CN112883963B - Positioning correction method, device and computer readable storage medium - Google Patents

Positioning correction method, device and computer readable storage medium Download PDF

Info

Publication number
CN112883963B
CN112883963B CN202110136913.6A CN202110136913A CN112883963B CN 112883963 B CN112883963 B CN 112883963B CN 202110136913 A CN202110136913 A CN 202110136913A CN 112883963 B CN112883963 B CN 112883963B
Authority
CN
China
Prior art keywords
point
point set
determining
circle center
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110136913.6A
Other languages
Chinese (zh)
Other versions
CN112883963A (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.)
Hefei Lianbao Information Technology Co Ltd
Original Assignee
Hefei Lianbao Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Lianbao Information Technology Co Ltd filed Critical Hefei Lianbao Information Technology Co Ltd
Priority to CN202110136913.6A priority Critical patent/CN112883963B/en
Publication of CN112883963A publication Critical patent/CN112883963A/en
Application granted granted Critical
Publication of CN112883963B publication Critical patent/CN112883963B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • 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/30204Marker

Landscapes

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

Abstract

The invention discloses a positioning correction method, a device and a computer readable storage medium, wherein the method comprises the following steps: determining a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern through template mapping on the designated image; the first circle center set comprises a plurality of first circle centers; circle center correction is carried out through Hough circle detection according to the first circle center set to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers; determining one first central point in the first central point set, screening the second circle center set according to the first central point, and determining a second circle center meeting a preset index as a dependent point; carrying out affine transformation according to the dependent point and a first circle center corresponding to the dependent point to obtain affine transformation information; and correcting the first central point according to the affine transformation information to obtain a second central point so as to meet the requirement of accurate positioning.

Description

