CN111932491A - Component detection method, device and storage medium - Google Patents

Component detection method, device and storage medium Download PDF

Info

Publication number
CN111932491A
CN111932491A CN202010579296.2A CN202010579296A CN111932491A CN 111932491 A CN111932491 A CN 111932491A CN 202010579296 A CN202010579296 A CN 202010579296A CN 111932491 A CN111932491 A CN 111932491A
Authority
CN
China
Prior art keywords
detected
image
size
component
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010579296.2A
Other languages
Chinese (zh)
Other versions
CN111932491B (en
Inventor
罗文君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LCFC Hefei Electronics Technology Co Ltd
Original Assignee
LCFC Hefei Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LCFC Hefei Electronics Technology Co Ltd filed Critical LCFC Hefei Electronics Technology Co Ltd
Priority to CN202010579296.2A priority Critical patent/CN111932491B/en
Publication of CN111932491A publication Critical patent/CN111932491A/en
Application granted granted Critical
Publication of CN111932491B publication Critical patent/CN111932491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a component detection method, a device and a computer readable storage medium, firstly, carrying out image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected; then, acquiring the structured information of the object to be detected and all parts of the object to be detected from a format file corresponding to the object to be detected; then converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected; and finally, mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image.

Description

Component detection method, device and storage medium
Technical Field
The present invention relates to image detection technologies, and in particular, to a method and an apparatus for detecting a component, and a computer-readable storage medium.
Background
In the big context of intelligent manufacturing, the analysis of data, fully mining the value thereof, is the key content of intelligent manufacturing. And the design data in the research and development design stage is used for guiding the assembly and appearance detection flow in the production process of the product, thereby being beneficial to improving the flexibility and the industrial automation level of the assembly line. Therefore, how to guide the assembly error and the appearance defect detection of the product components through the product design drawing is a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention creatively provides a component detection method, a component detection device and a computer-readable storage medium.
According to a first aspect of the present invention, there is provided a component detection method, the method comprising: carrying out image positioning on a detection image of an object to be detected to obtain an original point coordinate and a size of the object to be detected; acquiring the structured information of the object to be detected and all parts thereof from a format file corresponding to the object to be detected; converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected; and mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image.
According to an embodiment of the present invention, after obtaining the position of the part to be detected in the detection image, the method further includes: and intercepting a corresponding component image according to the position of the component to be detected in the detection image.
According to an embodiment of the invention, the method further comprises: acquiring the structural information of the object to be detected and all parts of the object to be detected from a design drawing of the object to be detected; and storing the structured information of the object to be detected and each part thereof to a corresponding format file.
According to one embodiment of the present invention, the following method is adopted to obtain the structural information of the object to be detected and its components from the design drawing of the object to be detected: marking the design drawing of the object to be detected according to a specified rule to obtain a template image; and extracting the structural information of the object to be detected and each part of the object to be detected from the template image by using an image processing algorithm.
According to an embodiment of the present invention, the marking a design drawing of the object to be detected according to a specified rule includes: and marking the design drawing of the object to be detected by adopting different pixel colors according to each part corresponding to the object to be detected.
According to an embodiment of the present invention, the extracting the structural information of the object to be detected and its components from the template image by using an image processing algorithm includes: traversing pixels in the template image to obtain a non-zero pixel set; traversing the non-zero pixel set, calculating to obtain a minimum vertical circumscribed rectangle, and taking the initial point coordinate and the size of the minimum vertical circumscribed rectangle as the structural information of the object to be detected; and traversing the marked pixels of each part of the object to be detected respectively, and calculating to obtain the structural information of each part.
According to an embodiment of the present invention, the traversing the labeled pixels of each part of the object to be detected, and calculating to obtain the structured information of each part includes: traversing the marked pixels of various circular components, and calculating to obtain a minimum vertical circumscribed rectangle so as to obtain the coordinates and the radius of the central point of each circular component; and traversing the marking pixels of other non-circular parts, and determining the boundary contour of the other non-circular parts to obtain the inflection point coordinates of the boundary contour.
According to a second aspect of the present invention, there is also provided a component inspection apparatus, the apparatus comprising: the image positioning module is used for carrying out image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected; the information acquisition module is used for acquiring the structured information of the object to be detected and all parts of the object to be detected from the format file corresponding to the object to be detected; the size conversion module is used for converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected; and the positioning module is used for mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image.
According to an embodiment of the invention, the apparatus further comprises: and the image intercepting module is used for intercepting a corresponding component image according to the position of the component to be detected in the detection image after the position of the component to be detected in the detection image is obtained by the positioning module.
According to an embodiment of the invention, the apparatus further comprises: the information acquisition module is also used for acquiring the structured information of the object to be detected and all parts thereof from the design drawing of the object to be detected; and the storage module is used for storing the structured information of the object to be detected and all parts thereof to the corresponding format file.
According to an embodiment of the present invention, the information obtaining module obtains the structural information of the object to be detected and its components from the design drawing of the object to be detected by the following method: marking the design drawing of the object to be detected according to a specified rule to obtain a template image; and extracting the structural information of the object to be detected and each part of the object to be detected from the template image by using an image processing algorithm.
According to an embodiment of the present invention, the information obtaining module is specifically configured to mark the design drawing of the object to be detected in a manner of respectively adopting different pixel colors corresponding to each part of the object to be detected.
According to an embodiment of the present invention, the information obtaining module is specifically configured to traverse pixels in the template image to obtain a non-zero pixel set; traversing the non-zero pixel set, calculating to obtain a minimum vertical circumscribed rectangle, and taking the initial point coordinate and the size of the minimum vertical circumscribed rectangle as the structural information of the object to be detected; and traversing the marked pixels of each part of the object to be detected respectively, and calculating to obtain the structural information of each part.
According to an embodiment of the present invention, the information obtaining module is further configured to traverse the labeled pixels of the various circular components, and calculate to obtain a minimum vertical circumscribed rectangle, so as to obtain coordinates and radii of center points of the various circular components; and traversing the marking pixels of other non-circular parts, and determining the boundary contour of the other non-circular parts to obtain the inflection point coordinates of the boundary contour.
According to a third aspect of the present invention, there is also provided a computer-readable storage medium comprising a set of computer-executable instructions which, when executed, perform any of the above-described component detection methods.
According to the component detection method, the component detection device and the computer readable storage medium, firstly, image positioning is carried out on a detection image of an object to be detected, and the origin coordinate and the size of the object to be detected are obtained; then, acquiring the structured information of the object to be detected and all parts of the object to be detected from a format file corresponding to the object to be detected; then converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected; and finally, mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image. Therefore, the invention obtains the structural information of the image template by reading the format file corresponding to the object to be detected, and further obtains the position of the part to be detected in the image by data scale conversion, thereby preparing for the detection process of the assembly error and the appearance defect of the part.
It is to be understood that the teachings of the present invention need not achieve all of the above-described benefits, but rather that specific embodiments may achieve specific technical results, and that other embodiments of the present invention may achieve benefits not mentioned above.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
FIG. 1 is a first schematic flow chart illustrating an implementation of a component detection method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a second implementation flow of the component detection method according to the embodiment of the present invention;
FIG. 3 is a simplified flow diagram of a component detection method according to an exemplary embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating rules for marking a design drawing with different pixel colors according to an embodiment of the present invention;
fig. 5 is a schematic diagram showing the component structure of the component detection apparatus according to the embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given only to enable those skilled in the art to better understand and to implement the present invention, and do not limit the scope of the present invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The technical solution of the present invention is further elaborated below with reference to the drawings and the specific embodiments.
Fig. 1 shows a first implementation flow diagram of a component detection method according to an embodiment of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a component detection method, including: operation 101, performing image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected; operation 102, obtaining the structured information of the object to be detected and each part of the object to be detected from the format file corresponding to the object to be detected; operation 103, converting the structured information of the object to be detected and each part of the object to be detected to the same size as the product image according to the original point coordinate and the size of the object to be detected; and an operation 104, mapping the structural information of each part subjected to size conversion into the detection image, and obtaining the position of the part to be detected in the detection image.
Before the operations 101-103, the embodiment of the invention firstly uses a structured template generated by design data to guide the assembly and appearance detection flow in the production process of the product. Specifically, firstly, obtaining structural information of the object to be detected and each part of the object to be detected from a design drawing of the object to be detected; and then storing the structured information of the object to be detected and each part thereof to a corresponding format file. Therefore, the structured template is generated by using the design data, and compared with a modeling mode of real object shooting, the modeling process is short in time consumption, convenient to operate and stable and reliable in effect.
In operation 101, an image positioning method is used to perform image positioning on a detection image of an object to be detected, so as to obtain an origin coordinate and a size of the object to be detected. Wherein, the origin coordinates can be recorded as pt _ test (x, y); the dimensions may include the width and height of the object map to be detected, denoted as width _ test and height _ test, respectively.
Next, in operation 102, a format file, such as a YML file, corresponding to the object to be detected is read, so as to obtain a structured information file of the object to be detected and each component thereof from the format file corresponding to the object to be detected, and obtain structured information of the object to be detected.
Further, in operation 103-104, the structured information is converted to the same scale as the image to be detected according to the origin coordinates and the size of the object to be detected; and mapping the position of the part into the image to be detected by adopting a specific calculation formula to obtain the position of the part to be detected in the detection image.
In one embodiment, the method further comprises: after operation 104, a corresponding part image is intercepted according to the position of the part to be detected in the detection image, so as to prepare for a part assembly error and appearance defect detection process.
Therefore, the invention obtains the structural information of the image template by reading the format file corresponding to the object to be detected, and further obtains the position of the part to be detected in the image by data scale conversion, thereby preparing for the detection process of the assembly error and the appearance defect of the part.
FIG. 2 is a schematic diagram illustrating a second implementation flow of the component detection method according to the embodiment of the present invention; FIG. 3 is a simplified flow diagram of a component detection method according to an exemplary embodiment of the present invention; FIG. 4 is a schematic diagram illustrating rules for marking a design drawing with different pixel colors according to an embodiment of the present invention.
Referring to fig. 2, an embodiment of the present invention further provides a component detection method, where the method includes: operation 201, obtaining structural information of an object to be detected and each part of the object to be detected from a design drawing of the object to be detected; operation 202, storing the structural information of the object to be detected and each part thereof to a corresponding format file; operation 203, performing image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected; operation 204, obtaining the structured information of the object to be detected and each part of the object to be detected from the format file corresponding to the object to be detected; operation 205, converting the structured information of the object to be detected and each part of the object to be detected to the same size as the product image according to the origin coordinates and the size of the object to be detected; in operation 206, the structural information of each part subjected to size conversion is mapped into the detection image, and the position of the part to be detected in the detection image is obtained.
According to the embodiment of the invention, the structured template generated by using the design data is used for guiding the assembly and appearance detection flow in the production process of the product through operations 201-202; and then, obtaining the structural information of the image template by reading the format file corresponding to the object to be detected through operations 203-206, and further obtaining the position of the part to be detected in the image through data scale conversion, thereby preparing for a part assembly error and appearance defect detection process.
In operation 201, referring to fig. 3, structured information of the object to be detected and its components is obtained from a design drawing of the object to be detected in the following manner: firstly, marking a design drawing of the object to be detected according to a specified rule to obtain a template image; and then extracting the structural information of the object to be detected and each part of the object to be detected from the template image by using an image processing algorithm.
In an application example, a template image is obtained by marking a design drawing of an object to be detected in different pixel colors according to each part corresponding to the object to be detected, specifically referring to a marking rule shown in fig. 4.
And then, extracting the structural information of the object to be detected and each part thereof from the template image by using an image processing algorithm, namely extracting the dimension, the coordinate and the shape information of the object and each part in the template image. The image processing algorithm specifically operates as follows:
operation 1, traverse the pixels in the template image, obtain a non-zero set of pixels, i.e., traverse the pixels in the image, obtain a set of non-zero (RGB: 0, 0, 0) pixels, i.e., a non-zero set of pixels c _ pts.
And 2, traversing the non-zero pixel set, calculating to obtain a minimum vertical circumscribed rectangle, and taking the initial point coordinate and the size of the minimum vertical circumscribed rectangle as the structural information of the object to be detected.
Specifically, traversing the non-zero pixel set c _ pts, calculating a minimum vertical bounding rectangle of the c _ pts, the upper left point coordinate of the minimum vertical bounding rectangle is denoted as the initial point pt _ ori (x, y), and the width and height of the image template are denoted as the width _ ori and height _ ori, respectively.
And operation 3, traversing the marking pixels of each part of the object to be detected respectively, and calculating to obtain the structural information of each part.
Specifically, traversing the marked pixels of various circular components, and calculating to obtain the minimum vertical circumscribed rectangle so as to obtain the coordinates and the radius of the central point of each circular component. Taking screws as an example, the minimum vertical circumscribed rectangle of the pixel set is calculated to obtain the coordinates (screen) of the center points of various screwsi.x,screwiY) and radius, the specific calculation formula is as follows:
Figure BDA0002551799370000071
wherein (rect)i.x,recti.y)、recti.width、rectiHeight is the coordinate of the upper left point of the smallest vertical circumscribed rectangle, the rectangle is wide, the rectangle is high, and i is the screw number.
Further, traversing the marking pixels of other non-circular parts, and determining the boundary contour of the other non-circular parts to obtain the inflection point coordinates of the boundary contour. Taking a memory bank as an example, a boundary contour of the memory bank is an irregular shape, the position and the shape of the memory bank are described by using an inflection point of the boundary contour, and a coordinate calculation formula of the inflection point is as follows:
Figure BDA0002551799370000081
wherein, the inflection _ pt is the inflection point of the boundary contour, and j is the inflection point number.
In operation 202, the structured information of the object to be detected and its components is saved to a corresponding format file, such as a YML file.
After the format file of the structural information of the detected object and each part thereof is obtained based on the operations 201 to 202, the position of the detected part in the image can be further obtained by the format file through the operations 203 to 206.
Specifically, in operation 203, an image of a detection image of an object to be detected is located by using an image locating method, and an origin coordinate and a size of the object to be detected are obtained. Wherein, the origin coordinates can be recorded as pt _ test (x, y); the dimensions may include the width and height of the object map to be detected, denoted as width _ test and height _ test, respectively.
Next, in operation 204, a format file, such as a YML file, corresponding to the object to be detected is read, so as to obtain a structured information file of the object to be detected and each component thereof from the format file corresponding to the object to be detected, and obtain structured information of the object to be detected.
Further, in operations 205-206, the structured information is converted to the same scale as the image to be detected according to the origin coordinates and the size of the object to be detected; and then, mapping the position of the part into the image to be detected by adopting a specific calculation formula to obtain the position of the part to be detected in the detection image, wherein the specific calculation formula is as follows:
Figure BDA0002551799370000091
in an implementation, referring to fig. 3, the method further includes: after operation 206, the corresponding part image is intercepted according to the position of the part to be detected in the detection image, so as to prepare for a part assembly error and appearance defect detection process.
Therefore, the method is based on the operations 201-202, the structured template generated by the design data is used for guiding the assembly and appearance detection processes in the production process of the product, and the flexibility and the industrial automation level of the assembly line are improved; the structured template is generated by using the design data, and compared with a modeling mode of real object shooting, the modeling process is short in time consumption, convenient to operate and stable and reliable in effect. And moreover, the object and the part to be detected in the design drawing are marked by using the specified color, the information in the template is obtained by retrieving the pixel of the specified color in the template image, the identification of the color of the pixel of the image is accurate and reliable, the identification error condition easily caused by the identification of other parts is avoided, the generated structured template information is accurate and reliable, and the serious error caused by the inaccuracy of the template is avoided.
In addition, through the operations 201-206, on the basis of obtaining the format file of the structural information of the detected object and each part of the detected object, the structural information of the image template is obtained by reading the format file corresponding to the detected object, and the position of the detected part in the image is further obtained through data scale conversion, so that preparation is made for a part assembly error and appearance defect detection process.
Similarly, based on the component detection method described above, an embodiment of the present invention further provides a computer-readable storage medium storing a program, which, when executed by a processor, causes the processor to perform at least the following operation steps: operation 101, performing image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected; operation 102, obtaining the structured information of the object to be detected and each part of the object to be detected from the format file corresponding to the object to be detected; operation 103, converting the structured information of the object to be detected and each part of the object to be detected to the same size as the product image according to the original point coordinate and the size of the object to be detected; and an operation 104, mapping the structural information of each part subjected to size conversion into the detection image, and obtaining the position of the part to be detected in the detection image.
Further, based on the component detection method as described above, an embodiment of the present invention further provides a component detection apparatus, as shown in fig. 5, where the apparatus 50 includes: the image positioning module 501 is configured to perform image positioning on a detection image of an object to be detected, so as to obtain an origin coordinate and a size of the object to be detected; an information obtaining module 502, configured to obtain structured information of the object to be detected and each component thereof from a format file corresponding to the object to be detected; the size conversion module 503 is configured to convert the structured information of the object to be detected and each component thereof to the same size as the product image according to the origin coordinate and the size of the object to be detected; and a positioning module 504, configured to map the structural information of each component subjected to size conversion into the detection image, and obtain a position of the component to be detected in the detection image.
According to an embodiment of the invention, the apparatus 50 further comprises: and the image intercepting module is used for intercepting a corresponding component image according to the position of the component to be detected in the detection image after the position of the component to be detected in the detection image is obtained by the positioning module.
According to an embodiment of the invention, the apparatus 50 further comprises: the information acquisition module is also used for acquiring the structural information of the object to be detected and all parts of the object to be detected from the design drawing of the object to be detected; and the storage module is used for storing the structured information of the object to be detected and all parts thereof to the corresponding format file.
According to an embodiment of the present invention, the information obtaining module obtains the structural information of the object to be detected and its components from the design drawing of the object to be detected by the following method: marking the design drawing of the object to be detected according to a specified rule to obtain a template image; and extracting the structural information of the object to be detected and each part of the object to be detected from the template image by using an image processing algorithm.
According to an embodiment of the present invention, the information obtaining module is specifically configured to mark the design drawing of the object to be detected in a manner of respectively adopting different pixel colors corresponding to each part of the object to be detected.
According to an embodiment of the present invention, the information obtaining module is specifically configured to traverse pixels in the template image to obtain a non-zero pixel set; traversing the non-zero pixel set, calculating to obtain a minimum vertical circumscribed rectangle, and taking the initial point coordinate and the size of the minimum vertical circumscribed rectangle as the structural information of the object to be detected; and traversing the marked pixels of each part of the object to be detected respectively, and calculating to obtain the structural information of each part.
According to an embodiment of the present invention, the information obtaining module is further configured to traverse the labeled pixels of the various circular components, and calculate to obtain a minimum vertical circumscribed rectangle, so as to obtain coordinates and radii of center points of the various circular components; and traversing the marking pixels of other non-circular parts, and determining the boundary contour of the other non-circular parts to obtain the inflection point coordinates of the boundary contour.
Here, it should be noted that: the above description of the embodiment of the component detecting apparatus is similar to the description of the method embodiment shown in fig. 1 to 4, and has similar beneficial effects to the method embodiment shown in fig. 1 to 4, and therefore, the description is omitted. For technical details that are not disclosed in the embodiment of the component detection apparatus of the present invention, please refer to the description of the method embodiment shown in fig. 1 to 4 of the present invention for understanding, and therefore, for brevity, will not be described again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A method for component inspection, the method comprising:
carrying out image positioning on a detection image of an object to be detected to obtain an original point coordinate and a size of the object to be detected;
acquiring the structured information of the object to be detected and all parts thereof from a format file corresponding to the object to be detected;
converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected;
and mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image.
2. The method according to claim 1, wherein after obtaining the position of the part to be detected in the inspection image, the method further comprises:
and intercepting a corresponding component image according to the position of the component to be detected in the detection image.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
acquiring the structural information of the object to be detected and all parts of the object to be detected from a design drawing of the object to be detected;
and storing the structured information of the object to be detected and each part thereof to a corresponding format file.
4. The method according to claim 3, characterized in that the structured information of the object to be detected and its components is obtained from the design paper of the object to be detected in the following way:
marking the design drawing of the object to be detected according to a specified rule to obtain a template image;
and extracting the structural information of the object to be detected and each part of the object to be detected from the template image by using an image processing algorithm.
5. The method according to claim 4, wherein the marking of the design drawing of the object to be detected according to the specified rule comprises:
and marking the design drawing of the object to be detected by adopting different pixel colors according to each part corresponding to the object to be detected.
6. The method according to claim 4 or 5, wherein the extracting the structural information of the object to be detected and parts thereof from the template image by using an image processing algorithm comprises:
traversing pixels in the template image to obtain a non-zero pixel set;
traversing the non-zero pixel set, calculating to obtain a minimum vertical circumscribed rectangle, and taking the initial point coordinate and the size of the minimum vertical circumscribed rectangle as the structural information of the object to be detected;
and traversing the marked pixels of each part of the object to be detected respectively, and calculating to obtain the structural information of each part.
7. The method according to claim 6, wherein the step of respectively traversing the labeled pixels of the components of the object to be detected to calculate the structural information of the components comprises:
traversing the marked pixels of various circular components, and calculating to obtain a minimum vertical circumscribed rectangle so as to obtain the coordinates and the radius of the central point of each circular component;
and traversing the marking pixels of other non-circular parts, and determining the boundary contour of the other non-circular parts to obtain the inflection point coordinates of the boundary contour.
8. A component inspection apparatus, the apparatus comprising:
the image positioning module is used for carrying out image positioning on a detection image of an object to be detected to obtain an origin coordinate and a size of the object to be detected;
the information acquisition module is used for acquiring the structured information of the object to be detected and all parts of the object to be detected from the format file corresponding to the object to be detected;
the size conversion module is used for converting the structured information of the object to be detected and all parts of the object to be detected to the size which is the same as the size of the product image according to the original point coordinate and the size of the object to be detected;
and the positioning module is used for mapping the structural information of each part subjected to size conversion into the detection image to obtain the position of the part to be detected in the detection image.
9. The apparatus of claim 8, further comprising:
and the image intercepting module is used for intercepting a corresponding component image according to the position of the component to be detected in the detection image after the position of the component to be detected in the detection image is obtained by the positioning module.
10. A computer-readable storage medium comprising a set of computer-executable instructions that, when executed, perform the component detection method of any of claims 1 to 7.
CN202010579296.2A 2020-06-23 2020-06-23 Component detection method, device and storage medium Active CN111932491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010579296.2A CN111932491B (en) 2020-06-23 2020-06-23 Component detection method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010579296.2A CN111932491B (en) 2020-06-23 2020-06-23 Component detection method, device and storage medium

