1. An image compositing apparatus comprising: a motion vector calculation unit configured to calculate a global motion vector reflecting an inter-image global motion of a base image and a reference image and to calculate a local motion vector reflecting an inter-image local motion between the base image and the reference image for one of a pixel and a unit region consisting of pixels; a moving region information calculation unit configured to calculate moving region information, the moving region information indicating one of a moving region in which a subject is moving and a still region in which the subject is not moving, by estimating, in each unit region, a difference between the global motion vector and the local motion vector, and using a predetermined relationship between the difference and a value of the moving region information; an image correction unit configured to generate a corrected reference image obtained by correcting the reference image based on the global motion vector and a corrected reference image obtained by correcting the reference image based on the local motion vector; a composition ratio determining unit configured to determine composition ratios for compositing the base image with the corrected reference image corrected based on the global motion vector and the corrected reference image corrected based on the local motion vector, by using the moving image information calculated by the moving region information calculation unit and correlations between an image pixel of the base image to be processed and a target pixel of the corrected reference images corrected by the image correction unit; and a composition unit configured to composite the base image with the corrected reference image corrected based on the global motion vector and the corrected reference image corrected based on the local motion vector, with the composition ratios determined by the composition ratio determining unit, wherein the composition ratio of the corrected reference image corrected based on the global motion vector is higher than the composition ratio of the corrected reference image corrected based on the local motion vector in a region indicated to be the moving region in which an absolute value of the difference between the global motion vector and the local motion vector is at or above a first threshold.