Positioning correction method, device and computer readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a positioning correction method, a positioning correction device, and a computer-readable storage medium.
Background
In the visual inspection of electronic equipment assembly, the accurate positioning of a component to be inspected is a key step of the visual inspection. Generally, the positioning of the component to be detected is to select a shape and an edge with significant features for the product design image and the product image to be detected respectively to perform shape matching, and obtain the position of the component to be detected by using a template mapping method. However, due to image distortion and slight deformation of the real object, the positioning error at the position far away from the center of the image is large, and the requirement of accurate positioning cannot be met.
Disclosure of Invention
The embodiment of the invention provides a positioning correction method, a positioning correction device and a computer readable storage medium, which have the effect of accurate positioning.
A first aspect of an embodiment of the present invention provides a positioning correction method, where the method includes: determining a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern through template mapping on the designated image; the first circle center set comprises a plurality of first circle centers; circle center correction is carried out through Hough circle detection according to the first circle center set to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers; determining one first central point in the first central point set, screening the second circle center set according to the first central point, and determining a second circle center meeting a preset index as a dependent point; carrying out affine transformation according to the dependent point and a first circle center corresponding to the dependent point to obtain affine transformation information; and correcting the first center point according to the affine transformation information to obtain a second center point.
In an implementation manner, the screening the second circle center set according to the first center point and determining a second circle center meeting a preset index as a dependent point includes: arranging and combining the second circle center set according to a preset number to obtain a candidate point set; and screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set.
In an embodiment, the preset index includes a distance preset index; correspondingly, the screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set includes: determining the distance between each candidate point in the candidate point set and the first central point according to the coordinates of the candidate point and the first central point; integrating the distance of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set; and determining a dependent point set according to the distance score.
In an embodiment, the preset index includes an angle preset index; correspondingly, screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set, including: determining an included angle between each two candidate points and the first central point according to the coordinates of each candidate point in the candidate point set and the first central point; comparing included angles between every two candidate points in the candidate point set and the first central point to obtain angle scores corresponding to the candidate point set; and determining a dependent point set according to the angle fraction.
In an implementation manner, when the preset index includes a distance preset index and an angle preset index; correspondingly, screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set, including: determining a distance score corresponding to the candidate point set according to a preset distance index; determining an angle score corresponding to the candidate point set according to an angle preset index; integrating the distance score and the angle score according to preset weight to obtain a dependence score; and comparing the dependency scores corresponding to all the candidate point sets, determining an optimal dependency score, and determining the candidate point set corresponding to the optimal dependency score as a dependency point set.
A second aspect of an embodiment of the present invention provides a positioning correction apparatus, including: the template mapping module is used for determining a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern on the appointed image through template mapping; the first circle center set comprises a plurality of first circle centers; the circle center correction module is used for correcting the circle center through Hough circle detection according to the first circle center set to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers; the screening module is used for determining one first central point in the first central point set, screening the second circle center set according to the first central point, and determining a second circle center meeting a preset index as a dependent point; the affine transformation module is used for carrying out affine transformation according to the dependent point and the first circle center corresponding to the dependent point to obtain affine transformation information; and the center point correction module is used for correcting the first center point according to the affine transformation information to obtain a second center point.
In one embodiment, the screening module includes: the permutation and combination submodule is used for carrying out permutation and combination on the second circle center set according to the preset number to obtain a candidate point set; and the index screening submodule is used for screening the candidate point set according to a preset index and determining the candidate point set meeting the preset index as a dependent point set.
In an embodiment, the preset index includes a distance preset index; correspondingly, the index screening submodule comprises: the distance determining unit is used for determining the distance between each candidate point in the candidate point set and the first central point according to the coordinates of the candidate point and the first central point; the distance integration unit is used for integrating the distance of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set; and the determining unit is used for determining the dependent point set according to the distance score.
In an embodiment, the preset index includes an angle preset index; correspondingly, the index screening submodule comprises: the included angle determining unit is used for determining an included angle between each two candidate points and the first central point according to the coordinates of each candidate point in the candidate point set and the first central point; the included angle comparison unit is used for comparing included angles between every two candidate points in the candidate point set and the first central point to obtain angle scores corresponding to the candidate point set; the determining unit is further configured to determine a dependent point set according to the angle score.
In an implementation manner, when the preset index includes a distance preset index and an angle preset index; correspondingly, the index screening submodule comprises: determining a distance score corresponding to the candidate point set according to a preset distance index; determining an angle score corresponding to the candidate point set according to an angle preset index; integrating the distance score and the angle score according to preset weight to obtain a dependence score; and comparing the dependency scores corresponding to all the candidate point sets, determining an optimal dependency score, and determining the candidate point set corresponding to the optimal dependency score as a dependency point set.
Another aspect of the embodiments of the present invention provides a computer-readable storage medium, which includes a set of computer-executable instructions, and when the instructions are executed, the storage medium is configured to perform any one of the above positioning correction methods.
The positioning correction method provided by the embodiment of the invention determines a first circle center set corresponding to the position of the circular pattern and a first center point set corresponding to the position of the non-circular pattern on the appointed image by utilizing template mapping, and then performs circle center correction according to the first circle center set to obtain a second circle center set. And then screening appropriate second circle centers in the second circle center set to correct the first center point to obtain a second center point, wherein compared with the first center point, the second center point eliminates the error of the position of the non-circular pattern caused by image distortion, so that the actual position of the non-circular pattern is positioned more accurately.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 is a schematic diagram illustrating an implementation flow of a positioning correction method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process of determining a dependent point set in a positioning correction method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an implementation module of a positioning correction apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic diagram of an implementation process of a positioning correction method according to an embodiment of the present invention.
Referring to fig. 1, a first aspect of the embodiments of the present invention provides a positioning correction method, including: operation 101, determining a first circle center set corresponding to a circular pattern and a first center point set corresponding to a non-circular pattern on a designated image through template mapping; the first circle center set comprises a plurality of first circle centers; operation 102, performing circle center correction on the first circle center set through hough circle detection to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers; operation 103, determining one of the first center points in the first center point set, screening a second center point set according to the first center point, and determining a second center point meeting a preset index as a dependent point; operation 104, performing affine transformation according to the dependent point and the first circle center corresponding to the dependent point to obtain affine transformation information; in operation 105, the first centroid is corrected according to the affine transformation information, and a second centroid is obtained.
The positioning correction method provided by the embodiment of the invention is applied to machine vision, is particularly suitable for vision detection in an intelligent factory, and realizes accurate positioning of a target product. The method comprises the steps of utilizing a template to map and determine a first circle center set corresponding to the position of a circular pattern on a designated image and a first center point set corresponding to the position of a non-circular pattern, and then carrying out circle center correction according to the first circle center set to obtain a second circle center set. Then, the non-circular pattern needing positioning correction is determined, the first central point corresponding to the non-circular pattern is determined, the second center is screened, the second center is concentrated with the appropriate second center to correct the first central point, the second central point is obtained, compared with the first central point, the second central point eliminates the error of the position of the non-circular pattern caused by image distortion, the actual positioning position of the component corresponding to the non-circular pattern is more accurate, namely the second central point is the central point position information of the actual component corresponding to the non-circular pattern on the appointed image, and therefore the purpose of accurately determining the actual position of the component through the appointed image is achieved.
Specifically, in the method operation 101, a designated image is obtained, and the designated image has a product image to be positioned thereon. When the product to be positioned is various components of the electronic equipment, the appointed image can be obtained by carrying out image acquisition on the electronic equipment on the assembly line through an image acquisition device arranged on the assembly line. The obtained designated image is provided with a product image to be positioned, it can be understood that the product can be provided with a corresponding real object template, based on the real object template, template mapping can be performed on the designated image through the real object template, and position information of features on the product image to be positioned can be determined. Through template mapping, a first set of centers corresponding to the circular part or structure and a first set of center points corresponding to the non-circular part or structure can be obtained. It is understood that the first circle center set includes the same number of first circle centers as the number of circular parts or structures on the physical template. Similarly, the number of the first central points contained in the first central point set is consistent with the data of the non-circular spare parts or structures on the physical template. For example, when there are four screw holes on the real template, the first circle center set contains position coordinate information of the four screw holes on the designated image. It is understood that the first circle center of the first circle center set is used for representing the position information of the circular pattern on the object template. And the first central point of the first central point set is used for representing the position information of the non-circular pattern on the real object template.
In operation 102, circle center correction is performed through hough circle detection according to the first circle center set to obtain a second circle center set. According to the first circle set, the area position of the circular pattern on the designated image can be roughly determined, then the image of the area is intercepted, and the image of the area is detected through Hough circle transformation, so that a corresponding second circle center set can be obtained. It will be appreciated that the second centre of the circle is used to characterise the position information of the circular pattern on the given image.
In operation 103, one of the first center points in the first center point set is determined according to the component to be positioned, for example, when the component to be positioned is the non-circular component a, the first center point corresponding to the non-circular component a is determined in the first center point set according to the real template. And screening a second circle center set according to the position information of the first center point, wherein in the operation, the second circle center set is used for correcting the position information of the first center point, based on the operation, a preset index is set to determine the second circle center of the first center point which can be accurately corrected, and the second circle center of the first center point which can be accurately corrected is determined as a dependent point. The preset index may be an index set based on a lens distortion rule and a practice deformation rule, for example, based on that lens distortion conditions in the same region are similar, the second circle center within the preset range of the first center point is screened as the dependent point.
In operation 104, the dependent point and the first circle center corresponding to the dependent point are determined to perform affine transformation, and affine transformation information is obtained, and the affine transformation information can be used for evaluating lens distortion conditions in the area of the specified image.
In operation 105, based on the affine transformation information of operation 104, the first centroid may be corrected according to the affine transformation information, i.e., the second centroid may be obtained. Similarly, the second center point is used to characterize the position information of the non-circular pattern on the given image. Compared with the first central point, the second central point can more accurately reflect the position information of the non-circular pattern on the designated image, so that convenience is brought to detection of the non-circular pattern, such as a polygonal appearance to-be-detected component. It should be noted that the position information may be represented by coordinate information, and the reference coordinate system may be determined according to actual conditions, for example, the position information of the first circle center is (a1, b1, c 1).
Fig. 2 is a schematic flow chart of the positioning correction method depending on the determination of the point set according to the embodiment of the present invention.
Referring to fig. 2, in an implementation manner, the operation 104 of screening a second circle center set according to the first center point and determining a second circle center meeting a preset index as a dependent point includes: operation 1041, performing permutation and combination on the second circle center set according to the preset number, to obtain a candidate point set; operation 1042, a candidate point set is screened according to the preset index, and the candidate point set meeting the preset index is determined as a dependent point set.
It can be understood that, as the number of the dependent points, the more the number of the dependent points is, the more accurate the correction result is, the method does not limit the preset number, for example, 3 dependent points can be set, and optionally three of the dependent points in the second circle center set can be used as a combination to obtain a plurality of candidate point sets, where the total number of the candidate point sets is Cn3And n is the number of the second circle centers. And then, scoring each candidate point set according to a preset index, in the scoring process, according to the setting of a scoring rule, the smaller the score is, the more the score is consistent with the preset index, or the larger the score is, the more the score is consistent with the preset index, comparing the scores of each candidate point set, determining the candidate point set with the score meeting the requirement as a dependent point set, and specifically, determining the candidate point set with the minimum score as the dependent point set under the condition that the smaller the score is, the more the score is, the preset index is met.
In one embodiment, the predetermined indicator includes a distance predetermined indicator; correspondingly, operation 1042 is to screen the candidate point set according to the preset index, and determine the candidate point set meeting the preset index as a dependent point set, including: firstly, determining the distance between a candidate point and a first central point according to the coordinates of each candidate point in a candidate point set and the first central point; then, integrating the distance of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set; and then determining a dependent point set according to the distance score.
In one case, the method may use a distance between each second circle center in the candidate point set and the first center point to be corrected as a specified basis of a preset index, and it can be understood that the closer the distance between the second circle center and the first center point is, the closer the distortion condition of the component corresponding to the second circle center is to the distortion condition of the component corresponding to the first center point. It should be noted that the candidate point in the candidate point set is the second circle center. Based on this, when the candidate point set is screened, the distance between each candidate point and the first central point is calculated, specifically, the distance calculation can be performed through the coordinate information of the coordinate candidate points and the first central point. And then integrating the distance of each candidate point in the candidate point set, and using an integrated result obtained after integration to determine a distance score. When the integration method is to add or average the distances corresponding to the candidate points, the smaller the integration result is, i.e. the closer the distance between the candidate point set and the first center point is. That is, when the integration result is in a direct relationship with the distance score, the smaller the distance score is, the closer the distance between the candidate point set and the first central point is, and at this time, the candidate point set with the smallest distance score may be screened through comparison of the distance scores, and the candidate point set with the smallest distance score may be determined as the dependent point set. Similarly, if the integration result is in inverse relation to the distance score, the greater the distance score is, the closer the distance between the candidate point set and the first center point is.
In one embodiment, the predetermined index includes an angle predetermined index; correspondingly, operation 1042 is to screen the candidate point set according to the preset index, and determine the candidate point set meeting the preset index as a dependent point set, including: firstly, determining an included angle between each two candidate points and a first central point according to the coordinates of each candidate point and the first central point in a candidate point set; then, comparing included angles between every two candidate points in the candidate point set and the first central point to obtain angle scores corresponding to the candidate point set; and determining a dependent point set according to the angle fraction.
In another case, the method may use an angle between each second circle center in the candidate point set and the first center point to be corrected as a specified basis of a preset index, and it can be understood that the component corresponding to the first center point has a certain shape and area, and distortions on opposite sides of the component may be different or have a certain difference. Based on the method, when the candidate point set is screened, the angle distribution of every two candidate points and the first central point is calculated, and the angle distribution can be calculated through the coordinate information of the coordinate candidate points and the coordinate information of the first central point. And then integrating the angle distribution of every two candidate points in the candidate point set and the first central point, and using an integrated result obtained after integration to determine an angle score. When the integration method is to calculate the average or added value of the difference values between the angles, the smaller the integration result is, i.e. the closer the angle between no two candidate points in the candidate point set and the first center point is. That is, when the integration result is in a direct proportion relationship with the angle score, the smaller the angle score is, the more uniform the angle distribution between the candidate point set and the first central point is, and at this time, the candidate point set with the most uniform angle distribution can be screened through comparison of the angle scores, and the candidate point set with the smallest angle score is determined as the dependent point set. If the integration result is in inverse relation to the angle score, the larger the angle score is, the more uniform the angle distribution between the candidate point set and the first center point is.
In an implementation, when the preset index includes a distance preset index and an angle preset index; correspondingly, operation 1042 is to screen the candidate point set according to the preset index, and determine the candidate point set meeting the preset index as a dependent point set, including: firstly, determining a distance score corresponding to a candidate point set according to a preset distance index; then, determining an angle score corresponding to the candidate point set according to an angle preset index; then, integrating the distance score and the angle score according to a preset weight to obtain a dependence score; and finally, comparing the dependency scores corresponding to all the candidate point sets, determining the optimal dependency score, and determining the candidate point set corresponding to the optimal dependency score as the dependency point set.
In another case, the preset index may be based on both the distance preset index and the angle preset index. In this case, the angle score and the distance score may be calculated in the above manner, further, in order to facilitate integration of the angle score and the distance score, normalization processing may be performed on the angle score and the distance score, the integration manner may be addition or multiplication to obtain a dependency score, and further, based on the influence of the angle score and the distance score on the correction accuracy, the method may further weight the distance score and the angle score respectively according to the influence on the accuracy, so as to further improve the accuracy of the dependency score. In the case where the angle score and the distance score are obtained in the above-described manner and the dependence score is obtained by addition or multiplication, the smaller the dependence score is, the more suitable the candidate point set is for correcting the first center point.
Specifically, a description is given below of a specific implementation scenario. The scene is applied to machine vision of an intelligent factory and used for positioning all components inside the notebook computer. The notebook computer with the internal components assembled inside is placed on the object placing table or the production line, and the image acquisition device for shooting the notebook computer with the internal components assembled is correspondingly arranged.
The method comprises the following steps that firstly, an image acquisition device is used for acquiring images of the notebook computer to obtain a designated image.
Performing template mapping on the designated image through a template corresponding to the assembly of the internal components to obtain a mapping circle center coordinate set of the circular component on the designated image, namely a first circle center set, which is marked as pts _ temp _ circle; and carrying out template mapping on the appointed image through a template corresponding to the assembly of the internal components to obtain a central point set of the non-circular components on the appointed image, namely a first central point set which is marked as pts _ temp _ polygon.
And thirdly, taking each circle center coordinate in the mapping circle center coordinate set as a center, and intercepting the image, wherein the intercepted image can be larger than the size of the component corresponding to the circular coordinate, the shape of the intercepted image can be a rectangle, and a rectangular image set corresponding to the circle center coordinate set is obtained. And detecting a circular part in each intercepted rectangular image by using a Hough circle detection algorithm to obtain an actual circle center coordinate set, namely a second circle center set, namely a pts _ real _ circle.
And fourthly, arranging and combining second circle centers in the actual circle center coordinate set, specifically, randomly selecting three circle centers as a combination, wherein the total number of the combinations is Cn3And n is the number of the coordinate points of the actual circle center. The resulting combination is the candidate set of points.
Determining a first central point (temp _ x, temp _ y) to be positioned in the first central point set, and calculating an angle fraction angle _ ratio of each candidate point set corresponding to the first central point, where the angle fraction angle _ ratio is obtained by normalizing an angle mean value angle _ dif, and the specific formula is as follows:
angle_ratio=(360-angle_dif)/360
the calculation formula of the angle mean is as follows:
angle_dif=|angle_0-angle_1|+|angle_1-angle_2|+|angle_2-angle_0|
and the angle _0, the angle _1 and the angle _2 are angles between two second circle center coordinates in the candidate point set and the first central point to be positioned respectively. Based on the above formula, the more uniform the angular distribution, the larger the angular fraction.
Operation six, calculating a distance score dis _ ratio of each candidate point set corresponding to the first center point, where the distance score dis _ ratio is obtained by normalizing a distance sum dis _ sum, and the specific formula is as follows:
dis_ratio=(dis_max*3-dis_sum)/(dis_max*3)
and dis _ max is the farthest distance between a second circle center and a first central point to be positioned in the actual circle center coordinate set pts _ real _ circle.
The calculation formula of the clutch distance value is as follows:
Figure BDA0002927052310000121
Figure BDA0002927052310000122
Figure BDA0002927052310000123
dis_sum=dis_ao+dis_bo+dis_co
in the candidate point set, the candidate point coordinates are a (a _ x, a _ y), b (b _ x, b _ y), and c (c _ x, c _ y). Based on the above formula, the closer the distance, the larger the distance score.
And operation seven, integrating the obtained angle scores and distance scores to obtain a dependent score depend _ score corresponding to each candidate point set.
The specific formula is as follows:
depend_score=angle_weight*angle_ratio+(1-angle_weight)*dis_ratio
the angle _ weight and the 1-angle _ weight are weights respectively corresponding to the angle score and the distance score, and can be selected according to actual needs. Based on the above formula calculation, the closer the circle center coordinate in the candidate point set is to the first center point coordinate, the more uniform the distribution is, and the higher the dependence score is.
And seventhly, sorting the dependency scores of all the candidate point sets to obtain a candidate point set A corresponding to the maximum dependency score. Obtaining a corresponding point set B in a corresponding mapping circle center coordinate set according to a candidate point set A corresponding to the maximum dependency score, carrying out affine transformation according to the corresponding point sets A and B, and calculating to obtain a transformation matrix M, wherein the transformation matrix M is shown as the following formula:
Figure BDA0002927052310000124
and eighthly, transforming the first central point to be positioned according to the transformation matrix M, and calculating to obtain actual coordinates (real _ x, real _ y) corresponding to the first central point, wherein the coordinates are point coordinates obtained after the first central point is positioned and corrected. As shown in the following formula:
Figure BDA0002927052310000125
the corrected point coordinates obtained by the method can be used for machine vision, so that the machine can better position the component corresponding to the corrected point coordinates, and the subsequent operations of the machine, including but not limited to assembly, carrying, detection, recording and the like, are facilitated.
Fig. 3 is a schematic diagram of an implementation module of a positioning correction apparatus according to an embodiment of the present invention.
Referring to fig. 3, a second aspect of the embodiments of the present invention provides a positioning correction apparatus, including: the template mapping module 301 is configured to determine a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern on the designated image through template mapping; the first circle center set comprises a plurality of first circle centers; the circle center correction module 302 is configured to perform circle center correction on the first circle center set through hough circle detection to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers; the screening module 303 is configured to determine one of the first center points in the first center point set, screen the second center point set according to the first center point, and determine a second center point meeting a preset index as a dependent point; the affine transformation module 304 is configured to perform affine transformation according to the dependent point and the first circle center corresponding to the dependent point to obtain affine transformation information; and a centroid correcting module 305, configured to correct the first centroid according to the affine transformation information to obtain a second centroid.
In one embodiment, the screening module 303 includes: the permutation and combination submodule 3031 is configured to perform permutation and combination on the second circle center set according to a preset number, so as to obtain a candidate point set; and the index screening submodule 3032 is configured to screen the candidate point set according to a preset index, and determine the candidate point set meeting the preset index as a dependent point set.
In one embodiment, the predetermined indicator includes a distance predetermined indicator; correspondingly, the index screening submodule 3032 includes: a distance determining unit 30321, configured to determine a distance between each candidate point in the candidate point set and the first center point according to the coordinates of the candidate point and the first center point; a distance integration unit 30322, configured to integrate distances of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set; a determining unit 30323 configured to determine the dependent point set according to the distance score.
In one embodiment, the predetermined index includes an angle predetermined index; correspondingly, the index screening submodule 3032 includes: an included angle determining unit 30324, configured to determine an included angle between each two candidate points and the first central point according to coordinates of each candidate point in the candidate point set and the first central point; an included angle comparing unit 30325, configured to compare included angles between each two candidate points in the candidate point set and the first central point, and obtain an angle score corresponding to the candidate point set; the determining unit 30323 is further configured to determine a dependent point set according to the angle score.
In an implementation, when the preset index includes a distance preset index and an angle preset index; correspondingly, the index screening submodule 3032 includes: determining a distance score corresponding to the candidate point set according to a preset distance index; determining an angle score corresponding to the candidate point set according to an angle preset index; integrating the distance score and the angle score according to a preset weight to obtain a dependence score; and comparing the dependency scores corresponding to all the candidate point sets, determining the optimal dependency score, and determining the candidate point set corresponding to the optimal dependency score as the dependency point set.
Another aspect of an embodiment of the present invention provides a computer-readable storage medium, where the storage medium includes a set of computer-executable instructions, and when the instructions are executed, the storage medium is configured to perform any one of the above positioning correction methods.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (4)

