JP2024046819A - Image processing device and program - Google Patents

Image processing device and program Download PDF

Info

Publication number
JP2024046819A
JP2024046819A JP2022152122A JP2022152122A JP2024046819A JP 2024046819 A JP2024046819 A JP 2024046819A JP 2022152122 A JP2022152122 A JP 2022152122A JP 2022152122 A JP2022152122 A JP 2022152122A JP 2024046819 A JP2024046819 A JP 2024046819A
Authority
JP
Japan
Prior art keywords
image
illumination
processing device
pixel values
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2022152122A
Other languages
Japanese (ja)
Inventor
和敏 池田
翔太 鳴海
奏馬 白壁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2022152122A priority Critical patent/JP2024046819A/en
Publication of JP2024046819A publication Critical patent/JP2024046819A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

【課題】1つの画像における明部と暗部の両方のダイナミックレンジを広げた補正画像を得られるようにする。【解決手段】画像処理装置はプロセッサを備える。プロセッサは、Retinex理論に基づいて元画像10の照明成分Lを推定して、照明画像12を取得する照明成分推定処理と、元画像10と照明画像12に基づいて得られる明部補正と暗部補正のそれぞれの画素値Il’,Id’を、照明画像12の画素値Lで重み付けして合成することで、補正画像14を生成する合成処理を行う。【選択図】図2[Problem] To obtain a corrected image in which the dynamic range of both light and dark areas in a single image is expanded. [Solution] An image processing device includes a processor. The processor performs an illumination component estimation process that estimates the illumination component L of an original image 10 based on the Retinex theory to obtain an illumination image 12, and a synthesis process that generates a corrected image 14 by weighting and synthesizing pixel values Il', Id' of the light and dark area corrections obtained based on the original image 10 and the illumination image 12 by the pixel value L of the illumination image 12. [Selected Figure] Figure 2

Description

本発明は、画像処理装置及びプログラムに関する。 The present invention relates to an image processing device and a program.

従来から、カメラの撮影画像を鮮明化する画像処理や、撮影画像の白飛びや黒つぶれを補正する画像処理等について検討が行われている。 Image processing to sharpen images captured by cameras and to correct blown-out highlights and crushed shadows in captured images have been studied for some time now.

特許文献1は、同一画像内に極端に明るい部分と暗い部分が混在する画像や、水中・霧など極端にコントラストが低い部分が混在する画像を、見やすい画像に変換する鮮明化処理と、画像内の黒つぶれ部分を補正する黒つぶれ処理に関するものである。同文献には、鮮明化処理を行った画像と黒つぶれ処理を行った画像を合成する画像処理が開示されている。 Patent Document 1 relates to a sharpening process that converts images that contain a mixture of extremely bright and dark areas or images that contain extremely low contrast areas such as underwater or fog into images that are easier to see, and a blackout process that corrects blackout areas in the image. The document discloses image processing that combines an image that has been sharpened with an image that has been blackout processed.

特許文献2は、1つの画像における明部と暗部のいずれのコントラストも改善させる画像処理に関するものである。同文献には、1つの画像を複数のブロックに分割して、ブロック毎に輝度値の頻度をカウントし、ブロック毎に輝度値のヒストグラムを生成する処理等を行って出力画像を得る構成が開示されている。 Patent Document 2 relates to image processing that improves the contrast of both light and dark areas in an image. The document discloses a configuration that divides an image into multiple blocks, counts the frequency of luminance values for each block, and performs processing to generate a histogram of luminance values for each block to obtain an output image.

非特許文献1には、映像は物体を照らす照明光成分とその物体の反射率成分との積で表わされるという理論に基づいたRetinex(レティネックス)処理と、画像内の霞を除去するDehaze(ディヘイズ)処理に関し、Retinex処理とDehaze処理の間には、実用的な仮定のもとで線形の関係があることが記載されている。 Non-Patent Document 1 describes Retinex processing, which is based on the theory that an image is expressed as the product of the illumination light component that illuminates an object and the reflectance component of that object, and Dehaze processing, which removes haze from an image, and states that there is a linear relationship between Retinex processing and Dehaze processing under practical assumptions.

特許第6893068号公報Japanese Patent No. 6893068 特開2011-124800号公報JP 2011-124800 A

Galdran, “On the Duality Between Retinex and Image Dehazing”, in CVPR 2018Galdran, “On the Duality Between Retinex and Image Dehazing”, in CVPR 2018

カメラの撮影画像において、例えば、光源で照らされた領域と、光源で照らされない領域とで極端な明暗差が生じ、明部と暗部でダイナミックレンジが狭くなることがある。このような画像に対して、明部と暗部の両方のダイナミックレンジを広げた補正画像を得られるようにすることが望まれている。 In an image captured by a camera, for example, there may be an extreme difference in brightness between areas illuminated by a light source and areas not illuminated by the light source, narrowing the dynamic range between bright and dark areas. For such images, it is desirable to be able to obtain a corrected image that expands the dynamic range of both the bright and dark areas.

本発明の目的は、1つの画像における明部と暗部の両方のダイナミックレンジを広げた補正画像が得られるようにすることにある。 The objective of the present invention is to obtain a corrected image that expands the dynamic range of both the bright and dark areas of a single image.

請求項1に係る発明は、プロセッサを含み、前記プロセッサは、Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、を行う、画像処理装置である。 The invention according to claim 1 is an image processing device that includes a processor, and the processor performs an illumination component estimation process that estimates the illumination component of an original image based on the Retinex theory to obtain an illumination image, and a synthesis process that generates a corrected image by weighting and synthesizing the pixel values of the bright area correction and the dark area correction obtained based on the original image and the illumination image by the pixel values of the illumination image.

請求項2に係る発明は、請求項1に記載の画像処理装置であって、前記元画像は、画素値が明度を表わす明度画像である、画像処理装置である。 The invention according to claim 2 is the image processing device according to claim 1, in which the original image is a brightness image in which pixel values represent brightness.

請求項3に係る発明は、請求項2に記載の画像処理装置であって、前記プロセッサは、前記元画像の画素値を、前記照明画像の画素値で除算することで、前記暗部補正の画素値を取得し、前記元画像を明度反転させた反転明度画像の画素値を、前記照明画像を明度反転させた反転照明画像の画素値で除算して得られる画素値を、明度反転することで、前記明部補正の画素値を取得する、画像処理装置である。 The invention according to claim 3 is the image processing device according to claim 2, in which the processor obtains pixel values of the dark area correction by dividing pixel values of the original image by pixel values of the illumination image, and obtains pixel values of the bright area correction by inverting the brightness of pixel values obtained by dividing pixel values of an inverted brightness image obtained by inverting the brightness of the original image by pixel values of an inverted illumination image obtained by inverting the brightness of the illumination image.

請求項4に係る発明は、請求項1~3のいずれか1つに記載の画像処理装置であって、前記プロセッサは、前記照明画像における画素値が閾値より高い領域である明部領域とその画素値が前記閾値以下である暗部領域を、前記元画像または前記元画像に色成分が付加された元カラー画像に重畳させて、表示部に表示する制御を行う、画像処理装置である。 The invention according to claim 4 is an image processing device according to any one of claims 1 to 3, in which the processor controls the display of bright areas in the illumination image, which are areas in which pixel values are higher than a threshold, and dark areas in which the pixel values are equal to or lower than the threshold, superimposed on the original image or an original color image in which color components are added to the original image.

請求項5に係る発明は、請求項4に記載の画像処理装置であって、前記プロセッサは、前記表示部に表示された前記明部領域と前記暗部領域を変更する指示を、ユーザから受け付け、前記ユーザからの前記変更の指示に基づいて、前記照明画像の画素値を更新する、画像処理装置である。 The invention according to claim 5 is the image processing device according to claim 4, in which the processor receives an instruction from a user to change the bright area and the dark area displayed on the display unit, and updates the pixel values of the illumination image based on the change instruction from the user.

請求項6に係る発明は、請求項1~3のいずれか1つに記載の画像処理装置であって、前記プロセッサは、前記照明画像の画素値を補正するための補正係数を、ユーザから受け付け、前記補正係数に基づいて、前記照明画像の画素値を更新する、画像処理装置である。 The invention according to claim 6 is an image processing device according to any one of claims 1 to 3, in which the processor receives a correction coefficient for correcting pixel values of the illumination image from a user, and updates the pixel values of the illumination image based on the correction coefficient.

請求項7に係る発明は、請求項1~3のいずれか1つに記載の画像処理装置であって、前記プロセッサは、前記照明成分推定処理において、前記元画像を平滑化したぼかし画像を、前記照明画像として取得する、画像処理装置である。 The invention according to claim 7 is an image processing device according to any one of claims 1 to 3, in which the processor acquires, as the illumination image, a blurred image obtained by smoothing the original image in the illumination component estimation process.

請求項8に係る発明は、請求項7に記載の画像処理装置であって、前記プロセッサは、カーネルサイズ、カーネルのシグマ値、またはそれらの両方を、ユーザから受け付け、前記照明成分推定処理において、前記ユーザから受け付けた前記カーネルサイズ、前記カーネルのシグマ値、またはそれらの両方を有するカーネルを用いて、前記照明画像を取得する、画像処理装置である。 The invention according to claim 8 is the image processing device according to claim 7, in which the processor receives a kernel size, a kernel sigma value, or both from a user, and in the illumination component estimation process, acquires the illumination image using a kernel having the kernel size, the kernel sigma value, or both received from the user.

請求項9に係る発明は、請求項7に記載の画像処理装置であって、前記プロセッサは、前記元画像に現れる対象物に関し、カメラによる撮影時の前記カメラと前記対象物の間の距離の情報を取得し、前記照明成分推定処理において、前記カメラと前記対象物の間の距離が長い場合にはそれが短い場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、画像処理装置である。 The invention according to claim 9 is the image processing device according to claim 7, in which the processor acquires, for an object appearing in the original image, information on the distance between the camera and the object when photographed by the camera, and acquires the illumination image in the illumination component estimation process using a kernel having a smaller kernel size when the distance between the camera and the object is long compared to when the distance is short.

請求項10に係る発明は、請求項7に記載の画像処理装置であって、前記プロセッサは、前記元画像に現れる対象物に関し、前記元画像の全体に対する前記対象物の大きさの情報を取得し、前記照明成分推定処理において、前記対象物の大きさが小さい場合にはそれが大きい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、画像処理装置である。 The invention according to claim 10 is the image processing device according to claim 7, in which the processor acquires, for an object appearing in the original image, information on the size of the object relative to the entire original image, and in the illumination component estimation process, acquires the illumination image using a kernel having a smaller kernel size when the size of the object is small compared to when the size of the object is large.

