Abstract:
A method for operating an optical sensing device having a light source and a photodetector device with at least one photosensitive element, said method comprising the steps of: (i) illuminating a surface portion with radiation by means of said light source; (ii) detecting radiation reflected from the illuminated surface portion with said at least one photosensitive element; (iii)while said surface portion is being illuminated, integrating an output signal of said at least one photosensitive element over time; (iv)comparing the output signal integration level with a first integration reference level during integration; (v) interrupting said integration step (iii) if said output signal integration level has reached said first integration reference level, or getting back to comparison step (iv) until a first integration period has elapsed if said output signal integration level has not reached said first integration reference level, and wherein said method further comprises the steps of: (vi) comparing said output signal integration level with a second integration reference level smaller than said first integration reference level, after said first integration period has elapsed; (vii) interrupting said integration step (iii), if said output signal integration level has reached at least said second integration reference level.

Description:
FIELD OF THE INVENTION  
       [0001]     The present invention generally relates to optical sensing devices comprising a light source for illuminating a surface portion with radiation, a photodetector device having at least one photosensitive element responsive to radiation reflected from the illuminated surface portion and conversion means (or integrating means) for integrating an output signal of the said at least one photosensitive element over time during an integration period. Such optical sensing devices are particularly used in optical pointing devices such as mice, trackballs and other similar computer peripherals. The present invention also concerns a method for operating the above optical sensing device as well as an optical pointing device equipped with the above constituent parts of the optical sensing device.  
       BACKGROUND OF THE INVENTION  
       [0002]     In order to extract motion-related information, a so-called “Edge Motion Detection” technique serves as a basis. This “Edge Motion Detection” technique essentially consists in a determination of the movement of edges (i.e. a difference between the intensity of pairs of pixels) in the image detected by the photodetector array. Edges are defined as spatial intensity differences between two pixels of the photodetector array. The relative motion of each of these edges is tracked and measured so as to determine an overall displacement measurement which is representative of the relative movement between the photodetector array and the illuminated portion of the surface.  
         [0003]     In optical sensing devices, it is commonly known to couple a conversion circuit (or integration circuit) to each photosensitive element of the photodetector device so as to integrate the output signals of these photosensitive elements over time during a so-called integration period.  FIG. 1  schematically shows the general principle of an integrating circuit, designated by reference numeral  1100 , coupled to a photosensitive element, in this case a photodiode, designated by reference numeral  1000 . This integrating circuit  1100  typically consists of an amplifier  1110  and a capacitive element  1120  (or integration capacitor) connected between the output and the inverting input of the amplifier, the photosensitive element  1000  being connected to the inverting input of the amplifier while the non-inverting input of the amplifier is tied to a reference potential such as ground. The integrating circuit  1100  outputs a voltage signal Vout, or integrated signal, which varies over time and which is in essence the result of the integration over time of the current signal iout produced by the photosensitive element  1000 . Assuming that current iout has a substantially constant value during the period where integrating circuit is active (i.e. during the so-called integration period), the output voltage Vout will vary substantially linearly over time. In some cases, the integration period is set to have a fixed duration. In some other cases, however, the duration of the integration period may be variable.  
         [0004]     Such optical pointing devices are already known in the art. U.S. Pat. No. 6,963,059, filed in the name of the same Assignee and which is incorporated in its entirety herein by reference, for instance discloses a method, and system for optimizing illumination power and integration time in an optical sensing device.  
         [0005]      FIG. 2  illustrates the basic principle of U.S. Pat. No. 6,963,059. It basically consists of an optical sensing system comprising a light source  10  for illuminating a portion of a surface S with radiation, a photodetector device  20  having at least one photosensitive element responsive to radiation reflected from the illuminated surface portion S, conversion means  30 , coupled to the output of the photodetector device  20 , for integrating an output signal of the said at least one photosensitive element over time during an integration period of variable duration and a regulating system  40  for controlling the power of the light source as a function of the duration of the integration period. It should be stressed that the optical sensing system is designed, so that the integration period has a variable duration, designated Tint, which depends on the power of the light source  10  and the level of radiation reflected from the illuminated surface portion S. It will thus be appreciated that the optical sensing system of  FIG. 2  includes some sort of feedback loop for enslaving the power of the light source  10  as a function of the evolution of the integration. The regulating system  40  is used to control (i.e. adjust if necessary) the power of the light source so that the duration of the integration period remains, under normal conditions, in the vicinity of at least one reference duration value. As schematically illustrated in the example of  FIG. 2 , three reference values designated Tmin, Tmax and Ttimeout may be used.  
         [0006]     These optical pointing devices are more and more cordless devices, i.e. battery powered, and used on a wide variety of surfaces. Thus, for these optical pointing devices two very important features are surface coverage and tracking quality along with battery life. Darker surfaces require more light and thus a longer amount of integration time or a more powerful light source to recover the same amount of light energy as lighter surfaces. This longer integration time of the recovered light or this more powerful light source respectively causes the supported speed of motion to drop proportionally or the power consumption to increase proportionally. One way to optimize this behaviour is to stop the integration of light sooner on dark surfaces. Unfortunately this also decreases the signal to noise ratio (SNR) generally resulting in poorer tracking.  
       SUMMARY OF THE INVENTION  
       [0007]     One goal of the present invention is thus to implement an integration stop control algorithm in the way of a reliable method for operating an optical motion sensing device in order to optimize the trade-off between tracking speed (linked to the integration time) and tracking quality (linked to the signal to noise ratio) on light and dark surfaces. This allows a better signal to noise ratio on lighter surfaces and faster supported tracking speeds on darker surfaces.  
         [0008]     For that purpose, the invention concerns a method for operating an optical sensing device having a light source and a photodetector device with at least one photosensitive element, said method comprising the steps of:  
         [0009]     (i) illuminating a surface portion with radiation by means of said light source;  
         [0010]     (ii) detecting radiation reflected from the illuminated surface portion with said at least one photosensitive element;  
         [0011]     (iii) while said surface portion is being illuminated, integrating an output signal of said at least one photosensitive element over time;  
         [0012]     (iv) comparing the output signal integration level with a first integration reference level during integration;  
         [0013]     (v) interrupting said integration step (iii) if said output signal integration level has reached said first integration reference level, or getting back to comparison step  
         [0014]     (iv) until a first integration period has elapsed if said output signal integration level has not reached said first integration reference level, and wherein said method further comprises the steps of:  
         [0015]     (vi) comparing said output signal integration level with a second integration reference level smaller than said first integration reference level, after said first integration period has elapsed;  
         [0016]     (vii) interrupting said integration step (iii), if said output signal integration level has reached at least said second integration reference level; and  
         [0017]     This operating mode efficiently solves complicated trade-offs between tracking speed and tracking quality by optimizing signal to noise ratio (SNR) for a given speed requirement.  
         [0018]     Furthermore, other advantageous embodiments form the subject of the dependent claims. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0019]     Other aspects, features and advantages of the present invention will be apparent upon reading the following detailed description of non-limiting examples and embodiments made with reference to the accompanying drawings.  
         [0020]      FIGS. 1 and 2 , already described, are schematic illustrations of an optical motion sensing device according to the prior art;  
         [0021]      FIG. 3  is a schematic illustration of the integration level of one photosensitive element when reaching a first integration reference level;  
         [0022]      FIG. 4  is a schematic illustration of the integration level of one photosensitive element when reaching at least a second integration reference level;  
         [0023]      FIG. 5  is a schematic illustration of the integration level of one photosensitive element when reaching a second integration level after a predetermined integration time;  
         [0024]      FIG. 6  is a flow chart illustrating a method for controlling operation of an optical sensing device according to a first embodiment of the invention;  
         [0025]      FIG. 7  represents a flow chart illustrating a method for controlling operation of an optical sensing device according to a second embodiment of the invention;  
         [0026]      FIG. 8  represents a flow chart illustrating a method for controlling operation of an optical sensing device according to a third embodiment of the invention;  
         [0027]      FIG. 9  represents a flow chart illustrating a method for controlling operation of an optical sensing device according to a fourth embodiment of the invention;  
         [0028]      FIG. 10  represents a flow chart illustrating a method for controlling operation of an optical sensing device according to a fifth embodiment of the invention; 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0029]     The following description concerns a method for operating an optical sensing device having a light source and a photodetector device with at least one photosensitive element having a determined gain, will be explained by way of a non limiting examples in relation with FIGS.  3  to  10 .  
       First Embodiment  
       [0030]     According to a first embodiment, the control algorithm or method of operating of the optical sensing device allows an initial high integration stop voltage or first integration reference level (SFmaxHighLevel). This mode is enabled by a specific register wherein the first integration reference level to be reached, is stored and is maintained as long as the integration time, is sufficiently short to support the max required tracking speed defined by the maximum flashing rate. This insures that the signal to noise ratio is maximized as long as the max required tracking speed may be supported (see  FIG. 3 ).  
         [0031]     If, at a predetermined programmable time or a first integration period (HighSFmaxTime), which advantageously equals to the max integration time that still supports the max required tracking speed, the integration level (SFmax) of the output signal of the photosensitive element has not met the first integration reference level, then this first integration reference level is reduced immediately to a lower second integration reference level (SFmaxLevel&lt;SFmaxHighLevel), and preferably at least twice smaller than the first reference (SFmaxLevel=SFmaxHighLevel/2). Now, if at this point the output signal integration level (SFmax) has reached a level which is below SFmaxHighLevel and above SFmaxLevel, the integration will stop, allowing the sensor to achieve maximum signal to noise ratio within the framework of supporting the maximum required tracking speed (see  FIG. 4 ). In other words, the sensor allows “medium-bright” surfaces to maximize the pixels signal to noise ratio within the framework of maximum flash rate.  
         [0032]     If the current integration level is below the second integration reference level (SFmax&lt;SFmaxLevel), the integration will continue until this lower integration reference level (SFmaxLevel) is reached. This allows the sensor to achieve a minimal required signal to noise ratio, while the supported speed is lower (see  FIG. 5 ). Actually it is better to support a lower speed, but with a reasonable accuracy rather than supporting higher speed with an unacceptable accuracy. A timeout period may be provided to avoid “unlimited” integration time.  
         [0033]     Referring now to  FIG. 6 , it will be described in more detail the method for operating an optical sensing device according to this first embodiment.  FIG. 6  shows a flowchart of operations which could be undertaken during each flash (or illumination period or activation period) of the optical sensing device. This flowchart is applicable in particular to the optical sensing device of  FIG. 2 .  
         [0034]     Following the start of the flash, the first step S 1  of  FIG. 6  consists in activating the light source. Next, at step S 2 , integration of the output signal, i.e. integration level (SFmax), of the photodetector device starts as well as the timing operation of the duration of the integration period. For every flash, this integration is always made with consideration of the first integration reference level setting (SFmaxHighLevel) that may be stored in an associated register as already mentioned.  
         [0035]     At step S 3 , it is optionally but preferably monitored whether the duration of the integration that is timed Tint reaches the timeout value (Ttimeout). In the affirmative, the process continues directly at step S 7 . In the negative or if step S 3  is not implemented, the process continues at step S 4  where it is checked whether the duration that is timed Tint reaches a first integration period (HighSFmaxTime). In the negative at step S 4 , the process continues at step S 5  where it is checked whether the end of integration (E.O.I.) condition considering the first integration reference level has been detected (SFmax≧SFmaxHighLevel). If such end of integration condition is detected at step S 5  then the process continues to step S 7 , otherwise it returns to step S 3 . In the affirmative at step S 4 , the process continues at step S 6 , where the integration reference level is switched from the first integration reference level (SFmaxHighLevel) to the second integration reference level being smaller than the first integration reference level (SFmaxLevel&lt;SFmaxHighLevel). The value of this second integration reference level may be stored in another register. The process then continues at step S 5  where it is checked whether the end of integration (E.O.I.) condition considering now also the second integration reference level has been detected (SFmaxLevel&lt;SFmax&lt;SFmaxHighLevel). Similarly to step S 5 , if such end of integration condition is detected at step S 6  then the process continues to step S 7 , otherwise it returns to step S 3 . At step S 7 , integration and timing operations are interrupted and the light source is deactivated until the next activation or flash.  
         [0036]     It is to be noted that the flowchart of  FIG. 6  is of course purely illustrative and shall not be considered as being a limitation of the scope of the invention.  
         [0037]     Alternatively and advantageously to the first embodiment, additional features, that will be described hereinafter, may be implemented within the control algorithm or method of operating according to the invention.  
       Second Embodiment  
       [0038]     According to a second embodiment of the present invention described in relation with  FIG. 7 , one additional feature concerns the gain of the photosensitive elements or pixels of the photodetector device. In this particular mode of operation, the pixels are provided with a first gain value or high gain mode (HG) and a second gain value greater than the first one or super high gain mode (SHG). By default, a dedicated register may contain the first gain value (HG) and two other registers may be allocated to contain the first reference integration level (SFmaxHighLevel) and the second integration reference level (SFmaxLevel). For the operating method implementing this feature, the control algorithm switches the pixel gain to super high gain (SHG) for the next flash if the integration time exceeds a predetermined time (HighIntegTime 1 ) defined in a register which super high gain will reduce the integration time by a factor determined by the ratio between both gain values (for example 2) but in the meantime will decrease the signal to noise ratio. This has the effect of increasing tracking speed at the expense of some tracking quality.  
         [0039]     When this mode of operation is enabled the control algorithm steps S 1  and S 2  are performed, then steps coming after steps S 1  and S 2  and before step S 7  will differ from the steps of the first embodiment. As steps S 1 , S 2  and S 7  remain the same for the whole description as for the first embodiment, they will not be disclosed in detail again. After step S 2 , the algorithm will go through steps S 8  to S 15 , illustrated in  FIG. 7 . By default the gain value has been set to the first value (HG).  
         [0040]     At step S 8 , it is optionally but preferably monitored whether the duration of the integration that is timed Tint reaches the timeout value (Ttimeout). In the affirmative, the process continues directly at step S 7 . In the negative or if step S 8  is not implemented, the process continues at step S 9  where it is checked whether the duration that is timed Tint reaches a second determined integration period (HighIntegTime 1 ).  
         [0041]     In the negative at step S 9 , the process continues at step S 10  where it is checked whether the duration that is timed Tint reaches the first integration period shorter than the second one (HighSFmaxTime&lt;HighIntegTime 1 ). In the negative at step S 10 , the process continues at step S 11  where it is checked whether the end of integration (E.O.I.) condition considering the first integration reference level has been detected (SFmax≧SFmaxHighLevel). In the affirmative at step S 10 , the process continues at step S 13 , where the integration reference level is switched from the first integration reference level (SFmaxHighLevel) to the second integration reference level (SFmaxLevel&lt;SFmaxHighLevel). The process then continues at step S 11  where it is checked whether the end of integration (E.O.I.) condition considering now also the second integration reference level has been detected (SFmaxLevel&lt;SFmax&lt;SFmaxHighLevel).  
         [0042]     In the affirmative at step S 9 , the process continues at step S 12  where the pixel gain is set for the next flash to the second value SHG greater than HG, and preferably so that SHG&gt;2×HG. After step S 12 , the process continues to step S 13 , already described. The SHG pixel gain value will then be used for the next flash.  
         [0043]     Referring again to step S 11 , where it is checked whether the end of integration (E.O.I.) condition has been detected, considering either only the first integration reference level if directly coming from step S 10  (HighSFmaxLevel&lt;SFmax) or also the second integration reference level if coming from step S 13  (SFmaxLevel≦SFmax≦HighSFmaxLevel). If any of such end of integration condition is detected at step S 11  then the process continues to step S 14 , otherwise it returns to step S 8 . At step S 14 , it is checked whether the duration that is timed Tint reaches a third determined integration period LowIntegTime 1 &lt;HighlntegTime 1 , and defined in LowIntegTime 1  register. Advantageously, it is chosen so that: 
 
