A method for identifying foot size based on computer vision

Through computer vision-based methods, combined with multiple threshold segmentation and perspective correction methods, the problems of environmental interference, equipment limitations and low accuracy in mobile phone photo measurement are solved, achieving efficient and accurate foot shape parameter acquisition, and supporting personalized shoe recommendations. and customization.

CN117115226BActive Publication Date: 2024-08-30SOUTHEAST INST OF INFORMATION TECH BEIJING UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311049171.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2024-08-30
Estimated Expiration
2043-08-21

AI Technical Summary

Technical Problem

The existing method of measuring foot size by taking pictures with mobile phones has environmental interference, equipment limitations, cumbersome operations, low accuracy and data security issues. It also fails to effectively consider height differences and arch heights, resulting in low measurement accuracy.

Method used

Using computer vision-based methods, by obtaining side views and top views, using multiple threshold segmentation methods and new perspective correction methods to segment and correct the A4 paper and foot contours, the foot length and arch height are calculated based on the shooting angle to achieve Accurate foot shape parameter acquisition.

Benefits of technology

It improves the accuracy of foot shape measurement in complex scenarios, simplifies the operation process, enhances data security, realizes efficient foot shape information acquisition, and supports personalized footwear recommendation and customization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115226B
    Figure CN117115226B
Patent Text Reader

Abstract

The present application provides a method for identifying foot size based on computer vision, and the method comprises: step 1, image acquisition: respectively acquiring a side view and a top view of a measured person's foot placed on a white paper; step 2, performing image scaling processing; step 3, using a multiple threshold segmentation method to respectively segment the A4 paper and the foot contour, then using a new perspective correction method to correct the A4 paper contour, and using a mask method to obtain a target foot area image; step 4, performing top view processing to obtain a maximum foot width: respectively segmenting the A4 paper and the foot contour, and using a simple correction method to correct the A4 paper contour, and after acquiring the target foot area image, determining the target parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart footwear technology, and in particular to a method for identifying foot shape and size based on computer vision. Background Art

[0002] Measuring foot size with a mobile phone is a method that uses the camera and gyroscope of a smartphone, combined with image processing or 3D reconstruction technology, to quickly, conveniently and accurately obtain foot shape data at home. This method can provide personalized shoe recommendations and customization services for the person being measured, and can also provide data support for shoe design and manufacturing. It does not require professional equipment, is simple and easy to use, efficient and fast, and has a relatively high accuracy.

[0003] However, due to the limitations of technological development, the method of measuring foot size by taking photos with a mobile phone also has the following challenges: environmental interference: users usually need to measure in a well-lit, non-reflective, and clutter-free environment; equipment limitations: users need to use a smartphone with a high-definition camera and gyroscope, as well as A4 paper and an ID card as a reference; cumbersome operation: users need to shoot from a specific angle; measurement accuracy: most of the current methods and systems based on mobile phone photography to identify foot size cannot achieve an accuracy of within 5 mm in most complex scenarios; slow algorithm speed: general methods require up to 5 minutes of recovery time; data security: users upload their foot data to the cloud, which may pose a risk of data leakage or abuse.

[0004] At present, the feasible solution for foot shape recognition based on mobile phone photography is mainly 2D imaging calculation of camera + gyroscope. This method has also been developed in many aspects and is also reflected in many patents. However, these methods still have certain problems. For example, the application number of a method for extracting and measuring key parts of human feet based on images is: 201310731335.6. The main problems are: 1. During the geometric correction process, the problem caused by height difference is not considered; 2. Although the foot length, foot width and foot surface height are automatically measured, the arch height is not considered, and the foot width position is considered less;

[0005] A method for measuring foot shape by taking photos with a mobile phone, application number 201610370311.6, has the following problems: 1. In the process of image acquisition, using a block as a reference object cannot meet the needs of online customization by customers and has no practical application value; 2. There is no correction, only the tilt angle of the mobile phone is required; 3. There is no automatic calculation, which is not conducive to large-scale application; 1. Geometric correction does not consider the problems caused by height difference; 2. Although the foot length and width are automatically measured, the arch height is not considered, and the foot width position is considered less;

[0006] A method for measuring foot size based on mobile phone photography, application number 201811296595.4 (authorized). The problems in this patent include: 1. During image acquisition, when obtaining side information, the heel must be in the middle of the image, which has limitations; 2. During geometric correction, the heel must be in the middle of the image to eliminate errors when shooting, which is difficult to operate; 3. Automatically identify the heel and toe, measure the foot length, and do not consider the foot width and arch height.

[0007] A shoe size information detection method and device, application number 201510084720.5, has the following problems: 1. Image acquisition, only shooting from a bird's-eye view; 2. Geometric correction, without considering the difference caused by height difference; 3. Automatic calculation of the widest width and length of the foot, without considering the arch height.

[0008] In summary, existing technologies have not considered the impact of height differences in geometric correction and have ignored the height of the arch of the foot, resulting in low accuracy in measuring foot size using mobile phone cameras. Summary of the invention

[0009] The present application provides a method for identifying foot shape and size based on computer vision, which can be used to solve the technical problem of low accuracy in measuring foot size by taking photos with a mobile phone.

[0010] The present application provides a method for identifying foot size based on computer vision, the method comprising:

[0011] Step 1, image acquisition: obtain a side view and a top view of the measured person's foot placed on a white paper;

[0012] Step 2, perform image scaling processing;

[0013] Step 3: Use the multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, then use the new perspective correction method to correct the A4 paper contour, and use the mask method to obtain the target foot area image;