請求項11に係る発明は、請求項7に記載の画像処理装置であって、前記プロセッサは、前記元画像のカメラによる撮影時の画角の情報を取得し、前記照明成分推定処理において、前記画角が大きい場合にはそれが小さい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、画像処理装置である。 The invention according to claim 11 is the image processing device according to claim 7, in which the processor acquires information on the angle of view when the original image was captured by a camera, and in the illumination component estimation process, acquires the illumination image using a kernel with a smaller kernel size when the angle of view is large compared to when the angle of view is small.

請求項12に係る発明は、Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、をコンピュータに実行させるプログラムである。 The invention according to claim 12 is a program for causing a computer to execute an illumination component estimation process for estimating the illumination component of an original image based on the Retinex theory and acquiring an illumination image, and a synthesis process for generating a corrected image by weighting and synthesizing the pixel values of the light area correction and the dark area correction obtained based on the original image and the illumination image by the pixel values of the illumination image.

請求項1に係る発明によれば、1つの元画像における明部と暗部の両方のダイナミックレンジを広げた補正画像が得られる。 According to the invention of claim 1, a corrected image is obtained in which the dynamic range of both the bright and dark areas in a single original image is expanded.

請求項2に係る発明によれば、明度画像に対する補正画像が得られる。 According to the invention of claim 2, a correction image for a brightness image is obtained.

請求項3に係る発明によれば、元画像と照明画像の画素値から、明部補正と暗部補正の画素値が得られる。 According to the invention of claim 3, pixel values for bright area correction and dark area correction are obtained from the pixel values of the original image and the illuminated image.

請求項4に係る発明によれば、ユーザが明部領域と暗部領域を確認可能となる。 According to the invention of claim 4, the user can check the bright and dark areas.

請求項5に係る発明によれば、ユーザが明部領域と暗部領域を確認しながら、照明成分を更新することが可能となる。 According to the invention of claim 5, it becomes possible for the user to update the lighting components while checking the bright and dark areas.

請求項6に係る発明によれば、ユーザが照明成分を補正可能となる。 According to the invention of claim 6, the user can correct the lighting component.

請求項7に係る発明によれば、元画像を平滑化したぼかし画像の画素値により、照明成分が近似される。 According to the invention of claim 7, the illumination component is approximated by the pixel values of a blurred image obtained by smoothing the original image.

請求項8に係る発明によれば、ユーザがカーネルサイズ、カーネルのシグマ値、またはそれらの両方により、照明成分を調整可能となる。 According to the invention of claim 8, the user can adjust the illumination components by the kernel size, the kernel sigma value, or both.

請求項9に係る発明によれば、補正画像において対象物の視認性が向上することを期待できる。 According to the invention of claim 9, it is expected that the visibility of the object in the corrected image will be improved.

請求項10に係る発明によれば、補正画像において対象物の視認性が向上することを期待できる。 According to the invention of claim 10, it is expected that the visibility of the object in the corrected image will be improved.

請求項11に係る発明によれば、補正画像において物体の視認性が向上することを期待できる。 According to the invention of claim 11, it is expected that the visibility of objects in the corrected image will be improved.

請求項12に係る発明によれば、1つの元画像における明部と暗部の両方のダイナミックレンジを広げた補正画像が得られる。 According to the invention of claim 12, a corrected image is obtained in which the dynamic range of both the bright and dark areas in a single original image is expanded.

カラー補正画像の取得処理の流れを示す図である。FIG. 11 is a diagram showing a flow of a process for acquiring a color-corrected image. 照明成分推定処理と領域別加重合成処理の流れを示すフローチャートである。11 is a flowchart showing the flow of an illumination component estimation process and an area-specific weighted synthesis process. 元画像と補正画像を例示する図である。1A and 1B are diagrams illustrating an original image and a corrected image. 明部領域と暗部領域を表わす調整用画像についての説明図である。11 is an explanatory diagram of an adjustment image representing a bright area and a dark area. FIG. 照明成分の補正についての説明図である。FIG. 11 is an explanatory diagram of the correction of an illumination component. カーネルサイズの設定についての説明図である。FIG. 11 is an explanatory diagram of the setting of a kernel size. カメラの撮影画像の各種情報についての説明図である。FIG. 2 is an explanatory diagram of various information of an image captured by a camera. カラー補正画像の別の取得処理の流れを示す図である。FIG. 11 is a diagram showing the flow of another process for obtaining a color corrected image. コンピュータのハードウェア構成を例示する図である。FIG. 2 is a diagram illustrating an example of a hardware configuration of a computer.

<概要>
以下、本発明に係る実施形態について添付図面を確認しながら詳細に説明する。以下で述べる構成は、説明のための例示であって、画像処理装置の仕様等に合わせて適宜変更が可能である。また、以下において複数の実施形態や変形例等が含まれる場合、それらの特徴部分を適宜に組み合わせて用いることは当初から想定されている。全ての図面において同一の要素には同一の符号を付し、重複する説明を省略する。
<Overview>
Hereinafter, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. The configurations described below are merely examples for the purpose of explanation, and can be modified as appropriate in accordance with the specifications of the image processing device. Furthermore, when multiple embodiments or modifications are included below, it is assumed from the beginning that the characteristic parts of these will be used in appropriate combination. The same elements in all drawings are given the same reference numerals, and duplicated explanations will be omitted.

以下では、Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、元画像と照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、を行う、画像処理装置についての実施形態を説明する。 The following describes an embodiment of an image processing device that performs an illumination component estimation process that estimates the illumination component of an original image based on the Retinex theory and acquires an illumination image, and a synthesis process that generates a corrected image by weighting and synthesizing the pixel values of the bright area correction and dark area correction obtained based on the original image and the illumination image with the pixel values of the illumination image.

画像処理装置は、例えばデジタルカメラ(水中カメラ等を含む)、スマートフォンやタブレット端末等の携帯端末装置、PC(パーソナルコンピュータ)、プリンタ、複合機等である。画像処理装置は、カメラ(撮像素子)を含んで構成された装置であってもよいし、カメラとは別体の装置であってもよい。画像処理装置は、カメラによって撮影された画像(撮影画像)に対して、以下説明する処理を行う。 Image processing devices are, for example, digital cameras (including underwater cameras, etc.), mobile terminal devices such as smartphones and tablet terminals, PCs (personal computers), printers, multifunction devices, etc. The image processing device may be a device that includes a camera (image sensor), or may be a device separate from the camera. The image processing device performs the processing described below on an image captured by the camera (captured image).

画像処理装置の処理対象となる画像は、静止画、または、動画のフレーム画像である。画像処理装置(一例としてカメラ等)は、画像が取得された後、即座に処理を行ってもよい。すなわち、リアルタイム処理を行ってもよい。また、画像処理装置は、画像が取得された後、画像を例えばハードディスクやフラッシュメモリ等の記憶装置に一旦記憶し、それを読み出して処理を行ってもよい。また、画像処理装置は、カメラ等の他の装置から画像を受け取って処理を行ってもよい。以下では、画像処理装置の処理対象となる画像を元カラー画像、元画像と言う。 The image to be processed by the image processing device is a still image or a frame image of a video. The image processing device (such as a camera, for example) may process the image immediately after it is acquired. In other words, real-time processing may be performed. After an image is acquired, the image processing device may temporarily store the image in a storage device such as a hard disk or flash memory, and then read and process the image. The image processing device may also receive an image from another device such as a camera and process it. In the following, the image to be processed by the image processing device will be referred to as the original color image or original image.

なお、画像の画素値は、一般的には、例えば0~255等の範囲の値をとるものである。しかし、以下では、画像の画素値を、正規化された0~1の範囲の値をとるものとして説明している箇所がある。正規化された画素値は、所定の値を乗算することで一般的な画素値となるものであり、一般的な画素値と実質的な差があるわけではない。 Note that pixel values in an image generally take on values in a range from 0 to 255, for example. However, in the following, there are some places where the pixel values of an image are described as taking normalized values in the range from 0 to 1. Normalized pixel values become normal pixel values by multiplying them by a specified value, and there is no substantial difference between them and normal pixel values.

また、明るさの度合を示す指標としては、明度と輝度がある。一般的に、例えば、YCbCr,HSL,RGB等の色空間では「輝度」という用語が使われ、Lab,HSV等の色空間では「明度」という用語が使われている。しかし、それらは明るさの度合を示す点では同様の性質を有するものである。特許請求の範囲に「明度」と記載されている場合には、それは広義的に解釈されてよく、「輝度」を含むものとして解釈されてよい。また、特許請求の範囲に「輝度」と記載されている場合には、それは広義的に解釈されてよく、「明度」を含むものとして解釈されてよい。 In addition, there are lightness and luminance as indices that indicate the degree of brightness. Generally, for example, the term "luminance" is used in color spaces such as YCbCr, HSL, and RGB, while the term "lightness" is used in color spaces such as Lab and HSV. However, they have similar properties in that they indicate the degree of brightness. When "lightness" is stated in the claims, it may be interpreted broadly and may be interpreted as including "luminance." When "luminance" is stated in the claims, it may be interpreted broadly and may be interpreted as including "lightness."

<カラー補正画像の取得処理の流れ>
図1は、カラー補正画像18の取得処理の流れを示す図である。元カラー画像100は、カメラの撮影画像である。なお、各図に示された画像は例示であって、模式的に表わされている。例示の元カラー画像100には、左右両側が複数の木があることで暗くなっており、略中央の開けた部分が陽射し(不図示)が強くあたることで明るくなっている様子が示されている。これは、光源で照らされた領域と、光源で照らされない領域とで極端な明暗差が生じて、明部と暗部でダイナミックレンジが狭くなっている例である。このような画像に対して処理を行って、明部と暗部の両方のダイナミックレンジを広げたカラー補正画像18(図1参照)を得られるようにする。
<Flow of color correction image acquisition process>
FIG. 1 is a diagram showing the flow of the process of acquiring a color-corrected image 18. An original color image 100 is an image captured by a camera. The images shown in each figure are illustrative and are represented diagrammatically. In the illustrative original color image 100, both the left and right sides are darkened by the presence of multiple trees, and an open area in the approximate center is brightened by strong sunlight (not shown). This is an example in which an extreme difference in brightness occurs between an area illuminated by a light source and an area not illuminated by the light source, narrowing the dynamic range between the bright and dark areas. Processing is performed on such an image to obtain a color-corrected image 18 (see FIG. 1) in which the dynamic range of both the bright and dark areas is expanded.

