JP2011022656A - Image processor and image processing program - Google Patents

Image processor and image processing program Download PDF

Info

Publication number
JP2011022656A
JP2011022656A JP2009164825A JP2009164825A JP2011022656A JP 2011022656 A JP2011022656 A JP 2011022656A JP 2009164825 A JP2009164825 A JP 2009164825A JP 2009164825 A JP2009164825 A JP 2009164825A JP 2011022656 A JP2011022656 A JP 2011022656A
Authority
JP
Japan
Prior art keywords
coefficient
target pixel
value
image
dither
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
JP2009164825A
Other languages
Japanese (ja)
Inventor
Norimitsu Asami
典充 浅見
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2009164825A priority Critical patent/JP2011022656A/en
Publication of JP2011022656A publication Critical patent/JP2011022656A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To effectively prevent the difference in level of gradation in the periphery of a highlighted section from being made to be conspicuous. <P>SOLUTION: An image processor is provided with: a first coefficient generation part for calculating a first coefficient based on a difference between the luminance value of a targeted pixel in an image and a mean luminance value in peripheral pixels arranged in the periphery of the targeted pixel; a second coefficient generation part for calculating a second coefficient different from the first coefficient with respect to the targeted pixel at random; and a dither processing part for correcting the luminance value of the targeted pixel by using the first coefficient and the second coefficient. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

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

カメラでの撮影時、被写界中に際だって高輝度な物体が存在すると、撮影した画像の一部が白飛びする。この白飛び部分(ハイライト部)は、他の部分と異なり階調が全く無いので、階調段差により、その輪郭が浮き出して観察者に不自然な印象を与える。   When shooting with a camera, if there is an extremely bright object in the field, a part of the shot image will be overexposed. Unlike the other portions, the whiteout portion (highlight portion) has no gradation at all, so that the contour is raised due to the gradation step, giving an unnatural impression to the observer.

特許文献1には、その輪郭を目立たなくする信号処理技術が開示されている。この技術は、飽和レベルに近い信号へ意図的にランダムノイズを加算するものである。これによって、ハイライト部の周辺にディザ効果(ざらつき感)を与え、その輪郭を曖昧にすることができる。   Patent Document 1 discloses a signal processing technique for making the contour inconspicuous. This technique intentionally adds random noise to a signal close to the saturation level. As a result, a dither effect (roughness) can be given around the highlight portion, and the outline can be made ambiguous.

特開2005−72835号公報JP-A-2005-72835

しかし、この信号処理技術をそのままデジタルカメラへ適用しても、その適用方法や使用状況などにより、必ずしもディザ効果が現れないことがわかった。また、ディザ効果が現れなくても良い部分に現れるおそれがあった。   However, it has been found that even if this signal processing technique is applied to a digital camera as it is, the dither effect does not necessarily appear depending on the application method and usage situation. Further, there is a possibility that the dither effect may appear in a portion where it does not have to appear.

そこで、本発明の画像処理装置及び画像処理プログラムは、ハイライト部周辺の階調段差を効果的に目立たなくすることを目的とする。   Therefore, an object of the image processing apparatus and the image processing program of the present invention is to effectively make the gradation step around the highlight portion inconspicuous.

本発明の画像処理装置は、画像中の注目画素の輝度値と、該注目画素の周辺に配置された周辺画素における平均輝度値との差分に基づいて第1係数を求める第1係数生成部と、前記第1係数とは異なる第2係数を前記注目画素に対して無作為に求める第2係数生成部と、前記第1係数及び前記第2係数を用いて、前記注目画素の輝度値を補正するディザ処理部とを備える。
なお、前記ディザ処理部は、少なくとも前記第1係数及び前記第2係数を用いて補正値を算出した後、算出した前記補正値を前記注目画素の輝度値に加算しても良い。
また、前記第1係数は、前記注目画素の輝度値と前記周辺画素の平均輝度値とが等しいときに0となるように設定されるとともに、前記第1係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となっても良い。
また、前記第2係数が取り得る値として0が含まれるとともに、前記第2係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となっても良い。
また、前記注目画素の輝度値に基づく第3係数を求める第3係数生成部をさらに備え、前記ディザ処理部は、前記第1係数及び前記第2係数の他に、前記第3係数を用いて前記補正値を算出しても良い。
また、前記第3係数は、前記注目画素の輝度値が予め定めた閾値以下となるときに0となるように設定されるとともに、前記第3係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となっても良い。
An image processing apparatus according to the present invention includes a first coefficient generation unit that obtains a first coefficient based on a difference between a luminance value of a target pixel in an image and an average luminance value of peripheral pixels arranged around the target pixel. The second coefficient generation unit that randomly obtains a second coefficient different from the first coefficient for the target pixel, and the luminance value of the target pixel is corrected using the first coefficient and the second coefficient A dither processing unit.
The dither processing unit may calculate a correction value using at least the first coefficient and the second coefficient, and then add the calculated correction value to the luminance value of the target pixel.
The first coefficient is set to 0 when the luminance value of the target pixel is equal to the average luminance value of the surrounding pixels, and when the first coefficient is 0, the dither processing is performed. The correction value calculated by the unit may be zero.
Further, 0 may be included as a value that can be taken by the second coefficient, and when the second coefficient becomes 0, the correction value calculated by the dither processing unit may be 0.
The image processing apparatus further includes a third coefficient generation unit that obtains a third coefficient based on the luminance value of the target pixel, and the dither processing unit uses the third coefficient in addition to the first coefficient and the second coefficient. The correction value may be calculated.
The third coefficient is set to be 0 when the luminance value of the pixel of interest is equal to or less than a predetermined threshold, and is calculated by the dither processing unit when the third coefficient is 0. The correction value may be 0.

