CN111986208A - Target mark positioning circle capturing and positioning method and device and computer equipment - Google Patents

Target mark positioning circle capturing and positioning method and device and computer equipment Download PDF

Info

Publication number
CN111986208A
CN111986208A CN201911022611.5A CN201911022611A CN111986208A CN 111986208 A CN111986208 A CN 111986208A CN 201911022611 A CN201911022611 A CN 201911022611A CN 111986208 A CN111986208 A CN 111986208A
Authority
CN
China
Prior art keywords
circle
positioning
processing
positioning circle
picture
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.)
Pending
Application number
CN201911022611.5A
Other languages
Chinese (zh)
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.)
Shenzhen Anda Automation Software Co ltd
Original Assignee
Shenzhen Anda Automation Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Anda Automation Software Co ltd filed Critical Shenzhen Anda Automation Software Co ltd
Priority to CN201911022611.5A priority Critical patent/CN111986208A/en
Publication of CN111986208A publication Critical patent/CN111986208A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G06T5/70
    • 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/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/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/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • 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/30141Printed circuit board [PCB]

Abstract

The invention is suitable for the technical field of dispenser, and provides a method for capturing and positioning a target mark positioning circle, which comprises the steps of obtaining a preprocessed first mark positioning circle picture; sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail; performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm to determine the maximum connected domain in the thumbnail; and acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the marking positioning circle. The method comprises the steps of sampling a preprocessed marked positioning circle picture, carrying out binarization and abbreviative processing on the preprocessed marked positioning circle picture, and then carrying out inverse transformation calculation processing of connected domain analysis, weighted average processing and sampling processing on the preprocessed marked positioning circle picture, so that the circle center coordinate value of the marked positioning circle is obtained, and a large amount of operation time is saved.

Description

