as chuck says an optical one can be confused by the surface its on, if its the old ball type its usually down to the little spindles/sensors with a bit of crud build up on them..
Just take take the plate of the bottom and remove the ball it should be fairly obvious if it is dirt.