Cutting piece size detection method and device, electronic equipment and storage medium

An automated method and device align cut piece images with templates to determine size accurately, addressing inefficiencies and inaccuracies in manual detection, enhancing production quality.

CN119123984APending Publication Date: 2024-12-13SHANGGONG FUYI INTELLIGENT MFG (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411333231.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Manual detection of cut piece size is inefficient, labor-intensive, and prone to false results, failing to ensure the quality of subsequent products due to cutting errors.

Method used

An automated method and device for detecting cut piece size by aligning a cut piece image with a template image using position and rotation adjustments, determining reference point displacement and angle, and calculating contour point distances to assess size accuracy.

Benefits of technology

Improves detection efficiency and accuracy by automating the process, reducing false positives and ensuring higher quality control in cut piece production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119123984A_ABST
    Figure CN119123984A_ABST
Patent Text Reader

Abstract

The invention discloses a cut piece size detection method and device, electronic equipment and a storage medium. According to the specific scheme, a to-be-detected cutting piece image is placed in a detection plane, and first position information of the to-be-detected cutting piece image in the detection plane is determined; determining reference point displacement information and rotation angle information between the to-be-detected cutting piece image and the cutting piece template image based on the first position information and second position information of the cutting piece template image in the detection plane; on the basis of the reference point displacement information and the rotation angle information, each cutting piece contour point in the cutting piece template image is moved, so that a reference point in the cutting piece template image coincides with a reference point in the to-be-detected cutting piece image; and determining a contour point distance between contour points of the same cutting piece in the moved cutting piece template image and the to-be-detected cutting piece image, and determining a size detection result of the to-be-detected cutting piece based on the contour point distance. According to the invention, the automatic detection of the size of the cut-part image is realized, and the detection efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, electronic equipment and storage medium for detecting size of a cut piece. Background Art

[0002] In actual application, the pieces cut by the cutting table may have certain cutting errors, that is, the size of the pieces may not meet the actual production requirements. For example, when cutting multi-layer pieces, the top and bottom pieces often have a large difference in size.

[0003] At present, the method for detecting the size of cutting pieces is usually to manually compare the cutting piece to be detected with the cutting template to determine the detection result. However, manual detection is not only inefficient and labor-intensive, but also subjective and prone to false detection, thus failing to guarantee the quality of subsequent products. Summary of the invention

[0004] The present invention provides a cut piece size detection method, device, electronic equipment and storage medium, which realize automatic detection of the cut piece image size and improve detection efficiency and accuracy.

[0005] According to one aspect of the present invention, a method for detecting the size of a cut piece is provided, the method comprising:

[0006] Placing the image of the cut piece to be detected in the detection plane, and determining first position information of the image of the cut piece to be detected in the detection plane;

[0007] Determine reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image based on the first position information and the second position information of the cutting piece template image in the detection plane;

[0008] Based on the reference point displacement information and the rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected;

[0009] The contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected is determined, and the size detection result of the cutting piece to be detected is determined based on the contour point distance.

[0010] According to another aspect of the present invention, there is provided a device for detecting the size of a cut piece, the device comprising:

[0011] A position information determination module, used for placing the image of the cut piece to be detected in a detection plane and determining first position information of the image of the cut piece to be detected in the detection plane;

[0012] A displacement and angle determination module, used to determine the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image based on the first position information and the second position information of the cutting piece template image in the detection plane;

[0013] An image moving module is used to move each cutting piece contour point in the cutting piece template image based on the reference point displacement information and the rotation angle information, so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected;

[0014] The detection result determination module is used to determine the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result of the cutting piece to be detected based on the contour point distance.

[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the cutting piece size detection method of any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the cutting piece size detection method of any embodiment of the present invention when executed.

[0020] According to another aspect of the present invention, there is provided a computer program product, comprising a computer program, wherein the computer program, when executed by a processor, implements a method for detecting the size of a cut piece according to any embodiment of the present invention.

[0021] The technical solution of the embodiment of the present invention is to place the image of the cutting piece to be detected in the detection plane and determine the first position information of the image of the cutting piece to be detected in the detection plane. Based on the first position information and the second position information of the cutting piece template image in the detection plane, the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image are determined, providing data support for the subsequent movement of the cutting piece template image. Based on the reference point displacement information and rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected, so as to facilitate the determination of the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result according to the contour point distance. The present invention solves the problems of low detection efficiency and false detection caused by manual detection of cutting piece size in the prior art, realizes automatic detection of cutting piece image size, and improves detection efficiency and accuracy.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0024] Figure 1 is a flow chart of a method for detecting the size of a cut piece provided by an embodiment of the present invention;

[0025] Figure 2 is an example diagram of a cut piece contour image and a reference cut piece image provided by an embodiment of the present invention;

[0026] Figure 3 is an example diagram of a cutting piece template image provided by an embodiment of the present invention;

[0027] Figure 4 is an example diagram of a cut piece image to be detected provided by an embodiment of the present invention;

[0028] Figure 5 is a flow chart of a method for detecting the size of a cut piece provided by an embodiment of the present invention;

[0029] Figure 6 is an example diagram of a binary image of a cutting piece template provided by an embodiment of the present invention;

[0030] Figure 7 is an example diagram of a binary image of a piece to be detected provided by an embodiment of the present invention;

[0031] Figure 8 is an example diagram of a difference binary image provided by an embodiment of the present invention;

[0032] Fig. 9 is an example diagram of a marked image of a cut piece to be detected provided by an embodiment of the present invention;

[0033] Fig.10 is an example of a marked image of a cut piece to be detected provided by an embodiment of the present invention.

[0034] Fig.11 is a structural schematic diagram of a cut piece size detection device provided by an embodiment of the present invention;

[0035] Fig.12 It is a structural schematic diagram of an electronic device for implementing the cut piece size detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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 creative work should fall within the scope of protection of the present invention.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] Embodiment 1