Publications (2)

Publication Number Publication Date
CN111932491A true CN111932491A (en) 2020-11-13
CN111932491B CN111932491B (en) 2022-02-08

Family

ID=73317618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010579296.2A Active CN111932491B (en) 2020-06-23 2020-06-23 Component detection method, device and storage medium

Country Status (1)

Country Link
CN (1) CN111932491B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102704215A (en) * 2012-04-24 2012-10-03 东南大学 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision
CN105352975A (en) * 2015-12-02 2016-02-24 湖南拓达结构监测技术有限公司 Bridge cable appearance detecting method
US20160110602A1 (en) * 2014-10-17 2016-04-21 Omron Corporation Area information estimating device, area information estimating method, and air conditioning apparatus
CN108627095A (en) * 2017-03-15 2018-10-09 上海华太数控技术有限公司 A kind of machine vision metrology method of parts length and width dimensions
CN108648175A (en) * 2018-04-12 2018-10-12 杭州兆图科技有限公司 A kind of detection method and device
CN110533714A (en) * 2019-08-21 2019-12-03 合肥晌玥科技有限公司 Method and system based on image processing techniques detection target object maximum inscribed circle
CN110596121A (en) * 2019-09-12 2019-12-20 南京旷云科技有限公司 Keyboard appearance detection method and device and electronic system
CN111210442A (en) * 2020-01-02 2020-05-29 广东博智林机器人有限公司 Drawing image positioning and correcting method and device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102704215A (en) * 2012-04-24 2012-10-03 东南大学 Automatic cutting method of embroidery cloth based on combination of DST file parsing and machine vision
US20160110602A1 (en) * 2014-10-17 2016-04-21 Omron Corporation Area information estimating device, area information estimating method, and air conditioning apparatus
CN105352975A (en) * 2015-12-02 2016-02-24 湖南拓达结构监测技术有限公司 Bridge cable appearance detecting method
CN108627095A (en) * 2017-03-15 2018-10-09 上海华太数控技术有限公司 A kind of machine vision metrology method of parts length and width dimensions
CN108648175A (en) * 2018-04-12 2018-10-12 杭州兆图科技有限公司 A kind of detection method and device
CN110533714A (en) * 2019-08-21 2019-12-03 合肥晌玥科技有限公司 Method and system based on image processing techniques detection target object maximum inscribed circle
CN110596121A (en) * 2019-09-12 2019-12-20 南京旷云科技有限公司 Keyboard appearance detection method and device and electronic system
CN111210442A (en) * 2020-01-02 2020-05-29 广东博智林机器人有限公司 Drawing image positioning and correcting method and device and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BIN FANG 等: "Fabric Defect Detection Using Vision-Based Tactile Sensor", 《ARXIV》 *
杨梅: "利用数字图像处理技术测量零件几何尺寸", 《吉林工程技术师范学院学报》 *
韩向可 等: "基于机器视觉的复杂零件外观尺寸检测", 《装备制造技术》 *

