1. Field of the Invention
The present invention relates to the technical field of image processing and, more particularly, to a method and apparatus for dynamically searching a moving vector of an image stream.
2. Description of Related Art
A typical optical mouse applies first a light-emitting diode (LED) to illuminate a mouse pad corresponding to the mouse or other object in order to obtain an image via an image sensor, and then the image sensor captures another image on the mouse pad, thus a moving vector of the optical mouse is found by comparing the two images. The moving vector is the moved distance of the mouse between two sampling points. As shown in
When the optical mouse is moved to the left upper corner, an image captured by the image sensor is moved to the right lower corner as shown in
The object of the invention is to provide a method and apparatus for dynamically searching a moving vector of an image stream, which eliminates search and comparison on an entire frame in the prior art and thus avoids significant computation time and energy waste, thereby effectively reducing power consumption and achieving the purpose of saving power.
In accordance with one aspect of the present invention, there is provided a method for dynamically searching a moving vector of an image stream. The method includes the steps: (A) capturing an image for determining a target area in the image; (B) capturing a new image at a next sampling time for comparing the new image with the target area in the image and thus finding a matched area in the new area in order to determine a moving vector and offset in the image stream; and (C) capturing another next image at another next sampling time for determining an estimated area in the next image in accordance with the moving vector and further updating the moving vector and offset in the image stream in accordance with a matched part found in the estimated area as compared with the target area.
In accordance with another aspect of the invention, there is provided an apparatus for dynamically searching a moving vector of an optical mouse. The apparatus includes an image sensor, a memory unit, and an image and moving vector processor. The image sensor extracts images. The memory unit stores the images captured by the image sensor. The processor is connected to the memory unit. When the image sensor captures a first image and stores it in the memory unit, the processor determines a target area in the first image. When the image sensor captures a second image and stores it in the memory unit, the processor compares the target area with the second image to accordingly find a matched area in the second image and determine a moving vector and offset in the image stream. When the image sensor captures a third image and stores it in the memory unit, the processor determines an estimated area in the third image in accordance with the moving vector and further updates the moving vector and offset in the image stream in accordance with matched part found in the estimated area as compared with the target area.
Other objects, advantages, and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
When the optical mouse moves to the left upper corner, an image captured by the image sensor 110 moves to the right lower corner, as shown in
As shown in
In step S204, the image sensor 110 captures a new image (time t1) as the optical mouse moves. At this point, the first image in the captured image memory 120 is stored in the reference image memory 130 while the new image is stored in the captured image memory 120. Such an arrangement of storage is convenient for a following image comparison.
In step S205, the image and moving vector processor 140 compares the target area E″ in the previous (first) image with the current (new) image B in order to find the same area or a matched area in the current image B, thereby determining the optical mouse's moving vector and offset and further storing the moving vector in the dynamic estimation shift register 150 (step S206). The aforementioned comparison can be performed by a second order momentum method, a mean squared error (MSE), or the like.
Next, in step S207, the image sensor 110 captures another new image at time t2. At this point, the previous (new) image in the captured image memory 120 is stored in the reference image memory 130 while the current (another new) image is stored in the captured image memory 120. In accordance with the moving vector in the dynamic estimation shift register 150 and the range of target area in the comparison range register 160, the image and moving vector processor 140 estimates that the range of target area is located in area E′ at time t2. Accordingly, in step S208, a current sub-area P′ is captured as an estimated area from the captured image memory 120 and the range of the sub-area P′ is greater than or equal to the range of target area E′. Next, in the step S209, the estimated area P′ is compared to the target area E in the reference image memory 130 in order to find the same area or a matched area in the estimated area P′ and accordingly update the optical mouse's moving vector and offset. Next, in the step S210, the moving vector updated is stored in the dynamic estimation shift register 150. The aforementioned comparison can be performed by a second order momentum method, a mean squared error (MSE), or the like.
If the same area as E cannot be found in the estimated area P′, it represents that the moving vector in the dynamic estimation shift register 150 is not correct. As such, a corresponding triangle C′ to triangle C included in the previous image's target area E is not found in current image's estimated area P′. This may be a situation as shown in
In view of the foregoing, it is known that the invention can dynamically estimate the optical mouse's moving vector through the dynamic estimation shift register and the comparison range register, and perform dynamic search by adjusting the selected location for the reference image and next image comparison range in accordance with the moving vector dynamically estimated. Therefore, since searching the entire frame of a captured image is not necessary, the computation amount is relatively reduced to thus avoid wasting computation time and energy incurred in the prior art. Further, power consumption in the chip is effectively reduced and the purpose of saving power is achieved.
Although the present invention has been explained in relation to its preferred embodiment, it is to be understood that many other possible modifications and variations can be made without departing from the spirit and scope of the invention as hereinafter claimed.
Number | Date | Country | Kind |
---|---|---|---|
092128523 | Oct 2003 | TW | national |