[0039] Figure 11 is a flow chart of a method for detecting the size of a cut piece provided in the first embodiment of the present invention. This embodiment is applicable to the case of automatically detecting the size of a cut piece. The method can be executed by a cut piece size detection device. The cut piece size detection device can be implemented in the form of hardware and / or software. The cut piece size detection device can be configured in an electronic device such as a mobile phone, a computer or a server. Figure 1 As shown, the method includes:

[0040] S110, placing the image of the cut piece to be detected in a detection plane, and determining first position information of the image of the cut piece to be detected in the detection plane.

[0041] The image of the cut piece to be detected can be understood as the image of the cut piece that needs to be detected currently. The detection plane can be a plane for placing the image of the cut piece to be detected. Optionally, the detection plane can be a page for displaying the image of the cut piece to be detected. The first position information can be understood as the position information of the image of the cut piece to be detected in the detection plane. Optionally, the first position information can be represented by the coordinates of the center point of the image of the cut piece to be detected in the detection plane, and the first position information can also be represented by the coordinates of the contour points corresponding to multiple contour points of the image of the cut piece to be detected in the detection plane.

[0042] Specifically, a to-be-detected piece is obtained, and an to-be-detected piece image corresponding to the to-be-detected piece is placed in a detection plane. Position detection is performed on the to-be-detected piece image placed on the detection plane to determine first position information of the to-be-detected piece image in the detection plane.

[0043] Exemplarily, the detection plane is a page that displays the image of the cut piece to be detected, and the first position information is the position information corresponding to the coordinates of the center point of the image of the cut piece to be detected as an example for explanation. The cut piece to be detected is obtained, and an image of the cut piece to be detected is collected to obtain the image of the cut piece to be detected. The image of the cut piece to be detected is displayed in the detection plane, and the first position information of the image of the cut piece to be detected in the detection plane is determined according to a preset position detection algorithm. For example, the preset position detection algorithm can be a template matching algorithm, and the image of the cut piece to be detected is processed according to the template matching algorithm to obtain a feature image corresponding to the image of the cut piece to be detected, and the first position information corresponding to the feature image is determined. In addition, the contour point coordinate data of the cut piece image to be detected in the detection plane can be averaged to determine the coordinates of the center point of the cut piece image to be detected in the detection plane. The position information corresponding to the center point coordinates is used as the first position information.

