CN114897864A - 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
CN114897864A
CN114897864A CN202210593470.8A CN202210593470A CN114897864A CN 114897864 A CN114897864 A CN 114897864A CN 202210593470 A CN202210593470 A CN 202210593470A CN 114897864 A CN114897864 A CN 114897864A
Authority
CN
China
Prior art keywords
workpiece
image
digital
gray
analog
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
CN202210593470.8A
Other languages
Chinese (zh)
Other versions
CN114897864B (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

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
    • 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 scale image of a qualified workpiece, and counting the gray scale value of the qualified workpiece; acquiring the corresponding situation of the workpiece position on the image on a digital-analog coordinate system; designing a corresponding image position frame; carrying out edge detection; detecting and acquiring an image edge; determining the deviation range of the movement of the workpiece; obtaining a normal characteristic image and a defect characteristic image with the same size; confirming whether the workpiece meets digital-analog form information or not, and determining whether the workpiece is a workpiece to be detected of the template or not; judging whether a workpiece exists or not, 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 the standard deviation value of the selected area; and judging whether the workpiece is qualified or not, and outputting the 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 upgrading and development of industrial manufacturing, computer vision is widely applied to the industrial field, and industrial design software is gradually refined. Before industrial manufacturing, the shape of a workpiece is designed by using industrial design software such as AutoCAD, CATIA and the like, and some feature points on the workpiece are marked. The industrial design is the modeling design of industrial products and aims to better embody the characteristics of the products. The designer can utilize design software to complete the design work of the product according to actual requirements. The digital-to-analog information is mainly used for the design and manufacture of the workpiece. This advantageously assists in the detection of the workpiece after it has been manufactured. However, few studies have been made to combine the digital and 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 development direction of coordinate measurement technology.
Disclosure of Invention
In view of the above, the present invention provides a method for detecting a workpiece and determining a defect based on digital-to-analog information.
In order to achieve the purpose, the invention provides the following technical scheme:
the workpiece detection and defect judgment method based on the digital-analog information comprises the following steps:
s1: acquiring complete workpiece image information by using a visual sensor;
s2: extracting required digital-analog information, storing the number, coordinates and form information of the workpieces in corresponding files, acquiring a gray-scale image of the qualified workpiece, and counting the gray-scale value of the qualified workpiece;
s3: establishing a corresponding coordinate system aiming at the image, aligning the digital-analog coordinate information with the image coordinate information, and acquiring 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 search position to an image target position frame, and carrying out edge detection on the workpiece on the image target position frame;
s6: acquiring a target workpiece by utilizing edge detection, and detecting and acquiring an image edge by utilizing the gray level step change of the edge position and other positions of a workpiece object;
s7: determining the deviation range of the workpiece movement according to errors possibly generated by actual manufacturing;
s8: respectively extracting interested areas of the normal form image of the object to be detected and the defective image of the object to be detected to obtain a normal characteristic image and a defective characteristic image with the same size;
s9: matching and comparing the obtained workpiece with the 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 obtained edge condition of the workpiece with the digital-analog information, and judging whether the workpiece and the size and the shape of the workpiece meet the preset design requirements or not;
s11: obtaining a gray level image of the workpiece image, establishing a selection area in the gray level image according to a preset size, counting gray levels of all pixel points in the selection area, and calculating a gray level mean value and a standard deviation value of the selection area;
s12: judging whether the gray value of the workpiece image meets the standard image or not so as to judge whether the workpiece is a qualified workpiece or not, integrating the template matching result, and outputting the result obtained by comparison;
if the pixel point range containing the gray value exceeds the pixel point range containing the gray value of the standard workpiece, the workpiece form is considered to be overlarge;
if the part judges that the pixel point containing the gray value is less than the pixel point range of the standard workpiece containing the gray value, the shape of the workpiece is determined to be defective;
if the gray values of the pixels on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be unsmooth, and if the gray values of the pixels on the judged part are smaller than the standard gray value, the workpiece is considered to have a concave condition;
if the gray value of part of the pixel points is judged to be greater than the standard gray value, the workpiece is considered to have a convex condition;
if the image to be detected has various morphological problems, the defect with larger difference with the standard workpiece is preferentially listed.
Optionally, the workpiece detection and defect judgment method specifically includes:
reading the number n and the position [ X ] of the workpieces from the digital-analog file W Y W Z W ]And size s 1 The relevant dimension information in the digital-analog design conforms to 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 the image, and converting and aligning the two coordinate systems to obtain a specific coordinate position point of the corresponding position of 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 a camera coordinate, converting the camera coordinate into an image coordinate, and converting the image coordinate into a pixel coordinate; is the interconversion between four coordinate systems;
wherein world coordinates are converted to camera coordinates:
Figure BDA0003666649250000021
camera coordinates are converted to image coordinates:
Figure BDA0003666649250000022
image coordinates are converted to pixel coordinates:
Figure BDA0003666649250000031
the process of directly converting world coordinates into pixel coordinates is as follows:
Figure BDA0003666649250000032
wherein the world coordinate is [ X ] W Y W Z W ]The camera coordinate is [ X ] C Y C Z C ]And 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 are
Figure BDA0003666649250000033
The external parameter of the camera is
Figure BDA0003666649250000034
Coordinates of the position of the workpiece on the image [ u v]And size s 2 Information, and marking a preselection frame on the image;
detecting the edge of an image aiming at a preselected frame of the image to acquire and judge corresponding workpiece information;
the edge detection is carried out by using a Canny edge detection algorithm, and comprises the step of carrying out graying on 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 partial derivatives; carrying out non-maximum suppression on the gradient amplitude; detecting and connecting edges by using a dual-threshold algorithm;
wherein the gray value after gaussian filtering becomes:
Figure BDA0003666649250000035
the gradient strength and direction of each pixel point are as follows:
Figure BDA0003666649250000036
Figure BDA0003666649250000037
multiplying each pixel point and the neighborhood thereof by a Gaussian matrix, and taking the average value with the weight as the final gray value;
filtering non-maximum values, and filtering points which are not edges by using a rule to enable the width of the edges to be 1 pixel point to form edge lines;
Figure BDA0003666649250000038
comparing the obtained edge condition with the numerical model information, and judging whether the sizes and the shapes of the workpieces meet the preset design requirements or not;
according to the detected gray value, an upper threshold value and a lower threshold value in the image are obtained, wherein the upper threshold value and the lower threshold value are detected as edges, and the lower threshold value and the upper 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 not;
comparing the template image with the image to be detected or the image of a certain area by using a template matching method, and judging whether the images are 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 searched is known to exist in the image, the target and the template have the same size, direction and image elements, and the target is found in the image through a certain algorithm;
template matching using normalized correlation coefficient matching method
Figure BDA0003666649250000041
The standard workpiece or the digital-analog image is used as a template image to be matched and compared with an image to be detected, errors caused by shooting angles or other reasons are improved by adjusting a matching threshold value, and whether the color of the workpiece meets the preset design requirement or not is judged;
detecting the workpiece by using H, S and V values of the workpiece to obtain a 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;
respectively extracting interested areas of the normal-form image of the object to be detected and the image of the object to be detected with defects to obtain a normal characteristic image and a defect characteristic image with the same size;
matching and comparing the obtained workpiece with the 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 the template, and judging whether the workpiece and the size and the shape of the workpiece meet the preset design requirements or not; then, detecting whether the shape of the workpiece is qualified or not by using an image gray value detection method;
establishing a selection area in the gray-scale image according to a preset size, counting gray-scale values of all pixel points in the selection area, and calculating a gray-scale mean value and a standard deviation value of the selection area;
and judging whether the gray value of the workpiece image meets the standard image or not so as to judge whether the workpiece is a qualified workpiece or not, integrating the template matching result, and outputting the result obtained by comparison.
Optionally, the defects include whether a conforming workpiece exists, whether the workpiece shape conforms to reality, whether the workpiece position conforms to reality, whether the workpiece color conforms to reality, whether the size conforms to a standard, whether a concave-convex condition exists, and whether the surface is smooth.
The invention has the beneficial effects that: and detecting the actual workpiece image in an auxiliary manner by utilizing ideal information in the digital analogy.
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 objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with 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 a digital-to-analog color based image method;
FIG. 3 is a flowchart illustrating a process of determining the qualification of a workpiece.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood 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 numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
Referring to fig. 1 to 3, in the current image detection of an object, either template matching is relied on or deep learning is used for training a large number of data sets, model matching is relied on mainly for form matching, deep learning detection mainly uses image features of a training image for detection, and few detection methods are used for detecting coordinate information in a workpiece digital model before design. The digital-to-analog information contains position information and workpiece shape 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 the detection result is obtained more quickly and more accurately.
The invention refers to an AOI detection method in an industrial component SMT, and utilizes an optical detection method to detect whether various components exist at corresponding positions or not through light reflection, whether the mounting is correct or not, whether the welding is good or not and whether various bad states exist or not.
The invention matches the acquired image with the digital-analog image by using a model matching method, thereby completing the image detection of the workpiece.
The invention comprises an imaging system which may consist of one or more cameras to provide the possibility of better images. 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 the digital-analog file W Y W Z W ]And size s 1 The method comprises the following steps of (1) waiting for morphological information, wherein the origin point can be designed to be any point on a digital-analog image because relevant dimension information on digital-analog design conforms to actual information, so that a digital-analog 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 the image, and converting and aligning the two coordinate systems so as to obtain a specific coordinate position point of the corresponding position of 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 system into a camera coordinate system, converting the camera coordinate system into an image coordinate system, and converting the image coordinate system into a pixel coordinate system. Is the interconversion between the four coordinate systems.
Wherein world coordinates are converted to camera coordinates
Figure BDA0003666649250000061
Conversion of camera coordinates to image coordinates
Figure BDA0003666649250000062
Conversion of image coordinates to pixel coordinates
Figure BDA0003666649250000063
The process of directly converting world coordinates into pixel coordinates is
Figure BDA0003666649250000071
Wherein the world coordinate is [ X ] W Y W Z W ]The camera coordinate is [ X ] C Y C Z C ]And 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 are
Figure BDA0003666649250000072
The external parameter of the camera is
Figure BDA0003666649250000073
Coordinates of the position of the workpiece on the image [ u v]Size s 2 The information is waited, and the mark of the preselection frame is carried out on the image;
detecting the edge of an image aiming at a preselected frame of the image to acquire and judge corresponding workpiece information;
the edge detection is formed by utilizing a plurality of steps of a Canny edge detection algorithm and comprises the steps of carrying out graying on 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 partial derivatives; carrying out non-maximum suppression on the gradient amplitude; edges are detected and connected using a dual threshold algorithm.
Wherein the gaussian filtered gray value will become:
Figure BDA0003666649250000074
the gradient intensity and direction of each pixel point are
Figure BDA0003666649250000075
Figure BDA0003666649250000076
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, and filtering points which are not edges by using a rule to ensure that the width of the edges is 1 pixel point as far as possible to form edge lines.
Figure BDA0003666649250000077
And comparing the obtained edge condition with the numerical model 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.
And obtaining an upper threshold value and a lower threshold value in the image according to the detected gray value, wherein the upper threshold value is detected as an edge, and the lower threshold value is detected as a non-edge. 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 not edge. This makes it possible to improve accuracy.
And comparing the template image with the image to be detected or the image of a certain area by using a template matching method, and judging whether the template image and the image to be detected or the image of a certain area 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, the target and the template have the same size, direction and image elements, and the target can be found in the image through a certain algorithm.
Template matching using normalized correlation coefficient matching method
Figure BDA0003666649250000081
The standard workpiece or the digital-analog image is used as a template image to be matched and compared with an image to be detected, errors caused by shooting angles or other reasons can be improved by adjusting a matching threshold value, and whether the color of the workpiece meets the preset design requirement or not is judged.
And detecting the workpiece by using 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 position coordinates of the workpiece on the actual image.
And respectively extracting interested areas of the normal-form image of the object to be detected and the image of the object to be detected with the defects to obtain a normal characteristic image and a defect characteristic image with the same size.
Matching and comparing the obtained workpiece with the 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 the template, and judging whether the workpiece and the size and the shape of the workpiece meet the preset design requirements or not; and detecting whether the shape of the workpiece is qualified or not by using an image gray value detection method.
Establishing a selection area in the gray-scale image according to a preset size, counting gray-scale values of all pixel points in the selection area, and calculating a gray-scale mean value and a standard deviation value of the selection area;
and judging whether the gray value of the workpiece image meets the standard image or not so as to judge whether the workpiece is a qualified workpiece or not, integrating the template matching result, and outputting the result obtained by comparison.
If the range of the pixels containing the gray values exceeds the range of the pixels containing the gray values of the standard workpiece, the workpiece is considered to be overlarge in shape, if the range of the pixels containing the gray values is partially judged to be smaller than the range of the pixels containing the gray values of the standard workpiece, the workpiece is considered to be defective in shape, if the gray values of the pixels on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be unsmooth, if the gray values of the pixels 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, and if the gray values of the pixels on the part of the workpiece are judged to be larger than the standard gray values, the workpiece is considered to have a convex condition.
If the image to be detected has various morphological problems, the defect with larger difference with the standard workpiece is preferentially listed.
The detection method can detect the workpiece with corresponding digital-analog information and obvious color contrast, determine the deviation from ideal digital-analog information, detect 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 defect is found in the early stage, the assembly and the sub-assembly of the workpiece in the later stage are avoided, and the workpiece can be maintained in advance.
The defects mainly comprise whether a workpiece is in accordance with the shape, whether the position and the color of the workpiece are in accordance with the actual shape, whether the size is in accordance with the standard, whether the concave-convex condition exists, whether the surface is smooth and the like.
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should 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 required digital-analog information, storing the number, coordinates and form information of the workpieces in corresponding files, acquiring a gray-scale image of the qualified workpiece, and counting the gray-scale value of the qualified workpiece;
s3: establishing a corresponding coordinate system aiming at the image, aligning the digital-analog coordinate information with the image coordinate information, and acquiring 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 search position to an image target position frame, and carrying out edge detection on the workpiece on the image target position frame;
s6: acquiring a target workpiece by utilizing edge detection, and detecting and acquiring an image edge by utilizing the gray level step change of the edge position and other positions of a workpiece object;
s7: determining the deviation range of the workpiece movement according to errors possibly generated by actual manufacturing;
s8: respectively extracting interested areas of the normal form image of the object to be detected and the defective image of the object to be detected to obtain a normal characteristic image and a defective characteristic image with the same size;
s9: matching and comparing the obtained workpiece with the 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 obtained edge condition of the workpiece with the digital-analog information, and judging whether the workpiece and the size and the shape of the workpiece meet the preset design requirements or not;
s11: obtaining a gray level image of the workpiece image, establishing a selection area in the gray level image according to a preset size, counting gray levels of all pixel points in the selection area, and calculating a gray level mean value and a standard deviation value of the selection area;
s12: judging whether the gray value of the workpiece image meets the standard image or not so as to judge whether the workpiece is a qualified workpiece or not, integrating the template matching result, and outputting the result obtained by comparison;
if the pixel point range containing the gray value exceeds the pixel point range containing the gray value of the standard workpiece, the workpiece form is considered to be overlarge;
if the part judges that the pixel point containing the gray value is less than the pixel point range of the standard workpiece containing the gray value, the shape of the workpiece is determined to be defective;
if the gray values of the pixels on the surface of the whole workpiece are judged to be unbalanced, the surface of the workpiece is considered to be unsmooth, and if the gray values of the pixels on the judged part are smaller than the standard gray value, the workpiece is considered to have a concave condition;
if the gray value of the partial pixel points is judged to be greater than the standard gray value, the workpiece is considered to have a convex condition;
if the image to be detected has various morphological problems, the defect with larger difference with the standard workpiece is preferentially listed.
2. The method according to claim 1, wherein the method comprises: the workpiece detection and defect judgment method specifically comprises the following steps:
reading the number n and the position [ X ] of the workpieces from the digital-analog file W Y W Z W ]And size s 1 The relevant dimension information in the digital-analog design conforms to 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 the image, and converting and aligning the two coordinate systems to obtain a specific coordinate position point of the corresponding position of 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 a camera coordinate, converting the camera coordinate into an image coordinate, and converting the image coordinate into a pixel coordinate; is the interconversion between four coordinate systems;
wherein world coordinates are converted to camera coordinates:
Figure FDA0003666649240000021
camera coordinates are converted to image coordinates:
Figure FDA0003666649240000022
image coordinates are converted to pixel coordinates:
Figure FDA0003666649240000023
the process of directly converting world coordinates into pixel coordinates is as follows:
Figure FDA0003666649240000024
wherein the world coordinate is [ X ] W Y W Z W ]And the camera coordinate is [ X ] C Y C Z C ]And 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 are
Figure FDA0003666649240000025
The external parameter of the camera is
Figure FDA0003666649240000026
Coordinates of the position of the workpiece on the image [ u v]And size s 2 Information, and marking a preselection frame on the image;
detecting the edge of an image aiming at a preselected frame of the image to acquire and judge corresponding workpiece information;
the edge detection is carried out by using a Canny edge detection algorithm, and comprises the step of carrying out graying on 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 partial derivatives; carrying out non-maximum suppression on the gradient amplitude; detecting and connecting edges by using a dual-threshold algorithm;
wherein the gray value after gaussian filtering becomes:
Figure FDA0003666649240000031
the gradient strength and direction of each pixel point are as follows:
Figure FDA0003666649240000032
Figure FDA0003666649240000033
multiplying each pixel point and the neighborhood thereof by a Gaussian matrix, and taking the average value with the weight as the final gray value;
filtering non-maximum values, and filtering points which are not edges by using a rule to enable the width of the edges to be 1 pixel point to form edge lines;
Figure FDA0003666649240000034
comparing the obtained edge condition with the numerical model information, and judging whether the sizes and the shapes of the workpieces meet the preset design requirements or not;
according to the detected gray value, an upper threshold value and a lower threshold value in the image are obtained, wherein the upper threshold value and the lower threshold value are detected as edges, and the lower threshold value and the upper 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 not;
comparing the template image with the image to be detected or the image of a certain area by using a template matching method, and judging whether the images are 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 searched is known to exist in the image, the target and the template have the same size, direction and image elements, and the target is found in the image through a certain algorithm;
template matching using normalized correlation coefficient matching method
Figure FDA0003666649240000035
The standard workpiece or the digital-analog image is used as a template image to be matched and compared with an image to be detected, errors caused by shooting angles or other reasons are improved by adjusting a matching threshold value, and whether the color of the workpiece meets the preset design requirement or not is judged;
detecting the workpiece by using H, S and V values of the workpiece to obtain a 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;
respectively extracting interested areas of the normal-form image of the object to be detected and the image of the object to be detected with defects to obtain a normal characteristic image and a defect characteristic image with the same size;
matching and comparing the obtained workpiece with the 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 the template, 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; then, detecting whether the shape of the workpiece is qualified or not by using an image gray value detection method;
establishing a selection area in the gray-scale image according to a preset size, counting gray-scale values of all pixel points in the selection area, and calculating a gray-scale mean value and a standard deviation value of the selection area;
and judging whether the gray value of the workpiece image meets the standard image or not so as to judge whether the workpiece is a qualified workpiece or not, integrating the template matching result, and outputting the result obtained by comparison.
3. The method according to claim 2, wherein the method comprises: the defects comprise whether the workpiece conforms to the standard or not, whether the shape of the workpiece conforms to the reality or not, whether the position of the workpiece conforms to the reality or not, whether the color of the workpiece conforms to the reality or not, whether the size conforms to the standard or not, and whether the surface is smooth or not.
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 true CN114897864A (en) 2022-08-12
CN114897864B 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115257767A (en) * 2022-09-26 2022-11-01 中科慧眼(天津)研究开发有限公司 Pavement obstacle height measurement method and system based on plane target
CN115731165A (en) * 2022-09-28 2023-03-03 广州市易鸿智能装备有限公司 Detection system and method for lithium battery online size point inspection
CN116580022A (en) * 2023-07-07 2023-08-11 杭州鄂达精密机电科技有限公司 Workpiece size detection method, device, computer equipment and storage medium
CN116703914A (en) * 2023-08-07 2023-09-05 浪潮云洲工业互联网有限公司 Welding defect detection method, equipment and medium based on generation type artificial intelligence
CN116818780A (en) * 2023-05-26 2023-09-29 深圳市大德激光技术有限公司 Visual 2D and 3D detection system for button cell shell after laser welding
CN117152145A (en) * 2023-10-31 2023-12-01 威海天拓合创电子工程有限公司 Board card process detection method and device based on image
CN117974605A (en) * 2024-02-02 2024-05-03 山东福茂装饰材料有限公司 Method for detecting edge sealing defect of plate based on image
CN118010751A (en) * 2024-04-08 2024-05-10 杭州汇萃智能科技有限公司 Machine vision detection method and system for workpiece defect detection
CN118396942A (en) * 2024-04-22 2024-07-26 泰安鑫杰机械有限公司 Intelligent sensing and fault diagnosis method for transformer winding insulating part processing equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090161943A1 (en) * 2007-12-25 2009-06-25 Hitachi High-Technologies Corporation Inspection apparatus and inspection method
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
US20210010953A1 (en) * 2019-07-12 2021-01-14 SVXR, Inc. Methods and Systems for Defects Detection and Classification Using X-rays
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090161943A1 (en) * 2007-12-25 2009-06-25 Hitachi High-Technologies Corporation Inspection apparatus and inspection method
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
US20210010953A1 (en) * 2019-07-12 2021-01-14 SVXR, Inc. Methods and Systems for Defects Detection and Classification Using X-rays
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
JHON GOMEZ: "DDtM: Increasing Latent Defect Detection in Analog/Mixed-Signal ICs Using the Difference in Distance to Mean Value", 《IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS》, 29 September 2021 (2021-09-29), pages 4771 *
龙亮亮;刘冠峰;张国英;李永胜;: "基于机器视觉的玻璃马赛克缺陷在线检测系统", 机械设计与制造, no. 1, 8 September 2017 (2017-09-08), pages 136 - 139 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115257767A (en) * 2022-09-26 2022-11-01 中科慧眼(天津)研究开发有限公司 Pavement obstacle height measurement method and system based on plane target
CN115257767B (en) * 2022-09-26 2023-02-17 中科慧眼(天津)研究开发有限公司 Road surface obstacle height measurement method and system based on plane target
CN115731165A (en) * 2022-09-28 2023-03-03 广州市易鸿智能装备有限公司 Detection system and method for lithium battery online size point inspection
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
CN116818780A (en) * 2023-05-26 2023-09-29 深圳市大德激光技术有限公司 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
CN116580022A (en) * 2023-07-07 2023-08-11 杭州鄂达精密机电科技有限公司 Workpiece size detection method, device, computer equipment and storage medium
CN116703914A (en) * 2023-08-07 2023-09-05 浪潮云洲工业互联网有限公司 Welding defect detection method, equipment and medium based on generation type artificial intelligence
CN116703914B (en) * 2023-08-07 2023-12-22 浪潮云洲工业互联网有限公司 Welding defect detection method, equipment and medium based on generation type artificial intelligence
CN117152145A (en) * 2023-10-31 2023-12-01 威海天拓合创电子工程有限公司 Board card process detection method and device based on image
CN117152145B (en) * 2023-10-31 2024-02-23 威海天拓合创电子工程有限公司 Board card process detection method and device based on image
CN117974605A (en) * 2024-02-02 2024-05-03 山东福茂装饰材料有限公司 Method for detecting edge sealing defect of plate based on image
CN118010751A (en) * 2024-04-08 2024-05-10 杭州汇萃智能科技有限公司 Machine vision detection method and system for workpiece defect detection
CN118396942A (en) * 2024-04-22 2024-07-26 泰安鑫杰机械有限公司 Intelligent sensing and fault diagnosis method for transformer winding insulating part processing equipment