[0014] Step 4, perform top view processing to obtain the maximum foot width: segment the A4 paper and the foot contour respectively, correct the A4 paper contour using a simple correction method, obtain the target foot area image, and then determine the target parameters.

[0015] Optionally, step 1, image acquisition: obtaining a side view and a top view of the measured person's foot placed on a white paper, including:

[0016] When shooting the side view, the long side of the mobile phone is aligned with the long side of the A4 paper, and the phone panel is at 60-90 degrees to the horizontal plane.

[0017] Place a standard A4 paper on the ground, making sure the short side of the A4 paper faces the person being measured.

[0018] The person being measured wears dark socks, places his left foot on the A4 paper, and makes sure that the direction of the foot is basically parallel to the long side of the A4 paper. Place the phone horizontally, and make sure that the long side of the phone is consistent with the long side of the A4 paper. Take a picture of the foot from the right side, and the phone panel should be between 60-90 degrees to the horizontal plane, which is recorded as gamma. Adjust the position of the phone to ensure that all four vertices of the A4 paper are in the picture.

[0019] The person being measured moves the phone to just above the sole of the foot, with the long side of the phone aligned with the long side of the A4 paper, adjusts the phone panel to be parallel to the horizontal plane, and adjusts the position of the phone to ensure that the two vertices of the A4 paper close to the toes are in the picture.

[0020] Optionally, step 2, image scaling processing, includes:

[0021] Take the tolerance factor as 3, the length of A4 paper is 297 mm, and the width is 210 mm. Assuming that the ratio of the length and width of A4 paper in each shot is about 3 / 5, the pixels of A4 paper in the length direction of the image are at least:

[0022]

[0023]

[0024] The size of the picture taken by the camera is recorded as L src and W src , scale them both to the minimum pixel requirements of formulas 1 and 2, and determine their respective magnifications:

[0025]

[0026] The larger magnification ratio is taken as the unified magnification ratio of the length and width of the original image, so the image size after scaling is expressed as:

[0027] L img =αL src (4)

[0028] W img =αW src (5)

[0029] According to formula 3-5, the side view and top view taken in step 1 are scaled to appropriate sizes.

[0030] Optionally, in step 3, a multiple threshold segmentation method is used to segment the A4 paper and the foot contour respectively, and then a new perspective correction method is used to correct the A4 paper contour, and a mask method is used to obtain the target foot area image, including:

[0031] Step 31, A4 paper key points acquisition:

[0032] Step 32, foot area acquisition:

[0033] Step 33, determine foot type parameters.

[0034] Optionally, step 31, obtaining key points of A4 paper, includes:

[0035] Step 311, blur processing and first threshold segmentation: use Gaussian blur to achieve preliminary noise reduction to avoid abnormal noise points affecting the segmentation result; use threshold segmentation method to perform the first segmentation on the side view image in step 2, and set the threshold to 150;

[0036] Step 312, contour extraction and preliminary acquisition of key vertices: perform contour search, traverse the obtained contour points, and use the largest contour in the search result as the contour point of the A4 paper; according to formula 6, calculate the distances between all points and the four vertices of the image respectively, and the points with the smallest distances to the four vertices are recorded as the four vertices of the A4 paper: Get the obtained vertices:

[0037]

[0038] Step 313, new perspective correction method for A4 paper outline: Use the perspective correction method to correct the A4 paper into a trapezoid, that is, the two upper vertices are at the same height, and the two lower vertices are at the same height:

[0039] The original four-point coordinates are Points_old = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y), (RD_point_x, RD_point_y), (LD_point_x, LD_point_y)]

[0040] The order is top left, top right, bottom right, bottom left

[0041] The corrected coordinates of the target calibration are Points_new = [(LT_point_x, LT_point_y), (RT_point_x, LT_point_y), (RD_point_x, LD_point_y), (LD_point_x, LD_point_y)]

[0042] The upper and lower base positions of the target trapezoid are based on the upper left vertex and the lower left vertex.

[0043] Determine the perspective transformation matrix:

[0044] M trans=getPerspectiveTransform(Points_old,Points_new) (7)

[0045] After obtaining the correction matrix, the image angle is transformed.

[0046] Optionally, step 32, obtaining the foot region, includes:

[0047] Segmentation using the second threshold: The side view image processed in step 31 is segmented for the second time using the threshold segmentation method, and the threshold is set to 80;

[0048] According to step 31, the key points of the A4 paper are obtained and connected once to form a mask, and the second threshold segmentation image is extracted by the mask, and the area outside the mask is uniformly replaced by a value of 255, i.e., white;

[0049] Perform an inverse transformation and use contour extraction to obtain the largest contour, which is the foot contour, and determine its minimum circumscribed rectangle. The coordinates of the two vertices below the rectangle are recorded as Points_rect = [(Foot_LD_x, Foot_LD_y), (Foot_RD_x, Foot_RD_y)].

[0050] Optionally, step 33, determining foot type parameters, includes:

[0051] Step 331, determine the length of the foot:

[0052] The number of pixels occupied by the length of the foot in the figure is obtained by subtracting the horizontal coordinates of the two vertices on the left and right below the circumscribed rectangle of the foot, that is,

[0053] Pixel_foot=Points_rect[1][0]-Points_rect[1][0] (8)

[0054] The actual length and width of A4 paper are: L_A4 and W_A4 respectively.