[0044] Before using the cutting piece template image to determine the reference point displacement information and rotation angle information, it is also necessary to determine the cutting piece template image. The cutting piece template image can be determined by placing the reference cutting piece image in a detection plane and determining the reference position information of the reference cutting piece image in the detection plane; using the reference position information as the second position information of the cutting piece template image in the detection plane, and adjusting the standard coordinate data of the cutting piece contour points based on the second position information, so as to generate the cutting piece template image based on the adjusted standard coordinate data.

[0045] Among them, the reference cutting piece image can be understood as an image used to provide position information for the cutting piece template image. The cutting piece template image is a cutting piece image of a standard template, that is, a cutting piece image generated according to the standard coordinate data after adjusting the position. The cutting piece template image can be used to determine whether the size of the cutting piece image to be detected is qualified. The reference position information can be understood as the position information of the reference cutting piece image in the detection plane. Optionally, the reference position information can be represented by the center point coordinates of the reference cutting piece image in the detection plane. In order to improve the calculation efficiency, the reference position information can be used as the second position information of the cutting piece template image in the detection plane. The standard coordinate data of the cutting piece contour point can be pre-set template contour point coordinate data. Optionally, the standard coordinate data of the cutting piece contour point can be obtained from a data file in DXF (Drawing Exchange Format) format.

[0046] Specifically, the reference piece image is placed in the detection plane. According to the contour point coordinate data of at least one contour point of the reference piece image in the detection plane, the reference position information of the reference piece image in the detection plane is determined. And the reference position information is used as the second position information of the piece template image in the detection plane. According to the second position information of the piece template image, the standard coordinate data of the piece contour point is adjusted. That is, the standard coordinate data is adjusted to the position corresponding to the second position information, and the piece template image is generated according to the adjusted standard coordinate data.

[0047] Exemplarily, in combination with the above example, a reference cut piece image is collected and displayed in the detection plane. According to the contour point coordinate data of at least one contour point of the reference cut piece image in the detection plane, the center point coordinates (x1, y1) of the reference cut piece image are determined. The standard coordinate data corresponding to the cut piece contour point is imported, and the cut piece contour image corresponding to the standard coordinate data is moved to the corresponding position of the reference cut piece image. Figure 2 As shown in the figure, the white image is the contour image of the cutting piece corresponding to the standard coordinate data, and the black image is the reference cutting piece image. That is, the white image is moved to the corresponding position of the black image. The center point coordinates (x1, y1) are expressed as the second position information of the cutting piece template image. Based on this, according to the standard coordinate data after the move and the second position information, we can get Figure 3 The cutting piece template image shown in FIG. 1 can be understood that the contour point coordinate data of the cutting piece template image is the standard coordinate data after the movement.

[0048] It should be noted that the acquisition method of the image of the cut piece to be detected is the same as the acquisition method of the reference cut piece image.

[0049] In an embodiment of the present invention, the reference position information of the reference cut piece image in the detection plane may be determined by: determining contour point coordinate data of at least one contour point in the reference cut piece image; performing mean processing on at least one contour point coordinate data to obtain coordinate data to be used of the reference cut piece image; and determining the reference position information of the reference cut piece image based on the coordinate data to be used.

[0050] The contour point coordinate data may be the coordinates of at least one contour point in the reference piece image. For example, the contour point coordinate data may be vertex coordinate data of the reference piece image. The coordinate data to be used may be the center point coordinate data of the reference piece image. The reference position information may be represented by the coordinate data to be used.

[0051] Specifically, the contour point coordinate data of at least one contour point in the reference cut piece image in the detection plane is determined, the contour point coordinate data is averaged, and the to-be-used coordinate data of the reference cut piece image is obtained, and the to-be-used coordinate data is used to represent the reference position information of the reference cut piece image.

[0052] S120, determining reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image based on the first position information and the second position information of the cutting piece template image in the detection plane.