Target mark positioning circle capturing and positioning method and device and computer equipment
Technical Field
The invention belongs to the technical field of glue dispensers, and particularly relates to a method and a device for capturing and positioning a target mark positioning circle, and computer equipment.
Background
The marking positioning point is a position identification point of a PCB (printed Circuit Board) applied to an automatic chip mounter in circuit board design, when a working plane of the chip mounter is calibrated by using a machine vision technology, a calibration plate with the marking positioning point is often used as a calibration reference object, and the marking positioning point needs to be photographed and positioned for many times in the calibration process of the working plane of the chip mounter so as to calculate the calibration position of a mechanical device.
The traditional capture positioning of the marking positioning circle is directly processed by an algorithm, and the problems of slow operation and long consumed time exist.
Disclosure of Invention
The embodiment of the invention aims to provide a method for capturing and positioning a target marker positioning circle, and aims to solve the problems of slow operation and long consumed time of the traditional method for capturing and positioning the marker positioning circle by directly adopting an algorithm for processing.
The embodiment of the invention is realized in such a way that the method for capturing and positioning the target marker positioning circle comprises the following steps:
acquiring a preprocessed first mark positioning circle picture;
sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
Performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm to determine the maximum connected domain in the thumbnail;
and acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
The embodiment of the invention also provides a capturing and positioning device of the target mark positioning circle, which comprises:
the image acquisition unit is used for acquiring the preprocessed first mark positioning circle picture;
the binary thumbnail generation unit is used for sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
the maximum connected domain determining unit is used for analyzing the connected domain of the binary thumbnail based on a Two-Pass algorithm and determining the maximum connected domain in the thumbnail;
and the circle center coordinate value determining unit is used for acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
The embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the location description information display method according to any one of the above methods.
According to the capturing and positioning method for the target mark positioning circle, provided by the embodiment of the invention, the preprocessed mark positioning circle picture is subjected to sampling and binarization abbreviative processing, and then connected domain analysis, weighted average processing and inverse transformation calculation processing of a sampling processing method are carried out, so that the circle center coordinate value of the mark positioning circle is obtained, and a large amount of operation time can be saved.
Drawings
Fig. 1 is a flowchart of an implementation of a first method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of a second method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of a third method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an implementation of another method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention;
FIG. 6 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention;
FIG. 8 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention;
fig. 9 is a block diagram of a first capture locator for a target marker locating circle according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that the terms "first," "second," and the like, as used herein, may be used herein to describe various elements, which are limited by these terms. These terms are not only used to distinguish one element from another. For example, a first xx script may not be referred to as a second xx script, and similarly, a second xx script may not be referred to as a first xx script, without departing from the scope of the present application.
In the embodiment of the invention, the circle center coordinate value of the marked positioning circle is obtained by sampling the preprocessed marked positioning circle picture, carrying out binarization and abbreviative processing, and then carrying out connected domain analysis, weighted average processing and inverse transformation calculation processing of a sampling processing method, thereby saving a large amount of operation time.
By way of example, the capturing and positioning method for the target mark positioning circle can be applied to a component mounting and positioning device of a PCB, the device comprises an image acquisition device and an image processing device, the image acquisition device can be a video camera, a camera and the like, the image processing device can be a computer, an industrial personal computer and the like, the coordinate value of the mark point in the image can be obtained by processing the image of the calibration plate acquired by the image acquisition device by using the capturing and positioning method for the target mark positioning circle, and the capturing and positioning method for the target mark positioning circle is stored in the image processing device.
Fig. 1 shows a flowchart of an implementation of a first method for capturing and positioning a target marker positioning circle, which is provided by an embodiment of the present invention and is detailed as follows:
and S102, acquiring the preprocessed first mark positioning circle picture.
In the embodiment of the invention, the marked positioning circle picture is a picture shot by the glue dispenser at the marking positioning point when the glue dispenser is calibrated on the working plane, the first marked positioning circle picture is a picture generated after the shot picture is subjected to median filtering treatment to remove impulse noise and morphological closed operation treatment to remove star point noise, and the interference caused by dirt such as dust, residual grease and the like on the working plane can be basically removed.
And step S104, sequentially processing the preprocessed first mark positioning circle picture by adopting a sampling processing and OTSU (maximum inter-class difference) algorithm to generate a binary thumbnail.
In the embodiment of the invention, the sampling processing refers to carrying out thumbnail processing on a first marked positioning circle picture, sampling the picture at every several pixel points on the x axis and the y axis by setting the x axis and the y axis to construct a thumbnail, wherein the sampling is divided into down sampling, namely zooming the picture, and up sampling, namely amplifying the picture, and the sampling modes comprise various methods such as nearest interpolation, bilinear interpolation, mean value interpolation, median difference value and the like. Bilinear interpolation is a conventional method of sampling and is not described in detail.
In the embodiment of the invention, the OTSU algorithm is used for carrying out binarization processing on the thumbnail, the image is divided into a foreground part and a background part according to the gray characteristic of the thumbnail, the variance is a measure of the gray distribution uniformity, the larger the inter-class variance between the background and the foreground is, the larger the difference between the two parts forming the image is, the largest inter-class variance between the background and the foreground is taken, so that the difference between the background and the foreground is the largest, and the image with the largest difference between the background and the foreground is the binary thumbnail of the embodiment. The OTSU algorithm is a conventional algorithm for binarizing an image.
And S106, performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm, and determining the maximum connected domain in the thumbnail.
In the embodiment of the invention, the Two-value thumbnail is scanned twice by using a Two-Pass algorithm, all connected domains existing in the Two-value thumbnail are found and marked, and the connected domain with the largest area is the largest connected domain of the Two-value thumbnail. The Two-Pass algorithm is a conventional algorithm for image connected domain analysis.
And step S108, acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
In the embodiment of the invention, the image is composed of pixels, the pixel coordinate is the position of the pixel in the image, the pixel coordinate of the maximum connected domain represents the position of the maximum connected domain in the image, the weighted average operation is carried out on the pixel coordinate of the maximum connected domain by utilizing a weighted average algorithm to obtain the weighted average value of the pixel coordinate, and the weighted average value is the central coordinate of the maximum connected domain. The weighted average algorithm is a conventional algorithm for weighted average smoothing of gray-scale images.
In the embodiment of the present invention, the specific steps of the sampling process may refer to the explanation of step S104, and the inverse transform calculation of the sampling process may be understood as performing up-sampling, i.e., amplification process on the image according to the bilinear interpolation method.
In the embodiment of the invention, the circle center coordinate value of the marked positioning circle is obtained by sampling the preprocessed marked positioning circle picture, carrying out binarization and abbreviative processing, and then carrying out connected domain analysis, weighted average processing and inverse transformation calculation processing of a sampling processing method, thereby saving a large amount of operation time.
Fig. 2 shows a flowchart of an implementation of a second method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, the step S104 specifically includes a step S202 and a step S204.
Step S202, sampling every other pixel point in the x direction and the y direction of the preprocessed first mark positioning circle picture to generate a thumbnail.
In the embodiment of the invention, the sampling processing refers to carrying out thumbnail processing on a first marked positioning circle picture, sampling the picture at every several pixel points on the x axis and the y axis by setting the x axis and the y axis to construct a thumbnail, wherein the sampling is divided into down sampling, namely zooming the picture, and up sampling, namely amplifying the picture, and the sampling modes comprise various methods such as nearest interpolation, bilinear interpolation, mean value interpolation, median difference value and the like.
And S204, processing the thumbnail based on an OTSU algorithm to generate a binary thumbnail.
In the embodiment of the invention, the OTSU algorithm is used for carrying out binarization processing on the thumbnail, the image is divided into a foreground part and a background part according to the gray characteristic of the thumbnail, the variance is a measure of the gray distribution uniformity, the larger the inter-class variance between the background and the foreground is, the larger the difference between the two parts forming the image is, the largest inter-class variance between the background and the foreground is taken, so that the difference between the background and the foreground is the largest, and the image with the largest difference between the background and the foreground is the binary thumbnail of the embodiment.
Fig. 3 is a flowchart illustrating an implementation of the third method for capturing and positioning a circle of a target marker according to an embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, the step S102 specifically includes a step S302 and a step S304.
Step S302, acquiring a marked positioning circle original picture.
In the embodiment of the invention, the original picture of the marked positioning circle is a picture shot for the marked positioning point when the dispenser is used for calibrating on the working plane.
And step S304, processing the marked positioning circle original picture based on a median filtering algorithm and a morphological closed operation algorithm in sequence to generate a first marked positioning circle picture.
In the embodiment of the invention, the image is processed by using a median filtering algorithm to remove salt and pepper noise. Because the calibration board can have dirt such as dust, residual grease and the like in the placing process, the shot digital image is often polluted by a lot of noises such as salt and pepper noises, Gaussian noises and the like in the forming, transmission and recording processes of the digital image, the signal data of the image is sorted by using a median filtering algorithm, and a value corresponding to a middle item of a result is taken, so that the salt and pepper noises do not work, the median result is not influenced, and the original signal can be better protected. The median filtering algorithm is a conventional algorithm.
In the embodiment of the invention, the picture after the median filtering is subjected to smoothing processing by using a morphological closed operation algorithm to remove noise, an important target contour is reserved, and the interference of dirt such as dust, residual grease and the like on the image processing is further removed, so that the requirement of the calibration process on the cleaning degree of the calibration plate can be reduced, and the cleaning operation time is saved. The morphological closed-loop algorithm is a conventional algorithm for performing smooth denoising on an image.
Fig. 4 shows a flowchart of an implementation of the method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention, which is detailed as follows:
In the embodiment of the present invention, step S108 is followed by step S402 to step S412.
Step S402, acquiring the preprocessed second mark positioning circle picture.
In the embodiment of the invention, the marked positioning circle picture is a picture shot by the dispenser when the dispenser is used for calibrating the working plane and is a picture generated after pulse noise is removed by sequentially performing median filtering on the shot picture, so that the interference caused by dirt such as dust, residual grease and the like on the working plane can be basically removed.
Step S404, the circle center coordinate is taken as the center of the second marked positioning circle picture to process the second marked positioning circle picture, and the circle center coordinate and the circle radius of the marked positioning circle are determined.
In the embodiment of the present invention, the center coordinates of the marked positioning circle are the center coordinates determined in step S108, and the radius of the marked positioning circle is the distance from the center to the circumference.
Step S406, determining an annular search band by using the circumference of the mark positioning circle and the circumference of the second mark positioning circle.
In the embodiment of the present invention, the annular search band is a portion where the circumference of the mark positioning circle, which takes the center coordinates determined in step S108 as the center, overlaps with the circumference of the second mark positioning circle.
Step S408, calling preset direction vectors to determine two intersection points where each of the direction vectors intersects with the edge of the circular search band.
In an embodiment of the present invention, the preset direction vectors are a group of direction vectors that are uniformly distributed along the circumference of the second mark positioning circle and are parallel to the radius of the second mark positioning circle.
In the embodiment of the present invention, a set of direction vectors is preset in the second marker positioning circle picture, and the direction vectors are uniformly distributed on the circumference of the second marker positioning circle and are parallel to the radius of the second marker positioning circle. Two intersections are two points where the direction vector intersects the edge of the circular search band. Since there are two intersections of each direction vector with the edge of the circular search band, a set of direction vectors respectively intersect the edge of the circular search band, resulting in a set of two such intersections.
And step S410, processing the two intersection points determined by the same preset direction vector based on a gray scale caliper algorithm, and determining the edge point of the target mark positioning circle.
In an embodiment of the present invention, the edge point is denoted as a first edge point.
In the embodiment of the invention, two intersection points of the direction vector and the edge of the annular search belt are two points on the second mark positioning picture, the two points are connected to form a section of connecting line, a plurality of pixel points exist on the connecting line, the point with the maximum gray value on the connecting line is selected by utilizing a gray scale caliper algorithm according to the maximum value of gray scale gradient, the three points are fitted by utilizing a Gaussian function to obtain a function result, the result is the edge point captured by a single caliper, a group of edge points can be obtained after the group of intersection points are processed, and the group of edge points are connected to determine a circle, which is the target mark positioning circle. The gray scale caliper algorithm adopts a mode of fitting a Gaussian function to position the edge points, so that the positioning accuracy of the edge points is improved.
Step S412, processing the first edge point based on a least square circle fitting method, and determining a circle center coordinate and a circle radius value of the target mark positioning circle.
In the embodiment of the invention, the group of edge points are processed by using a least square circle fitting method, and the circle center coordinates and the circle radius of the circle formed by the edge points are determined, namely the circle center coordinates and the circle radius of the target mark positioning circle are determined. The least square method is generally used for curve fitting, and the least square circle fitting method is a detection method based on statistics, so that even if the edge of a circular target in an image is lost due to the influence of factors such as uneven illumination intensity, the positioning of the circle center and the detection of the radius cannot be influenced.
Fig. 5 is a flowchart illustrating an implementation of another method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, step S412 specifically includes step S502 and step S504.
Step S502, processing the first edge point based on a RANSAC algorithm (Random Sample Consensus), and determining a valid point of the first edge point.
In the embodiment of the invention, the edge points contain some interference points, so that the determination of the target circle has defects, the RANSAC algorithm is used for calculating the mathematical model parameters of the edge points to obtain the data of effective samples, namely, the RANSAC algorithm can be used for eliminating the interference points in the edge points, determining the effective points in the edge points and enabling the circumference of the target circle to be more smooth.
Step S504, processing the effective point of the first edge point based on a least square circle fitting method, and determining the circle center coordinate and the circle radius value of the target mark positioning circle.
In the embodiment of the invention, the effective points of the edge points are processed by using a least square circle fitting method, and the center coordinates and the circle radius of the circle formed by the effective points are determined, namely the center coordinates and the circle radius of the target mark positioning circle are determined. Because the RANSAC algorithm eliminates the interference points on the target mark positioning circle in the obvious steps, and then performs least square fitting, the operation precision is greatly improved.
Fig. 6 shows a flowchart of an implementation of a method for capturing and positioning a target marker positioning circle according to an embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, step S402 includes step S602 and step S604.
Step S602, acquiring a marked positioning circle original picture.
In the embodiment of the invention, the original picture of the marked positioning circle is a picture shot for the marked positioning point when the dispenser is used for calibrating on the working plane.
Step S604, processing the marked positioning circle original picture based on a median filtering algorithm to generate a second marked positioning circle picture.
In the embodiment of the invention, the image is processed by using a median filtering algorithm to remove salt and pepper noise. Because the calibration board can have dirt such as dust, residual grease and the like in the placing process, the shot digital image is often polluted by a lot of noises such as salt and pepper noises, Gaussian noises and the like in the forming, transmission and recording processes of the digital image, the signal data of the image is sorted by using a median filtering algorithm, and a value corresponding to a middle item of a result is taken, so that the salt and pepper noises do not work, the median result is not influenced, and the original signal can be better protected. The median filtering algorithm is a nonlinear signal processing technology which can effectively inhibit noise based on a sequencing statistical theory.
Fig. 7 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, step S404 includes step S702, step S704, and step S706.
Step S702, connecting the four corner points and the middle points of the four edges of the second mark positioning circle image with the center coordinates of the circle as the center of the second mark positioning circle image, respectively, to generate eight sets of line segments.
In the embodiment of the invention, the corner points are extreme points, namely points with particularly outstanding attributes in some aspects, and are isolated points with maximum or minimum intensity in some attributes, the middle points of line segments, pixel points corresponding to local maximum of the gradient of the gray scale, intersection points of two or more edges, points with high gradient values in the image and high change rate of the gradient direction. The angular points are pixel points corresponding to local maximum of the gray scale gradient, four edge lines are connecting lines connecting the four angular points, and the center of the circle of the second mark positioning circle picture is connected to the four angular points and the midpoints of the four connecting lines to obtain eight groups of line segments.
Step S704, processing the eight groups of line segments based on a gray scale caliper algorithm, determining edge points of the marked positioning circle, and recording the edge points as second edge points.
In the embodiment of the invention, a plurality of pixel points exist on the connecting line, a gray scale caliper algorithm is utilized to select the point with the maximum gray scale value on the connecting line according to the maximum gray scale gradient, a Gaussian function is utilized to fit the three points to obtain a function result, the result is the edge point captured by a single caliper, eight edge points can be obtained after the eight groups of connecting lines are processed, the eight edge points are connected to determine a circle, and the circle is a marked positioning circle. The gray scale caliper algorithm adopts a mode of fitting a Gaussian function to position the edge points, so that the positioning accuracy of the edge points is improved.
Step S706, processing the second edge point based on the least square circle fitting method, and determining the circle center coordinate and the circle radius of the mark positioning circle.
In the embodiment of the invention, the effective points of the edge points are processed by using a least square circle fitting method, and the center coordinates and the circle radius of the circle formed by the effective points are determined, namely the center coordinates and the circle radius of the marked positioning circle are determined.
Fig. 8 is a flowchart illustrating an implementation of a method for capturing and positioning a target marker positioning circle according to another embodiment of the present invention, which is detailed as follows:
in the embodiment of the present invention, step S706 includes step S802 and step S804.
And S802, processing the second edge point based on a RANSAC screening algorithm, and determining an effective point of the second edge point.
In the embodiment of the invention, the edge points contain some interference points, so that the determination of the target circle has defects, the RANSAC algorithm is used for calculating the mathematical model parameters of the edge points to obtain the data of effective samples, namely, the RANSAC algorithm can be used for eliminating the interference points in the edge points, determining the effective points in the edge points and enabling the circumference of the target circle to be more smooth.
Step S804, processing the effective points of the second edge points based on a least square circle fitting method, and determining the circle center coordinates and the circle radius of the marking positioning circle.
In the embodiment of the invention, the effective points of the edge points are processed by using a least square circle fitting method, and the center coordinates and the circle radius of the circle formed by the effective points are determined, namely the center coordinates and the circle radius of the target mark positioning circle are determined. Because the RANSAC algorithm eliminates the interference points on the target mark positioning circle in the obvious steps, and then performs least square fitting, the operation precision is greatly improved.
Fig. 9 is a block diagram of a first capture locator for a target marker locating circle according to an embodiment of the present invention, and only the relevant portions are shown for convenience of illustration.
As shown in fig. 9, an embodiment of the present invention provides a capturing and positioning device for a target marker positioning circle, the device comprising:
and the image acquisition unit 91 is used for acquiring the preprocessed first mark positioning circle picture.
In the embodiment of the invention, the marked positioning circle picture is a picture shot by the glue dispenser at the marking positioning point when the glue dispenser is calibrated on the working plane, the first marked positioning circle picture is a picture generated after the shot picture is subjected to median filtering treatment to remove impulse noise and morphological closed operation treatment to remove star point noise, and the interference caused by dirt such as dust, residual grease and the like on the working plane can be basically removed.
And the binary thumbnail generation unit 92 is used for sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail.
In the embodiment of the invention, the sampling processing refers to carrying out thumbnail processing on a first marked positioning circle picture, sampling the picture at every several pixel points on the x axis and the y axis by setting the x axis and the y axis to construct a thumbnail, wherein the sampling is divided into down sampling, namely zooming the picture, and up sampling, namely amplifying the picture, and the sampling modes comprise various methods such as nearest interpolation, bilinear interpolation, mean value interpolation, median difference value and the like.
In the embodiment of the invention, the OTSU algorithm is used for carrying out binarization processing on the thumbnail, the image is divided into a foreground part and a background part according to the gray characteristic of the thumbnail, the variance is a measure of the gray distribution uniformity, the larger the inter-class variance between the background and the foreground is, the larger the difference between the two parts forming the image is, the largest inter-class variance between the background and the foreground is taken, so that the difference between the background and the foreground is the largest, and the image with the largest difference between the background and the foreground is the binary thumbnail of the embodiment.
And the maximum connected domain determining unit 93 is configured to perform connected domain analysis on the binary thumbnail based on a Two-Pass algorithm, and determine a maximum connected domain in the thumbnail.
In the embodiment of the invention, the Two-value thumbnail is scanned twice by using a Two-Pass algorithm, all connected domains existing in the Two-value thumbnail are found and marked, and the connected domain with the largest area is the largest connected domain of the Two-value thumbnail.
And a circle center coordinate value determining unit 94, configured to obtain the pixel coordinate of the largest connected domain, process the pixel coordinate based on a weighted average method, determine a center coordinate of the largest connected domain, and perform inverse transformation calculation of the sampling process on the center coordinate to determine a circle center coordinate value of the mark positioning circle.
In the embodiment of the invention, the image is composed of pixels, the pixel coordinate is the position of the pixel in the image, the pixel coordinate of the maximum connected domain represents the position of the maximum connected domain in the image, the weighted average operation is carried out on the pixel coordinate of the maximum connected domain by utilizing a weighted average algorithm to obtain the weighted average value of the pixel coordinate, and the weighted average value is the central coordinate of the maximum connected domain.
In the embodiment of the present invention, the specific steps of the sampling process may refer to the explanation of step S104, and the inverse transform calculation of the sampling process may be understood as performing up-sampling, i.e., amplification process on the image according to the bilinear interpolation method.
In the embodiment of the invention, the circle center coordinate value of the marked positioning circle is obtained by sampling the preprocessed marked positioning circle picture, carrying out binarization and abbreviative processing, and then carrying out connected domain analysis, weighted average processing and inverse transformation calculation processing of a sampling processing method, thereby saving a large amount of operation time.
In one embodiment, a computer device is proposed, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
Acquiring a preprocessed first mark positioning circle picture;
sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm to determine the maximum connected domain in the thumbnail;
and acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the steps of:
acquiring a preprocessed first mark positioning circle picture;
sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm to determine the maximum connected domain in the thumbnail;
and acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in various embodiments may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for capturing and positioning a target marker positioning circle, comprising:
acquiring a preprocessed first mark positioning circle picture;
Sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
performing connected domain analysis on the binary thumbnail based on a Two-Pass algorithm to determine the maximum connected domain in the thumbnail;
and acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation processing of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
2. The method for capturing and positioning the target marker positioning circle according to claim 1, wherein the step of processing the preprocessed marker positioning circle picture by sequentially adopting sampling processing and an OTSU algorithm to generate a binary thumbnail specifically comprises:
sampling every several pixel points in the x and y directions of the preprocessed first mark positioning circle picture to generate a thumbnail;
and processing the thumbnail based on an OTSU algorithm to generate a binary thumbnail.
3. The method for capturing and positioning the target marker positioning circle according to claim 1, wherein the step of acquiring the preprocessed first marker positioning circle picture comprises:
Acquiring a marked positioning circle original picture;
and processing the marked positioning circle original picture based on a median filtering algorithm and a morphological closed operation algorithm in sequence to generate a first marked positioning circle picture.
4. The method for capturing and positioning a target marker positioning circle according to claim 1, wherein the step of obtaining the pixel coordinates of the maximum connected component area, processing the pixel coordinates based on a weighted average method to determine the center coordinates of the maximum connected component area, and performing an inverse transform calculation process of the sampling process on the center coordinates to determine the circle center coordinate value of the marker positioning circle further comprises:
acquiring a preprocessed second mark positioning circle picture;
processing the second marked positioning circle picture by taking the circle center coordinate as the center of the second marked positioning circle picture to determine the circle center coordinate and the circle radius of the marked positioning circle;
determining an annular search band by using the circumference of the mark positioning circle and the circumference of the second mark positioning circle;
calling preset direction vectors to determine two intersection points of each direction vector and the edge of the annular search belt, wherein the preset direction vectors are a group of direction vectors which are uniformly distributed along the circumference of the second mark positioning circle and are parallel to the radius of the second mark positioning circle;
Processing the two intersection points determined by the same preset direction vector based on a gray scale caliper algorithm, determining an edge point of a target mark positioning circle, and recording the edge point as a first edge point;
and processing the first edge point based on a least square circle fitting method, and determining the circle center coordinate and the circle radius value of the target mark positioning circle.
5. The method for capturing and positioning a target marker positioning circle according to claim 4, wherein the step of determining the center coordinates and the circle radius value of the target marker positioning circle by processing the first edge point based on a least square circle fitting method specifically comprises:
processing the first edge point based on a RANSAC algorithm, and determining a valid point of the first edge point;
and processing the effective points of the first edge points based on a least square circle fitting method, and determining the circle center coordinates and the circle radius values of the target mark positioning circle.
6. The method for capturing and positioning a target marker positioning circle according to claim 4, wherein the step of obtaining the preprocessed second marker positioning circle picture specifically comprises:
acquiring a marked positioning circle original picture;
and processing the marked positioning circle original picture based on a median filtering algorithm to generate a second marked positioning circle picture.
7. The method for capturing and positioning a target positioning circle according to claim 4, wherein the step of processing the second positioning circle picture with the center coordinates as the center of the second positioning circle picture to determine the center coordinates and the circle radius of the positioning circle is specifically as follows:
connecting four corner points and the middle points of four edges of the second mark positioning circle image respectively by taking the circle center coordinate as the center of the second mark positioning circle image to generate eight groups of line segments;
processing the eight groups of line segments based on a gray scale caliper algorithm, determining edge points of a marking positioning circle, and recording the edge points as second edge points;
and processing the second edge point based on a least square circle fitting method, and determining the circle center coordinate and the circle radius of the marking positioning circle.
8. The method for capturing and positioning the target marker positioning circle according to claim 7, wherein the step of determining the center coordinates and the circle radius of the marker positioning circle by processing the second edge point based on a least square circle fitting method specifically comprises:
processing the second edge point based on a RANSAC algorithm to determine an effective point of the second edge point;
And processing the effective points of the second edge points based on a least square circle fitting method, and determining the circle center coordinates and the circle radius of the marking positioning circle.
9. A target mark positioning circle capturing and positioning device, comprising:
the image acquisition unit is used for acquiring the preprocessed first mark positioning circle picture;
the binary thumbnail generation unit is used for sequentially processing the preprocessed first mark positioning circle picture by adopting sampling processing and an OTSU algorithm to generate a binary thumbnail;
the maximum connected domain determining unit is used for analyzing the connected domain of the binary thumbnail based on a Two-Pass algorithm and determining the maximum connected domain in the thumbnail;
and the circle center coordinate value determining unit is used for acquiring the pixel coordinate of the maximum connected domain, processing the pixel coordinate based on a weighted average method, determining the center coordinate of the maximum connected domain, and performing inverse transformation calculation of the sampling processing on the center coordinate to determine the circle center coordinate value of the mark positioning circle.
10. A computer arrangement comprising a memory and a processor, the memory having stored thereon a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of captured localization of a target marker localization circle of any of claims 1 to 8.
CN201911022611.5A 2019-10-25 2019-10-25 Target mark positioning circle capturing and positioning method and device and computer equipment Pending CN111986208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911022611.5A CN111986208A (en) 2019-10-25 2019-10-25 Target mark positioning circle capturing and positioning method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911022611.5A CN111986208A (en) 2019-10-25 2019-10-25 Target mark positioning circle capturing and positioning method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN111986208A true CN111986208A (en) 2020-11-24

