To realize an imaging device, imaging method and program capable of improving image quality. This invention controls light sources so as to irradiate a body with irradiation light of a luminance level higher than that in the air arriving at the body, adjusts the imaging sensitivity of a solid imaging element for performing photoelectric conversion on pattern scattered light obtained through the inside of the body, and masks the luminance level deterioration region of a pattern image obtained from the solid imaging element to treat the masked image as an image to be composed with a reference image.