本発明の画像処理プログラムは、画像中の注目画素の輝度値と、該注目画素の周辺に配置された周辺画素における平均輝度値との差分に基づいて第1係数を求める第1係数生成工程と、前記第1係数とは異なる第2係数を前記注目画素に対して無作為に求める第2係数生成工程と、前記第1係数及び前記第2係数を用いて、前記注目画素の輝度値を補正するディザ処理工程とをコンピュータで実現する。   An image processing program according to the present invention includes a first coefficient generation step for obtaining a first coefficient based on a difference between a luminance value of a target pixel in an image and an average luminance value of peripheral pixels arranged around the target pixel. The second coefficient generation step for randomly obtaining the second coefficient different from the first coefficient for the target pixel, and the luminance value of the target pixel is corrected using the first coefficient and the second coefficient The dither processing step to be performed is realized by a computer.

本発明の画像処理装置及び画像処理プログラムによれば、ハイライト部周辺の階調段差を効果的に目立たなくすることができる。   According to the image processing apparatus and the image processing program of the present invention, the gradation step around the highlight portion can be effectively made inconspicuous.

本発明の実施形態におけるデジタルカメラ10の構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera 10 in embodiment of this invention. 係数Aを算出する際に用いられるLUT27の一例である。It is an example of LUT27 used when calculating the coefficient A. FIG. 係数Bを算出する際に用いられるLUT28の一例である。It is an example of LUT28 used when calculating the coefficient B. FIG. 係数Cを算出する際に用いられるLUT29の一例である。It is an example of LUT29 used when calculating the coefficient C. ディザ処理時の流れを示すフローチャートである。It is a flowchart which shows the flow at the time of a dither process. (a)ディザ処理前のJPEG画像30の例を示す図である。(b)ディザ処理前のJPEG画像30における直線Z上に位置する画素のX座標値とY信号値との対応関係を示す図である。(c)ディザ処理後のJPEG画像30における直線Z上に位置する画素のX座標値とY’信号値との対応関係を示す図である。(A) It is a figure which shows the example of the JPEG image 30 before a dither process. (B) It is a figure which shows the correspondence of the X coordinate value and Y signal value of the pixel located on the straight line Z in the JPEG image 30 before a dither process. (C) It is a figure which shows the correspondence of the X coordinate value and Y 'signal value of the pixel located on the straight line Z in the JPEG image 30 after a dither process.

以下、図面を用いて本発明の実施形態について説明する。なお、本実施形態では、本発明の画像処理装置の一例として、デジタルカメラを用いて説明する。図1は、本発明の実施形態におけるデジタルカメラ10の構成を示すブロック図である。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In this embodiment, a digital camera is used as an example of the image processing apparatus of the present invention. FIG. 1 is a block diagram showing a configuration of a digital camera 10 according to an embodiment of the present invention.

図1に示すように、デジタルカメラ10は、撮像レンズ11、撮像素子12、A/D変換部13、バッファメモリ14、画像処理部15、制御部16、表示部17、操作部18、メモリ19、記録I/F部20、記録媒体21、バス22を備える。   As shown in FIG. 1, the digital camera 10 includes an imaging lens 11, an imaging device 12, an A / D conversion unit 13, a buffer memory 14, an image processing unit 15, a control unit 16, a display unit 17, an operation unit 18, and a memory 19. A recording I / F unit 20, a recording medium 21, and a bus 22.

撮像レンズ11は、撮像素子12の撮像面に被写体像を結像する。なお、撮像レンズ11は、ズームレンズやフォーカスレンズ等の複数のレンズから構成されていても良い。撮像素子12は、撮像レンズ11を通過した被写体光を光電変換し、R、G、Bの各色に対応するアナログの画像信号を出力する。撮像素子12は、後述するレリーズ釦25が全押しされると、被写体についての画像を取得する。なお、画像としては、静止画像の他に、動画像が含まれる。   The imaging lens 11 forms a subject image on the imaging surface of the imaging element 12. Note that the imaging lens 11 may be composed of a plurality of lenses such as a zoom lens and a focus lens. The imaging element 12 photoelectrically converts the subject light that has passed through the imaging lens 11 and outputs analog image signals corresponding to the R, G, and B colors. The image sensor 12 acquires an image of the subject when a release button 25 described later is fully pressed. Note that the images include moving images in addition to still images.

撮像素子12から出力される画像信号は、A/D変換部13に入力される。A/D変換部13は、撮像素子12から出力されるアナログの画像信号をA/D変換し、デジタルの画像信号に変更する。なお、このデジタルの画像信号は、1コマにまとめられ、画像データとしてバッファメモリ14に記録される。バッファメモリ14は、画像処理部15による画像処理の前工程や後工程で画像データを一時的に記録する。   An image signal output from the image sensor 12 is input to the A / D converter 13. The A / D conversion unit 13 performs A / D conversion on the analog image signal output from the image sensor 12 and changes it to a digital image signal. The digital image signals are collected into one frame and recorded in the buffer memory 14 as image data. The buffer memory 14 temporarily records image data in the pre-process and post-process of image processing by the image processing unit 15.