[0053] The reference displacement information can be understood as the distance information between the image of the cutting piece to be detected and the image of the cutting piece template. The rotation angle information can be the angle information between the image of the cutting piece to be detected and the image of the cutting piece template.

[0054] Specifically, according to the image matching algorithm, the first position information of the cutting piece image to be detected and the second position information of the cutting piece template image are processed to determine the reference displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image.

[0055] For example, in conjunction with the above examples, see Figure 4 , Figure 4is an example diagram of the image of the cutting piece to be detected. According to the first position information (x2, y2) of the cutting piece image to be detected and the second position information (x1, y1) of the cutting piece template image, the reference point displacement information and the rotation angle information are determined. For example, according to the first position information (2259.71, 2239.44) of the cutting piece image to be detected and the second position information (2317.49, 2605.50) of the cutting piece template image, the reference displacement information between the cutting piece image to be detected and the cutting piece template image is determined to be 370.56, and the rotation angle information is -148.73 degrees.

[0056] S130, based on the reference point displacement information and the rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected.

[0057] Each contour point of the cutting piece in the cutting piece template image is the standard coordinate data of the movement. The reference point can be a feature point corresponding to the image predetermined according to actual needs. For example, the reference point can be a center point.

[0058] Specifically, each piece contour point in the piece template image is adjusted according to the reference point displacement information and the rotation angle information, so that the reference point in the piece template image coincides with the reference point in the piece image to be detected, thereby realizing the movement of the piece template image.

[0059] For example, in combination with the above example, according to the reference displacement information of 370.56 and the rotation angle information of -148.73 degrees, Figure 3 Each contour point of the cutting piece in the cutting piece template image shown is translated and rotated to Figure 4 At the corresponding position of the image of the cutting piece to be detected, the reference point in the cutting piece template image coincides with the reference point in the image of the cutting piece to be detected.

[0060] S140, determining a contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determining a size detection result of the cutting piece to be detected based on the contour point distance.

[0061] The same cut piece contour point can be understood as the contour point at the same position in the cut piece template image after the movement and the cut piece image to be detected. The contour point distance is the distance between the cut piece contour points at the same position in the cut piece template image after the movement and the cut piece image to be detected. The size detection result can be that the size of the cut piece to be detected is qualified or unqualified.

[0062] Specifically, the contour point distance between each contour point of the cut piece in the moved cut piece template image and the corresponding contour point of the same cut piece in the cut piece image to be detected is determined. Whether the size of the cut piece to be detected is qualified is determined based on the contour point distance. If the contour point distance is greater than or equal to the standard distance threshold, the size of the cut piece to be detected is considered unqualified. Correspondingly, if the contour point distance is less than the standard distance threshold, the size of the cut piece image to be detected is qualified.

[0063] The technical solution of this embodiment is to place the image of the cutting piece to be detected in the detection plane and determine the first position information of the image of the cutting piece to be detected in the detection plane. Based on the first position information and the second position information of the cutting piece template image in the detection plane, the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image are determined, providing data support for the subsequent movement of the cutting piece template image. Based on the reference point displacement information and rotation angle information, each cutting piece contour point of the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected, so as to facilitate the determination of the contour point distance between the moving cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result according to the contour point distance. The present invention solves the problems of low detection efficiency and false detection caused by manual detection of cutting piece size in the prior art, realizes automatic detection of cutting piece image size, and improves detection efficiency and accuracy.

[0064] Embodiment 2

[0065] Figure 5 This is a flow chart of a method for detecting the size of a cutting piece provided in the second embodiment of the present invention. This embodiment is based on the above embodiment and refines the step of "determining the contour point distance between the cut piece template image after the movement and the contour point of the same cut piece in the cut piece image to be detected". The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or corresponding to the above embodiment are not repeated here. Figure 5 As shown, the method includes:

[0066] S210: placing the image of the cut piece to be detected in a detection plane, and determining first position information of the image of the cut piece to be detected in the detection plane.

[0067] S220: Determine reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image based on the first position information and the second position information of the cutting piece template image in the detection plane.

[0068] S230, based on the reference point displacement information and the rotation angle information, each cutting piece contour point of the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected.

