Imaging device, image generation method, and recording medium for generating composite image from two or more images
Obtaining a needed image has been difficult with conventional technology. A needed image can be obtained by an imaging device including an optical signal acquisition unit that performs imaging and acquires an optical signal, an original image acquisition unit that acquire two or more different original images using the optical signal, a selection unit that acquires one output image from candidate images including the two or more original images acquired by the original image acquisition unit, and an image output unit that outputs the output image acquired by the selection unit.
1 . An imaging device comprising:
an image sensor configured to capture an image of an object and generate an optical signal; and
a processor; and
a recording medium storing a program, wherein the program, when executed by the processor, causes the processor to:
generate two or more original images different from each other from the optical signal;
generate a composite image by compositing the two or more original images;
after the composite image is generated, select one output image, which satisfies a predetermined condition, from three or more candidate images including the composite image and the two or more original images; and
output, to an image display device, the output image, and
when the composite image satisfies the predetermined condition, the processor outputs the composite image as the output image, and
when one of the two or more original images satisfies the predetermined condition, the processor outputs the one of the two or more original images that satisfies the predetermined condition as the output image.
2 . The imaging device according to claim 1 , further comprising:
a storage unit configured to store a composite image flag indicating whether or not the composite image is to be generated, wherein the executed program causes the processor to:
determine, before starting generation of the composite image, whether the flag indicates that the composite image is to be generated, and in a case where the composite image flag indicates that the composite image is to be generated, generate the composite image by compositing the two or more original images.
3 . The imaging device according to claim 1 ,
wherein the executed program causes the processor to automatically select the one output image that satisfies the predetermined condition from the three or more candidate images.
4 . The imaging device according to claim 1 ,
wherein to select the one image, the executed program causes the processor to
perform machine-learning prediction processing using a learning model and the three or more candidate images,
acquire image identification information specifying the one output image, and
acquire the one output image specified by the image identification information, the learning model being information acquired by performing learning processing using two or more pieces of training data including two or more previously obtained original images, one or more previously obtained composite images, and image identification information specifying a selected image.
5 . The imaging device according to claim 1 ,
wherein the executed program causes the processor to generate the composite image in which a partial original image of a partial area of one or more original images out of the two or more original images is adopted as an area corresponding to the partial area.
6 . The imaging device according to claim 5 ,
wherein the executed program causes the processor to generate the composite image in which a first partial original image of a first area of a first original image out of the two or more original images is adopted as an area corresponding to the first area, and in which a second partial original image of a second area of a second original image out of the two or more original images is adopted as an area corresponding to the second area.
7 . The imaging device according to claim 1 ,
wherein the executed program causes the processor to embed, in the output image, at least identification information specifying that the output image was acquired by the imaging device, and acquire the output image embedded with the identification information, and
the executed program causes the processor to output the output image embedded with the identification information.
8 . The imaging device according to claim 1 , wherein the two or more original images are generated by extracting part of wavelengths from the optical signal.
9 . The imaging device according to claim 8 , wherein:
the executed program causes the processor to
accept an instruction given by a user selecting one image from the composite image and the two or more original images, and
output the one output image that corresponds to the instruction for further processing.
10 . The imaging device according to claim 1 , wherein one of the two or more original images is a part of another of the two or more original images.
11 . An image generation method comprising:
imaging, by an image sensor, an object and generating an optical signal corresponding to the object;
generating, by a processor, two or more original images different from each other, from the optical signal;
generating a composite image by compositing the two or more original images;
after the composite image is generated, selecting one output image from three or more candidate images including the composite image and the two or more original images; and
outputting the output image,
wherein in the selecting,
as a result of determining that the composite image satisfies a predetermined condition, the composite image is selected as the output image, and
as a result of determining that one of the two or more original images satisfies the predetermined condition, the one of the two or more original images that satisfies the predetermined condition is selected as the output image.