LowIntegTime1&lt;HighintegTime1 *HG/SHG;    (1) 
 
         [0044]     In the negative at step S 14 , the process continues at step S 15 , where the pixel gain is switched back from the second gain value SHG to the first gain value HG, the register value being adapted. The process then continues at step S 7 . Otherwise, in the affirmative at step S 14 , the process directly continues at step S 7 .  
         [0045]     For implementing this feature, there are registers that control the switching of the feature. Preferably, care is taken with the register settings to prevent oscillation on a flash by flash basis between SHG and HG by an adequate selection of integration time ratio and pixel gain ratio (see formula 1).  
         [0046]     The motivation behind this scheme is to enable a faster integration time (with SHG) on darker surfaces, where the integration time exceeds a value that is equivalent to some supported speed, on the account of lower signal to noise ratio and tracking quality. Since SHG shortens the integration time by 2 times if SHG=2*HG, LowIntegTime 1  has to be at least 2 times shorter than HighIntegTime 1 . Otherwise, the pixels gain will keep on switching from HG to SHG and back for each flash.  
       Third Embodiment  
       [0047]     According to a third embodiment of the invention, another additional feature concerns the use of three different integration reference levels. For this mode which is described in relation with  FIG. 8 , there are the two levels already described in relation with the first embodiment that is to say the high or first integration reference level (SFmaxHighLevel) and the second integration reference level (SFmaxLevel). When this operating mode is enabled the control algorithm will lower the SFmax target level (SFmaxLevel) to even a lower target stop level or third integration reference level (SFmaxLowLevel), which lower stop level is programmable, instead of enabling SHG as for the second embodiment. This also decreases the integration time at the expense of signal to noise ratio and dynamic range. By switching to SFmaxLowLevel, the integration time will be shortened on the account of a lower pixel signal levels, i.e. lower signal to noise ratio.  
         [0048]     When this mode of operation is enabled steps S 1  and S 2  are performed, then the steps coming after steps S 1  and S 2  and before step S 7  will only differ from the second embodiment in that steps S 16 , S 17  and S 18  respectively replace steps S 12 , S 13  and S 14 .  
         [0049]     Thus, in the affirmative at step S 9 , the process continues to step S 16  instead of step S 12 . At step S 16 , the integration reference level is set for the next flash to a lower and third integration reference level (SFmaxLowLevel) instead of the second integration reference level, and then the process continues at step S 17  still considering the integration reference level setting of the current flash that is to say either SFmaxLevel or SFmaxLowLevel according to the integration behaviour during the previous flash.  
         [0050]     In the affirmative at step S 10 , the process continues to step S 17  instead of step S 13 . At step S 17  it is checked whether the lower integration reference level has been set during a previous flash to either SFmaxLevel or SFmaxLowLevel. If, it has been set to SFmaxLevel, then at step S 11 , it is checked whether the end of integration (E.O.I.) condition has been detected considering the first and second integration reference levels (SFmaxLevel≦SFmax≦SFmaxHighLevel). Alternatively, if it has been set to SFmaxLowLevel, then at step S 11 , it is checked whether the end of integration (E.O.I.) condition has been detected considering the first and third integration reference levels (SFmaxLowLevel≦SFmax≦SFmaxHighLevel).  
         [0051]     At step S 14 , it is checked whether the duration that is timed Tint reaches a third determined integration period LowIntegTime 1 &lt;HighIntegTime 1 , and defined in LowIntegTime 1  register. Advantageously, it is chosen so that: 
 