なお、明部と暗部のダイナミックレンジが狭くなる別の一例としては、水中で撮影された画像がある。水中(例えば海中)では、プランクトン、マリンスノー、泥など微小な物体が浮遊する関係で濁り(遠くが見えない)が生じ得て、太陽光が届かないことから、光源で照らす領域と照らさない領域で極端な明暗差が生じ、カメラの映像が鮮明でないことが多い。近年、洋上風力発電の風車の設置が進んでいるところ、水中にある風車の根本付近の点検に、カメラ映像を使うことが考えられ、その映像は鮮明であることが望まれる。ここで説明する実施形態は、そのような水中のカメラ映像を鮮明化する手段としても使用可能なものである。以下、具体的にカラー補正画像18の取得処理について説明する。 Another example of a narrow dynamic range between light and dark areas is an image taken underwater. Underwater (for example, in the sea), plankton, marine snow, mud, and other tiny floating objects can cause turbidity (making it difficult to see far away), and sunlight cannot reach the area, resulting in extreme differences in brightness between areas illuminated by the light source and areas not illuminated, and camera images are often not clear. In recent years, as more and more wind turbines are being installed for offshore wind power generation, it is considered that camera images will be used to inspect the area around the base of the turbines underwater, and it is desirable for the images to be clear. The embodiment described here can also be used as a means of sharpening such underwater camera images. Below, the process of acquiring the color-corrected image 18 will be described in detail.

S100で、画像処理装置は、元カラー画像100を、明度成分(V)の画像10と色成分(色相H/彩度S)の画像16に分離する。ここで、明度成分(V)の画像10が、元画像10である。明度成分(V)の画像10の各画素値は、明度である。 At S100, the image processing device separates the original color image 100 into an image 10 of the luminance component (V) and an image 16 of the color components (hue H/saturation S). Here, the image 10 of the luminance component (V) is the original image 10. Each pixel value of the image 10 of the luminance component (V) is luminance.

次に、S102で、画像処理装置は、照明成分推定処理により、元画像10から照明画像12を生成する。そして、S104で、画像処理装置は、領域別加重合成処理により、元画像10と照明画像12から、色なしの補正画像14を生成する。なお、照明成分推定処理と領域別加重合成処理については、以下で詳しく説明する。 Next, in S102, the image processing device generates an illumination image 12 from the original image 10 by illumination component estimation processing. Then, in S104, the image processing device generates a colorless corrected image 14 from the original image 10 and the illumination image 12 by region-specific weighted synthesis processing. The illumination component estimation processing and region-specific weighted synthesis processing will be described in detail below.

そして、S106で、画像処理装置は、色なし補正画像14と色成分画像16を合成して、カラー補正画像18を取得する。 Then, in S106, the image processing device combines the colorless corrected image 14 and the color component image 16 to obtain a color corrected image 18.

<照明成分推定処理と領域別加重合成処理>
以下では、図1のS102の照明成分推定処理、S104の領域別加重合成処理について、詳しく説明する。図2は、これらの処理の流れを示すフローチャートである。ここでは、まず、各処理の技術前提について説明する。
<Illumination component estimation processing and area-specific weighted synthesis processing>
The illumination component estimation process in S102 and the area-specific weighted synthesis process in S104 in Fig. 1 will be described in detail below. Fig. 2 is a flowchart showing the flow of these processes. Here, the technical premise of each process will be described first.

画像の視認性劣化の原因としては、主に次のようなものが挙げられる。
(1)逆光(環境光が強いこと)による視認性の劣化
(2)環境光が弱いこと(例えば夜間)による視認性の劣化
(3)霧/霞による視認性の劣化
The main causes of deterioration in image visibility are as follows:
(1) Deterioration of visibility due to backlighting (strong ambient light) (2) Deterioration of visibility due to weak ambient light (e.g., at night) (3) Deterioration of visibility due to fog/haze

上記(1)については、逆光のため相対的に暗くなってしまった領域のダイナミックレンジを上げる逆光補正を行えば視認性が向上する。また、上記(2)については、全体的に暗くなってしまった画像全体のダイナミックレンジを上げる暗部補正を行えば視認性が向上する。逆光補正と暗部補正は、どちらも画像の暗部のダイナミックレンジを広げる処理(Retinex)である。 Regarding (1) above, visibility can be improved by performing backlight correction, which increases the dynamic range of areas that are relatively dark due to backlight. Also, regarding (2) above, visibility can be improved by performing dark area correction, which increases the dynamic range of the entire image that is dark overall. Both backlight correction and dark area correction are processes (Retinex) that expand the dynamic range of dark areas of an image.

一方、上記(3)については、霧や霞により、微粒子が太陽光などを拡散反射することで実際よりも画像が明るくなって(白みを帯びて)いることが原因である。これについては、霧/霞を除去する補正を行えば視認性が向上する。霧/霞の除去は、画像の明部のダイナミックレンジを広げる処理(Dehaze)である。 On the other hand, the above issue of (3) is caused by fog or haze, which causes fine particles to diffusely reflect sunlight and other light, making the image appear brighter (whitish) than it actually is. Visibility can be improved by making corrections to remove the fog/haze. Removing fog/haze is a process known as dehazing, which expands the dynamic range of the bright areas of the image.

ここで、非特許文献1には、RetinexとDehazeの間には、実用的な仮定のもとで、線形の関係(以下、(数1)式の関係)があることが述べられている。 Here, Non-Patent Document 1 states that, under practical assumptions, there is a linear relationship between Retinex and Dehaze (hereinafter, the relationship in Equation 1).

(数1)
Dehaze(J)=1-Retinex(1-J)
(Equation 1)
Dehaze(J)=1-Retinex(1-J)

上記(数1)式において、Jはヘイズ画像(もや、霞を有する画像)であり、Dehaze(J)はヘイズ画像Jに対してDehaze処理を行った画像、すなわち、ヘイズ画像Jの明部のダイナミックレンジを広げる処理(Dehaze)を行った画像である。上記(数1)式は、ヘイズ画像Jをネガポジ反転させてからRetinex処理を行い、その後さらにネガポジ反転させると、ヘイズ除去ができる(明部のダイナミックレンジを広げることができる)ことを示したものである。RetinexとDehazeは、「原画像の色味を保ちながら明るさを変える」という意味において同じ問題を解いている。 In the above formula (1), J is a haze image (an image having mist or fog), and Dehaze(J) is an image obtained by performing Dehaze processing on haze image J, i.e., an image obtained by performing processing (Dehaze) to expand the dynamic range of the bright areas of haze image J. The above formula (1) shows that haze can be removed (the dynamic range of the bright areas can be expanded) by performing negative-positive inversion on haze image J, followed by Retinex processing, and then further negative-positive inversion. Retinex and Dehaze solve the same problem in the sense of "changing the brightness while maintaining the color of the original image."

ここで、発明者は、上記(数1)式を参考として、Retinex処理を用いて、画像の明部と暗部の両方のダイナミックレンジを広げる処理が可能であることを見い出した。すなわち、上記したように、画像の暗部のダイナミックレンジを広げる処理はRetinex処理であり、(数1)式に示すように画像の明部のダイナミックレンジを広げる処理もRetinex処理を用いて行うことが可能である。 Here, the inventors have found, with reference to the above formula (1), that it is possible to use Retinex processing to widen the dynamic range of both the bright and dark areas of an image. In other words, as described above, the process of widening the dynamic range of the dark areas of an image is Retinex processing, and as shown in formula (1), it is also possible to use Retinex processing to widen the dynamic range of the bright areas of an image.

以下、図2を参照しながら、具体的な処理について説明する。なお、図2に示す画素値I,L,Id’,Il’,I’は、正規化された0~1の範囲の値をとるものである。 The specific process will be described below with reference to Figure 2. Note that the pixel values I, L, Id', Il', and I' shown in Figure 2 are normalized values in the range of 0 to 1.

S102で、画像処理装置は、元画像10(明度画像)から照明成分Lを推定して、照明画像12(画素値L)を生成する照明成分推定処理を行う。Retinex理論は、人間の目が照明光に関係なく色や明るさを感じられるという、色恒常性、明るさ恒常性に関する理論である。Retinex理論では、映像Iは、物体を照らす照明光Lとその物体の反射率Rとの積として表わされる。これは、本実施形態では以下の(数2)式で表わされる。 At S102, the image processing device performs an illumination component estimation process in which the illumination component L is estimated from the original image 10 (brightness image) to generate an illumination image 12 (pixel value L). The Retinex theory is a theory regarding color constancy and brightness constancy, which states that the human eye can sense color and brightness regardless of the illumination light. In the Retinex theory, an image I is expressed as the product of the illumination light L that illuminates an object and the reflectance R of that object. In this embodiment, this is expressed by the following equation (2).

(数2)
元画像の画素値I=照明成分L*反射率成分R
(Equation 2)
Pixel value of original image I = illumination component L * reflectance component R

Retinex理論は、上記の(数2)式における照明成分Lを、例えば平滑化画像などで近似できるとしている。そこで、本実施形態の画像処理装置は、Retinex理論に基づいて元画像の照明成分を推定する。具体的には、画像処理装置は、照明成分推定処理において、元画像10をガウシアンフィルタ等で平滑化したぼかし画像(平滑化画像)を生成し、ぼかし画像の画素値を照明成分Lとして取得する。なお、照明成分Lの取得方法は、Retinex理論に基づいている限り、その他の方法であってもよい。 The Retinex theory states that the illumination component L in the above equation (2) can be approximated by, for example, a smoothed image. Therefore, the image processing device of this embodiment estimates the illumination component of the original image based on the Retinex theory. Specifically, in the illumination component estimation process, the image processing device generates a blurred image (smoothed image) by smoothing the original image 10 using a Gaussian filter or the like, and obtains the pixel values of the blurred image as the illumination component L. Note that the method of obtaining the illumination component L may be any other method as long as it is based on the Retinex theory.

次に、S104で、画像処理装置は、領域別加重合成処理(単に合成処理とも言う)により、元画像10と照明画像12から、補正画像14を生成する。具体的に合成処理について説明する。 Next, in S104, the image processing device generates a corrected image 14 from the original image 10 and the illumination image 12 by region-based weighted synthesis processing (also simply called synthesis processing). The synthesis processing will be described in detail.

上記(数2)式から、反射率成分R=I/Lとなる。つまり、暗部を補正すべく照明成分を均一化する(反射率成分だけを残す)場合は、以下の(数3)式を用いる。 From the above formula (2), the reflectance component R = I/L. In other words, to homogenize the illumination component to correct the dark areas (leaving only the reflectance component), the following formula (3) is used.

(数3)
暗部補正の画素値Id’=R=I/L
(Equation 3)
Dark area correction pixel value Id'=R=I/L