画像処理部15は、バッファメモリ14に記録された画像データに対して画像処理を施す。なお、この画像処理としては、周知のホワイトバランス調整、色補間、階調変換処理、輪郭強調処理等が挙げられる。また、画像処理部15は、JPEG(Joint Photographic Experts Group)形式等で圧縮する処理や、圧縮された上記のデータを伸長復元する処理をも実行する。例えば、圧縮処理前の階調数は、12bitであり、圧縮処理後の階調数は8bitである。以下、圧縮処理後の画像をJPEG画像と称する。
また、画像処理部15は、係数生成部23、ディザ処理部24の機能を有する。係数生成部23は、JPEG画像に含まれる画素毎に、ルックアップテーブルLUT27、LUT28、LUT29を用いて、ディザ処理に必要な係数A、係数B、係数Cを算出する。係数の算出については、後述する。
ディザ処理部24は、JPEG画像にディザ処理を行う。JPEG画像中の画素は、輝度成分(Y)を示す画像信号値(以下、Y信号値)と、色差成分を示す画像信号値(以下、Cr、Cb信号値)とにより構成される。ディザ処理部24は、下記に示す(1)式に従って、JPEG画像を構成する各画素のY信号値にディザ信号値を加算することにより、ディザ処理を行う。なお、2α は、係数Cの振幅である。
The image processing unit 15 performs image processing on the image data recorded in the buffer memory 14. Examples of the image processing include well-known white balance adjustment, color interpolation, gradation conversion processing, and contour enhancement processing. The image processing unit 15 also executes processing for compressing in JPEG (Joint Photographic Experts Group) format and the like, and processing for decompressing and restoring the compressed data. For example, the number of gradations before compression processing is 12 bits, and the number of gradations after compression processing is 8 bits. Hereinafter, the image after the compression processing is referred to as a JPEG image.
The image processing unit 15 has functions of a coefficient generation unit 23 and a dither processing unit 24. The coefficient generation unit 23 calculates the coefficients A, B, and C necessary for dither processing using the lookup tables LUT27, LUT28, and LUT29 for each pixel included in the JPEG image. The calculation of the coefficient will be described later.
The dither processing unit 24 performs dither processing on the JPEG image. A pixel in a JPEG image is composed of an image signal value indicating a luminance component (Y) (hereinafter referred to as Y signal value) and an image signal value indicating a color difference component (hereinafter referred to as Cr, Cb signal value). The dither processing unit 24 performs dither processing by adding the dither signal value to the Y signal value of each pixel constituting the JPEG image according to the following equation (1). 2 α is the amplitude of the coefficient C.

Figure 2011022656
Figure 2011022656

各係数は、以下のように求められる。なお、ディザ処理の対象となる画素を注目画素と称する。また、JPEG画像の横方向をX軸、縦方向をY軸とする。
まず、係数生成部23は、LUT27を用いて、注目画素のY信号値に応じた係数Aを算出する。図2は、LUT27の一例である。なお、横軸はY信号値であり、縦軸は係数Aである。また、JPEG画像の階調数が8bitである場合、0≦Y信号値≦255となる。LUT27は、Y信号値が閾値以下である(図2では、0≦Y信号値≦230)場合、係数A=0となるように設定され、Y信号値が閾値より高い(図2では、230<Y信号値≦255)場合、Y信号値が高いほど、係数Aが大きくなるように設定されている。
次に、係数Bは、以下のように求められる。最初に、係数生成部23は、注目画素を中心とし、縦7画素×横7画素の領域を設定する。そして、係数生成部23は、この領域に含まれる画素であって、注目画素を除く48個の画素のY信号値の平均値を算出し、周辺画素の平均Y信号値とする。さらに、係数生成部23は、下式に従って、差分値Dを算出する。
差分値D=|周辺画素の平均Y信号値−注目画素のY信号値|
そして、係数生成部23は、LUT28を用いて、注目画素のY信号値と周辺画素の平均Y信号値との差分値Dに応じた係数Bを算出する。図3は、LUT28の一例である。なお、横軸は差分値Dであり、縦軸は係数Bである。LUT28は、差分値D=0である場合、係数B=0となるように設定され、差分値Dが大きいほど、係数Bが大きくなるように設定されている。
次に、係数生成部23は、LUT29を用いて、注目画素のX座標値に応じた係数Cを算出する。図4は、LUT29の一例である。なお、横軸はX座標値であり、縦軸はランダムな値に予め決められている係数Cである。例えば、−2α≦係数C≦+2αとする。図4の例では、α=3である。
Each coefficient is obtained as follows. Note that a pixel to be subjected to dither processing is referred to as a target pixel. Also, the horizontal direction of the JPEG image is the X axis and the vertical direction is the Y axis.
First, the coefficient generation unit 23 uses the LUT 27 to calculate a coefficient A corresponding to the Y signal value of the target pixel. FIG. 2 is an example of the LUT 27. The horizontal axis represents the Y signal value, and the vertical axis represents the coefficient A. Further, when the number of gradations of the JPEG image is 8 bits, 0 ≦ Y signal value ≦ 255. The LUT 27 is set so that the coefficient A = 0 when the Y signal value is less than or equal to the threshold value (0 ≦ Y signal value ≦ 230 in FIG. 2), and the Y signal value is higher than the threshold value (230 in FIG. 2). <Y signal value ≦ 255), the higher the Y signal value, the larger the coefficient A is set.
Next, the coefficient B is obtained as follows. First, the coefficient generation unit 23 sets an area of vertical 7 pixels × horizontal 7 pixels around the target pixel. Then, the coefficient generation unit 23 calculates the average value of the Y signal values of the 48 pixels that are included in this region and exclude the pixel of interest, and sets the average Y signal value of the peripheral pixels. Further, the coefficient generation unit 23 calculates the difference value D according to the following equation.
Difference value D = | Average Y signal value of surrounding pixels−Y signal value of target pixel |
Then, the coefficient generation unit 23 uses the LUT 28 to calculate a coefficient B corresponding to the difference value D between the Y signal value of the target pixel and the average Y signal value of surrounding pixels. FIG. 3 is an example of the LUT 28. The horizontal axis is the difference value D, and the vertical axis is the coefficient B. The LUT 28 is set so that the coefficient B = 0 when the difference value D = 0, and the coefficient B is set to increase as the difference value D increases.
Next, the coefficient generation unit 23 uses the LUT 29 to calculate a coefficient C corresponding to the X coordinate value of the target pixel. FIG. 4 is an example of the LUT 29. The horizontal axis is the X coordinate value, and the vertical axis is the coefficient C that is predetermined as a random value. For example, the -2 alpha ≦ coefficient C ≦ + 2 α. In the example of FIG. 4, α = 3.