1. A method of position correction, the method comprising:
determining a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern through template mapping on the designated image; the first circle center set comprises a plurality of first circle centers;
circle center correction is carried out through Hough circle detection according to the first circle center set to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers;
determining one first central point in the first central point set, screening the second circle center set according to the first central point, and determining a second circle center meeting a preset index as a dependent point;
carrying out affine transformation according to the dependent point and a first circle center corresponding to the dependent point to obtain affine transformation information;
correcting the first center point according to the affine transformation information to obtain a second center point;
the screening the second circle center set according to the first center point, and determining a second circle center meeting a preset index as a dependent point, includes:
arranging and combining the second circle center set according to a preset number to obtain a candidate point set;
screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set;
the preset indexes comprise distance preset indexes;
correspondingly, the screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set includes:
determining the distance between each candidate point in the candidate point set and the first central point according to the coordinates of the candidate point and the first central point;
integrating the distance of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set;
determining a dependent point set according to the distance score;
and/or the preset index comprises an angle preset index;
correspondingly, screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set, including:
determining an included angle between each two candidate points and the first central point according to the coordinates of each candidate point in the candidate point set and the first central point;
comparing included angles between every two candidate points in the candidate point set and the first central point to obtain angle scores corresponding to the candidate point set;
and determining a dependent point set according to the angle fraction.
2. The method according to claim 1, wherein, when the preset index comprises a distance preset index and an angle preset index;
correspondingly, screening the candidate point set according to a preset index, and determining the candidate point set meeting the preset index as a dependent point set, including:
determining a distance score corresponding to the candidate point set according to a preset distance index;
determining an angle score corresponding to the candidate point set according to an angle preset index;
integrating the distance score and the angle score according to preset weight to obtain a dependence score;
and comparing the dependency scores corresponding to all the candidate point sets, determining an optimal dependency score, and determining the candidate point set corresponding to the optimal dependency score as a dependency point set.
3. A positioning correction apparatus, characterized in that the apparatus comprises:
the template mapping module is used for determining a first circle center set corresponding to the circular pattern and a first center point set corresponding to the non-circular pattern on the appointed image through template mapping; the first circle center set comprises a plurality of first circle centers;
the circle center correction module is used for correcting the circle center through Hough circle detection according to the first circle center set to obtain a second circle center set; the second circle center set comprises a plurality of second circle centers;
the screening module is used for determining one first central point in the first central point set, screening the second circle center set according to the first central point, and determining a second circle center meeting a preset index as a dependent point;
the affine transformation module is used for carrying out affine transformation according to the dependent point and the first circle center corresponding to the dependent point to obtain affine transformation information;
the center point correction module is used for correcting the first center point according to the affine transformation information to obtain a second center point;
the screening module includes:
the permutation and combination submodule is used for carrying out permutation and combination on the second circle center set according to the preset number to obtain a candidate point set;
the index screening submodule is used for screening the candidate point set according to a preset index and determining the candidate point set meeting the preset index as a dependent point set;
the preset indexes comprise distance preset indexes;
correspondingly, the index screening submodule comprises:
the distance determining unit is used for determining the distance between each candidate point in the candidate point set and the first central point according to the coordinates of the candidate point and the first central point;
the distance integration unit is used for integrating the distance of each candidate point in the candidate point set to obtain a distance score corresponding to the candidate point set;
a determining unit, configured to determine a dependent point set according to the distance score;
and/or the preset index comprises an angle preset index;
correspondingly, the index screening submodule comprises:
the included angle determining unit is used for determining an included angle between each two candidate points and the first central point according to the coordinates of each candidate point in the candidate point set and the first central point;
the included angle comparison unit is used for comparing included angles between every two candidate points in the candidate point set and the first central point to obtain angle scores corresponding to the candidate point set;
the determining unit is further configured to determine a dependent point set according to the angle score.
4. A computer-readable storage medium comprising a set of computer-executable instructions that, when executed, perform the location correction method of claim 1 or 2.
CN202110136913.6A 2021-02-01 2021-02-01 Positioning correction method, device and computer readable storage medium Active CN112883963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110136913.6A CN112883963B (en) 2021-02-01 2021-02-01 Positioning correction method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110136913.6A CN112883963B (en) 2021-02-01 2021-02-01 Positioning correction method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112883963A CN112883963A (en) 2021-06-01
CN112883963B true CN112883963B (en) 2022-02-01