[0069] S240, determining a binary image of the cutting piece template corresponding to the moved cutting piece template image and a binary image of the cutting piece to be detected corresponding to the cutting piece image to be detected.

[0070] The binary image of the cutting piece template may be a binary image generated according to the contour point data corresponding to the moved cutting piece template image. The binary image of the cutting piece to be detected may be an image obtained by binarizing the cutting piece image to be detected.

[0071] Specifically, the contour point data corresponding to the cut piece template image is determined according to the moved cut piece template image, that is, the standard coordinate data after translation and rotation. A cut piece template binary image is generated according to the standard coordinate data after translation and rotation. The cut piece image to be detected is binarized to obtain a cut piece binary image to be detected. Based on this, it is convenient to accurately determine the contour point distance between the cut piece image to be detected and the cut piece template image in the subsequent step. For example, see Figure 6 and Figure 7 , Figure 6 This is an example of a binary image of a cutting template. Figure 7 This is an example of a binary image of the piece to be detected.

[0072] In an embodiment of the present invention, the method for determining the binary image of the piece to be detected can be: performing grayscale processing on the image of the piece to be detected to determine the grayscale image of the piece to be detected; performing threshold segmentation on the grayscale image of the piece to be detected, and binarizing the grayscale image of the piece to be detected after threshold segmentation to obtain the binary image of the piece to be detected.

[0073] The grayscale image of the cut piece to be detected is a grayscale image of the cut piece to be detected.

[0074] Specifically, the grayscale image of the cut piece to be detected is processed to obtain a grayscale image of the cut piece to be detected. One or more grayscale thresholds are set. According to the grayscale thresholds, the pixels in the grayscale image of the cut piece to be detected are divided into different categories, and the grayscale images of the cut pieces to be detected divided into different categories are binarized to obtain a binary image of the cut piece to be detected. For example, the pixels in the grayscale image of the cut piece to be detected whose pixel values ​​are higher than the grayscale threshold are set to white, and the pixels whose pixel values ​​are lower than the grayscale threshold are set to black.

[0075] S250 , determining a difference binary image based on the binary image of the cut piece template and the binary image of the cut piece to be detected.

[0076] The difference binary image can be determined based on the pixel difference of the same pixel in the binary image of the clip template and the binary image of the clip to be detected. Figure 8 shown.

[0077] Specifically, the absolute value of the difference between the pixel values ​​of the same pixel point in the binary image of the cut piece template and the binary image of the cut piece to be detected is determined, and the difference binary image is determined according to the absolute value of the difference of each pixel point.

[0078] S260, performing contour point search processing on the difference binary image, determining the contour point distance between the moved cutting piece template image and the cutting piece image to be detected, and determining the size detection result of the cutting piece to be detected based on the contour point distance.

[0079] Specifically, the difference binary image is processed by contour point search to determine the contour point distance between the contour points of the moved cut piece template image and the cut piece image at the same position. According to the contour point distance and the standard distance threshold, the size detection result of the cut piece to be detected is determined. For example, if the contour point distance is greater than or equal to the standard distance threshold, the size detection result of the cut piece to be detected is determined to be unqualified. If the contour point distance is less than the standard distance threshold, the size detection result of the cut piece to be detected is determined to be qualified.

[0080] Optionally, if there is at least one contour point whose corresponding contour point distance is greater than or equal to the standard distance threshold, the size detection result of the cut piece to be detected is determined to be unqualified; if the contour point distance corresponding to each contour point of the cut piece is less than the standard distance threshold, the size detection result of the cut piece to be detected is determined to be qualified.

[0081] The standard distance threshold may be a standard value of the contour point distance set according to actual needs.

[0082] Specifically, if there is at least one contour point whose corresponding contour point distance is greater than or equal to the standard distance threshold, the size detection result of the to-be-detected cut piece is determined to be unqualified. If the contour point distances corresponding to each contour point of the cut piece are less than the standard distance threshold, the size detection result of the to-be-detected cut piece is determined to be qualified.

