CN114897864B - Workpiece detection and defect judgment method based on digital-analog information - Google Patents

Workpiece detection and defect judgment method based on digital-analog information Download PDF

Info

Publication number
CN114897864B
CN114897864B CN202210593470.8A CN202210593470A CN114897864B CN 114897864 B CN114897864 B CN 114897864B CN 202210593470 A CN202210593470 A CN 202210593470A CN 114897864 B CN114897864 B CN 114897864B
Authority
CN
China
Prior art keywords
workpiece
image
digital
analog
gray
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.)
Active
Application number
CN202210593470.8A
Other languages
Chinese (zh)
Other versions
CN114897864A (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.)
Chongqing University
Chongqing Institute of Green and Intelligent Technology of CAS
Original Assignee
Chongqing University
Chongqing Institute of Green and Intelligent Technology of CAS
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 Chongqing University, Chongqing Institute of Green and Intelligent Technology of CAS filed Critical Chongqing University
Priority to CN202210593470.8A priority Critical patent/CN114897864B/en
Publication of CN114897864A publication Critical patent/CN114897864A/en
Application granted granted Critical
Publication of CN114897864B publication Critical patent/CN114897864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • 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/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • 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/60Analysis of geometric attributes
    • G06T7/64Analysis of geometric attributes of convexity or concavity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/10004Still image; Photographic image
    • 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/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

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

Abstract

The invention relates to a workpiece detection and defect judgment method based on digital-analog information, and belongs to the field of image processing. The method comprises the following steps: acquiring complete workpiece image information by using a visual sensor; acquiring a gray level image of a qualified workpiece, and counting gray level values of the gray level image; acquiring the corresponding situation of the position of the workpiece on the image on the digital-analog coordinate system; designing a corresponding image position frame; performing edge detection; detecting and acquiring an image edge; determining a deviation range of workpiece movement; obtaining normal characteristic images and defect characteristic images with the same size; confirming whether the workpiece meets the digital-analog form information or not, and determining whether the workpiece is a workpiece to be detected of a template or not; judging whether a workpiece exists, and whether the size and the shape of the workpiece meet the preset design requirements or not; counting the gray values of all pixel points in the selected area, and calculating the gray average value and standard deviation value of the selected area; judging whether the workpiece is a qualified workpiece or not, and outputting a result obtained by comparison. The invention realizes the auxiliary detection of the actual workpiece image.

Description