Family

ID=76052314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110136913.6A Active CN112883963B (en) 2021-02-01 2021-02-01 Positioning correction method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112883963B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113997290B (en) * 2021-11-17 2023-03-28 合肥联宝信息技术有限公司 Control method and equipment for mechanical arm

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123542A (en) * 2014-07-18 2014-10-29 大连理工大学 Device and method for positioning wheel hub work piece
CN104794704A (en) * 2015-03-27 2015-07-22 华为技术有限公司 Calibration template and template detection method, device and terminal
CN105488779A (en) * 2014-09-18 2016-04-13 宝山钢铁股份有限公司 Camera distortion correction calibration board and calibration method
CN107967471A (en) * 2017-09-20 2018-04-27 北京工业大学 A kind of table tool automatic identifying method based on machine vision
CN108596854A (en) * 2018-04-28 2018-09-28 京东方科技集团股份有限公司 Image distortion correction method and device, computer-readable medium, electronic equipment
CN108734188A (en) * 2017-04-25 2018-11-02 中兴通讯股份有限公司 A kind of clustering method, equipment and storage medium
CN111861979A (en) * 2020-05-29 2020-10-30 合肥联宝信息技术有限公司 Positioning method, positioning equipment and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123542A (en) * 2014-07-18 2014-10-29 大连理工大学 Device and method for positioning wheel hub work piece
CN105488779A (en) * 2014-09-18 2016-04-13 宝山钢铁股份有限公司 Camera distortion correction calibration board and calibration method
CN104794704A (en) * 2015-03-27 2015-07-22 华为技术有限公司 Calibration template and template detection method, device and terminal
CN108734188A (en) * 2017-04-25 2018-11-02 中兴通讯股份有限公司 A kind of clustering method, equipment and storage medium
CN107967471A (en) * 2017-09-20 2018-04-27 北京工业大学 A kind of table tool automatic identifying method based on machine vision
CN108596854A (en) * 2018-04-28 2018-09-28 京东方科技集团股份有限公司 Image distortion correction method and device, computer-readable medium, electronic equipment
CN111861979A (en) * 2020-05-29 2020-10-30 合肥联宝信息技术有限公司 Positioning method, positioning equipment and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Olivier Ecabert et al..Adaptive Hough transform for the detection of natural shapes under weak affine transformations.《Pattern Recognition Letters》.2004, *
激光切割中FPCB定位和畸变校正方法;郑雪梅 等;《机床与液压》;20080731;第36卷(第7期);第46-51页 *

