1. An image processing apparatus comprising: one or more processors; and a memory storing instructions which, when executed by the one or more processors, cause the image processing apparatus to function as units comprising: (1) an in-focus position acquiring unit configured to acquire an in-focus position on a photographed image; (2) a distance information acquiring unit configured to acquire a distance information corresponding to the in-focus position from a depth map corresponding to the photographed image; and (3) an image processing unit configured to perform image processing on the photographed image based on the depth map and the distance information, wherein the in-focus position acquiring unit acquires the in-focus position from autofocus information at the time of photography of the photographed image, wherein the autofocus information is information on a range-finding point that was used during automatic focusing.