Virtual shoe test system

. In order to solve the problem of uncomfortable wearing shoes caused by foot type or shoe type of consumers, a virtual shoe test system is developed based on computer graphics knowledge. If the online shoe test has problems, it can provide personal customization for consumers. Firstly, the shoe database is constructed to store shoe last model and key parts data for data comparison and fast data query. Secondly, the method based on OBB and AABB bounding box and plane fitting is proposed. Based on the foot bottom surface, combined with the foot shape law and foot skeleton composition of Chinese people, the automatic extraction of key data and the automatic matching of foot and shoe last are realized. Finally, the OpenGL function is realized in the MFC program, and the 3D visualization of shoes and boots is realized. The mouse control function is added to the system, which improves the human-computer interaction experience.


Introduction
With the rapid development of computer hardware, 3D point cloud [1] based on vision is more convenient to obtain, and virtual reality technology has been widely used. The technology combines computer graphics [2], man-machine interface [3] and other technologies, and has made breakthrough progress in the field of virtual apparel fitting [4], virtual shoe fitting [5].
In the field of virtual shoe testing, the purpose of shoe testing is mainly achieved through the registration of foot and shoe last point cloud model. Iterative Closest Point algorithm (ICP) [6][7] [8] is the most widely used rigid registration algorithm in the current point cloud model registration process. It mainly includes sampling the model data to obtain the corresponding points and coordinate transformation. Although the matching effect of this method is good, the data extraction is difficult, and the speed is slow when the amount of point cloud data is large, which cannot be applied to virtual shoes. In the existing virtual shoe testing system, foot last matching based on position dynamics [9] laid a solid foundation for shoe wearing comfort. However, the collision detection efficiency of shoe last model is low and the speed is slow. The method based on OBB and AABB bounding box calculation [10] amount of this method was small, but when the model foot wrist was long, the OBB bounding box was quite different from the ideal state. On this basis, the AABB bounding box obtained was meaningless and the matching effect was poor.
This paper constructs a new virtual shoe test system to realize online shoe test. A foot-shoe last matching method based on OBB bounding box and plane fitting is proposed. The method has less calculation and does not be affected when the wrist of the foot model was long, and the extraction data is simple. If there is a big difference in key parts at the end of matching, which affects the comfort of wearing, the manufacturer can improve the shoe last according to the user ' s foot data and provide personal customization.

Construction of virtual shoe test system
The virtual shoe test system module is shown in Figure 1:

System framework construction
In the process of system development, we should first establish the system framework, clarify the system module, and then realize the subdivision function under the framework, which can greatly improve the development efficiency. This shoe test system mainly includes three modules, database, foot model preprocessing and online shoe test. Database module is mainly responsible for shoe last model and shoe model data storage ; the foot model preprocessing module mainly carries on the preparation work before the test shoe, unifies the foot model and shoe last model space posture ; online shoe test module is used for customer online shoe test and data query and other interactive functions.
First, establish a database class for database module operation.

Data base
The database structure is shown in Figure 2:

Constructing database
This system relies on VS2013 platform and MySQL database to establish the connection between the platform and the database to realize the database function. Create a database named ' xiexuanku ' and 'xiexingku' in MySQL database, as shown in Figure 3. In the 'xiexuanku' database, create the ' xiedata ' table to store shoe last length, width, back height and wrist circumference, as shown in Figure 4; create the ' file ' table to store the shoe last filename corresponding to the shoe last code, as shown in Figure 5. Create a ' xiestyle ' table in the 'xiexingku' database to store the name of the shoe type file corresponding to the shoe last as shown in Figure 6.

Connect database
Connecting MySQL database in C + + project needs to be realized by calling specific function mysql _ real _ connect ( ). The name and password of the self-built shoe last database are introduced into the function as parameters, and the connection with the database is established. After the connection is successful, the database can be operated by MySQL command statement. Mysql_real_connect(&mysql,DataBase_Host,DataBase_UserName,DataBase_Passwor d, DataBase_Name, DataBase_Port, NULL, 0) // User name and password

Data input
The system needs to upload the user foot model to match. In order to make the system as simple as possible, the upload model file needs to be converted to obj format. The obj format file contains the point, surface and normal information of the model, it is simple and easy to read. Construct the 'foot' class in the system framework, the foot model data are read into the foot model, as shown in Figure 7.

Attitude control
Due to the different foot model postures uploaded by users, the next step cannot be directly processed. After the model data are read, the foot model posture is unified first. This system adopts the algorithm of combining obb directed bounding box with plane separation. Firstly, the OBB bounding box is calculated for the foot model data. The foot model point set is transformed into a matrix, and the covariance matrix of the matrix is obtained. The eigenvalues of the covariance matrix and the corresponding eigenvectors are obtained. The three eigenvectors are taken as the coordinate axis, and the maximum and minimum points of the model on the new coordinate axis are obtained. The OBB bounding box is obtained as shown in Figure 8. The feature vector corresponding to the maximum eigenvalue of the covariance matrix represents the main direction of the data point, namely the foot length direction of the model; in the middle section of the foot length direction, the foot model is partially intercepted according to the distance, and the eigenvector corresponding to the maximum eigenvalue of the covariance matrix is obtained, namely the foot width direction. The convex part of the forefoot was located at 68.8 % foot length, and the footprint width of the forefoot was wider than that of the heel, so as to determine the foot position and toe direction. The part of the foot is intercepted and the OBB bounding box is obtained. The part of the foot is divided into two parts through the bounding box, as shown in Figure 9. Extend the middle plane to separate the bottom of the foot and the back of the foot. By comparing the vertical distance between the heel and the middle of the bounding box, the bottom of the foot and the back of the foot are distinguished. The bottom of the foot is separated as shown in Figure 10. Through the least square fitting, the separated foot bottom surface points are approximately fitted to a plane, and the angle between the plane and the XOY plane is calculated. The plane and the XOY plane are overlapped by rotation. Combined with the foot length direction, the foot model posture is determined as shown in Figure 11.

