Optical input apparatus and control method
Technical field
The present invention relates to a kind of input equipment and control method, particularly relate to a kind of in the non-optical input apparatus and the control method that can stop to export motion vector when being in operating surface.
Background technology
Consult Fig. 1, mouse is the computer entry device that the user the most often uses, and existing optical mouse 9 has a housing 90, a light source 91, lens 92, an image sensor 93 and a processing unit 94.
Optical mouse 9 is to utilize the physical construction of image sensor 93 and processing unit 94 replacement idler wheel mouses on hardware, and the product of the integrated optical mouse control chip of image sensor 93 and processing unit 94 is also arranged at present; The operating principle of optical mouse 9 is: light source 91 emits beam; On an operating surface 8, be reflected; And reflected light passes lens 92; In addition capture of the image sensor processed by semi-conductor chip 93, each capture are about hundreds of frames (frame)/more than the per second, and deliver to processing unit 94 and carry out the computing of motion vector.
Processing unit 94 is for the account form of motion vector; Mainly be to obtain two images according to sequential; From first image, select earlier a target area (Region of Interest; Abbreviation ROI) pattern; After finding pattern identical in second image again, judge that then pattern in the target area of first image is to calculate a motion vector again after moving to which position of second image with the target area, the account form of motion vector can use correlativity (correlation) estimation method judge in first with second image on the pattern change in location obtain motion vector.
But about disclosed contents of related patent U.S. Patent No. technology such as No. the 5644139th, aforementioned correlativity estimation method reference example such as United States Patent (USP)s; Perhaps also have other selection scheme, for example block relative method (block match method) can (for example mean square deviation MSE (meansquared error) or absolute value method of average MAD (mean absolute difference) try to achieve motion vector according to comparison function.
Because optical mouse 9 general only meetings operated at surface level; Therefore; 94 of the processing units of optical mouse 9 can carry out X, and the computing of the motion vector of Y direction (being on the surface level) can not change the judgement of whether carrying out away from operating surface 8 based on the ratio of the certain patterns of image.
Summary of the invention
Be in the instantaneous of operating surface because optical input apparatus is non-; The certain patterns of the image that detects changes the generation ratio; Therefore; The ratio that the object of the present invention is to provide a kind of certain patterns of utilizing detecting image to produce changes and is judged as the non-operating surface that is in, and when being in operating surface, can stop to export the optical input apparatus and the control method of motion vector non-.
In the control method of optical input apparatus of the present invention, this optical input apparatus moves and the image of this operating surface of every certain interval of time acquisition at an operating surface; Said method comprises the steps: that (a) complies with the acquisition time order and function and receive one with reference to an image and a present image, and utilization calculates a motion vector with reference to the change in location of a certain patterns of image and present image; (b) calculating is with reference to the geometric center of the certain patterns of image and the geometric center of the certain patterns of present image; (c) if identical with the geometric center of the certain patterns of present image, calculate this certain patterns in ratio with reference to image and present image with reference to image; (d) judge whether this ratio remains unchanged, if constant rate, export this motion vector,, do not export motion vector or be failure to actuate if ratio changes.
Preferable, step (b) is according to orienting several unique points of outermost with reference to the certain patterns of image and the certain patterns of image at present and calculating the geometric center of said unique point.
Preferable, step (c) be according to reference to this certain patterns of distance ratio decision of the certain patterns of image and each unique point of certain patterns to the geometric center position of image at present with reference to the image and the ratio of image at present.
Optical input apparatus of the present invention is used for moving at an operating surface, and said optical input apparatus comprises an image sensing module, a processing module and a transport module.
The image of this operating surface of the every certain interval of time of this image sensing module acquisition and output according to the acquisition time order and function one with reference to an image and a present image.
This processing module comprises that one converts the analog image signal that this image sensing module captured the analog digital modular converter and a computing module of numerical data into; This computing module has a graphics processing unit, a displacement computing unit, an anti-error processing unit and an interface unit.
This graphics processing unit self-reference image is obtained a certain patterns with present image.
The change in location that the unit by using certain patterns is calculated in this displacement calculates a motion vector.
This anti-error processing unit calculates with reference to the geometric center of the certain patterns of image and the geometric center of the certain patterns of present image; If identical with the geometric center of the certain patterns of present image with reference to image, calculate this certain patterns with reference to the ratio of image with present image, reach and judge whether this ratio remains unchanged; If constant rate; Export this motion vector,, do not export motion vector or be failure to actuate if ratio changes.
This interface unit receives the motion vector that anti-error processing unit is exported, and according to the predetermined interface specification motion vector is converted into the interface specification data.
This transport module is with the interface specification data output of this processing module output.
Preferable, said anti-error processing unit is according to orienting several unique points of outermost with reference to the certain patterns of image and the certain patterns of image at present and calculating the geometric center of said unique point.
Preferable, said anti-error processing unit be according to reference to this certain patterns of distance ratio decision of the certain patterns of image and each unique point of certain patterns to the geometric center position of image at present with reference to the image and the ratio of image at present.
Preferable, said optical input apparatus is a pen type input equipment.
Beneficial effect of the present invention is: when the notion of optical mouse is applied to the pen type input equipment, whether be in operating surface by judging that the proportionate relationship of pattern is learnt in the image, if be not in operating surface then keep former output or be failure to actuate.
Description of drawings
Fig. 1 is a synoptic diagram, and existing optical mouse is described;
Fig. 2 is a unit calcspar, and the preferred embodiment of optical input apparatus of the present invention is described;
Fig. 3 is a synoptic diagram, explains that optical input apparatus contacts the certain patterns in the image that on operating surface, detects;
Fig. 4 is a synoptic diagram, and the vertical non-certain patterns that is in the image that detects on the operating surface of optical input apparatus is described;
Fig. 5 is a synoptic diagram, certain patterns according to the certain patterns of reference image as shown in Figure 3 and present image as shown in Figure 4 is described under the identical situation of geometric center, and each unique point is to the distance of geometric center position;
Fig. 6 is a process flow diagram, and the preferred embodiment of the control method of optical input apparatus of the present invention is described.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is elaborated.
Fig. 2 is preferred embodiment of the present invention.
In the preferred embodiment of the present invention, said optical input apparatus 100 is pen type input equipments, comprises a tool 10, a light source module 11, an image sensing module 12, a power module 13, a processing module 2, a transport module 3 and a memory module 4.
Tool 10 inside are built and are put light source module 11, image sensing module 12, power module 13, processing module 2, transport module 3 and memory module 4, and are in order to move power module 13 each assembly required electric power of supply at an operating surface 6; Light source module 11 emits beam; On operating surface 6, be reflected, and reflected light passes lens (figure do not show) and supply with image sensing module 12 and receive, and deliver to processing module 2 and do computing; In order to receive image in a big way, the lens of present embodiment adopt the wide-angle eyeglass.
The image of the every certain interval of times acquisition of image sensing module 12 operating surfaces 6 and output according to time sequencing successively capture one with reference to the analog image signal of image and a present image to processing module 2; Processing module 2 comprises that an analog image signal with acquisition converts the analog digital modular converter 21 and a computing module 22 of digital signal into; Computing module 22 has a graphics processing unit 221, a displacement computing unit 222, one anti-error processing unit 223 and an interface unit 224, and each assembly operating principle introduction is following.
Consult Fig. 2 to Fig. 4, graphics processing unit 221 self-reference images 201 are obtained a certain patterns with present image 202, for example: binary conversion treatment.
Displacement computing unit 222 utilizes the change in location of certain patterns to calculate a motion vector and it is temporary in memory module 4; Calculating about motion vector; For example: the block relative method of the certain patterns of target area capable of using; Obtaining certain patterns 41 (like Fig. 3) with reference to image 201, obtaining certain patterns 42 (like Fig. 4) at present image 202, yet; The block relative method of the certain patterns of target area only is a kind of way of illustration but not limitation of numerous Flame Image Process modes, and the motion vector account form of other similar certain patterns search also belongs to applicable category.
Anti-error processing unit 223 mainly utilizes the proportionate relationship decision of pattern whether to export motion vector, just during the constant rate of pattern, represents optical input apparatus 100 to be in operating surface 6 always; Belong to normal running, thus exportable motion vector, but when in a single day the ratio of pattern changes; Represent the non-operating surface 6 (comprise away from or approaching) that is in of optical input apparatus 100; Belong to abnormal operation, so do not export motion vector, its account form introduction is following.
At first, calculating is with reference to the geometric center (X of the certain patterns 41 of image 201
0, Y
0) with the present geometric center (X of the certain patterns 42 of image 202
0', Y
0'), account form is to orient several unique points of outermost and calculate the geometric center of said unique point according to certain patterns 41,42, for example: three characteristic point position (X that get certain patterns 41 outermost
1, Y
1), (X
2, Y
2), (X
3, Y
3) and three characteristic point position (X of the outermost of certain patterns 42
1', Y
1'), (X
2', Y
2'), (X
3', Y
3') and calculate the geometric center of said unique point, account form is following formula 1 and formula 2.
Formula 1
Formula 2
If the certain patterns 41 with reference to image 201 is identical with the geometric center of the certain patterns 42 of present image 202, shown in formula 3.
(X
0', Y
0')=(X
0, Y
0) formula 3
Just calculate certain patterns 41 with reference to image 201 and certain patterns 42 in the ratio of image 202 at present; Present embodiment is according to the ratio of certain patterns 41 with the distance ratio k judgement certain patterns 41,42 of each unique point to the geometric center position of certain patterns 42, shown in formula 4.
Formula 4
At last, carry out the judgement whether ratio remains unchanged, the numerical value after supposing to be divided by is 1, represents constant rate, just exports this motion vector, if ratio changes, the numerical value k after for example being divided by is not 1, does not just export motion vector or is failure to actuate.
Interface unit 224 receives the motion vector of being exported after anti-error processing unit 223 judgment processing; And according to the predetermined interface specification motion vector is converted into the interface specification data, the predetermined interface specification for example: PS/2 interface specification, usb compliant, wireless transmission interface specification or above combination in any produce the interface specification data.
Transport module 3 has one will comprise that the data processing of motion vector becomes the wire transmission unit 31 and of wire transmission signal will comprise that the data processing of motion vector becomes the wireless transmission unit 32 of wireless transmission signal; Wire transmission unit 31 can be that the wire transmission signal is done further processing for the main frame 51 of rear end with the interface specification data processing of interface unit 224 outputs; Wireless transmission unit 32 can be transmitted the wireless transmission signal; With the interface specification data processing of interface unit 224 outputs is the radio receiving unit 52 of wireless transmission signal to supply with long-range main frame 51, realizes wired or wireless input function.
Consult Fig. 6; And cooperation Fig. 2; Utilize aforementioned principles; The control method of optical input apparatus 100 of the present invention is carried out and comprised following step behind the image of the every certain interval of times acquisition of image sensing module 12 operating surfaces 6: the displacement computing unit 222 of processing module 2 receives one with reference to image and a present image (step 501) and utilize the change in location with reference to the certain patterns of image and present image to calculate motion vector (step 502); Then; Anti-error processing unit 223 calculates with reference to the geometric center of the certain patterns of image and the geometric center (step 503) of the certain patterns of image at present, judge with reference to the geometric center of image and the certain patterns of present image whether identical (step 504)? If 504 are judged as not, export this motion vector (step 507); If it is identical; Calculate this certain patterns with reference to the image and the present ratio (step 505) of image, judge this ratio remain unchanged (step 506)? If constant rate is exported this motion vector (step 507); If ratio changes, do not export motion vector or be failure to actuate (step 508).
In sum; The effect of optical input apparatus 100 of the present invention and control method is: when the notion of optical mouse is applied to the pen type input equipment; Learn by the proportionate relationship of judging pattern whether non-ly to be in operating surface 6, if the ratio of pattern is identical, representative still is in operating surface 6 and just exports motion vector; If the ratio of pattern changes; Represent the non-operating surface 6 that is in just to keep and do not export motion vector or be failure to actuate, very helpful to the continuity of writing or drawing, so can reach the object of the invention really.