Workpiece detection and defect judgment method based on digital-analog information
Technical Field
The invention belongs to the field of image processing, and relates to a workpiece detection and defect judgment method based on digital-analog information.
Background
With the progress of computer science and the development of industrial manufacturing, computer vision is widely applied in the industrial field, and industrial design software is gradually becoming more sophisticated. Prior to industrial manufacture, the shape of a workpiece is generally designed by using industrial design software such as AutoCAD, CATIA and the like, and some characteristic points of the workpiece are marked. The industrial design is the modeling design of industrial products, and aims to better reflect the characteristics of the products. The designer can utilize design software to accomplish the design work of product according to actual demand. The digital-analog information is mainly used for designing and manufacturing the workpiece. This is advantageous in providing assistance in the detection of the workpiece after it has been manufactured. But few studies currently combine digital-to-analog information with the processing of subsequent images to provide more additional information. The use of digital-to-analog information to assist detection is a new direction of development in coordinate measurement techniques.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method for detecting and determining defects of a workpiece based on digital-analog information.
In order to achieve the above purpose, the present invention provides the following technical solutions:
a workpiece detection and defect judgment method based on digital-analog information comprises the following steps:
s1: acquiring complete workpiece image information by using a visual sensor;
s2: extracting the required digital-analog information, storing the number, coordinates and form information of the workpieces in corresponding files, acquiring gray level images of qualified workpieces, and counting gray level values of the qualified workpieces;
s3: establishing a corresponding coordinate system aiming at the image, aligning digital-analog coordinate information with image coordinate information, and obtaining the corresponding condition of the workpiece position on the image on the digital-analog coordinate system;
s4: selecting and designing a corresponding image position frame according to the aligned image coordinate information;
s5: corresponding the searching position to an image target position frame, and carrying out edge detection on the workpiece on the searching position;
s6: acquiring a target workpiece by utilizing edge detection, and detecting and acquiring an image edge by utilizing gray step changes existing at the edge position and other positions of an object of the workpiece;
s7: determining a deviation range of workpiece movement according to errors possibly generated in actual manufacturing;
s8: extracting the region of interest of the image of the object to be detected in the normal form and the image of the object to be detected with the defect respectively to obtain a normal characteristic image and a defect characteristic image with the same size;
s9: matching and comparing the obtained workpiece with a template, confirming whether the workpiece meets digital-analog form information, and determining whether the workpiece is a workpiece to be detected of the template;
s10: comparing the edge condition of the obtained workpiece with digital-analog information, and judging whether the workpiece exists and whether the size and the shape of the workpiece meet the preset design requirements;
s11: obtaining a gray level image of a workpiece image, establishing a selected area in the gray level image according to a preset size, counting gray level values of all pixel points in the selected area, and calculating a gray level average value and a standard deviation value of the selected area;
s12: judging whether the gray value of the workpiece image accords with the standard image, thereby judging whether the workpiece is a qualified workpiece, synthesizing the result of template matching, and outputting the result obtained by comparison;
if the pixel point range containing the gray value is partially judged to be beyond the pixel point range containing the gray value of the standard workpiece, the workpiece is considered to be oversized;
if the part of the pixel points containing the gray values are judged to be less than the pixel point range containing the gray values of the standard workpiece, the shape of the workpiece is considered to be defective;
if the gray values of the pixel points on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be uneven, and if the gray values of the pixel points on the part of the workpiece are judged to be smaller than the standard gray values, the workpiece is considered to have a concave condition;
if the gray value of part of the pixel points is larger than the standard gray value, the workpiece is considered to have a bulge condition;
if the image to be detected is judged to have various morphological problems, the defects that the image to be detected has larger phase difference with the standard workpiece are listed preferentially.
Optionally, the workpiece detection and defect judgment method specifically includes:
reading the number n and the position [ X ] of the workpieces from a digital-analog file W Y W Z W ]Size s 1 Wherein the related size information on the digital-analog design accords with the actual information, the origin is designed to be any point on the digital-analog image, and the digital-analog coordinate system is regarded as a world coordinate system;
respectively establishing a pixel coordinate system u-v and a digital-analog coordinate system x-y on an image, and converting and aligning the two coordinate systems to obtain a specific coordinate position point of a position corresponding to the digital-analog coordinate point on the image;
the process of converting the world coordinate system into the pixel coordinate system is a process of converting the world coordinate into the camera coordinate, converting the camera coordinate into the image coordinate, and converting the image coordinate into the pixel coordinate; is the mutual conversion among four coordinate systems;
wherein world coordinates are converted to camera coordinates:
the camera coordinates are converted into image coordinates:
the image coordinates are converted into pixel coordinates:
the process of directly converting world coordinates into pixel coordinates is as follows:
wherein the world coordinates are [ X ] W Y W Z W ]The camera coordinates are [ X ] C Y C Z C ]Image coordinates: [ x y ]]Pixel coordinates: [ u v ]]The focal length of the camera is f, the rotation matrix is R, the translation matrix is T, and the internal parameters of the camera areExternal parameters of the camera
Coordinates of the position of the workpiece on the image u v]And size s 2 Information and marking a preselected frame on the image;
detecting the image edge of a preselected frame of the image to obtain and judge corresponding workpiece information;
the edge detection is carried out by using a Canny edge detection algorithm, and the method comprises the steps of graying an image; smoothing the image with a gaussian filter; calculating the magnitude and direction of the gradient by using the finite difference of the first-order bias derivatives; performing non-maximum suppression on the gradient amplitude; detecting and connecting edges by using a double-threshold algorithm;
wherein the Gaussian filtered gray value becomes:
the gradient intensity and direction of each pixel point are as follows:
multiplying each pixel point and the neighborhood thereof by a Gaussian matrix, and taking the average value of the pixel points with weights as the final gray value;
filtering non-maximum values, filtering points which are not edges by using a rule, and enabling the width of the edges to be 1 pixel point to form edge lines;
comparing the obtained edge condition with the digital-analog information, and judging whether the workpiece exists or not, and whether the size and the shape of the workpiece meet the preset design requirements or not;
according to the gray values detected before, an upper threshold value and a lower threshold value in the image are obtained, all the values larger than the upper threshold value are detected as edges, and all the values lower than the lower threshold value are detected as non-edges; for the middle pixel point, if the middle pixel point is adjacent to the pixel point determined as the edge, the edge is determined; otherwise, the edge is non-edge;
comparing the template image with the image to be detected or a certain area image by using a template matching method, and judging whether the template image is the same or similar;
in the template matching, the template is a known small image, the template matching is to search a target in a large image, the target to be found in the image is known, the target and the template have the same scale, direction and image element, and the target is found in the image through a certain algorithm;
template matching using normalized correlation coefficient matching method
The method comprises the steps of taking a standard workpiece or a digital-analog image as a template image, carrying out matching comparison with an image to be detected, improving errors caused by shooting angles or other reasons by adjusting a matching threshold value, and judging whether the color of the workpiece meets the preset design requirement;
detecting the workpiece by utilizing H, S and V values of the workpiece to obtain the central coordinate position of the target workpiece;
comparing the center coordinates of the workpiece obtained by edge detection with the center coordinates obtained by color detection, and correcting to obtain the position coordinates of the workpiece on the actual image;
extracting the region of interest of the image of the object to be detected in the normal form and the image of the object to be detected with the defect respectively to obtain a normal characteristic image and a defect characteristic image with the same size;
matching and comparing the obtained workpiece with a template, confirming whether the workpiece meets digital-analog form information, and determining whether the workpiece is a workpiece to be detected of the template;
matching and comparing the obtained workpiece with a template, and judging whether the workpiece and the workpiece size or not and whether the workpiece shape meet the preset design requirement or not; detecting whether the workpiece shape is qualified or not by using an image gray value detection method;
establishing a selected area in the gray scale map according to a preset size, counting gray scale values of all pixel points in the selected area, and calculating a gray scale average value and a standard deviation value of the selected area;
judging whether the gray value of the workpiece image accords with the standard image, thereby judging whether the workpiece is a qualified workpiece, synthesizing the result of template matching, and outputting the result obtained by comparison.
Optionally, the defects include whether the workpiece is in accordance with the standard, whether the workpiece shape is in accordance with the actual, whether the workpiece position is in accordance with the actual, whether the workpiece color is in accordance with the actual, whether the size is in accordance with the standard, whether the concave-convex condition exists, and whether the surface is smooth.
The invention has the beneficial effects that: and using ideal information in the digital analog to assist in detecting the actual workpiece image.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objects and other advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out in the specification.
Drawings
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in the following preferred detail with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of an image detection processing method based on digital-to-analog information;
FIG. 2 is a flow chart of an image method based on digital-to-analog color;
fig. 3 is a flowchart of the work pass judgment.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be noted that the illustrations provided in the following embodiments merely illustrate the basic idea of the present invention by way of illustration, and the following embodiments and features in the embodiments may be combined with each other without conflict.
Wherein the drawings are for illustrative purposes only and are shown in schematic, non-physical, and not intended to limit the invention; for the purpose of better illustrating embodiments of the invention, certain elements of the drawings may be omitted, enlarged or reduced and do not represent the size of the actual product; it will be appreciated by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numbers in the drawings of embodiments of the invention correspond to the same or similar components; in the description of the present invention, it should be understood that, if there are terms such as "upper", "lower", "left", "right", "front", "rear", etc., that indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, it is only for convenience of describing the present invention and simplifying the description, but not for indicating or suggesting that the referred device or element must have a specific azimuth, be constructed and operated in a specific azimuth, so that the terms describing the positional relationship in the drawings are merely for exemplary illustration and should not be construed as limiting the present invention, and that the specific meaning of the above terms may be understood by those of ordinary skill in the art according to the specific circumstances.
Referring to fig. 1 to 3, at present, image detection of an object is not dependent on template matching or training of a large number of data sets by using deep learning, but dependent model matching is mainly based on form matching, detection of deep learning is mainly performed by using image features of training images, and few detection methods use coordinate information in a model of a workpiece before design in detection. The digital-analog information includes position information and workpiece form information of each work on the background plate. The precondition information is used as an input quantity to be input together with the image to be detected, and then the image to be detected is detected according to the edge information of the workpiece by various image processing methods, so that a detection result is obtained more quickly and accurately.
The invention refers to an AOI detection method in industrial component SMT, and utilizes an optical detection method to check whether various components exist at corresponding positions, whether the mounting is correct, the welding is good, and various bad states exist through light reflection.
The invention utilizes a model matching method to match the acquired image with the digital-analog image, thereby completing the image detection of the workpiece.
The invention comprises an imaging system which may be composed of one or more cameras to provide better image possibilities. The camera should also be able to move under software control to obtain a clearer, more complete image.
The method comprises the following steps:
acquiring complete workpiece image information by using a visual sensor;
reading the number n and the position [ X ] of the workpieces from a digital-analog file W Y W Z W ]Size s 1 Equi-morphological information, wherein the related size information is based on digital-analog designThe origin point is possibly designed to be any point on the digital-mode image according to the actual information, so that the digital-mode coordinate system can be understood as a world coordinate system;
respectively establishing a pixel coordinate system u-v and a digital-analog (world) coordinate system x-y on an image, and converting and aligning the two coordinate systems so as to obtain a specific coordinate position point of a position corresponding to the digital-analog coordinate point on the image;
the process of converting the world coordinate system into the pixel coordinate system is a process of converting the world coordinate into the camera coordinate, converting the camera coordinate into the image coordinate, and converting the image coordinate into the pixel coordinate. Is the interconversion between four coordinate systems.
Wherein world coordinates are converted into camera coordinates
Conversion of camera coordinates into image coordinates
Conversion of image coordinates into pixel coordinates
The process of directly converting world coordinates into pixel coordinates is that
Wherein the world coordinates are [ X ] W Y W Z W ]The camera coordinates are [ X ] C Y C Z C ]Image coordinates: [ x y ]]Pixel coordinates: [ u v ]]The focal length of the camera is f, the rotation matrix is R, the translation matrix is T, and the internal parameters of the camera areExternal parameters of the camera
Coordinates of the position of the workpiece on the image u v]Size s 2 Waiting for information, and marking a preselected frame on the image;
detecting the image edge of a preselected frame of the image to obtain and judge corresponding workpiece information;
the edge detection is formed by a Canny edge detection algorithm, and comprises the steps of graying an image; smoothing the image with a gaussian filter; calculating the magnitude and direction of the gradient by using the finite difference of the first-order bias derivatives; performing non-maximum suppression on the gradient amplitude; edges are detected and connected using a double threshold algorithm.
Wherein the gaussian filtered gray values will become:
the gradient intensity and the gradient direction of each pixel point are
It can be understood that each pixel and its neighborhood are multiplied by a gaussian matrix, and the weighted average is taken as the final gray value.
Filtering non-maximum values, filtering points other than edges by using a rule to make the width of the edges as 1 pixel point as possible, and forming edge lines.
And comparing the obtained edge condition with the digital-analog information, and judging whether the workpiece exists or not, and whether the size and the shape of the workpiece meet the preset design requirements or not.
Based on the previously detected gray values, an upper threshold and a lower threshold in the image are obtained, with all values above the upper threshold being detected as edges and all values below the lower threshold being detected as non-edges. For the middle pixel point, if the middle pixel point is adjacent to the pixel point determined as the edge, the edge is determined; otherwise, it is non-edge. This makes it possible to improve accuracy.
And comparing the template image with the image to be detected or a certain area image by using a template matching method, and judging whether the template image and the image to be detected or the certain area image are the same or similar.
In the template matching, the template is a known small image, the template matching is to search for a target in a large image, the target to be found in the image is known, and the target and the template have the same scale, direction and image element, so that the target can be found in the image through a certain algorithm.
Template matching using normalized correlation coefficient matching method
The standard workpiece or the digital-analog image is used as a template image to be matched and compared with the image to be detected, and for errors caused by shooting angles or other reasons, the errors can be improved by adjusting a matching threshold value, so that whether the color of the workpiece meets the preset design requirement is judged.
And detecting the workpiece by utilizing the H, S and V values of the workpiece to obtain the central coordinate position of the target workpiece.
And comparing the center coordinates of the workpiece obtained by edge detection with the center coordinates obtained by color detection, and correcting to obtain the workpiece position coordinates on the actual image.
And extracting the region of interest of the image of the object to be detected in the normal form and the image of the object to be detected with the defect respectively to obtain a normal characteristic image and a defect characteristic image with the same size.
Matching and comparing the obtained workpiece with a template, confirming whether the workpiece meets digital-analog form information, and determining whether the workpiece is a workpiece to be detected of the template;
matching and comparing the obtained workpiece with a template, and judging whether the workpiece and the workpiece size or not and whether the workpiece shape meet the preset design requirement or not; and detecting whether the workpiece shape is qualified or not by using an image gray value detection method.
Establishing a selected area in the gray scale map according to a preset size, counting gray scale values of all pixel points in the selected area, and calculating a gray scale average value and a standard deviation value of the selected area;
judging whether the gray value of the workpiece image accords with the standard image, thereby judging whether the workpiece is a qualified workpiece, synthesizing the result of template matching, and outputting the result obtained by comparison.
If the range of the pixel points containing the gray values is judged to be beyond the range of the pixel points containing the gray values of the standard workpiece, the shape of the workpiece is considered to be too large, if the range of the pixel points containing the gray values is judged to be less than the range of the pixel points containing the gray values of the standard workpiece, the shape of the workpiece is considered to be defective, if the gray values of the pixel points on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be uneven, if the gray values of the pixel points are judged to be less than the standard gray values, the workpiece is considered to have a concave condition, and if the gray values of the pixel points are judged to be greater than the standard gray values, the workpiece is considered to have a convex condition.
If the image to be detected is judged to have various morphological problems, the defects that the image to be detected has larger phase difference with the standard workpiece are listed preferentially.
The detection method can detect the workpiece which has corresponding digital-analog information and obvious color contrast, determine the deviation of the workpiece and ideal digital-analog information, detect the corresponding defects of the workpiece, and detect the workpiece without interrupting the production flow. The detection information of the workpiece is obtained in production, better process control can be realized, the early detection of defects can avoid assembly and split charging of later-stage workpieces, and the workpieces can be maintained in advance.
The defects mainly comprise whether the workpiece is in accordance with the reality, whether the workpiece is in accordance with the standard, whether the concave-convex condition exists, whether the surface is smooth and the like.
Finally, it is noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made thereto without departing from the spirit and scope of the present invention, which is intended to be covered by the claims of the present invention.