[0055] The difference between the upper and lower vertices on the left and right sides of the A4 paper is the number of pixels in the length direction of the A4 paper. By proportional conversion, the foot position, i.e. the bottom edge position of the rectangle, is measured. The actual distance represented by each pixel is:

[0056] Number of pixels on the top and bottom of A4 paper trapezoidal projection:

[0057] Pixel_T=Points_new[1][0] - Points_new[0][0] (9)

[0058] A4 paper trapezoidal projection bottom pixel count:

[0059] Pixel_D=Points_new[2][0] - Points_new[3][0] (10)

[0060] A4 paper trapezoidal projection height pixels:

[0061] Pixel_TD=Points_new[3][1] - Points_new[0][1] (11)

[0062] Number of pixels from the bottom of the circumscribed rectangle of the sole to the bottom of the A4 paper trapezoidal projection:

[0063] Pixel_H=Points_new[3][1] - Points_rect[0][1] (12)

[0064] Number of pixels occupied by the foot in the length direction of A4 paper:

[0065] Pixel_JD=Pixel_T+(Pixel_D-Pixel_T) / Pixel_TD*(Pixel_TD-Pixel_H) (13)

[0066] The actual length of the foot position per pixel is:

[0067] w= L_A4 / Pixel_JD (14)

[0068] Using the additional shooting angle as the hyperparameter gamma, the foot length is corrected:

[0069]

[0070] Step 332, determine the height of the arch of the foot:

[0071] Based on the double threshold segmentation result and the contour circumscribed rectangle, the lowest point of the heel, which is 20% of the foot length from the heel, is taken as the starting point, and the first metatarsal, which is 69.5% of the foot length from the heel, is taken as the end point. The scan is performed from bottom to top. When the first 0 value is scanned, the coordinates are recorded, the longitudinal scan is exited, and the scan is continued to the right. Finally, the point with the smallest longitudinal coordinate is the highest point of the arch, and the coordinates are marked as (ZG_x, ZG_y).

[0072] The actual distance represented by each pixel in the longitudinal direction is calculated based on formula 16:

[0073] h= W_A4 / Pixel_TD (16)

[0074] Due to the influence of shooting angle, angle compensation is introduced when calculating the arch height:

[0075]

[0076] The final position of the highest point of the arch of the foot.

[0077] Optionally, step 4, performing top view processing to obtain the maximum foot width includes:

[0078] The A4 paper and foot contours are segmented respectively, and the A4 paper contour is corrected using a simple correction method. After obtaining the target foot area image, the target parameters are determined.

[0079] Step 41, obtain the key points of A4 paper:

[0080] The key points of the A4 paper in the top view are mainly the two vertices above the A4 paper. The main steps are as follows:

[0081] Step 411, blur processing and first threshold segmentation: use Gaussian blur to achieve preliminary noise reduction, use threshold segmentation method to perform the first segmentation on the side view image in step 2, and set the threshold to 150;

[0082] Step 412, contour extraction and preliminary acquisition of key vertices: perform contour search, and the largest contour in the search result is the contour point of the A4 paper; traverse the obtained contour points, and calculate the distances between all points and the two vertices above the image according to calculation formula 6, and the points with the smallest distance are recorded as the two upper vertices of the A4 paper; according to the coordinates of the two top vertices, make the short side of the A4 paper horizontal by simple rotation; the two upper vertices are recorded as Points_top = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y)]

[0083] Step 42, obtain the foot area:

[0084] Second threshold segmentation: Use the threshold segmentation method to perform a second segmentation on the top view image processed in step 42, and set the threshold to 80;

[0085] Step 43, determine foot type parameters:

[0086] Take the vertical coordinates of the two upper vertices of the A4 paper as the starting point and the horizontal coordinates of the two upper vertices as the boundary, and use the result of the second threshold segmentation to scan from top to bottom and from left to right. When the first 0 value is scanned, it is the position of the toe, recorded as (ZJ_x, ZJ_y)

[0087] Determine the actual distance represented by each pixel in the top view:

[0088] w_h= W_A4 / (Points_top[1][0]-Points_top[0][0]) (18)

[0089] The maximum width of the foot is the length of the connecting line between the first metatarsal and the fifth metatarsal. In addition, the first metatarsal is 30.5% of the foot length from the toe, and the fifth metatarsal is 37.5% of the foot length from the toe.

[0090] The reference ordinates of the first metatarsal and the fifth metatarsal are obtained as follows:

[0091] ZG1_ref= Points_top[1][1]-L_foot*0.305 / w_h (19)

[0092] ZG5_ref= Points_top[1][1]-L_foot*0.305 / w_h (20)

[0093] Take the first metatarsal reference point 20 pixels above and below as the boundary, take the upper right corner of the A4 paper as the starting point, and scan from right to left and from top to bottom. When the first 0 value is scanned, it is the first position, recorded as (ZG1_x, ZG1_y);

[0094] Take the 20 pixels above and below the fifth metatarsal reference point as the boundary, take the upper left corner of the A4 paper as the starting point, and scan from left to right and from top to bottom. When the first 0 value is scanned, it is the fifth position, recorded as (ZG5_x, ZG5_y);

[0095]

[0096] The advantages of the final calculated maximum foot width position of this application are as follows:

[0097] 1. Use multiple threshold mask segmentation method:

[0098] An innovative method of multiple threshold filtering combined with masking is used to correctly obtain the reference A4 paper and foot contour information in complex scenes, solving the problem that existing algorithms cannot correctly calculate foot shape information when the background of the picture is complex.

[0099] 2. New perspective correction method:

