CN114926488A - Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration - Google Patents

Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration Download PDF

Info

Publication number
CN114926488A
CN114926488A CN202210561825.5A CN202210561825A CN114926488A CN 114926488 A CN114926488 A CN 114926488A CN 202210561825 A CN202210561825 A CN 202210561825A CN 114926488 A CN114926488 A CN 114926488A
Authority
CN
China
Prior art keywords
target
pyramid
model
matching
search
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
CN202210561825.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.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
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 South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202210561825.5A priority Critical patent/CN114926488A/en
Publication of CN114926488A publication Critical patent/CN114926488A/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/12Edge-based segmentation
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/753Transform-based matching, e.g. Hough transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • 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/20048Transform domain processing
    • G06T2207/20061Hough transform
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a workpiece positioning method based on a generalized Hough model and improved pyramid search acceleration, which comprises the following steps: an off-line modeling stage and an on-line target matching stage. First, a stage matching model is created in an offline modeling stage. In the on-line target matching stage, the targets are matched by adopting an acceleration search strategy based on a pyramid according to a pre-established model file, the similarity of the targets is calculated by adopting a parallel calculation method, and the target position is finally obtained. The invention can improve the matching efficiency of target positioning and reduce the calculated amount in the positioning process, and the provided acceleration strategy has better acceleration performance than the existing matching speed method.