Also Published As

Publication number Publication date
CN114897864B (en) 2024-04-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
CN109871895B (en) Method and device for detecting defects of circuit board
CN112308916B (en) Target pose recognition method based on image target
CN111612737B (en) Artificial board surface flaw detection device and detection method
CN108007388A (en) A kind of turntable angle high precision online measuring method based on machine vision
CN109815822B (en) Patrol diagram part target identification method based on generalized Hough transformation
CN114862849A (en) Aluminum alloy plate film coating effect evaluation method based on image processing
CN107705293A (en) A kind of hardware dimension measurement method based on CCD area array cameras vision-based detections
CN111354047B (en) Computer vision-based camera module positioning method and system
CN114494045A (en) Large-scale straight gear geometric parameter measuring system and method based on machine vision
CN107610085A (en) A kind of welding point defect detecting system based on computer vision
JP6055228B2 (en) Shape measuring device
JP7393313B2 (en) Defect classification device, defect classification method and program
CN111192326B (en) Method and system for visually identifying direct-current charging socket of electric automobile
CN113970560B (en) Defect three-dimensional detection method based on multi-sensor fusion
CN115861217A (en) System and method for detecting defects of circuit board of backlight plate based on vision
CN114998571B (en) Image processing and color detection method based on fixed-size markers
CN113222955A (en) Gear size parameter automatic measurement method based on machine vision
KR100960543B1 (en) A method and a system for creating a reference image using unknown quality patterns
CN113252103A (en) Method for calculating volume and mass of material pile based on MATLAB image recognition technology
CN116883498A (en) Visual cooperation target feature point positioning method based on gray centroid extraction algorithm
CN114219802A (en) Skin connecting hole position detection method based on image processing
JP2007033126A (en) Substrate inspection device, parameter adjusting method thereof and parameter adjusting device
CN114155179A (en) Light source defect detection method, device, 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