LowIntegTime1&lt;HighIntegTime1 *SF maxLowLevel/ SF maxLevel;   (2) 
 
         [0052]     In the negative at step S 14 , the process continues at step S 18 , instead of step S 15 . At step  18 , the integration reference level is set back to the second integration reference level (SFmaxLevel), and then the process continues at step S 7 . Otherwise, in the affirmative at step S 14 , the process directly continues at step S 7 .  
         [0053]     For implementing this feature, there are registers that control the switching of the feature. Preferably, care is taken with the register settings to prevent oscillation on a flash by flash basis between SFmaxLevel and SFmaxLowLevel by an adequate selection of integration time ratio and integration reference level ratio (see formula 2).  
         [0054]     Since SFmaxLowLevel lowers the integration level to be reached by 2 if SFmaxLevel=2*SFmaxLowLevel, LowIntegTime 1  has to be at least 2 times shorter than HighIntegTime 1 . Otherwise, the integration reference level will keep on switching from SFmaxLevel to SFmaxLowLevel and back for each flash.  
       Fourth Embodiment  
       [0055]     According to a fourth embodiment of the invention, the operating mode allows a combination of the second and third embodiments described above. This fourth embodiment will be described in relation with  FIG. 9 . When this mode is enabled, there are three different integration reference levels with SFmaxHighLevel&gt;SFmaxLevel&gt;SFmaxLowLevel and two different gain values HighGain (HG) and SuperHighGain (SHG), with HG&lt;SHG.  
         [0056]     In this mode, the algorithm will first increase the pixel gain value from HG to SHG on a next flash, when the integration time exceeds a first programmed value. Then, if the integration time still exceeds another programmed value the SFMax target level is reduced as well from SFmaxLevel to SFmaxLowLevel. This allows the optical pointing device to maintain two different tracking speed points with the tracking quality possibly being reduced at each step. Again care must be used when setting the control registers to prevent unwanted flash to flash oscillations.  
         [0057]     Practically, when this operating mode is enabled, steps S 1  and S 2  are performed and then the steps coming after steps S 1  and S 2  and before step S 7  differ.  
         [0058]     At step S 19 , it is optionally but preferably monitored whether the duration of the integration that is timed Tint reaches the timeout value (Ttimeout). In the affirmative, the process continues directly at step S 7 . In the negative or if step S 19  is not implemented, the process continues at step S 20  where it is checked whether the duration that is timed Tint reaches a fourth determined integration period HighIntegTime 2 &gt;HighIntegTime 1 . By selecting HighIntegTime 2 &gt;HighIntegTime 1 , one selects two points of integration time (equivalent to two points of supported speed), where the sensor switch in features that decrease the integration time on the account of signal to noise ratio and tracking quality.  
         [0059]     In the negative at step S 20 , the process continues at step S 21 , where it is checked whether the duration that is timed Tint reaches the second determined integration period (HighIntegTime 1 ). In the negative at step S 21 , the process continues at step S 22  where it is checked whether the duration that is timed Tint reaches the first integration period (HighSFmaxTime&lt;HighIntegTime 1 ). In the negative at step S 22 , the process continues at step S 23  where it is checked whether the end of integration (E.O.I.) condition considering the first integration reference level has been detected (SFmax≧SFmaxHighLevel). In the affirmative at step S 22 , the process continues at step S 26 . At step S 26  it is checked whether the lower integration reference level has been set during a previous flash to either SFmaxLevel or SFmaxLowLevel. If, it has been set to SFmaxLevel, then at step S 23 , it is checked whether the end of integration (E.O.I.) condition has been detected considering the first and second integration reference levels (SFmaxLevel&lt;SFmax&lt;SFmaxHighLevel). Alternatively, if it has been set to SFmaxLowLevel, then at step S 23 , it is checked whether the end of integration (E.O.I.) condition has been detected considering the first and third integration reference levels (SFmaxLowLevel≦SFmax≦SFmaxHighLevel). In the affirmative at step S 21 , the process continues at step S 25  where the pixel gain is set for the next flash to the second value SHG greater than HG, and preferably so that SHG&gt;2×HG. After step S 25 , the process continues to step S 26 , already described. The SHG pixel gain value will then be used for the next flash.  
         [0060]     In the affirmative at step S 20 , the process continues at step S 24 . At step S 24 , the integration reference level is set for the next flash to the lower and third integration reference level (SFmaxLowLevel) instead of the second integration reference level, and then the process continues at step S 26  still considering the integration reference level setting of the current flash that is to say either SFmaxLevel or SFmaxLowLevel according to the integration behaviour during the previous flash.  
         [0061]     Referring again to step S 23 , where it is checked whether the end of integration (E.O.I.) condition has been detected, considering either only the first integration reference level if directly coming from step S 22  (HighSFmaxLevel≦SFmax) or if coming from step S 26  also the second integration reference level (SFmaxLevel≦SFmax≦HighSFmaxLevel) or alternatively also the third integration reference level (SFmaxLowLevel≦SFmax≦HighSFmaxLevel) depending on the setting of the integration reference level between the second and the third one during the current flash. If any of such end of integration condition is detected at step S 11  then the process continues to step S 27 , otherwise it returns to step S 19 .  
         [0062]     At step S 27 , it is checked whether the duration that is timed Tint reaches a third determined integration period LowIntegTime 1 &lt;HighIntegTime 1 . Advantageously, it is chosen so that: 
 