Description

Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration
Technical Field
The invention relates to the technical field of target positioning detection, in particular to a workpiece positioning method based on a generalized Hough model and improved pyramid search acceleration.
Background
Common target positioning algorithms in actual industrial fields include various methods based on gray scale, feature points, shape features and the like, but the target positioning method based on edge gradient features has the characteristics of good stability and strong shielding resistance, is widely applied in the visual field of fixed scenes, and has higher requirements on the calculation efficiency of the positioning algorithm due to diversification of requirements such as mechanical control, production efficiency and the like, so that how to improve the efficiency of target positioning is always a hotspot problem in the visual positioning field.
The target positioning algorithm is the most important algorithm in image processing, but is difficult to realize, and in order to meet the requirement of real-time visual detection of a workpiece target in an industrial environment, a workpiece positioning technology is urgently needed to solve the problem that the algorithm is insufficient in real time.
Disclosure of Invention
Compared with the prior art, the workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration can improve the matching efficiency of target positioning and reduce the calculated amount in the positioning process, and the provided acceleration strategy has better acceleration performance than the existing matching speed method.
The second purpose of the invention is to provide a workpiece positioning system based on the generalized Hough model and the improved pyramid search acceleration.
A third object of the present invention is to provide a storage medium.
It is a fourth object of the invention to provide a computing device.
In order to achieve the purpose, the invention adopts the following technical scheme:
a workpiece positioning method based on a generalized Hough model and improved pyramid search acceleration comprises the following steps:
an off-line model making stage: extracting required edge information from the template picture by using a model description method based on generalized Hough transformation for storage, and generating a model required by online matching;
and (3) an online target matching stage: the method comprises the following steps of searching a target according to an improved pyramid acceleration strategy, matching a target image by using stored information of a model file, reducing a search area by using a target area reduction strategy, and finally acquiring required target pose information, wherein the method specifically comprises the following steps:
and (3) coarse target matching: pyramid sampling is carried out on the target picture to generate multilayer pyramid picture information, edge information is extracted from the top layer pyramid picture by using a Canny operator, and similarity calculation is carried out on the edge information and the edge information in the loaded model file, so that a preselected target position is screened out;
target fine matching: searching in a next pyramid according to the preselected target position obtained at the upper layer, reducing the search area by adopting a target area reduction strategy, calculating the similarity, continuing to search in the next layer after obtaining the target position at the current layer, repeating the searching until reaching the bottom layer of the pyramid, and finally putting the obtained target coordinate position into a result queue to obtain a workpiece target positioning matching result.
As a preferred technical solution, the method for extracting and storing the required edge information from the template picture by using the model description method based on the generalized Hough transform to generate the model required for online matching includes the specific steps of:
calculating edge coordinates and gradient vector information in the template picture by using a Canny operator, and storing the extracted edge information of the template picture by using a generalized Hough model;
discrete sampling is carried out on the edge information;
creating a plurality of discrete parameter space templates, performing rotation transformation on the templates, extracting edge information of a current template picture, transforming edge points by using a transformation matrix, and calculating and obtaining positions of the rotated edge points and corresponding edge gradients after rotation;
setting pyramid layer number, generating a pyramid image by an original image according to a pyramid sampling method, performing edge information extraction on the pyramid layer image of each layer, creating a generalized Hough model, performing geometric transformation, and finally sequentially storing Hough models of different angles of each layer according to the pyramid layer number, thereby forming a complete model file;
as a preferred technical solution, the discrete sampling of the edge information specifically includes:
after extracting the edge information, reducing the number of edge points, firstly setting a discrete sampling step length called discrete granularity, calculating the vertical coordinate value and the horizontal coordinate value of each edge point, if the coordinate values are integral multiples of the step length, storing the edge, and if not, discarding the edge point.
As a preferred technical solution, when creating a template, the edge of the template picture is expanded to create a square region, which is called a model picture, and the side length of the square region is the minimum second power of the length of the original picture.
As a preferred technical solution, the target area reduction strategy specifically includes:
the coordinate of the upper left corner of the search area is set as (r) 1 ,c 1 ) The coordinate of the lower right corner is (r) 2 ,c 2 ) The specific calculation formula is as follows:
Figure BDA0003656902450000031
Figure BDA0003656902450000032
Figure BDA0003656902450000033
Figure BDA0003656902450000034
wherein, result x ,result y The horizontal and vertical coordinate points of the upper-layer matching coordinate points are defined, w is the width of the template picture, h is the length of the template picture, and i is the number of pyramid layers;
in the matching process, according to the information of the pre-matched target point, a search area is divided, and the next layer of search is carried out within the set angle and coordinate range;
angle search range value within search area:
angle upper =result angle +2·i
angle lower =result angle -2·i
wherein result angle For pre-matching angle values, angle upper For the upper limit value of the angle search range, angle lower The lower limit value of the angle searching range;
the coordinate in the search area at the upper left corner of the coordinate search range area is (x) 1 ,y 1 ) The coordinate of the lower right corner is (x) 2 ,y 2 ) Specifically, it is represented as:
x 1 =result x -c 1 -i
y 1 =result y -r 1 -i
x 2 =x 1 +2·i
y 2 =y 1 +2·i
setting an angle searching step length, wherein the angle searching step length is increased along with the increase of the pyramid layer number, and specifically expressed as follows:
e a =a s ·2 i
wherein e is a Denotes the angle search step, a s Which indicates the rotation angle step when the template is made.
As a preferred technical scheme, the method further comprises an approximate target deduplication step, wherein an approximate result in the result queue is screened, and the pose information of the target is finally obtained, and the specific steps comprise:
sorting the result queues according to the similarity, putting the first result with the highest similarity in the queue into a screened queue, sequentially traversing the sorted result queues, traversing the screened queue in each traversal, comparing the absolute value of the difference value between the result coordinate position in the result queue and the result coordinate position in the screened queue, discarding the result if the absolute value is less than a set threshold value, otherwise, putting the result into the screened queue.
In order to achieve the second object, the invention adopts the following technical scheme:
a workpiece positioning system based on generalized Hough model and improved pyramid search acceleration comprises: the online target matching system comprises an offline model building module and an online target matching module, wherein the online target matching module is provided with a target coarse matching unit and a target fine matching unit;
the offline model building module is used for building an offline model, extracting required edge information from a template picture by using a model description method based on generalized Hough transformation, storing the edge information and generating a model required by online matching;
the online target matching module is used for performing online target matching, performing target search according to an improved pyramid acceleration strategy, matching a target image by using the stored information of the model file, reducing a search area through a target area reduction strategy and finally acquiring required target pose information;
the target coarse matching unit is used for carrying out pyramid sampling on a target picture to generate multilayer pyramid picture information, extracting edge information from the top layer pyramid picture by using a Canny operator, and carrying out similarity calculation on the edge information and the edge information in the loaded model file so as to screen out a preselected target position;
the target fine matching unit is used for searching in a pyramid of the next layer according to a preselected target position obtained by the upper layer, reducing a search area by adopting a target area reduction strategy, then calculating similarity, continuing to search in the next layer after obtaining the target position of the current layer, repeating until the bottom layer of the pyramid is reached, and finally putting the obtained target coordinate position into a result queue to obtain a workpiece target positioning matching result.
In order to achieve the third object, the invention adopts the following technical scheme:
a computer-readable storage medium storing a program which, when executed by a processor, implements a method for workpiece positioning based on a generalized Hough model and improved pyramid search acceleration as described above.
In order to achieve the fourth object, the invention adopts the following technical scheme:
a computing device comprises a processor and a memory for storing a program executable by the processor, wherein the processor executes the program stored in the memory to realize the workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the invention avoids a non-ergodic searching mode by the generalized Hough model, can only utilize the edge information extracted by the template, thereby greatly reducing the matching time and the calculation amount consumed in model manufacture, combines with an improved pyramid searching acceleration method, reduces irrelevant calculation generated by increasing the picture size along with the gradual lower-layer searching of a pyramid, reduces the irrelevant calculation amount by a designed target area reduction strategy, has stronger anti-shielding and anti-interference capability, can realize the real-time positioning of a target at any angle and any coordinate, and simultaneously has better acceleration performance compared with the existing matching speed method.
Drawings
FIG. 1 is a schematic flow chart of a workpiece positioning method based on a generalized Hough model and improved pyramid search acceleration according to the present invention;
FIG. 2 is a schematic flow chart of edge information extraction and discrete sampling according to the present invention;
FIG. 3 is a schematic diagram of a generalized Hough model in the stage of extracting model information according to the present invention;
FIG. 4 is a schematic diagram of the model transformation of the present invention;
FIG. 5 is a schematic diagram of pyramid target search at an online target matching stage according to the present invention;
FIG. 6 is a schematic diagram of the objective reduction strategy 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.
Example 1
As shown in fig. 1, the present embodiment provides a workpiece positioning method based on a generalized Hough model and improved pyramid search acceleration, which includes the following steps:
s1: an off-line model making stage: extracting required edge information from a template picture by using a model description method based on generalized Hough transformation for storage, and generating a model required by online matching, wherein the method specifically comprises the following steps of:
s11, as shown in fig. 2, in the edge information extraction stage, edge coordinates and gradient vector information in the template picture are calculated using Canny operators with an edge threshold of 80 and a hysteresis threshold of 20, and the extracted template edge information is stored using a generalized Hough model;
constructing a generalized Hough model M according to information in the current pyramid picture, wherein the model M is a set of template edge points and gradient vectors corresponding to the edge points, and the gradient vector corresponding to the edge points is d i =(t i ,u i ) T
M=(p i ,d i )∈R 2 ×R 2 ,i=1,…,n
Wherein p is i =(x i ,y i ) T Is the relative coordinate of the edge points of the template with respect to the center point of the template, R 2 A two-dimensional real number set is represented.
As shown in fig. 3, the absolute coordinates of the calculated edge points are converted into relative coordinates of the center of the picture by using the generalized Hough model, and then step S12 is performed;
and (3) generalized Hough model construction:
firstly, after edges and gradient features corresponding to the edge points are extracted from a template image, the coordinates of the edge points at the moment take the upper left corner as a coordinate point, but the coordinates are inconvenient to use when rotating, so that the coordinates are converted into relative coordinates taking the center of a picture as an origin;
and (4) converting the absolute coordinates into relative coordinates, and subtracting the picture center coordinates from the absolute coordinates to obtain the relative coordinates, wherein the gradient value is unchanged.
After the calculation is completed, a table 1 is established, which is as follows:
table 1 structural schematic table of generalized hough model
Number of edge point Relative coordinates of edge points Gradient of edge points
1 p 1 =(x,y) d 1 =(t,u)
2 p 2 =(x,y) d 2 =(t,u)
The table structure forms a model M, which is also called a generalized Hough model, of course, the generalized Hough model is only under an angle, and the complete version is shown in the following Table 2;
s12, in the stage of model discrete sampling, discrete sampling is carried out on the edge information of the model, and the amount of stored edge data is reduced, and the method specifically comprises the following steps:
after extracting the edge information, in order to reduce the number of edge points, firstly setting a discrete sampling step length called discrete granularity, calculating a longitudinal coordinate value and an abscissa coordinate value of each edge point, and if the coordinate values are integral multiples of the step length, storing the edge; if not, the edge point is discarded.
Since the discrete granularity adopted in the present embodiment is 2, if the abscissa or ordinate position of the edge point can be divided by 2, the edge point is deleted, otherwise, the edge point is retained, so as to reduce the number of edge points, and then step S13 is executed;
s13, in the model transformation stage, discrete edge points and gradient vectors are processed by using geometric change, so that edge information in multiple directions is obtained;
in order to find a target object with geometric transformation in an image, a plurality of discrete parameter space templates are created, the discrete degree of the templates depends on the size of a template picture, templates in a plurality of directions are created, meanwhile, the aspect ratio is not fixed during the selection of the templates, and after the templates are subjected to rotation transformation, the variation of the aspect ratio of a rectangle circumscribed by the templates is larger.
After the edge information of the current template picture is extracted, in order to accelerate the template making speed of rotation in other multiple directions, according to the characteristics of a generalized Hough transform model, the edge points of the current edge point set are transformed by using a transform matrix, and the original image traversal transform operation is converted into the operation on the edge point set, so that the calculation amount consumed by edge recalculation is reduced.
As the initial angle of the input parameters is 0, the final angle is 360, and the step length is 1, templates in 360 directions need to be created to expand the edges of the pictures, as the length of the pictures is 640, the expansion length is 1024, and according to the size of the expanded model pictures, the relative coordinate positions stored in the generalized Hough model are utilized, and as shown in FIG. 4, the positions of the rotated edge points and the corresponding gradient of the rotated edge are obtained through calculation of a transformation matrix;
in this embodiment, the rotation and movement matrix of the template picture in the model picture is:
Figure BDA0003656902450000091
a=s*cos(θ)
b=s*sin(θ)
p x =(l-c)/2
p y =(l-r)/2
where s is the scaling factor and θ is the angle of rotation.
The rotated edge point p' is
p′=T*p
The gradient vector value d' corresponding to the edge point after the simultaneous transformation is
d′=(R -1 ) T d i
Figure BDA0003656902450000092
Then step S14 is executed;
s14, a model generation stage, wherein the number of the given pyramid layers is 3, so that an original picture generates three layers of pyramid images according to a pyramid sampling method, each layer of image is processed according to the steps of S11, S12 and S13 in sequence, and finally information of each layer is stored, so that a model file is obtained;
in this embodiment, in each pyramid layer, edge information extraction is performed once on the pyramid layer picture of each layer, a generalized hough model is created, geometric transformation is performed, and finally hough models at different angles of each layer are sequentially stored according to the number of pyramid layers, so that a complete model file is formed. As shown in the following table 2, below,
TABLE 2 structural schematic table of Hough models at different angles
Figure BDA0003656902450000093
Figure BDA0003656902450000101
S2, performing online target matching, and searching a target according to an improved pyramid acceleration strategy: matching the target image by using the stored information of the model file, accelerating the positioning process of the target through a region reduction strategy, and finally acquiring the required position and pose information of the target;
the stored information of the model file in this embodiment is an integral composed of the generalized hough model calculated by each pyramid layer picture and the information after geometric transformation thereof.
The pyramid acceleration strategy is improved specifically by reducing a search area in a pyramid search process, in the search process, according to a coordinate and angle result matched by a previous layer, in the search of a next layer, only information in a specific angle range is used for matching in the specific area, so that the phenomenon that a large amount of time is consumed in some areas which are impossible or extremely low in possibility in the matching calculation process can be avoided, the phenomenon that low-probability template information is used for calculation can also be avoided, and the image data amount is larger as the pyramid bottom layer is reached, and irrelevant calculation can be reduced through the mode.
S21, in the stage of coarse target matching, pyramid sampling is carried out on a target picture to generate multilayer pyramid picture information, edge information is extracted from the top pyramid picture by using a Canny operator, and similarity calculation is carried out on the edge information and the edge information in the loaded model file, so that a preselected target position is screened out;
firstly, a multilayer pyramid image is constructed on an image to be searched according to the input pyramid layer number of 3, as shown in fig. 5, edge coordinates and gradient vector information in the pyramid layer image are calculated according to Canny operators with the same parameters when a template is manufactured according to S11 in the top pyramid image, under the condition that the pyramid layer number is given to be 3, the top pyramid layer number is 2, and then the similarity formula is adopted
Figure BDA0003656902450000111
Calculating by utilizing the edge points stored in the model file and the corresponding edge points in the picture to be searched, wherein e x,y =(v x,y ,w x,y ) T The edge points q in the image to be searched are gradient vectors corresponding to (x, y); d is a radical of i =(t i ,u i ) T Is a feature point p in the template model i =(x i ,y i ) T The corresponding edge gradient vector has a greedy value g of 0.7 given by the user and is expressed by the formula
Figure BDA0003656902450000112
Figure BDA0003656902450000113
Judging, wherein n is the number of edge points of the template, m is the calculated edge point, and S min And if the inequality is established, immediately terminating the calculation. With a given minimum similarity score of 0.6, if the similarity is higher than the minimum similarity, the target point is retained as a preselected target point; if the similarity is lower than the minimum similarity, the target point is discarded, and then step 22 is executed;
s22, a target fine matching stage:
and searching in the next pyramid layer according to the pre-matching target point, reducing the area to be searched by using a target reduction strategy, calculating the similarity, continuing to search in the next layer after obtaining the target position of the current layer, repeating until reaching the pyramid bottom layer, and finally putting the obtained target coordinate position into a result array.
Meanwhile, in order to improve the calculation speed in the matching process, a parallel method is adopted to improve the matching speed in the searching process. When the potential target points are obtained at the top of the pyramid, a separate thread is used for each potential target point, and the target search is performed by adopting the search strategy provided by the embodiment.
In the upper pyramid, discrete sampling of the pyramid image may result in a false match of the target. And when the similarity value is found to be smaller than the threshold value in the matching process, abandoning subsequent matching so as to reduce the calculation amount. If greater than the threshold, the result is placed in a result queue. After a matching result is obtained, eliminating invalid matching through an approximate target duplicate removal method;
in this embodiment, according to a preselected target position obtained at an upper layer, searching is performed in a pyramid at a lower layer, the size of a picture is larger as the pyramid gradually searches to the lower layer, and in order to reduce irrelevant calculation, a region reduction strategy is adopted to reduce a search region and further search for a target.
The target area reduction strategy specifically includes:
after the potential search area position is determined in the upper pyramid, when the similarity is to be calculated, the area can be further reduced according to the characteristic because the template model stores the relative coordinates of the center and the edge points of the template, and the coordinate of the upper left corner of the search area is (r) 1 ,c 1 ) The coordinate of the lower right corner is (r) 2 ,c r )。
Figure BDA0003656902450000121
Figure BDA0003656902450000122
Figure BDA0003656902450000123
Figure BDA0003656902450000124
Wherein result x ,result y The horizontal and vertical coordinate points of the upper-layer matching coordinate points are, w is the width of the template picture, h is the length of the template picture, i is the number of pyramid layers, the range of i is 0-7, and 0 is the lowest layer, namely the size of the original picture.
In the matching process, a search area is divided according to the information of the target point to be matched, and the next layer of search is carried out within a certain angle and coordinate range.
Angle search range value within search area:
angle upper =result angle +2·i
angle lower =result angle -2·i
wherein result angle To pre-match the angle values, angle upper For the upper limit value of the angle search range, angle lower The lower limit value of the angle searching range;
coordinate in the search area the upper left corner of the coordinate search range area is (x) 1 ,y 1 ) The coordinate of the lower right corner is (x) 2 ,y 2 )
x 1 =result x -c 1 -i
y 1 =result y -r 1 -i
x 2 =x 1 +2·i
y 2 =y 1 +2·i
Because the pyramid at the upper layer is discrete sampling of the original picture and the edge information at the upper layer is incomplete, a larger step length can be used in the upper layer search, so that the angle search step length is increased along with the increase of the number of layers of the pyramid, and the angle search step length e a Is composed of
e a =a s ·2 i
Wherein a is s The step length of the rotation angle when the template is manufactured.
After the preselected target in the top pyramid is acquired from S21, the search area in the next level pyramid image is reduced according to the proposed target search strategy, and then in the next level pyramid image, given a pyramid level number of 3, at which the pyramid level number is 1, the search area will be limited to a rectangular area, and within that area, the pose information includes coordinate information and angle information, and then a coordinate search range and an angle search upper and lower limit ranges are calculated, as shown in fig. 6, edge coordinates and gradient vector information in the region are calculated according to Canny operator with the same parameters when the template is manufactured in S11, and performing similarity calculation and screening methods the same as those in S21 using the model information in the angle search range within the coordinate search range to obtain preselected target points in the number of layers of the pyramid, and then performing step 23.
And S23, repeating the operation in the S22 until the pyramid layer number is 0, namely the size of the original picture of the picture to be searched, obtaining a preselected target point in the original picture, screening an approximate result by using an approximate target duplicate removal method, and finally obtaining the pose information of the target.
In this embodiment, the approximate target deduplication method specifically includes:
firstly sorting the result queues according to the similarity, putting the first result with the highest similarity in the queue into a screened queue, then sequentially traversing the sorted result queues, traversing the screened queue in each traversal, comparing the absolute value of the difference value between the result coordinate position in the result queue and the result coordinate position in the screened queue, discarding the result if the absolute value is less than a threshold value, otherwise, putting the result into the screened queue.
The method avoids a non-ergodic searching mode by virtue of a generalized Hough model, can only utilize edge information extracted by a template, thereby greatly reducing matching time and the calculation amount consumed in model manufacturing, combines an improved pyramid search acceleration method, reduces irrelevant calculation generated by increasing the picture size along with gradual lower-layer searching of a pyramid, reduces the irrelevant calculation amount by virtue of a designed target area reduction strategy, has strong anti-shielding and anti-interference capability, and can realize real-time positioning of a target at any angle and any coordinate; meanwhile, the proposed acceleration strategy has better acceleration performance than the existing speed matching method.
Example 2
The embodiment provides a workpiece positioning system based on a generalized Hough model and improved pyramid search acceleration, which comprises: the online target matching system comprises an offline model building module and an online target matching module, wherein the online target matching module is provided with a target coarse matching unit and a target fine matching unit;
in this embodiment, the offline model building module is configured to build an offline model, extract and store required edge information from a template picture by using a model description method based on generalized Hough transform, and generate a model required for online matching;
in this embodiment, the online target matching module is configured to perform online target matching, perform target search according to an improved pyramid acceleration policy, match a target image using information stored in a model file, reduce a search area by a target area reduction policy, and finally obtain required target pose information;
in this embodiment, the target coarse matching unit is configured to perform pyramid sampling on a target picture to generate multilayer pyramid picture information, extract edge information from a top-level pyramid picture by using a Canny operator, and perform similarity calculation with the edge information in a loaded model file, thereby screening out a preselected target position;
in this embodiment, the target fine matching unit is configured to search in a pyramid of a next layer according to a preselected target position obtained by an upper layer, reduce a search area by using a target area reduction strategy, perform similarity calculation, continue to search in the next layer after obtaining a target position of a current layer, repeat until a bottom layer of the pyramid, and finally place the obtained target coordinate position in a result queue to obtain a workpiece target positioning matching result.
Example 3
The present embodiment provides a storage medium, which may be a storage medium such as a ROM, a RAM, a magnetic disk, an optical disk, or the like, and the storage medium stores one or more programs, and when the programs are executed by a processor, the workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration of embodiment 1 is implemented.
Example 4
The embodiment provides a computing device, which may be a desktop computer, a notebook computer, a smart phone, a PDA handheld terminal, a tablet computer, or other terminal device with a display function, and the computing device includes a processor and a memory, where the memory stores one or more programs, and when the processor executes the programs stored in the memory, the workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration of embodiment 1 is implemented.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (9)

