An optical computer mouse converts its movement on a surface to the movement of a cursor on the computer screen. It also incorporate buttons to perform various functionalities. Regardless of whether it is wired or wireless, uses LED or laser, almost all mice used today are classified as optical mice, in contrast to the now obselete mechanical mice.
Figure 1, (a) Typical components of an optical mouse (LED type); and (b) schematic discription of the working principle of an optical mouse.
To detect the movement, an optical mouse uses a light source (LED or Laser), a photodetector (typically a CMOS sensor) and a digital signal processor (DSP). First, the light source produces light that shines onto the surface. The light is reflected back and picked up by the CMOS sensor forming an image of the local surface. Thousands of images are taken every second by the CMOS sensor and these images are sent to the DSP for analysis. The DSP compares these images to determine whether the mouse has moved, in what direction and at what speed. These information is then sent to the computer (through wire or wireless receiver), which updates the positon of cursor on the screen accordingly.
Figure 2, How does an optical mouse translate changes in recorded image to movement of mouse on the surface. Figure from http://www.dvhardware.net/review70_logitech-mx1000.html
As shown in Figure 2, certain features in an image is taken as the fingerprints. The DSP compares the locations of such fingerprints in the two images, and the difference is related to how the mouse has moved (in which direction, by how much etc.). A modern optical mouse capture and compare thousands of images every second (a process known as digital image correlation), each image is offset from the previous one by certain amount of pixels depending on how fast the mouse is moving. Such information is translated to the movement of cursor on the computer screen.