1. An image processing apparatus for processing images picked up on a plurality of image pickup planes having different distances to a lens, the apparatus comprising: acquiring means for acquiring a plurality of images of a target object picked up on said plurality of image pickup planes; first computing means for computing weights of said plurality of images acquired by said acquiring means; second computing means for computing averages of said plurality of images acquired by said acquiring means; and image creating means for creating an optimum image of said target object by obtaining a weighted average based on said weights computed by said first computing means and on said averages of said plurality of images computed by said second computing means.