ここで、(数3)式における画素値I,Lは、元画像10と照明画像12の中の同一の画素位置における画素値である。これは、以下説明する(数4)~(数6)式の画素値I,L,Il’,Id’,I’についても同様である。上記(数3)式に示すように、元画像の画素値Iを、照明画像の画素値Lで除算することで、暗部補正の画素値Id’が取得される。画像処理装置は、元画像10の全画素について(数3)式を行うことで、暗部補正の全画素の画素値(暗部補正画像)を取得することができる。なお、(数3)式におけるI/Lが、Retinex処理である。 Here, the pixel values I and L in (Equation 3) are pixel values at the same pixel position in the original image 10 and the illuminated image 12. This also applies to the pixel values I, L, Il', Id', and I' in (Equation 4) to (Equation 6) described below. As shown in (Equation 3) above, the pixel value Id' for the dark correction is obtained by dividing the pixel value I of the original image by the pixel value L of the illuminated image. The image processing device can obtain the pixel values of all pixels for the dark correction (dark correction image) by performing (Equation 3) on all pixels of the original image 10. Note that I/L in (Equation 3) is the Retinex process.

次に、上記した(数1)式のRetinexとDehazeの関係に基づいて明部を補正すべく照明成分を均一化する場合は、以下の(数4)式を用いる。 Next, when homogenizing the illumination components to correct bright areas based on the relationship between Retinex and Dehaze in the above (Equation 1), the following (Equation 4) is used.

(数4)
明部補正の画素値Il’=(1.0-(1.0-I)/(1.0-L))
(Equation 4)
Brightness correction pixel value Il'=(1.0-(1.0-I)/(1.0-L))

上記(数4)式に示すように、元画像の画素値Iを明度反転させた反転明度画像の画素値(1.0-I)を、照明画像の画素値Lを明度反転させた反転照明画像の画素値(1.0-L)で除算して得られる画素値((1.0-I)/(1.0-L))を、明度反転することで、明部補正の画素値Il’が取得される。画像処理装置は、元画像10の全画素について(数4)式を行うことで、明部補正の全画素の画素値(明部補正画像)を取得することができる。なお、(数1)式と(数4)式を対応づけて見ればわかるように、(数4)式における(1.0-I)/(1.0-L)が、Retinex処理である。 As shown in the above formula (4), the pixel value (1.0-I) of the inverted brightness image, which is the result of inverting the brightness of the pixel value I of the original image, is divided by the pixel value (1.0-L) of the inverted illumination image, which is the result of inverting the brightness of the pixel value L of the illumination image, to obtain a pixel value ((1.0-I)/(1.0-L)), and the pixel value Il' of the bright area correction is obtained by inverting the brightness. The image processing device can obtain the pixel values of all pixels of the bright area correction (bright area corrected image) by performing formula (4) on all pixels of the original image 10. Note that, as can be seen by matching formula (1) and formula (4), (1.0-I)/(1.0-L) in formula (4) is the Retinex process.

ここで、明部補正と暗部補正の画素値Il’,Id’は、明部と暗部のそれぞれを対象とした補正用の画素値である。よって、これらを重み付けして合成し、1つの画像値とする必要がある。ここで、照明画像12において、画素値(照明成分L)が高いところは明部、画素値(照明成分L)が低いところは暗部とみなすことができるため、照明成分Lを、2つの画素値Il’,Id’を合成する際の係数として使うことができる。すなわち、補正画像14の画素値I’は、以下の(数5)式で表わすことができる。 Here, the pixel values Il', Id' for the bright area correction and the dark area correction are pixel values for correction targeted at the bright areas and the dark areas, respectively. Therefore, these need to be weighted and combined to create a single image value. Here, in the illumination image 12, areas with high pixel values (illumination component L) can be considered as bright areas, and areas with low pixel values (illumination component L) can be considered as dark areas, so the illumination component L can be used as a coefficient when combining the two pixel values Il', Id'. In other words, the pixel value I' of the correction image 14 can be expressed by the following formula (5).

(数5)
補正画像の画素値I’=(1.0-L)*Id’+L*Il’
(Equation 5)
Pixel value of corrected image I'=(1.0-L)*Id'+L*Il'

上記の(数5)式から、以下の(数6)式が導かれる。 From the above formula (5), the following formula (6) can be derived.

(数6)
補正画像の画素値I’=(1.0-L)*I/L+
L*(1.0-(1.0-I)/(1.0-L))
(Equation 6)
Pixel value of corrected image I'=(1.0-L)*I/L+
L*(1.0-(1.0-I)/(1.0-L))

画像処理装置は、元画像10の全画素に関して(数6)式を行うことで、補正画像14を取得することができる。ここで、(数6)式を用いて補正画像14を生成する処理が、領域別加重合成処理である。 The image processing device can obtain the corrected image 14 by performing equation (6) on all pixels of the original image 10. Here, the process of generating the corrected image 14 using equation (6) is the region-specific weighted synthesis process.