Family

ID=73441561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911022611.5A Pending CN111986208A (en) 2019-10-25 2019-10-25 Target mark positioning circle capturing and positioning method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN111986208A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113034614A (en) * 2021-03-30 2021-06-25 上海久航电子有限公司 Five-circle center calibration method of five-circle calibration plate

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729655A (en) * 2014-01-22 2014-04-16 哈尔滨工业大学 Detection method for sheet element visual positioning
CN104463920A (en) * 2014-11-05 2015-03-25 西北工业大学 Two-level optimization Hough transformation rapid detection positioning method oriented to circular identifier
WO2017088462A1 (en) * 2015-11-24 2017-06-01 乐视控股(北京)有限公司 Image processing method and device
CN107588723A (en) * 2017-09-22 2018-01-16 南昌航空大学 Circular mark leak source detection method on a kind of High-speed target based on two-step method
CN108830838A (en) * 2018-05-28 2018-11-16 江苏大学 A kind of pcb board incompleteness Trigger jitter detection method of sub-pixel
CN208434185U (en) * 2018-06-22 2019-01-25 上海钧正网络科技有限公司 A kind of PCB circuit board

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729655A (en) * 2014-01-22 2014-04-16 哈尔滨工业大学 Detection method for sheet element visual positioning
CN104463920A (en) * 2014-11-05 2015-03-25 西北工业大学 Two-level optimization Hough transformation rapid detection positioning method oriented to circular identifier
WO2017088462A1 (en) * 2015-11-24 2017-06-01 乐视控股(北京)有限公司 Image processing method and device
CN107588723A (en) * 2017-09-22 2018-01-16 南昌航空大学 Circular mark leak source detection method on a kind of High-speed target based on two-step method
CN108830838A (en) * 2018-05-28 2018-11-16 江苏大学 A kind of pcb board incompleteness Trigger jitter detection method of sub-pixel
CN208434185U (en) * 2018-06-22 2019-01-25 上海钧正网络科技有限公司 A kind of PCB circuit board

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈戈珩;李华杰;房晓伟;: "基于相位一致性和Hough圆的贴片机视觉定位系统的研究", 科学技术与工程, no. 27 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113034614A (en) * 2021-03-30 2021-06-25 上海久航电子有限公司 Five-circle center calibration method of five-circle calibration plate
CN113034614B (en) * 2021-03-30 2022-05-10 上海久航电子有限公司 Five-circle center calibration method of five-circle calibration plate