以上説明したように、ディザ信号値は、Y信号値が飽和レベル近傍となる画素であって、該Y信号値と周辺画素の平均Y信号値とに差分がある画素に対し、Y信号値のバラツキを与えるように設定されている。
制御部16は、所定のシーケンスプログラムにしたがって、デジタルカメラ10の統括的な制御を行う。表示部17は、制御部16の制御により各種の画像を表示する。表示部17に表示される各種の画像は、撮像により取得した画像、後述する記録媒体21に記録された画像、メニュー画像等を含む。操作部18は、レリーズ釦25、十字キー26等を有する。メモリ19は、LUT27、LUT28、LUT29などを記録している。レリーズ釦25は、撮像時に操作される。十字キー26は、上記のメニュー画像等で操作される。なお、レリーズ釦25及び十字キー26の状態は制御部16により検知され、検知された釦やキーの状態に基づいたシーケンスが実行される。
As described above, the dither signal value is a pixel in which the Y signal value is near the saturation level, and the Y signal value of the pixel having a difference between the Y signal value and the average Y signal value of the surrounding pixels is It is set to give variation.
The control unit 16 performs overall control of the digital camera 10 according to a predetermined sequence program. The display unit 17 displays various images under the control of the control unit 16. Various images displayed on the display unit 17 include images acquired by imaging, images recorded on a recording medium 21 described later, menu images, and the like. The operation unit 18 includes a release button 25, a cross key 26, and the like. The memory 19 records LUT27, LUT28, LUT29, and the like. The release button 25 is operated during imaging. The cross key 26 is operated on the above menu image or the like. The state of the release button 25 and the cross key 26 is detected by the control unit 16, and a sequence based on the detected state of the button or key is executed.

記録I/F部20は、記録媒体21を接続するためのコネクタを備えている。この記録I/F部20と記録媒体21とが接続されることにより、記録媒体21に対してデータの書き込み/読み出しを実行する。バス22は、バッファメモリ14、画像処理部15、制御部16、表示部17、記録I/F部20を相互に接続することにより、データや信号の出入力を実行する。   The recording I / F unit 20 includes a connector for connecting the recording medium 21. When the recording I / F unit 20 and the recording medium 21 are connected, data writing / reading is executed on the recording medium 21. The bus 22 connects the buffer memory 14, the image processing unit 15, the control unit 16, the display unit 17, and the recording I / F unit 20, thereby executing data and signal input / output.

図5は、ディザ処理時の流れを示すフローチャートである。   FIG. 5 is a flowchart showing a flow during dither processing.

ステップS101は、JPEG画像を読み出す処理である。制御部16は、ディザ処理の対象となるJPEG画像を記録媒体21から読み出す。   Step S101 is processing for reading a JPEG image. The control unit 16 reads from the recording medium 21 a JPEG image that is a target of dither processing.

ステップS102は、Y信号値を算出する処理である。係数生成部23は、注目画素のY信号値を算出する。   Step S102 is processing for calculating a Y signal value. The coefficient generator 23 calculates the Y signal value of the target pixel.

ステップS103は、係数Aを算出する処理である。係数生成部23は、LUT27を用いて、ステップS102で算出したY信号値に応じた係数Aを算出する。   Step S103 is a process for calculating the coefficient A. The coefficient generation unit 23 uses the LUT 27 to calculate the coefficient A corresponding to the Y signal value calculated in step S102.

ステップS104は、係数A≠0であるか否かを判定する処理である。係数生成部23は、係数A≠0である場合(ステップS104の判定がYESとなる場合)には、ステップS105に進む。一方、係数生成部23は、係数A=0である場合(ステップS105の判定がNOとなる場合)には、後述するステップS111に進む。   Step S104 is processing for determining whether or not the coefficient A ≠ 0. When the coefficient A is not 0 (when the determination in step S104 is YES), the coefficient generation unit 23 proceeds to step S105. On the other hand, when the coefficient A = 0 (when the determination in step S105 is NO), the coefficient generation unit 23 proceeds to step S111 described later.

ステップS105は、周辺画素の平均Y信号値を算出する処理である。係数生成部23は、注目画素の周辺画素の平均Y信号値を算出する。   Step S105 is processing for calculating the average Y signal value of the peripheral pixels. The coefficient generation unit 23 calculates the average Y signal value of the peripheral pixels around the target pixel.

ステップS106は、差分値Dを算出する処理である。係数生成部23は、注目画素のY信号値と周辺画素の平均Y信号値との差分値Dを算出する。   Step S106 is a process of calculating the difference value D. The coefficient generation unit 23 calculates a difference value D between the Y signal value of the target pixel and the average Y signal value of surrounding pixels.

ステップS107は、係数Bを算出する処理である。係数生成部23は、LUT28を用いて、ステップS106で算出した差分値Dに応じた係数Bを算出する。   Step S107 is processing for calculating the coefficient B. The coefficient generation unit 23 uses the LUT 28 to calculate a coefficient B according to the difference value D calculated in step S106.

ステップS108は、係数B≠0であるか否かを判定する処理である。係数生成部23は、係数B≠0である場合(ステップS108の判定がYESとなる場合)には、ステップS109に進む。一方、係数生成部23は、係数B=0である場合(ステップS108の判定がNOとなる場合)には、後述するステップS111に進む。   Step S108 is a process for determining whether or not the coefficient B ≠ 0. When the coefficient B ≠ 0 (when the determination in step S108 is YES), the coefficient generation unit 23 proceeds to step S109. On the other hand, when the coefficient B = 0 (when the determination in step S108 is NO), the coefficient generation unit 23 proceeds to step S111 described later.

ステップS109は、X座標値を算出する処理である。係数生成部23は、注目画素のX座標値を算出する。   Step S109 is processing for calculating an X coordinate value. The coefficient generation unit 23 calculates the X coordinate value of the target pixel.

ステップS110は、係数Cを算出する処理である。係数生成部23は、LUT29を用いて、ステップS109で算出したX座標値に応じた係数Cを算出する。   Step S110 is a process for calculating the coefficient C. The coefficient generation unit 23 uses the LUT 29 to calculate a coefficient C corresponding to the X coordinate value calculated in step S109.