ここで、領域別加重合成処理は、元画像10と照明画像12に基づいて得られる明部補正と暗部補正のそれぞれの画素値Il’,Id’を、照明画像12の画素値Lで重み付けして合成することで、補正画像(画素値I’)を生成する処理、と説明することができる。しかし、これは、明部補正と暗部補正のそれぞれの画素値Il’,Id’を予め算出しておき(図2のS104-1、S104-2)、その後、補正画像14の画素値I’を算出する(S104-3)形態のみを表わすものではない。すなわち、上記説明において「重み付け」や「合成」といった用語は、領域別加重合成処理を表現するために使っているだけである。上記説明の領域別加重合成処理には、元画像10と照明画像12の画素値I,Lのみを用いて(つまり、明部補正と暗部補正の画素値を算出しないで(明部補正と暗部補正を個別に意識しないで))、(数6)式により、補正画像14の画素値I’を算出する形態(S104-3のみを行う形態、つまり、(数6)式のみを行う形態)を含むものである。 Here, the regional weighted compositing process can be described as a process of generating a corrected image (pixel value I') by weighting and compositing the pixel values Il', Id' of the bright area correction and dark area correction obtained based on the original image 10 and the illumination image 12 with the pixel value L of the illumination image 12. However, this does not only represent a form in which the pixel values Il', Id' of the bright area correction and dark area correction are calculated in advance (S104-1, S104-2 in FIG. 2) and then the pixel value I' of the corrected image 14 is calculated (S104-3). In other words, the terms "weighting" and "compositing" in the above explanation are only used to represent the regional weighted compositing process. The above-described weighted synthesis process by region includes a form in which pixel values I' of corrected image 14 are calculated using only pixel values I and L of original image 10 and illuminated image 12 (i.e., without calculating pixel values for bright area correction and dark area correction (without considering bright area correction and dark area correction individually)) according to equation (6) (a form in which only S104-3 is performed, i.e., a form in which only equation (6) is performed).

以上説明した実施形態によれば、図3に模式的に例示するように、1つの元画像10における明部30と暗部32の両方のダイナミックレンジを広げた補正画像14が得られるようになる。補正画像14において、明部30と暗部32が鮮明化されて、それらの部分の視認性が向上することになる。 According to the embodiment described above, as illustrated in FIG. 3, a corrected image 14 is obtained in which the dynamic range of both the bright areas 30 and the dark areas 32 in one original image 10 is expanded. In the corrected image 14, the bright areas 30 and the dark areas 32 are made clearer, improving the visibility of these areas.

また、以上説明した実施形態によれば、明部補正、暗部補正、およびそれらの合成、からなる3つの処理と同等の作用効果を、1つの領域別加重合成処理((数6)式)から得ることができる。 In addition, according to the embodiment described above, it is possible to obtain the same effect as the three processes consisting of light area correction, dark area correction, and their combination from a single area-based weighted combination process (Equation 6).

また、以上説明した照明成分推定処理によれば、ヒストグラム処理などが無いため、メモリ使用量が増大化することがなく、1つの元画像の複数部分を並列処理することも可能である。また、領域別加重合成処理によれば、明/暗の補正処理を1ステップで処理でき(計算コスト低減)、画素ごとに並列に実行することができるため、高速処理が可能である。例えば、GPU/FPGAを用いて、画素ごとに並列処理することも可能である。また、動画においてリアルタイム処理も可能である。 In addition, the illumination component estimation process described above does not require histogram processing, so memory usage does not increase and it is possible to process multiple parts of one original image in parallel. Furthermore, the region-specific weighted synthesis process allows brightness/darkness correction processing to be processed in one step (reducing calculation costs) and can be performed in parallel for each pixel, allowing high-speed processing. For example, it is possible to use a GPU/FPGA to perform parallel processing for each pixel. Real-time processing of moving images is also possible.

本実施形態は、Retinex理論に基づき、照明成分を推定し、推定した照明成分の度合を明暗の度合として捉えて明部/暗部の領域を判断し、かつ推定した照明成分の度合を使って明部/暗部双方に適切な補正値を算出する。それにより、推定した照明成分を、明部/暗部の領域の判断、補正値の算出の2種類の情報として使いまわすことができるため、計算コストを抑えつつ、明部/暗部双方に効果のある補正処理を実現することができる。 This embodiment estimates the illumination component based on the Retinex theory, interprets the degree of the estimated illumination component as the degree of brightness to determine the bright and dark areas, and calculates appropriate correction values for both the bright and dark areas using the degree of the estimated illumination component. This makes it possible to reuse the estimated illumination component as two types of information for determining the bright and dark areas and for calculating the correction values, thereby realizing correction processing that is effective for both the bright and dark areas while keeping calculation costs down.

<明暗領域を表示するGUI>
次に、明暗領域を表示するGUI(Graphical User Interface)について説明する。図4は、このGUIの説明図である。画像処理装置は、図4(A)に示すような調整用画像22を、表示部としてのディスプレイに表示する制御を行う。調整用画像22は、照明成分に基づいて明部領域30aと暗部領域32aを区別して表わした画像であり、それぞれの領域30a、32aをユーザが確認、修正するための画像である。
<GUI for displaying light and dark areas>
Next, a GUI (Graphical User Interface) for displaying light and dark regions will be described. Fig. 4 is an explanatory diagram of this GUI. The image processing device performs control to display an adjustment image 22 as shown in Fig. 4(A) on a display serving as a display unit. The adjustment image 22 is an image that distinguishes a light region 30a and a dark region 32a based on the illumination component, and is an image that allows the user to confirm and correct each of the regions 30a, 32a.

具体的には、画像処理装置は、照明画像における画素値Lが閾値Thより高い領域である明部領域30aと、その画素値Lが閾値Th以下である暗部領域32aとを、元画像10または元カラー画像100に重畳させた調整用画像22を、ディスプレイに表示する制御を行う。図4(A)の調整用画像22に示すように、例えば、明部領域30aは白色等の明るい色を元画像10等に重畳させて表わされ、暗部領域32aは灰色等の暗い色を元画像10等に重畳させて表わされる。また、明部領域30aと暗部領域32aの境界には、黒色等の境界線34が設けられる。 Specifically, the image processing device controls the display to display an adjustment image 22 in which bright areas 30a, which are areas in the illumination image where the pixel value L is higher than a threshold value Th, and dark areas 32a, where the pixel value L is equal to or lower than the threshold value Th, are superimposed on the original image 10 or original color image 100. As shown in the adjustment image 22 in FIG. 4(A), for example, the bright areas 30a are represented by superimposing a bright color such as white on the original image 10, etc., and the dark areas 32a are represented by superimposing a dark color such as gray on the original image 10, etc. In addition, a boundary line 34, such as black, is provided at the boundary between the bright areas 30a and the dark areas 32a.

そして、画像処理装置は、調整用画像22における明部領域30aと暗部領域32aを変更する指示を、ユーザから受け付ける。そして、画像処理装置は、ユーザからの変更指示に基づいて、照明画像の画素値(照明成分L)を更新して、更新された照明画像に基づいて補正画像14、カラー補正画像18を再び生成する。そして、画像処理装置は、再生成された補正画像14又はカラー補正画像18を、ディスプレイに表示する制御を行う。これにより、再生成(更新)された補正画像14又はカラー補正画像18を、ユーザが確認できるようにする。 The image processing device then receives an instruction from the user to change the bright areas 30a and dark areas 32a in the adjustment image 22. The image processing device then updates the pixel values (illumination component L) of the illumination image based on the change instruction from the user, and regenerates the corrected image 14 and color corrected image 18 based on the updated illumination image. The image processing device then controls the display of the regenerated corrected image 14 or color corrected image 18 on the display. This allows the user to check the regenerated (updated) corrected image 14 or color corrected image 18.

ユーザの変更指示の方式としては、例えば次のような方式がある。
(A)境界線34をマウスやタッチで移動する。
(B)明部領域30aまたは暗部領域32aにおいて、指でこすった度合で(指でこすった領域の)照明成分を増加または減少させる。
(C)明部領域30aと暗部領域32aのいずれかを選択し、選択した領域の照明成分を、スライダーなどで調節する。
The method of the user's change instruction is, for example, as follows.
(A) The boundary line 34 is moved using the mouse or by touch.
(B) In the bright area 30a or the dark area 32a, the illumination component (of the area rubbed with a finger) is increased or decreased according to the degree of rubbing with a finger.
(C) Either the bright area 30a or the dark area 32a is selected, and the illumination component of the selected area is adjusted using a slider or the like.

上記(A)については、例えば、入力装置としてのマウスで境界線34の一部をドラッグアンドドロップして、その境界線34の一部の位置を移動させる形態や、入出力装置としてのタッチパネル上で境界線34の一部に指をタッチした後に指を移動させ、その後、指をタッチパネルから離すことで、その境界線34の一部を移動させる形態等が考えられる。そして、画像処理装置は、例えば、新たに明部領域30aから暗部領域32aになった領域には、上記の閾値Th以下である、予め定められた照明成分Lを割り当てる。また、画像処理装置は、例えば、新たに暗部領域32aから明部領域30aになった領域には、上記の閾値Thより高い、予め定められた照明成分Lを割り当てる。 Regarding (A) above, for example, a form in which a part of the boundary line 34 is moved by dragging and dropping the part of the boundary line 34 with a mouse as an input device, or a form in which a part of the boundary line 34 is moved by touching a part of the boundary line 34 with a finger on a touch panel as an input/output device, moving the finger, and then removing the finger from the touch panel. Then, the image processing device assigns, for example, a predetermined illumination component L that is equal to or less than the above threshold value Th to a region that has newly changed from a bright region 30a to a dark region 32a. Also, the image processing device assigns, for example, a predetermined illumination component L that is higher than the above threshold value Th to a region that has newly changed from a dark region 32a to a bright region 30a.

上記(B)については、例えば、タッチパネル上に照明成分を増加させるか、または、減少させるかを示す選択ボタンを表示させて、ユーザにどちらかを選択させた後、タッチパネル上でユーザが指で1回こする毎に予め定められた量だけ照明成分を増減させる(増加させるか減少させるかは上記選択ボタンの選択に依存する)形態が考えられる。 As for (B) above, for example, a conceivable form is that a selection button indicating whether to increase or decrease the lighting component is displayed on the touch panel, and the user is allowed to select one of the options, and then each time the user rubs their finger once on the touch panel, the lighting component is increased or decreased by a predetermined amount (whether to increase or decrease depends on the selection of the selection button).

上記(C)については、例えば、マウスやタッチパネル操作により、明部領域30aと暗部領域32aのいずれかをユーザに選択させ、ディスプレイやタッチパネルにスライダーを表示させ、ユーザに、マウスやタッチパネル操作により、スライダーを操作させる形態等が考えられる。 As for (C) above, for example, a possible configuration is to have the user select either the bright area 30a or the dark area 32a by operating a mouse or a touch panel, and have a slider displayed on a display or touch panel, and have the user operate the slider by operating a mouse or a touch panel.

なお、例えば画像処理装置がカメラであれば、カメラに設けられたタッチパネルやディスプレイにおいて、ユーザが上記の操作を行ってもよい。また、カメラによる動画の撮影中などに、リアルタイムで、ユーザが上記の操作を行う形態であってもよい。 For example, if the image processing device is a camera, the user may perform the above operations on a touch panel or display provided on the camera. Also, the user may perform the above operations in real time, such as while the camera is capturing video.

<照明成分の補正のGUI>
次に、照明成分の補正のGUIについて説明する。図5は、このGUIの説明図である。画像処理装置は、図5に示すように、照明画像の画素値(照明成分L)を補正するための補正係数(図5の+0.5、+0.25等)をユーザから受け付け、補正係数に基づいて照明画像の画素値を更新してもよい。例えば、新しい照明成分を「新照明成分」と表わし、現在の照明成分を「現照明成分」と表わすと、「新照明成分=現照明成分+補正係数」とする。そして、画像処理装置は、更新された照明画像(新照明成分)に基づいて補正画像14、カラー補正画像18を再び生成して、再生成された補正画像14、カラー補正画像18をディスプレイに表示する制御を行ってもよい(図5の14-1~14-3、18-1~18-3を参照)。
<GUI for correcting lighting components>
Next, a GUI for correcting the illumination component will be described. FIG. 5 is an explanatory diagram of this GUI. As shown in FIG. 5, the image processing device may receive a correction coefficient (+0.5, +0.25, etc. in FIG. 5) for correcting the pixel value (illumination component L) of the illumination image from the user, and update the pixel value of the illumination image based on the correction coefficient. For example, if the new illumination component is represented as a "new illumination component" and the current illumination component is represented as a "current illumination component", then "new illumination component = current illumination component + correction coefficient". Then, the image processing device may perform control to generate the correction image 14 and the color correction image 18 again based on the updated illumination image (new illumination component) and display the regenerated correction image 14 and the color correction image 18 on the display (see 14-1 to 14-3, 18-1 to 18-3 in FIG. 5).

画像処理装置は、例えば、補正係数を入力するためのテキストボックスをディスプレイに表示して、ユーザからマウス・キーボード、タッチパネル等によりテキストボックスに補正係数を受け付けるとよい。そして、画像処理装置は、ユーザから受け付けた補正係数によって更新した照明画像(新照明成分)を用いて、補正画像14、カラー補正画像18を再生成し、それらの画像14,18をディスプレイに表示するとよい。 The image processing device may, for example, display a text box on the display for inputting a correction coefficient, and accept the correction coefficient from the user in the text box via a mouse, keyboard, touch panel, or the like. The image processing device may then regenerate the correction image 14 and the color correction image 18 using an illumination image (new illumination component) updated with the correction coefficient accepted from the user, and display these images 14 and 18 on the display.

このような実施形態によれば、ユーザが、補正画像14、カラー補正画像18等の結果を参照しながら、照明成分に一定値(補正係数)を加算または乗算するなどして、補正係数を決定することができる。なお、加算の場合には、「新照明成分=現照明成分+補正係数」となり、乗算の場合には、「新照明成分=現照明成分×補正係数」となる。なお、明部領域30aと暗部領域32a(図4(A)参照)に同じ補正係数を加算または乗算してもよいし、別の補正係数を加算または乗算してもよい。また、明部領域30aと暗部領域32aの一方をユーザに選択させて、選択された領域のみに補正係数を加算または乗算するとしてもよい。 According to such an embodiment, the user can determine the correction coefficient by adding or multiplying the lighting component by a constant value (correction coefficient) while referring to the results of the correction image 14, the color correction image 18, etc. In the case of addition, "new lighting component = current lighting component + correction coefficient", and in the case of multiplication, "new lighting component = current lighting component × correction coefficient". The same correction coefficient may be added to or multiplied to the bright area 30a and the dark area 32a (see FIG. 4(A)), or different correction coefficients may be added to or multiplied to them. Also, the user may be allowed to select either the bright area 30a or the dark area 32a, and the correction coefficient may be added to or multiplied to only the selected area.

なお、例えば画像処理装置がカメラであれば、カメラに設けられたボタン、タッチパネル等を用いて、ユーザが補正係数を入力してもよい。また、カメラによる動画の撮影中などに、リアルタイムで、ユーザが補正係数を入力する形態であってもよい。 For example, if the image processing device is a camera, the user may input the correction coefficient using a button, touch panel, or the like provided on the camera. Also, the user may input the correction coefficient in real time, such as while the camera is capturing video.

<カーネルの手動調整>
次に、カーネル(フィルタとも言う)の手動調整について説明する。Retinex理論に基づいて照明成分を求める際には、撮影対象の大きさ、撮影対象との距離、画角、解像度などの状況を元に適切なカーネルサイズやシグマ値を設定することが望まれる。ここでは、それをユーザが設定する形態について説明する。図6は、この形態についての説明図である。
<Manual kernel adjustment>
Next, manual adjustment of the kernel (also called a filter) will be described. When obtaining an illumination component based on the Retinex theory, it is desirable to set an appropriate kernel size and sigma value based on the size of the subject, the distance to the subject, the angle of view, the resolution, and other conditions. Here, a form in which the user sets them will be described. Figure 6 is an explanatory diagram of this form.

上記したように、画像処理装置は、照明成分推定処理において、元画像を平滑化したぼかし画像を、照明画像(照明成分L)として取得する。この際、ガウシアンフィルタ等のカーネルを用いる。ここで説明する形態は、そのカーネルを調整するものである。具体的には、画像処理装置は、カーネルサイズ、カーネルのシグマ値、またはそれらの両方を、ユーザから受け付ける。そして、画像処理装置は、照明成分推定処理において、ユーザから受け付けたカーネルサイズ、カーネルのシグマ値、またはそれらの両方を有するカーネルを用いて、照明画像(ぼかし画像)を取得する。そして、画像処理装置は、その照明画像を用いて、補正画像やカラー補正画像を生成する。 As described above, in the illumination component estimation process, the image processing device obtains a blurred image obtained by smoothing the original image as an illumination image (illumination component L). At this time, a kernel such as a Gaussian filter is used. The form described here adjusts the kernel. Specifically, the image processing device receives a kernel size, a kernel sigma value, or both, from the user. Then, in the illumination component estimation process, the image processing device obtains an illumination image (blurred image) using a kernel having the kernel size, kernel sigma value, or both, received from the user. Then, the image processing device uses the illumination image to generate a correction image or a color correction image.

画像処理装置は、例えば、カーネルサイズ、カーネルのシグマ値を入力するためのテキストボックスをディスプレイに表示して、ユーザからマウス・キーボード、タッチパネル等により、テキストボックスにカーネルサイズ、カーネルのシグマ値を受け付けるとよい。そして、画像処理装置は、ユーザから受け付けたカーネルサイズ、カーネルのシグマ値を有するカーネルを用いて照明画像を取得するとよい。そして、画像処理装置は、その照明画像を用いて生成された補正画像14、カラー補正画像18をディスプレイに表示するとよい。 The image processing device may, for example, display a text box on the display for inputting the kernel size and the kernel sigma value, and accept the kernel size and the kernel sigma value in the text box from the user via a mouse, keyboard, touch panel, or the like. The image processing device may then obtain an illumination image using a kernel having the kernel size and kernel sigma value accepted from the user. The image processing device may then display on the display the correction image 14 and color correction image 18 generated using the illumination image.

また、画像処理装置は、図6に示すように、調整用画像22-1~22-3をディスプレイに表示してもよい。画像処理装置は、例えば、図6に示すように、ユーザから入力されたカーネルサイズ(以下、入力カーネルサイズと言う)と、入力カーネルサイズよりも所定サイズ小さいカーネルサイズと、入力カーネルサイズよりも所定サイズ大きいカーネルサイズとのそれぞれに対応する調整用画像22-1~22-3を、ディスプレイに表示する、としてもよい。このような実施形態によれば、ユーザが、調整用画像22-1~22-3等の結果を参照しながら、カーネルサイズやシグマ値を決定することができる。 The image processing device may also display adjustment images 22-1 to 22-3 on a display as shown in FIG. 6. For example, as shown in FIG. 6, the image processing device may display adjustment images 22-1 to 22-3 on a display that correspond to a kernel size input by a user (hereinafter referred to as an input kernel size), a kernel size that is a predetermined size smaller than the input kernel size, and a kernel size that is a predetermined size larger than the input kernel size. According to such an embodiment, the user can determine the kernel size and sigma value while referring to the results of adjustment images 22-1 to 22-3, etc.

例えば、ユーザは、局所的な領域の視認性を上げたい場合には、カーネルサイズを小さくすることで視認性を向上することができる。また、ユーザは、大局的な領域の視認性を上げたい場合には、カーネルサイズを大きくすることで視認性を向上することができる。 For example, if a user wishes to improve the visibility of a local area, the user can improve the visibility by reducing the kernel size. On the other hand, if a user wishes to improve the visibility of a global area, the user can improve the visibility by increasing the kernel size.

<カーネルの自動調整>
次に、カーネルの自動調整について説明する。以上説明した実施形態では、ユーザによりカーネルを手動調整するものであったが、ここで説明する形態は、画像に含まれる属性情報やその他の情報に基づいて、カーネルを自動調整するものである。図7は、この形態に関する説明図である。
<Automatic kernel tuning>
Next, automatic adjustment of the kernel will be described. In the above-described embodiment, the kernel is manually adjusted by the user, but the embodiment described here is one in which the kernel is automatically adjusted based on attribute information and other information contained in the image. Fig. 7 is an explanatory diagram relating to this embodiment.

例えば、カメラ200のパラメータとしては解像度、画角等がある。また、カメラ200の撮影画像内での撮影対象物(単に対象物とも記す)の大きさを、画像認識処理等により判別することが可能である。また、距離センサ(例えばカメラ200に設けられた、赤外線、音波などを用いたセンサ)等により、カメラ200と対象物の間の距離を取得することが可能である。画像処理装置(一例としてカメラ200自体であり得る)は、これらの解像度、画角、対象物の大きさ、対象物との距離等から、カーネルサイズを設定することができる。 For example, the parameters of the camera 200 include the resolution, the angle of view, etc. Also, the size of the object being photographed (also simply referred to as the object) in the image captured by the camera 200 can be determined by image recognition processing, etc. Also, the distance between the camera 200 and the object can be obtained by a distance sensor (for example, a sensor using infrared rays, sound waves, etc., provided in the camera 200). The image processing device (which can be the camera 200 itself, as an example) can set the kernel size from these resolution, angle of view, size of the object, distance from the object, etc.

例えば、画像処理装置は、元画像に現れる対象物に関し、撮影時のカメラ200と対象物の間の距離の情報を取得し、照明成分推定処理において、カメラ200と対象物の間の距離が長い場合にはそれが短い場合に比べて、カーネルサイズが小さいカーネルを用いて、照明画像を取得する。カメラ200と対象物が離れている(距離が長い)場合には、視認したい領域が相対的に小さくなるので、カーネルサイズを小さくすることで視認性を向上することができる。一方、カメラ200と対象物が近い(距離が短い)場合には、視認したい領域が相対的に大きくなるので、カーネルサイズを大きくすることで視認性を向上することができる。 For example, the image processing device acquires information on the distance between the camera 200 and the object at the time of capture for an object appearing in the original image, and in the illumination component estimation process, when the distance between the camera 200 and the object is long, an illumination image is acquired using a kernel with a smaller kernel size than when the distance is short. When the camera 200 and the object are far away (the distance is long), the area to be viewed is relatively small, so visibility can be improved by reducing the kernel size. On the other hand, when the camera 200 and the object are close (the distance is short), the area to be viewed is relatively large, so visibility can be improved by increasing the kernel size.

また、例えば、画像処理装置は、元画像に現れる対象物に関し、元画像の全体に対する対象物の大きさの情報を取得し、照明成分推定処理において、対象物の大きさが小さい場合にはそれが大きい場合に比べて、カーネルサイズが小さいカーネルを用いて、照明画像を取得する。対象物が小さい場合には、視認したい領域が相対的に小さくなるので、カーネルサイズを小さくすることで視認性を向上することができる。一方、対象物が大きい場合には、視認したい領域が相対的に大きくなるので、カーネルサイズを大きくすることで視認性を向上することができる。 Also, for example, the image processing device acquires information on the size of an object appearing in an original image relative to the entire original image, and in the illumination component estimation process, when the size of the object is small, an illumination image is acquired using a kernel with a smaller kernel size than when the size of the object is large. When the object is small, the area to be viewed is relatively small, so visibility can be improved by reducing the kernel size. On the other hand, when the object is large, the area to be viewed is relatively large, so visibility can be improved by increasing the kernel size.

また、例えば、画像処理装置は、元画像のカメラによる撮影時の画角の情報を取得し、照明成分推定処理において、画角が大きい場合にはそれが小さい場合に比べて、カーネルサイズが小さいカーネルを用いて、照明画像を取得する。画角が大きい場合には、視認したい領域が相対的に小さくなるので、カーネルサイズを小さくすることで視認性を向上することができる。一方、画角が小さい場合には、視認したい領域が相対的に大きくなるので、カーネルサイズを大きくすることで視認性を向上することができる。 Also, for example, the image processing device acquires information about the angle of view when the original image was captured by the camera, and in the illumination component estimation process, when the angle of view is large, an illumination image is acquired using a kernel with a smaller kernel size than when the angle of view is small. When the angle of view is large, the area to be viewed is relatively small, so visibility can be improved by reducing the kernel size. On the other hand, when the angle of view is small, the area to be viewed is relatively large, so visibility can be improved by increasing the kernel size.

<元画像の別の例>
次に、別の元画像について説明する。以上説明した実施形態では、元画像10は、明度成分(V)の画像であった(図1参照)。しかし、元画像10は、輝度成分(Y)の画像であってもよい。以下では、元画像10が輝度成分(Y)の画像である場合の実施形態について説明する。
<Another example of the original image>
Next, another original image will be described. In the above-described embodiment, the original image 10 is an image of the lightness component (V) (see FIG. 1). However, the original image 10 may be an image of the luminance component (Y). In the following, an embodiment in which the original image 10 is an image of the luminance component (Y) will be described.

図8は、カラー補正画像18の別の取得処理の流れを示す図である。図8の処理について説明する。S200で、画像処理装置は、元カラー画像100を、輝度成分(Y)の画像10Aと色成分(CbCr)の画像16Aに分離する。ここで、輝度成分(Y)の画像10が、元画像10Aである。輝度成分(Y)の画像10の各画素値は、輝度(輝度値)である。 Figure 8 is a diagram showing the flow of another process for obtaining a color-corrected image 18. The process of Figure 8 will be described. In S200, the image processing device separates the original color image 100 into an image 10A of the luminance component (Y) and an image 16A of the color components (CbCr). Here, the image 10 of the luminance component (Y) is the original image 10A. Each pixel value of the image 10 of the luminance component (Y) is luminance (brightness value).

次に、S202で、画像処理装置は、照明成分推定処理により元画像10Aから、照明画像12Aを生成する。そして、S204で、画像処理装置は、領域別加重合成処理により元画像10Aと照明画像12Aから、色なしの補正画像14Aを生成する。そして、S206で、画像処理装置は、色なし補正画像14Aと色成分画像16Aを合成して、カラー補正画像18を取得する。以上説明した図8の処理であっても、補正画像を得ることが可能である。 Next, in S202, the image processing device generates an illumination image 12A from the original image 10A by illumination component estimation processing. Then, in S204, the image processing device generates a colorless corrected image 14A from the original image 10A and the illumination image 12A by region-specific weighted synthesis processing. Then, in S206, the image processing device synthesizes the colorless corrected image 14A and the color component image 16A to obtain a color corrected image 18. It is possible to obtain a corrected image even with the processing of FIG. 8 described above.

<ハードウェア構成>
上記実施形態の画像処理装置は、例えば汎用のコンピュータを用いて構成される。図9に例示するように、画像処理装置1000のベースとなるコンピュータは、プロセッサ1002、ランダムアクセスメモリ(RAM)等のメモリ(主記憶装置)1004、フラッシュメモリやSSD(ソリッドステートドライブ)、HDD(ハードディスクドライブ)等の不揮発性記憶装置である補助記憶装置1006を制御するコントローラ、各種の入出力装置1008とのインタフェース、ローカルエリアネットワークなどのネットワークとの接続のための制御を行うネットワークインタフェース1010等が、例えばバス1012等のデータ伝送路を介して接続された回路構成を有する。上記実施形態の処理の内容が記述されたプログラムが、ネットワーク等を経由してそのコンピュータにインストールされ、補助記憶装置1006に記憶される。補助記憶装置1006に記憶されたプログラムが、プロセッサ1002によりメモリ1004を用いて実行されることにより、本実施形態の画像処理装置1000が構成される。
<Hardware Configuration>
The image processing device of the above embodiment is configured, for example, using a general-purpose computer. As illustrated in FIG. 9, the computer that is the base of the image processing device 1000 has a circuit configuration in which a processor 1002, a memory (main storage device) 1004 such as a random access memory (RAM), a controller that controls an auxiliary storage device 1006 that is a non-volatile storage device such as a flash memory, an SSD (solid state drive), or an HDD (hard disk drive), an interface with various input/output devices 1008, a network interface 1010 that controls connection to a network such as a local area network, and the like are connected via a data transmission path such as a bus 1012. A program in which the contents of the processing of the above embodiment are described is installed in the computer via a network or the like and stored in the auxiliary storage device 1006. The image processing device 1000 of this embodiment is configured by the processor 1002 executing the program stored in the auxiliary storage device 1006 using the memory 1004.

なお、上記プログラムは、インターネット等のネットワークを介して提供することはもちろん、光ディスクやUSBメモリ等のコンピュータ読み取り可能な記録媒体に格納して提供することが可能である。 The above program can be provided via a network such as the Internet, or can be stored on a computer-readable recording medium such as an optical disk or USB memory.

上記実施形態において、プロセッサとは広義的なプロセッサを指し、汎用的なプロセッサ(例えばCPU:Central Processing Unit、等)や、専用のプロセッサ(例えばGPU:Graphics Processing Unit、ASIC:Application Specific Integrated Circuit、FPGA:Field Programmable Gate Array、プログラマブル論理デバイス、等)を含むものである。 In the above embodiment, the term "processor" refers to a processor in a broad sense, including general-purpose processors (e.g., CPU: Central Processing Unit, etc.) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, programmable logic device, etc.).