1. A workpiece positioning method based on generalized Hough model and improved pyramid search acceleration is characterized by comprising the following steps:
an off-line model making stage: extracting required edge information from the template picture by using a model description method based on generalized Hough transformation for storage, and generating a model required by online matching;
and (3) an online target matching stage: the method comprises the following steps of searching a target according to an improved pyramid acceleration strategy, matching a target image by using stored information of a model file, reducing a search area by using a target area reduction strategy, and finally acquiring required target pose information, wherein the method specifically comprises the following steps:
and (3) coarse target matching: pyramid sampling is carried out on the target picture to generate multilayer pyramid picture information, edge information is extracted from the top layer pyramid picture by using a Canny operator, and similarity calculation is carried out on the edge information and the edge information in the loaded model file, so that a preselected target position is screened out;
target fine matching: searching in the next pyramid according to the preselected target position obtained at the upper layer, reducing the search area by adopting a target area reduction strategy, then carrying out similarity calculation, continuing to search in the next layer after obtaining the target position at the current layer, repeating until reaching the bottom layer of the pyramid, and finally putting the obtained target coordinate position into a result queue to obtain a workpiece target positioning matching result.
2. The workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration of claim 1, wherein the model description method based on the generalized Hough transform is used for extracting and storing the required edge information from the template picture to generate the model required for online matching, and the specific steps include:
calculating edge coordinates and gradient vector information in the template picture by using a Canny operator, and storing the extracted edge information of the template picture by using a generalized Hough model;
discrete sampling is carried out on the edge information;
creating a plurality of discrete parameter space templates, performing rotation transformation on the templates, extracting edge information of a current template picture, transforming edge points by using a transformation matrix, and calculating and obtaining positions of the rotated edge points and corresponding edge gradients after rotation;
setting pyramid layer number, generating pyramid images of an original image according to a pyramid sampling method, extracting edge information of the pyramid layer images of each layer once, creating a generalized Hough model, performing geometric transformation, and finally sequentially storing Hough models of different angles of each layer according to the pyramid layer number to form a complete model file.
3. The workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration according to claim 2, wherein the discrete sampling is performed on the edge information, and the specific steps include:
after extracting the edge information, reducing the number of edge points, firstly setting a discrete sampling step length called discrete granularity, calculating the vertical coordinate value and the horizontal coordinate value of each edge point, if the coordinate values are integral multiples of the step length, storing the edge, and if not, discarding the edge point.
4. The workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration as claimed in claim 2, wherein said creating a plurality of discrete parameter space templates, when creating the template, first extending the template picture edge to create a square region, called the model picture, whose square side length is the smallest second power of the original picture length.
5. The workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration according to claim 1, wherein the target region reduction strategy specifically comprises:
the coordinate of the upper left corner of the search area is set as (r) 1 ,c 1 ) The coordinate of the lower right corner is (r) 2 ,c 2 ) The specific calculation formula is as follows:
Figure FDA0003656902440000021
Figure FDA0003656902440000022
Figure FDA0003656902440000023
Figure FDA0003656902440000024
wherein, result x ,result y The horizontal and vertical coordinate points of the upper-layer matching coordinate points are set, w is the width of the template picture, h is the length of the template picture, and i is the number of pyramid layers;
in the matching process, a search area is divided according to the information of the target point to be matched, and the next layer of search is carried out within the set angle and the set coordinate range;
angle search range value within search area:
angle upper =result angle +2·i
angle lower =result angle -2·i
wherein result angle To pre-match the angle values, angle upper For the upper limit value of the angle search range, angle lower The lower limit value of the angle searching range;
coordinate in the search area the upper left corner of the coordinate search range area is (x) 1 ,y 1 ) The coordinate of the lower right corner is (x) 2 ,y 2 ) Specifically, it is represented as:
x 1 =result x -c 1 -i
y 1 =result y -r 1 -i
x 2 =x 1 +2·i
y 2 =y 1 +2·i
setting an angle searching step length, wherein the angle searching step length is increased along with the increase of the pyramid layer number, and the angle searching step length is specifically represented as:
e a =a s ·2 i
wherein e is a Denotes the angle search step, a s Which indicates the rotation angle step when the template is made.
6. The workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration according to claim 1, characterized by further comprising an approximate target deduplication step of screening approximate results in a result queue to finally obtain pose information of a target, the specific steps comprising:
sorting the result queues according to the similarity, putting the first result with the highest similarity in the queue into a filtered queue, then traversing the sorted result queues in sequence, traversing the filtered queue in each traversal, comparing the absolute value of the difference value between the result coordinate position in the result queue and the result coordinate position in the filtered queue, discarding the result if the absolute value is less than a set threshold value, otherwise, putting the result into the filtered queue.
7. A generalized Hough model and improved pyramid search acceleration-based workpiece positioning system, comprising: the online target matching system comprises an offline model building module and an online target matching module, wherein the online target matching module is provided with a target coarse matching unit and a target fine matching unit;
the offline model building module is used for building an offline model, extracting required edge information from a template picture by using a model description method based on generalized Hough transformation, storing the edge information and generating a model required by online matching;
the online target matching module is used for performing online target matching, performing target search according to an improved pyramid acceleration strategy, matching a target image by using the stored information of the model file, reducing a search area through a target area reduction strategy and finally acquiring required target pose information;
the target coarse matching unit is used for carrying out pyramid sampling on a target picture to generate multilayer pyramid picture information, extracting edge information from the top layer pyramid picture by using a Canny operator, and carrying out similarity calculation on the edge information and the edge information in the loaded model file so as to screen out a preselected target position;
the target fine matching unit is used for searching in the next pyramid according to the preselected target position obtained from the upper layer, reducing the search area by adopting a target area reduction strategy, then carrying out similarity calculation, continuing to search in the next layer after obtaining the target position of the current layer, repeating until reaching the bottom layer of the pyramid, and finally putting the obtained target coordinate position into a result queue to obtain a workpiece target positioning matching result.
8. A computer-readable storage medium storing a program, wherein the program when executed by a processor implements the workpiece positioning method based on the generalized Hough model and the improved pyramid search acceleration as claimed in any one of claims 1-6.
9. A computing device comprising a processor and a memory for storing a program executable by the processor, wherein the processor, when executing the program stored in the memory, implements a method for workpiece localization based on a generalized Hough model and improved pyramid search acceleration as claimed in any one of claims 1-6.
CN202210561825.5A 2022-05-23 2022-05-23 Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration Pending CN114926488A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210561825.5A CN114926488A (en) 2022-05-23 2022-05-23 Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210561825.5A CN114926488A (en) 2022-05-23 2022-05-23 Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration

Publications (1)

Publication Number Publication Date
CN114926488A true CN114926488A (en) 2022-08-19

Family

ID=82810202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210561825.5A Pending CN114926488A (en) 2022-05-23 2022-05-23 Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration

Country Status (1)

Country Link
CN (1) CN114926488A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117115487A (en) * 2023-10-23 2023-11-24 睿励科学仪器(上海)有限公司 Template matching method, template matching system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110472674A (en) * 2019-07-31 2019-11-19 苏州中科全象智能科技有限公司 A kind of template matching algorithm based on edge and Gradient Features
CN114331995A (en) * 2021-12-24 2022-04-12 无锡超通智能制造技术研究院有限公司 Multi-template matching real-time positioning method based on improved 2D-ICP

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110472674A (en) * 2019-07-31 2019-11-19 苏州中科全象智能科技有限公司 A kind of template matching algorithm based on edge and Gradient Features
CN114331995A (en) * 2021-12-24 2022-04-12 无锡超通智能制造技术研究院有限公司 Multi-template matching real-time positioning method based on improved 2D-ICP

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RUI WANG 等: "Design of real-time target location algorithmfor industrial scene", 《JOURNAL OF PHYSICS: CONFERENCE SERIES》, 22 January 2022 (2022-01-22), pages 1 - 8 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117115487A (en) * 2023-10-23 2023-11-24 睿励科学仪器(上海)有限公司 Template matching method, template matching system and storage medium
CN117115487B (en) * 2023-10-23 2024-03-08 睿励科学仪器(上海)有限公司 Template matching method, template matching system and storage medium