ステップS111は、Y’信号値を算出する処理である。ディザ処理部24は、注目画素のY信号値、係数A、係数B、係数Cを用いて、Y’信号値を算出する。なお、ステップS104又はステップS108の判定がNOとなる場合には、ディザ信号値が0になる。そのため、このような画素では、ディザ処理前のY信号値と、ディザ処理後のY’信号値とは同じである。また、係数生成部23は、注目画素のCb、Cr信号値を算出する。   Step S111 is a process of calculating the Y ′ signal value. The dither processing unit 24 calculates the Y ′ signal value using the Y signal value, the coefficient A, the coefficient B, and the coefficient C of the target pixel. If the determination in step S104 or step S108 is NO, the dither signal value is zero. Therefore, in such a pixel, the Y signal value before the dither process is the same as the Y ′ signal value after the dither process. Further, the coefficient generation unit 23 calculates Cb and Cr signal values of the target pixel.

ステップS112は、全ての画素についてY’信号値を算出したか否かを判定する処理である。ディザ処理部24は、全ての画素についてY’信号値を算出した場合(ステップS112の判定がYESとなる場合)には、ステップS113に進む。一方、ディザ処理部24は、全ての画素についてY’信号値を算出していない場合(ステップS112の判定がNOとなる場合)には、ステップS102に戻る。   Step S112 is a process of determining whether or not the Y ′ signal value has been calculated for all the pixels. When the dither processing unit 24 has calculated the Y ′ signal value for all the pixels (when the determination in step S112 is YES), the dither processing unit 24 proceeds to step S113. On the other hand, if the dither processing unit 24 has not calculated the Y ′ signal value for all the pixels (when the determination in step S112 is NO), the dither processing unit 24 returns to step S102.

ステップS113は、ディザ処理後のJPEG画像を記録する処理である。ディザ処理部24は、ステップS111で算出したY’信号値とCb、Cr信号値とを画素毎に合成し、ディザ処理後のJPEG画像を生成する。そして、制御部16は、ディザ処理後のJPEG画像を記録媒体21に記録し、一連の処理を終了する。
例えば、ディザ処理前のJPEG画像30の例を図6(a)に示す。領域Kに含まれる画素のY信号値は全て同じであり、例えば、Y信号値=255とする。同様に、領域Lに含まれる画素のY信号値は全て同じであり、例えば、Y信号値=245とする。また、領域Mに含まれる画素のY信号値は全て同じであり、Y信号値=230とする。また、領域Nに含まれる画素のY信号値は全て同じであり、Y信号値=220とする。図6(b)は、ディザ処理前のJPEG画像30における直線Z上に位置する画素のX座標値とY信号値との対応関係を示す図である。
この場合、領域K、L、Mは、Y信号値が飽和レベル近傍である画素により構成される領域、すなわちハイライト部であり、領域Kと領域LとのY信号値の差分値、及び領域Lと領域MとのY信号値の差分値は大きい。そのため、領域Kと領域Lとの境界、及び領域Lと領域Mとの境界に、階調段差が生じる。
Step S113 is a process of recording the JPEG image after the dither process. The dither processing unit 24 combines the Y ′ signal value calculated in step S111 with the Cb and Cr signal values for each pixel, and generates a JPEG image after the dither processing. Then, the control unit 16 records the JPEG image after the dither processing on the recording medium 21 and ends the series of processing.
For example, FIG. 6A shows an example of a JPEG image 30 before dither processing. The Y signal values of the pixels included in the region K are all the same, for example, Y signal value = 255. Similarly, the Y signal values of the pixels included in the region L are all the same, for example, Y signal value = 245. The Y signal values of the pixels included in the region M are all the same, and Y signal value = 230. Further, the Y signal values of the pixels included in the region N are all the same, and Y signal value = 220. FIG. 6B is a diagram showing a correspondence relationship between the X coordinate value and the Y signal value of the pixel located on the straight line Z in the JPEG image 30 before the dither process.
In this case, the regions K, L, and M are regions composed of pixels whose Y signal values are near the saturation level, that is, highlight portions, and the difference values of the Y signal values between the regions K and L, and the regions The difference value of the Y signal value between L and region M is large. Therefore, gradation steps are generated at the boundary between the region K and the region L and at the boundary between the region L and the region M.