Claims (3)

1. The workpiece detection and defect judgment method based on the digital-analog information is characterized by comprising the following steps of: the method comprises the following steps:
s1: acquiring complete workpiece image information by using a visual sensor;
s2: extracting the required digital-analog information, storing the number, coordinates and form information of the workpieces in corresponding files, acquiring gray level images of qualified workpieces, and counting gray level values of the qualified workpieces;
s3: establishing a corresponding coordinate system aiming at the image, aligning digital-analog coordinate information with image coordinate information, and obtaining the corresponding condition of the workpiece position on the image on the digital-analog coordinate system;
s4: selecting and designing a corresponding image position frame according to the aligned image coordinate information;
s5: corresponding the searching position to an image target position frame, and carrying out edge detection on the workpiece on the searching position;
s6: acquiring a target workpiece by utilizing edge detection, and detecting and acquiring an image edge by utilizing gray step changes existing at the edge position and other positions of an object of the workpiece;
s7: determining a deviation range of workpiece movement according to errors possibly generated in actual manufacturing;
s8: extracting the region of interest of the image of the object to be detected in the normal form and the image of the object to be detected with the defect respectively to obtain a normal characteristic image and a defect characteristic image with the same size;
s9: matching and comparing the obtained workpiece with a template, confirming whether the workpiece meets digital-analog form information, and determining whether the workpiece is a workpiece to be detected of the template;
s10: comparing the edge condition of the obtained workpiece with digital-analog information, and judging whether the workpiece exists and whether the size and the shape of the workpiece meet the preset design requirements;
s11: obtaining a gray level image of a workpiece image, establishing a selected area in the gray level image according to a preset size, counting gray level values of all pixel points in the selected area, and calculating a gray level average value and a standard deviation value of the selected area;
s9 to S11 are specifically:
comparing the template image with the image to be detected or a certain area image by using a template matching method, and judging whether the template image is the same or similar;
in the template matching, the template is a known small image, the template matching is to search a target in a large image, the target to be found in the image is known, the target and the template have the same scale, direction and image element, and the target is found in the image through a certain algorithm;
template matching using normalized correlation coefficient matching method
The method comprises the steps of taking a standard workpiece or a digital-analog image as a template image, carrying out matching comparison with an image to be detected, improving errors caused by shooting angles or other reasons by adjusting a matching threshold value, and judging whether the color of the workpiece meets the preset design requirement;
detecting the workpiece by utilizing H, S and V values of the workpiece to obtain the central coordinate position of the target workpiece;
comparing the center coordinates of the workpiece obtained by edge detection with the center coordinates obtained by color detection, and correcting to obtain the position coordinates of the workpiece on the actual image;
s12: judging whether the gray value of the workpiece image accords with the standard image, thereby judging whether the workpiece is a qualified workpiece, synthesizing the result of template matching, and outputting the result obtained by comparison;
if the pixel point range containing the gray value is partially judged to be beyond the pixel point range containing the gray value of the standard workpiece, the workpiece is considered to be oversized;
if the part of the pixel points containing the gray values are judged to be less than the pixel point range containing the gray values of the standard workpiece, the shape of the workpiece is considered to be defective;
if the gray values of the pixel points on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be uneven, and if the gray values of the pixel points on the part of the workpiece are judged to be smaller than the standard gray values, the workpiece is considered to have a concave condition;
if the gray value of part of the pixel points is larger than the standard gray value, the workpiece is considered to have a bulge condition;
if the image to be detected is judged to have various morphological problems, the defects that the image to be detected has larger phase difference with the standard workpiece are listed preferentially.
2. The method for detecting and judging defects of a workpiece based on digital-analog information according to claim 1, wherein: the workpiece detection and defect judgment method specifically comprises the following steps:
reading the number n and the position [ X ] of the workpieces from a digital-analog file W Y W Z W ]Size s 1 Wherein the related size information on the digital-analog design accords with the actual information, the origin is designed to be any point on the digital-analog image, and the digital-analog coordinate system is regarded as a world coordinate system;
respectively establishing a pixel coordinate system u-v and a digital-analog coordinate system x-y on an image, and converting and aligning the two coordinate systems to obtain a specific coordinate position point of a position corresponding to the digital-analog coordinate point on the image;
the process of converting the world coordinate system into the pixel coordinate system is a process of converting the world coordinate into the camera coordinate, converting the camera coordinate into the image coordinate, and converting the image coordinate into the pixel coordinate; is the mutual conversion among four coordinate systems;
wherein world coordinates are converted to camera coordinates:
the camera coordinates are converted into image coordinates:
the image coordinates are converted into pixel coordinates:
the process of directly converting world coordinates into pixel coordinates is as follows:
wherein the world coordinates are [ X ] W Y W Z W ]The camera coordinates are [ X ] C Y C Z C ]Image coordinates: [ x y ]]Pixel coordinates: [ u v ]]The focal length of the camera is f, the rotation matrix is R, the translation matrix is T, and the internal parameters of the camera areExternal parameters of the camera
Coordinates of the position of the workpiece on the image u v]And size s 2 Information and marking a preselected frame on the image;
detecting the image edge of a preselected frame of the image to obtain and judge corresponding workpiece information;
the edge detection is carried out by using a Canny edge detection algorithm, and the method comprises the steps of graying an image; smoothing the image with a gaussian filter; calculating the magnitude and direction of the gradient by using the finite difference of the first-order bias derivatives; performing non-maximum suppression on the gradient amplitude; detecting and connecting edges by using a double-threshold algorithm;
wherein the Gaussian filtered gray value becomes:
the gradient intensity and direction of each pixel point are as follows:
multiplying each pixel point and the neighborhood thereof by a Gaussian matrix, and taking the average value of the pixel points with weights as the final gray value;
filtering non-maximum values, filtering points which are not edges by using a rule, and enabling the width of the edges to be 1 pixel point to form edge lines;
comparing the obtained edge condition with the digital-analog information, and judging whether the workpiece exists or not, and whether the size and the shape of the workpiece meet the preset design requirements or not;
according to the gray values detected before, an upper threshold value and a lower threshold value in the image are obtained, all the values larger than the upper threshold value are detected as edges, and all the values lower than the lower threshold value are detected as non-edges; for the middle pixel point, if the middle pixel point is adjacent to the pixel point determined as the edge, the edge is determined; otherwise, the edge is non-edge;
extracting the region of interest of the image of the object to be detected in the normal form and the image of the object to be detected with the defect respectively to obtain a normal characteristic image and a defect characteristic image with the same size;
matching and comparing the obtained workpiece with a template, confirming whether the workpiece meets digital-analog form information, and determining whether the workpiece is a workpiece to be detected of the template;
matching and comparing the obtained workpiece with a template, and judging whether the workpiece and the workpiece size or not and whether the workpiece shape meet the preset design requirement or not; detecting whether the workpiece shape is qualified or not by using an image gray value detection method;
establishing a selected area in the gray scale map according to a preset size, counting gray scale values of all pixel points in the selected area, and calculating a gray scale average value and a standard deviation value of the selected area;
judging whether the gray value of the workpiece image accords with the standard image, thereby judging whether the workpiece is a qualified workpiece, synthesizing the result of template matching, and outputting the result obtained by comparison.
3. The method for detecting and judging defects of a workpiece based on digital-analog information according to claim 2, wherein: the defects comprise whether the workpiece accords with the shape of the workpiece, whether the workpiece position accords with the shape of the workpiece, whether the workpiece color accords with the shape of the workpiece, whether the workpiece accords with the standard, whether the concave-convex condition exists and whether the surface is smooth.
CN202210593470.8A 2022-05-27 2022-05-27 Workpiece detection and defect judgment method based on digital-analog information Active CN114897864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210593470.8A CN114897864B (en) 2022-05-27 2022-05-27 Workpiece detection and defect judgment method based on digital-analog information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210593470.8A CN114897864B (en) 2022-05-27 2022-05-27 Workpiece detection and defect judgment method based on digital-analog information

