An electronic image stabilizer in a digital camera compensates for camera motion-induced blurriness by segmenting exposure times into multiple shorter exposure times and summing the individual pixels from successive frames after applying an appropriate motion correction. Motion is detected by computing the correlation function between successive images, and compensation is applied by maximizing the correlation function. This avoids the need for mechanical stabilization devices in order to detect or correct the motion as is done in prior art. This method further enables the detection of moving objects in a still background, and correction of blurriness images due to such motion.