Image processing apparatus and non-transitory computer readable medium storing program
An image processing apparatus includes an input unit that inputs an image, and a processor configured to read out a program stored in a memory, and executes the program. The processor is configured to detect an intended subject from the input image by a first detection method, set an intended subject region for the detected intended subject, detect the intended subject from the input image by a second detection method different from the first detection method, and update the set intended subject region by using a detection result of the second detection method.
1. An image processing apparatus comprising:
an input unit that inputs an image; and
a hardware processor configured to read out a program stored in a memory, and executes the program,
wherein the hardware processor is configured to
detect an intended subject from the input image by a first detection method, set an intended subject region for the detected intended subject,
detect the intended subject from the input image by a second detection method different from the first detection method, and
update the set intended subject region by using a detection result of the second detection method,
wherein the hardware processor is configured to detect a salient region from the input image, as the second detection method, and update the set intended subject region by expanding the set intended subject region by using the salient region,
wherein the hardware processor is configured to limit an expansion range of the intended subject region by the detection result, and decide an upper limit of the expansion, and
wherein the hardware processor is configured to expand the intended subject region by adding pixels which are adjacent to the intended subject region and are detected in the detection result to pixels of the intended subject region.
2. The image processing apparatus according to claim 1 ,
wherein the hardware processor is configured to binarize the input image, as the second detection method.
3. The image processing apparatus according to claim 2 ,
wherein the hardware processor is configured to update the set intended subject region by expanding the set intended subject region by using a binarization result.
4. The image processing apparatus according to claim 1 ,
wherein the hardware processor is configured to detect a salient region indicating a degree of attention of a person from the input image and binarize the input image, as the second detection method.
5. The image processing apparatus according to claim 4 ,
wherein the hardware processor is configured to update the set intended subject region by using the salient region and a binarization result.
6. The image processing apparatus according to claim 5 ,
wherein the hardware processor is configured to update the set intended subject region by expanding the set intended subject region by using the salient region and further calculating a logical sum of a binarization region of the binarization result and the set intended subject region.
7. The image processing apparatus according to claim 1 ,
wherein the hardware processor is configured to further set an unnecessary subject region from the input image by using the detection result of the second detection method and the updated intended subject region.
8. The image processing apparatus according to claim 7 ,
wherein the hardware processor is configured to further update the updated intended subject region by using the unnecessary subject region.
9. The image processing apparatus according to claim 1 ,
wherein the hardware processor is configured to further set a cutout region from the updated intended subject region, and cut out the intended subject from the input image by using the cutout region.