[0083] For example, the standard distance threshold is 3 mm. If there is at least one contour point whose corresponding contour point distance is greater than or equal to 3 mm, the size detection result of the to-be-detected cut piece is determined to be unqualified. If the contour point distances corresponding to each contour point of the cut piece are less than 3 mm, the size detection result of the to-be-detected cut piece is determined to be qualified.

[0084] Optionally, when the size detection result of the cut piece to be detected is unqualified, the target cut piece contour points whose contour point distances in the cut piece image to be detected exceed the standard distance threshold are marked to obtain a marked cut piece image to be detected; feedback information is generated based on the marked cut piece image to be detected, the contour point distances exceeding the standard distance threshold, and the size detection result, and the feedback information is sent to the target terminal.

[0085] The target piece contour point may be a contour point in the image of the piece to be detected whose distance exceeds a standard distance threshold. The feedback information may include the marked image of the piece to be detected, the distance of the contour point exceeding the standard distance threshold, and the size detection result. The feedback information may remind the corresponding user of the size detection status of the piece to be detected. The target terminal may be a pre-set electronic device for receiving feedback information. The target terminal may be an electronic device such as a mobile phone and a computer.

[0086] Specifically, when the size detection result of the to-be-detected piece is unqualified, the target piece contour points whose contour point distances in the to-be-detected piece image exceed the standard distance threshold are marked to obtain the marked to-be-detected piece image. Feedback information is generated based on the marked to-be-detected piece image, the contour point distances exceeding the standard distance threshold, and the size detection result, and the feedback information is sent to the corresponding target terminal.

[0087] For example, if the distances of all contour points in the image of the cut piece to be detected are less than the standard distance threshold, then an OK mark is displayed on the display plane displaying the image of the cut piece to be detected, such as Fig. 9 If there is at least one contour point whose distance is greater than the standard distance threshold, then NG is marked in the display plane showing the image of the cut piece to be detected, and the contour point distance greater than the standard distance threshold is marked, as shown in FIG. Fig.10 As shown. According to the marked image of the cut piece to be detected, the size detection result and the distance of the contour point greater than the standard distance threshold, it is saved in the corresponding table. And the table is fed back to the target terminal. Based on this, it is convenient for the quality control personnel in the later stage to adjust the accuracy of the cutting equipment to achieve the purpose of improving the quality of the cut piece.

[0088] The technical solution of this embodiment is to place the image of the cutting piece to be detected in the detection plane and determine the first position information of the image of the cutting piece to be detected in the detection plane. Based on the first position information and the second position information of the cutting piece template image in the detection plane, the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image are determined, providing data support for the subsequent movement of the cutting piece template image. Based on the reference point displacement information and rotation angle information, each cutting piece contour point of the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected. Determine the cutting piece template binary image corresponding to the moved cutting piece template image and the cutting piece binary image corresponding to the cutting piece image to be detected. According to the cutting piece template binary image and the cutting piece binary image to be detected, determine the difference binary image. The difference binary image performs contour point search processing, determines the contour point distance between the moved cutting piece template image and the cutting piece image to be detected, and determines the size detection result of the cutting piece to be detected based on the contour point distance. The present invention solves the problems of low detection efficiency and false detection caused by manual detection of cut piece size in the prior art, realizes automatic detection of cut piece image size, and improves detection efficiency and accuracy.

[0089] Embodiment 3

[0090] Fig.11 Schematic diagram of the structure of a cutting piece size detection device provided in the third embodiment of the present invention. Fig.11 As shown, the device includes: a position information determination module 310, a displacement and angle determination module 320, an image movement module 330 and a detection result determination module 340.

[0091] The position information determination module 310 is used to place the image of the cutting piece to be detected in the detection plane and determine the first position information of the image of the cutting piece to be detected in the detection plane; the displacement and angle determination module 320 is used to determine the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image based on the first position information and the second position information of the cutting piece template image in the detection plane; the image movement module 330 is used to move each cutting piece contour point in the cutting piece template image based on the reference point displacement information and the rotation angle information so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected; the detection result determination module 340 is used to determine the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result of the cutting piece to be detected based on the contour point distance.

