1. An image processing apparatus comprising: moving-image input means for inputting a moving image composed of a plurality of frames; background-image acquisition means for acquiring a background image relating to the moving image that has been input; object extraction means for extracting an object by comparing each of the frames constituting the moving image with the background image; abnormal-data discrimination means for discriminating whether shape data representing the shape of the extracted object is abnormal or not; shape-data correction means for correcting the shape data based upon result of discrimination of the shape data; image-data correction means for generating image data, which represents the image of the object, conforming to the shape data that has been corrected by said shape-data correction means; and coding means for coding the shape data and the image data.