図6(c)は、ディザ処理後のJPEG画像30における直線Z上に位置する画素のX座標値とY’信号値との対応関係を示す図である。領域Kと領域Lとの境界、領域Lと境界Mとの境界は、ディザ処理により曖昧になる。一方、領域Kと領域Lとの境界、及び領域Lと境界Mとの境界以外の部分では、Y’信号値は均一のままである。
上述したように、ディザ処理部24は、Y’信号値=Y信号値+(係数A×係数B×係数C)/2αを算出する。例えば、注目画素のY信号値が高いほど、階調段差が目立つので、ディザ処理の必要性が高く、注目画素のY信号値が低いほどディザ処理の必要性は低い。上記の式では、注目画素のY信号値が低い場合、係数A=0となり、注目画素のY信号値が高いほど、係数Aは大きくなる。そのため、ディザ処理部24は、上記の式のように、係数Aを乗じることにより、ハイライト部にのみディザ信号値を加算することができる。
また、注目画素のY信号値と周辺画素の平均Y信号値との差分値Dが大きいほど、階調段差が目立つので、ディザ処理の必要性が高く、差分値Dが小さいほどディザ処理の必要性は低い。上記の式では、差分値D=0である場合、係数B=0となり、差分値Dが大きいほど、係数Bは大きくなる。そのため、ディザ処理部24は、上記の式のように、係数Bを乗じることにより、Y信号値に差がある境界部分にのみディザ信号値を加算することができる。
また、一般的に、被写界の画像には、空間的に近接した画素同士はY信号値も近接するという傾向がある。上記の式では、注目画素のX座標値に応じた係数Cを乗じる。これにより、ディザ処理部24は、近接した画素同士でも、ランダムなディザ信号値を加算することができる。
すなわち、本実施形態のデジタルカメラ10では、ハイライト部周辺以外には、ディザ効果が現れず、ハイライト部周辺にのみディザ効果が現れる。したがって、本実施形態のデジタルカメラ10によれば、ハイライト部周辺の階調段差を効果的に目立たなくすることができる。また、ハイライト部の内側の領域など、ハイライト部周辺以外にディザ効果が現れないため、観察者に自然な印象を与えることができる。
FIG. 6C is a diagram illustrating a correspondence relationship between the X coordinate value and the Y ′ signal value of the pixel located on the straight line Z in the JPEG image 30 after the dither processing. The boundary between the region K and the region L and the boundary between the region L and the boundary M are made ambiguous by the dither processing. On the other hand, the Y ′ signal value remains uniform at the boundary between the region K and the region L and at portions other than the boundary between the region L and the boundary M.
As described above, the dither processing unit 24 calculates Y ′ signal value = Y signal value + (coefficient A × coefficient B × coefficient C) / . For example, as the Y signal value of the target pixel is higher, the gradation step becomes more conspicuous, so the necessity for dither processing is higher. In the above formula, when the Y signal value of the target pixel is low, the coefficient A = 0, and the higher the Y signal value of the target pixel, the larger the coefficient A. Therefore, the dither processing unit 24 can add the dither signal value only to the highlight portion by multiplying by the coefficient A as in the above equation.
Further, as the difference value D between the Y signal value of the target pixel and the average Y signal value of the surrounding pixels is larger, the gradation step is more conspicuous. Therefore, the necessity of dither processing is higher. The nature is low. In the above formula, when the difference value D = 0, the coefficient B = 0, and the larger the difference value D, the larger the coefficient B. Therefore, the dither processing unit 24 can add the dither signal value only to the boundary portion where there is a difference in the Y signal value by multiplying by the coefficient B as in the above formula.
Further, generally, in an image of the object scene, pixels that are spatially close to each other tend to have Y signal values close to each other. In the above formula, the coefficient C corresponding to the X coordinate value of the target pixel is multiplied. Thus, the dither processing unit 24 can add random dither signal values even between adjacent pixels.
That is, in the digital camera 10 of the present embodiment, the dither effect does not appear except in the vicinity of the highlight portion, and the dither effect appears only in the periphery of the highlight portion. Therefore, according to the digital camera 10 of the present embodiment, the gradation step around the highlight portion can be effectively made inconspicuous. In addition, since the dither effect does not appear in areas other than the highlight area such as the area inside the highlight area, a natural impression can be given to the observer.

なお、上記の実施形態では、LUT29を用いて、注目画素のX座標値に応じた係数Cを算出する例を示したが、これに限らない。例えば、ディザ処理部24は、注目画素毎に乱数演算を行って、ランダム値を算出し、このランダム値を係数Cとする。   In the above embodiment, an example is shown in which the coefficient C corresponding to the X coordinate value of the target pixel is calculated using the LUT 29, but the present invention is not limited to this. For example, the dither processing unit 24 performs random number calculation for each pixel of interest, calculates a random value, and sets the random value as the coefficient C.

また、上記の実施形態では、LUT29において、α=3である例を示したが、αの値は、これに限らない。また、ISO感度、彩度、エッジの度合いを加味してαの値を設定しても良い。例えば、ISO感度が高いと画像のSN比は高くなり、画像中のハイライト部周辺の階調段差もあまり目立たない傾向にある。よって、αの値が小さく設定されても問題はない。また、彩度補正の強度が低いほど、αの値を大きくしても良いし、エッジ強調の強度が低いほど、αの値を大きくしても良い。   In the above embodiment, an example in which α = 3 in the LUT 29 is shown, but the value of α is not limited to this. Further, the value of α may be set in consideration of ISO sensitivity, saturation, and edge degree. For example, if the ISO sensitivity is high, the S / N ratio of the image is high, and the gradation steps around the highlight portion in the image tend not to be noticeable. Therefore, there is no problem even if the value of α is set small. Further, the value of α may be increased as the intensity of saturation correction is lower, and the value of α may be increased as the intensity of edge enhancement is lower.

また、上記の実施形態では、周辺画素の平均Y信号値を算出する際に、注目画素を除いた48個の画素のY信号値の平均値を算出する例を示したが、これに限らない。例えば、注目画素を含む49個の画素のY信号値の平均値を算出しても良い。また、縦7画素×横7画素の領域を設定する例を示したが、領域の大きさは、これに限らない。例えば、領域が小さいほど、図6(c)に示すようなY’信号値の刻みが細かくなる。   In the above embodiment, an example is shown in which the average value of the Y signal values of 48 pixels excluding the target pixel is calculated when calculating the average Y signal value of the surrounding pixels. However, the present invention is not limited to this. . For example, an average value of Y signal values of 49 pixels including the target pixel may be calculated. Moreover, although the example which sets the area | region of vertical 7 pixels x horizontal 7 pixels was shown, the magnitude | size of an area | region is not restricted to this. For example, the smaller the region, the finer the Y ′ signal value increments as shown in FIG.

また、上記の実施形態では、LUT27が曲線である例を示したが、これに限らない。例えば、一次関数の直線でも良い。また、230<Y信号値≦240の場合は、係数A=1とし、240<Y信号値≦255の場合は、係数A=2となるように設定しても良い。また、0≦係数A≦2となる例を示したが、係数Aの値は、限定されない。なお、LUT28、係数Bについても同様とする。   In the above-described embodiment, an example in which the LUT 27 is a curve has been described, but the present invention is not limited to this. For example, a straight line of a linear function may be used. Further, when 230 <Y signal value ≦ 240, the coefficient A = 1 may be set, and when 240 <Y signal value ≦ 255, the coefficient A = 2 may be set. Moreover, although the example which becomes 0 <= coefficient A <= 2 was shown, the value of the coefficient A is not limited. The same applies to the LUT 28 and the coefficient B.