[0100] We innovatively proposed a new perspective correction method for side-view images. Compared with the traditional method of directly restoring A4 paper to a rectangle, we only restore it to an ordinary trapezoid, avoiding the influence of the thickness of the footboard and the problem of huge distortion caused by it.

[0101] 3. Calculation method of arch height and foot length based on angle correction:

[0102] The side shooting angle is innovatively introduced into the calculation of arch height and foot length compensation, which makes it possible to obtain arch height with a single image and provide calculation accuracy of foot length. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] Figure 1 A side view of the shooting provided by the embodiment of the present application;

[0104] Figure 2 A top view provided for an embodiment of the present application;

[0105] Figure 3 A side view fuzzy processing and first threshold segmentation result diagram provided in an embodiment of the present application;

[0106] Figure 4 A preliminary acquisition diagram of key vertices on A4 paper of the side view provided in the embodiment of the present application;

[0107] Figure 5 A4 paper key point diagram after new perspective correction provided in the embodiment of the present application;

[0108] Figure 6 A double threshold segmentation result diagram provided in an embodiment of the present application;

[0109] Figure 7 A diagram of the foot region extraction result provided in an embodiment of the present application;

[0110] Figure 8 A diagram showing the highest point of the arch of the foot provided in an embodiment of the present application;

[0111] Fig. 9 A top view fuzzy processing and first threshold segmentation result diagram provided in an embodiment of the present application;

[0112] Fig.10 A4 paper key point diagram after simple correction provided in the embodiment of the present application;

[0113] Fig.11 A second threshold segmentation result diagram of a top view provided in an embodiment of the present application;

[0114] Fig.12 Provide a maximum foot width position for the embodiment of the present application;

[0115] Fig.13 A flow chart of the method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0116] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0117] The method provided in this application includes:

[0118] Step 1, image acquisition: obtain a side view and a top view of the measured person's foot placed on a white paper;

[0119] When shooting the side view, the long side of the mobile phone is aligned with the long side of the A4 paper, and the phone panel is at 60-90 degrees to the horizontal plane.

[0120] Place a standard A4 paper on the ground, making sure the short side of the A4 paper faces the person being measured.

[0121] The person being measured wears dark socks and places his left foot on the A4 paper, making sure that the direction of the foot is basically parallel to the long side of the A4 paper. Place the phone horizontally, making sure that the long side of the phone is consistent with the long side of the A4 paper. Photograph the foot from the right side, with the phone panel at 60-90 degrees to the horizontal plane, recorded as gamma (when the angle meets the requirements, the camera button is unlocked). Adjust the position of the phone, making sure that all four vertices of the A4 paper are in the picture, press the camera button, and obtain a side view (select the most complex picture possible for demonstration).

[0122] The person being measured moves the phone to just above the instep, with the long side of the phone aligned with that of the A4 paper, adjusts the phone panel to be parallel to the horizontal plane (the angle is controlled within ±3 degrees, and the camera button is unlocked when the angle is met), adjusts the position of the phone to ensure that the two vertices of the A4 paper close to the toes are in the picture, and presses the camera button to obtain a top view.

[0123] Step 2: Image scaling:

[0124] It is known that the size difference of shoe sizes in the European standard is 5 mm. In order to achieve customized comfort and accuracy, the target accuracy of the present invention is 1 mm. The tolerance coefficient is usually 3-5. Considering the trade-off between calculation accuracy and calculation cost, the tolerance coefficient of this application is 3. Therefore, the pixel accuracy of the image needs to be controlled at more than 3 times, that is, 1 mm is equivalent to 3 pixels in the image. It is known that the length of A4 paper is 297 mm and the width is 210 mm. Since A4 paper cannot occupy the entire field of view in the image, it is assumed that the ratio of A4 paper in the length and width direction in each shot is about 3 / 5, so the pixels of A4 paper in the length direction in the image are at least:

[0125]

[0126]

[0127] The size of the picture taken by the camera is recorded as L src and W src , scale them both to the minimum pixel requirements of formulas 1 and 2, and determine their respective magnifications:

[0128]

[0129] The larger magnification ratio is taken as the unified magnification ratio of the length and width of the original image, so the image size after scaling is expressed as:

[0130] L img =αL src (4)

[0131] W img =αW src (5)

[0132] According to formula 3-5, the side view and top view taken in step 1 are scaled to appropriate sizes to minimize the calculation cost while meeting the accuracy requirements.

[0133] Step 3: Use the multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, then use the new perspective correction method to correct the A4 paper contour, and use the mask method to obtain the target foot area image:

[0134] Due to the complex background and various light and shadow influences, it is often difficult to segment the foot contour and the A4 paper contour at the same time in a single segmentation. For this reason, this application uses a multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, and then uses a new perspective correction method to correct the A4 paper contour, and then uses the mask method to obtain the target's foot area image, and further calculate the target parameters.

[0135] Step 31, A4 paper key points acquisition:

[0136] The key points of the A4 paper in the side view are mainly the four vertices of the A4 paper. The main steps are as follows:

[0137] Step 311, blur processing and first threshold segmentation: Use Gaussian blur to achieve preliminary noise reduction to avoid abnormal noise points affecting the segmentation results; use the threshold segmentation method to perform the first segmentation of the side view image in step 2. According to the experience of multiple experiments, the threshold is set to 150 to obtain the best effect; (Note: Compare Figure 1 and Figure 3 It can be found that the threshold segmentation algorithm is easily disturbed by the shadow of the foot, which is also a serious drawback of the previous invention patent and the reason why this application uses multiple threshold segmentation)

