CN102116607B - Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio - Google Patents
Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio Download PDFInfo
- Publication number
- CN102116607B CN102116607B CN 200910251092 CN200910251092A CN102116607B CN 102116607 B CN102116607 B CN 102116607B CN 200910251092 CN200910251092 CN 200910251092 CN 200910251092 A CN200910251092 A CN 200910251092A CN 102116607 B CN102116607 B CN 102116607B
- Authority
- CN
- China
- Prior art keywords
- forw
- stepper motor
- max
- frame
- camera
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention provides a method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio. The device comprises a common computer, a computer camera, a stepping motor, an interface circuit of the stepping motor, and a camera axial displacement device, wherein the computer camera is connected with the computer via a USB (universal serial bus) interface; the camera is installed on the axial displacement device and is driven by the stepping motor; the stepping motor is connected to an RS232C interface of the computer via the interface circuit of the stepping motor; and the computer is configured with programs for camera capture and axial displacement measurement according to the 1D contrast ratio. The method provided by the invention comprises the following steps of: taking the 1D contrast ratio as the characteristic of an image frame of a measured object, and calculating autocorrelation matching coefficients for pixel brightness so as to automatically analyze and select an optimum viewing area; and judging the imaging focusing degree of the object by counting the number of image characteristics in the viewing area so as to measure micro-displacement of the object in the optical axis direction of the camera. The measurement method is novel and can adapt to the change of ambient light to a certain extent.
Description
Technical field
The invention belongs to the digital picture field of measuring technique, particularly use the computing machine camera to measure method and the device thereof of object along the micro-displacement of its optic axis direction generation.
Background technology
The technology that detects the displacement occurred along the optical axis direction of system has been analyzed in the application for a patent for invention of submitting to recently method and the device of the displacement of trichromatic contrast ratio as pattern measurement along optical axis direction " take ", a kind of method and device thereof of detection axial displacement of novelty have been proposed, the information that the picture frame that has utilized more fully camera to take comprises, but, its analytic operation amount is larger, affects measuring speed.
Summary of the invention
The invention provides a kind of method and device that one-dimensional contrast is pattern measurement axial displacement of take, it utilizes the computing machine camera, can occur in the environment of certain variation at illuminating position, measure the micro-displacement vector that object occurs along the optical axis direction of camera.
The technical solution adopted for the present invention to solve the technical problems is: computing machine camera of allocation of computer that a Daepori is logical, it is on the axial displacement device that forms of core by the high-precision micro displacement stepper motor that this camera is installed in one, this stepper motor is connected to the RS232C interface of described computing machine by the stepper motor interface circuit, described allocation of computer has camera to take and measures the axial displacement program according to one-dimensional contrast, this program has embodied take the method for the pattern measurement axial displacement that one-dimensional contrast is picture frame, comprising:
Step 1, with the form of bitmap (M * N, M, N ∈ positive integer), take the image of a frame testee, as the reference frame; Take the position of first pixel in this frame pel array upper left corner is initial point, and the direction of take to the right is the x direction of principal axis, and vertical downward direction is the y direction of principal axis, the size that the unit of the coordinate system of getting is a pixel; Choose a zone at the middle section of described pel array, size is m
0* n
0, m
0, n
0the ∈ positive integer, be referred to as view window, and the horizontal direction of the described pel array of its distance and the edge pixel of vertical direction respectively have h and v pixel, have: m
0+ 2h=M, n
0+ 2v=N, h, v ∈ positive integer;
In formula, sign of operation means binary logic and computing, its operation result or be logical zero or for logical one, sign of operation " [] " means to get the corresponding numerical value of value of logical operation function wherein, or is numerical value 0, or is numerical value 1, parametric variable a, the combination of b has determined the scale of associated coupling operator array, if get 3 * 3 associated coupling operator array: a=-1,0,1, b=-1,0,1, therefore, along each change in coordinate axis direction, each will produce 9 self-correlation auto_correlation
x(a, b) and auto_correlation
y(a, b);
m
x=m
0±step,n
x=n
0±step,2h=M-m
x,2v=N-n
x
And m
y=m
0± step, n
y=n
0± step, 2h=M-m
y, 2v=N-n
y,
In formula, subscript x, y mean respectively its value corresponding along X-direction and Y direction, step is the stepped parameter in search procedure, the unlike signs of its front is determined by the direction of search; Get large person in this two class value and measure the scale of view window array used: m * n for this;
According to above-mentioned edge direction data, for view window zone wherein, use respectively their corresponding positive limit and marginal number: N of accumulator count
x-axis justand N
x-axis is negative, wherein, N (umber) means number, the count results of cumulative above-mentioned totalizer is also preserved it, be expressed as: N (i, j=0, forw=0, back=0), wherein, i=1, 2, 3...... mean the sequential counting of captured reference frame, it is also the counting of measuring, j=0, 1, 2, 3, ..., the counting that means the sampling frame taken in the i time measuring process, variable forw (=0, 1, 2, ...) and back (=0, 1, 2, ...) mean that respectively stepper motor generation clockwise described in the i time measurement rotates and the corresponding step-by-step impulse counting of anticlockwise rotation, before this is measured and starts, have: i=1, j=0, forw=0, back=0,
For the pel array of above-mentioned sampling frame, according to its pixel intensity, derive line by line its 1 frame edge direction data along X-direction;
According to above-mentioned edge direction data, for view window zone wherein, use respectively their corresponding positive limit and marginal number: N of accumulator count
x-axis justand N
x-axis is negative; The count results of cumulative above-mentioned totalizer is also preserved it, is expressed as: N (i, j=1, forw=1, back=0);
If: N (i, j=1, forw=1, back=0)<N (i, j=0, forw=0, back=0), described computing machine is exported back=1 digital pulse signal to described stepper motor interface circuit by an output control line BACKWARD of its RS232C interface, control the anticlockwise rotation backward of this stepper motor, get back to the initial position of this measurement, then, described computing machine continues output back (=2 by the output control line BACKWARD of its RS232C interface, 3, ...) individual digital pulse signal is to described stepper motor interface circuit, control the further anticlockwise rotation of this stepper motor, in this process, each anticlockwise rotation one step respectively samples the interior positive limit all along X-direction of frame view window and marginal number sum N (i before and after all taking and analyze comparison, j=back+1, forw=1, back) and N (i, j=back, forw=1, back=back-1), should have: N (i, j=back+1, forw=1, back=back)>=N (i, j=back, forw=1, back=back-1), preserve it, so continue, until meet: N (i, j=back+1, forw=1, back)<N (i, j=back, forw=1, back-1), at this moment, record: (back)
mAX=back, simultaneously, described computing machine arrives described stepper motor interface circuit by another root output control line FORWARD digital pulse signal of output (forw=2) of its RS232C interface, control this stepper motor clockwise and rotate a step, at this moment, this measures the initial position before starting relatively, and the camera of this device i.e. best object imaging and focusing position in this is measured: FocusP=forw-(back)
mAX=2-(back)
mAX, the result of its calculating is negative value, and the sense of rotation that means described stepper motor is anticlockwise, and the interior positive limit all along X-direction of sampling frame view window that this focal position is corresponding and marginal number sum are: N (i, j=((back)
mAX-1)+1=(back)
mAX, forw=1, back=(back)
mAXthe tale result of the sampling frame of-1), taking in measuring process is: j=forw+ (back)
mAX=2+ (back)
mAX,
Integrate, this measures the initial position before starting relatively, the object that this measurement obtains along the displacement of the optic axis direction generation of described camera is: Δ z (i)=forw-back, the value of above-mentioned calculating formula Counter forw and back is count results last in this measuring process, result of calculation has the symbol of plus or minus, the direction that the displacement that expression occurs is respectively advanced or retreated along optic axis, corresponding to the sense of rotation of described stepper motor (clockwise or anticlockwise), specifically by the arrangement of the axial displacement device of stepper motor, determined;
Total displacement is: Δ Z
0(i)=Δ Z
0(i-1)+Δ z (i)
Wherein, Δ Z
0(i-1) measure the axial displacement of accumulation before for this;
N (i, j=0, forw=0, back=0)=N (i, j=(forw)
mAX-1, forw=(forw)
mAX-1, back=0), or N (i, j=0, forw=0, back=0)=
N(i,j=((back)
MAX-1)+1=(back)
MAX,forw=1,back=(back)
MAX-1);
In the actual measurement process, by measurement, calibrate, can obtain direct measurement result.
Above-mentioned camera is taken and according to the definition of edge direction data described in the step of one-dimensional contrast measurement axial displacement program is:
In pel array, along X-axis or along Y direction, if the light intensity value of a pixel is than the also little error margin value error of second corresponding light intensity value of pixel of its back, if
I (X, Y)<I (X+2, Y)-error or I (X, Y)<I (X, Y+2)-error
Define between these two pixels and have one along this axial positive limit; If the light intensity value of a pixel is than second corresponding light intensity value of pixel of its back large error margin value error also, if
I (X, Y)>I (X+2, Y)+error or I (X, Y)>I (X, Y+2)+error
Define between these two pixels exist one axial marginal along this; The limit so obtained is positioned at the position of first pixel after this pixel, also is positioned on that pixel in the centre position that participates in two pixels relatively; If second corresponding light intensity value of pixel of certain light intensity value of a pixel and its back approaches, its value differs and is no more than an error margin value error, if
I(X+2,Y)-error≤I(X,Y)≤I(X+2,Y)+error
Or I (X, Y+2)-error≤I (X, Y)≤I (X, Y+2)+error,
Think and do not have corresponding " limit " along this direction of principal axis between these two pixels, or be referred to as the 3rd class limit;
Along some change in coordinate axis direction, all positive limit of corresponding pixel column or pixel column, marginal and the 3rd class limit form this row maybe these row along the edge direction data of this change in coordinate axis direction; Error margin value in above-listed formula can, according to concrete light conditions, be predisposed to a little numerical value, for example: error=10; There are not the edge direction data in four limits in pel array and the location of pixels on angle.
Above-mentioned camera is taken and is comprised according to the method for the pel array of search optimal viewing window described in the step of one-dimensional contrast measurement axial displacement program:
View window and the associated coupling of k * k (k ∈ positive integer) operator array (a, b) for described pel array, can produce k * k auto correlation matching factor along certain change in coordinate axis direction, by following inequality, compares these auto correlation matching factors:
auto_correlation(a,b)≥auto_correlation(0,0)×similarity
In formula, similarity has described the similarity degree of view window with the pel array of its contiguous identical scale, for example gets similarity=60%, can set in advance, and also can be debugged and select according to the quality on light conditions and measured object surface;
If meet the self-correlation of above-mentioned inequality more than k * k * 1/3, need to enlarge the capable and step row of each step of scope of view window: make m=m
0+ step, n=n
0+ step, recalculate the self-correlation of new view window, and carry out above-mentioned comparison, until meet the no more than k * k of auto correlation matching factor of above-mentioned inequality * 1/3, at this moment, 2h=M-m, 2v=N-n, wherein, step is stepped parameter, initial value is 1, needs the scale of expansion view window just to increase by 1 at every turn; If exceed a predetermined scope in frame, also do not find suitable view window, think that the quality of this this part reflecting surface of object is unsuitable for the surveying work of this device, and provide the prompting warning;
If meet the no more than k * k of auto correlation matching factor of above-mentioned inequality * 1/3, the architectural feature on surface that subject is described is enough meticulous, value between neighborhood pixels can be distinguished, can further attempt dwindling the capable and step row of each step of scope of view window, to reduce amount of calculation: make m=m
0-step, n=n
0-step, recalculate the self-correlation of view window, and carry out above-mentioned comparison, the parameter s of going forward one by one tep is each increases by 1, be not less than k * k * 1/3 until selected view window zone meets the number of the self-correlation of above-mentioned inequality, at this moment, think and searched optimal viewing window pel array.
Described camera axial displacement device comprises: described camera is arranged on a worktable, this worktable and a long tap turning axle are socketed with tap, this tap turning axle is arranged on a large worktable by two bracing frames, and, it and these two bracing frames are all that the mode with rotating shaft is socketed, and at the socket place with bracing frame, can rotate but displacement does not forward or backward occur; A fixing gear is arranged, the mutual interlock of gear above the rotating shaft of it and stepper motor on described tap turning axle.Described stepper motor also is arranged on described large worktable, and it is connected to the RS232C interface of computer system by the stepper motor interface circuit.
Patent of the present invention is usingd the one-dimensional contrast of pixel intensity as the feature of testee picture frame, and by calculating the auto correlation matching factor, automatic analysis is also chosen the optimal viewing zone; By counting the number of characteristics of image in this viewing area, the degree of judgment object imaging and focusing, and then measure the micro-displacement that object occurs in camera optic axis direction; This measuring method novelty, relatively method and the device of the displacement of trichromatic contrast ratio as pattern measurement along optical axis direction " take ", the advantage of patent of the present invention is, reduced the analytic operation amount, improved measuring speed.
The accompanying drawing explanation
Further illustrate patent of the present invention below in conjunction with accompanying drawing.
Fig. 1 is computing machine of the present invention and camera measuring system block scheme thereof.
Fig. 2 be of the present invention by the high-precision micro displacement stepper motor, be the camera axial displacement device block scheme that core forms.
Fig. 3 is optical imagery during focusing schematic diagram of the present invention.
Fig. 4 is that the photoelectric sensor chip carries out the pel array and the view window area schematic thereof that produce after opto-electronic conversion.
Fig. 5 is the schematic diagram of a traveling optical signal and digitized signal thereof, edge direction data.
In Fig. 1,1. computing machine camera, 2. optical lens, 3. photoelectric sensor chip, 4.USB interface, 5. computer system, 6.USB interface, 7.CPU, 8.RS232C interface, 9. display card and display, 10. internal memory and hard disk, 11. keyboards and mouse, 12. operating system, 13. the webcam driver program, 14. cameras are taken and are measured axial displacement program, 15. light fixture according to one-dimensional contrast.
In Fig. 2,30. the worktable of stepper motor and camera, 31. bracing frame, 32. bracing frame, the worktable of 33. cameras (1), 34. tap turning axles, 341. the gear on tap turning axle (34), 40. stepper motor, the turning axle of 41. stepper motors (40), the gear on the turning axle (41) of 42. stepper motors (40).
In Fig. 3,90.-96. object (circle hot spot) schematic diagram of different position imagings on optical axis, 97. optic axises.
In Fig. 5,21. 1 traveling optical signals, 22. digitized signals corresponding with light signal (21), 23. edge direction data corresponding with digitized signal (22).
Embodiment
Patent of the present invention comprises two parts: shown in the computing machine shown in Fig. 1 and camera measuring system thereof, Fig. 2 is the camera axial displacement device that core forms by the high-precision micro displacement stepper motor.
In the webcam driver program (13) of the upper operation the placing of computer system (5), be connected camera (1) with (6) by USB interface (4) to computing machine (5).Then, allow camera focal imaging object being measured.
In measuring process, allow illuminating position that certain variation occurs, take it, to change the light and shade contrast who affects the object being measured imaging be limit not obviously.Select light fixture (15) to contribute to enforcement of the present invention.For example adopt irreflexive Uniform Illumination mode, or its intensity of light fixture can be better than the impact of environment parasitic light.The material of object being measured preferably has more careful surface reflection feature, also can select this type of material to make target, avoids or overcomes smooth reflecting surface material.
As shown in Figure 2, it is upper that camera (1) is arranged on worktable (33), with worktable, moves, and this worktable (33) is socketed with tap with a long tap turning axle (34).Tap turning axle (34) is arranged on a large worktable (30) by bracing frame (31) and (32), and, tap turning axle (34) and bracing frame (31) and (32) are all that the mode with rotating shaft is socketed, and tap turning axle (34) can rotate but displacement does not forward or backward occur at the socket place with bracing frame (31) and (32).A fixing gear (341) is arranged on tap turning axle (34), the interlock mutually of gear (42) above the rotating shaft (41) of it and stepper motor (40), when the rotating shaft (41) of stepper motor (40) is rotated, rotation meeting driven gear (341) rotation of gear (42), and then drive tap turning axle (34) rotation, impel camera (1) and worktable (33) thereof to be moved forward or backward together.Stepper motor (40) also is arranged on large worktable (30).
Choose two inner output signal lines of RS232C interface (8) of computer system (5), FORWARD as shown in the figure and BACKWARD, receive a stepper motor interface circuit (43) together with a ground wire GROUND, carry out power amplification at this, then, be connected to stepper motor (40), control step motor (40) is done clockwise rotation or anticlockwise rotation.
The property relationship of stepper motor (40) is to the measuring accuracy of patent of the present invention, should select that step-wise displacement is meticulous, precision is high, the motor of working stability,
The operation camera is taken and is measured axial displacement program (14) according to one-dimensional contrast, measures in real time displacement.Concrete steps are shown in that " summary of the invention " describe, below as follows with regard to its general condensed summary.
It is whether clear that the principle of patent measurement optical shaft orientation micrometric displacement of the present invention and method focus on based on optical imagery, and as shown in Figure 3, its judgment criterion is: when focusing on clearly, picture frame view window zone has the characteristics of image that number is maximum--the limit reflection condition.Relevant photoelectric sensor chip carries out the pel array that produces after opto-electronic conversion and view window zone thereof as shown in Figure 4.Relevant characteristics of image is the definition of edge direction data and determines as shown in Figure 5.
Before measure starting, calculate the auto correlation matching factor, the suitable view window zone with constituency, judge whether the optical reflectance property on testee surface adapts to this surveying work, and optimization analytic operation amount.
The selected coordinate axis of patent of the present invention is not limited to X-axis, and Y-axis and it are equal to.
The described measuring method of patent of the present invention also is applicable to other picture pick-up device.
Claims (3)
1. take the method for one-dimensional contrast as pattern measurement axial displacement for one kind, it is by the logical computing machine of a Daepori, a camera, the camera axial displacement device, stepper motor and stepper motor interface circuit are measured axial displacement, this computing machine is connected to camera by its USB interface, it is on the camera axial displacement device that forms of core by described stepper motor that this camera is installed in one, this stepper motor is connected to the RS232C interface of computing machine by the stepper motor interface circuit, described camera axial displacement device comprises: camera (1) is arranged on the first worktable (33), the first worktable (33) is socketed with tap with a long tap turning axle (34), tap turning axle (34) is arranged on large second worktable (30) by the first bracing frame (31) and the second bracing frame (32), and, tap turning axle (34) and the first bracing frame (31) and the second bracing frame (32) are all that the mode with rotating shaft is socketed, tap turning axle (34) can rotate but displacement forward or backward not occur at the socket place with the first bracing frame (31) and the second bracing frame (32), a fixing gear (341) is arranged on tap turning axle (34), the interlock mutually of gear (42) above the rotating shaft (41) of this gear (341) and stepper motor (40), stepper motor (40) also is arranged on the second worktable (30), stepper motor (40) is connected to the RS232C interface (8) of computing machine (5) by stepper motor interface circuit (43), it is characterized in that, the method is taken by camera and is measured the micro-displacement of object along the optical axis direction generation of described camera according to one-dimensional contrast, comprises the steps:
Step 1, take the image of a frame testee with the form of bitmap M * N, as the reference frame; Take the position of first pixel in this frame pel array upper left corner is initial point, and the direction of take to the right is X-direction, and vertical downward direction is Y direction, the size that the unit of the coordinate system of getting is a pixel; Choose a zone at the middle section of described pel array, size is m
0* n
0, being referred to as view window, the horizontal direction of the described pel array of its distance and the edge pixel of vertical direction respectively have h and v pixel, have: m
0+ 2h=M, n
0+ 2v=N, wherein, M, N, m
0, n
0, h, v ∈ positive integer;
Step 2, for the pel array of above-mentioned reference frame, pursue pixel column, by pixel column, derive the edge direction data along X-direction and Y direction, and with the binary numeral 001 of 3bit, 010 and 100 mean respectively positive limit, marginal and the 3rd class limit wherein, so formed corresponding described reference frame pel array about X-direction with about two frame edge direction data { reference of Y direction
x(x, y) } and { reference
y(x, y) }, wherein, subscript x or y mean respectively the direction of the coordinate axis on institute edge, symbol " { } " means to preserve these data along a set of the edge direction data that in the change in coordinate axis direction view window that wherein the function subscript indicates, all pixels (x, y) are located;
Step 3, for above-mentioned two frame edge direction data, calculate respectively the auto correlation matching factor of pel array in view window in described reference frame:
In formula, sign of operation means binary logic and computing, its operation result or be logical zero or for logical one, sign of operation " [] " means to get the corresponding numerical value of value of logical operation function wherein, or be numerical value 0, or be numerical value 1, the combination of parametric variable a, b has determined the scale of associated coupling operator array, if get 3 * 3 associated coupling operator array: a=-1,0,1, b=-1,0,1, therefore, along each change in coordinate axis direction, each will produce 9 auto correlation matching factor auto_correlation
x(a, b) and auto_correlation
y(a, b);
Step 4, according to auto correlation matching factor corresponding to above-mentioned two frame edge direction data, search for respectively and can carry out matching ratio optimal viewing window pel array under current body surface situation and illuminating position:
m
x=m
0±step,n
x=n
0±step,2h=M-m
x,2v=N-n
x,
And m
y=m
0± step, n
y=n
0± step, 2h=M-m
y, 2v=N-n
y,
In formula, subscript x, y mean respectively its value corresponding along X-direction and Y direction, step is the stepped parameter in search procedure, the unlike signs of its front is determined by the direction of search; Get large person in this two class value and measure the scale of view window array used: m * n for this;
Step 5, for the pel array of above-mentioned reference frame, according to its pixel intensity, derive line by line the 1 frame edge direction data along X-direction;
According to above-mentioned edge direction data, for view window zone wherein, use respectively their corresponding positive limits of accumulator count, marginal number: N
x-axis justand N
x-axis is negative, wherein, N means number, the count results of cumulative above-mentioned totalizer is also preserved it, be expressed as: N (i, j=0, forw=0, back=0), wherein, i=1, 2, 3......, the sequential counting that means captured reference frame, it is also the counting of measuring, j=0, 1, 2, 3, ..., the counting that means the sampling frame taken in the i time measuring process, stepper motor generation clockwise rotation described in variable forw and back mean respectively to measure for the i time and the corresponding step-by-step impulse counting of anticlockwise rotation: forw=0, 1, 2, ..., back=0, 1, 2, ..., before this is measured and starts, have: i=1, j=0, forw=0, back=0,
Step 6, measurement start: described computing machine is exported forw=1 digital pulse signal to described stepper motor interface circuit by an output control line FORWARD of its RS232C interface, control this stepper motor clockwise and rotate a step, then, take j=1 frame sample framing bit figure;
For the pel array of above-mentioned sampling frame, according to its pixel intensity, derive line by line its 1 frame edge direction data along X-direction;
According to above-mentioned edge direction data, for view window zone wherein, use respectively their corresponding positive limits of accumulator count, marginal number: N
x-axis justand N
x-axis is negative; The count results of cumulative above-mentioned totalizer is also preserved it, is expressed as: N (i, j=1, forw=1, back=0);
Step 7, if: N (i, j=1, forw=1, back=0)>=N (i, j=0, forw=0, back=0), described computing machine is exported forw digital pulse signal to described stepper motor interface circuit: forw=2 by an output control line FORWARD of its RS232C interface, 3, ..., control this stepper motor clockwise rotation progressive, each clockwise rotates a step and all takes and analyze before and after comparison and respectively sample in frame in view window the positive limit all along X-direction and marginal number sum N (i, j=forw-1, forw-1, back=0) and N (i, j=forw, forw, back=0), preserve it, in this process, should have: N (i, j=forw, forw, back=0)>=N (i, j=forw-1, forw-1, back=0), until meet: N (i, j=forw, forw, back=0)<N (i, j=forw-1, forw-1, back=0), at this moment, record (forw)
mAX=forw, simultaneously, described computing machine arrives described stepper motor interface circuit: back=1 by digital pulse signal of another root output control line BACKWARD output of its RS232C interface, control anticlockwise rotation one step of this stepper motor, at this moment, this measures the initial position before starting relatively, and described camera i.e. best object imaging and focusing position in this is measured: FocusP=(forw)
mAX-back=(forw)
mAX-1, the result of its calculating is more than or equal to 0, the sense of rotation that means described stepper motor is in general clockwise, and the interior positive limit all along X-direction of sampling frame view window that this focal position is corresponding and marginal number sum are: N (i, j=(forw)
mAX-1, forw=(forw)
mAX-1, back=0), the tale result of the sampling frame of taking in measuring process is: j=(forw)
mAX+ back=(forw)
mAX+ 1,
If: N (i, j=1, forw=1, back=0)<N (i, j=0, forw=0, back=0), described computing machine is exported back=1 digital pulse signal to described stepper motor interface circuit by an output control line BACKWARD of its RS232C interface, control the anticlockwise rotation backward of this stepper motor, get back to the initial position of this measurement, then, described computing machine continues back digital pulse signal of output to described stepper motor interface circuit: back=2 by the output control line BACKWARD of its RS232C interface, 3, ..., control the further anticlockwise rotation of this stepper motor, in this process, each anticlockwise rotation one step respectively samples the interior positive limit all along X-direction of frame view window and marginal number sum N (i before and after all taking and analyze comparison, j=back+1, forw=1, back) and N (i, j=back, forw=1, back=back-1), should have: N (i, j=back+1, forw=1, back=back)>=N (i, j=back, forw=1, back=back-1), preserve it, so continue, until meet: N (i, j=back+1, forw=1, back)<N (i, j=back, forw=1, back-1), at this moment, record: (back)
mAX=back, simultaneously, described computing machine arrives described stepper motor interface circuit: forw=2 by digital pulse signal of another root output control line FORWARD output of its RS232C interface, control this stepper motor clockwise and rotate a step, at this moment, this measures the initial position before starting relatively, and described camera i.e. best object imaging and focusing position in this is measured: FocusP=forw-(back)
mAX=2-(back)
mAX, the result of its calculating is negative value, and the sense of rotation that means described stepper motor is anticlockwise, and the interior positive limit all along X-direction of sampling frame view window that this focal position is corresponding and marginal number sum are: N (i, j=((back)
mAX-1)+1=(back)
mAX, forw=1, back=(back)
mAXthe tale result of the sampling frame of-1), taking in measuring process is: j=forw+ (back)
mAX=2+ (back)
mAX,
Integrate, this measures the initial position before starting relatively, and the object that this measurement obtains along the displacement of the optic axis direction generation of described camera is: Δ z (i)=forw-back,
The value of above-mentioned calculating formula Counter forw and back is count results last in this measuring process, result of calculation has the symbol of plus or minus, the direction that the displacement that expression occurs is respectively advanced or retreated along optic axis, corresponding to the sense of rotation of described stepper motor clockwise or anticlockwise, the arrangement that is specifically the camera axial displacement device that forms of core by stepper motor is determined;
Total displacement is: Δ Z
0(i)=Δ Z
0(i-1)+Δ z (i),
Wherein, Δ Z
0(i-1) measure the axial displacement of accumulation before for this;
Step 8, prepare surveying work next time: measure time counter i and add 1, get and measure the corresponding object in best object imaging and focusing position of determining for the i time and become the interior positive limit all along X-direction of picture frame view window and marginal number sum as new witness mark value:
N (i, j=0, forw=0, back=0)=N (i, j=(forw)
mAX-1, forw=(forw)
mAX-1, back=0), or N (i, j=0, forw=0, back=0)=
N(i,j=((back)
MAX-1)+1=(back)
MAX,forw=1,back=(back)
MAX-1);
Step 9, jump to step 6, continue to measure.
2. according to claim 1ly take the method that one-dimensional contrast is pattern measurement axial displacement, it is characterized in that, the definition of edge direction data described in described step 2, step 5 and step 6 is:
In pel array, along X-axis or along Y direction, if the light intensity value of a pixel is than the also little error margin value error of second corresponding light intensity value of pixel of its back, if:
I (X, Y)<I (X+2, Y)-error or I (X, Y)<I (X, Y+2)-error,
Define between these two pixels and have one along this axial positive limit; If the light intensity value of a pixel is than second corresponding light intensity value of pixel of its back large error margin value error also, if:
I (X, Y)>I (X+2, Y)+error or I (X, Y)>I (X, Y+2)+error,
Define between these two pixels exist one axial marginal along this; The limit so obtained is positioned at the position of first pixel after this pixel, also is positioned on that pixel in the centre position that participates in two pixels relatively; If second corresponding light intensity value of pixel of certain light intensity value of a pixel and its back approaches, its value differs and is no more than an error margin value error, if:
I(X+2,Y)-error≤I(X,Y)≤I(X+2,Y)+error,
Or I (X, Y+2)-error≤I (X, Y)≤I (X, Y+2)+error,
Think and do not have corresponding " limit " along this direction of principal axis between these two pixels, or be referred to as the 3rd class limit; In above-mentioned expression, independent variable X and independent variable Y mean respectively discussed pixel coordinate about X-axis and Y direction in pel array;
Along some change in coordinate axis direction, all positive limit of corresponding pixel column or pixel column, marginal and the 3rd class limit form this row maybe these row along the edge direction data of this change in coordinate axis direction; According to concrete light conditions, the error margin value error in preset above-listed formula is a little numerical value; There are not the edge direction data in four limits in pel array and the location of pixels on angle.
3. according to claim 1ly take the method that one-dimensional contrast is pattern measurement axial displacement, it is characterized in that, in described step 4, the method for search optimal viewing window pel array comprises:
For view window and the associated coupling of the k * k operator array (a, b) of described pel array, k ∈ positive integer, can produce k * k auto correlation matching factor along certain change in coordinate axis direction, by following inequality, compares these auto correlation matching factors:
auto_correlation(a,b)≥auto_correlation(0,0)×similarity
In formula, similarity has described the similarity degree of view window with the pel array of its contiguous identical scale, and similarity is set up in advance, according to the quality on light conditions and measured object surface, is debugged and selects;
If meet the auto correlation matching factor of above-mentioned inequality more than k * k * 1/3, need to enlarge the capable and step row of each step of scope of view window: make m=m
0+ step, n=n
0+ step, recalculate the auto correlation matching factor of new view window, and carry out above-mentioned comparison, until meet the no more than k * k of auto correlation matching factor of above-mentioned inequality * 1/3, at this moment, 2h=M-m, 2v=N-n, wherein, step is stepped parameter, initial value is 1, needs the scale of expansion view window just to increase by 1 at every turn; If exceed a predetermined scope in frame, also do not find suitable view window, think that the quality of this this part reflecting surface of object is unsuitable for surveying work, and provide the prompting warning;
If meet the no more than k * k of auto correlation matching factor of above-mentioned inequality * 1/3, the architectural feature on surface that subject is described is enough meticulous, value between neighborhood pixels can be distinguished, further attempt dwindling the capable and step row of each step of scope of view window, to reduce amount of calculation: make m=m
0-step, n=n
0-step, recalculate the auto correlation matching factor of view window, and carry out above-mentioned comparison, stepped parameter step is each increases by 1, until meeting the number of the auto correlation matching factor of above-mentioned inequality, selected view window zone is not less than k * k * 1/3, at this moment, think and searched optimal viewing window pel array.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910251092 CN102116607B (en) | 2009-12-30 | 2009-12-30 | Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200910251092 CN102116607B (en) | 2009-12-30 | 2009-12-30 | Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102116607A CN102116607A (en) | 2011-07-06 |
CN102116607B true CN102116607B (en) | 2013-06-12 |
Family
ID=44215482
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200910251092 Expired - Fee Related CN102116607B (en) | 2009-12-30 | 2009-12-30 | Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102116607B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114463434A (en) * | 2021-12-27 | 2022-05-10 | 智能多维数据分析研究中心有限公司 | Method for measuring moving parameters of dynamic camera in real time based on one-dimensional image information |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6549648B1 (en) * | 1998-06-10 | 2003-04-15 | Leica Microsystems Wetzlar Gmbh | Method for determining a position of a structural element on a substrate |
CN1818545A (en) * | 2006-03-02 | 2006-08-16 | 浣石 | Small-displacement measuring system in long-distance plane |
EP1454290B1 (en) * | 2001-12-05 | 2008-09-10 | EM Microelectronic-Marin SA | Method, sensing device and optical pointing device including a sensing device for comparing light intensity between pixels |
CN102095375A (en) * | 2009-11-27 | 2011-06-15 | 曾艺 | Method and device for measuring displacement along optical axis direction by using contrasts of three primary colors as characteristics |
-
2009
- 2009-12-30 CN CN 200910251092 patent/CN102116607B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6549648B1 (en) * | 1998-06-10 | 2003-04-15 | Leica Microsystems Wetzlar Gmbh | Method for determining a position of a structural element on a substrate |
EP1454290B1 (en) * | 2001-12-05 | 2008-09-10 | EM Microelectronic-Marin SA | Method, sensing device and optical pointing device including a sensing device for comparing light intensity between pixels |
CN1818545A (en) * | 2006-03-02 | 2006-08-16 | 浣石 | Small-displacement measuring system in long-distance plane |
CN102095375A (en) * | 2009-11-27 | 2011-06-15 | 曾艺 | Method and device for measuring displacement along optical axis direction by using contrasts of three primary colors as characteristics |
Also Published As
Publication number | Publication date |
---|---|
CN102116607A (en) | 2011-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102360079B (en) | Laser range finder and working method thereof | |
CN105043259B (en) | Digit Control Machine Tool rotary shaft error detection method based on binocular vision | |
CN103728315B (en) | Heavy-calibre element surface detection apparatus and damage accordingly method for rapidly positioning | |
CN110411346B (en) | Method for quickly positioning surface micro-defects of aspheric fused quartz element | |
CN1115546C (en) | Surface three-dimensional appearance testing method and equipment | |
CN101458072A (en) | Three-dimensional contour outline measuring set based on multi sensors and measuring method thereof | |
CN112540089B (en) | Application method of digital imaging system in concrete bridge crack detection and analysis | |
CN104111485A (en) | Stereo imaging based observation method for raindrop size distribution and other rainfall micro physical characteristics | |
CN112858321A (en) | Steel plate surface defect detection system and method based on linear array CCD | |
CN110082360A (en) | A kind of sequence optical element surface on-line detection device of defects and method based on array camera | |
CN106248684A (en) | For detecting Optical devices and the method for the internal flaw of transparent substrates | |
CN107103604A (en) | A kind of particulate colourity auto-clustering analysis system | |
CN102095375B (en) | Method for measuring displacement along optical axis direction by using contrasts of three primary colors as characteristics | |
CN202304767U (en) | Three-dimensional outline measurement device based on multiple sensors | |
CN104123728A (en) | Hough transform based round pipe detection method | |
CN104515473A (en) | Online diameter detection method of varnished wires | |
CN102116607B (en) | Method and device for measuring axial displacement characterized by one-dimensional (1D) contrast ratio | |
CN106878617A (en) | A kind of focusing method and system | |
CN102095374B (en) | Method and device for measuring displacement along optical axis direction by using peaks and valleys of three primary colors as characteristics | |
CN106225765A (en) | A kind of many line scan image sensors obtain device and the formation method of hyperfocal distance scanning imagery | |
CN201532254U (en) | Automatic focusing device of thermal imaging system | |
TWI521295B (en) | Bevel-axial auto-focus microscopic system and method thereof | |
CN102494640B (en) | Mounting precision detector of infrared product | |
CN101329515B (en) | Device and method for measuring and checking step photoetching machine aligning system | |
CN105423998A (en) | Lens distance measurement device and measurement method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130612 Termination date: 20141230 |
|
EXPY | Termination of patent right or utility model |