1. An image processing apparatus that performs image processing on a first image and a second image, the image processing apparatus comprising: dividing means for dividing the first image into a plurality of blocks; first motion-vector calculating means for calculating first motion vectors representing movements from the blocks of the first image to corresponding regions of the second image; second motion-vector calculating means for calculating second motion vectors representing movements of the blocks that occur when the blocks are transformed based on a first positional-relationship parameter representing positional relationship between the first image and the second image; difference-vector calculating means for calculating difference vectors representing differences between the first motion vectors and the second motion vectors; and extracting means for extracting blocks including a moving object or blocks including a non-moving object based on distribution density of end points of the difference vectors.