[0092] The technical solution of this embodiment is to place the image of the cutting piece to be detected in the detection plane and determine the first position information of the image of the cutting piece to be detected in the detection plane. Based on the first position information and the second position information of the cutting piece template image in the detection plane, the reference point displacement information and rotation angle information between the cutting piece image to be detected and the cutting piece template image are determined, providing data support for the subsequent movement of the cutting piece template image. Based on the reference point displacement information and rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected, so as to facilitate the determination of the contour point distance between the moving cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result according to the contour point distance. The present invention solves the problems of low detection efficiency and false detection caused by manual detection of cutting piece size in the prior art, realizes automatic detection of cutting piece image size, and improves detection efficiency and accuracy.

[0093] On the basis of the above-mentioned embodiment, optionally, the device further includes: a template image generation module, including: a reference position information determination unit, used to place the reference cutting piece image in the detection plane, and determine the reference position information of the reference cutting piece image in the detection plane; a cutting piece template image determination unit, used to use the reference position information as the second position information of the cutting piece template image in the detection plane, and based on the second position information, adjust the standard coordinate data of the cutting piece contour points to generate the cutting piece template image based on the adjusted standard coordinate data.

[0094] Optionally, a reference position information determination unit is used to determine contour point coordinate data of at least one contour point in a reference cut piece image; perform mean processing on at least one contour point coordinate data to obtain coordinate data to be used of the reference cut piece image; and determine reference position information of the reference cut piece image based on the coordinate data to be used.

[0095] Optionally, the detection result determination module includes: an image binarization processing unit, which is used to determine the binary image of the cutting piece template corresponding to the moved cutting piece template image and the binary image of the cutting piece to be detected corresponding to the cutting piece image to be detected; a difference binary image determination unit, which is used to determine the difference binary image based on the cutting piece template binary image and the binary image of the cutting piece to be detected; and a contour point distance determination unit, which is used to perform contour point search processing on the difference binary image to determine the contour point distance between the moving cutting piece template image and the cutting piece image to be detected.

[0096] Optionally, an image binarization processing unit is used to perform grayscale processing on the image of the piece to be detected to determine the grayscale image of the piece to be detected; perform threshold segmentation on the grayscale image of the piece to be detected, and binarize the grayscale image of the piece to be detected after threshold segmentation to obtain a binary image of the piece to be detected.

[0097] Optionally, a detection result determination module is used to determine that the size detection result of the cutting piece to be detected is unqualified if there is at least one cutting piece contour point whose corresponding contour point distance is greater than or equal to a standard distance threshold; if the contour point distance corresponding to each cutting piece contour point is less than the standard distance threshold, determine that the size detection result of the cutting piece to be detected is qualified.

[0098] Optionally, the device also includes: an information feedback module, which is used to mark the target piece contour points whose contour point distances in the image of the piece to be detected exceed the standard distance threshold when the size detection result of the piece to be detected is unqualified, so as to obtain a marked image of the piece to be detected; based on the marked image of the piece to be detected, the contour point distances exceeding the standard distance threshold and the size detection result, generate feedback information, and send the feedback information to the target terminal.

[0099] The cutting piece size detection device provided in the embodiment of the present invention can execute the cutting piece size detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0100] Embodiment 4

[0101] Fig.12 1 is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0102] like Fig.12 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0103] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0104] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a cut piece size detection method.

[0105] In some embodiments, the cutting piece size detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the cutting piece size detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the cutting piece size detection method in any other appropriate manner (e.g., by means of firmware).

[0106] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0107] The computer program for implementing the cutting piece size detection method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0108] Embodiment 5

[0109] Embodiment 5 of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute a method for detecting the size of a cut piece, the method comprising:

[0110] The image of the cutting piece to be detected is placed in the detection plane, and the first position information of the cutting piece image to be detected in the detection plane is determined; based on the first position information and the second position information of the cutting piece template image in the detection plane, the reference point displacement information and the rotation angle information between the cutting piece image to be detected and the cutting piece template image are determined; based on the reference point displacement information and the rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected; the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected is determined, and the size detection result of the cutting piece to be detected is determined based on the contour point distance.