また、上記の実施形態では、係数A、係数B、係数Cの順に、係数を算出する例を示したが、これに限らない。例えば、係数生成部23は、係数B、係数A、係数Cの順に係数を算出しても良いし、3つの係数を併行して算出しても良い。   In the above embodiment, an example is shown in which the coefficients are calculated in the order of the coefficient A, the coefficient B, and the coefficient C. However, the present invention is not limited to this. For example, the coefficient generation unit 23 may calculate the coefficients in the order of the coefficient B, the coefficient A, and the coefficient C, or may calculate three coefficients in parallel.

また、上記の実施形態では、係数A、係数B、係数Cを用いて、ディザ信号値を算出する例を示したが、これに限らない。例えば、ディザ処理部24は、係数Aを用いることなく、係数B及び係数Cのみを用いてディザ信号値を算出しても良い。   In the above embodiment, an example in which the dither signal value is calculated using the coefficient A, the coefficient B, and the coefficient C has been described. However, the present invention is not limited to this. For example, the dither processing unit 24 may calculate the dither signal value using only the coefficient B and the coefficient C without using the coefficient A.

また、上記の実施形態では、係数A、係数B、係数Cを乗算して、ディザ信号値を算出する例を示したが、これに限らない。例えば、加算、減算、除算などを用いて、係数Aと係数Bと係数Cとのうち、少なくともいずれか1つが0となるときに、ディザ信号値が0となるような式を予め求めておく。そして、ディザ処理部24は、この式により、ディザ信号値を算出しても良い。   In the above embodiment, the dither signal value is calculated by multiplying the coefficient A, the coefficient B, and the coefficient C. However, the present invention is not limited to this. For example, using addition, subtraction, division, or the like, an expression is obtained in advance such that the dither signal value becomes 0 when at least one of coefficient A, coefficient B, and coefficient C is 0. . Then, the dither processing unit 24 may calculate the dither signal value using this equation.

また、上記の実施形態では、デジタルカメラ10を例に挙げて説明したが、これに限らない。例えば、図1に示した以外の構成を有するデジタルカメラにも本発明を同様に適用することができる。また、図1に示す機能や、図5に示すフローチャートの流れを実行することが可能なコンピュータなどの画像処理装置であっても良い。この場合、例えば、メモリカードの記録媒体やデジタルカメラ等などの電子機器と電気的に接続可能にし、これらの記録媒体に記録された画像やデジタルカメラで取得された画像を取り込むことができるような形態であれば良い。また、図1に示す機能や、図5に示すフローチャートの流れをコンピュータにて実行することが可能なプログラムであっても良い。このようなプログラムの場合には、メモリカードや光学ディスクや磁気ディスクなどのコンピュータに読み取り可能な記録媒体に記録されていることが好ましい。   In the above embodiment, the digital camera 10 has been described as an example, but the present invention is not limited to this. For example, the present invention can be similarly applied to a digital camera having a configuration other than that shown in FIG. Moreover, the image processing apparatus such as a computer capable of executing the function illustrated in FIG. 1 and the flow of the flowchart illustrated in FIG. 5 may be used. In this case, for example, it is possible to electrically connect to an electronic device such as a recording medium of a memory card or a digital camera, and an image recorded on the recording medium or an image acquired by the digital camera can be captured. Any form is acceptable. Moreover, the program which can perform the function shown in FIG. 1 and the flow of the flowchart shown in FIG. 5 with a computer may be sufficient. In the case of such a program, the program is preferably recorded on a computer-readable recording medium such as a memory card, an optical disk, or a magnetic disk.

10…デジタルカメラ、15…画像処理部、16…制御部、23…係数生成部、24…ディザ処理部 DESCRIPTION OF SYMBOLS 10 ... Digital camera, 15 ... Image processing part, 16 ... Control part, 23 ... Coefficient generation part, 24 ... Dither processing part

Claims (7)

画像中の注目画素の輝度値と、該注目画素の周辺に配置された周辺画素における平均輝度値との差分に基づいて第1係数を求める第1係数生成部と、
前記第1係数とは異なる第2係数を前記注目画素に対して無作為に求める第2係数生成部と、
前記第1係数及び前記第2係数を用いて、前記注目画素の輝度値を補正するディザ処理部と、
を備えたことを特徴とする画像処理装置。
A first coefficient generation unit for obtaining a first coefficient based on a difference between a luminance value of a target pixel in the image and an average luminance value in peripheral pixels arranged around the target pixel;
A second coefficient generation unit that randomly calculates a second coefficient different from the first coefficient for the target pixel;
A dither processing unit that corrects a luminance value of the target pixel using the first coefficient and the second coefficient;
An image processing apparatus comprising:
請求項1に記載の画像処理装置において、
前記ディザ処理部は、少なくとも前記第1係数及び前記第2係数を用いて補正値を算出した後、算出した前記補正値を前記注目画素の輝度値に加算する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The dither processing unit calculates a correction value using at least the first coefficient and the second coefficient, and then adds the calculated correction value to the luminance value of the target pixel.
請求項2に記載の画像処理装置において、
前記第1係数は、前記注目画素の輝度値と前記周辺画素の平均輝度値とが等しいときに0となるように設定されるとともに、
前記第1係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となる
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 2,
The first coefficient is set to be 0 when the luminance value of the target pixel and the average luminance value of the surrounding pixels are equal,
When the first coefficient is zero, the correction value calculated by the dither processing unit is zero.
請求項2又は請求項3のいずれか1項に記載の画像処理装置において、
前記第2係数が取り得る値として0が含まれるとともに、
前記第2係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となる
ことを特徴とする画像処理装置。
In the image processing device according to any one of claims 2 and 3,
The possible value of the second coefficient includes 0,
The image processing apparatus according to claim 1, wherein when the second coefficient is 0, the correction value calculated by the dither processing unit is 0.
請求項2から請求項4のいずれか1項に記載の画像処理装置において、
前記注目画素の輝度値に基づく第3係数を求める第3係数生成部をさらに備え、
前記ディザ処理部は、前記第1係数及び前記第2係数の他に、前記第3係数を用いて前記補正値を算出する
ことを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 2 to 4,
A third coefficient generation unit for obtaining a third coefficient based on a luminance value of the target pixel;
The dither processing unit calculates the correction value using the third coefficient in addition to the first coefficient and the second coefficient.
請求項5に記載の画像処理装置において、
前記第3係数は、前記注目画素の輝度値が予め定めた閾値以下となるときに0となるように設定されるとともに、
前記第3係数が0となるとき、前記ディザ処理部により算出される前記補正値は0となる
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 5.
The third coefficient is set to be 0 when the luminance value of the target pixel is equal to or less than a predetermined threshold,
The image processing apparatus according to claim 1, wherein when the third coefficient is zero, the correction value calculated by the dither processing unit is zero.
画像中の注目画素の輝度値と、該注目画素の周辺に配置された周辺画素における平均輝度値との差分に基づいて第1係数を求める第1係数生成工程と、
前記第1係数とは異なる第2係数を前記注目画素に対して無作為に求める第2係数生成工程と、
前記第1係数及び前記第2係数を用いて、前記注目画素の輝度値を補正するディザ処理工程と、
をコンピュータで実現することを特徴とする画像処理プログラム。
A first coefficient generation step for obtaining a first coefficient based on a difference between a luminance value of a target pixel in the image and an average luminance value in peripheral pixels arranged around the target pixel;
A second coefficient generation step for randomly obtaining a second coefficient different from the first coefficient for the target pixel;
A dither processing step of correcting a luminance value of the target pixel using the first coefficient and the second coefficient;
An image processing program characterized by realizing the above by a computer.
JP2009164825A 2009-07-13 2009-07-13 Image processor and image processing program Pending JP2011022656A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009164825A JP2011022656A (en) 2009-07-13 2009-07-13 Image processor and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009164825A JP2011022656A (en) 2009-07-13 2009-07-13 Image processor and image processing program