LowIntegTime1 21  HighIntegTime1 *HG/SHG;    (1) 
 
         [0063]     In the affirmative at step S 27 , the process continues at step S 28 , where it is checked whether the duration that is timed Tint reaches a fifth determined integration period LowIntegTime 2 , and defined in LowIntegTime 2  register. It is chosen so that: 
 
LowIntegTime1&lt;LowIntegTime2&lt;HighIntegTime2   (3) 
 
 And advantageously it is chosen so that: 
 
LowIntegTime2&lt;HighIntegTime2 *SF maxLowLevel/ SF maxLevel   (4) 
 
         [0064]     In the negative at step S 28 , the process continues at step S 30 , where the integration reference level is switched back from SFmaxLowLevel to SFmaxLevel. The process then continues at step S 7 . Otherwise, in the affirmative at step S 28 , the process directly continues at step S 7 .  
         [0065]     In the negative at step S 27 , the process continues at step S 29 , where the pixel gain is switched back from SHG to HG. The process then continues at step S 30  already described.  
       Fifth Embodiment  
       [0066]     According to a fifth embodiment of the invention, it provides the same two additional features as for the fourth embodiment, with the difference of switching the SFmaxLowLevel first when integration time exceeds HighIntegTime 1  and the pixel gain to the second value SHG when integration time exceeds HighIntegTime 2 . This allows a comparison between these two features and the best trade-off between tracking speed and quality can be chosen.  
         [0067]     Practically, in this fifth mode, the process differs from the fourth mode in that steps S 24  and S 25  are shifted so that in the affirmative at step S 20 , the process continues at step S 25  and then S 26 , while in the affirmative at step S 21 , the process continues at step S 24  and then S 26 . The process in the fifth mode further differs from the process in the fourth mode in that steps S 29  and S 30  are also shifted. Thus, in the affirmative at step S 27 , the process continues first at step S 30  and then at step S 29 , while in the affirmative at step S 28 , the process continues only at step  29 .  
         [0068]     It is to be noted that in the fifth mode the third and fifth integration periods, respectively LowIntegTime 1  and LowIntegTime 2 , are advantageously chosen so that: 
 
