Shoe sole edge detection method and device based on image gray value analysis
By using a method based on image gray value analysis to detect the edge of rubber soles, the problem of low detection accuracy of traditional equipment is solved, and efficient and accurate sole edge positioning is achieved, replacing manual operations.
Patent Information
- Application Number
- CN202410467718.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-18
AI Technical Summary
Traditional automated equipment cannot effectively detect the edges of rubber soles, resulting in low detection accuracy, unable to replace manual operations, and affecting efficiency.
The sole edge detection method based on image gray value analysis is used to obtain the grayscale sole depth map, set the reference line, draw the gray value curve, segment and filter the line segments, obtain edge detection points, locate the sole edge, and reduce manual labor. intervention.
It improves the efficiency and accuracy of sole edge detection, simplifies the edge line segment screening process, avoids misjudgments, achieves fast and accurate edge positioning, and meets the needs of sole material cutting and process inspection.
Smart Images

Figure CN118071783B
Abstract
Description
Technical Field
[0001] The invention relates to the field of edge detection, and in particular to a method and a device for detecting the edge of a shoe sole based on image gray value analysis. Background Art
[0002] In the shoe manufacturing industry, rubber soles are usually made using injection molding technology. The newly formed soles have injection molding residues or burrs, which need to be removed. The traditional method is to manually visually inspect and remove the injection molding residues or burrs on the edge of the sole. With the increase in labor costs and higher requirements for the efficiency of this process, full manual operation is no longer as good as the fully automated equipment system. Since rubber soles have the characteristics of high elasticity, light transmittance, and irregular shape, the visual imaging system in traditional automated equipment cannot adaptively detect and obtain effective sole edges, affecting the accuracy of sole edge detection.
[0003] Therefore, it is necessary to propose a sole edge detection algorithm to improve the efficiency and accuracy of sole edge detection. Summary of the invention
[0004] In view of the above-mentioned technical problems, the purpose of the embodiments of the present application is to propose a method and device for detecting the edge of a shoe sole based on image grayscale value analysis to solve the technical problems mentioned in the above background technology section.
[0005] In a first aspect, the present invention provides a method for detecting a sole edge based on image grayscale value analysis, comprising the following steps:
[0006] Obtain a grayscale sole depth map, set a horizontal axis and a vertical axis on the grayscale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines that are parallel to the horizontal axis of the grayscale sole depth map and are arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line;
[0007] The gray value curve is segmented according to a preset line segment angle range to obtain a number of sub-line segments;
[0008] According to the angle range of the edge line segment, several sub-line segments are screened to obtain the edge line segment on the gray value curve, the abscissa and ordinate of the end pixel point of the edge line segment are obtained, and the edge detection point is obtained according to the position relationship of the end pixel point on the gray sole depth map;
[0009] The above steps are repeated until the corresponding edge detection points on each reference line of the gray-scale sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the gray-scale sole depth map.
[0010] Preferably, the gray value curve is segmented according to a preset line segment angle range to obtain a plurality of sub-line segments, specifically including:
[0011] Calculate the slope of the line segment between each pixel point and the adjacent pixel point on the gray value curve;
[0012] Calculate the angle of the line segment based on the slope;
[0013] The angles of all line segments on the gray value curve are traversed, and the gray value curve is segmented according to a preset line segment angle range to obtain a number of sub-line segments.
[0014] Preferably, a plurality of sub-segments are screened according to the angle range of the edge segment to obtain the edge segment on the gray value curve, the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment are obtained, and the edge detection point is obtained according to the positional relationship of the end pixel point on the grayscale sole depth map, specifically including: the angle range of the edge segment includes a first edge segment angle range and a second edge segment angle range, each sub-segment is screened according to the first edge segment angle range to obtain the first edge segment, the horizontal coordinate and the vertical coordinate of the pixel point at the first end of the first edge segment are obtained, and the first edge detection point is obtained; each sub-segment is screened according to the second edge segment angle range to obtain the second edge segment, the horizontal coordinate and the vertical coordinate of the pixel point at the second end of the second edge segment are obtained, and the second edge detection point is obtained.
[0015] Preferably, the preset line segment angle range includes [0°, 45°), [45°, 90°), [90°, 135°), [135°, 180°), [180°, 225°), [225°, 270°), [270°, 315°), [315°, 360°); the first edge line segment angle range is [45°, 90°); the second edge line segment angle range is [270°, 315°).
[0016] As a preference, it also includes:
[0017] In response to determining that there are at least two candidate pixel points on the gray value curve, and the at least two candidate pixel points have the same vertical coordinate and correspond to at least two gray values, the distance between each of the at least two candidate pixel points and the adjacent edge detection point is calculated, and the candidate pixel point corresponding to the minimum distance is selected as the edge detection point on the gray value curve.
[0018] Preferably, the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line are obtained, specifically including: selecting the pixel points on the reference line on the grayscale sole depth map according to the set step size, and obtaining the horizontal coordinates and grayscale values of the pixel points on the reference line.
[0019] In a second aspect, the present invention provides a sole edge detection device based on image gray value analysis, comprising:
[0020] The curve drawing module is configured to obtain a gray-scale sole depth map, set a horizontal axis and a vertical axis on the gray-scale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines that are parallel to the horizontal axis of the gray-scale sole depth map and are arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the gray-scale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line;
[0021] A curve segmentation module is configured to segment the gray value curve according to a preset line segment angle range to obtain a plurality of sub-line segments;
[0022] The edge detection point acquisition module is configured to screen a plurality of sub-segments according to the angle range of the edge segment, obtain the edge segment on the gray value curve, obtain the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment, and obtain the edge detection point according to the position relationship of the end pixel point on the gray sole depth map;
[0023] The repeated execution module is configured to repeatedly execute the above modules until the corresponding edge detection points on each reference line of the gray-scale sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the gray-scale sole depth map.
[0024] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.
[0025] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] (1) The sole edge detection method based on image grayscale value analysis proposed in the present invention analyzes the grayscale value of the grayscale sole depth map, specifically including grouping the pixel points on the grayscale sole depth map according to the reference line and drawing the corresponding grayscale value curve, segmenting the grayscale value curve and angle screening, so as to quickly obtain the edge detection points on the grayscale sole depth map and locate the sole edge without manual visual inspection, thereby improving the efficiency and accuracy of sole edge detection; and grouping the pixel points on the grayscale sole depth map according to the reference line, thereby reducing the influence of the sole shape, injection molding residue or burr shape on the sole edge detection result, thereby improving the accuracy of sole edge detection;
[0028] (2) The shoe sole edge detection method based on image gray value analysis proposed in the present invention simplifies the edge segment screening process by first segmenting the gray value curve and then screening out the edge segments, thereby avoiding the problem of misjudgment of edge segments and difficulty in determining edge detection points, thereby improving the efficiency of shoe sole edge detection;
[0029] (3) The shoe sole edge detection method based on image gray value analysis proposed in the present invention uses adjacent edge detection point filtering to select the corresponding edge detection point on the reference line from multiple candidate pixel points, thereby improving the accuracy of shoe sole edge detection;
[0030] (4) In practical applications, the sole edge detection method based on image grayscale value analysis proposed in the present invention can quickly obtain the spatial position of the sole edge, has high efficiency and accuracy in sole edge detection, meets the needs of sole edge detection, and provides an implementation solution for sole waste material cutting and sole process inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 is an exemplary device architecture diagram to which an embodiment of the present application may be applied;
[0033] Figure 2 A schematic diagram of the process of a sole edge detection method based on image gray value analysis according to an embodiment of the present application;
[0034] Figure 3 A grayscale sole depth map and a reference line schematic diagram of a sole edge detection method based on image grayscale value analysis according to an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a gray value curve corresponding to a reference line of a shoe sole edge detection method based on image gray value analysis according to an embodiment of the present application;
[0036] Figure 5 A schematic diagram of a segmented grayscale value curve of a shoe sole edge detection method based on image grayscale value analysis according to an embodiment of the present application;
[0037] Figure 6 A schematic diagram of filtering edge segments from sub-segments of a gray value curve in a shoe sole edge detection method based on image gray value analysis according to an embodiment of the present application;
[0038] Figure 7 A schematic diagram of obtaining edge detection points from edge line segments in a sole edge detection method based on image gray value analysis in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of candidate pixels and reference pixels in a shoe sole edge detection method based on image gray value analysis according to an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of a sole edge detection result of a sole edge detection method based on image gray value analysis according to an embodiment of the present application;
[0041] Fig.10 A schematic diagram of a shoe sole edge detection device based on image grayscale value analysis according to an embodiment of the present application;
[0042] Fig.11 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Figure 1 An exemplary device architecture 100 is shown to which the shoe sole edge detection method based on image grayscale value analysis or the shoe sole edge detection device based on image grayscale value analysis according to the embodiments of the present application can be applied.
[0045] like Figure 1As shown, the device architecture 100 may include a terminal device 1 101, a terminal device 2 102, a terminal device 3 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal device 1 101, the terminal device 2 102, the terminal device 3 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0046] The user can use the terminal device 101, the terminal device 2 102, and the terminal device 3 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various applications, such as data processing applications, file processing applications, etc., can be installed on the terminal device 101, the terminal device 2 102, and the terminal device 3 103.
[0047] Terminal device 1 101, terminal device 2 102, and terminal device 3 103 may be hardware or software. When terminal device 1 101, terminal device 2 102, and terminal device 3 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc. When terminal device 1 101, terminal device 2 102, and terminal device 3 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or they may be implemented as a single software or software module. No specific limitation is made here.
[0048] The server 105 may be a server that provides various services, such as a background data processing server that processes files or data uploaded by the terminal device 101, the terminal device 2 102, and the terminal device 3 103. The background data processing server may process the acquired files or data and generate processing results.
[0049] It should be noted that the sole edge detection method based on image grayscale value analysis provided in the embodiment of the present application can be executed by the server 105, and can also be executed by the terminal device 1 101, the terminal device 2 102, and the terminal device 3 103. Accordingly, the sole edge detection device based on image grayscale value analysis can be set in the server 105, and can also be set in the terminal device 1 101, the terminal device 2 102, and the terminal device 3 103.
[0050] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided as required. In the case where the processed data does not need to be obtained remotely, the above device architecture may not include a network, but only a server or a terminal device.
[0051] Figure 2 A method for detecting the edge of a shoe sole based on image grayscale value analysis provided by an embodiment of the present application is shown, comprising the following steps:
[0052] S1, obtain a grayscale sole depth map, set a horizontal axis and a vertical axis on the grayscale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines parallel to the horizontal axis of the grayscale sole depth map and arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line.
[0053] In a specific embodiment, obtaining the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line specifically includes: selecting the pixel points on the reference line on the grayscale sole depth map according to the set step size, and obtaining the horizontal coordinates and grayscale values of the pixel points on the reference line.
[0054] Specifically, refer to Figure 3 , take a picture of the sole to be detected by a 3D camera, and perform image processing to obtain a gray-scale sole depth map, set a horizontal axis and a vertical axis on the gray-scale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, and set reference lines parallel to the horizontal axis of the gray-scale sole depth map and arranged at equal intervals to achieve grouping of pixel points on the gray-scale sole depth map for subsequent analysis, and reduce the influence of the shape of the sole, injection molding residue or burr on the sole edge detection result; further, the larger the spacing between the reference lines, the sparser the edge detection points; the larger the spacing between the reference lines, the denser the edge detection points; set the step size to 1, select the pixel points on the reference line on the gray-scale sole depth map according to the set step size, and obtain the horizontal coordinates and grayscale values of the pixel points on the reference line, so as to obtain more accurate edge detection points for subsequent analysis; and draw the grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line, and the grayscale value curve corresponding to the reference line is as shown in Figure 4 shown.
[0055] S2, segmenting the gray value curve according to a preset line segment angle range to obtain a plurality of sub-line segments.
[0056] In a specific embodiment, the gray value curve is segmented according to a preset line segment angle range to obtain a plurality of sub-line segments, specifically including:
[0057] Calculate the slope of the line segment between each pixel point and the adjacent pixel point on the gray value curve;
[0058] Calculate the angle of the line segment based on the slope;
[0059] The angles of all line segments on the gray value curve are traversed, and the gray value curve is segmented according to a preset line segment angle range to obtain a number of sub-line segments.
[0060] Specifically, let the horizontal coordinate of each pixel point on the gray value curve be , the gray value is , the horizontal coordinates of the pixels adjacent to this pixel are , the gray value is , the slope of the line segment between the pixel and the adjacent pixel for:
[0061] ;
[0062] The angle of the line segment between this pixel and the adjacent pixel for:
[0063] .
[0064] In a specific embodiment, the preset line segment angle range includes [0°, 45°), [45°, 90°), [90°, 135°), [135°, 180°), [180°, 225°), [225°, 270°), [270°, 315°), [315°, 360°).
[0065] Specifically, refer to Figure 5 , according to the preset line segment angle range [0°, 45°), [45°, 90°), [90°, 135°), [135°, 180°), [180°, 225°), [225°, 270°), [270°, 315°), [315°, 360°), the gray value curve is segmented to obtain a first sub-segment 201, a second sub-segment 202, a third sub-segment 203, a fourth sub-segment 204, a fifth sub-segment 205 and a sixth sub-segment 206.
[0066] S3, screening several sub-segments according to the angle range of the edge segment, obtaining the edge segment on the gray value curve, obtaining the horizontal coordinate and vertical coordinate of the end pixel point of the edge segment, and obtaining the edge detection point according to the position relationship of the end pixel point on the grayscale sole depth map.
[0067] In a specific embodiment, a plurality of sub-segments are screened according to the angle range of the edge segment to obtain the edge segment on the gray value curve, the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment are obtained, and the edge detection point is obtained according to the positional relationship of the end pixel point on the grayscale sole depth map, specifically including: the angle range of the edge segment includes a first edge segment angle range and a second edge segment angle range, each sub-segment is screened according to the first edge segment angle range to obtain the first edge segment, the horizontal coordinate and the vertical coordinate of the pixel point at the first end of the first edge segment are obtained, and the first edge detection point is obtained; each sub-segment is screened according to the second edge segment angle range to obtain the second edge segment, the horizontal coordinate and the vertical coordinate of the pixel point at the second end of the second edge segment are obtained, and the second edge detection point is obtained.
[0068] In a specific embodiment, the first edge segment angle range is [45°, 90°); the second edge segment angle range is [270°, 315°).
[0069] Specifically, refer to Figure 6 and Figure 7 , the first sub-segment 201, the second sub-segment 202, the third sub-segment 203, the fourth sub-segment 204, the fifth sub-segment 205 and the sixth sub-segment 206 are screened according to the first edge segment angle range [45°, 90°) and the second edge segment angle range [270°, 315°), respectively, and the angle of the second sub-segment 202 is within the first edge segment angle range [45°, 90°) and the angle of the fifth sub-segment 205 is within the second edge segment angle range [270°, 315°); the second sub-segment 202 As the first edge segment, since the first edge segment is located in the left half of the gray-scaled sole depth map, the horizontal coordinate and the vertical coordinate of the left end pixel of the first edge segment are obtained, and the left end pixel of the first edge segment is used as the first edge detection point 31; the fifth sub-segment 205 is used as the second edge segment, since the second edge segment is located in the right half of the gray-scaled sole depth map, the horizontal coordinate and the vertical coordinate of the right end pixel of the second edge segment are obtained, and the right end pixel of the second edge segment is used as the second edge detection point 32. By screening the edge segments of the segmented gray value curve, the screening process of the edge segments can be simplified, avoiding the problem of difficulty in determining the edge detection point due to screening out multiple edge segments, and improving the efficiency of sole edge detection.
[0070] Also includes:
[0071] S4, in response to determining that there are at least two candidate pixel points on the gray value curve, at least two candidate pixel points have the same vertical coordinate and correspond to at least two gray values, then calculate the distance between each of the at least two candidate pixel points and the adjacent edge detection point, and select the candidate pixel point corresponding to the minimum distance as the edge detection point on the gray value curve.
[0072] Specifically, refer to Figure 8 , execute step S3, if there are the first candidate pixel 33, the second candidate pixel 34, and the third candidate pixel 35 on the gray value curve, then select the third edge detection point 41 and the fourth edge detection point 42 adjacent to the three candidate pixels on the grayed sole depth map, respectively calculate the distances from the first candidate pixel 33, the second candidate pixel 34, and the third candidate pixel 35 to the line between the third edge detection point 41 and the fourth edge detection point 42, and select the second candidate pixel 34 corresponding to the minimum distance as the edge detection point on the gray value curve. Alternatively, only one third edge detection point 41 adjacent to the three candidate pixels on the grayed sole depth map can be selected, and the distances between the three candidate pixels and the third edge detection point 41 can be respectively calculated, and the second candidate pixel 34 corresponding to the minimum distance can be selected as the edge detection point on the gray value curve. By using the adjacent edge detection point filtering method, the corresponding edge detection points on the reference line are quickly screened out from multiple candidate pixels to ensure the efficiency of sole edge detection and improve the accuracy of sole edge detection.
[0073] S5, repeat the above steps until the corresponding edge detection points on each reference line of the gray-scale sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the gray-scale sole depth map.
[0074] Specifically, steps S1-S4 are repeatedly performed to determine the edge detection point corresponding to each reference line of the grayscale sole depth map. Fig. 9 , the edge of the sole is determined according to the edge detection points on the grayscale sole depth map.
[0075] The above steps S1-S5 do not merely represent the order of the steps, but are symbolic representations of the steps.
[0076] Further references Fig.10 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a sole edge detection device based on image gray value analysis. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0077] The embodiment of the present application provides a sole edge detection device based on image gray value analysis, comprising:
[0078] The curve drawing module 1 is configured to obtain a gray-scale sole depth map, set a horizontal axis and a vertical axis on the gray-scale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines that are parallel to the horizontal axis of the gray-scale sole depth map and are arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the gray-scale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line;
[0079] The curve segmentation module 2 is configured to segment the gray value curve according to a preset line segment angle range to obtain a plurality of sub-line segments;
[0080] The edge detection point acquisition module 3 is configured to screen a plurality of the sub-segments according to the angle range of the edge segment, obtain the edge segment on the gray value curve, obtain the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment, and obtain the edge detection point according to the position relationship of the end pixel point on the gray sole depth map;
[0081] The repeated execution module 4 is configured to repeatedly execute the above modules until the corresponding edge detection points on each reference line of the grayscale sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the grayscale sole depth map.
[0082] Reference below Fig.11 , which shows an electronic device (eg Figure 1 A schematic diagram of the structure of a computer device 1100 (a server or terminal device as shown). Fig.11 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0083] like Fig.11 As shown, the computer device 1100 includes a central processing unit (CPU) 1101 and a graphics processing unit (GPU) 1102, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1103 or a program loaded from a storage part 1109 to a random access memory (RAM) 1104. In the RAM 1104, various programs and data required for the operation of the computer device 1100 are also stored. The CPU 1101, the GPU 1102, the ROM 1103, and the RAM 1104 are connected to each other through a bus 1105. An input / output (I / O) interface 1106 is also connected to the bus 1105.
[0084] The following components are connected to the I / O interface 1106: an input section 1107 including a keyboard, a mouse, etc.; an output section 1108 including a display such as a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1109 including a hard disk, etc.; and a communication section 1110 including a network interface card such as a LAN card, a modem, etc. The communication section 1110 performs communication processing via a network such as the Internet. A drive 1111 may also be connected to the I / O interface 1106 as needed. A removable medium 1112, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1111 as needed so that a computer program read therefrom is installed into the storage section 1109 as needed.
[0085] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1110, and / or installed from a removable medium 1112. When the computer program is executed by the central processing unit (CPU) 1101 and the graphics processing unit (GPU) 1102, the above functions defined in the method of the present application are executed.
[0086] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor device, device or component, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution device, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution device, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0087] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] The modules involved in the embodiments described in this application may be implemented by software or hardware, and the modules described may also be set in a processor.
[0090] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or it may exist independently and not be assembled into the electronic device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device: obtains a grayscale sole depth map, sets a horizontal axis and a vertical axis on the grayscale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, sets reference lines that are parallel to the horizontal axis of the grayscale sole depth map and are arranged at equal intervals, obtains the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line, and draws the grayscale value according to the horizontal coordinates and grayscale values of the pixel points on the reference line. to the gray value curve corresponding to the reference line; segment the gray value curve according to the preset line segment angle range to obtain a plurality of sub-segments; screen the plurality of sub-segments according to the angle range of the edge segment to obtain the edge segment on the gray value curve, obtain the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment, and obtain the edge detection point according to the positional relationship of the end pixel point on the gray-scaled sole depth map; repeat the above steps until the edge detection point corresponding to each reference line of the gray-scaled sole depth map is determined, and determine the edge of the sole according to the edge detection point on the gray-scaled sole depth map.
[0091] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A method for detecting the edge of a shoe sole based on image grayscale value analysis, characterized in that: The following steps are involved: Obtain a grayscale sole depth map, set a horizontal axis and a vertical axis on the grayscale sole depth map, the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines that are parallel to the horizontal axis of the grayscale sole depth map and are arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line; Calculating the slope of a line segment between each pixel point on the gray value curve and an adjacent pixel point, obtaining the angle of the line segment according to the slope, traversing the angles of all line segments on the gray value curve, and segmenting the gray value curve according to a preset line segment angle range to obtain a plurality of sub-line segments; Filtering a plurality of sub-segments according to the angle range of the edge segment to obtain the edge segment on the gray value curve, obtaining the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment, and obtaining the edge detection point according to the positional relationship of the end pixel point on the gray-scale sole depth map, specifically comprising: the angle range of the edge segment includes a first edge segment angle range and a second edge segment angle range, filtering each sub-segment according to the first edge segment angle range to obtain the first edge segment, obtaining the horizontal coordinate and the vertical coordinate of the pixel point at the first end of the first edge segment, and obtaining the first edge detection point; filtering each sub-segment according to the second edge segment angle range to obtain the second edge segment, obtaining the horizontal coordinate and the vertical coordinate of the pixel point at the second end of the second edge segment, and obtaining the second edge detection point; The above steps are repeatedly performed until the corresponding edge detection points on each reference line of the gray-scaled sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the gray-scaled sole depth map.
2. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 1, characterized in that: The preset line segment angle range includes [0°, 45°), [45°, 90°), [90°, 135°), [135°, 180°), [180°, 225°), [225°, 270°), [270°, 315°), [315°, 360°); the first edge line segment angle range is [45°, 90°); the second edge line segment angle range is [270°, 315°).
3. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 1, characterized in that: Also includes: In response to determining that there are at least two candidate pixel points on the gray value curve, and the at least two candidate pixel points have the same vertical coordinate and correspond to at least two gray values, the distance between each of the at least two candidate pixel points and the adjacent edge detection point is calculated, and the candidate pixel point corresponding to the minimum distance is selected as the edge detection point on the gray value curve.
4. The method for detecting the edge of a shoe sole based on image grayscale value analysis according to claim 1, characterized in that: The step of obtaining the horizontal coordinates and grayscale values of the pixel points of the grayscale sole depth map corresponding to the reference line specifically includes: selecting the pixel points on the reference line on the grayscale sole depth map according to the set step size, and obtaining the horizontal coordinates and grayscale values of the pixel points on the reference line.
5. A shoe sole edge detection device based on image gray value analysis, characterized in that: include: A curve drawing module is configured to obtain a gray-scale sole depth map, set a horizontal axis and a vertical axis on the gray-scale sole depth map, wherein the vertical axis is parallel to the length direction of the sole, and the horizontal axis is parallel to the width direction of the sole, set reference lines that are parallel to the horizontal axis of the gray-scale sole depth map and are arranged at equal intervals, obtain the horizontal coordinates and grayscale values of the pixel points of the gray-scale sole depth map corresponding to the reference line, and draw a grayscale value curve corresponding to the reference line according to the horizontal coordinates and grayscale values of the pixel points on the reference line; A curve segmentation module is configured to calculate the slope of a line segment between each pixel point on the gray value curve and an adjacent pixel point, obtain the angle of the line segment according to the slope, traverse the angles of all line segments on the gray value curve, and segment the gray value curve according to a preset line segment angle range to obtain a plurality of sub-line segments; The edge detection point acquisition module is configured to screen a plurality of sub-segments according to the angle range of the edge segment to obtain the edge segment on the gray value curve, obtain the horizontal coordinate and the vertical coordinate of the end pixel point of the edge segment, and obtain the edge detection point according to the positional relationship of the end pixel point on the gray-scale sole depth map, specifically comprising: the angle range of the edge segment includes a first edge segment angle range and a second edge segment angle range, each of the sub-segments is screened according to the first edge segment angle range to obtain the first edge segment, and the horizontal coordinate and the vertical coordinate of the pixel point at the first end of the first edge segment are obtained to obtain the first edge detection point; each of the sub-segments is screened according to the second edge segment angle range to obtain the second edge segment, and the horizontal coordinate and the vertical coordinate of the pixel point at the second end of the second edge segment are obtained to obtain the second edge detection point; The repeated execution module is configured to repeatedly execute the above modules until the corresponding edge detection points on each reference line of the gray-scaled sole depth map are determined, and the edge of the sole is determined according to the edge detection points on the gray-scaled sole depth map.
6. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Automatic shoe sole edge line tracking method based on robot
CN104463851A
Laser line stripe edge extraction method
CN105844655A
Lane line detection method and device and electronic device
CN109002795A
Image contour extraction method and system
CN109934834A
Method for generating glue spraying path of special piece sole type sole based on contour splicing
CN115601424A