Publications (2)

Publication Number Publication Date
CN114897864A CN114897864A (en) 2022-08-12
CN114897864B true CN114897864B (en) 2024-04-12

Family

ID=82726842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210593470.8A Active CN114897864B (en) 2022-05-27 2022-05-27 Workpiece detection and defect judgment method based on digital-analog information

Country Status (1)

Country Link
CN (1) CN114897864B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115257767B (en) * 2022-09-26 2023-02-17 中科慧眼(天津)研究开发有限公司 Road surface obstacle height measurement method and system based on plane target
CN115731165B (en) * 2022-09-28 2023-10-20 广州市易鸿智能装备有限公司 Detection system and method for on-line size spot inspection of lithium battery
CN116818780B (en) * 2023-05-26 2024-03-26 深圳市大德激光技术有限公司 Visual 2D and 3D detection system for button cell shell after laser welding
CN116580022B (en) * 2023-07-07 2023-09-29 杭州鄂达精密机电科技有限公司 Workpiece size detection method, device, computer equipment and storage medium
CN116703914B (en) * 2023-08-07 2023-12-22 浪潮云洲工业互联网有限公司 Welding defect detection method, equipment and medium based on generation type artificial intelligence
CN117152145B (en) * 2023-10-31 2024-02-23 威海天拓合创电子工程有限公司 Board card process detection method and device based on image
CN118010751A (en) * 2024-04-08 2024-05-10 杭州汇萃智能科技有限公司 Machine vision detection method and system for workpiece defect detection

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2998927A1 (en) * 2014-09-22 2016-03-23 ALSTOM Transport Technologies Method for detecting the bad positioning and the surface defects of specific components and associated detection device
CN113016004A (en) * 2018-11-16 2021-06-22 阿莱恩技术有限公司 Machine-based three-dimensional (3D) object defect detection
CN113034474A (en) * 2021-03-30 2021-06-25 无锡美科微电子技术有限公司 Test method for wafer map of OLED display
CN114240854A (en) * 2021-11-30 2022-03-25 深圳市裕展精密科技有限公司 Product detection method and detection device
WO2022065621A1 (en) * 2020-09-28 2022-03-31 (주)미래융합정보기술 Vision inspection system using distance learning of product defect image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8351683B2 (en) * 2007-12-25 2013-01-08 Hitachi High-Technologies Corporation Inspection apparatus and inspection method
US20210010953A1 (en) * 2019-07-12 2021-01-14 SVXR, Inc. Methods and Systems for Defects Detection and Classification Using X-rays

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2998927A1 (en) * 2014-09-22 2016-03-23 ALSTOM Transport Technologies Method for detecting the bad positioning and the surface defects of specific components and associated detection device
CN113016004A (en) * 2018-11-16 2021-06-22 阿莱恩技术有限公司 Machine-based three-dimensional (3D) object defect detection
WO2022065621A1 (en) * 2020-09-28 2022-03-31 (주)미래융합정보기술 Vision inspection system using distance learning of product defect image
CN113034474A (en) * 2021-03-30 2021-06-25 无锡美科微电子技术有限公司 Test method for wafer map of OLED display
CN114240854A (en) * 2021-11-30 2022-03-25 深圳市裕展精密科技有限公司 Product detection method and detection device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DDtM: Increasing Latent Defect Detection in Analog/Mixed-Signal ICs Using the Difference in Distance to Mean Value;Jhon Gomez;《IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems》;20210929;4771 - 4781 *
基于机器视觉的玻璃马赛克缺陷在线检测***;龙亮亮;刘冠峰;张国英;李永胜;;机械设计与制造;20170908(第S1期);136-139 *