Similar Documents

Publication Publication Date Title
Pang et al. 3D point cloud object detection with multi-view convolutional neural network
CN107742102B (en) Gesture recognition method based on depth sensor
CN110287873B (en) Non-cooperative target pose measurement method and system based on deep neural network and terminal equipment
CN109033989B (en) Target identification method and device based on three-dimensional point cloud and storage medium
CN113034600B (en) Template matching-based texture-free planar structure industrial part identification and 6D pose estimation method
CN107784288A (en) A kind of iteration positioning formula method for detecting human face based on deep neural network
Lomio et al. Classification of building information model (BIM) structures with deep learning
CN112927353A (en) Three-dimensional scene reconstruction method based on two-dimensional target detection and model alignment, storage medium and terminal
WO2022179002A1 (en) Image matching method and apparatus, electronic device, and storage medium
CN112767456A (en) Three-dimensional laser point cloud rapid relocation method
Guo et al. 3D object recognition from cluttered and occluded scenes with a compact local feature
CN111429344A (en) Laser S L AM closed loop detection method and system based on perceptual hashing
CN114926488A (en) Workpiece positioning method based on generalized Hough model and improved pyramid search acceleration
CN113159103B (en) Image matching method, device, electronic equipment and storage medium
CN111597367B (en) Three-dimensional model retrieval method based on view and hash algorithm
Lee et al. Reinforced adaboost learning for object detection with local pattern representations
CN107609565B (en) Indoor visual positioning method based on image global feature principal component linear regression
KR101733288B1 (en) Object Detecter Generation Method Using Direction Information, Object Detection Method and Apparatus using the same
CN115661218B (en) Virtual super-point-based laser point cloud registration method and system
CN115100136B (en) Workpiece category and pose estimation method based on YOLOv-tiny model
Elashry et al. Feature matching enhancement using the graph neural network (gnn-ransac)
CN114120011B (en) Method for improving image matching precision and speed by using group intelligent algorithm
Chen et al. Workpiece Detection Based on Image Processing and Convolutional Neural Network
CN114266863B (en) 3D scene graph generation method, system, device and readable storage medium based on point cloud
CN108171163B (en) Hand gesture recognition method based on Pareto optimization query

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