CN109544509A - One kind is based on the matched workpiece localization method of secondary template, equipment and storage equipment - Google Patents

One kind is based on the matched workpiece localization method of secondary template, equipment and storage equipment Download PDF

Info

Publication number
CN109544509A
CN109544509A CN201811231405.0A CN201811231405A CN109544509A CN 109544509 A CN109544509 A CN 109544509A CN 201811231405 A CN201811231405 A CN 201811231405A CN 109544509 A CN109544509 A CN 109544509A
Authority
CN
China
Prior art keywords
workpiece
image
template
image block
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811231405.0A
Other languages
Chinese (zh)
Other versions
CN109544509B (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.)
China University of Geosciences
Original Assignee
China University of Geosciences
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 China University of Geosciences filed Critical China University of Geosciences
Priority to CN201811231405.0A priority Critical patent/CN109544509B/en
Publication of CN109544509A publication Critical patent/CN109544509A/en
Application granted granted Critical
Publication of CN109544509B publication Critical patent/CN109544509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • 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/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The present invention provides one kind based on the matched workpiece localization method of secondary template, equipment and storage equipment, its method includes: to utilize the camera acquisition workpiece image demarcated, then image rectification is carried out, and then the characteristic area of workpiece is positioned by template matching twice, and the centroid two-dimensional coordinate of characteristic area is converted to the three-dimensional coordinate of original image by serial of methods, finally by solid geometry method, the three-dimensional coordinate of workpiece centroid to be positioned is calculated, completes positioning.One kind is based on the matched Workpiece positioning apparatus of secondary template and storage equipment, for realizing the matched workpiece localization method of secondary template is based on.The beneficial effects of the present invention are: the method based on template matching twice that the present invention uses improves the speed and accuracy of positioning, suitable for most of workpiece, it can also be divided using multiple template simultaneously to be constantly adjusted and optimize according to the actual situation, it is practical.

Description