また上記実施形態におけるプロセッサの動作は、1つのプロセッサによってなすのみでなく、物理的に離れた位置に存在する複数のプロセッサが協働してなすものであってもよい。また、プロセッサの各動作は、以上の実施形態において説明した順序のみに限定されるものではなく、適宜に変更してもよい。 The processor operations in the above embodiments may not only be performed by a single processor, but may also be performed by multiple processors in physically separate locations working together. The order of each processor operation is not limited to the order described in the above embodiments, and may be changed as appropriate.

(付記)
(((1)))
プロセッサを含み、
前記プロセッサは、
Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、
前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、を行う、
画像処理装置。
(((2)))
(((1)))に記載の画像処理装置であって、
前記元画像は、画素値が明度を表わす明度画像である、
画像処理装置。
(((3)))
(((2)))に記載の画像処理装置であって、
前記プロセッサは、
前記元画像の画素値を、前記照明画像の画素値で除算することで、前記暗部補正の画素値を取得し、
前記元画像を明度反転させた反転明度画像の画素値を、前記照明画像を明度反転させた反転照明画像の画素値で除算して得られる画素値を、明度反転することで、前記明部補正の画素値を取得する、
画像処理装置。
(((4)))
(((1)))~(((3)))のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明画像における画素値が閾値より高い領域である明部領域とその画素値が前記閾値以下である暗部領域を、前記元画像または前記元画像に色成分が付加された元カラー画像に重畳させて、表示部に表示する制御を行う、
画像処理装置。
(((5)))
(((4)))に記載の画像処理装置であって、
前記プロセッサは、
前記表示部に表示された前記明部領域と前記暗部領域を変更する指示を、ユーザから受け付け、
前記ユーザからの前記変更の指示に基づいて、前記照明画像の画素値を更新する、
画像処理装置。
(((6)))
(((1)))~(((5)))のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明画像の画素値を補正するための補正係数を、ユーザから受け付け、
前記補正係数に基づいて、前記照明画像の画素値を更新する、
画像処理装置。
(((7)))
(((1)))~(((6)))のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明成分推定処理において、前記元画像を平滑化したぼかし画像を、前記照明画像として取得する、
画像処理装置。
(((8)))
(((7)))に記載の画像処理装置であって、
前記プロセッサは、
カーネルサイズ、カーネルのシグマ値、またはそれらの両方を、ユーザから受け付け、
前記照明成分推定処理において、前記ユーザから受け付けた前記カーネルサイズ、前記カーネルのシグマ値、またはそれらの両方を有するカーネルを用いて、前記照明画像を取得する、
画像処理装置。
(((9)))
(((7)))に記載の画像処理装置であって、
前記プロセッサは、
前記元画像に現れる対象物に関し、カメラによる撮影時の前記カメラと前記対象物の間の距離の情報を取得し、
前記照明成分推定処理において、前記カメラと前記対象物の間の距離が長い場合にはそれが短い場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
(((10)))
(((7)))に記載の画像処理装置であって、
前記プロセッサは、
前記元画像に現れる対象物に関し、前記元画像の全体に対する前記対象物の大きさの情報を取得し、
前記照明成分推定処理において、前記対象物の大きさが小さい場合にはそれが大きい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
(((11)))
(((7)))に記載の画像処理装置であって、
前記プロセッサは、
前記元画像のカメラによる撮影時の画角の情報を取得し、
前記照明成分推定処理において、前記画角が大きい場合にはそれが小さい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
(((12)))
Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、
前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、
をコンピュータに実行させるプログラム。
(Additional Note)
(((1)))
A processor is included.
The processor,
an illumination component estimation process for estimating an illumination component of an original image based on the Retinex theory to obtain an illumination image;
a synthesis process for generating a corrected image by weighting pixel values of the bright area correction and the dark area correction obtained based on the original image and the illumination image by the pixel values of the illumination image and synthesizing the weighted pixel values.
Image processing device.
(((2)))
An image processing device according to any one of claims 1 to 7,
The original image is a brightness image in which pixel values represent brightness.
Image processing device.
(((3)))
An image processing device according to (((2))),
The processor,
obtaining pixel values of the dark correction by dividing pixel values of the original image by pixel values of the illumination image;
obtaining pixel values of the bright area correction by inverting brightness of pixel values obtained by dividing pixel values of an inverted brightness image obtained by inverting brightness of the original image by pixel values of an inverted illumination image obtained by inverting brightness of the illumination image;
Image processing device.
(((4)))
An image processing device according to any one of ((1)) to ((3)),
The processor,
and performing control to superimpose a bright area in the illumination image, which is an area where pixel values are higher than a threshold, and a dark area in the illumination image, which is an area where pixel values are equal to or lower than the threshold, on the original image or an original color image obtained by adding a color component to the original image, and display the superimposed image on a display unit.
Image processing device.
(((5)))
An image processing device according to (((4))),
The processor,
receiving an instruction from a user to change the bright area and the dark area displayed on the display unit;
updating pixel values of the illumination image based on the instruction of the change from the user;
Image processing device.
(((6)))
An image processing device according to any one of ((1)) to ((5)),
The processor,
receiving, from a user, a correction coefficient for correcting a pixel value of the illumination image;
updating pixel values of the illumination image based on the correction coefficients;
Image processing device.
(((7)))
An image processing device according to any one of ((1)) to ((6)),
The processor,
In the illumination component estimation process, a blurred image obtained by smoothing the original image is acquired as the illumination image.
Image processing device.
(((8)))
An image processing device according to any one of claims 1 to 7,
The processor,
The kernel size, kernel sigma value, or both can be specified by the user.
In the illumination component estimation process, the illumination image is acquired using a kernel having the kernel size, the sigma value of the kernel, or both of them, received from the user.
Image processing device.
(((9)))
An image processing device according to any one of claims 1 to 7,
The processor,
With respect to an object appearing in the original image, information on the distance between the camera and the object at the time of photographing the object by the camera is acquired;
In the illumination component estimation process, when the distance between the camera and the object is long, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the distance is short.
Image processing device.
(((10)))
An image processing device according to any one of claims 1 to 7,
The processor,
With respect to an object appearing in the original image, information on the size of the object relative to the entire original image is obtained;
In the illumination component estimation process, when the size of the object is small, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the size of the object is large.
Image processing device.
(((11)))
An image processing device according to any one of claims 1 to 7,
The processor,
Acquire information on the angle of view when the original image was captured by a camera;
In the illumination component estimation process, when the angle of view is large, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the angle of view is small.
Image processing device.
(((12)))
an illumination component estimation process for estimating an illumination component of an original image based on the Retinex theory to obtain an illumination image;
a synthesis process for generating a corrected image by weighting pixel values of the bright area correction and the dark area correction obtained based on the original image and the illumination image by pixel values of the illumination image and synthesizing the weighted pixel values;
A program that causes a computer to execute the following.