Similar Documents

Publication Publication Date Title
US11854173B2 (en) System and method for finding lines in an image with a vision system
US6674904B1 (en) Contour tracing and boundary detection for object identification in a digital image
TWI581213B (en) Method, image processing system and computer-readable recording medium for item defect inspection
CN115908269B (en) Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN106920245B (en) Boundary detection method and device
CN109509200B (en) Checkerboard corner detection method based on contour extraction and computer readable storage medium
CN108288264B (en) Wide-angle camera module contamination testing method
CN107749071B (en) Large-distortion checkerboard image corner detection method and device
CN112184744A (en) Display screen edge defect detection method and device
CN113077459B (en) Image definition detection method and device, electronic equipment and storage medium
CN113379680A (en) Defect detection method, defect detection device, electronic equipment and computer readable storage medium
CN110852997A (en) Dynamic image definition detection method and device, electronic equipment and storage medium
CN112164050B (en) Method and device for detecting surface defects of products on production line and storage medium
CN112085682A (en) Image noise reduction method and device, electronic equipment and storage medium
CN111242888A (en) Image processing method and system based on machine vision
Mohammad et al. Study Sobel edge detection effect on the ImageEdges using MATLAB
Bukhari et al. Robust radial distortion from a single image
CN107230212B (en) Vision-based mobile phone size measuring method and system
CN112200848A (en) Depth camera vision enhancement method and system under low-illumination weak-contrast complex environment
CN109784328B (en) Method for positioning bar code, terminal and computer readable storage medium
CN111986208A (en) Target mark positioning circle capturing and positioning method and device and computer equipment
CN113554688B (en) O-shaped sealing ring size measurement method based on monocular vision
Evans et al. Iterative roll angle estimation from dense disparity map
CN109215068B (en) Image magnification measuring method and device
CN110490865B (en) Stud point cloud segmentation method based on high light reflection characteristic of stud

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