Provided are an image processing apparatus, an image processing method, and a program capable of generating a learning sample that appropriately reflects a state inside a lumen. An image processing apparatus 1 includes a surface shape estimation unit 10 that estimates a surface shape of a target that appears in an intraluminal image of a living body, an imaging viewpoint changing unit 11 that changes an imaging viewpoint with respect to the surface shape, and an image generation unit 12 that generates a virtual image of the target for a case of imaging the target from the changed imaging viewpoint.