[0138] Step 312: contour extraction and preliminary acquisition of key vertices: Figure 3 It can be seen that the segmentation results are rather confusing, so further extraction is needed. Figure 3Perform contour search, traverse the obtained contour points, and use the largest contour in the search result as the contour point of the A4 paper; according to formula 6, calculate the distance between all points and the four vertices of the image respectively, and the point with the smallest distance to the four vertices is recorded as the four vertices of the A4 paper: The obtained vertices are as follows: Figure 4 As shown:

[0139]

[0140] Step 313, new perspective correction method for A4 paper outline: The traditional perspective correction method directly restores the A4 paper to a rectangular shape. Affected by the thickness of the script, this operation will cause serious deformation and distortion of the foot shape. For this reason, this application uses the perspective correction method to correct the A4 paper into a trapezoid, that is, the two vertices at the top are at the same height, and the two vertices at the bottom are at the same height:

[0141] The original four-point coordinates are Points_old = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y), (RD_point_x, RD_point_y), (LD_point_x, LD_point_y)]

[0142] The order is top left, top right, bottom right, bottom left

[0143] The corrected coordinates of the target calibration are Points_new = [(LT_point_x, LT_point_y), (RT_point_x, LT_point_y), (RD_point_x, LD_point_y), (LD_point_x, LD_point_y)]

[0144] The upper and lower base positions of the target trapezoid are based on the upper left vertex and the lower left vertex.

[0145] Determine the perspective transformation matrix:

[0146] M trans =getPerspectiveTransform(Points_old,Points_new) (7)

[0147] After obtaining the correction matrix, use the warpPerspective function of the opencv tool to transform the image angle. The transformed image is as follows Figure 5 As shown:

[0148] Step 32, foot area acquisition:

[0149] Segmentation using the second threshold: The side view image processed in step 31 is segmented using the threshold segmentation method. According to the experience of multiple experiments, the threshold is set to 80 to obtain the best effect, which can remove the influence of the foot shadow.

[0150] According to step 31, the key points of the A4 paper are obtained and connected to form a mask. The mask is used to extract the image segmented by the second threshold. The area outside the mask is uniformly replaced with a value of 255, i.e., white. Figure 6 As shown:

[0151] Perform an inverse transformation, use contour extraction to obtain the largest contour, which is the foot contour, and determine its minimum circumscribed rectangle, such as Figure 7 As shown, the coordinates of the two vertices below the rectangle are recorded as Points_rect = [(Foot_LD_x, Foot_LD_y), (Foot_RD_x, Foot_RD_y)]

[0152] Step 33: Determine foot type parameters

[0153] Step 331, determine the length of the foot:

[0154] The number of pixels occupied by the length of the foot in the figure is obtained by subtracting the horizontal coordinates of the two vertices on the left and right below the circumscribed rectangle of the foot, that is,

[0155] Pixel_foot=Points_rect[1][0]-Points_rect[1][0] (8)

[0156] The actual length and width of A4 paper are: L_A4 and W_A4 respectively.

[0157] The difference between the upper and lower vertices on the left and right sides of the A4 paper is the number of pixels in the length direction of the A4 paper. By proportional conversion, the foot position, i.e. the bottom edge position of the rectangle, is measured. The actual distance represented by each pixel is:

[0158] Number of pixels on the top and bottom of A4 paper trapezoidal projection:

[0159] Pixel_T=Points_new[1][0]-Points_new[0][0] (9)

[0160] A4 paper trapezoidal projection bottom pixel count:

[0161] Pixel_D=Points_new[2][0]-Points_new[3][0] (10)

[0162] A4 paper trapezoidal projection height pixels:

[0163] Pixel_TD=Points_new[3][1]-Points_new[0][1] (11)

[0164] Number of pixels from the bottom of the circumscribed rectangle of the sole to the bottom of the A4 paper trapezoidal projection:

[0165] Pixel_H=Points_new[3][1]-Points_rect[0][1] (12)

[0166] Number of pixels occupied by the foot in the length direction of A4 paper:

[0167] Pixel_JD=Pixel_T+(Pixel_D-Pixel_T) / Pixel_TD*(Pixel_TD-Pixel_H) (13)

[0168] The actual length of the foot position per pixel is:

[0169] w= L_A4 / Pixel_JD (14)

[0170] In fact, the side view only captures the side profile of the left big toe, and the longest distance of the foot is often from the index finger to the back heel, not from the big toe to the back heel. When shooting at an angle, the longest position of the foot is often a little higher than the bottom of the circumscribed rectangle. Therefore, when calculating the length of the foot, this application uses the additional shooting angle as a hyperparameter gamma to correct the foot length:

[0171]

[0172] Step 332, determine the height of the arch of the foot:

[0173] The calculation of the arch is based on Figure 6 The double threshold segmentation result and the outline circumscribed rectangle are obtained. The lowest point of the heel, which is 20% of the foot length away from the heel, is taken as the starting point, and the first metatarsal, which is 69.5% of the foot length away from the heel, is taken as the end point. The scan is performed from bottom to top. When the first 0 value is scanned, the coordinates are recorded, the longitudinal scan is exited, and the scan is continued to the right. Finally, the point with the smallest longitudinal coordinate is the position of the highest point of the arch, and the coordinates are marked as (ZG_x, ZG_y).

[0174] The actual distance represented by each pixel in the longitudinal direction is calculated based on formula 16:

[0175] h= W_A4 / Pixel_TD (16)