LowIntegTime1&lt;HighIntegTime1 *SF maxLowLevel/ SF maxLevel;   (2) 
 
LowIntegTime2&lt;HighIntegTime2 * HG/SHG;    (5) 
 
         [0069]     Finally, it is to be noted, that all FIGS.  6  to  10  are purely illustrative and that various amendments may be brought to these embodiments only given by way of examples.  
         [0000]     Rest Mode  
         [0070]     According to any preceding embodiments, one will now describe how the optical sensing device may operate in rest mode. Rest mode is a condition where the sensor decides that the mouse is not moving. The way this is decided may be by looking at the flash rate, eventually controlled by a flash rate control algorithm, after each flash as taught for example in the U.S. patent application Ser. No. 11/011,164 in the name of the same Assignee and which is enclosed herewith by way of reference. When the sensing device is in rest mode, the sensor may use a specific integration reference level SFmaxRestLevel. If the flash rate is at a level which is equal to or below a level that is defined in a dedicated register called FlashRateRest then the sensor decides that the mouse is in rest (“rest mode”). Alternatively, if the flash rate is above that level the sensor decides that the mouse is moving (“motion mode”) which was disclosed in relation with all Figures.  
         [0071]     The motivation for a separate level in rest mode is that when the sensor is in rest, a longer integration time may be allowed. Thus, a higher integration reference level may be used at rest, which would lead to a better signal to noise ratio and less jitter, false reports etc . . . However, one may implement all features disclosed with the motion mode within the rest mode as well.  
         [0072]     Having described the invention with regard to certain specific embodiments, it is to be understood that these embodiments are not meant as limitations of the invention. Indeed, various modifications and/or adaptations may become apparent to those skilled in the art without departing from the scope of the annexed claims. For instance, the proposed embodiments are not necessarily limited to the features above described.