Also Published As

Publication number Publication date
CN114897864A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN114897864B (en) Workpiece detection and defect judgment method based on digital-analog information
CN108776140B (en) Machine vision-based printed matter flaw detection method and system
CN104981105B (en) A kind of quickly accurate detection and method for correcting error for obtaining element central and deflection angle
CN112818988B (en) Automatic identification reading method and system for pointer instrument
CN112308916B (en) Target pose recognition method based on image target
CN108007388A (en) A kind of turntable angle high precision online measuring method based on machine vision
CN112164048B (en) Magnetic shoe surface defect automatic detection method and device based on deep learning
CN108871185B (en) Method, device and equipment for detecting parts and computer readable storage medium
CN112819748B (en) Training method and device for strip steel surface defect recognition model
CN107356213B (en) Optical filter concentricity measuring method and terminal equipment
CN112419420B (en) Camera calibration method and device, electronic equipment and storage medium
CN104574312A (en) Method and device of calculating center of circle for target image
CN114219802B (en) Skin connecting hole position detection method based on image processing
CN115619787A (en) UV adhesive defect detection method, system, equipment and medium
CN112085708A (en) Method and equipment for detecting defects of straight line edge in product outer contour
CN117274258A (en) Method, system, equipment and storage medium for detecting defects of main board image
CN113989384A (en) Camera calibration method, cropping data generation method, device, equipment and medium
CN113970560A (en) Defect three-dimensional detection method based on multi-sensor fusion
CN114998571B (en) Image processing and color detection method based on fixed-size markers
CN107886530A (en) A kind of improved image registration algorithm based on SIFT feature
CN112329845A (en) Method and device for replacing paper money, terminal equipment and computer readable storage medium
CN110349129B (en) Appearance defect detection method for high-density flexible IC substrate
CN116883498A (en) Visual cooperation target feature point positioning method based on gray centroid extraction algorithm
CN116908185A (en) Method and device for detecting appearance defects of article, electronic equipment and storage medium
CN115423746A (en) Image processing method for calculating skin hole site and hole diameter

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