[0176] Due to the influence of shooting angle, angle compensation is introduced when calculating the arch height:

[0177]

[0178] The final highest point of the arch is as follows Figure 8 shown.

[0179] Step 4: Process the top view to obtain the maximum foot width:

[0180] Due to the complex background and various light and shadow effects, it is often difficult to segment the foot contour and the A4 paper contour at the same time in a single segmentation. For this reason, the present invention uses a multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, and corrects the A4 paper contour using a simple correction method. After obtaining the target foot area image, the target parameters are determined:

[0181] Step 41, obtain the key points of A4 paper:

[0182] The key points of the A4 paper in the top view are mainly the two vertices above the A4 paper. The main steps are as follows:

[0183] Step 411, blur processing and first threshold segmentation: Gaussian blur is used to achieve preliminary noise reduction to avoid the influence of abnormal noise points on the segmentation results; the side view image of step 2 is segmented by the threshold segmentation method. According to the experience of multiple experiments, the threshold is set to 150 to obtain the best effect;

[0184] Step 412, contour extraction and preliminary acquisition of key vertices: Fig. 9 It can be seen that the segmentation results are rather confusing, so further extraction is needed. Fig. 9 Perform contour search. The largest contour in the search result is the contour point of the A4 paper. Traverse the obtained contour points and calculate the distance between all points and the two vertices above the image according to calculation formula 6 (the two vertices below are easily blocked, so they are abandoned). The points with the smallest distance are recorded as the two upper vertices of the A4 paper. According to the coordinates of the two top vertices, make the short side of the A4 paper horizontal by simple rotation (shoot horizontally when shooting, generally there is no error). The two upper vertices are recorded as Points_top = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y)]

[0185] Step 42, obtain the foot area:

[0186] Second threshold segmentation: The top-view image processed in step 42 is segmented for the second time using the threshold segmentation method. According to the experience of multiple experiments, the threshold is set to 80 to obtain the best effect, which can remove the influence of the foot shadow;

[0187] Step 43, determine foot type parameters:

[0188] Take the vertical coordinates of the two upper vertices of the A4 paper as the starting point and the horizontal coordinates of the two upper vertices as the boundary, and use the result of the second threshold segmentation to scan from top to bottom and from left to right. When the first 0 value is scanned, it is the position of the toe, recorded as (ZJ_x, ZJ_y)

[0189] Determine the actual distance represented by each pixel in the top view:

[0190] w_h= W_A4 / (Points_top[1][0]-Points_top[0][0]) (18)

[0191] The maximum width of the foot is the length of the connecting line between the first metatarsal and the fifth metatarsal. In addition, the first metatarsal is generally located at 30.5% of the foot length from the toes, and the fifth metatarsal is generally located at 37.5% of the foot length from the toes.

[0192] The reference ordinates of the first metatarsal and the fifth metatarsal are obtained as follows:

[0193] ZG1_ref= Points_top[1][1]-L_foot*0.305 / w_h (19)

[0194] ZG5_ref= Points_top[1][1]-L_foot*0.305 / w_h (20)

[0195] Take the first metatarsal reference point 20 pixels above and below as the boundary, take the upper right corner of the A4 paper as the starting point, and scan from right to left and from top to bottom. When the first 0 value is scanned, it is the first position, recorded as (ZG1_x, ZG1_y);

[0196] Take the 20 pixels above and below the fifth metatarsal reference point as the boundary, take the upper left corner of the A4 paper as the starting point, and scan from left to right and from top to bottom. When the first 0 value is scanned, it is the fifth position, recorded as (ZG5_x, ZG5_y);

[0197]

[0198] The final calculated maximum foot width position is as follows Fig.12 shown.

[0199] The present application is described in detail below in conjunction with specific embodiments:

[0200] Prepare a standard A4 paper and place it on a clean floor. The consumer sits on a chair next to the A4 paper, making sure the short edge of the A4 paper faces him or herself.

[0201] The consumer wears dark socks and places his left foot on the A4 paper, making sure that the direction of the foot is basically parallel to the long side of the A4 paper. Place the mobile phone horizontally, making sure that the long side of the mobile phone is consistent with the long side of the A4 paper, and shoot from the right side towards the foot, with the mobile phone panel at 60-90 degrees to the horizontal plane (when the angle is met, the camera button is unlocked). Adjust the position of the mobile phone, making sure that the four vertices of the A4 paper are in the picture, and press the camera button to get a side view.

[0202] The consumer moves the phone to just above the top of the foot, with the long side of the phone aligned with the long side of the A4 paper, adjusts the phone panel to be parallel to the horizontal plane (the angle is controlled within ±3 degrees, and the camera button is unlocked when the angle is met), adjusts the position of the phone, ensures that the two vertices of the A4 paper close to the toes are in the picture, and presses the camera button to get a top view.

[0203] It is up to the consumer to choose whether to enter the shoe size they usually wear (not a required option, only used for result comparison. If the error exceeds 3 mm, it will be considered an invalid calculation and the consumer will be prompted to retake the photo).

[0204] Based on the input side view and top view, the foot length, maximum foot width, arch height and other data are automatically calculated. When the result is presented to the consumer, the user can be further guided to enter the shoe selection interface as needed. All data is finally integrated and transmitted to the manufacturer to complete the personalized production and customization of the shoe.

[0205] This application has the following advantages:

[0206] 1. The use of multiple threshold mask segmentation method can effectively solve the problem of target area extraction in most complex background situations. It can greatly reduce the time consumers spend on pre-preparation and is more user-friendly. At the same time, more accurate area segmentation also provides a strong guarantee for the extraction of data information.

