An image processing device processes an image acquired by an imaging section that enables magnifying observation. The image processing device includes a motion information acquisition section that acquires motion information that indicates a relative motion of the imaging section with respect to an object, an imaging magnification calculation section that calculates an imaging magnification of the imaging section, and an image extraction section that extracts an image within a specific area from a captured image acquired by the imaging section as an extracted image. The image extraction section sets the position of the specific area within the captured image based on the motion information, and sets the size of a margin area based on the imaging magnification and the motion information, the margin area being an area except the specific area in the captured image.