Selection of key facts
The extraction of the key data of the foot model of this system is carried out after the model posture is unified. The foot bottom of the foot model coincides with the XOY plane, and the toe direction is parallel to the Y axis. In order to obtain accurate foot bottom two-dimensional data, based on the fitted foot bottom surface, the specified distance along the Z axis is taken to obtain the complete foot bottom data points as shown in Figure 12. The complete foot bottom data points are projected onto the XOY plane, and the two-dimensional plan of the foot bottom is obtained, and the alignment posture is controlled. The two-dimensional plan is shown in Figure 13, and the foot length and foot width data are obtained according to the two-dimensional plan. According to the human foot bone structure Figure 14, the os cuneiforme is the middle position of the foot back, and it is also located in the middle position of the foot in the foot long direction. Therefore, the position of os cuneiforme is taken as the height measurement point of the foot back, and the foot back height is measured based on the bottom of the foot. In the wearing of boots or high heels, the circumference of ankle is also an important factor affecting comfort. The height of the lower point of the medial malleolus of Chinese adults is about 70 mm. According to the foot pattern of adult males, females and children proposed in reference [11] , the height of the lateral malleolus is equal to 20.14 % of the foot length. Therefore, based on the bottom of the foot, within the same range of the foot model, the maximum external diameter is taken as the ankle joint as shown in Figure 15. The circumference of the ankle joint is calculated by the infinitesimal method on the cross-sectional curve of the ankle joint. The experimental foot model is a 1: 5 scaled down model, and the query results of data extraction are shown in Figure 16.

Automatic match
The automatic matching of the system is divided into two parts. Firstly, the foot length data is obtained by data extraction, and compared with the shoe last data in the database to obtain the shoe last code with the smallest data difference. According to the shoe last code, the corresponding shoe last model is read from the database to match.
In the matching process, the system automatically adjusts the spatial attitude of the foot model to obtain the foot surface of the model. Taking the center point of the two-dimensional foot surface of the model as the feature point, the foot model and the shoe last model are moved to the same position, so that the two models achieve spatial alignment. As shown in Figure 17, in order to facilitate observation, black represents the shoe last model and point represents the foot model. A shoe last model corresponds to multiple shoe types. After the spatial matching of the shoe last model is completed, different shoe models corresponding to the shoe last can be manually switched, as shown in Figure 18.

Man-machine interaction
The interaction of this system is based on the mfc module in vs2013, and the combination of mouse control and OpenGL display is realized in the mfc program.
In the mfc program, a fast data query window is added, as shown in Figure 19. Rewrite the menu function, as shown in Figure 20. In terms of display, the mouse control is combined with OpenGL display. Users can zoom in and zoom out the rotation of the model in real time through the mouse, and realize online shoe testing.
After the shoe test, if the foot and the shoe last model are quite different in key parts, which affects the wearing comfort and the user intends to purchase this shoe, the manufacturer can improve the shoe last according to the user's foot shape data and provide personal customization.

Superiority of virtual shoe test system
This virtual shoe test system relies on VS2013 platform, combines OpenGL open graphics library with MySQL database, and realizes virtual shoe test through foot last matching. This virtual shoe testing system has the following advantages: 1) Self-built MySQL database stores shoe last model data to facilitate user query 2) Based on the bottom of the foot, the data of the special parts of the foot model are obtained, and the comfort is dataized.
3) Custom mfc program interface, add mouse control to the model, improve the human-computer interaction experience 4) Provide individual customization options for consumers to maximize consumer demand.

Conclusion
In this virtual shoe test system, the MySQL shoe last database is first established for the comparison of key data of shoe last, providing data query interface for users and improving human-computer interaction experience. Secondly, combined with the foot shape law of Chinese, a virtual shoe test algorithm based on the combination of OBB bounding box and plane fitting is proposed, which realizes the extraction of key parts of foot model data and automatic matching of last. Finally, the visual three-dimensional shoe test is realized by combining MFC with OpenGL and mouse control. The shoe test system digitizes comfort, provides users with customized options, reduces the inventory pressure of enterprises, meets the subjective needs of consumers to the maximum extent, and achieves a win-win situation between enterprises and consumers.
According to the shape difference of soles, shoes can be divided into flat soles and high heels. The system currently supports the trial wear of flat soles, and the system will be improved later. The data extraction for high heels is added to provide the trial wear of high heels in the system and improve the test shoe system.