Also Published As

Publication number Publication date
CN112883963A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
CN112818988B (en) Automatic identification reading method and system for pointer instrument
CN111210468B (en) Image depth information acquisition method and device
CN111414934A (en) Pointer type meter reading automatic identification method based on fast R-CNN and U-Net
CN104657711B (en) A kind of readings of pointer type meters automatic identifying method of robust
CN107038443B (en) Method and device for positioning region of interest on circuit board
CN109726746B (en) Template matching method and device
CN111681186A (en) Image processing method and device, electronic equipment and readable storage medium
CN112883963B (en) Positioning correction method, device and computer readable storage medium
CN114529613A (en) Method for extracting characteristic point high-precision coordinates of circular array calibration plate
CN109727058A (en) User behavior method for detecting abnormality, device, electronic equipment and readable storage medium storing program for executing
CN106529548A (en) Sub-pixel level multi-scale Harris corner detection algorithm
CN107525652A (en) Lens distortion method of testing, apparatus and system
CN108992033B (en) Grading device, equipment and storage medium for vision test
CN117893468A (en) Rapid 3D hole detection method, system, computer equipment and medium
CN117372515A (en) Self-adaptive deviation rectifying control system
CN105389818B (en) Component positioning method and system
CN112381177A (en) Dial digital character recognition method and system based on deep learning
CN110208271B (en) Phased array antenna damage detection method, phased array antenna damage detection device and terminal
CN115880303A (en) Sub-pixel precision positioning detection method and system for PCB circular hole
CN112200002A (en) Body temperature measuring method and device, terminal equipment and storage medium
CN115424009A (en) Automatic reading method for pointer instrument data based on Yolact network
CN107734324A (en) Method and system for measuring illumination uniformity of flash lamp and terminal equipment
CN114897990A (en) Camera distortion calibration method and system based on neural network and storage medium
CN114155380A (en) Instrument panel image identification method and device, computer equipment and storage medium
CN112954310A (en) Image quality detection method, device, computer equipment and readable 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