Image processing device, image processing method, and recording medium
An image processing device includes a memory and a processor configured to calculate a reference black level and a reference illumination light component based on pixel values of peripheral pixels located around a target pixel for image processing using image data acquired by an imaging device, correct a black level of the target pixels based on the reference black level calculated by the processor, and perform a tone correction of the target pixels with the black level corrected based on the reference illumination light component calculated by the processor. Accordingly, even when a large gain is applied to a dark portion of an image in a local tone correction, it is possible to generate an image with high visibility in which an occurrence of raised black levels is suppressed.
1 . An image processing device, comprising:
a memory; and
a processor coupled to the memory and configured to
calculate, using image data acquired by an imaging device, a reference black level and a reference illumination light component based on pixel values of peripheral pixels located around a target pixel for image processing;
correct a black level of the target pixel based on the reference black level calculated by the processor; and
perform, based on the reference illumination light component calculated by the processor, a tone correction of the target pixel with the black level thereof corrected,
wherein the processor calculates, for each of a plurality of target pixels, the reference black level and the reference illumination light component based on the pixel values of the peripheral pixels located around the target pixel.
2 . The image processing device as claimed in claim 1 , wherein the processor calculates a minimum value of the pixel values of the peripheral pixels as the reference black level.
3 . The image processing device as claimed in claim 1 , wherein the processor calculates an average value of the pixel values of the peripheral pixels as the reference illumination light component.
4 . The image processing device as claimed in claim 1 , wherein the processor performs a first edge-preserving smoothing process when calculating the reference black level, and performs a second edge-preserving smoothing process when calculating the reference illumination light component.
5 . The image processing device as claimed in claim 4 , wherein the processor utilizes a part of a processing result of the first edge-preserving smoothing process in the second edge-preserving smoothing process.
6 . An image processing method executed by a computer, comprising:
a calculation process of calculating, using image data acquired by an imaging device, a reference black level and a reference illumination light component based on pixel values of peripheral pixels located around a target pixel for image processing;
a black level correction process of correcting a black level of the target pixel based on the reference black level calculated by the calculation process; and
a tone correction process of performing, based on the reference illumination light component calculated by the calculation process, a tone correction of the target pixel with the black level thereof corrected,
wherein, for each of a plurality of target pixels, the reference black level and the reference illumination light component are calculated based on the pixel values of the peripheral pixels located around the target pixel.
7 . A non-transitory computer-readable recording medium having a program embodied therein for causing a computer to perform:
a calculation process of calculating, using image data acquired by an imaging device, a reference black level and a reference illumination light component based on pixel values of peripheral pixels located around a target pixel for image processing;
a black level correction process of correcting a black level of the target pixel based on the reference black level calculated by the calculation process; and
a tone correction process of performing, based on the reference illumination light component calculated by the calculation process, a tone correction of the target pixel with the black level thereof corrected,
wherein, for each of a plurality of target pixels, the reference black level and the reference illumination light component are calculated based on the pixel values of the peripheral pixels located around the target pixel.