[0207] 2. For the side view, we use a new perspective correction method. Compared with the previous method of restoring A4 paper to a rectangle, we only restore it to an ordinary trapezoid. This approach can effectively avoid the influence of the thickness of the footboard and make the calculation more accurate.

[0208] 3. Using the arch height and foot length calculation method based on angle correction, the side shooting angle is introduced into the calculation of arch height and foot length compensation operation, which realizes the acquisition of arch height in a single image and provides the calculation accuracy of foot length.

[0209] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the service construction device and service loading device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

[0210] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.

Claims

1. A method for identifying foot size based on computer vision, characterized in that: The method comprises: Step 1, image acquisition: obtain a side view and a top view of the measured person's foot placed on a white paper; Step 2, perform image scaling processing; Step 3: Use the multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, then use the new perspective correction method to correct the A4 paper contour, and use the mask method to obtain the target foot area image; Step 4, perform top view processing to obtain the maximum foot width: segment the A4 paper and the foot contour respectively, correct the A4 paper contour using a simple correction method, obtain the target foot area image, and then determine the target parameters; Among them, step 3 uses a multiple threshold segmentation method to segment the A4 paper and the foot contour respectively, then uses a new perspective correction method to correct the A4 paper contour, and uses a mask method to obtain the target foot area image, including: Step 31, obtaining key points of A4 paper; Step 32, foot area acquisition; Step 33, determining foot type parameters; Step 31, obtaining key points of A4 paper, including: Step 311, blur processing and first threshold segmentation: use Gaussian blur to achieve preliminary noise reduction to avoid abnormal noise points affecting the segmentation result; use threshold segmentation method to perform the first segmentation on the side view image in step 2, and set the threshold to 150; Step 312, contour extraction and preliminary acquisition of key vertices: perform contour search, traverse the obtained contour points, and use the largest contour in the search result as the contour point of the A4 paper; according to formula 6, calculate the distances of all points and the four vertices of the image respectively, and the points with the smallest distances to the four vertices are recorded as the four vertices of the A4 paper, and the obtained vertices are obtained: Step 313, new perspective correction method for A4 paper outline: Use the perspective correction method to correct the A4 paper into a trapezoid, that is, the two upper vertices are at the same height, and the two lower vertices are at the same height: The original four-point coordinates are Points_old = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y), (RD_point_x, RD_point_y), (LD_point_x, LD_point_y)] Among them, the order is upper left, upper right, lower right, lower left; The corrected coordinates of the target are Points_new = [(LT_point_x, LT_point_y), (RT_point_x, LT_point_y), (RD_point_x, LD_point_y), (LD_point_x, LD_point_y)] The upper and lower base positions of the target trapezoid are based on the upper left vertex and the lower left vertex. Determine the perspective transformation matrix: M trans =getPerspectiveTransform(Points_old,Points_new) (7) After obtaining the correction matrix, the image angle is transformed; Step 32, obtaining the foot region, includes: Segmentation using the second threshold: The side view image processed in step 31 is segmented for the second time using the threshold segmentation method, and the threshold is set to 80; According to step 31, the key points of the A4 paper are obtained and connected once to form a mask, and the second threshold segmentation image is extracted by the mask, and the area outside the mask is uniformly replaced by a value of 255, i.e., white; Perform an inverse transformation, use contour extraction to obtain the largest contour, which is the foot contour, and determine its minimum circumscribed rectangle. The coordinates of the two vertices below the rectangle are recorded as Points_rect = [(Foot_LD_x, Foot_LD_y), (Foot_RD_x, Foot_RD_y)]; Step 33, determining foot type parameters, includes: Step 331, determine the length of the foot: The number of pixels occupied by the length of the foot in the figure is obtained by subtracting the horizontal coordinates of the two vertices on the left and right below the circumscribed rectangle of the foot, that is, Pixel_foot=Points_rect[1][0]-Points_rect[1][0] (8) The actual length and width of A4 paper are: L_A4 and W_A4 respectively. The difference between the upper and lower vertices on the left and right sides of the A4 paper is the number of pixels in the length direction of the A4 paper. By proportional conversion, the foot position, i.e. the bottom edge position of the rectangle, is measured. The actual distance represented by each pixel is: A4 paper trapezoidal projection upper and lower pixel count: Pixel_T=Points_new[1][0]-Points_new[0][0](9) A4 paper trapezoidal projection bottom pixel count: Pixel_D=Points_new[2][0]-Points_new[3][0](10) A4 paper trapezoidal projection height pixels: Pixel_TD=Points_new[3][1]-Points_new[0][1](11) Number of pixels from the bottom of the circumscribed rectangle of the sole to the bottom of the A4 paper trapezoidal projection: Pixel_H=Points_new[3][1]-Points_rect[0][1](12) Number of pixels occupied by the foot in the length direction of A4 paper: Pixel_JD=Pixel_T+(Pixel_D-Pixel_T) / Pixel_TD*(Pixel_TD-Pixel_H)(13) The actual length of the foot position per pixel is: w=L_A4 / Pixel_JD(14) Using the additional shooting angle as the hyperparameter gamma, the foot length is corrected: Step 332, determine the height of the arch of the foot: Based on the double threshold segmentation result and the contour circumscribed rectangle, the lowest point of the heel, which is 20% of the foot length from the heel, is taken as the starting point, and the first metatarsal, which is 69.5% of the foot length from the heel, is taken as the end point. The scan is performed from bottom to top. When the first 0 value is scanned, the coordinates are recorded, the current longitudinal scan is exited, and the scan continues to the right. Finally, the point with the smallest longitudinal coordinate is the position of the highest point of the arch, and the coordinates are marked as (ZG_x, ZG_y). The actual distance represented by each pixel in the longitudinal direction is calculated based on formula 16: h=W_A4 / Pixel_TD (16) Due to the influence of shooting angle, angle compensation is introduced when calculating the arch height: The final position of the highest point of the arch of the foot.

