Embodiment
For describing technology contents of the present invention, structural attitude, the purpose of being reached and effect in detail, described in detail below in conjunction with embodiment and conjunction with figs..
See also Fig. 1 and Fig. 2, a kind of embodiment of optical positioning apparatus of the present invention in order to locate a device 6 to be measured in the space the first axial X, the second axial Z and the coordinate of the 3rd axial Y, optical positioning apparatus is provided with main frame 2 and means for correcting 4.Main frame 2 is provided with the first optical sensor unit 8, the second optical sensor unit 10, control module 12 and processing unit 14.
Control module 12 is electrically connected between the first optical sensor unit 8, the second optical sensor unit 10 and the processing unit 14, in order to control the first optical sensor unit 8 and the second optical sensor unit 10, and receive the data that the first optical sensor unit 8 and the second optical sensor unit 10 send, again these data are sent to processing unit 14.Therefore, optical positioning apparatus can calculate the coordinate of device 6 to be measured first axial X in the space, the coordinate of the second axial Z and the coordinate of the 3rd axial Y.
See also Fig. 3 to Fig. 6, the first optical sensor unit 8 and the second optical sensor unit 10 are horizontally placed on the surface level that the first axial X and the second axial Z constituted, and the first optical sensor unit 8 in the coordinate of the first axial X and the second optical sensor unit 10 in the coordinate of the first axial X, one first distance D f at interval.The first optical sensor unit 8 and the second optical sensor unit 10 can be a kind of in CMOS (Complementary Metal Oxide Semiconductor) image sensor (CMOS) and the charge coupling device image sensor (CCD).The intermediate point of setting the first distance D f is the initial point of the first axial X, the second axial Z and the 3rd axial Y.
When optical positioning apparatus is worked, at first, open optical positioning apparatus, afterwards, carry out aligning step, last, utilize principle of parallax to position step.In aligning step, at first, means for correcting 4 is arranged in the induction range of the first optical sensor unit 8 and the second optical sensor unit 10, makes coordinate and first optical sensor unit 8 and second optical sensor unit 10 in the coordinate of second axial Z between the interval one second distance Ds (Fig. 3 only represent means for correcting 4 coordinate and first optical sensor unit 8 interval second distance Dss in second axial Z) of means for correcting 4 in the second axial Z.
See also Fig. 3, then, the first optical sensor unit 8 and the second optical sensor unit 10 are responded to means for correcting 4 respectively, to produce first image 16.Afterwards, the shared pixel of means for correcting 4 in the physical size of processing unit 14 calculation correction devices 4 and first image 16 is to produce a ratio.
The calculating formula of described ratio is as follows:
The shared pixel of ratio=physical size ÷
Means for correcting 4 is a correction plate of being made up of some black squares and some white square each intervals.The height of the black square 5 of means for correcting 4 is 10 millimeters (mm), and the height of black square is 20 pixels (Pixel) in first image 16, and according to the result of aforementioned calculation formula, ratio is 0.5 (mm/pixel).
See also Fig. 6, in positioning step, at first, device 6 to be measured is arranged in the induction range of the first optical sensor unit 8 and the second optical sensor unit 10, the device 6 to be measured and the first optical sensor unit 8 constitute the first angle theta l, the device 6 to be measured and the second optical sensor unit 10 constitute the second angle theta r, and the surface level that the device 6 to be measured and the first axial X and the second axial Z are constituted constitutes the 3rd angle theta.
Device 6 to be measured constitutes the described first angle theta l in coordinate, the first optical sensor unit 8 of the first axial X and the second axial Z in the coordinate and the second axial Z of the first axial X and the second axial Z, device 6 to be measured constitutes the described second angle theta r in coordinate, the second optical sensor unit 10 of the first axial X and the second axial Z in the coordinate and the second axial Z of the first axial X and the second axial Z, and device 6 to be measured constitutes described the 3rd angle theta in coordinate, the first optical sensor unit 8 of the second axial Z and the 3rd axial Y in the coordinate and the second axial Z of the second axial Z and the 3rd axial Y.
See also Fig. 4, then, the first optical sensor unit 8 and the second optical sensor unit 10 are responded to device 6 to be measured respectively, to produce second image 18 and the 3rd image (only showing second image 18 among the figure) respectively.Second coordinate of device 6 shared pixels to be measured in first coordinate of device 6 shared pixels to be measured and the 3rd image in processing unit 14 calculating second image 18.Afterwards, computing unit 14 utilizes an inverse trigonometric function calculating formula to calculate ratio, second distance Ds and first coordinate, to obtain the numerical value of the first angle theta l, computing unit 14 utilizes described inverse trigonometric function calculating formula to calculate ratio, second distance Ds and second coordinate, to obtain the numerical value of the second angle theta r, computing unit 14 utilizes one of the two of the described calculating of inverse trigonometric function calculating formula ratio, second distance Ds and first coordinate and second coordinate, to obtain the numerical value of the 3rd angle theta.
See also Fig. 5, device 6 to be measured is a handgrip, the handgrip front end is provided with a light emitting source 20, the first optical sensor unit 8 and the second optical sensor unit 10 can be responded to the light emitting source 20 of handgrip respectively, in second image 18 and the 3rd image, this light emitting source 20 can be considered a luminous point, and is arranged in first coordinate of second image 18 and second coordinate of the 3rd image.
Second image 18 and the 3rd image are the image of a VGA image quality, so second image 18 and the 3rd image have 640x480 pixel, each pixel can be considered a coordinate points, so lateral coordinates is 0 to 639 from left to right in regular turn, along slope coordinate from top to bottom is 0 to 479 in regular turn.Because the first optical sensor unit 8 and the second optical sensor unit 10 are horizontally placed on the surface level that the first axial X and the second axial Z constituted, so the along slope coordinate of first coordinate is identical with the along slope coordinate of second coordinate.
Suppose that first setting coordinate is (336,240), second coordinate is (146,240).The inverse trigonometric function calculating formula is
Angle=arctan (coordinate * ratio ÷ second distance)
Therefore, when stating calculating formula in the use and calculating the first angle theta l, coordinate should be the lateral coordinates of first coordinate, according to above-mentioned formula:
The first angle theta l=arctan (336 * 0.5 ÷ 200), therefore, the first angle theta l is 40 degree.
According to above-mentioned formula:
The second angle theta r=arctan (146 * 0.5 ÷ 200), therefore, the second angle theta r is 20 degree.
According to above-mentioned formula:
The 3rd angle theta=arctan (240 * 0.5 ÷ 200), therefore, the 3rd angle theta is 31 degree.
Afterwards, computing unit 14 uses a trigonometric function calculating formula to calculate the first distance D f, the first angle theta l and the second angle theta r, to obtain the second axial Z coordinate Dz of device 6 to be measured.When the second axial Z coordinate Dz that calculates device 6 to be measured, the induction range of the first optical sensor unit 8 and the second optical sensor unit 10 is divided into three zones, space between the first optical sensor unit 8 and the second optical sensor unit 10 is first area I, the first optical sensor unit 8 is second area II away from the space of the second optical sensor unit, 10 1 sides, and the second optical sensor unit 10 is the 3rd area I II away from the space of the first optical sensor unit, 8 one sides.
Computing unit 14 judges earlier which zone device 6 to be measured is positioned at, and computing unit 14 can utilize the lateral coordinates of first coordinate and the lateral coordinates of second coordinate to make a decision.When device 6 to be measured was positioned at first area I, the trigonometric function calculating formula was:
Second axial coordinate=first distance/(| tan (Yi Clip angle) |+| tan (Er Clip angle) |)
When device 6 to be measured was positioned at second area II, the trigonometric function formula of calculating was:
Second axial coordinate=first distance/(| tan (second angle) |-| tan (first angle) |)
When device 6 to be measured was positioned at the 3rd area I II, the trigonometric function formula of calculating was:
Second axial coordinate=first distance/(| tan (first angle) |-| tan (second angle) |)
Suppose that device 6 to be measured is positioned at first area I, first distance is 300mm, according to above-mentioned formula:
The second axial coordinate Dz=300/ (| tan (40) |+| tan (20) |), therefore, the second axial Z coordinate Dz of device 6 to be measured is 249.
See also Fig. 7, come, processing unit 14 uses a trigonometric function calculating formula to calculate coordinate Dz, the first angle theta l, the first distance D f of the second axial Z, to obtain the first axial X coordinate Dx of device 6 to be measured.In the present embodiment, described trigonometric function calculating formula is:
First axial coordinate=second axial coordinate * tan (first angle)-first is apart from ÷ 2
According to above-mentioned formula:
First axial coordinate Dx=249 * tan (40)-300 ÷ 2, therefore, the first axial X coordinate Dx of device 6 to be measured is 59.
The intermediate point of the first distance D f is made as initial point, and to set initial point be the negative sense of the first axial X towards the direction of first optical induction device 8, and relatively, initial point is the forward of the first axial X towards the direction of second optical induction device 10, so can get the aforementioned calculation formula.
When real enforcement, can set first axial forward and the negative sense arbitrarily, utilizing triangle to contain the number calculating formula, calculate the side-play amount of device 6 to be measured apart from initial point, if side-play amount is being for just, promptly the coordinate of the first axial X is for just, side-play amount is for negative, and promptly the coordinate of the first axial X is for negative.
At last, computing unit 14 uses a trigonometric function calculating formula to calculate the coordinate of the second axial Z of the 3rd angle theta and device to be measured 6, with the coordinate of the 3rd axial Y that obtains device 6 to be measured.Described trigonometric function calculating formula is
The 3rd axial coordinate=second axial coordinate * tan (the 3rd angle)
According to above-mentioned formula:
The 3rd axial coordinate=249 * tan (31), therefore, the 3rd axial Y coordinate of device 6 to be measured is 149.Therefore, the coordinate of device 6 to be measured is (59,249,149).
See also Fig. 8 and Fig. 9, the main frame 2 of another embodiment of optical positioning apparatus of the present invention also comprises one the 3rd optical sensor unit 22 and one the 4th optical sensor unit 24.The first optical sensor unit 8 and the second optical sensor unit 10 are first group of sensing unit, and the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 are second group of sensing unit.
The 3rd optical sensor unit 22 and the 4th optical sensor unit 24 are arranged at the first optical sensor unit 8 and the second optical sensor unit, 10 1 sides respectively, one first distance D f at interval between the 3rd optical sensor unit 22 and the 4th optical sensor unit 24, and be horizontally placed on the surface level that the first axial X and the second axial Z constituted.
Therefore second group of sensing unit being constituted of first group of sensing unit being constituted of the first optical sensor unit 8 and the second optical sensor unit 10 and the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 can provide the output of first group of coordinate and the second group of coordinate and per second 30 width of cloth (Frame) of device 6 to be measured respectively; so first group of sensing unit and second group of sensing unit can provide the output of per second 60 width of cloth under home; when the environment deepening; the output of per second 30 width of cloth also can be provided, improve the correct location rate that band is surveyed device 6 by this.
In addition, because first group of sensing unit and second group of sensing unit can provide the output of per second 60 width of cloth, the sampling coordinate of device 6 promptly to be measured doubles, and therefore, optical positioning apparatus can directly calculate the acceleration of device 6 to be measured.Compare with existing skill, thereby can save the acceleration inductor.The 3rd optical sensor unit 22 and the 4th optical sensor unit 24 can be CMOS (Complementary Metal Oxide Semiconductor) image sensor or charge coupling device image sensor.
Control module 12 is provided with phase-locked loop unit 26, frequency generation unit 28, changes serial unit 30 and buffer cell 32 side by side.Phase-locked loop unit 26 connects the first optical sensor unit 8, the second optical sensor unit 10, the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 respectively, in order to activate the first optical sensor unit 8 and the second optical sensor unit 10 and the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 in regular turn.
Frequency generation unit 28 connects the first optical sensor unit 8, the second optical sensor unit 10, the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 respectively, in order to frequency of operation to be provided.Change serial unit 30 side by side and connect the first optical sensor unit 8, the second optical sensor unit 10, the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 respectively, in order to receiving the data that the data sent in the first optical sensor unit 8 and the second optical sensor unit 10 and the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 send in regular turn, and these data are sent to processing unit 14.
Buffer cell 32 connects changes serial unit 30 side by side, change the data that serial unit 30 is received side by side in order to temporary transient storage, make commentaries on classics serial unit 30 arranged side by side can be once the data of the first optical sensor unit 8, the second optical sensor unit 10, the 3rd optical sensor unit 22 and the 4th optical sensor unit 24 be sent to processing unit 14.Control module 12 is field programmable gate array (FPGA).
See also Figure 10, the flow chart of steps of optical positioning method of the present invention comprises:
At first, the first optical sensor unit 8 and the second optical sensor unit 10 are set, make it on the first axial X, be separated with one first distance D f to each other;
Secondly, a means for correcting 4 is set, makes means for correcting 4 between the coordinate on the second axial Z, be separated with a second distance Dz in the coordinate on the second axial Z and the first optical sensor unit 8 and the second optical sensor unit 10;
Afterwards, the first optical sensor unit 8 and the second optical sensor unit 10 are responded to means for correcting 4 respectively, to obtain first image 16;
Moreover, make the ratio of processing unit 14 calculation correction devices, 4 physical sizes and first image 16;
Afterwards, first optical sensor 8 and second optical sensor 10 are responded to device 6 to be measured respectively, to produce second image 18 and the 3rd image respectively;
Then, processing unit 14 calculates first coordinate and to be measured device 6 second coordinate in three image of device 6 to be measured in second image 18;
Afterwards, processing unit 14 calculating ratios, second distance Dz and first coordinate are to obtain the first angle theta l that the device 6 to be measured and the first optical sensor unit 8 are constituted; Processing unit 14 calculating ratios, second distance Dz and second coordinate are to obtain the second angle theta r that the device 6 to be measured and the second optical sensor unit 10 are constituted; One of the two of processing unit 14 calculating ratios, second distance Dz and first coordinate and second coordinate is to obtain the 3rd angle theta that the device 6 to be measured and the second axial Z are constituted;
Come, processing unit 14 calculates the first distance D f, the first angle theta l and the second angle theta r, to obtain the second axial Z coordinate of device 6 to be measured again;
Then, processing unit 14 calculates the first distance D f, the first angle theta l or the second angle theta r, to obtain the first axial X coordinate of device 6 to be measured; And
At last, use the second axial Z coordinate of processing unit 14 calculating the 3rd angle theta and device to be measured 6, to obtain the 3rd axial Y coordinate of device 6 to be measured.Mat above-mentioned steps and obtain the first axial X, the second axial Z of device 6 to be measured and the coordinate of the 3rd axial Y respectively.
By after the above-mentioned explanation as can be known, be separated with the first optical sensor unit 8 and the second optical sensor unit 10 of one first distance D f between optical positioning apparatus of the present invention and optical positioning method utilization, after means for correcting 4 corrections, and use principle of parallax, calculate in device to be measured 6 spaces three axial coordinates, therefore, optical positioning apparatus of the present invention is provided with simply, uses easily.In addition, this optical positioning apparatus can use first group of sensing unit and second group of sensing unit so that the speed of per second 60 width of cloth to be provided simultaneously, thereby can save the acceleration inductor, directly calculate the acceleration of device 6 to be measured, and in relatively poor environment, also can provide the speed of per second 30 width of cloth at least, to improve correct localization.