1. An image processing apparatus comprising: a processor; and a memory, the memory storing program code executable by the processor to perform operations comprising: detecting an object which is included in an image; determining a positional relationship by calculating a difference value between a feature amount of a detected object and a feature amount of a protective barrier region in a depth direction of the image relating to at least one of the detected object and the protective barrier region, when the detected object and the protective barrier region overlap with each other in the image; and calculating a total value of the difference value of each pixel of the overlap, wherein the detected object is present in the protective barrier region when the total value is greater than a threshold value and the detected object is not present in the protective barrier region when the total value is less than the threshold value.