One kind is based on the matched workpiece localization method of secondary template, equipment and storage equipment
Technical field
The present invention relates to field of image recognition, more particularly to one kind to be based on the matched workpiece localization method of secondary template, set Standby and storage equipment.
Background technique
Currently, machine vision template matching technique is widely used in the various aspects of industry spot.The mould having had at present Plate matching process is divided into three classes: the matching process based on gray value, the matching process based on geometrical characteristic and be based on gradient direction Template matching method.Wherein the template matching method based on gray value is dependent on good light environment and inadaptable rotation Transformation;Although higher to image quality requirements based on the matching process of geometrical characteristic, matching effect becomes illumination and rotation etc. It is stronger to change robustness;Template matching algorithm based on gradient direction can assign some defects as noise, to cause matching rate not High problem.
Some workpiece are since in outdoor, illumination condition is simultaneously unstable, therefore the template matching method based on gray value is very Difficulty applies in the positioning of such workpiece.Simultaneously because use throughout the year, surface usually has spot to some extent, to make At the limitation of the template matching algorithm application based on gradient direction.Based on both the above situation, the matching based on geometrical characteristic Method can be effectively solved both of these problems, but directly will lead to progress using the template matching method based on geometrical characteristic Calculation amount is excessive when template matching and precision is low.
A kind of chip positioning method based on template matching, Main classification number: G06K9/00 (2006.01) I, classification number: G06K9/00(2006.01)I.A kind of chip positioning method based on template matching of the disclosure of the invention, specifically includes following step Rapid: step 1 makes template;Step 2 pre-processes picture to be positioned, increases the contrast of background and chip basal body; Step 3 carries out image segmentation to pretreated picture, obtains blob block, corresponding using the area and blob block of blob block There are crystal stocks, the chip of defect flaw for the side length information exclusion of minimum circumscribed rectangle;The minimum for obtaining remaining blob block is external The center position coordinates and short side of rectangle and the angle of horizontal direction;Step 4 is sat according to the center that step 3 obtains Mark and angle use template matching chip on picture to be positioned, orient position and the angle of chip.This method is mainly applicable in To the positioning of chip in chip manufacturing proces, qualified chip can be quick and precisely oriented using matched method is first screened again Position excludes the chip with crystal stock, defect flaw.
The positioning of MELF element and detection method based on template matching, Main classification number: G06K9/62 (2006.01) I, classification Number: G06K9/62 (2006.01) I G06T7/00 (2006.01) I.The invention is by establishing with angled template image, obtaining Element image after to diminution, reduced after element image distance transformed image and original component image range conversion Image obtains final best match template image and best match position, extracts key side in the edge image with noise spot Edge point and after forming minimum circumscribed rectangle, amount of bias being set according to minimum circumscribed rectangle the number of internal non-zero pixels process, It obtains position of components correctly and the length and width of element is in range of tolerable variance, terminate positioning and detection process and output element position Confidence breath.
Summary of the invention
To solve the above-mentioned problems, the present invention provides one kind to be based on the matched workpiece localization method of secondary template, equipment And storage equipment, one kind being based on the matched workpiece localization method of secondary template, mainly comprise the steps that
S101: demarcating camera using Zhang Zhengyou calibration method, and completes workpiece to be positioned using calibrated camera Image Acquisition, obtain the first qualified workpiece image to be positioned;
S102: using the method for image self-correcting, image rectification is carried out to the first workpiece image to be positioned, after obtaining correction The second workpiece image to be positioned;
S103: according to preset first template, using template matching algorithm, the workpiece image to be positioned of second after calibration In filter out the first image block corresponding with the first template, obtain the first image block in the second workpiece image to be positioned it is corresponding in Heart position coordinates;First template is all or part of image of workpiece to be positioned;The first image block second to Corresponding region is the target area of workpiece to be positioned on positioning workpiece image;
S104: it according to preset second template, using template matching algorithm, is filtered out in the first image block and the second mould Corresponding second image block of plate, obtains center position coordinates of second image block in the first image block;Second template is A part of first template is the local characteristic region of workpiece image to be positioned;
S105: according to center position coordinates of second image block in the first image block, using linear coordinate conversion method, Center position coordinates of second image block in the second workpiece image to be positioned are calculated;
S106: according to center position coordinates of second image block in the second workpiece image to be positioned, using edge fitting The central coordinate of circle of the fitted arc of the second image block is calculated in algorithm;And the central coordinate of circle of the fitted arc according to the second image block, Using solid matching method, the centroid coordinate of the second image block is calculated;The central coordinate of circle is based under image coordinate system Two-dimensional coordinate, the centroid coordinate be based on the three-dimensional coordinate under world coordinate system;
S107: according to the centroid coordinate of the second image block, the three-dimensional coordinate of workpiece centroid is calculated, it is fixed to complete workpiece Position.
Further, in step S102, method that automatic correcting method is combined using global self-correcting and local self-correcting.
Further, in step S103, template matching algorithm uses the template carving culture algorithm based on geometrical characteristic.
Further, in step S105, using linear coordinate conversion method, it is undetermined second that the second image block is calculated Center position coordinates (s in the workpiece image of positionbui,sbvi) formula such as formula (1) shown in:
Wherein, (sbui,sbvi) it is position of form center coordinate of second image block in the second workpiece image to be positioned, (tbu, tbv) it is centroid coordinate of first image block in the second workpiece image to be positioned, (stui,stvi) it is the second image block in the first figure As the center position coordinates in block, WTAnd HTFor the length and width of the first template, i=1,2 ..., n, n is the number of the second image block.
Further, in step S106, using edge fitting algorithm, the center of circle of the fitted arc of the second image block is calculated The step of coordinate are as follows:
S201: with (sbui,sbvi) it is the center of circle, r is that radius work is justified, and obtains border circular areas;R is preset value;
S202: it is fitted arc operation in border circular areas, obtains the center of circle O of fitted arci, i=1,2 ..., n, n The number of two image blocks;
S203: determining the coefficient value of the elliptic equation where fitted arc, shown in the expression formula of elliptic equation such as formula (2):
Ax2+Bxy+Cy2+ Dx+Ey+F=0 (2)
In formula, A, B, C, D, E, F are the coefficient of the elliptic equation where fitted arc, and calculation method is as follows: will be with (sbui, sbvi) it is the center of circle, r is the circle discretization of radius, appoints and the upper 5 different coordinate points of circle is taken to acquire ellipse using least square method The value of coefficient A, B, C, D, E, F of equation;Wherein, shown in the calculation formula of least square method such as formula (3):
Wherein, (xi,yi) it is with (sbui,sbvi) be the center of circle, r be radius circle on discrete point coordinate, i=1,2 ..., n, N is the number of the second image block;
S204: according to coefficient value A, B, C, D, E, F, the central coordinate of circle (X where fitted arc is calculated0,Y0), it calculates public Shown in formula such as formula (4):
Further, in step S106, according to the central coordinate of circle of the fitted arc of the second image block, using Stereo matching side Method, shown in the formula such as formula (5) that the centroid coordinate P (x, y, z) of the second image block is calculated:
AP=b (5)
In formula,P=[x y z]T,
MlAnd MrIt is known quantity for the projection matrix of left camera and right camera.
Further, in step S107, according to the centroid coordinate of the second image block, the public affairs of workpiece centroid coordinate are calculated Shown in formula such as formula (6):
In above formula,(x, y, z) is work Part centroid coordinate value, (xi, yi, z) be the second image block centroid coordinate, i=1,2 ..., n, n be the second image block number.
A kind of storage equipment, the storage equipment store instruction and data are matched based on secondary template for realizing one kind Workpiece localization method.
One kind being based on the matched Workpiece positioning apparatus of secondary template, comprising: processor and the storage equipment;The processing Device loads and executes the instruction in the storage equipment and data for realizing one kind based on the matched workpiece positioning of secondary template Method.
The method that technical solution provided by the invention has the benefit that the template matching twice that the present invention uses mentions The high speed and accuracy of positioning, is suitable for most of workpiece, while can also be using the segmentation of multiple template come according to reality Situation is constantly adjusted and optimizes, practical.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is a kind of flow chart based on the matched workpiece localization method of secondary template in the embodiment of the present invention;
Fig. 2 is the schematic diagram of fitting panel template in the embodiment of the present invention;
Fig. 3 is the schematic diagram of each coordinate position when linear coordinate is converted in the embodiment of the present invention;
Fig. 4 is the schematic diagram that hardware device works in the embodiment of the present invention.
Specific embodiment
For a clearer understanding of the technical characteristics, objects and effects of the present invention, now control attached drawing is described in detail A specific embodiment of the invention.
The embodiment provides one kind to be set based on the matched workpiece localization method of secondary template, equipment and storage It is standby.
Referring to FIG. 1, Fig. 1 is a kind of process based on the matched workpiece localization method of secondary template in the embodiment of the present invention Figure, specifically comprises the following steps:
S101: demarcating camera using Zhang Zhengyou calibration method, and completes workpiece to be positioned using calibrated camera Image Acquisition, obtain the first qualified workpiece image to be positioned;The camera includes left camera and right camera;Described One workpiece image to be positioned include the acquisition of left camera the first workpiece left image to be positioned and the acquisition of right camera first to Position workpiece right image;
S102: using the method for image self-correcting, image rectification is carried out to the first qualified workpiece image to be positioned, is obtained The second workpiece image to be positioned after correction;Second workpiece image to be positioned includes the second workpiece left image to be positioned and the Two workpiece right images to be positioned;
S103: according to preset first template, using template matching algorithm, the workpiece image to be positioned of second after calibration In filter out the first image block corresponding with the first template, obtain the first image block in the second workpiece image to be positioned it is corresponding in Heart position coordinates;First template is all or part of image of workpiece to be positioned;The first image block second to Corresponding region is the target area of workpiece to be positioned on positioning workpiece image;
S104: it according to preset second template, using template matching algorithm, is filtered out in the first image block and the second mould Corresponding second image block of plate, obtains position coordinates of second image block in the first image block;Second template is first A part of template is the local characteristic region of workpiece image to be positioned;
S105: according to position coordinates of second image block in the first image block, the method converted using linear coordinate, meter Calculation obtains position coordinates of second image block in the second workpiece image to be positioned;
S106: according to position coordinates of second image block in the second workpiece image to be positioned, using edge fitting algorithm, The central coordinate of circle of the fitted arc of the second image block is calculated;And the central coordinate of circle of the fitted arc according to the second image block, it uses The centroid coordinate of the second image block is calculated in solid matching method;The central coordinate of circle is based on two under image coordinate system Coordinate is tieed up, the centroid coordinate is based on the three-dimensional coordinate under world coordinate system;
S107: according to the centroid coordinate of the second image block, being calculated workpiece centroid coordinate, completes workpiece positioning.
In step S102, method that automatic correcting method is combined using global self-correcting and local self-correcting.
In step S103, template matching algorithm uses the template carving culture algorithm based on geometrical characteristic.
In step S105, using linear coordinate conversion method, the second image block is calculated in the second workpiece figure to be positioned Position coordinates (s as inbui,sbvi) formula such as formula (1) shown in:
Wherein, (sbui,sbvi) it is position of form center coordinate of second image block in the second workpiece image to be positioned, (tbu, tbv) it is centroid coordinate of first image block in the second workpiece image to be positioned, (stui,stvi) it is the second image block in the first figure As the center position coordinates in block, WTAnd HTFor the length and width of the first template, i=1,2 ..., n, n is the number of the second image block.
In step S106, using edge fitting algorithm, the step of the central coordinate of circle of the fitted arc of the second image block is calculated Suddenly are as follows:
S201: with (sbui,sbvi) it is the center of circle, r is that radius work is justified, and obtains border circular areas;R is preset value;
S202: it is fitted arc operation in border circular areas, obtains the center of circle O of fitted arci, i=1,2 ..., n, n The number of two image blocks;
S203: determining the coefficient value of the elliptic equation where fitted arc, shown in the expression formula of elliptic equation such as formula (2):
Ax2+Bxy+Cy2+ Dx+Ey+F=0 (2)
In formula, A, B, C, D, E, F are the coefficient of the elliptic equation where fitted arc, and calculation method is as follows: will be with (sbui, sbvi) it is the center of circle, r is the circle discretization of radius, appoints and the upper 5 different coordinate points of circle is taken to acquire ellipse using least square method The value of coefficient A, B, C, D, E, F of equation;Wherein, shown in the calculation formula of least square method such as formula (3):
Wherein, (xi, yi) and it is with (sbui,sbvi) be the center of circle, r be radius circle on discrete point coordinate, i=1,2 ..., N, n are the number of the second image block;
S204: according to coefficient value A, B, C, D, E, F, the central coordinate of circle (X where fitted arc is calculated0,Y0), it calculates public Shown in formula such as formula (4):
In step S106, it is calculated according to the central coordinate of circle of the fitted arc of the second image block using solid matching method Shown in the formula such as formula (5) of the centroid coordinate P (x, y, z) of second image block:
AP=b (5)
In formula,P=[x y z]T,
MlAnd MrIt is known quantity for the projection matrix of left camera and right camera.
In step S107, according to the centroid coordinate of the second image block, the formula such as formula of workpiece centroid coordinate is calculated (6) shown in:
In above formula,(x, y, z) is work Part centroid coordinate value, (xi, yi, z) be the second image block centroid coordinate, i=1,2 ..., n, n be the second image block number.
It, will be using technical solution of the present invention to transformer substation pipe bus for more specific description technical solution of the present invention Fitting panel is positioned, to illustrate the feasibility of the technical program:
According to above method step, the calibration of camera is completed first.Camera calibration is primarily to obtain the internal reference of camera Number, including camera focus f, distortion factor k, pixel dimension dx、dy, image principal point cx、cy.And binocular camera (take the photograph including a left side by camera As head and right camera) calibration, other than needing to find out the internal reference of two cameras in left and right, it is also necessary to find out the camera shooting of left and right two Relative pose relationship between head, including spin matrix R and translation vector T.In calibration, picture is demarcated in acquisition first.For More accurately nominal data is obtained, acquisition picture number is 15~20, while the scaling board for collecting picture will cover substantially Cover all binoculars field of view.It is complete to demarcate picture collection, using Zhang Zhengyou calibration method, completes camera calibration, solves camera internal reference Relative pose relationship between several and two cameras.
After completing camera calibration, workpiece image B is acquired, and self-correcting is carried out to image, picture quality is improved, convenient for subsequent Template matching.To improve template matching accuracy rate and efficiency, the template carving culture algorithm based on geometrical characteristic is used herein, it is complete The identification of pairs of bus fitting panel.Specific step is as follows:
(1) fitting panel template is created, as shown in Fig. 2, and prestoring into program.Here fitting panel template is this The first template in inventive technique scheme.
(2) the template carving culture of geometrical characteristic.Fitting panel template and logging template center are searched for from entire image Coordinate of the point in entire imageBT(tbu,tbv)。
Then using the screw hole on fitting panel as local feature, creating screw hole template, (screw hole template is skill of the present invention Second template described in art scheme).Screw hole template, note are searched for from the bus fitting panel template image searched for the first time Record center position coordinate of the screw hole template in bus fitting panel template imageTS1(stu1,stv1)、TS2(stu2,stv2)、TS3 (stu3,stv3)、TS4(stu4,stv4)。
It is converted by linear coordinate and screw hole template center position coordinates under fitting panel template image is converted into whole picture figure The coordinate of pictureBS1(sbu1,sbv1)、BS2(sbu2,sbv2)、BS3(sbu3,sbv3)、BS4(sbu4,sbv4).The step of linear coordinate is converted is such as Under:
Original image size is WB*HB, fitting panel template size is WT*HT, the spiral shell that is matched in fitting panel template image Hole template centre coordinate is respectivelyTS1(stu1,stv1)、TS2(stu2,stv2)、TS3(stu3,stv3)、TS4(stu4,stv4), then pass through line Property coordinate conversion, by screw hole template center coordinate in fitting panel template image, be converted to the screw hole template center in original image CoordinateBS1(sbu1,sbv1)、BS2(sbu2,sbv2)、BS3(sbu3,sbv3)、BS4(sbu4,sbv4), as shown in Figure 3.
Solution is obtainedBS1,BS2 BS3,BS4, respectively using this four points as the center of circle, specified radius r draws circle, obtains 4 Border circular areas.Arc, the center of circle O of available arc are fitted in border circular areas1,O2,O3,O4.The process of fitted arc is as follows:
Elliptical equation can be expressed as formula (7):
Ax2+Bxy+Cy2+ Dx+Ey+F=0 (7)
According to above formula, it is only necessary to which 5 points on contour edge can determine elliptic parameter.For whole boundary curve Speech, can be used least square method and is sought.Directly the above-mentioned equation of application carries out minimum two to the discrete point after edge detection Multiply processing, so that it may obtain each coefficient in equation, calculation formula such as formula (8):
Again by extremum principle, the value of f (A, B, C, D, E) to be made is minimum, obtains formula (9):
It can thus be concluded that a system of linear equations, then using solve system of linear equations method can in the hope of coefficient A, B, C, the value of D, E, F.
Elliptical center coordinate (X can be solved according to the value of A, B, C, D, E, F0,Y0), such as formula (10):
Since left images can obtain the center of circle of 4 fittings respectively, 4 centers of circle of left images are used into Stereo matching side After method is matched, the three-dimensional coordinate in 4 centers of circle can be found out using least square method.
The extraction step of three-dimensional coordinate is as follows:
Assuming that bus fitting surface center of circular hole is point P (x, y, z), in two imager coordinate imaged on head plane difference It is Pl(ul,vl) and Pr(ur,vr), according to pin-hole imaging model, there are formula (11):
Wherein Ml、MrThe respectively projection matrix of two cameras in left and right.Z is eliminated respectively to above formulal、zrIt obtains formula (12):
AP=b (12)
In above formula:P=[x y z]T According to least square method, the three-dimensional coordinate of the P point under world coordinate system is acquired, such as formula (13):
P=(ATA)-1ATb (13)
In above formula, matrix A, b be it is known, bring the M that solves of calibration into respectivelyl,MrAnd left images correspondence fits The screw hole centroid pixel coordinate come, can solve the three-dimensional coordinate R of 4 screw holes1,R2,R3,R4.It is sat according to 4 screw hole three-dimensionals Mark, finds out fitting panel centroid coordinate.Method for solving is as follows:
If R1(x1,y1,z),R2(x2,y2,z),R3(x3,y3,z),R4(x4,y4, z) and it is 4 screw hole three-dimensional coordinates, then there are public affairs Formula (14):
Fitting panel centroid coordinate is O (x, y, z), wherein each coordinate value calculation formula such as formula (15):
Thus it solves and obtains accurate fitting panel centroid three-dimensional coordinate O (x, y, z), complete workpiece positioning.
Fig. 4 is referred to, Fig. 4 is the hardware device operation schematic diagram of the embodiment of the present invention, and the hardware device specifically includes: One kind is based on the matched Workpiece positioning apparatus 401 of secondary template, processor 402 and storage equipment 403.
One kind being based on the matched Workpiece positioning apparatus 401 of secondary template: described a kind of based on the matched workpiece of secondary template Positioning device 401 is realized described a kind of based on the matched workpiece localization method of secondary template.
Processor 402: the processor 402 loads and executes the instruction in the storage equipment 403 and data for real It is existing described a kind of based on the matched workpiece localization method of secondary template.
Store equipment 403: 403 store instruction of storage equipment and data;The storage equipment 403 is for realizing described One kind being based on the matched workpiece localization method of secondary template.
The beneficial effects of the present invention are: the method for the template matching twice that the present invention uses improves the speed and essence of positioning Exactness is suitable for most of workpiece, while can also be divided using multiple template to be constantly adjusted according to the actual situation It is practical with optimization.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (9)

1. one kind is based on the matched workpiece localization method of secondary template, it is characterised in that: the following steps are included:
S101: camera is demarcated using Zhang Zhengyou calibration method, and completes the figure of workpiece to be positioned using calibrated camera As acquisition, the first qualified workpiece image to be positioned is obtained;
S102: using the method for image self-correcting, carrying out image rectification to the first workpiece image to be positioned, and the after being corrected Two workpiece images to be positioned;
S103: it according to preset first template, using template matching algorithm, is sieved in the workpiece image to be positioned of second after calibration The first image block corresponding with the first template is selected, the corresponding centre bit of the first image block in the second workpiece image to be positioned is obtained Set coordinate;First template is all or part of image of workpiece to be positioned;The first image block is to be positioned second Corresponding region is the target area of workpiece to be positioned on workpiece image;
S104: it according to preset second template, using template matching algorithm, is filtered out in the first image block and the second template pair The second image block answered obtains center position coordinates of second image block in the first image block;Second template is first A part of template is the local characteristic region of workpiece image to be positioned;
S105: it is calculated according to center position coordinates of second image block in the first image block using linear coordinate conversion method Obtain center position coordinates of second image block in the second workpiece image to be positioned;
S106: according to center position coordinates of second image block in the second workpiece image to be positioned, using edge fitting algorithm, The central coordinate of circle of the fitted arc of the second image block is calculated;And the central coordinate of circle of the fitted arc according to the second image block, it uses The centroid coordinate of the second image block is calculated in solid matching method;The central coordinate of circle is based on two under image coordinate system Coordinate is tieed up, the centroid coordinate is based on the three-dimensional coordinate under world coordinate system;
S107: according to the centroid coordinate of the second image block, being calculated the three-dimensional coordinate of workpiece centroid, completes workpiece positioning.
2. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S102 In, method that automatic correcting method is combined using global self-correcting and local self-correcting.
3. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S103 In, template matching algorithm uses the template carving culture algorithm based on geometrical characteristic.
4. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S105 In, using linear coordinate conversion method, center of second image block in the second workpiece image to be positioned is calculated and sits Mark (sbui,sbvi) formula such as formula (1) shown in:
Wherein, (sbui,sbvi) it is position of form center coordinate of second image block in the second workpiece image to be positioned, (tbu,tbv) be Centroid coordinate of first image block in the second workpiece image to be positioned, (stui,stvi) it is the second image block in the first image block In center position coordinates, WTAnd HTFor the length and width of the first template, i=1,2 ..., n, n is the number of the second image block.
5. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S106 In, using edge fitting algorithm, the step of central coordinate of circle of the fitted arc of the second image block is calculated are as follows:
S201: with (sbui,sbvi) it is the center of circle, r is that radius work is justified, and obtains border circular areas;R is preset value;
S202: it is fitted arc operation in border circular areas, obtains the center of circle O of fitted arci, i=1,2 ..., n, n is the second image The number of block;
S203: determining the coefficient value of the elliptic equation where fitted arc, shown in the expression formula of elliptic equation such as formula (2):
Ax2+Bxy+Cy2+ Dx+Ey+F=0 (2)
In formula, A, B, C, D, E, F are the coefficient of the elliptic equation where fitted arc, and calculation method is as follows: will be with (sbui,sbvi) be The center of circle, r are the circle discretization of radius, appoint and the upper 5 different coordinate points of circle is taken to acquire elliptic equation using least square method The value of coefficient A, B, C, D, E, F;Wherein, shown in the calculation formula of least square method such as formula (3):
Wherein, (xi,yi) it is with (sbui,sbvi) it is the center of circle, r is the discrete point coordinate on the circle of radius, and i=1,2 ..., n, n is The number of second image block;
S204: according to coefficient value A, B, C, D, E, F, the central coordinate of circle (X where fitted arc is calculated0,Y0), calculation formula is such as Shown in formula (4):
6. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S106 In, the centroid of the second image block is calculated using solid matching method according to the central coordinate of circle of the fitted arc of the second image block Shown in the formula such as formula (5) of coordinate P (x, y, z):
AP=b (5)
In formula,P=[x y z]T,
MlAnd MrIt is known quantity for the projection matrix of left camera and right camera.
7. as described in claim 1 a kind of based on the matched workpiece localization method of secondary template, it is characterised in that: step S107 In, according to the centroid coordinate of the second image block, shown in the formula such as formula (6) that workpiece centroid coordinate is calculated:
In above formula,(x, y, z) is workpiece shape Heart coordinate value, (xi, yi, z) be the second image block centroid coordinate, i=1,2 ..., n, n be the second image block number.
8. a kind of storage equipment, it is characterised in that: the storage equipment store instruction and data are for realizing claim 1~7 Any one described is based on the matched workpiece localization method of secondary template.
9. one kind is based on the matched Workpiece positioning apparatus of secondary template, it is characterised in that: include: that processor and the storage are set It is standby;The processor loads and executes the instruction in the storage equipment and data for realizing appointing described in claim 1~7 It anticipates a kind of based on the matched workpiece localization method of secondary template.
CN201811231405.0A 2018-10-22 2018-10-22 Workpiece positioning method and device based on secondary template matching and storage device Active CN109544509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811231405.0A CN109544509B (en) 2018-10-22 2018-10-22 Workpiece positioning method and device based on secondary template matching and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811231405.0A CN109544509B (en) 2018-10-22 2018-10-22 Workpiece positioning method and device based on secondary template matching and storage device

Publications (2)

Publication Number Publication Date
CN109544509A true CN109544509A (en) 2019-03-29
CN109544509B CN109544509B (en) 2020-07-07

Family

ID=65844213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811231405.0A Active CN109544509B (en) 2018-10-22 2018-10-22 Workpiece positioning method and device based on secondary template matching and storage device

Country Status (1)

Country Link
CN (1) CN109544509B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112734863A (en) * 2021-03-31 2021-04-30 武汉理工大学 Crossed binocular camera calibration method based on automatic positioning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101101484A (en) * 2007-08-01 2008-01-09 暨南大学 Two-dimensional positioning device based on machine vision
CN102721364A (en) * 2011-03-30 2012-10-10 比亚迪股份有限公司 Positioning method and positioning device for workpiece
CN104457577A (en) * 2014-12-19 2015-03-25 上海工业自动化仪表研究院 Machine-vision-oriented non-contact type workpiece positioning and measuring method
US20160370172A1 (en) * 2013-12-06 2016-12-22 Werth Messtechnik Gmbh Device and method for measuring workpieces
WO2018120290A1 (en) * 2016-12-26 2018-07-05 华为技术有限公司 Prediction method and device based on template matching

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101101484A (en) * 2007-08-01 2008-01-09 暨南大学 Two-dimensional positioning device based on machine vision
CN102721364A (en) * 2011-03-30 2012-10-10 比亚迪股份有限公司 Positioning method and positioning device for workpiece
US20160370172A1 (en) * 2013-12-06 2016-12-22 Werth Messtechnik Gmbh Device and method for measuring workpieces
CN104457577A (en) * 2014-12-19 2015-03-25 上海工业自动化仪表研究院 Machine-vision-oriented non-contact type workpiece positioning and measuring method
WO2018120290A1 (en) * 2016-12-26 2018-07-05 华为技术有限公司 Prediction method and device based on template matching

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112734863A (en) * 2021-03-31 2021-04-30 武汉理工大学 Crossed binocular camera calibration method based on automatic positioning
CN112734863B (en) * 2021-03-31 2021-07-02 武汉理工大学 Crossed binocular camera calibration method based on automatic positioning

Also Published As

Publication number Publication date
CN109544509B (en) 2020-07-07

Similar Documents

Publication Publication Date Title
WO2017092631A1 (en) Image distortion correction method for fisheye image, and calibration method for fisheye camera
EP2236980B1 (en) A method for determining the relative position of a first and a second imaging device and devices therefore
US6768509B1 (en) Method and apparatus for determining points of interest on an image of a camera calibration object
CN107270810B (en) The projector calibrating method and device of multi-faceted projection
CN107767456A (en) A kind of object dimensional method for reconstructing based on RGB D cameras
CN106611416B (en) Method and device for segmenting lung in medical image
CN106952262B (en) Ship plate machining precision analysis method based on stereoscopic vision
CN104748683A (en) Device and method for online and automatic measuring numerical control machine tool workpieces
CN115830103A (en) Monocular color-based transparent object positioning method and device and storage medium
CN108269289A (en) A kind of two step optimization methods of camera parameter calibration
CN112734863A (en) Crossed binocular camera calibration method based on automatic positioning
WO2022040983A1 (en) Real-time registration method based on projection marking of cad model and machine vision
CN114170284B (en) Multi-view point cloud registration method based on active landmark point projection assistance
KR20170080116A (en) Face Recognition System using Depth Information
CN114463442A (en) Calibration method of non-coaxial camera
CN108805940B (en) Method for tracking and positioning zoom camera in zooming process
CN105991913A (en) Method for location of feature object based on machine vision
CN107850425A (en) Method for measuring artifact
CN108694713A (en) A kind of the ring segment identification of satellite-rocket docking ring part and measurement method based on stereoscopic vision
CN111583342A (en) Target rapid positioning method and device based on binocular vision
CN109544509A (en) One kind is based on the matched workpiece localization method of secondary template, equipment and storage equipment
CN110458951B (en) Modeling data acquisition method and related device for power grid pole tower
CN117611525A (en) Visual detection method and system for abrasion of pantograph slide plate
CN116596987A (en) Workpiece three-dimensional size high-precision measurement method based on binocular vision
KR101923581B1 (en) Normal vector extraction apparatus and method thereof based on stereo vision for hull underwater inspection using underwater robot

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