Sole edge detection method based on image gray value analysis
The sole edge detection method based on image grayscale value analysis can automatically screen defective shoes and match the left and right feet, solving the problems of low efficiency and high misjudgment rate in existing technologies and achieving efficient and accurate shoe detection and matching.
Patent Information
- Application Number
- CN202511128929.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-08-13
AI Technical Summary
Existing footwear inspection technology relies on manual operation, which has low efficiency and high error rate, making it difficult to meet large-scale production needs and high cost.
A sole edge detection method based on image grayscale value analysis is adopted. The color image is obtained through the camera, converted into a grayscale image, and region segmentation and edge detection are performed to automatically screen defective shoes and match the left and right feet.
It achieves efficient and accurate shoe defect detection, improves production efficiency, reduces costs, and enhances the degree of automation in shoe production and user comfort.
Smart Images

Figure CN120635084A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a sole edge detection method based on image grayscale value analysis. Background Art
[0002] With the rapid development of industrial automation and intelligent technology, quality inspection and matching of footwear products have become an important link in the footwear manufacturing industry. As a major manufacturing country, my country ranks among the top in the world in terms of footwear exports and production.
[0003] However, the testing technology for footwear products is still in a blank period in the current market, and automated testing technology is relatively scarce. In the era of big data and artificial intelligence, how to effectively use data for quality analysis and prediction is the current challenge.
[0004] Traditional footwear inspection and matching methods mainly rely on manual operations, which have problems such as low efficiency, high misjudgment rate and high cost. They are difficult to meet the needs of large-scale production, and the large amount of human resource investment greatly increases the burden on enterprises. Therefore, the present invention proposes a sole edge detection method based on image grayscale value analysis. By combining image processing technology with automation technology, it can achieve efficient and accurate footwear product defect detection, improve production efficiency, reduce costs, enhance the competitiveness of enterprises, and provide an efficient and accurate quality inspection and matching solution for the footwear production industry. Summary of the Invention
[0005] In view of the shortcomings of the existing technology, the present invention provides a sole edge detection method based on image grayscale value analysis, which solves the problems of difficulty in detecting defective footwear products and low detection efficiency in the existing technology.
[0006] The purpose of the present invention can be achieved through the following technical solutions: The sole edge detection method based on image grayscale value analysis includes the following steps: Step 1: Use several cameras to obtain a color image of the shoe to be tested X in the shoe detection area, and fit the image into a complete color image Q of the shoe to be tested; The grayscale image Q of the shoe to be tested is obtained by converting the color image Q of the shoe to be tested gray ; Step 2: Grayscale image Q of the shoe to be tested gray Perform region segmentation processing to obtain the grayscale image Q of the sole edge gum , and further analyze and determine; If the shoe to be tested X is determined to be a defective shoe, the shoe to be tested X is removed and the grayscale image Q of the shoe to be tested X is obtained. gray And the color image Q of the shoe to be tested performs a deletion operation; If the grayscale image Q of the sole edge isgum If the shoe X to be tested is determined to be a non-defective shoe, proceed to the next step; Step 3: Obtain grayscale images of the sole edges of several non-defective shoes to be tested, perform left and right foot matching screening, match the left foot test shoe with the best matching result with the right foot test shoe, and output the matching result.
[0007] As a further solution of the present invention, in step 1, in addition to several cameras, the shoe detection area also includes a positioning device for fixing the shoe X to be tested, ensuring that the several cameras can obtain color images of the shoe X to be tested.
[0008] As a further solution of the present invention, the color image Q of the shoe to be tested in step 1 includes a color image of the front, a first side color image, a color image of the back, and a second side color image of the shoe to be tested X; The image arrangement rules are as follows: In the color image Q of the shoe to be tested, the color image of the front of the shoe to be tested is connected to the first color image of the side of the shoe to be tested, the color image of the first color image of the side of the shoe to be tested is connected to the color image of the back of the shoe to be tested, and the color image of the back of the shoe to be tested is then connected to the second color image of the side of the shoe to be tested; In this color image Q of the shoe to be tested, the edge of the sole of the shoe to be tested X is displayed as a continuous image without interruption or repetition; The color image Q of the shoe to be tested is converted into the grayscale image Q of the shoe to be tested gray The image arrangement rule should be the same as that described in the color image Q of the shoe to be tested.
[0009] As a further solution of the present invention, the grayscale image Q of the shoe to be tested gray Perform region segmentation processing to obtain the grayscale image Q of the sole edge gum The specific method is: S41, based on the grayscale image Q of the shoe to be tested gray Construct a two-dimensional coordinate system, with each pixel as a point in the two-dimensional coordinate system. For any pixel Q i gray (x,y), calculate the grayscale variance σ in the e*e neighborhood i , where i is a positive integer counting index, not exceeding k, and k is Q gray The total number of pixels, x, y represent the horizontal and vertical coordinates of any pixel, and e is set by the operator; S42, calculate the grayscale variance of k pixels to obtain k grayscale variances, and arrange the k grayscale variances in descending order according to the grayscale variance values to obtain the grayscale variance sequence σ1, σ2, ..., σ k ; S43, obtain the first grayscale variance σ1 from the grayscale variance sequence as the first reference value, obtain the second grayscale variance σ2 backward, calculate the numerical difference rate between σ2 and the first reference value, and if the numerical difference rate does not exceed the numerical difference rate threshold σ preset by the operator, 阈 , then the grayscale variance σ2 and the first reference value are classified as category P1; S44, continue to obtain the grayscale variance from the grayscale variance sequence backward until σ k , calculate the numerical difference rate with the first reference value in sequence, and do not exceed the numerical difference rate threshold σ 阈 The corresponding grayscale variance is classified into category P1 and will exceed the numerical difference rate threshold σ 阈 The corresponding grayscale variance is classified into the category P to be classified 待 and treat the classification P 待 Arrange in descending order according to the grayscale variance value; S45, from the category to be classified P 待 In the process, the first grayscale variance value is obtained as the second reference value, and steps S43-S44 are repeated to obtain category P2. For the grayscale variance value exceeding the value difference rate threshold σ 阈 The corresponding grayscale variance is reclassified into the category to be classified P 待 and treat the classification P 待 Rearrange in descending order according to the grayscale variance value; S46, repeat S43-S45 until all grayscale variances are classified and n categories are obtained, which are recorded as category sequence P1, P2, ..., P n , n is a positive integer counting index, representing the total number of categories; The category sequence is further analyzed and processed to obtain the pre-selected area, and the pre-selected area is expanded to obtain the grayscale image Q of the sole edge. gum .
[0010] As a further solution of the present invention, the grayscale image Q of the edge of the sole is obtained. gum Specific methods also include: S51, obtaining the horizontal and vertical coordinates of the pixels corresponding to all grayscale variances in any category from the category sequence, and mapping all the pixels on a new two-dimensional coordinate system according to the horizontal and vertical coordinates of the pixels; If all the pixels can be fitted into a horizontal strip area, then the mean of the vertical coordinates of all the pixels in the horizontal strip area is obtained; If it cannot be fitted into a horizontal band area, no processing will be done; S52: Perform the operation described in step S51 on all categories in the category sequence to obtain a plurality of horizontal bands. Obtain the mean vertical coordinate value of all pixels in each horizontal band, and sort them in descending order based on the mean vertical coordinate value. The horizontal band corresponding to the first horizontal band mean value after sorting is selected as the pre-selected area. Based on the determined pre-selected area, the operator sets an extension value m, and expands m pixels upward based on the mean value of the vertical coordinate of the pre-selected area. The expanded length is used as the width of the pre-selected area, and the original length of the pre-selected area remains unchanged. The expanded preselected area corresponds to the grayscale image Q of the shoe to be tested gray The image in is used as the sole edge grayscale image Q gum .
[0011] As a further solution of the present invention, the grayscale image Q of the edge of the sole is obtained. gum , and the specific methods for further analysis and judgment are as follows: Take the grayscale image Q of the sole edge gum The first pixel in the lower left corner is used as the origin to construct a two-dimensional coordinate system with a scale of one pixel. Get the grayscale image Q of the sole edge gum The mean of all pixels in the shoe is taken as the grayscale image Q of the edge of the shoe gum The width of the standard pixel column is used as the width of the standard pixel column to construct the standard pixel column; Compare the standard pixel column with the sole edge grayscale image Q gum Compare each column of pixels in the two-dimensional coordinate system and record the pixel difference rate between the L column of pixels and the standard pixel column to obtain G1, G2, ..., G L , where L represents a positive integer count index, representing the grayscale image Q of the sole edge gum The total number of pixel columns in the Compare the L pixel difference rates with the pixel difference rate threshold G preset by the operator in turn. 阈 Compare, if the pixel difference rate exceeds the pixel difference rate threshold G 阈 Then the pixel column is regarded as an abnormal pixel column; If it does not exceed the limit, it is considered as a normal pixel column and no processing is performed; Extract the column numbers corresponding to all abnormal pixel columns and determine whether the column numbers are continuous. If so, it is determined that there is a defect in the corresponding shoe to be tested X, and the shoe to be tested X is considered a defective shoe; If there is no continuous situation, it is determined that the shoe X to be tested is a non-defective shoe.
[0012] As a further solution of the present invention, the column numbers corresponding to all abnormal pixel columns are extracted, and the specific method for determining whether the column numbers are continuous is as follows: If there are r consecutive columns, it is determined that there is a continuous situation; otherwise, it is considered that there is no continuous situation, where r is a positive integer set by the operator.
[0013] As a further solution of the present invention, if the shoe to be tested X is determined to be a defective shoe, the shoe to be tested X is removed and the grayscale image Q of the shoe to be tested X is obtained. gray And the color image Q of the shoe to be tested is deleted.
[0014] As a further solution of the present invention, a specific method for obtaining grayscale images of the sole edges of several non-defective shoes to be tested and performing left and right foot matching screening is as follows: Classify the obtained shoes to be tested into left and right shoes, and obtain α left shoes and α right shoes in total; Obtain the grayscale images of the sole edges corresponding to the α left shoes and the number of abnormal pixel columns in the grayscale images of the sole edges, and arrange the grayscale images of the sole edges in ascending order according to the number of abnormal pixel columns to obtain the grayscale image sequence Q of the sole edges corresponding to the α left shoes. 1 gum ,Q 2 gum ,...,Q α gum Similarly, we get the grayscale image sequence Q of the sole edge corresponding to the α right shoes 1’ gum ,Q 2’ gum ,...,Q α’ gum ; Using Q β gum Corresponding Q β’ gum , match α left shoes with α right shoes in sequence and output them as the best matching result, where β is a positive integer counting index representing any one in 1-α, and α is a counting index representing the number of left shoes and right shoes.
[0015] Beneficial effects of the present invention: (1) The present invention provides an automatic screening mechanism and method, which uses image processing technology to analyze image category sequences to obtain pre-selected areas, and then expands the pre-selected areas on this basis to obtain a complete and clear grayscale image of the sole edge; then, based on automated analysis technology, it is determined whether the shoes are defective, and the shoes are quickly screened and removed without the need for manual inspection one by one, saving manpower and time, and improving production efficiency; (2) The present invention provides a grayscale image analysis-based, grayscale variance sequence-based grouping and classification method that can effectively distinguish the edge area of the sole from the background or other irrelevant areas, further improving the accuracy of the division of the pre-selected area; in addition, by sorting the number of abnormal pixel columns and matching the corresponding methods, the integrity and symmetry of the sole edge are taken into account, and the accuracy of left and right foot matching is improved, ensuring that users receive suitable and matching shoes, thereby improving the user's comfort. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The present invention will be further described below with reference to the accompanying drawings.
[0017] Figure 1 is a schematic structural diagram of the system described in Example 1 of the present invention; Figure 2 Schematic diagram of the process of the method described in Example 2 of the present invention; Figure 3 Schematic diagram of the process of the method described in Example 3 of the present invention. DETAILED DESCRIPTION
[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0019] Example 1 The sole edge detection method based on image gray value analysis, such as Figure 1 As shown, the implementation of the present method relies on a sole edge detection system, which includes: The image acquisition module includes a plurality of cameras set up in the detection area of the shoe to be tested, and is used to acquire the color image of the shoe to be tested in real time.
[0020] The image analysis module converts the color image of the shoe to be tested into a grayscale image of the shoe to be tested, and obtains a grayscale image of the sole edge through region segmentation processing.
[0021] The image decision module analyzes the grayscale image of the sole edge obtained by the image analysis module, determines whether the current shoe to be tested is a defective shoe, matches the non-defective shoe, and obtains and outputs the best matching result.
[0022] The storage module is used to store the analysis results and calculation results of any step described in this method.
[0023] The central processing unit includes a computing unit for processing the calculation and analysis steps involved in the method and serving as a medium for data transmission between modules.
[0024] Example 2 The sole edge detection method based on image gray value analysis, such as Figure 2 As shown, the specific steps include: Step 1: This method is applicable to a footwear production line (specifically, a single production line, i.e., all shoes on the line are of the same size and shape, including both left and right shoes). It relies on the sole edge detection system described in Example 1. When a shoe to be tested passes through the production line and arrives at a testing area, a positioning device installed in the testing area first performs an alignment operation on the shoe to be tested, ensuring that multiple cameras installed in the testing area can accurately capture a color image of the shoe to be tested. Several cameras capture color images of the same shoe to be tested, obtaining several color images of the shoe to be tested. Using image fitting technology, these color images of the shoe to be tested are fitted into a complete color image of the shoe to be tested, which is recorded as Q. Then, the obtained color image Q of the shoe to be tested is converted into the grayscale image Q of the shoe to be tested using the conversion formula of the human eye perception weight. gray , which is convenient for subsequent image analysis operations.
[0025] It should be explained here that the color image Q of the shoe to be tested includes a color image of the front, a first side color image, a color image of the back, and a second side color image of the shoe to be tested; The image arrangement rules in the color image Q of the shoe to be tested are as follows: In the color image Q of the shoe to be tested, the color image of the front of the shoe to be tested is connected to the first color image of the side of the shoe to be tested, the color image of the first side of the shoe to be tested is connected to the color image of the back of the shoe to be tested, and the color image of the back of the shoe to be tested is connected to the second color image of the side of the shoe to be tested; Finally, a fitted color image Q of the shoe to be tested is obtained, in which the edge of the sole of the shoe to be tested is displayed as an uninterrupted and non-repeated continuous image; The color image Q of the shoe to be tested is converted into the grayscale image Q of the shoe to be tested gray Then, the grayscale image Q of the shoe to be tested gray The image arrangement rule is the same as that of the color image Q of the shoe to be tested; Such an arrangement ensures that the edge of the sole and the background appear as an approximately continuous straight line in the image, and the vertical coordinate of the pixel point representing the intersection of the edge of the sole and the background is within a certain range.
[0026] It should be noted that this method requires that the edge of the sole be clearly distinguishable from the background. Shoes without soles or shoes with sole edges similar to the background material and no clear distinction are not suitable for this method.
[0027] Step 2: Get the grayscale image Q of the shoe to be tested gray Perform region segmentation processing to segment the sole edge grayscale image Q containing only the sole edge gum , and then according to the grayscale image Q of the sole edge gum Perform analysis to determine whether the shoes to be tested are defective shoes; If the shoe to be tested is determined to be a defective shoe, the shoe to be tested is removed and does not participate in the subsequent analysis and processing, and the grayscale image Q of the shoe to be tested is converted to gray And the color image Q of the shoe to be tested performs a deletion operation; If the grayscale image Q of the sole edge is gum If the shoe under test is determined to be non-defective, proceed to the next step; Step 3: Based on the several test shoes that are not defective shoes screened out in step 2, obtain the grayscale images of the sole edges of these several test shoes again, perform left and right foot matching screening, match the left foot test shoe with the best matching result with the right foot test shoe, and output the matching result.
[0028] Example 3 This embodiment discloses a method for detecting the grayscale image Q of the shoe to be tested based on the embodiment 2. gray Perform segmentation processing to obtain the grayscale image Q of the sole edge gum methods, such as Figure 3 As shown, the details are as follows: Based on the grayscale image Q of the shoe to be tested gray , in the grayscale image Q of the shoe to be tested gray A two-dimensional coordinate system is constructed based on the grayscale image Q of the shoe to be tested. gray The boundary point in the lower left corner is taken as the origin, and the right and above the origin are taken as the horizontal and vertical axes of the two-dimensional coordinate system. gray Each pixel in is regarded as a point in the two-dimensional coordinate system; For the grayscale image Q of the shoe to be tested gray Any pixel Q i gray (x, y), get the pixel value of the pixel, and the pixel Q i gray The pixel values of all pixels in the e*e neighborhood of (x,y) and calculate the pixel Q i gray Grayscale variance σ of (x,y) in the e*e neighborhood i , where i is a positive integer counting index, not exceeding k, and k is Q gray The total number of pixels in the graph, x and y represent the horizontal and vertical coordinates of any pixel point, and the value of e is set by the operator based on the shoe type to be tested and the judgment accuracy required by the production line where the current shoe type is located; Grayscale image Q of the shoe to be tested gray The grayscale variance of each of the k pixels in the image is calculated, and finally k grayscale variances are obtained. The obtained k grayscale variances are sorted in descending order, and the obtained grayscale variance sequence is recorded as σ1, σ2, ..., σ k ; For the grayscale variance sequence, obtain the grayscale variance σ1 of the first sorting position and use it as the first reference value, then continue to obtain the grayscale variance σ2 of the second sorting position from the grayscale variance sequence, and use the numerical difference rate = ; Calculate the numerical difference rate between the grayscale variance σ2 and the first reference value (the grayscale variance σ1 with the first sorting position), and compare the numerical difference rate with the numerical difference rate threshold σ preset by the operator. 阈 Compare and compare, if the calculated numerical difference rate does not exceed the numerical difference rate threshold σ 阈 The grayscale variance σ2 and the first benchmark value are classified into the same category and recorded as category P1. The average value of the grayscale variance in category P1 is the largest among all categories, and the average values of the grayscale variances of subsequent categories decrease in sequence. Then continue to obtain the grayscale variance from the grayscale variance sequence backward until the last grayscale variance σ k , and calculate the numerical difference rate between the obtained grayscale variance and the first reference value in turn, and according to the above comparison method, the value that does not exceed the numerical difference rate threshold σ 阈 The corresponding grayscale variance is classified into the category P1 where the first benchmark value is located, and the calculated numerical difference rate exceeds the numerical difference rate threshold σ 阈 The corresponding grayscale variance is reclassified into a new category P 待 and treat the classification P 待 Sort by grayscale variance value from large to small; Then from the category to be classified P 待 In the process, the first grayscale variance value is obtained as the second reference value, and then the grayscale variance value is obtained from the category P to be classified. 待 Get a grayscale variance backward until the category P to be classified 待 The last grayscale variance in the , calculates the numerical difference rate between the second reference value in turn, and determines whether the calculated numerical difference rate exceeds the numerical difference rate threshold σ 阈 , if it does not exceed the difference rate threshold σ 阈 The grayscale variance and the second reference value are classified into one category, recorded as category P2, and for those exceeding the numerical difference rate threshold σ 阈 The corresponding grayscale variance is reclassified into the category to be classified P 待 and treat the classification P 待Re-sort the grayscale variance values from large to small; Repeat the above steps until all grayscale variances are classified and n categories are obtained, which are recorded as category sequence P1, P2, ..., P n , n is a positive integer counting index, representing the total number of categories; What needs to be explained here is that the larger the value of the grayscale variance, the more drastic the change in the grayscale value of the area around this pixel point, which means that in the neighborhood of this pixel point, the grayscale value fluctuates greatly. Such large fluctuations usually correspond to changes in edges, textures or other significant features in the image. In this scheme, the method is used to find the pixel point at the boundary between the sole and the background by taking advantage of the fact that the sole pixel background has a clear boundary.
[0029] Then, the horizontal and vertical coordinates of the pixel points corresponding to all grayscale variances in any category are obtained from the category sequence, and a new two-dimensional coordinate system is constructed, where the scale of the two-dimensional coordinate system is one pixel; Re-plot all pixel points on this two-dimensional coordinate system by using the horizontal and vertical coordinates of the pixel points, and determine whether the horizontal and vertical coordinates of the corresponding pixel points in this category can be fitted into a horizontal band area (the method of fitting the horizontal band area can be implemented according to existing technologies and will not be elaborated on here); If it can be fitted into a horizontal strip area, then the mean value of the vertical coordinates of all pixels in the horizontal strip area is obtained; If it cannot be fitted into a horizontal banded area, no processing is performed; Based on the mean values of the vertical coordinates of all pixels in all the obtained horizontal strips, they are sorted in ascending order, and the horizontal strip corresponding to the first horizontal coordinate mean value (the smallest vertical coordinate mean) after sorting is used as the pre-selected area. The pre-selected area represents the area at the boundary between the sole and the background. The sole is a continuous image, so it can be fitted into a horizontal strip area. The pixel at the sole has the smallest vertical coordinate among the pixels in the entire image, so the area at the boundary between the sole and the background can be obtained by the above method. For the determined preselected area, the operator sets an expansion value m, which is the number of pixels preset by the operator and matches the pixel width of the sole edge of the shoe to be tested, ensuring that the entire sole edge can be covered when the preselected area is expanded; The extension value m represents the extension of m pixels upward based on the average of the vertical coordinates of all pixels in the pre-selected area. The length of this extension (m pixels) is used as the width of the pre-selected area, and the original length of the pre-selected area remains unchanged. Get the expanded pre-selected area, and move the expanded pre-selected area from the corresponding grayscale image Q of the shoe to be tested grayThe segmented image is used as the sole edge grayscale image Q gum .
[0030] Example 4 This embodiment discloses a method for screening and matching shoes to be tested based on the first embodiment, which is as follows: The grayscale image Q of the shoe sole edge finally determined according to Example 3 gum , use this image to establish a two-dimensional coordinate system, with the grayscale image Q of the sole edge gum The first pixel in the lower left corner is used as the origin of the two-dimensional coordinate system. The horizontal axis to the left of the origin and the vertical axis just above the origin are constructed. The scales on the horizontal and vertical axes of the two-dimensional coordinate system are all one pixel wide. Get the grayscale image Q of the sole edge gum The pixel values of all pixels in the image are averaged to obtain the grayscale image Q of the edge of the sole gum The pixel average value is used to obtain the grayscale image Q of the sole edge gum The width of the sole edge grayscale image Q gum The distance between the coordinate on the vertical axis and the origin coordinate in the two-dimensional coordinate system is used to construct a column of pixel values as the grayscale image Q of the sole edge. gum The standard pixel column of the pixel average value; Using standard pixel columns and sole edge grayscale image Q gum Compare the first column of pixels with abscissa 1 in the two-dimensional coordinate system, and record the pixel difference rate between the first column of pixels and the standard pixel column, which is recorded as G1; Then compare the standard pixel column with the second column of pixels with abscissa 2, and slide back one scale to perform the comparison operation until the Lth column of pixels, and record the pixel difference rate between all columns of pixels and the standard pixel column, which is recorded as G1, G2, ..., G L , where L represents a positive integer count index, representing the grayscale image Q of the sole edge gum The total number of columns of pixels in .
[0031] Get the pixel difference rate threshold G preset by the operator 阈 , and compare the recorded L pixel difference rates with the pixel difference rate threshold G 阈 Perform the comparison operation. If there is a pixel difference rate that exceeds the pixel difference rate threshold G preset by the operator, 阈 , then the column of pixels associated with the pixel difference rate is regarded as an abnormal pixel column; if a pixel difference rate does not exceed the pixel difference rate threshold G preset by the operator 阈 , then the column of pixels associated with the pixel difference rate is regarded as a normal pixel column and no processing is performed.
[0032] Extract the grayscale image Q of the sole edge gum All abnormal pixel columns, the number of columns associated with the abnormal pixel columns, and sort all the column numbers in ascending order. If there are r consecutive abnormal pixel columns, the current sole edge grayscale image Q is determined. gum If there is a defect in the corresponding shoe to be tested, the shoe to be tested is regarded as a defective shoe, the shoe to be tested is removed, and the grayscale image Q of the shoe to be tested is converted to gray The color image Q of the shoe to be tested is deleted. If there is no continuity, the shoe to be tested X is regarded as a non-defective shoe.
[0033] The above steps are repeated continuously, and finally several non-defective shoes are obtained, including left shoes and right shoes of the same shoe type and shoe size, which are referred to as test shoes here. The sole edge grayscale images of several test shoes are obtained, and the sole edge grayscale images of several test shoes are taken. Then, the test shoes are classified into left shoes and right shoes, and finally α left shoes and α right shoes are obtained.
[0034] Taking α left shoes as an example, obtain α sole edge grayscale images and the number of abnormal pixel columns in each of the α sole edge grayscale images, and sort the sole edge grayscale images in the order of the number of abnormal pixel columns from small to large, and obtain Q 1 gum ,Q 2 gum ,...,Q α gum , and so on, we can get the grayscale image Q of the sole edge of α right shoes after sorting the number of abnormal pixel columns from small to large 1’ gum ,Q 2’ gum ,...,Q α’ gum ; Use Q 1 gum Corresponding Q 1’ gum , Q 2 gum Corresponding Q 2’ gum , until Q α gum Corresponding Q α’ gum The method is to match α left shoes with α right shoes as the same pair of shoes, record them as the best matching result and output them, where, The counting index represents the number of left shoes and right shoes.
[0035] Some of the data in the formulas described above are dimensionless and numerically calculated. Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0036] The above contents are merely examples and explanations of the present invention. Those skilled in the art may make various modifications or additions to the described specific embodiments or replace them in similar ways. As long as they do not deviate from the invention or exceed the scope defined by the claims, they should all fall within the scope of protection of the present invention.
[0037] It is important to note that all user data collected in this application is collected with the user's consent and authorization. Furthermore, the use of user data is legal and compliant, and the use and processing of user data complies with the relevant laws, regulations, and standards of the relevant regions.
Claims
1. A sole edge detection method based on image grayscale value analysis, characterized in that: This method comprises the following steps: Step 1: Use several cameras to obtain a color image of the shoe to be tested X in the shoe detection area, and fit the image into a complete color image Q of the shoe to be tested; The grayscale image Q of the shoe to be tested is obtained by converting the color image Q of the shoe to be tested gray ; Step 2: Grayscale image Q of the shoe to be tested gray Perform region segmentation processing to obtain the grayscale image Q of the sole edge gum , and further analyze and determine; If the shoe to be tested X is determined to be a defective shoe, the shoe to be tested X is removed and the grayscale image Q of the shoe to be tested X is obtained. gray And the color image Q of the shoe to be tested performs a deletion operation; If the grayscale image Q of the sole edge is gum If the shoe X to be tested is determined to be a non-defective shoe, proceed to the next step; Step 3: Obtain grayscale images of the sole edges of several non-defective shoes to be tested, perform left and right foot matching screening, match the left foot test shoe with the best matching result with the right foot test shoe, and output the matching result.
2. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 1, wherein: In the step 1, in addition to the plurality of cameras, the shoe detection area also includes a positioning device for fixing the shoe X to be tested, ensuring that the plurality of cameras can obtain a color image of the shoe X to be tested.
3. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 1, wherein: The color image Q of the shoe to be tested in step 1 includes a color image of the front, a first side color image, a color image of the back, and a second side color image of the shoe to be tested X; The image arrangement rules are as follows: In the color image Q of the shoe to be tested, the color image of the front of the shoe to be tested is connected to the first color image of the side of the shoe to be tested, the color image of the first color image of the side of the shoe to be tested is connected to the color image of the back of the shoe to be tested, and the color image of the back of the shoe to be tested is then connected to the second color image of the side of the shoe to be tested; In this color image Q of the shoe to be tested, the edge of the sole of the shoe to be tested X is displayed as a continuous image without interruption or repetition; The color image Q of the shoe to be tested is converted into the grayscale image Q of the shoe to be tested gray The image arrangement rule should be the same as that described in the color image Q of the shoe to be tested.
4. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 3, wherein: Grayscale image Q of the shoe to be tested gray Perform region segmentation processing to obtain the grayscale image Q of the sole edge gum The specific method is: S41, based on the grayscale image Q of the shoe to be tested gray Construct a two-dimensional coordinate system, with each pixel as a point in the two-dimensional coordinate system. For any pixel Q i gray (x,y), calculate the grayscale variance σ in the e*e neighborhood i , where i is a positive integer counting index, not exceeding k, and k is Q gray The total number of pixels, x, y represent the horizontal and vertical coordinates of any pixel, and e is set by the operator; S42, calculate the grayscale variance of k pixels to obtain k grayscale variances, and arrange the k grayscale variances in descending order according to the grayscale variance values to obtain the grayscale variance sequence σ1, σ2, ..., σ k ; S43, obtain the first grayscale variance σ1 from the grayscale variance sequence as the first reference value, obtain the second grayscale variance σ2 backward, calculate the numerical difference rate between σ2 and the first reference value, and if the numerical difference rate does not exceed the numerical difference rate threshold σ preset by the operator, 阈 , then the grayscale variance σ2 and the first reference value are classified as category P1; S44, continue to obtain the grayscale variance from the grayscale variance sequence backward until σ k , calculate the numerical difference rate with the first reference value in sequence, and do not exceed the numerical difference rate threshold σ 阈 The corresponding grayscale variance is classified into category P1 and will exceed the numerical difference rate threshold σ 阈 The corresponding grayscale variance is classified into the category P to be classified 待 and treat the classification P 待 Arrange in descending order according to the grayscale variance value; S45, from the category to be classified P 待 In the process, the first grayscale variance value is obtained as the second reference value, and steps S43-S44 are repeated to obtain category P2. For the grayscale variance value exceeding the value difference rate threshold σ 阈 The corresponding grayscale variance is reclassified into the category to be classified P 待 and treat the classification P 待 Rearrange in descending order according to the grayscale variance value; S46, repeat S43-S45 until all grayscale variances are classified and n categories are obtained, which are recorded as category sequence P1, P2, ..., P n , n is a positive integer counting index, representing the total number of categories; The category sequence is further analyzed and processed to obtain the pre-selected area, and the pre-selected area is expanded to obtain the grayscale image Q of the sole edge. gum .
5. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 4, wherein: Get the grayscale image Q of the sole edge gum Specific methods also include: S51, obtaining the horizontal and vertical coordinates of the pixels corresponding to all grayscale variances in any category from the category sequence, and mapping all the pixels on a new two-dimensional coordinate system according to the horizontal and vertical coordinates of the pixels; If all the pixels can be fitted into a horizontal strip area, then the mean of the vertical coordinates of all the pixels in the horizontal strip area is obtained; If it cannot be fitted into a horizontal band area, no processing will be done; S52: Perform the operation described in step S51 on all categories in the category sequence to obtain a plurality of horizontal bands. Obtain the mean vertical coordinate value of all pixels in each horizontal band, and sort them in descending order based on the mean vertical coordinate value. The horizontal band corresponding to the first horizontal band mean value after sorting is selected as the pre-selected area. Based on the determined pre-selected area, the operator sets an extension value m, and expands m pixels upward based on the mean value of the vertical coordinate of the pre-selected area. The expanded length is used as the width of the pre-selected area, and the original length of the pre-selected area remains unchanged. The expanded preselected area corresponds to the grayscale image Q of the shoe to be tested gray The image in is used as the sole edge grayscale image Q gum .
6. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 5, characterized in that: Get the grayscale image Q of the sole edge gum , and the specific methods for further analysis and judgment are as follows: Take the grayscale image Q of the sole edge gum The first pixel in the lower left corner is used as the origin to construct a two-dimensional coordinate system with a scale of one pixel. Get the grayscale image Q of the sole edge gum The mean of all pixels in the shoe is taken as the grayscale image Q of the edge of the shoe gum The width of the standard pixel column is used as the width of the standard pixel column to construct the standard pixel column; Compare the standard pixel column with the sole edge grayscale image Q gum Compare each column of pixels in the two-dimensional coordinate system and record the pixel difference rate between the L column of pixels and the standard pixel column to obtain G1, G2, ..., G L , where L represents a positive integer count index, representing the grayscale image Q of the sole edge gum The total number of pixel columns in the Compare the L pixel difference rates with the pixel difference rate threshold G preset by the operator in turn. 阈 Compare, if the pixel difference rate exceeds the pixel difference rate threshold G 阈 Then the pixel column is regarded as an abnormal pixel column; If it does not exceed the limit, it is considered as a normal pixel column and no processing is performed; Extract the column numbers corresponding to all abnormal pixel columns and determine whether the column numbers are continuous. If so, it is determined that there is a defect in the corresponding shoe to be tested X, and the shoe to be tested X is considered a defective shoe; If there is no continuous situation, it is determined that the shoe X to be tested is a non-defective shoe.
7. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 6, wherein: The specific method of extracting the column numbers corresponding to all abnormal pixel columns and determining whether the column numbers are continuous is as follows: If there are r consecutive columns, it is determined that there is a continuous situation; otherwise, it is considered that there is no continuous situation, where r is a positive integer set by the operator.
8. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 7, wherein: If the shoe to be tested X is determined to be a defective shoe, the shoe to be tested X is removed and the grayscale image Q of the shoe to be tested X is obtained. gray And the color image Q of the shoe to be tested is deleted.
9. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 8, wherein: The specific method for obtaining grayscale images of the sole edges of several non-defective shoes to be tested and performing left and right foot matching screening is as follows: Classify the obtained shoes to be tested into left and right shoes, and obtain α left shoes and α right shoes in total; Obtain the grayscale images of the sole edges corresponding to the α left shoes and the number of abnormal pixel columns in the grayscale images of the sole edges, and arrange the grayscale images of the sole edges in ascending order according to the number of abnormal pixel columns to obtain the grayscale image sequence Q of the sole edges corresponding to the α left shoes. 1 gum ,Q 2 gum ,...,Q α gum Similarly, we get the grayscale image sequence Q of the sole edge corresponding to the α right shoes 1’ gum ,Q 2’ gum ,...,Q α’ gum ; Using Q β gum Corresponding Q β’ gum , match α left shoes with α right shoes in sequence and output them as the best matching result, where β is a positive integer counting index representing any one in 1-α, and α is a counting index representing the number of left shoes and right shoes.
Citation Information
Patent Citations
Shoe identity determining method
CN103839068A
Jujube grading detection method based on machine vision
CN111667475A
Automatic detection method and system for flaws of quick-dry fabric
CN111709915A
Machine vision control method and system for shoe body quality detection
CN116862850A
Sole edge detection method and device based on image gray value analysis
CN118071783A