Publications (1)

Publication Number Publication Date
JP2011022656A true JP2011022656A (en) 2011-02-03

Family

ID=43632700

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009164825A Pending JP2011022656A (en) 2009-07-13 2009-07-13 Image processor and image processing program

Country Status (1)

Country Link
JP (1) JP2011022656A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220015915A (en) * 2020-07-31 2022-02-08 베이징 시아오미 모바일 소프트웨어 컴퍼니 리미티드 Method and device for image processing, terminal device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005072835A (en) * 2003-08-22 2005-03-17 Matsushita Electric Ind Co Ltd Imaging unit and image processor
WO2005125179A1 (en) * 2004-06-22 2005-12-29 Nikon Corporation Image processing device emphasizing on texture, image processing program, electronic camera, and image processing method
JP2008047102A (en) * 2006-07-20 2008-02-28 Matsushita Electric Ind Co Ltd Image processing apparatus and image processing method
JP2008118462A (en) * 2006-11-06 2008-05-22 Nikon Corp Image processing apparatus, imaging apparatus, and image processing program
JP2008129521A (en) * 2006-11-24 2008-06-05 Matsushita Electric Ind Co Ltd Image processing apparatus, image processing method, program for image processing, integrated circuit, and plasma display device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005072835A (en) * 2003-08-22 2005-03-17 Matsushita Electric Ind Co Ltd Imaging unit and image processor
WO2005125179A1 (en) * 2004-06-22 2005-12-29 Nikon Corporation Image processing device emphasizing on texture, image processing program, electronic camera, and image processing method
JP2008047102A (en) * 2006-07-20 2008-02-28 Matsushita Electric Ind Co Ltd Image processing apparatus and image processing method
JP2008118462A (en) * 2006-11-06 2008-05-22 Nikon Corp Image processing apparatus, imaging apparatus, and image processing program
JP2008129521A (en) * 2006-11-24 2008-06-05 Matsushita Electric Ind Co Ltd Image processing apparatus, image processing method, program for image processing, integrated circuit, and plasma display device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220015915A (en) * 2020-07-31 2022-02-08 베이징 시아오미 모바일 소프트웨어 컴퍼니 리미티드 Method and device for image processing, terminal device and storage medium
KR102459527B1 (en) * 2020-07-31 2022-10-27 베이징 시아오미 모바일 소프트웨어 컴퍼니 리미티드 Method and device for image processing, terminal device and storage medium
US11783450B2 (en) 2020-07-31 2023-10-10 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for image processing, terminal device and storage medium

Similar Documents

Publication Publication Date Title
JP4831067B2 (en) Image processing apparatus, image processing method, image processing program product, and imaging apparatus
US8170362B2 (en) Edge-enhancement device and edge-enhancement method
JP4875032B2 (en) Solid-state imaging device
JPWO2010053029A1 (en) Image input device
JP4818393B2 (en) Image processing method and image processing apparatus
JP4479527B2 (en) Image processing method, image processing apparatus, image processing program, and electronic camera
US8345121B2 (en) Image processing apparatus, method, and program
JP2011171842A (en) Image processor and image processing program
JP2009200743A (en) Image processor, image processing method, image processing program and imaging apparatus
JP5614256B2 (en) Imaging apparatus, image processing apparatus, and imaging method
JP4438363B2 (en) Image processing apparatus and image processing program
JP5365881B2 (en) Image processing apparatus and image processing method
JP5330291B2 (en) Signal processing apparatus and imaging apparatus
JP2011022656A (en) Image processor and image processing program
JP5213604B2 (en) Imaging device
JP5159647B2 (en) Image processing apparatus and image processing method
JP2006279162A (en) Method for inputting image and device for inputting image using the same
JP5147912B2 (en) Image processing method, image processing apparatus, program, and recording medium
JP2009258284A (en) Image processing device, imaging apparatus, image processing method, and program
CN116266864A (en) Information processing apparatus, control method thereof, medium, and head-mounted display
JP2014086957A (en) Image processing device and image processing method
WO2014192412A1 (en) Image processing device, imaging device, image processing method and program
JP2010199783A (en) Correction amount calculation system and electronic camera

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120711

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130509

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130514

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130704

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130716

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130903