Summary of the invention
The displacement estimating apparatus that the object of this invention is to provide a kind of displacement estimating and measuring method and use the method, it can dynamically adjust quality threshold according to the sampling parameters of image sensor, to reduce the possibility of output error displacement.
Another object of the present invention is to provide a kind of displacement estimating and measuring method and uses the displacement estimating apparatus of the method, and it can dynamically adjust quality threshold according to the noise level of image sensor captured images frame, to increase the degree of accuracy of estimation displacement.
For achieving the above object, the present invention proposes a kind of displacement estimating and measuring method, comprises the following step: according to sampling parameters, catch picture frame and determine default noise level; Calculate the mass parameter of this picture frame; According to this default noise level, determine quality threshold; And relatively this mass parameter and this quality threshold to determine whether this picture frame of aftertreatment.
In one embodiment, this default noise level can obtain according to theoretical derivation of this sampling parameters, or according to the caught picture frame that does not comprise working surface image, for example, comprises the picture frame of the image of equally distributed light source, and reality measures and obtains.
The present invention also proposes a kind of displacement estimating and measuring method, comprises the following step: according to sampling parameters, catch picture frame and definite quality threshold; Calculate the mass parameter of this picture frame; And relatively this mass parameter and this quality threshold to determine whether according to this picture frame estimation displacement and/or to determine whether that output is according to this displacement of this picture frame estimation.
In one embodiment, displacement estimating and measuring method of the present invention also comprises the following step: the mean flow rate that judges this picture frame whether in preset range to determine whether to adjust this sampling parameters.
The present invention also proposes a kind of displacement estimating apparatus, comprises image sensing unit, according to sampling parameters, catches and output map picture frame; And processing unit, control this image sensing unit and catch this picture frame according to this sampling parameters, according to this sampling parameters, determine quality threshold, calculate the mass parameter of this picture frame and relatively this mass parameter and this quality threshold.
In displacement estimating and measuring method of the present invention and displacement estimating apparatus, the brightness of the time shutter that this sampling parameters is image sensor, the yield value of amplifier and/or light source.
The present invention dynamically adjusts this default noise level or quality threshold according to different sampling parameters, can increase the degree of accuracy of accepting or rejecting picture frame, to reduce error count, calculate the possibility of displacement, wherein the relation of this default noise level or this quality threshold and this sampling parameters can be created as look-up table or graph of a relation is pre-stored within this processing unit.
Accompanying drawing explanation
Fig. 1 is the calcspar of the displacement estimating apparatus of the embodiment of the present invention.
Fig. 2 shows in the displacement estimating and measuring method of the embodiment of the present invention, the schematic diagram that quality threshold is adjusted with noise level.
Fig. 3 shows in the displacement estimating and measuring method of the embodiment of the present invention, another schematic diagram that quality threshold is adjusted with noise level.
Fig. 4 is the process flow diagram of the displacement estimating and measuring method of the embodiment of the present invention.
Fig. 5 shows in the displacement estimating and measuring method of the embodiment of the present invention, a kind of schematic diagram of mass parameter.
Main element symbol description
1 displacement estimating apparatus 10 image sensing unit
11 light source 12 image sensors
13 analog digital converting unit 14 analogue amplifiers
14 ' digital amplifier, 15 processing units
16 light element S working surfaces
T
1, t
2time interval Th, Th
1, Th
2quality threshold
NL noise level U
1, U
2, U
3upper crest
D
1, D
2, D
3lower crest S
1~S
5step
Embodiment
For allow above and other object of the present invention, feature and advantage can be more obvious, below will coordinate appended diagram, be described in detail below.In addition, in each diagram of the present invention, only shown part member and omitted the member not directly related with the present invention's explanation.
Please refer to shown in Fig. 1, it shows the displacement estimating apparatus of the embodiment of the present invention.Displacement estimating apparatus 1 is for example optical mouse, can be positioned over working surface S to estimate the displacement with respect to this working surface S, and wherein this working surface S can be any suitable surface, such as desktop, mouse pad surface or paper etc.Displacement estimating apparatus 1 comprises image sensing unit 10 and processing unit 15.Catch and output map picture frame (image frame) according to sampling parameters (sampling parameter) this image sensing unit 10; This processing unit 15 is controlled this image sensing unit 10 and according to this sampling parameters, is caught the picture frame of this working surface S, according to this sampling parameters, determine default noise level or quality threshold, calculate the mass parameter of this picture frame and relatively this mass parameter and this quality threshold are to determine whether this picture frame of aftertreatment (post-process), described aftertreatment is for example calculated this displacement estimating apparatus 1 with respect to the displacement of this working surface S and/or determines whether that output is according to the displacement of this picture frame estimation according to this picture frame.In the present invention, mass parameter can be the various parameters of the quality of presentation graphs picture frame.
Image sensing unit 10 comprise light source 11, image sensor 12, analog-digital converter (ADC) 13, analogue amplifier 14 and/or digital amplifier 14 '.When initial, this light source 11 is so that brightness this working surface S required light when providing this image sensor 12 to catch picture frame that throws light on to be provided, and it can be light emitting diode, laser diode or other suitable light sources.This image sensor 12 receives reflected light from this working surface S to form simulation drawing picture frame to preset the time shutter (exposure time), and it can be ccd image sensor, cmos image sensor or other suitable sensors.This analogue amplifier 14 amplifies the picture signal of the simulation drawing picture frame that this image sensor 12 exported to preset analog gain (gain); In the present embodiment, this analogue amplifier 14 can be implemented maybe will not implement.This analog-digital converter 13 is in order to be converted to digital image frames by simulation drawing picture frame.This digital amplifier 14 ' amplify with preset number gain picture signal of the digital image frames that this analog-digital converter 13 exported; This digital amplifier 14 in the present embodiment ' can implement maybe will not implement.Therefore, the sampling parameters of this image sensing unit 10 is such as being this time shutter, this brightness and/or this gain etc., but the present invention is not limited to this.In addition, this image sensing unit 10 also can comprise light element 16 in order to the reflected light from this working surface S is guided to this image sensor 12.
Then, it is luminous with a brightness that this processing unit 15 is controlled this light source 11 automatically according to received digital image frames, control this image sensor 12 and catch picture frame with a time shutter, and control this analogue amplifier 14 or this digital amplifier 14 ' with a gain enlarged drawing picture frame.The mean flow rate of this processing unit 15 judgement digital image frames that receive whether in preset range to determine sampling parameters, if for example the mean flow rate scope of digital image frames is 0~255,, when the mean flow rate of current picture frame is in 108~148 time, this processing unit 15 is not adjusted sampling parameters; When the mean flow rate of current picture frame is beyond 108~148, this processing unit 15 is adjusted sampling parameters so that next the mean flow rate of these image sensor 12 captured images frames can be in preset range.Be understandable that, the numerical value of above-mentioned preset range is only exemplary, not in order to limit the present invention.
Yet when sampling parameters is adjusted, the noise level of picture frame (NL) also can be along with change; In the present invention, noise level is the characteristic index of presentation video quality.
Please refer to Fig. 2 and Fig. 3, the situation that in the displacement estimating and measuring method of its demonstration embodiment of the present invention, noise level changes.The mean flow rate of the picture frame for example receiving when this processing unit 15, can be at time interval t during lower than preset range
1first increase the brightness of this light source 11 or the time shutter of this image sensor 12; When these sampling parameters increase gradually, in the mean flow rate of the picture frame that this processing unit 15 receives, noise level NL also increases simultaneously, as shown in Figures 2 and 3.Suppose that this processing unit 15 cannot be only by adjusting the luminosity of light source 11 and the time shutter of image sensor 12 so that the mean flow rate of picture frame reaches in preset range, therefore at the 2nd time interval t
2control these amplifiers 14 or 14 ' gain; Similarly, now the noise level NL in picture frame also increases simultaneously.
The present invention is by dynamically adjusting quality threshold to reduce the possibility of output error displacement; That is, the mass parameter of judging the picture frame receiving when this processing unit 15 during lower than quality threshold, is judged that this picture frame is as unavailable (unusable) picture frame, thereby is ignored this picture frame; Otherwise, the mass parameter of judging the picture frame receiving when this processing unit 15 is during higher than quality threshold, judge that this picture frame is as available (usable) picture frame, thereby this picture frame of aftertreatment, for example utilize this picture frame displacement calculating amount, wherein mass parameter and quality threshold will illustrate in the back.Be understandable that, the above-mentioned explanation when mass parameter this picture frame of aftertreatment during higher than quality threshold is not in order to limit the present invention; That is, after suitable numerical value is processed, may be for when mass parameter this picture frame of aftertreatment during lower than quality threshold.
In Fig. 2, quality threshold Th is set as multiple or the side-play amount (offset) of noise level; In Fig. 3, be set as presetting corresponding quality threshold Th1 and Th2 according to adjusted sampling parameters, for example can be in advance sampling parameters and default noise level or mass value threshold value be set up to look-up table or graph of a relation, so that this processing unit 15 is determined default noise level and quality threshold according to sampling parameters at that time.In addition, noise level can be derived and obtain with theory in advance according to different sampling parameters, or utilize this image sensor 12 under different sampling parameters, to catch the picture frame of the image that does not comprise this working surface S, and for example comprise the picture frame of the image of equally distributed light source, to survey, try to achieve.Be understandable that time interval t shown in Fig. 2 and Fig. 3
1and t
2middle adjusted sampling parameters is only exemplary, this processing unit 15 can other orders or combination adjust respectively or simultaneously different sampling parameters.
Please refer to shown in Fig. 4, the process flow diagram that it shows the displacement estimating and measuring method of the embodiment of the present invention, comprises the following step: according to sampling parameters, catch picture frame and determine default noise level (step S
1); Calculate mass parameter (the step S of this picture frame
2); According to this default noise level, determine quality threshold (step S
3); Relatively this mass parameter and this quality threshold are to determine whether this picture frame of aftertreatment (step S
4); And the mean flow rate that judges this picture frame whether in preset range to determine whether to adjust this sampling parameters (step S
5).
Except the aforementioned embodiment about displacement estimating and measuring method of the present invention, below also propose a kind of embodiment of picture quality, but this embodiment is only in order to the present invention to be described, not in order to limit the present invention.
Please refer to shown in Fig. 5 a kind of schematic diagram of image quality parameter in the displacement estimating and measuring method of its demonstration embodiment of the present invention.The GTG value that characteristics of image changes the one dimension pixel that for example can be these image sensing unit 10 captured images frames changes; And this mass parameter for example can be set as the peak value number that the GTG value of this one dimension pixel changes.For example, suppose that in row or one-row pixels of picture frame, the GTG value of pixel both sides pixel is lower than this pixel to a certain degree time, this pixel is upper crest; The GTG value of pixel both sides pixel is higher than this pixel to a certain degree time, and this pixel is lower crest; For example in Fig. 5, comprise three upper crest U
1~U
3and three lower crest D
1~D
3.Picture quality is such as can be upper crest number, lower crest number and/or upper and lower crest total number etc., and for example now crest adds up to 6.In the picture frame that catch this image sensing unit 10, crest number is higher represents that the changing features of captured images frame is more obvious, more easily becomes available frame; Therefore, can determine by different crest sums the quality of picture frame.In addition, the picture quality described in the present invention also can be other characteristic parameters of presentation video quality, is not limited to shown in Fig. 5.Detailed embodiment about above-mentioned mass parameter for example can be with reference to the United States Patent (USP) of being owned together by this case applicant the 7th, and 142, No. 695,7,444, No. 006 and the 7th, 116, No. 801.In addition, also can be with reference to disclosed paper, as Y.S.Chen and F.C.Meng, " Image quality measurement based on statistics of activity regions, " Journal of the Chinese Institute of Engineers, Vol.24, No.3, pp.379-388 (2001), or M.T.Postek N.Zhang, A.E.Vladar and B.Larrabee, " A kurtosis-based statistical measure for two-dimensional processes and its application to image sharpness, " Proceedings of Section of Physical and Engineering Sciences of American Statistical Society, pp.4730-4736, 2003.
Referring to Fig. 4 and Fig. 5, below take crest sum presentation video mass parameter as example illustrates displacement estimating and measuring method of the present invention.First, this processing unit 15 is controlled this image sensing unit 10 and is caught picture frame and determine default noise level according to sampling parameters with sampling parameters (time shutter, light-source brightness and/or gain amplifier), and now this default noise level is for example default crest sum 5 (step S
1); Then, this processing unit 15 calculates the mass parameter of this picture frame, calculates crest sum (the step S of this picture frame
2); Then, this processing unit 15 is determined quality threshold according to this default noise level, and for example this quality threshold can be set as multiple or the side-play amount of default crest total number, and for example 2 times is 10 or to add 3 be 8 (step S
3); Then, this processing unit 15 relatively this mass parameter and this quality threshold to determine whether this picture frame of aftertreatment (step S
4), when this mass parameter is greater than this quality threshold, this picture frame of aftertreatment; And when this mass parameter is less than this quality threshold, ignore this picture frame.In another embodiment, when the comparative result of this mass parameter and this quality threshold shows that this picture frame is available image frames, this picture frame of aftertreatment; And when the comparative result of this mass parameter and this quality threshold shows that this picture frame is unavailable picture frame, ignore this picture frame.
Finally, the mean flow rate that this processing unit 15 judges this picture frame whether in preset range to determine whether to adjust this sampling parameters, for example, when the mean flow rate of this picture frame is during in preset range, this processing unit 15 is controlled these image sensing unit 10 and when catching next picture frame, is maintained this sampling parameters; And when the mean flow rate of this picture frame is not during in this preset range, this processing unit 15 is controlled these image sensing unit 10 and catch image (step S with new sampling parameters when being caught next picture frame
5).
In addition, in being stored in this processing unit 15 for being related to of sampling parameters and quality threshold time, the process flow diagram of the displacement estimating and measuring method of the embodiment of the present invention comprises the following step: according to sampling parameters, catch picture frame and definite quality threshold; Calculate the mass parameter of this picture frame; And relatively this mass parameter and this quality threshold to determine whether according to this picture frame estimation displacement or to determine whether to export this displacement.
In sum, because known displacement estimating and measuring method system determines the quality of captured images frame according to fixed threshold, still there is the problem of possibility output error displacement.The present invention is another to be proposed a kind ofly can dynamically adjust according to default noise level or sampling parameters the displacement estimating and measuring method of quality threshold, according to the sampling parameters of setting up in advance and the relation of default noise level or quality threshold, adjust quality threshold, can effectively promote the degree of accuracy of displacement calculation.
Although the present invention discloses with previous embodiment, so it is not in order to limit the present invention, and any the technical staff in the technical field of the invention can make various changes and modification without departing from the spirit and scope of the present invention.Therefore protection scope of the present invention should be as the criterion with claims limited range.