2. The method according to claim 1, characterized in that Step 1, image acquisition: obtain the side view and top view of the measured person's feet placed on white paper. include: When shooting the side view, the long side of the mobile phone is aligned with the long side of the A4 paper, and the phone panel is between 60-90 degrees to the horizontal plane. Place a standard A4 paper on the ground, making sure the short side of the A4 paper faces the person being measured; The person being measured wears dark socks, places his left foot on the A4 paper, and makes sure that the direction of the foot is basically parallel to the long side of the A4 paper. Place the phone horizontally, and make sure that the long side of the phone is consistent with the long side of the A4 paper. Take a picture of the foot from the right side, and the phone panel should be between 60-90 degrees to the horizontal plane, which is recorded as gamma. Adjust the position of the phone to ensure that all four vertices of the A4 paper are in the picture. The person being measured moves the phone to just above the sole of the foot, with the long side of the phone aligned with the long side of the A4 paper, adjusts the phone panel to be parallel to the horizontal plane, and adjusts the position of the phone to ensure that the two vertices of the A4 paper close to the toes are in the picture.

3. The method according to claim 2, characterized in that: Step 2, image scaling processing, including: Take the tolerance factor as 3, the length of A4 paper is 297 mm, and the width is 210 mm. Assuming that the ratio of the length and width of A4 paper in each shot is 3 / 5, the pixels of A4 paper in the length direction of the image are at least: The size of the picture taken by the camera is recorded as L src and W src , scale them both to the minimum pixel requirements of formulas 1 and 2, and determine their respective magnifications: The larger magnification ratio is taken as the unified magnification ratio of the length and width of the original image, so the image size after scaling is expressed as: L img =αL src (4) W img =αW src (5) According to formula 3-5, the side view and top view taken in step 1 are scaled to appropriate sizes.

4. The method according to claim 1, characterized in that: Step 4, perform top view processing to obtain the maximum foot width, including: The A4 paper and the foot contour are segmented respectively, and the A4 paper contour is corrected using a simple correction method. After obtaining the target foot area image, the target parameters are determined; Step 41, obtain the key points of A4 paper: The key points of the A4 paper in the top view are mainly the two vertices above the A4 paper. The main steps are as follows: Step 411, blur processing and first threshold segmentation: use Gaussian blur to achieve preliminary noise reduction, use threshold segmentation method to perform the first segmentation on the side view image in step 2, and set the threshold to 150; Step 412, contour extraction and preliminary acquisition of key vertices: perform contour search, and the largest contour in the search result is the contour point of the A4 paper; traverse the obtained contour points, and calculate the distances between all points and the two vertices above the image according to calculation formula 6, and the points with the smallest distance are recorded as the two upper vertices of the A4 paper; according to the coordinates of the two top vertices, make the short side of the A4 paper horizontal by simple rotation; the two upper vertices are recorded as Points_top = [(LT_point_x, LT_point_y), (RT_point_x, RT_point_y)] Step 42, obtain the foot area: Second threshold segmentation: Use the threshold segmentation method to perform a second segmentation on the top view image processed in step 42, and set the threshold to 80; Step 43, determine foot type parameters: Take the vertical coordinates of the two upper vertices of the A4 paper as the starting point and the horizontal coordinates of the two upper vertices as the boundary, and use the result of the second threshold segmentation to scan from top to bottom and from left to right. When the first 0 value is scanned, it is the position of the toe, recorded as (ZJ_x, ZJ_y) Determine the actual distance represented by each pixel in the top view: w_h=W_A4 / (Points_top[1][0]-Points_top[0][0])(18) The maximum width of the foot is the length of the connecting line between the first metatarsal and the fifth metatarsal. In addition, the first metatarsal is 30.5% of the foot length from the toe, and the fifth metatarsal is 37.5% of the foot length from the toe. The reference ordinates of the first metatarsal and the fifth metatarsal are obtained as follows: ZG1_ref=Points_top[1][1]-L_foot*0.305 / w_h(19) ZG5_ref=Points_top[1][1]-L_foot*0.305 / w_h(20) Take the first metatarsal reference point 20 pixels above and below as the boundary, take the upper right corner of the A4 paper as the starting point, and scan from right to left and from top to bottom. When the first 0 value is scanned, it is the first position, recorded as (ZG1_x, ZG1_y); Take the 20 pixels above and below the fifth metatarsal reference point as the boundary, take the upper left corner of the A4 paper as the starting point, and scan from left to right and from top to bottom. When the first 0 value is scanned, it is the fifth position, recorded as (ZG5_x, ZG5_y); The final calculated maximum foot width position.

Citation Information

Patent Citations

  • A method for data extraction and measurement of key parts of the human foot based on images

    CN103646408B

  • A method and apparatus for detecting shoe size information

    CN104720192B

  • Measurement method for obtaining foot type data through mobile phone photographing

    CN107440236A

  • Subscript size measuring method based on cell phone photographing

    CN109330106A

  • Intelligent hub model size rapid measurement method

    CN118229670A