An image processing apparatus that is configured to generate a virtual viewpoint image based on one or more captured images out of a plurality of captured images obtained by capturing by a plurality of cameras, the apparatus (FIG. 3; FIG. 6) comprising: acquisition means (11; 601) configured to acquire virtual viewpoint information including information related to a position of a virtual viewpoint and a direction of view from the virtual viewpoint; determination means (10; 601) configured to determine (S103, S110; S118, S119), based on positions of objects detected in images captured at the same time respectively from a first viewpoint by a first camera and from a second viewpoint by a second camera and based on a transformation of the positions of the objects in the image captured from the first viewpoint to positions in the image captured from the second viewpoint, whether occlusion is occurring, wherein the first camera and the second camera are selected based on the virtual viewpoint information; wherein the apparatus is further characterised by: decision means (9; 601) configured to decide (S113; S122; S123), based on a distance from the first camera to a third camera which is different to the second camera among the plurality of cameras, an image captured from the first viewpoint by the first camera and an image captured at the same time from a third viewpoint by the third camera as captured images to be used for generation of a virtual viewpoint image that is based on the virtual viewpoint information, in a case where it is determined by the determination means (10; 601) that occlusion is occurring in at least one image captured from the second viewpoint by the second camera; and generation means (9; 601) configured to generate (S114; S124) a virtual viewpoint image that is based on the virtual viewpoint information using the captured images decided by the decision means (9; 601). acquisition means (11; 601) configured to acquire virtual viewpoint information including information related to a position of a virtual viewpoint and a direction of view from the virtual viewpoint; determination means (10; 601) configured to determine (S103, S110; S118, S119), based on positions of objects detected in images captured at the same time respectively from a first viewpoint by a first camera and from a second viewpoint by a second camera and based on a transformation of the positions of the objects in the image captured from the first viewpoint to positions in the image captured from the second viewpoint, whether occlusion is occurring, wherein the first camera and the second camera are selected based on the virtual viewpoint information; wherein the apparatus is further characterised by: decision means (9; 601) configured to decide (S113; S122; S123), based on a distance from the first camera to a third camera which is different to the second camera among the plurality of cameras, an image captured from the first viewpoint by the first camera and an image captured at the same time from a third viewpoint by the third camera as captured images to be used for generation of a virtual viewpoint image that is based on the virtual viewpoint information, in a case where it is determined by the determination means (10; 601) that occlusion is occurring in at least one image captured from the second viewpoint by the second camera; and generation means (9; 601) configured to generate (S114; S124) a virtual viewpoint image that is based on the virtual viewpoint information using the captured images decided by the decision means (9; 601). decision means (9; 601) configured to decide (S113; S122; S123), based on a distance from the first camera to a third camera which is different to the second camera among the plurality of cameras, an image captured from the first viewpoint by the first camera and an image captured at the same time from a third viewpoint by the third camera as captured images to be used for generation of a virtual viewpoint image that is based on the virtual viewpoint information, in a case where it is determined by the determination means (10; 601) that occlusion is occurring in at least one image captured from the second viewpoint by the second camera; and generation means (9; 601) configured to generate (S114; S124) a virtual viewpoint image that is based on the virtual viewpoint information using the captured images decided by the decision means (9; 601).