[0111] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0112] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0113] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0114] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0116] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting the size of a cut piece, characterized in that: include: Placing the image of the cut piece to be detected in a detection plane, and determining first position information of the image of the cut piece to be detected in the detection plane; Determine reference point displacement information and rotation angle information between the to-be-detected cutting piece image and the cutting piece template image based on the first position information and second position information of the cutting piece template image in the detection plane; Based on the reference point displacement information and the rotation angle information, each cutting piece contour point in the cutting piece template image is moved so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected; Determine the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result of the cutting piece to be detected based on the contour point distance.

2. The method according to claim 1, characterized in that Also includes: Placing a reference cut piece image in the detection plane, and determining reference position information of the reference cut piece image in the detection plane; The reference position information is used as second position information of the cutting piece template image in the detection plane, and based on the second position information, the standard coordinate data of the cutting piece contour points is adjusted to generate the cutting piece template image based on the adjusted standard coordinate data.

3. The method according to claim 2, characterized in that The determining the reference position information of the reference piece image in the detection plane includes: Determine contour point coordinate data of at least one contour point in the reference piece image; Performing mean processing on at least one of the contour point coordinate data to obtain the coordinate data to be used of the reference piece image; Based on the coordinate data to be used, reference position information of the reference piece image is determined.

4. The method according to claim 1, characterized in that: The step of determining the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected comprises: Determine a binary image of a cutting piece template corresponding to the moved cutting piece template image and a binary image of a cutting piece to be detected corresponding to the cutting piece image to be detected; Determine a difference binary image based on the binary image of the cut piece template and the binary image of the cut piece to be detected; The difference binary image is subjected to contour point search processing to determine the contour point distance between the moved cutting piece template image and the cutting piece image to be detected.

5. The method according to claim 4, characterized in that The step of determining the binary image of the clip to be detected corresponding to the clip image to be detected includes: Performing grayscale processing on the image of the cut piece to be detected to determine a grayscale image of the cut piece to be detected; Threshold segmentation is performed on the grayscale image of the to-be-detected piece, and the grayscale image of the to-be-detected piece after the threshold segmentation is binarized to obtain a binary image of the to-be-detected piece.

6. The method according to claim 1, characterized in that The step of determining the size detection result of the to-be-detected piece based on the contour point distance comprises: If there is at least one contour point whose corresponding contour point distance is greater than or equal to the standard distance threshold, it is determined that the size detection result of the to-be-detected cut piece is unqualified; If the contour point distances corresponding to each contour point of the cutting piece are all less than the standard distance threshold, it is determined that the size detection result of the cutting piece to be detected is qualified.

7. The method according to any one of claims 1 to 6, characterized in that: Also includes: When the size detection result of the to-be-detected cutting piece is unqualified, marking the target cutting piece contour points in the to-be-detected cutting piece image whose contour point distance exceeds the standard distance threshold, so as to obtain a marked cutting piece image to be detected; Based on the marked image of the cut piece to be detected, the distance of the contour points exceeding the standard distance threshold, and the size detection result, feedback information is generated and sent to the target terminal.

8. A cutting piece size detection device, characterized in that: include: A position information determination module, used for placing the image of the cutting piece to be detected in a detection plane, and determining first position information of the image of the cutting piece to be detected in the detection plane; a displacement and angle determination module, configured to determine reference point displacement information and rotation angle information between the to-be-detected cutting piece image and the cutting piece template image based on the first position information and second position information of the cutting piece template image in the detection plane; An image moving module, used for moving each cutting piece contour point in the cutting piece template image based on the reference point displacement information and the rotation angle information, so that the reference point in the cutting piece template image coincides with the reference point in the cutting piece image to be detected; The detection result determination module is used to determine the contour point distance between the moved cutting piece template image and the same cutting piece contour point in the cutting piece image to be detected, and determine the size detection result of the cutting piece to be detected based on the contour point distance.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the cutting piece size detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the cutting piece size detection method according to any one of claims 1 to 7 when executed.