Also Published As

Publication number Publication date
CN111932491B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US20190279045A1 (en) Methods and apparatuses for identifying object category, and electronic devices
CN109977191B (en) Problem map detection method, device, electronic equipment and medium
CN111767911A (en) Seal character detection and identification method, device and medium oriented to complex environment
WO2018233055A1 (en) Method and apparatus for entering policy information, computer device and storage medium
CN109343920B (en) Image processing method and device, equipment and storage medium thereof
JP2020533654A (en) Holographic anti-counterfeit code inspection method and equipment
US20180253852A1 (en) Method and device for locating image edge in natural background
CN111625668B (en) Object detection and candidate filtering system
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN111222548A (en) Similar image detection method, device, equipment and storage medium
CN116168351B (en) Inspection method and device for power equipment
CN111353502B (en) Digital table identification method and device and electronic equipment
CN109241555A (en) A kind of more pel Gerber document analysis and method for drafting improving drafting accuracy
CN112215811A (en) Image detection method and device, electronic equipment and storage medium
CN113255686A (en) Method and device for identifying seal in image, processing equipment and storage medium
CN115311469A (en) Image labeling method, training method, image processing method and electronic equipment
CN114005126A (en) Table reconstruction method and device, computer equipment and readable storage medium
CN111932491B (en) Component detection method, device and storage medium
CN111723799A (en) Coordinate positioning method, device, equipment and storage medium
CN110162362B (en) Dynamic control position detection and test method, device, equipment and storage medium
CN108182677B (en) Prepress register detection method, prepress register detection device and computer readable storage medium
CN107861931B (en) Template file processing method and device, computer equipment and storage medium
CN115880362A (en) Code region positioning method and device, computer equipment and computer readable storage medium
CN115063473A (en) Object height detection method and device, computer equipment and storage medium
CN111599080B (en) Spliced paper money detection method and device, financial machine tool equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant