A kind of mirror article measurement mechanism and method based on binocular vision
Technical field
The present invention relates to a kind of profile three-dimensional reconstruction, relate in particular to a kind of mirror article surface three-dimensional contour outline measuring set and measuring method of utilizing binocular camera.
Background technology
Along with the increase of measurement demand and the development of photoelectric technology, the noncontact measurement based on vision is developed rapidly.The 3D shape vision measurement of object has a wide range of applications at numerous areas such as reverse-engineering, robot vision, quality testing, digital medical, historical relic's protection, film advertisement and clothes manufactures.Mirror article surface measuring three-dimensional profile technology has important using value.In engineering, exist a large amount of specular surfaces to need to measure.For example, in fields such as machine-building, historical relic's protection and quality controls, the accurate measurement demand of the high reflecting surfaces of minute surface such as optical element surface, spraying vehicle body, polishing mould, liquid surface, historical relic pottery is increasingly powerful.Measurement for these mirror article surfaces is very difficult or helpless.For the measurement of mirror article surface, current two kinds of methods of industrial main employing.Be to adopt the contact type measurement equipment such as three coordinate measuring machine or three-dimensional measurement arm, efficiency is very low, and easily specular surface is produced to destructive influences; Its two, be also that a kind of habitual way is that object is carried out to spray treatment, make its surface present diffuse reflection optics characteristic, the structured light technique that recycles existing maturation carries out surface scan.But dusty spray not only can pollutant surface, also can affect three-dimensional measurement precision, obviously the method has seriously undermined the noncontact advantage of optical means.Other non-contact measurement method comprises passive type and active two classes.Wherein passive type method comprises " measuring technique based on photometry " and " from mirror-reflection composition, recovering face type technology ", and the data handling procedure of these technology is complicated, and precision is lower.Initiatively measure so long as adopt structural light measurement technology.Wherein, dot structure light technology generally adopts LASER Light Source, accurately controls the direction of emergent ray by galvanometer sweep unit, and target object is carried out to point by point scanning, measures its gradient, measures efficiency very low.Adopt light belt scanning technique partly to improve the efficiency of measuring.Area-structure light technology, can be divided into again pattern code and phase encoding two class methods according to the difference of the coded system of area-structure light, and the latter is commonly referred to as striped projective technique.This technology adopts diffuser structure light source, and the structured light that is Sine distribution by intensity projects body surface, calculates the gradient of measured surface by fringe phase.This method can directly obtain whole audience information, and without scanister, efficiency is very high.Above-mentioned three kinds of structured light techniques are all that the gradient that can only record tested surface distributes, and must just can obtain tested surface to elevation information by numerical integrating, calculate comparatively complexity, have larger cumulative errors.Minute surface is measured more difficult reason and is mainly contained two aspects: the detection that is first mirror-reflection composition.Do you how to judge that a characteristics of image correspondence real scene point or the mirror-reflection of another scene point? this ambiguity has proposed a severe problem to the vision technique based on feature detection and coupling.Secondly, during mirror-reflection, the reflection direction of light beam depends on incident direction and body surface normal direction, makes image capturing system be difficult to capture reflection ray, even if capture reflection ray, the face graphic data of tested mirror article also depends critically upon the normal direction information of object plane.As for the measurement of the transparent body, owing to being subject to the double influence of mirror-reflection and internal refraction, particularly difficulty becomes.
Summary of the invention
Object of the present invention, is to provide a kind of general, non-contacting mirror article surface three-dimensional contour outline measuring set and measuring method, can realize non-cpntact measurement, and measuring efficiency and measuring accuracy has largely and improve.
For achieving the above object, the present invention adopts following technical proposals: a kind of mirror article measurement mechanism based on binocular vision, and computing machine is connected with liquid crystal display, camera; Liquid crystal display is placed in tested mirror article top;
Liquid crystal display generates sine streak pattern for the control signal of receiving computer, and these candy strips is incident upon on the surface of testee;
Computing machine is for converting the stripe pattern on the testee surface of collected by camera to the surface profile of object being measured.
The liquid crystal display level of described liquid crystal display is placed downwards.
Described camera is two industrial cameras, is arranged on a side of liquid crystal display and symmetrical with respect to testee.
A mirror article measuring method based on binocular vision, comprises the following steps:
Demarcate binocular camera, obtain the internal reference matrix of binocular camera and the rotation translation matrix between camera, and the relative position relation of definite liquid crystal display and binocular camera;
Computing machine generates sine streak, control liquid crystal display to tested mirror article projection sine streak image, and computing machine is inputted in the virtual image that the sine streak image that camera was photographed becomes on testee surface;
Computing machine is according to demarcating resulting relative position relation and camera internal reference matrix, to collected by camera to virtual image image information process, obtain the three-D profile on testee surface.
The relative position relation of described definite liquid crystal display and binocular camera comprises the following steps:
In the pickup area of binocular camera, place a level crossing of pasting circular index point, internal reference matrix and rotation translation matrix by binocular camera obtain the three-dimensional coordinate of monumented point on level crossing, and fit to level crossing space plane equation;
Computer controlled display projects circular monumented point to level crossing, and the internal reference matrix by binocular camera and rotation translation matrix obtain the three-dimensional coordinate of display virtual image monumented point in level crossing, and fit to space plane equation;
According to the virtual image plane space plane equation of monumented point on display, determine the relative position relation of display projection plane and binocular camera.
Described the virtual image image information collecting processed and comprised the following steps:
(1) according to the internal reference matrix computations P of camera A
1the three-dimensional coordinate of point, by determining light P
1c
1space equation obtains the s point coordinate of a hypothesis; P
1, P
2be respectively the pixel incident point Q of display
1, Q
2project the lip-deep s point of testee and through s point reflection to the point in camera A phase plane, camera B phase plane, C
1, C
2central point for camera A, camera B;
(2) according to the s point coordinate of hypothesis, computing method vector
(3) horizontal phase of ordering according to s is searched some projection in camera B as s point of par phase place and vertical phase place in the phase plane of camera B with vertical phase value, determine pixel P
2point.
(4) according to pixel P
2point is determined Q
2point definite light Q
2s and P
2c
2, by these two light, obtain new normal vector
(5) newer normal vector n ' and initial normal vector n, when difference is greater than threshold value, reset s point coordinate, repeating step (2)~(5); Otherwise s point coordinate is the locus of tested point;
(6) repeating step (1)~(5), obtain all pixels of display and project the tested point on testee.
The present invention has following beneficial effect and advantage:
1. whole measuring system of the present invention is mainly comprised of LCD liquid crystal display, two industrial cameras, computing machines, and system architecture is simple.Can realize non-cpntact measurement, all kinds of contact measuring heads without in conventional measurement techniques, have reduced measurement cost, have improved measurement efficiency.
2. the present invention adopts horizontal and vertical fringe projection technology to replace the fixed light source in original technology, can obtain many group object plane PHASE DISTRIBUTION.
The present invention according to same place equiphase principle can determine on display on point and testee, put and camera as the corresponding relation of Plane-point.
4. the present invention can directly obtain outgoing and incident ray equation according to binocular vision technology.By searching algorithm, can directly calculate the volume coordinate of mirror article surface point, avoid the numerical integration process that exists in original method, also avoid cumulative errors, measuring accuracy is high simultaneously.
5. the present invention can regulate the distance of testee support face and display face according to the big or small surface configuration of measuring object, and measurement range and range of application are expanded, and it is more convenient to use.
Accompanying drawing explanation
Fig. 1 is measurement mechanism structural representation of the present invention;
Fig. 2 is measuring method schematic diagram of the present invention;
Wherein, (a) be binocular camera light path graph of a relation; (b) be monocular camera light path graph of a relation;
Fig. 3 is measuring method principle schematic of the present invention;
Fig. 4 is the projection bar graph of tested mirror article in embodiment;
Fig. 5 is the phase diagram of tested mirror article in embodiment;
Wherein, (a) for blocking phase diagram, (b) be external phase bitmap;
Fig. 6 is the three-dimensional point set figure obtaining according to measurement result in embodiment;
Wherein: 1 is LCD liquid crystal display, 2 is monitor signal line, and 3 is computing machine, and 4 is camera connecting line, and 5 is industrial camera A, and 6 is industrial camera B, and 7 is testee surface incident and reflection ray, and 8 is testee.
Embodiment
Details are as follows by reference to the accompanying drawings for a preferred embodiment of the present invention:
As shown in Figure 1, a kind of mirror article measurement mechanism based on binocular vision, is comprised of a LCD liquid crystal display 1, two industrial cameras, a computing machine 3; Described LCD liquid crystal display 1 is arranged on the framework of measurement mechanism of the present invention by level, and be placed in 200mm place, measured lens face object top, by cable, be connected with computing machine 3, controlled by computing machine 3 and generate sine streak pattern, these candy strips are incident upon on the surface of measured object 8; Described industrial camera adopts 8mm tight shot, according to the angle with horizontal direction angle 65 degree, be arranged on a side of LCD liquid crystal display, and with respect to testee 8 symmetries, make its distance of camera lens testee surface 300mm distance, and guarantee that the common visual field of binocular camera can contain whole measured zone.By video line, the stripe pattern collecting is passed to computing machine 3, computing machine 3 is processed stripe pattern, converts the surface profile of object being measured to.
A mirror article measuring method based on binocular vision, implements by the above-mentioned mirror article measurement mechanism based on binocular vision, and operation steps is as follows:
The first step, measurement mechanism system calibrating:
Adjust measurement mechanism, demarcate the inner parameter of binocular camera and calculate two rotation translation matrix between camera.Pickup area at binocular camera is placed a standard flat mirror, on level crossing, paste circular index point, first utilize the binocular camera (rotation translation matrix and internal reference matrix) of having demarcated to ask for the three-dimensional coordinate of putting on level crossing, and adopt least square fitting to obtain level crossing space plane equation; The flat mirror reflects region projection circular index point that utilizes computer controlled display can observe at binocular camera, utilize binocular camera (rotation translation matrix and internal reference matrix) to rebuild the three-dimensional coordinate of display virtual image point in level crossing, and adopt least square fitting to obtain space plane equation; According to the virtual image plane of putting on display and display plane, be about the principle of level crossing plane symmetry, to determine the relative position relation of display projection plane and binocular camera;
Second step, data acquisition:
(can setting cycle be 80 pixels, initial phase be in computing machine, to set the initial phase of sine streak and cycle
), adopt four-step phase-shifting method projection sine streak, first project vertical sine streak image and then project horizontal sine streak image; Sine streak image of every projection gathers with binocular camera the virtual image that sine streak image is become by measured surface reflection, and inputs computing machine;
The 3rd step, data processing:
According to the relative position relation of display, binocular camera in the geometric properties of light path reflection and measuring system, the phase image of binocular camera collection is processed, calculated the three-D profile on measured surface.
In the above-mentioned mirror article measuring method based on binocular vision, data processing method described in the 3rd step is: 1. LCD display is projected to mirror article surface and the stripe pattern that collected by binocular camera is processed, calculate stripe pattern block phase place and continuous phase distributes; 2. the equations of light ray of the reflection ray of determining measured surface according to left view camera (being camera A) parameter under left view camera coordinates system, and the initial value of measured surface point three-dimensional coordinate is set; 3. according to left view and LCD display phase relation, calculate the corresponding point of left view pixel in LCD display, determine incident ray equation; 4. according to the normal vector of the emergent ray of left view and incident ray calculating incident ray and emergent ray; 5. according to the phase relation of right view and LCD display, determine the corresponding point on display at right view mid point, determine the incident light equations of light ray of right view, and calculate the normal vector of incident ray and emergent ray; 6. according to normal vector principle of identity, search for optimal match point as the locus of tested point.
Principle of work of the present invention is as follows:
The measuring principle of this mirror article surface method for three-dimensional measurement as shown in Figure 2.In mirror-reflection, incident light, reflected light and minute surface normal direction are always coplanar, and the angle of incident light and minute surface normal direction always equals the angle of reflected light and minute surface normal direction.
In the left and right camera system as shown in Fig. 2 (a), x1 is left camera pixel point, the right camera pixel point of x2, X1 is for putting the light of pixel x1 from body surface, X2 is for putting the light of pixel x2 from body surface, Y1 and Y2 are that on display, point projects the light on testee, and Y1 arrives x1 point through testee reflection along X1 light, and Y2 arrives x2 point through testee reflection along X2 light.
Because the light reflecting from common point is from different directions, but their corresponding surface normals are the same.Once known light path parameter, just can estimate the profile of minute surface.For light path is positioned, adopt a LCD display herein, and on LCD, show two-dimentional phase shift.By the phase of horizontal direction and vertical direction, identify each pixel on display.By above-mentioned measurement mechanism system calibrating method, calibrate the geometric relationship of camera and display.By calibration result, just can determine the 3D location parameter of each picture point institute's corresponding light source on display.Light Y1 from display intersects at a point on testee surface with the light X1 from camera, and determines a plane.If the depth information of known this intersection point, just can unique surface normal of determining this point.That is to say, surface normal is the function of the degree of depth, and as shown in Fig. 2 (b), wherein N is the normal direction at body surface incidence point place.Because a surface point only has a surface normal, therefore, by searching for two common surface normal direction and degree of depth between view, just can realize surface point reconstruct.
The measuring process of the mirror article measuring method based on binocular vision comprises:
The first step, calibration measurements device: demarcate binocular camera, determine the internal reference matrix of binocular camera and the rotation translation matrix between camera, and the relative position relation of definite LCD liquid crystal display and binocular camera.
Second step, measurement image data acquisition: 1. computing machine generates vertical sine streak image, control LCD display and project vertical sine streak, adopt four-step phase-shifting technology, phase shifted images of every projection, computer control binocular industrial camera carries out image acquisition one time, the virtual image input computing machine that the sine streak image that camera was photographed becomes on testee surface; 2. utilize computing machine to generate horizontal sine streak image, and control display and project.Computer control binocular camera carries out image acquisition, the travers virtual image input computing machine that body surface is formed.
The 3rd step, the data processing of carrying out: according to measuring system, demarcate resulting relative position relation and camera parameter information, the image information collecting is processed, by computing machine, calculated the three-D profile on testee surface.
First, utilize following formula to collected by camera to stripe pattern data carry out phase unwrapping and wrap up in operation, obtain the absolute phase distribution plan of travers and vertical striped;
Wherein: Φ
abs(x, y) represents that the phase place after expansion is continuous phase; φ
w(x, y) represents to block phase place; Φ
0represent to put adjacent expansion phase place with (x, y); Round[x] represent to approach most the integer of x; I
n(x, y) is that n width image (x, y) is located pixel value, δ
nit is n width image phase-shift value.
As shown in Figure 3, take camera 1(camera1) be that camera A is main camera, camera 2(camera2) be that camera B is reference, s point is the point on testee, Q
1and Q
2be the pixel incident point on display, light is from Q
1point is transmitted into s point, the P through s point reflection to camera1 phase plane
1point, light is from Q
2point is transmitted into s point, the P through s point reflection to camera2 phase plane
2point, the image center point of establishing camera1 is C
1, the image center point of establishing camera2 is C
2, calculation procedure is as follows:
1. according to the internal reference matrix computations P of camera 1
1the three-dimensional coordinate of point, determines light P
1c
1space equation, pixel P on known camera 1
1that point is taken is Q
1point is by s point imaging, and the s point that reflection occurs so must be at light P
1c
1upper, therefore suppose s point three-dimensional coordinate (x, y, z) in the numerical value of any one dimension just can obtain the s point coordinate of a hypothesis, the initial coordinate values of ordering according to the distance setting s between measured object and camera A.
2. according to the s point coordinate of hypothesis, the phase relation between the phase diagram being collected by camera 1 and display standard phase diagram can be determined Q
1point position, determines light Q
1s, by incident ray direction vector Q
1s and reflection ray direction vector sP
1obtain the normal direction value of sampled point: by formula
Calculate normal vector.
3. the absolute phase of the travers that collected by camera 1 and vertical striped distributes, and the image coordinate that can order according to s obtains the horizontal phase and vertical phase value that s is ordered.The horizontal phase of ordering according to s is searched some projection in camera 2 as s point of par phase place and vertical phase place in the phase plane of camera 2 with vertical phase value, determine pixel P
2point.
4. according to body surface same point, in the different pixels of left and right view, put corresponding phase value principle of identity, P
2, Q
2there is identical horizontal phase and vertical phase place with s point.Can be by pixel P according to this principle
2point is determined the Q taking
2point, determines light Q
2s and P
2c
2, by these two light, calculate new normal vector
5. the relatively newer normal vector n ' calculating and the initial normal vector n calculating, when difference is greater than certain threshold value (being error range), set a new s point coordinate, repeats (2)~(5), otherwise, assert that s point coordinate is the locus of tested point.
The present embodiment is to the present invention is based on the mirror article surface three-dimensional contour outline measuring set of binocular vision and measuring principle and the measuring process of measuring method are described further: Fig. 4 is the stainless steel convex mirror testee that a diameter is 100mm, measures object distance in 300mm left and right.Grenade instrumentation adopts 19 cun of LCD display (1440 * 900 pixel).Fig. 5 blocks phase diagram and absolute (continuously) phase diagram for what calculate according to the phase shifted images gathering.Fig. 6 is the display effect that measures three-dimensional point set.