(((1)))に係る発明によれば、1つの元画像における明部と暗部の両方のダイナミックレンジを広げた補正画像が得られる。
(((2)))に係る発明によれば、明度画像に対する補正画像が得られる。
(((3)))に係る発明によれば、元画像と照明画像の画素値から、明部補正と暗部補正の画素値が得られる。
(((4)))に係る発明によれば、ユーザが明部領域と暗部領域を確認可能となる。
(((5)))に係る発明によれば、ユーザが明部領域と暗部領域を確認しながら、照明成分を更新することが可能となる。
(((6)))に係る発明によれば、ユーザが照明成分を補正可能となる。
(((7)))に係る発明によれば、元画像を平滑化したぼかし画像の画素値により、照明成分が近似される。
(((8)))に係る発明によれば、ユーザがカーネルサイズ、カーネルのシグマ値、またはそれらの両方により、照明成分を調整可能となる。
(((9)))に係る発明によれば、補正画像において対象物の視認性が向上することを期待できる。
(((10)))に係る発明によれば、補正画像において対象物の視認性が向上することを期待できる。
(((11)))に係る発明によれば、補正画像において物体の視認性が向上することを期待できる。
(((12)))に係る発明によれば、1つの元画像における明部と暗部の両方のダイナミックレンジを広げた補正画像が得られる。
According to the invention ((1)), a corrected image can be obtained in which the dynamic range of both the bright and dark areas in a single original image is expanded.
According to the invention related to ((2)), a correction image for a brightness image is obtained.
According to the invention related to ((3)), pixel values for bright area correction and dark area correction are obtained from pixel values of an original image and an illuminated image.
According to the invention related to ((4)), the user can check the light and dark areas.
According to the invention related to ((5)), it becomes possible for the user to update the illumination components while checking the light and dark areas.
According to the invention related to ((6)), the user can correct the illumination component.
According to the invention related to ((7)), the illumination component is approximated by the pixel values of a blurred image obtained by smoothing the original image.
The invention in ((8)) allows the user to adjust the illumination component by the kernel size, the kernel's sigma value, or both.
According to the invention pertaining to ((9))), it is expected that the visibility of the object in the corrected image will be improved.
According to the invention pertaining to ((10))), it is expected that the visibility of the object in the corrected image will be improved.
According to the invention pertaining to ((11))), it is expected that the visibility of objects in the corrected image will be improved.
According to the invention ((12)), a corrected image can be obtained in which the dynamic range of both the bright and dark areas in a single original image is expanded.

10,10A 元画像(画像)、12,12A 照明画像(照明成分)、14,14A,14-1,14-2,14-3 補正画像(画像)、16,16A 色成分画像(画像)、18,18-1,18-2,18-3 カラー補正画像(画像)、22,22-1,22-2,22-3 調整用画像、30 明部、32 暗部、30a 明部領域(領域)、32a 暗部領域(領域)、34 境界線、100 元カラー画像、200 カメラ、1000 画像処理装置、1002 プロセッサ、1004 メモリ、1006 補助記憶装置、1008 入出力装置、1010 ネットワークインタフェース、1012 バス。
10, 10A original image (image), 12, 12A illumination image (illumination component), 14, 14A, 14-1, 14-2, 14-3 corrected image (image), 16, 16A color component image (image), 18, 18-1, 18-2, 18-3 color corrected image (image), 22, 22-1, 22-2, 22-3 adjustment image, 30 bright area, 32 dark area, 30a bright area region (region), 32a dark area region (region), 34 boundary line, 100 original color image, 200 camera, 1000 image processing device, 1002 processor, 1004 memory, 1006 auxiliary storage device, 1008 input/output device, 1010 network interface, 1012 bus.

Claims (12)

プロセッサを含み、
前記プロセッサは、
Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、
前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、を行う、
画像処理装置。
A processor is included.
The processor,
an illumination component estimation process for estimating an illumination component of an original image based on the Retinex theory to obtain an illumination image;
a synthesis process for generating a corrected image by weighting pixel values of the bright area correction and the dark area correction obtained based on the original image and the illumination image by the pixel values of the illumination image and synthesizing the weighted pixel values.
Image processing device.
請求項1に記載の画像処理装置であって、
前記元画像は、画素値が明度を表わす明度画像である、
画像処理装置。
2. The image processing device according to claim 1,
The original image is a brightness image in which pixel values represent brightness.
Image processing device.
請求項2に記載の画像処理装置であって、
前記プロセッサは、
前記元画像の画素値を、前記照明画像の画素値で除算することで、前記暗部補正の画素値を取得し、
前記元画像を明度反転させた反転明度画像の画素値を、前記照明画像を明度反転させた反転照明画像の画素値で除算して得られる画素値を、明度反転することで、前記明部補正の画素値を取得する、
画像処理装置。
3. The image processing device according to claim 2,
The processor,
obtaining pixel values of the dark correction by dividing pixel values of the original image by pixel values of the illumination image;
obtaining pixel values of the bright area correction by inverting brightness of the pixel values obtained by dividing pixel values of an inverted brightness image obtained by inverting brightness of the original image by pixel values of an inverted illumination image obtained by inverting brightness of the illumination image;
Image processing device.
請求項1~3のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明画像における画素値が閾値より高い領域である明部領域とその画素値が前記閾値以下である暗部領域を、前記元画像または前記元画像に色成分が付加された元カラー画像に重畳させて、表示部に表示する制御を行う、
画像処理装置。
The image processing device according to any one of claims 1 to 3,
The processor,
and performing control to superimpose a bright area in the illumination image, which is an area where pixel values are higher than a threshold, and a dark area in the illumination image, which is an area where pixel values are equal to or lower than the threshold, on the original image or an original color image obtained by adding a color component to the original image, and display the superimposed image on a display unit.
Image processing device.
請求項4に記載の画像処理装置であって、
前記プロセッサは、
前記表示部に表示された前記明部領域と前記暗部領域を変更する指示を、ユーザから受け付け、
前記ユーザからの前記変更の指示に基づいて、前記照明画像の画素値を更新する、
画像処理装置。
5. The image processing device according to claim 4,
The processor,
receiving an instruction from a user to change the bright area and the dark area displayed on the display unit;
updating pixel values of the illumination image based on the instruction of the change from the user;
Image processing device.
請求項1~3のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明画像の画素値を補正するための補正係数を、ユーザから受け付け、
前記補正係数に基づいて、前記照明画像の画素値を更新する、
画像処理装置。
The image processing device according to any one of claims 1 to 3,
The processor,
receiving, from a user, a correction coefficient for correcting a pixel value of the illumination image;
updating pixel values of the illumination image based on the correction coefficients;
Image processing device.
請求項1~3のいずれか1つに記載の画像処理装置であって、
前記プロセッサは、
前記照明成分推定処理において、前記元画像を平滑化したぼかし画像を、前記照明画像として取得する、
画像処理装置。
The image processing device according to any one of claims 1 to 3,
The processor,
In the illumination component estimation process, a blurred image obtained by smoothing the original image is acquired as the illumination image.
Image processing device.
請求項7に記載の画像処理装置であって、
前記プロセッサは、
カーネルサイズ、カーネルのシグマ値、またはそれらの両方を、ユーザから受け付け、
前記照明成分推定処理において、前記ユーザから受け付けた前記カーネルサイズ、前記カーネルのシグマ値、またはそれらの両方を有するカーネルを用いて、前記照明画像を取得する、
画像処理装置。
8. The image processing device according to claim 7,
The processor,
The kernel size, kernel sigma value, or both can be specified by the user.
In the illumination component estimation process, the illumination image is acquired using a kernel having the kernel size, the sigma value of the kernel, or both of them, received from the user.
Image processing device.
請求項7に記載の画像処理装置であって、
前記プロセッサは、
前記元画像に現れる対象物に関し、カメラによる撮影時の前記カメラと前記対象物の間の距離の情報を取得し、
前記照明成分推定処理において、前記カメラと前記対象物の間の距離が長い場合にはそれが短い場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
8. The image processing device according to claim 7,
The processor,
With respect to an object appearing in the original image, information on the distance between the camera and the object at the time of photographing the object by the camera is acquired;
In the illumination component estimation process, when the distance between the camera and the object is long, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the distance is short.
Image processing device.
請求項7に記載の画像処理装置であって、
前記プロセッサは、
前記元画像に現れる対象物に関し、前記元画像の全体に対する前記対象物の大きさの情報を取得し、
前記照明成分推定処理において、前記対象物の大きさが小さい場合にはそれが大きい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
8. The image processing device according to claim 7,
The processor,
With respect to an object appearing in the original image, information on the size of the object relative to the entire original image is obtained;
In the illumination component estimation process, when the size of the object is small, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the size of the object is large.
Image processing device.
請求項7に記載の画像処理装置であって、
前記プロセッサは、
前記元画像のカメラによる撮影時の画角の情報を取得し、
前記照明成分推定処理において、前記画角が大きい場合にはそれが小さい場合に比べて、カーネルサイズが小さいカーネルを用いて、前記照明画像を取得する、
画像処理装置。
8. The image processing device according to claim 7,
The processor,
Acquire information on the angle of view when the original image was captured by a camera;
In the illumination component estimation process, when the angle of view is large, a kernel having a smaller kernel size is used to acquire the illumination image compared to when the angle of view is small.
Image processing device.
Retinex理論に基づいて元画像の照明成分を推定して、照明画像を取得する照明成分推定処理と、
前記元画像と前記照明画像に基づいて得られる明部補正と暗部補正のそれぞれの画素値を、前記照明画像の画素値で重み付けして合成することで、補正画像を生成する合成処理と、
をコンピュータに実行させるプログラム。
an illumination component estimation process for estimating an illumination component of an original image based on the Retinex theory to obtain an illumination image;
a synthesis process for generating a corrected image by weighting pixel values of the bright area correction and the dark area correction obtained based on the original image and the illumination image by pixel values of the illumination image and synthesizing the weighted pixel values;
A program that causes a computer to execute the following.
JP2022152122A 2022-09-26 2022-09-26 Image processing device and program Pending JP2024046819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022152122A JP2024046819A (en) 2022-09-26 2022-09-26 Image processing device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022152122A JP2024046819A (en) 2022-09-26 2022-09-26 Image processing device and program

Publications (1)

Publication Number Publication Date
JP2024046819A true JP2024046819A (en) 2024-04-05

Family

ID=90527370

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022152122A Pending JP2024046819A (en) 2022-09-26 2022-09-26 Image processing device and program

Country Status (1)

Country Link
JP (1) JP2024046819A (en)

Similar Documents

Publication Publication Date Title
US10997696B2 (en) Image processing method, apparatus and device
WO2019105262A1 (en) Background blur processing method, apparatus, and device
US11113795B2 (en) Image edge processing method, electronic device, and computer readable storage medium
CN108668093B (en) HDR image generation method and device
CN108604293B (en) Apparatus and method for improving image quality
JP6485078B2 (en) Image processing method and image processing apparatus
US9344636B2 (en) Scene motion correction in fused image systems
JP6818463B2 (en) Image processing equipment, image processing methods and programs
US11538175B2 (en) Method and apparatus for detecting subject, electronic device, and computer readable storage medium
KR20200023651A (en) Preview photo blurring method and apparatus and storage medium
JP6249638B2 (en) Image processing apparatus, image processing method, and program
US10091422B2 (en) Image processing device and recording medium
KR20170027301A (en) Image processing apparatus, image processing method, and storage medium
KR102355329B1 (en) Image processing apparatus, image processing method, and image processing program
JP4595569B2 (en) Imaging device
US20200118250A1 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
JP2017102642A (en) Image processor, image processing method and program
JP2012022652A (en) Image processing apparatus, image processing method and program
JP2016126750A (en) Image processing system, image processing device, imaging device, image processing method, program, and recording medium
CN110782400B (en) Self-adaptive illumination uniformity realization method and device
US8711250B2 (en) Image signal processing apparatus and image signal processing method
US20220398704A1 (en) Intelligent Portrait Photography Enhancement System
JP2024046819A (en) Image processing device and program
KR102585573B1 (en) Content-based image processing
JP5863236B2 (en) Image processing apparatus and image processing method