JP2016066990A - Evaluation method of tone correction, and arithmetic device - Google Patents

Evaluation method of tone correction, and arithmetic device Download PDF

Info

Publication number
JP2016066990A
JP2016066990A JP2015061040A JP2015061040A JP2016066990A JP 2016066990 A JP2016066990 A JP 2016066990A JP 2015061040 A JP2015061040 A JP 2015061040A JP 2015061040 A JP2015061040 A JP 2015061040A JP 2016066990 A JP2016066990 A JP 2016066990A
Authority
JP
Japan
Prior art keywords
image
correction
value
pixel
gradation
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
JP2015061040A
Other languages
Japanese (ja)
Inventor
邦明 荒金
Kuniaki Aragane
邦明 荒金
健二 増田
Kenji Masuda
健二 増田
杉山 徹
Toru Sugiyama
徹 杉山
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Publication of JP2016066990A publication Critical patent/JP2016066990A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an evaluation method of tone correction which allows for appropriate evaluation of tone correction performed for an image, and to provide an arithmetic device.SOLUTION: In a method for evaluating the effect of tone correction for an image, pixels included in an image to be corrected is classified to a dark part, an intermediate part, and a bright part, of a plurality of luminance value levels, depending on the luminance thereof, the pixels included in a corrected image are classified to have the same luminance value level as that of a pixel at the same position of the image to be corrected, statistic value of the image to be corrected and statistic value of the corrected image are determined by using the luminance value of each pixel of a pixel group included in each luminance value level, an evaluation index is determined using statistic value of the image to be corrected and statistic value of the corrected image, and then tone correction is evaluated using the evaluation index.SELECTED DRAWING: Figure 4

Description

本発明は、画像に対して行った階調補正の効果を評価する技術に関する。   The present invention relates to a technique for evaluating the effect of gradation correction performed on an image.

従来、画像に対しては、その画像品質を評価することが行われている。特に、機器を介して入力された場合に、人間の感覚と相関良く、鮮明性に対する評価をする技術も提案されている(特許文献1参照)。また、単に画像の鮮明性を評価するだけでなく、鮮明性の低い画像に鮮明性を与えるため、画像に対してコントラスト補正(輝度補正)等の様々な階調補正をすることも行われている。   Conventionally, an image quality is evaluated for an image. In particular, there has been proposed a technique for evaluating the clearness with a good correlation with a human sense when input is performed through a device (see Patent Document 1). In addition to simply evaluating the sharpness of an image, various gradation corrections such as contrast correction (brightness correction) are also performed on the image in order to give sharpness to an image with low sharpness. Yes.

特に、撮影時の設定に応じて撮影した画像が暗くなってしまった場合に、トーンカーブなどを利用したコントラスト補正を適用することによって、視認性を向上することができる。トーンカーブとは、補正前と補正後の輝度値が線グラフで規定されたものであり、このトーンカーブを変形させることにより、補正後の輝度値の調整を行うことができる。輝度値とは、純粋に輝度を表現したものだけでなく、画素の元々の値により階調を表現した様々な値を含む。一般的には画像全体に一様なトーンカーブに従った補正を適用するが、元画像の輝度値に応じてトーンカーブの傾きを適宜更新することにより、画像内に明部、暗部が存在する場合であっても、視認性が良好な画像を得ることができる。このようなコントラスト補正については、様々な手法が提案されている。   In particular, visibility can be improved by applying contrast correction using a tone curve or the like when a captured image becomes dark according to the settings at the time of shooting. In the tone curve, the luminance value before and after correction is defined by a line graph, and the luminance value after correction can be adjusted by deforming the tone curve. The luminance value includes not only a value that expresses the luminance purely but also various values that express the gradation by the original value of the pixel. In general, correction according to a uniform tone curve is applied to the entire image, but bright and dark portions exist in the image by appropriately updating the slope of the tone curve according to the luminance value of the original image. Even in this case, an image with good visibility can be obtained. Various methods have been proposed for such contrast correction.

特開2000−188647号公報JP 2000-188647 A

しかしながら、上記特許文献1に示したように、画像の鮮明性自体の評価は行われているが、画像に対する階調補正の効果についての評価は行われていなかった。   However, as shown in the above-mentioned Patent Document 1, evaluation of the sharpness of the image itself has been performed, but evaluation of the effect of gradation correction on the image has not been performed.

そこで、本発明は、画像に対して行った階調補正の効果を適切に評価することが可能な階調補正の評価方法、および階調補正の評価のための演算装置を提供することを課題とする。   Accordingly, it is an object of the present invention to provide a gradation correction evaluation method capable of appropriately evaluating the effect of gradation correction performed on an image, and an arithmetic device for evaluation of gradation correction. And

上記課題を解決するため、本発明第1の態様では、
階調補正前の画像である補正前画像の画素値の統計値と、階調補正後の画像である補正後画像の画素値の統計値を求め、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法を提供する。
In order to solve the above problems, in the first aspect of the present invention,
Obtain the statistical value of the pixel value of the pre-correction image that is the image before the gradation correction and the statistical value of the pixel value of the corrected image that is the image after the gradation correction,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
A gradation correction evaluation method is provided, wherein gradation evaluation is evaluated using the evaluation index.

本発明第1の態様によれば、補正前画像の画素値の統計値と、補正後画像の画素値の統計値を求め、補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求め、求められた評価指標を用いて階調補正の評価をするようにしたので、画像に対して行った階調補正の効果を適切に評価することが可能となる。   According to the first aspect of the present invention, the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction are obtained, and the statistical value of the pixel value of the image before correction and the pixel value of the image after correction are calculated. Since the evaluation index is obtained using the statistical value and the gradation correction is evaluated using the obtained evaluation index, the effect of the gradation correction performed on the image can be appropriately evaluated. Become.

また、本発明第2の態様では、前記階調補正の評価方法において、前記補正前画像および前記補正後画像から、それぞれ所定の条件を満たす画素の集合を選択画素群として選択し、当該選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする。本発明第2の態様によれば、補正前画像および補正後画像から、所定の条件を満たす画素の集合を選択画素群として選択し、当該選択画素群に属する画素に対して、階調補正前と補正後の画素値を取得し、当該画素値に基づいて統計値を求めるようにしたので、画像全体だけでなく、特定の特徴をもつ画素群に対する階調補正の効果を適切に評価することが可能となる。   In the second aspect of the present invention, in the gradation correction evaluation method, a set of pixels satisfying predetermined conditions is selected as a selected pixel group from the uncorrected image and the corrected image, and the selected pixel is selected. A pixel value of a pixel belonging to the group is acquired, and the statistical value is obtained based on the pixel value. According to the second aspect of the present invention, a set of pixels satisfying a predetermined condition is selected as a selected pixel group from the pre-correction image and the post-correction image, and before gradation correction is performed on the pixels belonging to the selected pixel group. And the corrected pixel value is obtained, and the statistical value is obtained based on the pixel value, so that the effect of gradation correction not only on the entire image but also on the pixel group having a specific feature should be evaluated appropriately. Is possible.

また、本発明第3の態様では、前記階調補正の評価方法において、前記補正前画像、前記補正後画像それぞれについて前記選択画素群が複数存在し、各選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする。本発明第3の態様によれば、複数の選択画素群に属する画素に対して、階調補正前と補正後の画素値を取得し、統計値を求めるようにしたので、様々な特徴をもつ画素群ごとに階調補正の効果を適切に評価することが可能となる。   In the third aspect of the present invention, in the gradation correction evaluation method, a plurality of the selected pixel groups exist for each of the pre-correction image and the post-correction image, and pixel values of pixels belonging to each selected pixel group are determined. Obtaining and obtaining the statistical value based on the pixel value. According to the third aspect of the present invention, the pixel values before and after the gradation correction are obtained for the pixels belonging to the plurality of selected pixel groups, and the statistical values are obtained. It is possible to appropriately evaluate the effect of gradation correction for each pixel group.

また、本発明第4の態様では、前記階調補正の評価方法において、前記所定の条件は画素値の範囲であることを特徴とする。本発明第4の態様によれば、画素値の範囲により選択画素群を特定するようにしたので、明部、中間部、暗部等の画素値レベルに対して個別に階調補正の効果を評価することが可能となる。   In the fourth aspect of the present invention, in the gradation correction evaluation method, the predetermined condition is a range of pixel values. According to the fourth aspect of the present invention, since the selected pixel group is specified by the range of pixel values, the effect of gradation correction is individually evaluated for pixel value levels such as a bright portion, an intermediate portion, and a dark portion. It becomes possible to do.

また、本発明第5の態様では、前記階調補正の評価方法において、前記所定の条件は、前記補正前画像および前記補正後画像の一部である部分画像に含まれることであることを特徴とする。本発明第5の態様によれば、補正前画像および補正後画像の一部である部分画像により選択画素群を特定するようにしたので、画像上の位置に応じて個別に階調補正の効果を評価することが可能となる。   In the fifth aspect of the present invention, in the gradation correction evaluation method, the predetermined condition is that the predetermined condition is included in a partial image that is a part of the pre-correction image and the post-correction image. And According to the fifth aspect of the present invention, since the selected pixel group is specified by the partial image that is a part of the pre-correction image and the post-correction image, the effect of gradation correction is individually determined according to the position on the image. Can be evaluated.

また、本発明第6の態様では、前記階調補正の評価方法において、前記部分画像は、前記補正前画像および前記補正後画像を格子状に分割した領域で特定されることを特徴とする。本発明第6の態様によれば、部分画像は、補正前画像および補正後画像を格子状に分割した画像であるので、画像の全領域について、個別に階調補正の効果を評価することが可能となる。   In the sixth aspect of the present invention, in the gradation correction evaluation method, the partial image is specified by an area obtained by dividing the pre-correction image and the post-correction image in a grid pattern. According to the sixth aspect of the present invention, since the partial image is an image obtained by dividing the pre-correction image and the post-correction image in a grid pattern, the effect of gradation correction can be individually evaluated for the entire area of the image. It becomes possible.

また、本発明第7の態様では、
階調補正前の画像である補正前画像に含まれる画素を、その画素値に応じて複数の画素値レベルに分類し、階調補正後の画像である補正後画像に含まれる画素を、前記補正前画像における同一位置の画素と同一画素値レベルに分類し、
前記補正前画像および前記補正後画像について、各画素値レベルに含まれる画素群の各画素の画素値の統計値を求め、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法を提供する。
In the seventh aspect of the present invention,
The pixels included in the pre-correction image that is the image before gradation correction are classified into a plurality of pixel value levels according to the pixel values, and the pixels included in the corrected image that is the image after gradation correction are Classify the same pixel value level as the pixel at the same position in the pre-correction image,
For the pre-correction image and the post-correction image, obtain a statistical value of the pixel value of each pixel of the pixel group included in each pixel value level,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
A gradation correction evaluation method is provided, wherein gradation evaluation is evaluated using the evaluation index.

本発明第7の態様によれば、補正前画像に含まれる画素を、その画素値に応じて複数の画素値レベルに分類し、階調補正後の画像である補正後画像に含まれる画素を、補正前画像における同一位置の画素と同一画素値レベルに分類し、補正前画像および補正後画像について、各画素値レベルに含まれる画素群の各画素の画素値の統計値を求め、補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求め、求められた評価指標を用いて階調補正の評価をするようにしたので、画像の明部、中間部、暗部等の複数の輝度値レベル等の画素値レベルに対して個別に階調補正の効果を評価することが可能となる。   According to the seventh aspect of the present invention, the pixels included in the pre-correction image are classified into a plurality of pixel value levels according to the pixel values, and the pixels included in the post-correction image that is the image after gradation correction are determined. The pixel value level is classified into the same pixel value level as the pixel at the same position in the pre-correction image, and the statistical value of the pixel value of each pixel of the pixel group included in each pixel value level is obtained for the pre-correction image and the post-correction image. Since the evaluation index is obtained using the statistical value of the pixel value of the image and the statistical value of the pixel value of the corrected image, and the gradation correction is evaluated using the obtained evaluation index, the bright part of the image, It is possible to individually evaluate the effect of gradation correction for a plurality of pixel value levels such as a luminance value level such as an intermediate portion and a dark portion.

また、本発明第8の態様では、前記階調補正の評価方法において、前記画素値の範囲は、ヒストグラムの谷となる部分に設定されるしきい値により決定されることを特徴とする。本発明第8の態様によれば、選択画素群を特定する画素値の範囲を、ヒストグラムの谷となる部分に設定されるしきい値により決定されるようにしたので、画素値レベルへの分類分けを最適化して行うことが可能となる。   In the eighth aspect of the present invention, in the gradation correction evaluation method, the range of the pixel value is determined by a threshold value set in a portion that becomes a valley of the histogram. According to the eighth aspect of the present invention, the range of pixel values specifying the selected pixel group is determined by the threshold value set in the portion that becomes the valley of the histogram. It is possible to optimize the division.

また、本発明第9の態様では、
階調補正前の画像である補正前画像、階調補正後の画像である補正後画像をそれぞれ格子状に分割した部分画像に含まれる画素群の各画素の画素値を用いて、前記補正前画像の画素値の統計値と、前記補正後画像の画素値の統計値を求め、
前記補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法を提供する。
In the ninth aspect of the present invention,
The pixel value of each pixel of the pixel group included in the partial image obtained by dividing the pre-correction image, which is an image before gradation correction, and the post-correction image, which is an image after gradation correction, into a grid pattern, before the correction Obtain the statistical value of the pixel value of the image and the statistical value of the pixel value of the corrected image,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
A gradation correction evaluation method is provided, wherein gradation evaluation is evaluated using the evaluation index.

本発明第9の態様によれば、補正前画像、補正後画像を格子状に分割した部分画像に含まれる画素群の各画素の画素値を用いて、補正前画像の画素値の統計値と、補正後画像の画素値の統計値を求め、補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求め、求められた評価指標を用いて階調補正の評価をするようにしたので、画像上の位置に応じて個別に階調補正の効果を評価することが可能となる。   According to the ninth aspect of the present invention, using the pixel value of each pixel of the pixel group included in the partial image obtained by dividing the pre-correction image and the post-correction image in a grid pattern, , Calculate the statistical value of the pixel value of the corrected image, determine the evaluation index using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, and then use the calculated evaluation index to Since the correction is evaluated, the effect of the gradation correction can be individually evaluated according to the position on the image.

また、本発明第10の態様では、前記階調補正の評価方法において、前記部分画像は、矩形状に配置された画素群単位で、画素値の範囲により分類されたものであることを特徴とする。本発明第10の態様によれば、補正前画像および補正後画像の一部である部分画像が、矩形状に配置された画素群単位で、画素値の範囲により分類されたものであるので、画像上の位置、および明部、中間部、暗部等の画素値レベルに応じて個別に階調補正の効果を評価することが可能となる。   The tenth aspect of the present invention is characterized in that, in the gradation correction evaluation method, the partial image is classified by a pixel value range in a pixel group unit arranged in a rectangular shape. To do. According to the tenth aspect of the present invention, the partial images that are a part of the pre-correction image and the post-correction image are classified by the range of pixel values in units of pixels arranged in a rectangular shape. It is possible to individually evaluate the effect of gradation correction in accordance with the position on the image and the pixel value levels such as the bright part, the intermediate part, and the dark part.

また、本発明第11の態様では、前記階調補正の評価方法において、前記部分画像は、画像上の指定位置に基づいて決定されることを特徴とする。本発明第11の態様によれば、補正前画像および補正後画像の一部である部分画像が、画像上の指定位置に基づいて決定されるようにしたので、指定された位置付近で所定の条件を満たす最適な部分画像を取得することが可能となる。   In the eleventh aspect of the present invention, in the gradation correction evaluation method, the partial image is determined based on a designated position on the image. According to the eleventh aspect of the present invention, the partial image that is a part of the pre-correction image and the post-correction image is determined based on the designated position on the image. It is possible to acquire an optimal partial image that satisfies the conditions.

また、本発明第12の態様では、前記階調補正の評価方法において、前記評価指標は、前記補正前画像の画素値の統計値と補正後画像の画素値の統計値の比であることを特徴とする。本発明第12の態様によれば、評価指標が、補正前画像の画素値の統計値と補正後画像の画素値の統計値の比であるので、階調補正の効果をより適切に評価することが可能となる。   In the twelfth aspect of the present invention, in the gradation correction evaluation method, the evaluation index is a ratio of a statistical value of the pixel value of the image before correction and a statistical value of the pixel value of the image after correction. Features. According to the twelfth aspect of the present invention, since the evaluation index is the ratio between the statistical value of the pixel value of the pre-correction image and the statistical value of the pixel value of the post-correction image, the effect of gradation correction is more appropriately evaluated. It becomes possible.

また、本発明第13の態様では、前記階調補正の評価方法において、前記統計値は標準偏差に基づく値であることを特徴とする。本発明第13の態様によれば、統計値が標準偏差に基づく値であるので、画素値の平均と分散を考慮して、階調補正の効果をより適切に評価することが可能となる。   In the thirteenth aspect of the present invention, in the gradation correction evaluation method, the statistical value is a value based on a standard deviation. According to the thirteenth aspect of the present invention, since the statistical value is a value based on the standard deviation, it is possible to more appropriately evaluate the effect of the gradation correction in consideration of the average and variance of the pixel values.

また、本発明第14の態様では、前記統計値は画素値の最大値と最小値の差に基づく値であることを特徴とする。本発明第14の態様によれば、統計値が画素値の最大値と最小値の差に基づく値であるので、画素値の最大範囲を考慮して、階調補正の効果をより適切に評価することが可能となる。   In the fourteenth aspect of the present invention, the statistical value is a value based on a difference between a maximum value and a minimum value of pixel values. According to the fourteenth aspect of the present invention, since the statistical value is a value based on the difference between the maximum value and the minimum value of the pixel value, the gradation correction effect is more appropriately evaluated in consideration of the maximum range of the pixel value. It becomes possible to do.

また、本発明第15の態様では、前記統計値は画素値が中央の所定割合に含まれる画素を特定し、特定された画素の画素値の最大値と最小値の差に基づく値であることを特徴とする。本発明第15の態様によれば、統計値は画素値が中央の所定割合に含まれる画素の画素値の最大値と最小値の差に基づく値であるので、画素値の特に小さい値と大きい値の画素を除外して、階調補正の効果をより適切に評価することが可能となる。   In the fifteenth aspect of the present invention, the statistical value is a value based on a difference between the maximum value and the minimum value of the specified pixel value by specifying a pixel whose pixel value is included in the central predetermined ratio. It is characterized by. According to the fifteenth aspect of the present invention, the statistical value is a value based on the difference between the maximum value and the minimum value of the pixel values that are included in the central predetermined ratio, so that the pixel value is particularly small and large. By excluding value pixels, the effect of gradation correction can be more appropriately evaluated.

本発明第16の態様では、
階調補正前の画像である補正前画像の画素値の統計値と、階調補正後の画像である補正後画像の画素値の統計値を求める手段と、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置を提供する。
この演算装置は、評価指標を求める装置として機能する。
In the sixteenth aspect of the present invention,
Means for obtaining a statistical value of a pixel value of an image before correction that is an image before gradation correction and a statistical value of a pixel value of an image after correction that is an image after gradation correction;
Means for obtaining an evaluation index using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction;
There is provided an arithmetic device characterized by comprising:
This arithmetic device functions as a device for obtaining an evaluation index.

また、本発明第17の態様では、前記演算装置において、前記補正前画像および前記補正後画像から、それぞれ所定の条件を満たす画素の集合を選択画素群として選択し、当該選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする。   In the seventeenth aspect of the present invention, in the arithmetic device, a set of pixels satisfying predetermined conditions is selected as a selected pixel group from the uncorrected image and the corrected image, and pixels belonging to the selected pixel group are selected. The pixel value is acquired, and the statistical value is obtained based on the pixel value.

また、本発明第18の態様では、前記演算装置において、前記補正前画像、前記補正後画像それぞれについて前記選択画素群が複数存在し、各選択画素群に属する各画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする。   Further, in an eighteenth aspect of the present invention, in the arithmetic device, there are a plurality of the selected pixel groups for each of the pre-correction image and the post-correction image, and the pixel value of each pixel belonging to each selected pixel group is acquired, The statistical value is obtained based on the pixel value.

また、本発明第19の態様では、前記演算装置において、前記所定の条件は画素値の範囲であることを特徴とする。   In the nineteenth aspect of the present invention, in the arithmetic device, the predetermined condition is a range of pixel values.

また、本発明第20の態様では、前記演算装置において、前記所定の条件は、前記補正前画像および前記補正後画像の一部である部分画像に含まれることであることを特徴とする。   In the twentieth aspect of the present invention, the predetermined condition is that the predetermined condition is included in a partial image that is a part of the pre-correction image and the post-correction image.

また、本発明第21の態様では、前記演算装置において、前記部分画像は、前記補正前画像および前記補正後画像を格子状に分割した領域で特定されることを特徴とする。   According to a twenty-first aspect of the present invention, in the arithmetic device, the partial image is specified by an area obtained by dividing the pre-correction image and the post-correction image in a grid pattern.

また、本発明第22の態様では、
階調補正前の画像である補正前画像に含まれる画素を、その画素値である輝度値に応じて複数の輝度値レベルに分類し、階調補正後の画像である補正後画像に含まれる画素を、前記補正前画像における同一位置の画素と同一輝度値レベルに分類する輝度値分類手段と、
前記補正前画像および前記補正後画像について、各輝度値レベルに含まれる画素群の各画素の輝度値の統計値を求める手段と、
前記補正前画像の統計値と前記補正後画像の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置を提供する。
In the twenty-second aspect of the present invention,
The pixels included in the pre-correction image that is the image before gradation correction are classified into a plurality of luminance value levels according to the luminance value that is the pixel value, and are included in the corrected image that is the image after gradation correction. Luminance value classification means for classifying pixels into the same luminance value level as the pixel at the same position in the pre-correction image;
Means for obtaining a statistical value of a luminance value of each pixel of a pixel group included in each luminance value level for the pre-correction image and the post-correction image;
Means for obtaining an evaluation index using the statistical value of the image before correction and the statistical value of the image after correction;
There is provided an arithmetic device characterized by comprising:

また、本発明第23の態様では、前記演算装置において、前記画素値の範囲は、ヒストグラムの谷となる部分に設定されるしきい値により決定されることを特徴とする。   In the twenty-third aspect of the present invention, in the arithmetic unit, the range of the pixel value is determined by a threshold value set in a portion that becomes a valley of the histogram.

また、本発明第24の態様では、
階調補正前の画像である補正前画像、階調補正後の画像である補正後画像をそれぞれ格子状に分割した部分画像に含まれる画素群を抽出する部分画像抽出手段と、
前記抽出された画素群の各画素の画素値を用いて、前記補正前画像の画素値の統計値と、前記補正後画像の画素値の統計値を求める手段と、
前記補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置を提供する。
In the twenty-fourth aspect of the present invention,
A partial image extracting means for extracting a pixel group included in a partial image obtained by dividing the pre-correction image, which is an image before gradation correction, and the corrected image, which is an image after gradation correction, in a grid pattern;
Means for obtaining a statistical value of a pixel value of the image before correction and a statistical value of a pixel value of the image after correction using a pixel value of each pixel of the extracted pixel group;
Means for obtaining an evaluation index using a statistical value of the pixel value of the image before correction and a statistical value of the pixel value of the image after correction;
There is provided an arithmetic device characterized by comprising:

また、本発明第25の態様では、前記演算装置において、前記部分画像は、矩形状に配置された画素群単位で、画素値の範囲により分類されたものであることを特徴とする。   In the twenty-fifth aspect of the present invention, in the arithmetic device, the partial images are classified by a range of pixel values in units of pixel groups arranged in a rectangular shape.

また、本発明第26の態様では、前記演算装置において、前記部分画像は、画像上の指定位置に基づいて決定されることを特徴とする。   According to a twenty-sixth aspect of the present invention, in the arithmetic device, the partial image is determined based on a designated position on the image.

また、本発明第27の態様では、前記評価指標は、前記補正前画像の画素値の統計値と補正後画像の画素値の統計値の比であることを特徴とする。   In the twenty-seventh aspect of the present invention, the evaluation index is a ratio of a statistical value of the pixel value of the pre-correction image and a statistical value of the pixel value of the post-correction image.

また、本発明第28の態様では、前記統計値は標準偏差に基づく値であることを特徴とする。   In the twenty-eighth aspect of the present invention, the statistical value is a value based on a standard deviation.

また、本発明第29の態様では、前記統計値は画素値の最大値と最小値の差に基づく値であることを特徴とする。   In a twenty-ninth aspect of the present invention, the statistical value is a value based on a difference between a maximum value and a minimum value of pixel values.

また、本発明第30の態様では、前記統計値は画素値が中央の所定割合に含まれる画素を特定し、特定された画素の画素値の最大値と最小値の差に基づく値であることを特徴とする。   In the thirtieth aspect of the present invention, the statistical value is a value based on a difference between the maximum value and the minimum value of the specified pixel value by specifying a pixel whose pixel value is included in a predetermined ratio at the center. It is characterized by.

本発明第16〜第30の態様によれば、本発明第1〜第15の態様に係る階調補正の評価方法の実行に寄与する装置を実現するので、本発明第1〜第15の態様に係る階調補正の評価方法に必要な評価指標を的確に求めることが可能となる。   According to the sixteenth to thirtieth aspects of the present invention, an apparatus that contributes to the execution of the gradation correction evaluation method according to the first to fifteenth aspects of the present invention is realized. It is possible to accurately obtain an evaluation index necessary for the gradation correction evaluation method according to the above.

本発明によれば、画像に対して行った階調補正の効果を示す評価指標を得ることが可能となるという効果を有する。   According to the present invention, it is possible to obtain an evaluation index indicating the effect of gradation correction performed on an image.

本発明の一実施形態に係る補正評価装置(演算装置)のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the correction | amendment evaluation apparatus (arithmetic apparatus) which concerns on one Embodiment of this invention. 本発明第1の実施形態に係る補正評価装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the correction | amendment evaluation apparatus which concerns on the 1st Embodiment of this invention. 本発明第1の実施形態に係る補正評価装置の処理動作を示すフローチャートである。It is a flowchart which shows the processing operation of the correction | amendment evaluation apparatus which concerns on the 1st Embodiment of this invention. 補正前画像と補正後画像内の画素の輝度値レベル分類の概念を示す図である。It is a figure which shows the concept of the luminance value level classification | category of the pixel in the image before correction | amendment, and the image after correction | amendment. レンジ幅の3つの定義と、画素の輝度値のヒストグラムの関係を示す図である。It is a figure which shows the relationship between three definitions of a range width | variety, and the histogram of the luminance value of a pixel. ある画像についての補正前と補正後のヒストグラムおよびレンジ幅の変化の様子を示す図である。It is a figure which shows the mode of the change of the histogram before a correction | amendment about a certain image, and a correction | amendment, and a range width | variety. 異なるトーンカーブに基づく補正手法による補正前画像と補正後画像の輝度値の対応を示す図である。It is a figure which shows a response | compatibility of the luminance value of the image before correction | amendment by the correction method based on a different tone curve, and the image after correction | amendment. 輝度値レベルごとに異なるトーンカーブに基づく補正を行う場合における、補正前画像と補正後画像の輝度値の対応を示す図である。It is a figure which shows a response | compatibility of the luminance value of the image before correction | amendment, and the image after correction | amendment in the case of correct | amending based on a different tone curve for every luminance value level. 本発明第2の実施形態に係る補正評価装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the correction | amendment evaluation apparatus which concerns on the 2nd Embodiment of this invention. 本発明第2の実施形態に係る補正評価装置の処理動作を示すフローチャートである。It is a flowchart which shows the processing operation of the correction | amendment evaluation apparatus which concerns on the 2nd Embodiment of this invention. 画像全体における部分画像の特定の例を示す図である。It is a figure which shows the specific example of the partial image in the whole image. 本発明第3の実施形態に係る補正評価装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the correction | amendment evaluation apparatus which concerns on the 3rd Embodiment of this invention. 本発明第3の実施形態に係る補正評価装置の処理動作を示すフローチャートである。It is a flowchart which shows the processing operation of the correction | amendment evaluation apparatus which concerns on the 3rd Embodiment of this invention. 第3の実施形態における補正前画像と補正後画像内の画素の輝度値レベル分類の概念を示す図である。It is a figure which shows the concept of the luminance value level classification | category of the pixel in the image before correction | amendment in the 3rd Embodiment, and the image after correction | amendment. 本発明第4の実施形態に係る補正評価装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the correction | amendment evaluation apparatus which concerns on the 4th Embodiment of this invention. 本発明第4の実施形態に係る補正評価装置の処理動作を示すフローチャートである。It is a flowchart which shows the processing operation of the correction | amendment evaluation apparatus which concerns on the 4th Embodiment of this invention. 第4の実施形態において、設定された部分画像の例を示す図である。It is a figure which shows the example of the set partial image in 4th Embodiment. 第4の実施形態に係る補正評価装置による評価結果の一例を示す図である。It is a figure which shows an example of the evaluation result by the correction | amendment evaluation apparatus which concerns on 4th Embodiment. 部分画像を設定する領域の探索の様子を示す図である。It is a figure which shows the mode of the search of the area | region which sets a partial image. 部分画像を設定する領域の探索の様子を示す図である。It is a figure which shows the mode of the search of the area | region which sets a partial image. 輝度値レベルへの分類のための境界値の設定を示す図である。It is a figure which shows the setting of the boundary value for the classification | category to a luminance value level. 画像が黄色っぽい場合に、青色を強調させるように色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。It is a figure which shows a response | compatibility of the gradation value of each color of the image before correction | amendment in the case of correcting a color tone so that blue may be emphasized when an image is yellowish. 画像が青っぽい場合に、赤色と緑色を強調し、青色を減衰させるように色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。FIG. 10 is a diagram illustrating correspondence between gradation values of respective colors of an image before correction and an image after correction when color tone correction is performed so that red and green are emphasized and blue is attenuated when the image is bluish. オフセットで色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。It is a figure which shows a response | compatibility with the gradation value of each color of the image before correction | amendment in the case of carrying out color tone correction | amendment by offset.

以下、本発明の好適な実施形態について図面を参照して詳細に説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments of the invention will be described in detail with reference to the drawings.

<1.第1の実施形態>
<1.1.装置構成>
図1は、本発明第1の実施形態に係る補正評価装置(演算装置)のハードウェア構成図である。補正評価装置100は、汎用のコンピュータに専用のプログラムを組み込むことにより実現することができる。図1に示すように、補正評価装置100は、CPU(Central Processing Unit)1と、メインメモリであるRAM(Random Access Memory)2と、CPU1が実行するプログラムやデータを記憶するためのハードディスク、フラッシュメモリ等の記憶装置3と、キーボード・マウス等の指示入力部4と、データ記憶媒体等の外部装置とデータ通信するためのデータ入出力I/F(インタフェース)5と、液晶ディスプレイ等の表示デバイスである表示部6を備え、互いにバスを介して接続されている。記憶装置3には、コントラスト補正前の画像である補正前画像と、コントラスト補正後の画像である補正後画像が記憶されている。なお、コントラスト補正は、階調補正という広い概念の一つである。本実施形態では、コントラスト補正を行うため、画素の輝度値を用いた場合を例にとって説明するが、本発明は、輝度値以外の様々な画素値を変化させることにより色調補正、ガンマ補正等の様々な階調補正を行う場合についても適用可能である。
<1. First Embodiment>
<1.1. Device configuration>
FIG. 1 is a hardware configuration diagram of a correction evaluation apparatus (arithmetic apparatus) according to the first embodiment of the present invention. The correction evaluation apparatus 100 can be realized by incorporating a dedicated program into a general-purpose computer. As shown in FIG. 1, a correction evaluation apparatus 100 includes a CPU (Central Processing Unit) 1, a RAM (Random Access Memory) 2 as a main memory, a hard disk and a flash for storing programs and data executed by the CPU 1. A storage device 3 such as a memory, an instruction input unit 4 such as a keyboard / mouse, a data input / output I / F (interface) 5 for data communication with an external device such as a data storage medium, and a display device such as a liquid crystal display Are connected to each other via a bus. The storage device 3 stores an uncorrected image that is an image before contrast correction and an corrected image that is an image after contrast correction. Contrast correction is one of the broad concepts of gradation correction. In the present embodiment, a case where the luminance value of a pixel is used for contrast correction will be described as an example. However, the present invention changes various pixel values other than the luminance value to perform color tone correction, gamma correction, and the like. The present invention can also be applied to various gradation corrections.

図2は、本実施形態に係る補正評価装置の構成を示す機能ブロック図である。図2において、10は画像取込手段、20は輝度値分類手段、30はレンジ幅算出手段、40はレンジ変化量算出手段、50は画像記憶手段である。   FIG. 2 is a functional block diagram showing the configuration of the correction evaluation apparatus according to the present embodiment. In FIG. 2, 10 is an image capture means, 20 is a luminance value classification means, 30 is a range width calculation means, 40 is a range change amount calculation means, and 50 is an image storage means.

画像取込手段10は、画像記憶手段50に記憶された画像の中から指定された補正前画像および補正後画像を取り込む。輝度値分類手段20は、取り込んだ画像の各画素を、その輝度値に応じて、事前に設定された輝度値レベルに分類する。本実施形態では、画素値として輝度値を用いているため、画素値レベルの一例である輝度値レベルに分類することになる。レンジ幅算出手段30は、各画像の輝度値レベルごとに、その輝度値レベルに属する画素のレンジ幅を算出する。レンジ変化量算出手段40は、各輝度値レベルについて、補正前画像と補正後画像のレンジ幅の変化量を算出する。画像記憶手段50は、コントラスト補正の対象となった補正前の画像である補正前画像と、補正前画像に対してコントラスト補正を行った後の画像である補正後画像を記憶している。   The image capture means 10 captures the pre-correction image and post-correction image specified from the images stored in the image storage means 50. The luminance value classification unit 20 classifies each pixel of the captured image into a luminance value level set in advance according to the luminance value. In this embodiment, since the luminance value is used as the pixel value, it is classified into a luminance value level which is an example of the pixel value level. For each luminance value level of each image, the range width calculating unit 30 calculates the range width of the pixels belonging to the luminance value level. The range change amount calculation means 40 calculates the change amount of the range width between the uncorrected image and the corrected image for each luminance value level. The image storage unit 50 stores a pre-correction image that is a pre-correction image to be subjected to contrast correction, and a post-correction image that is an image after performing contrast correction on the pre-correction image.

画像取込手段10、輝度値分類手段20、レンジ幅算出手段30、レンジ変化量算出手段40は、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。画像記憶手段50は、コントラスト補正の対象となった補正前の画像データである補正前画像と、補正前画像に対してコントラスト補正を行った後の画像データである補正後画像を記憶した記憶手段であり、記憶装置3により実現される。画像データとしては、単色のグレースケール画像を用いることもできるし、複数色のカラー画像を用いることもできる。また、画像データの階調としては、各画素の各色が6ビット64階調で表現されたものや、8ビット256階調で表現されたもの等、様々な階調のものを使用することができる。   The image capturing unit 10, the luminance value classifying unit 20, the range width calculating unit 30, and the range change amount calculating unit 40 are realized by the CPU 1 executing a program stored in the storage device 3. The image storage unit 50 stores a pre-correction image that is image data before correction that is a target of contrast correction, and a post-correction image that is image data after performing contrast correction on the pre-correction image. And is realized by the storage device 3. As the image data, a single-color gray scale image can be used, or a color image of a plurality of colors can be used. Further, as gradations of image data, it is possible to use various gradations such as those in which each color of each pixel is expressed by 6-bit 64 gradations and those expressed by 8-bit 256 gradations. it can.

図2に示した各構成手段は、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。なお、本明細書において、コンピュータとは、CPU等の演算処理部を有し、データ処理が可能な装置を意味し、パーソナルコンピュータなどの汎用コンピュータだけでなく、タブレットやいわゆるスマートフォン等のデータ処理端末も含む。   Each component shown in FIG. 2 is actually realized by installing a dedicated program in hardware such as a computer and its peripheral devices as shown in FIG. That is, the computer executes the contents of each means according to a dedicated program. In this specification, the computer means an apparatus having an arithmetic processing unit such as a CPU and capable of data processing, and is not only a general-purpose computer such as a personal computer but also a data processing terminal such as a tablet or a so-called smartphone. Including.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、補正評価装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、画像取込手段10、輝度値分類手段20、レンジ幅算出手段30、レンジ変化量算出手段40としての機能を実現することになる。また、記憶装置3は、画像記憶手段50として機能するだけでなく、補正評価装置としての処理に必要な様々なデータを記憶する。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as a correction evaluation device. By executing this dedicated program, the CPU 1 realizes functions as the image capturing means 10, the luminance value classification means 20, the range width calculation means 30, and the range change amount calculation means 40. The storage device 3 not only functions as the image storage unit 50 but also stores various data necessary for processing as the correction evaluation device.

<1.2.処理動作>
次に、図3に示したフローチャートを用いて、本発明第1の実施形態に係るコントラスト補正の評価方法を、図1、図2に示した補正評価装置の処理動作とともに説明する。まず、画像取込手段10が、画像記憶手段50に記憶された補正前画像、補正後画像を取り込む(ステップS11)。補正前画像、補正後画像がグレースケール画像である場合は、そのまま取り込む。補正前画像、補正後画像がカラー画像である場合は、画像取込手段10は、グレースケール変換を行うか、または一部の値のみを抽出してグレースケール画像として取り込む。
<1.2. Processing action>
Next, the contrast correction evaluation method according to the first embodiment of the present invention will be described together with the processing operation of the correction evaluation apparatus shown in FIGS. 1 and 2 using the flowchart shown in FIG. First, the image capture means 10 captures the pre-correction image and the post-correction image stored in the image storage means 50 (step S11). If the pre-correction image and the post-correction image are grayscale images, they are captured as they are. If the pre-correction image and the post-correction image are color images, the image capturing means 10 performs gray scale conversion or extracts only a part of the values and captures them as a gray scale image.

例えば、補正前画像および補正後画像がRGB形式のカラー画像である場合は、画素ごとに0.299×R+0.587×G+0.114×Bの演算を行うことによりグレースケール変換を行うか、最も重みの強いG成分のみを抽出してグレースケール画像として取り込む。また、補正前画像および補正後画像がYCbCr形式やYIQ形式のカラー画像である場合は、Y成分のみを抽出してグレースケール画像として取り込む。他の形式のカラー画像に対しても、画像取込手段10は、1画素が1つの値を有する形式のグレースケール画像に変換して取り込む。このようにしてグレースケール画像として取り込んだ、明るさを表現する画素の値を輝度値とする。   For example, when the pre-correction image and the post-correction image are RGB color images, grayscale conversion is performed by performing an operation of 0.299 × R + 0.587 × G + 0.114 × B for each pixel, Only the G component having a strong weight is extracted and captured as a grayscale image. When the pre-correction image and the post-correction image are color images in YCbCr format or YIQ format, only the Y component is extracted and captured as a grayscale image. For other types of color images as well, the image capturing means 10 converts and captures a grayscale image of a format in which one pixel has one value. The value of the pixel expressing the brightness captured as a gray scale image in this way is set as the luminance value.

したがって、画像取込手段10は、各画素が輝度値を有するグレースケール画像として補正前画像および補正後画像を取り込むことになる。ここで、輝度値とは、純粋に輝度を表現したものに限定されず、なんらかの基準(画素の元々の値である「グレーレベル」等)により画素の階調を表現した値を含むものとする。以下では、画像取込手段10により補正前画像および補正後画像が6ビット64階調のグレースケール画像として取り込まれた場合を例にとって説明する。   Therefore, the image capturing means 10 captures the pre-correction image and the post-correction image as a grayscale image in which each pixel has a luminance value. Here, the luminance value is not limited to purely expressing the luminance, but includes a value expressing the gradation of the pixel based on some standard (such as “gray level” which is the original value of the pixel). Hereinafter, a case where the pre-correction image and the post-correction image are captured as a 6-bit 64-gradation grayscale image by the image capturing unit 10 will be described as an example.

次に、輝度値分類手段20が、取り込んだ補正前画像、補正後画像の各画素の輝度値に応じて各画素を複数の輝度値レベルに分類する(ステップS12)。具体的には、補正前画像の各画素を複数の輝度値レベルのいずれかに分類し、補正後画像については、補正前画像の画素と同一位置の画素が、同一輝度値レベルに属するように分類する。これにより、各輝度値レベルに、分類された画素が選択画素群として存在することになる。   Next, the luminance value classifying unit 20 classifies each pixel into a plurality of luminance value levels according to the luminance value of each pixel of the captured pre-correction image and post-correction image (step S12). Specifically, each pixel of the pre-correction image is classified into one of a plurality of luminance value levels, and for the post-correction image, the pixel at the same position as the pixel of the pre-correction image belongs to the same luminance value level. Classify. As a result, classified pixels exist as selected pixel groups at each luminance value level.

複数の輝度値レベルとして、いくつのレベルに分類するかについては、適宜設定することが可能であるが、本実施形態では、暗部、中間部、明部の3つのレベルに分類している。また、どの輝度値の範囲を暗部、中間部、明部に分類するかについても適宜設定することが可能であるが、本実施形態では、0〜63の値をとる6ビット64階調の画素において、境界値を16および48と設定し、0以上15以下(16未満)を暗部、16以上47以下(48未満)を中間部、48以上63以下を明部に設定している。   The number of levels to be classified as a plurality of luminance value levels can be set as appropriate, but in this embodiment, the levels are classified into three levels, a dark part, an intermediate part, and a bright part. In addition, although it is possible to appropriately set which luminance value range is classified into a dark part, an intermediate part, and a bright part, in this embodiment, a 6-bit 64-gradation pixel having a value of 0 to 63 The boundary values are set to 16 and 48, 0 to 15 or less (less than 16) is set to the dark part, 16 to 47 or less (less than 48) is set to the intermediate part, and 48 to 63 or less is set to the bright part.

補正前画像については、各画素は、その輝度値に応じて、いずれかの輝度値レベルに分類される。補正後画像については、補正後画像の各画素の輝度値に応じて分類されるのではなく、補正後画像の各画素と同一位置(同一座標)の補正前画像の画素が分類された輝度値レベルと同一の輝度値レベルに分類される。補正後画像は、補正前画像に対してコントラスト補正を行うことにより得られた画像であるため、横と縦(xとy)の画素数は当然ながら同一であり、画素の位置も一対一で対応している。そのため、同一位置(同一座標)の画素は容易に特定できる。   For the pre-correction image, each pixel is classified into one of the luminance value levels according to its luminance value. The corrected image is not classified according to the luminance value of each pixel of the corrected image, but the luminance value of the pixel of the pre-correction image at the same position (same coordinate) as each pixel of the corrected image. It is classified into the same luminance value level as the level. Since the post-correction image is an image obtained by performing contrast correction on the pre-correction image, the number of horizontal and vertical (x and y) pixels is naturally the same, and the pixel positions are also one-to-one. It corresponds. Therefore, pixels at the same position (same coordinates) can be easily identified.

ここで、補正前画像と補正後画像内の画素の輝度値レベル分類の概念を図4に示す。図4において、左右の大きな矩形は、それぞれ補正前画像、補正後画像の画像領域全体を示している。また、補正前画像内の小さな3つの矩形は、それぞれ1つの画素を示し、補正後画像内の小さな3つの矩形は、補正前画像内の画素と同一位置(同一座標)の画素を示している。小さい矩形のうち、黒で塗り潰されているものは、64階調のうち0以上15以下の輝度値の画素を示し、斜線で網掛けされているものは、64階調のうち16以上47以下の輝度値の画素を示し、白で塗り潰されているものは、64階調のうち48以上63以下の輝度値の画素を示している。   Here, the concept of the luminance value level classification of the pixels in the pre-correction image and the post-correction image is shown in FIG. In FIG. 4, the left and right large rectangles indicate the entire image area of the uncorrected image and the corrected image, respectively. Each of the three small rectangles in the pre-correction image indicates one pixel, and each of the three small rectangles in the post-correction image indicates a pixel at the same position (same coordinate) as the pixel in the pre-correction image. . Among the small rectangles, those that are filled with black indicate pixels having a luminance value of 0 to 15 in 64 gradations, and those that are shaded with diagonal lines are 16 to 47 in 64 gradations. The pixels with the luminance value are filled with white, and the pixels with the luminance value of 48 or more and 63 or less of the 64 gradations are shown.

補正前画像の画素は、図4に示すように、輝度値に応じて暗部、中間部、明部に分類される。しかし、補正後画像の画素は、同一位置の補正前画像の画素と同じ輝度値レベルに分類されるため、図4の例では、白で塗り潰された48以上63以下の輝度値の画素であっても、暗部に分類され、黒で塗り潰された0以上15以下の輝度値の画素であっても、中間部、明部に分類される場合がある。   As shown in FIG. 4, the pixels of the image before correction are classified into a dark part, an intermediate part, and a bright part according to the luminance value. However, since the pixels of the corrected image are classified into the same luminance value level as the pixels of the uncorrected image at the same position, in the example of FIG. 4, the pixels with luminance values of 48 or more and 63 or less filled in white. Even in the case of a pixel having a brightness value of 0 to 15 that is classified as a dark part and painted in black, it may be classified as an intermediate part or a bright part.

次に、レンジ幅算出手段30が、補正前画像、補正後画像それぞれについて、分類された各輝度値レベルのレンジ幅を算出する(ステップS13)。レンジ幅は、輝度値の広がりの幅を示すものであり、統計値に基づく複数の定義により定めることができるが、本実施形態では、3つの定義により定めており、そのうちの一つを利用可能となっている。第1の定義は標準偏差である。各輝度値レベルについて、含まれる画素の輝度値の標準偏差σを算出し、標準偏差σに基づき、標準偏差σの2倍である2σをレンジ幅とする。すなわち、輝度値の統計値として標準偏差σを求め、標準偏差σに基づく2σをレンジ幅とする。   Next, the range width calculation means 30 calculates the range width of each classified luminance value level for each of the pre-correction image and the post-correction image (step S13). The range width indicates the width of the brightness value spread, and can be determined by a plurality of definitions based on statistical values. In this embodiment, the range width is determined by three definitions, and one of them can be used. It has become. The first definition is standard deviation. For each luminance value level, the standard deviation σ of the luminance values of the included pixels is calculated, and 2σ, which is twice the standard deviation σ, is set as the range width based on the standard deviation σ. That is, a standard deviation σ is obtained as a statistical value of luminance values, and 2σ based on the standard deviation σ is set as a range width.

第2の定義は最大値と最小値の差である。各輝度値レベルについて、含まれる画素の輝度値の最大値と最小値の差を算出し、算出された差をレンジ幅とする。すなわち、輝度値の統計値として輝度値の最大値と最小値を求め、その差をレンジ幅とする。   The second definition is the difference between the maximum and minimum values. For each luminance value level, the difference between the maximum value and the minimum value of the luminance values of the included pixels is calculated, and the calculated difference is set as the range width. That is, the maximum value and the minimum value of the luminance value are obtained as the statistical value of the luminance value, and the difference is set as the range width.

第3の定義は中央の所定割合の画素数の範囲である。各輝度値レベルについて、含まれる画素の輝度値の中央の所定割合の画素数を特定し、その特定された画素の輝度値の最大値と最小値の差を算出し、算出された差をレンジ幅とする。すなわち、輝度値の統計値として中央の所定割合の画素の輝度値の最大値と最小値を求め、その差をレンジ幅とする。所定割合としては、適宜設定することが可能であるが、本実施形態では90%としている。したがって、輝度値が小さい画素5%と輝度値が大きい画素5%を除いた画素90%のうち最大の輝度値と最小の輝度値の差がレンジ幅となる。言い換えると、中央値から輝度値の大きい方、小さい方それぞれ45%ずつの画素をとった場合の最大の輝度値と最小の輝度値の差がレンジ幅となる。   The third definition is a range of the number of pixels at a predetermined ratio in the center. For each luminance value level, specify the number of pixels in the center of the luminance value of the included pixels, calculate the difference between the maximum and minimum luminance values of the specified pixel, and range the calculated difference Width. That is, the maximum value and the minimum value of the luminance values of the pixels at a predetermined ratio in the center are obtained as the statistical values of the luminance values, and the difference is set as the range width. The predetermined ratio can be set as appropriate, but is set to 90% in the present embodiment. Therefore, the range width is the difference between the maximum luminance value and the minimum luminance value among the 90% pixels excluding the pixel 5% having a small luminance value and the pixel 5% having a large luminance value. In other words, the range width is the difference between the maximum luminance value and the minimum luminance value when 45% pixels are taken from the median to the larger and smaller luminance values.

ここで、レンジ幅の上記3つの定義と、画素の輝度値のヒストグラムの関係を図5に示す。図5(a)(b)(c)のいずれも、横軸が輝度値、縦軸が画素数を示している。横軸については、6ビット64階調であるため、0〜63の値をとる。縦軸については、画素数が最大の場合を“1”として正規化した数値を示している。図5(a)(b)(c)のヒストグラムは、同一画像から作成されたものであるため、全て同一となっている。   Here, the relationship between the above three definitions of the range width and the histogram of the luminance value of the pixel is shown in FIG. 5A, 5B, and 5C, the horizontal axis indicates the luminance value, and the vertical axis indicates the number of pixels. Since the horizontal axis is 6 bits and 64 gradations, it takes a value of 0 to 63. On the vertical axis, a numerical value normalized by setting “1” when the number of pixels is the maximum is shown. The histograms in FIGS. 5A, 5B, and 5C are created from the same image, and are all the same.

このようなヒストグラムとレンジ幅の関係について説明する。図5(a)は、標準偏差σの2倍である2σをレンジ幅とした例である。図5のヒストグラムでは、平均値が21であり、標準偏差が6であるため、12がレンジ幅となる。   A relationship between such a histogram and a range width will be described. FIG. 5A shows an example in which 2σ, which is twice the standard deviation σ, is set as the range width. In the histogram of FIG. 5, since the average value is 21 and the standard deviation is 6, 12 is the range width.

図5(b)は、画素の輝度値の最大値と最小値の差をレンジ幅とした例である。図5のヒストグラムでは、輝度値の最大値が41であり輝度値の最小値が4であるため、その差である37がレンジ幅となる。   FIG. 5B is an example in which the difference between the maximum value and the minimum value of the luminance value of the pixel is set as the range width. In the histogram of FIG. 5, since the maximum value of the luminance value is 41 and the minimum value of the luminance value is 4, the difference 37 is the range width.

図5(c)は、画素の輝度値の中央の90%の画素(最小から5%と最大から5%を除いたもの)を特定し、その特定された画素の輝度値の最大値と最小値の差を算出し、算出された差をレンジ幅とする。所定割合としては、適宜設定することが可能であるが、本実施形態では90%としている。図5のヒストグラムでは、上位5%を除いた輝度値の最大値が32であり、下位5%を除いた輝度値の最小値が13であるため、その差である19がレンジ幅となる。   FIG. 5C identifies 90% of pixels in the center of the luminance value of the pixel (excluding 5% from the minimum and 5% from the maximum), and the maximum and minimum luminance values of the specified pixel. The difference between the values is calculated, and the calculated difference is set as the range width. The predetermined ratio can be set as appropriate, but is set to 90% in the present embodiment. In the histogram of FIG. 5, the maximum luminance value excluding the upper 5% is 32 and the minimum luminance value excluding the lower 5% is 13, so the difference 19 is the range width.

図5に示したように、レンジ幅は、どのような定義で設定されるかにより異なるが、補正前画像と補正後画像に対しては、同一の定義により設定されたレンジ幅を用いるため、公平な比較を行うことができる。レンジ幅として、いずれの定義を選択するかについては、画像の特性等を考慮して事前に設定しておくことになる。上記3つの定義以外にも、輝度値の統計値を用いたレンジ幅を設定することが可能である。   As shown in FIG. 5, the range width varies depending on what definition is set, but the range width set by the same definition is used for the pre-correction image and the post-correction image, A fair comparison can be made. Which definition is selected as the range width is set in advance in consideration of image characteristics and the like. In addition to the above three definitions, it is possible to set the range width using the statistical value of the luminance value.

ステップS13において補正前画像の各輝度値レベル、補正後画像の各輝度値レベルのレンジ幅が算出されたら、次に、レンジ変化量算出手段40が、各輝度値レベルのレンジ変化量を算出する(ステップS14)。具体的には、各輝度値レベルについて、補正前画像のレンジ幅、補正後画像のレンジ幅を用いて、以下の〔数式1〕に従った処理を実行することにより、各輝度値レベルのレンジ変化量RVを算出する。   If the range width of each brightness value level of the pre-correction image and each brightness value level of the post-correction image is calculated in step S13, then the range change amount calculation means 40 calculates the range change amount of each brightness value level. (Step S14). Specifically, for each luminance value level, by using the range width of the pre-correction image and the range width of the post-correction image, the processing according to the following [Equation 1] is executed, thereby the range of each luminance value level. A change amount RV is calculated.

〔数式1〕
RV=(補正後画像のレンジ幅)/(補正前画像のレンジ幅)
[Formula 1]
RV = (range width of image after correction) / (range width of image before correction)

レンジ変化量RVは、輝度値レベルごとに算出されるものであるため、上記〔数式1〕に示すように、各輝度値レベルについて、補正後画像のレンジ幅を、補正前画像のレンジ幅で除することにより算出される。すなわち、レンジ変化量RVは、補正後画像のレンジ幅と補正前画像のレンジ幅の比で表現される。このレンジ変化量RVは、コントラスト補正等の階調補正の効果を評価する評価指標として用いられる。   Since the range change amount RV is calculated for each luminance value level, as shown in [Formula 1], for each luminance value level, the range width of the image after correction is the range width of the image before correction. It is calculated by dividing. That is, the range change amount RV is expressed by a ratio between the range width of the corrected image and the range width of the uncorrected image. This range change amount RV is used as an evaluation index for evaluating the effect of gradation correction such as contrast correction.

レンジ変化量RVが1より大きい場合は、コントラストが改善されていることを示し、レンジ変化量RVの値が大きいほど改善度が高い。レンジ変化量RV=1の場合は、補正後においてもコントラストが維持されていることを示す。レンジ変化量RVが1より小さい場合は、補正後にコントラストが劣化していることを示す。この場合、その輝度値レベルで階調潰れが発生する可能性がある。レンジ変化量RV=0の場合は、補正後の画素値(輝度値)が一定となっていること(飽和)を示す。これは、補正により、いわゆる黒潰れや白飛びが発生したことを意味する。なお、コントラスト補正を行わず、補正前画像と補正後画像が同じである場合、レンジ変化量RV=1となる。   When the range change amount RV is larger than 1, it indicates that the contrast is improved, and the degree of improvement is higher as the value of the range change amount RV is larger. A range change amount RV = 1 indicates that the contrast is maintained even after correction. When the range change amount RV is smaller than 1, it indicates that the contrast has deteriorated after correction. In this case, gradation collapse may occur at that luminance value level. The range change amount RV = 0 indicates that the corrected pixel value (luminance value) is constant (saturated). This means that so-called black crushing or whiteout occurs due to the correction. If contrast correction is not performed and the pre-correction image and the post-correction image are the same, the range change amount RV = 1.

図6に、ある画像についての補正前と補正後のヒストグラムおよびレンジ幅の変化の様子を示す。図6(a)は、補正前のヒストグラムを示し、図6(b)は、補正後のヒストグラムを、暗部、中間部、明部の輝度値レベル単位で示している。暗部、中間部、明部それぞれについて、補正前と補正後を比較すると、図6(a)に示した補正前画像のレンジ幅に比較して、図6(b)に示した補正後画像のレンジ幅が大きくなっているのがわかる。これは、暗部、中間部、明部それぞれにおいて、レンジ変化量RVが1より大きくなり、コントラストが改善されていることを示している。   FIG. 6 shows changes in histogram and range width before and after correction for a certain image. 6A shows a histogram before correction, and FIG. 6B shows a histogram after correction in units of luminance value levels of a dark part, an intermediate part, and a bright part. Comparing the dark part, the intermediate part, and the bright part before and after the correction, the corrected image shown in FIG. 6B is compared with the range width of the pre-correction image shown in FIG. It can be seen that the range width has increased. This indicates that the range change amount RV is larger than 1 in each of the dark part, the intermediate part, and the bright part, and the contrast is improved.

次に、補正処理の評価を行う(ステップS15)。具体的には、ステップS14において算出されたレンジ変化量RVを確認し、レンジ変化量RVの値が大きければ、その補正手法について高評価を与え、レンジ変化量RVの値が小さければ、その補正手法について低評価を与える。評価の具体的な提示手法としては、例えば、所定のしきい値を定めておき、しきい値より大きければ「高評価」、しきい値より小さければ「低評価」等として、表示部6に表示出力することができる。また、レンジ変化量RVの値を直接表示部6に表示出力することにより、評価を提示することもできる。   Next, the correction process is evaluated (step S15). Specifically, the range change amount RV calculated in step S14 is confirmed. If the value of the range change amount RV is large, the correction method is highly evaluated. If the value of the range change amount RV is small, the correction is made. Give a low rating for the method. As a specific presentation method of evaluation, for example, a predetermined threshold value is set, and if it is larger than the threshold value, it is indicated as “high evaluation”, if it is smaller than the threshold value, “low evaluation”, etc. Display output is possible. In addition, the evaluation can be presented by directly outputting the value of the range change amount RV on the display unit 6.

図7は、異なるトーンカーブに基づく補正手法による補正前画像(図中「入力」と表記)と補正後画像(図中「出力」と表記)の輝度値の対応を示す図である。図7(a)(b)(c)それぞれにおける左下端から右上端に向かう細めの線分は、補正がなされない場合の基準線を示しており、左上端と右上端を結ぶ太めの曲線は、補正手法を規定するトーンカーブを示している。また、横軸、縦軸において3つに区分された範囲は、それぞれ0側(左下端)から暗部、中間部、明部を示している。   FIG. 7 is a diagram illustrating a correspondence between luminance values of an image before correction (indicated as “input” in the figure) and an image after correction (indicated as “output” in the figure) by a correction method based on different tone curves. 7 (a), (b), and (c), the thin line segment from the lower left end to the upper right end indicates a reference line when correction is not performed, and a thick curve connecting the upper left end and the upper right end is The tone curve defining the correction method is shown. Further, the ranges divided into three on the horizontal axis and the vertical axis indicate the dark part, the intermediate part, and the bright part from the 0 side (lower left end), respectively.

図7(a)は、暗部を強調するトーンカーブに基づく補正を示しており、暗部のレンジ範囲が拡大した分だけ、明部のレンジ範囲が縮小している。すなわち、図7(a)に示す補正では、暗部のコントラストが改善する。図7(a)に示した補正前画像および補正後画像に対して本実施形態に係る補正評価装置でレンジ変化量を算出すると、暗部のレンジ変化量が>1、中間部のレンジ変化量<1、明部のレンジ変化量<1となる。   FIG. 7A shows correction based on a tone curve for emphasizing the dark portion, and the range range of the bright portion is reduced by an amount corresponding to the increase of the range range of the dark portion. That is, the correction shown in FIG. 7A improves the contrast of the dark part. When the range change amount is calculated by the correction evaluation apparatus according to the present embodiment for the pre-correction image and the post-correction image shown in FIG. 7A, the range change amount in the dark part is> 1, and the range change amount in the intermediate part < 1. The range change amount of the bright part is <1.

図7(b)は、明部を強調するトーンカーブに基づく補正を示しており、明部のレンジ範囲が拡大した分だけ、暗部のレンジ範囲が縮小している。すなわち、図7(b)に示す補正では、明部のコントラストが改善する。図7(b)に示した補正前画像および補正後画像に対して本実施形態に係る補正評価装置でレンジ変化量を算出すると、暗部のレンジ変化量が<1、中間部のレンジ変化量<1、明部のレンジ変化量>1となる。   FIG. 7B shows correction based on a tone curve that emphasizes the bright portion, and the dark range range is reduced by an amount corresponding to the increase of the bright range range. That is, in the correction shown in FIG. 7B, the contrast of the bright part is improved. When the range change amount is calculated by the correction evaluation apparatus according to the present embodiment for the pre-correction image and the post-correction image shown in FIG. 7B, the range change amount in the dark portion is <1, and the range change amount in the intermediate portion < 1. The range change amount of the bright part is greater than 1.

図7(c)は、中間部を強調するトーンカーブに基づく補正を示しており、中間部のレンジ範囲が拡大した分だけ、明部と暗部のレンジ範囲が縮小している。すなわち、図7(c)に示す補正では、中間部のコントラストが改善する。図7(c)に示した補正前画像および補正後画像に対して本実施形態に係る補正評価装置でレンジ変化量を算出すると、暗部のレンジ変化量が<1、中間部のレンジ変化量>1、明部のレンジ変化量<1となる。   FIG. 7C shows correction based on a tone curve that emphasizes the intermediate portion, and the range range of the bright portion and the dark portion is reduced by an amount corresponding to the increase of the range range of the intermediate portion. That is, in the correction shown in FIG. 7C, the contrast of the intermediate portion is improved. When the range change amount is calculated by the correction evaluation apparatus according to the present embodiment for the uncorrected image and the corrected image shown in FIG. 7C, the range change amount in the dark part is <1, the range change amount in the intermediate part>. 1. The range change amount of the bright part is <1.

図8は、輝度値レベルごとに異なるトーンカーブに基づく補正を行う場合における、補正前画像(図中「入力」と表記)と補正後画像(図中「出力」と表記)の輝度値の対応を示す図である。図8(a)は、暗部を強調するトーンカーブにより暗部のみを補正する場合を示している。図8(b)は、明部を強調するトーンカーブにより明部のみを補正する場合を示している。図8(c)は、中間部を強調するトーンカーブにより中間部のみを補正する場合を示している。   FIG. 8 shows the correspondence between the luminance values of the image before correction (indicated as “input” in the figure) and the image after correction (indicated as “output” in the figure) when correction based on a tone curve that differs for each luminance value level is performed. FIG. FIG. 8A shows a case where only the dark portion is corrected by a tone curve that emphasizes the dark portion. FIG. 8B shows a case where only the bright part is corrected by a tone curve that emphasizes the bright part. FIG. 8C shows a case where only the intermediate portion is corrected by a tone curve that emphasizes the intermediate portion.

図8に示したように、補正前画像の暗部、中間部、明部に対してそれぞれ異なるトーンカーブに基づく補正を行うことにより、暗部、中間部、明部全てのコントラストが改善する。図8に示した補正前画像および補正後画像に対して本実施形態に係る補正評価装置でレンジ変化量を算出すると、暗部のレンジ変化量が>1、中間部のレンジ変化量>1、明部のレンジ変化量>1となる。   As shown in FIG. 8, by performing correction based on different tone curves for the dark portion, intermediate portion, and bright portion of the pre-correction image, the contrast of all of the dark portion, intermediate portion, and bright portion is improved. When the range change amount is calculated by the correction evaluation apparatus according to the present embodiment for the pre-correction image and the post-correction image shown in FIG. 8, the range change amount in the dark part is> 1, the range change amount in the intermediate part> 1, The range change amount of the section is> 1.

<2.第2の実施形態>
<2.1.装置構成>
次に、第2の実施形態について説明する。第2の実施形態に係る補正評価装置のハードウェア構成は、第1の実施形態と同様、図1に示したようなものとなっており、第2の実施形態に係る補正評価装置101は、汎用のコンピュータに専用のプログラムを組み込むことにより実現することができる。
<2. Second Embodiment>
<2.1. Device configuration>
Next, a second embodiment will be described. As in the first embodiment, the hardware configuration of the correction evaluation apparatus according to the second embodiment is as shown in FIG. 1, and the correction evaluation apparatus 101 according to the second embodiment includes: This can be realized by incorporating a dedicated program into a general-purpose computer.

図9は、本実施形態に係る補正評価装置の構成を示す機能ブロック図である。図9において、11は画像取込手段、21は部分画像抽出手段、31はレンジ幅算出手段、41はレンジ変化量算出手段、51は画像記憶手段である。   FIG. 9 is a functional block diagram showing the configuration of the correction evaluation apparatus according to the present embodiment. In FIG. 9, 11 is an image capturing means, 21 is a partial image extracting means, 31 is a range width calculating means, 41 is a range change amount calculating means, and 51 is an image storage means.

画像取込手段11は、画像記憶手段51に記憶された画像の中から指定された補正前画像および補正後画像を取り込む。部分画像抽出手段21は、取り込んだ画像の一部分である部分画像を抽出する。レンジ幅算出手段31は、補正前画像および補正後画像の部分画像ごとに、その部分画像に属する画素のレンジ幅を算出する。レンジ変化量算出手段41は、各部分画像について、補正前画像と補正後画像のレンジ幅の変化量を算出する。画像記憶手段51は、コントラスト補正の対象となった補正前の画像である補正前画像と、補正前画像に対してコントラスト補正を行った後の画像である補正後画像を記憶している。上述のように、コントラスト補正は、階調補正という広い概念の一つである。本実施形態では、コントラスト補正を行うため、画素の輝度値を用いた場合を例にとって説明するが、本発明は、輝度値以外の様々な画素値を変化させることにより色調補正、ガンマ補正等の様々な階調補正を行う場合についても適用可能である。   The image capturing unit 11 captures the pre-correction image and the post-correction image specified from the images stored in the image storage unit 51. The partial image extraction unit 21 extracts a partial image that is a part of the captured image. The range width calculation unit 31 calculates the range width of the pixels belonging to the partial image for each partial image of the pre-correction image and the post-correction image. The range change amount calculation means 41 calculates the change amount of the range width between the pre-correction image and the post-correction image for each partial image. The image storage unit 51 stores a pre-correction image that is a pre-correction image to be subjected to contrast correction, and a post-correction image that is an image after performing contrast correction on the pre-correction image. As described above, contrast correction is one of the broad concepts of gradation correction. In the present embodiment, a case where the luminance value of a pixel is used for contrast correction will be described as an example. However, the present invention changes various pixel values other than the luminance value to perform color tone correction, gamma correction, and the like. The present invention can also be applied to various gradation corrections.

画像取込手段11、部分画像抽出手段21、レンジ幅算出手段31、レンジ変化量算出手段41は、第1の実施形態と同様、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。画像記憶手段51は、第1の実施形態と同様、コントラスト補正の対象となった補正前の画像データである補正前画像と、補正前画像に対してコントラスト補正を行った後の画像データである補正後画像を記憶した記憶手段であり、記憶装置3により実現される。画像データとしては、単色のグレースケール画像を用いることもできるし、複数色のカラー画像を用いることもできる。また、画像データの階調としては、各画素の各色が6ビット64階調で表現されたものや、8ビット256階調で表現されたもの等、様々な階調のものを使用することができる。   As in the first embodiment, the image capturing unit 11, the partial image extracting unit 21, the range width calculating unit 31, and the range change amount calculating unit 41 execute a program stored in the storage device 3. It is realized by. Similar to the first embodiment, the image storage unit 51 is a pre-correction image that is an image data before correction that is a target for contrast correction, and image data that has been subjected to contrast correction on the pre-correction image. The storage unit stores the corrected image, and is realized by the storage device 3. As the image data, a single-color gray scale image can be used, or a color image of a plurality of colors can be used. Further, as gradations of image data, it is possible to use various gradations such as those in which each color of each pixel is expressed by 6-bit 64 gradations and those expressed by 8-bit 256 gradations. it can.

図9に示した各構成手段は、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。なお、本明細書において、コンピュータとは、CPU等の演算処理部を有し、データ処理が可能な装置を意味し、パーソナルコンピュータなどの汎用コンピュータだけでなく、タブレットやいわゆるスマートフォン等のデータ処理端末も含む。   Each component shown in FIG. 9 is actually realized by mounting a dedicated program on hardware such as a computer and its peripheral devices as shown in FIG. That is, the computer executes the contents of each means according to a dedicated program. In this specification, the computer means an apparatus having an arithmetic processing unit such as a CPU and capable of data processing, and is not only a general-purpose computer such as a personal computer but also a data processing terminal such as a tablet or a so-called smartphone. Including.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、補正評価装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、画像取込手段11、部分画像抽出手段21、レンジ幅算出手段31、レンジ変化量算出手段41としての機能を実現することになる。また、記憶装置3は、画像記憶手段51として機能するだけでなく、補正評価装置としての処理に必要な様々なデータを記憶する。例えば、部分画像としてどの領域を特定するかについての情報も記憶されている。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as a correction evaluation device. By executing this dedicated program, the CPU 1 realizes functions as the image capturing unit 11, the partial image extracting unit 21, the range width calculating unit 31, and the range change amount calculating unit 41. The storage device 3 not only functions as the image storage unit 51 but also stores various data necessary for processing as the correction evaluation device. For example, information about which area is specified as the partial image is also stored.

<2.2.処理動作>
次に、図10に示したフローチャートを用いて、本発明第2の実施形態に係る階調補正の評価方法を、図1、図9に示した補正評価装置の処理動作とともに説明する。まず、第1の実施形態と同様、画像取込手段11が、画像記憶手段51に記憶された補正前画像、補正後画像を取り込む(ステップS21)。次に、取り込んだ補正前画像、補正後画像それぞれについて、部分画像抽出手段21が部分画像を抽出する(ステップS22)。具体的には、事前に設定された領域を部分画像とし、各部分画像に属する画素群を選択画素群として抽出する。
<2.2. Processing action>
Next, the gradation correction evaluation method according to the second embodiment of the present invention will be described together with the processing operation of the correction evaluation apparatus shown in FIGS. 1 and 9 using the flowchart shown in FIG. First, as in the first embodiment, the image capturing unit 11 captures the pre-correction image and the post-correction image stored in the image storage unit 51 (step S21). Next, the partial image extraction unit 21 extracts a partial image for each of the captured pre-correction image and post-correction image (step S22). Specifically, an area set in advance is set as a partial image, and a pixel group belonging to each partial image is extracted as a selected pixel group.

図11は、部分画像の区分の例を示す図である。図11の例では、補正対象とする画像が8×6の48個の部分画像に区分された例を示している。図11の例では、部分画像が、格子状に分割した領域で特定されている。何個の部分画像に区分するかについては、事前に設定しておくことができるが、補正前画像と補正後画像が同一個数、同一位置となるように設定する必要がある。   FIG. 11 is a diagram illustrating an example of segmentation of partial images. The example of FIG. 11 shows an example in which an image to be corrected is divided into 48 partial images of 8 × 6. In the example of FIG. 11, the partial image is specified by a region divided in a grid pattern. The number of partial images can be set in advance, but it is necessary to set the number of pre-correction images and the post-correction images so that they are the same number and the same position.

次に、レンジ幅算出手段31が、補正前画像、補正後画像それぞれについて、各部分画像のレンジ幅を算出する(ステップS23)。具体的には、第1の実施形態のステップS13で各輝度値レベルに対して実行したのと同様にして、各部分画像に対してレンジ幅の算出を行う。したがって、第2の実施形態においても、第1の実施形態と同様、標準偏差、最大値と最小値の差、中央値に近い所定割合の画素数の範囲の3つの定義のいずれかによりレンジ幅を算出する。   Next, the range width calculation unit 31 calculates the range width of each partial image for each of the pre-correction image and the post-correction image (step S23). Specifically, the range width is calculated for each partial image in the same manner as performed for each luminance value level in step S13 of the first embodiment. Therefore, in the second embodiment as well, as in the first embodiment, the range width depends on one of three definitions: standard deviation, difference between maximum and minimum values, and a range of the number of pixels at a predetermined ratio close to the median. Is calculated.

ステップS23において、補正前画像の各部分画像、補正後画像の各部分画像のレンジ幅が算出されたら、次に、各部分画像のレンジ変化量を算出する(ステップS24)。具体的には、各部分画像について、補正前画像のレンジ幅、補正後画像のレンジ幅を用いて、第1の実施形態でも用いた上記〔数式1〕に従った処理を実行することにより、各輝度値レベルのレンジ変化量RVを算出する。   If the range width of each partial image of the pre-correction image and each partial image of the post-correction image is calculated in step S23, next, the range change amount of each partial image is calculated (step S24). Specifically, for each partial image, using the range width of the pre-correction image and the range width of the post-correction image, by executing the processing according to the above [Equation 1] used in the first embodiment, A range change amount RV of each luminance value level is calculated.

第2の実施形態においては、レンジ変化量RVは、部分画像ごとに算出されるものであるため、上記〔数式1〕に示すように、各部分画像について、補正後画像のレンジ幅を、補正前画像のレンジ幅で除することにより算出される。このレンジ変化量RVは、コントラスト補正等の階調補正の効果を評価する評価指標として用いられる。   In the second embodiment, the range change amount RV is calculated for each partial image. Therefore, as shown in [Formula 1], the range width of the corrected image is corrected for each partial image. It is calculated by dividing by the range width of the previous image. This range change amount RV is used as an evaluation index for evaluating the effect of gradation correction such as contrast correction.

第1の実施形態と同様、レンジ変化量RVが1より大きい場合は、コントラストが改善されていることを示し、レンジ変化量RVの値が大きいほど改善度が高い。レンジ変化量RV=1の場合は、補正後においてもコントラストが維持されていることを示す。レンジ変化量RVが1より小さい場合は、補正後にコントラストが劣化していることを示す。この場合、その輝度値レベルで階調潰れが発生する可能性がある。レンジ変化量RV=0の場合は、補正後の画素値(輝度値)が一定となっていること(飽和)を示す。これは、補正により、いわゆる黒潰れや白飛びが発生したことを意味する。なお、コントラスト補正を行わず、補正前画像と補正後画像が同じである場合、レンジ変化量RV=1となる。   Similar to the first embodiment, when the range change amount RV is larger than 1, it indicates that the contrast is improved, and the degree of improvement is higher as the value of the range change amount RV is larger. A range change amount RV = 1 indicates that the contrast is maintained even after correction. When the range change amount RV is smaller than 1, it indicates that the contrast has deteriorated after correction. In this case, gradation collapse may occur at that luminance value level. The range change amount RV = 0 indicates that the corrected pixel value (luminance value) is constant (saturated). This means that so-called black crushing or whiteout occurs due to the correction. If contrast correction is not performed and the pre-correction image and the post-correction image are the same, the range change amount RV = 1.

次に、補正処理の評価を行う(ステップS25)。具体的には、ステップS24において算出されたレンジ変化量RVを確認し、レンジ変化量RVの値が大きければ、その補正手法について高評価を与え、レンジ変化量RVの値が小さければ、その補正手法について低評価を与える。部分画像ごとの評価が高い程、画像全体に対する補正の評価も高くなる。   Next, the correction process is evaluated (step S25). Specifically, the range change amount RV calculated in step S24 is confirmed. If the value of the range change amount RV is large, the correction method is highly evaluated. If the value of the range change amount RV is small, the correction is made. Give a low rating for the method. The higher the evaluation for each partial image, the higher the evaluation of correction for the entire image.

<3.第3の実施形態>
<3.1.装置構成>
次に、第3の実施形態について説明する。第3の実施形態に係る補正評価装置のハードウェア構成は、第1、第2の実施形態と同様、図1に示したようなものとなっており、第3の実施形態に係る補正評価装置102は、汎用のコンピュータに専用のプログラムを組み込むことにより実現することができる。
<3. Third Embodiment>
<3.1. Device configuration>
Next, a third embodiment will be described. As in the first and second embodiments, the hardware configuration of the correction evaluation apparatus according to the third embodiment is as shown in FIG. 1. The correction evaluation apparatus according to the third embodiment 102 can be realized by incorporating a dedicated program into a general-purpose computer.

図12は、本実施形態に係る補正評価装置の構成を示す機能ブロック図である。図12において、12は画像取込手段、22は部分画像抽出手段、23は輝度値分類手段、32はレンジ幅算出手段、42はレンジ変化量算出手段、52は画像記憶手段である。   FIG. 12 is a functional block diagram showing the configuration of the correction evaluation apparatus according to this embodiment. In FIG. 12, 12 is an image capture means, 22 is a partial image extraction means, 23 is a luminance value classification means, 32 is a range width calculation means, 42 is a range change amount calculation means, and 52 is an image storage means.

画像取込手段12は、画像記憶手段52に記憶された画像の中から指定された補正前画像および補正後画像を取り込む。部分画像抽出手段22は、取り込んだ画像の一部分である部分画像を抽出する。輝度値分類手段23は、抽出した部分画像を、その輝度値に応じて、事前に設定された輝度値レベルに分類する。本実施形態では、画素値として輝度値を用いているため、画素値レベルの一例である輝度値レベルに分類することになる。レンジ幅算出手段32は、補正前画像および補正後画像の輝度値レベルごとに、その輝度値レベルに属する画素のレンジ幅を算出する。   The image capturing unit 12 captures the pre-correction image and the post-correction image specified from the images stored in the image storage unit 52. The partial image extraction unit 22 extracts a partial image that is a part of the captured image. The luminance value classifying unit 23 classifies the extracted partial images into luminance value levels set in advance according to the luminance value. In this embodiment, since the luminance value is used as the pixel value, it is classified into a luminance value level which is an example of the pixel value level. For each luminance value level of the pre-correction image and the post-correction image, the range width calculation unit 32 calculates the range width of the pixels belonging to the luminance value level.

レンジ変化量算出手段42は、各輝度値レベルについて、補正前画像と補正後画像のレンジ幅の変化量を算出する。画像記憶手段52は、コントラスト補正の対象となった補正前の画像である補正前画像と、補正前画像に対してコントラスト補正を行った後の画像である補正後画像を記憶している。上述のように、コントラスト補正は、階調補正という広い概念の一つである。本実施形態では、コントラスト補正を行うため、画素の輝度値を用いた場合を例にとって説明するが、本発明は、輝度値以外の様々な画素値を変化させることにより色調補正、ガンマ補正等の様々な階調補正を行う場合についても適用可能である。   The range change amount calculation means 42 calculates the change amount of the range width between the pre-correction image and the post-correction image for each luminance value level. The image storage unit 52 stores a pre-correction image that is a pre-correction image to be subjected to contrast correction, and a post-correction image that is an image after performing contrast correction on the pre-correction image. As described above, contrast correction is one of the broad concepts of gradation correction. In the present embodiment, a case where the luminance value of a pixel is used for contrast correction will be described as an example. However, the present invention changes various pixel values other than the luminance value to perform color tone correction, gamma correction, and the like. The present invention can also be applied to various gradation corrections.

画像取込手段12、部分画像抽出手段22、輝度値分類手段23、レンジ幅算出手段32、レンジ変化量算出手段42は、第1、第2の実施形態と同様、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。画像記憶手段52は、第1、第2の実施形態と同様、コントラスト補正の対象となった補正前の画像データである補正前画像と、補正前画像に対してコントラスト補正を行った後の画像データである補正後画像を記憶した記憶手段であり、記憶装置3により実現される。画像データとしては、単色のグレースケール画像を用いることもできるし、複数色のカラー画像を用いることもできる。また、画像データの階調としては、各画素の各色が6ビット64階調で表現されたものや、8ビット256階調で表現されたもの等、様々な階調のものを使用することができる。   As in the first and second embodiments, the CPU 1 stores the image capturing unit 12, the partial image extracting unit 22, the luminance value classifying unit 23, the range width calculating unit 32, and the range change amount calculating unit 42 in the storage device 3. This is realized by executing a stored program. Similar to the first and second embodiments, the image storage unit 52 includes an image before correction that is image data before correction that is a target of contrast correction, and an image after contrast correction is performed on the image before correction. A storage unit that stores a corrected image that is data, and is realized by the storage device 3. As the image data, a single-color gray scale image can be used, or a color image of a plurality of colors can be used. Further, as gradations of image data, it is possible to use various gradations such as those in which each color of each pixel is expressed by 6-bit 64 gradations and those expressed by 8-bit 256 gradations. it can.

図12に示した各構成手段は、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。なお、本明細書において、コンピュータとは、CPU等の演算処理部を有し、データ処理が可能な装置を意味し、パーソナルコンピュータなどの汎用コンピュータだけでなく、タブレットやいわゆるスマートフォン等のデータ処理端末も含む。   Each component shown in FIG. 12 is actually realized by installing a dedicated program on hardware such as a computer and its peripheral devices as shown in FIG. That is, the computer executes the contents of each means according to a dedicated program. In this specification, the computer means an apparatus having an arithmetic processing unit such as a CPU and capable of data processing, and is not only a general-purpose computer such as a personal computer but also a data processing terminal such as a tablet or a so-called smartphone. Including.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、補正評価装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、画像取込手段12、部分画像抽出手段22、輝度値分類手段23、レンジ幅算出手段32、レンジ変化量算出手段42としての機能を実現することになる。また、記憶装置3は、画像記憶手段52として機能するだけでなく、補正評価装置としての処理に必要な様々なデータを記憶する。例えば、部分画像としてどの領域を特定するかについての情報も記憶されている。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as a correction evaluation device. By executing this dedicated program, the CPU 1 realizes functions as the image capturing unit 12, the partial image extracting unit 22, the luminance value classifying unit 23, the range width calculating unit 32, and the range change amount calculating unit 42. become. The storage device 3 not only functions as the image storage unit 52 but also stores various data necessary for processing as the correction evaluation device. For example, information about which area is specified as the partial image is also stored.

<3.2.処理動作>
次に、図13に示したフローチャートを用いて、本発明第3の実施形態に係る階調補正の評価方法を、図1、図12に示した補正評価装置の処理動作とともに説明する。まず、第1、第2の実施形態と同様、画像取込手段12が、画像記憶手段52に記憶された補正前画像、補正後画像を取り込む(ステップS31)。次に、取り込んだ補正前画像、補正後画像それぞれについて、部分画像抽出手段22が部分画像を抽出する(ステップS32)。具体的には、事前に設定された領域を部分画像とし、各部分画像に属する画素を抽出する。
<3.2. Processing action>
Next, a gradation correction evaluation method according to the third embodiment of the present invention will be described together with the processing operation of the correction evaluation apparatus shown in FIGS. 1 and 12 using the flowchart shown in FIG. First, as in the first and second embodiments, the image capturing unit 12 captures the pre-correction image and the post-correction image stored in the image storage unit 52 (step S31). Next, the partial image extraction unit 22 extracts a partial image for each of the captured pre-correction image and post-correction image (step S32). Specifically, a region set in advance is set as a partial image, and pixels belonging to each partial image are extracted.

図11は、部分画像の区分の例を示す図である。第2の実施形態と同様、図11の例では、補正対象とする画像が8×6の48個の部分画像に区分された例を示している。図11の例では、部分画像が、格子状に分割した領域で特定されている。何個の部分画像に区分するかについては、事前に設定しておくことができるが、補正前画像と補正後画像が同一個数、同一位置となるように設定する必要がある。   FIG. 11 is a diagram illustrating an example of segmentation of partial images. Similar to the second embodiment, the example of FIG. 11 shows an example in which the image to be corrected is divided into 48 partial images of 8 × 6. In the example of FIG. 11, the partial image is specified by a region divided in a grid pattern. The number of partial images can be set in advance, but it is necessary to set the number of pre-correction images and the post-correction images so that they are the same number and the same position.

次に、輝度値分類手段23が、補正前画像から抽出された部分画像の輝度値に応じて各部分画像を複数の輝度値レベルに分類する(ステップS33)。具体的には、補正前画像の部分画像を複数の輝度値レベルのいずれかに分類し、補正後画像については、補正前画像の部分画像と同一位置の部分画像が、同一輝度値レベルに属するように分類する。ここで、部分画像の輝度値は、部分画像に属する全画素を代表する輝度値とすることができる。例えば、部分画像に属する全画素の輝度値の平均値、中央値等を用いることができる。これにより、各輝度値レベルに分類された画素が、選択画素群として存在することになる。   Next, the luminance value classifying unit 23 classifies each partial image into a plurality of luminance value levels according to the luminance value of the partial image extracted from the pre-correction image (step S33). Specifically, the partial image of the pre-correction image is classified into one of a plurality of luminance value levels, and for the post-correction image, the partial image at the same position as the partial image of the pre-correction image belongs to the same luminance value level. Classify as follows. Here, the luminance value of the partial image can be a luminance value representative of all the pixels belonging to the partial image. For example, the average value, median value, etc. of the luminance values of all the pixels belonging to the partial image can be used. Thereby, the pixels classified into each luminance value level exist as a selected pixel group.

複数の輝度値レベルとして、いくつのレベルに分類するかについては、適宜設定することが可能であるが、本実施形態では、暗部、中間部、明部の3つのレベルに分類している。また、どの輝度値の範囲を暗部、中間部、明部に分類するかについても適宜設定することが可能であるが、本実施形態では、0〜63の値をとる6ビット64階調の画素において、境界値を16および48と設定し、0以上15以下(16未満)を暗部、16以上47以下(48未満)を中間部、48以上63以下を明部に設定している。   The number of levels to be classified as a plurality of luminance value levels can be set as appropriate, but in this embodiment, the levels are classified into three levels, a dark part, an intermediate part, and a bright part. In addition, although it is possible to appropriately set which luminance value range is classified into a dark part, an intermediate part, and a bright part, in this embodiment, a 6-bit 64-gradation pixel having a value of 0 to 63 The boundary values are set to 16 and 48, 0 to 15 or less (less than 16) is set to the dark part, 16 to 47 or less (less than 48) is set to the intermediate part, and 48 to 63 or less is set to the bright part.

補正前画像については、各部分画像は、その輝度値に応じて、いずれかの輝度値レベルに分類される。補正後画像については、補正後画像の各部分画像の輝度値に応じて分類されるのではなく、補正後画像の各部分画像と同一位置(同一座標)の補正前画像の部分画像が分類された輝度値レベルと同一の輝度値レベルに分類される。補正後画像は、補正前画像に対してコントラスト補正を行うことにより得られた画像であるため、横と縦(xとy)の画素数は当然ながら同一であり、画素の位置も一対一で対応している。また、部分画像の大きさ(画素サイズ)、位置も同一である。そのため、同一位置(同一座標)の部分画像は容易に特定できる。   For the pre-correction image, each partial image is classified into one of the luminance value levels according to the luminance value. The corrected image is not classified according to the luminance value of each partial image of the corrected image, but the partial image of the pre-correction image at the same position (same coordinate) as each partial image of the corrected image is classified. It is classified into the same luminance value level as the luminance value level. Since the post-correction image is an image obtained by performing contrast correction on the pre-correction image, the number of horizontal and vertical (x and y) pixels is naturally the same, and the pixel positions are also one-to-one. It corresponds. The size (pixel size) and position of the partial image are also the same. Therefore, partial images at the same position (same coordinates) can be easily specified.

ここで、補正前画像と補正後画像内の画素の輝度値レベル分類の概念を図14に示す。図14において、左右の大きな矩形は、それぞれ補正前画像、補正後画像の画像領域全体を示している。図14において、補正前画像内の小さな3つの矩形は、それぞれ図11に示した8×6の48個に区分した部分画像の中から、説明のために選択した部分画像を示している。また、補正後画像内の小さな3つの矩形は、補正前画像内の3つの部分画像と同一位置(同一座標)の部分画像を示している。部分画像のうち、黒で塗り潰されているものは、64階調のうち0以上15以下の輝度値の部分画像を示し、斜線で網掛けされているものは、64階調のうち16以上47以下の輝度値の部分画像を示し、白で塗り潰されているものは、64階調のうち48以上63以下の輝度値の部分画像を示している。   Here, the concept of the luminance value level classification of the pixels in the pre-correction image and the post-correction image is shown in FIG. In FIG. 14, the left and right large rectangles indicate the entire image area of the uncorrected image and the corrected image, respectively. In FIG. 14, three small rectangles in the pre-correction image indicate partial images selected for explanation from among the 8 × 6 48 partial images shown in FIG. 11. The three small rectangles in the corrected image indicate partial images at the same position (same coordinates) as the three partial images in the pre-correction image. Among the partial images, those filled in black indicate partial images having a luminance value of 0 or more and 15 or less in 64 gradations, and those shaded with diagonal lines are 16 or more 47 in 64 gradations. The partial images with the following luminance values are shown, and those filled with white indicate partial images with a luminance value of 48 to 63 out of 64 gradations.

補正前画像の部分画像は、図14に示すように、輝度値に応じて暗部、中間部、明部に分類される。しかし、補正後画像の部分画像は、同一位置の補正前画像の部分画像と同じ輝度値レベルに分類されるため、図14の例では、白で塗り潰された48以上63以下の輝度値の部分画像であっても、暗部に分類され、黒で塗り潰された0以上15以下の輝度値の部分画像であっても、中間部、明部に分類される場合がある。ある輝度値レベルに分類された部分画像に含まれる画素は、その輝度値に関わらず、全てその部分画像の輝度値レベルに分類される。例えば、ある画素が0以上15以下の輝度値であったとしても、その画素が含まれる部分画像の輝度値レベルが明部であった場合は、明部に分類される。このようにして、部分画像の分類と同時に、各画素の輝度値レベルへの分類も行われることになる。   As shown in FIG. 14, the partial image of the pre-correction image is classified into a dark part, an intermediate part, and a bright part according to the luminance value. However, since the partial image of the corrected image is classified into the same luminance value level as the partial image of the pre-correction image at the same position, in the example of FIG. Even an image may be classified into a middle part and a bright part even if it is a partial image with a brightness value of 0 to 15 that is classified as a dark part and is painted black. All pixels included in the partial image classified into a certain luminance value level are classified into the luminance value level of the partial image regardless of the luminance value. For example, even if a certain pixel has a luminance value of 0 or more and 15 or less, if the luminance value level of a partial image including the pixel is a bright portion, it is classified as a bright portion. In this way, the classification into the luminance value level of each pixel is performed simultaneously with the classification of the partial images.

次に、レンジ幅算出手段32が、補正前画像、補正後画像それぞれについて、分類された各輝度値レベルのレンジ幅を算出する(ステップS34)。具体的には、第1の実施形態のステップS13で各輝度値レベルに対して実行したのと同様にして、レンジ幅の算出を行う。したがって、第3の実施形態においても、第1の実施形態と同様、標準偏差、最大値と最小値の差、中央値に近い所定割合の画素数の範囲の3つの定義のいずれかによりレンジ幅を算出する。   Next, the range width calculation means 32 calculates the range width of each classified luminance value level for each of the pre-correction image and the post-correction image (step S34). Specifically, the range width is calculated in the same manner as performed for each luminance value level in step S13 of the first embodiment. Accordingly, in the third embodiment as well, as in the first embodiment, the range width depends on one of three definitions: standard deviation, difference between maximum and minimum values, and a range of a predetermined number of pixels close to the median. Is calculated.

ステップS34において、補正前画像の各部分画像、補正後画像の各部分画像のレンジ幅が算出されたら、次に、各輝度値レベルのレンジ変化量を算出する(ステップS35)。具体的には、各輝度値レベルについて、補正前画像のレンジ幅、補正後画像のレンジ幅を用いて、第1の実施形態でも用いた上記〔数式1〕に従った処理を実行することにより、各輝度値レベルのレンジ変化量RVを算出する。   If the range width of each partial image of the pre-correction image and each partial image of the post-correction image is calculated in step S34, the range change amount of each luminance value level is then calculated (step S35). Specifically, for each luminance value level, by using the range width of the pre-correction image and the range width of the post-correction image, the process according to [Formula 1] used in the first embodiment is executed. Then, the range change amount RV of each luminance value level is calculated.

第3の実施形態においては、レンジ変化量RVは、輝度値レベルごとに算出されるものであるため、上記〔数式1〕に示すように、各輝度値レベルについて、補正後画像のレンジ幅を、補正前画像のレンジ幅で除することにより算出される。すなわち、レンジ変化量RVは、補正後画像のレンジ幅と補正前画像のレンジ幅の比で表現される。このレンジ変化量RVは、コントラスト補正等の階調補正の効果を評価する評価指標として用いられる。   In the third embodiment, the range change amount RV is calculated for each luminance value level. Therefore, as shown in the above [Equation 1], the range width of the corrected image is set for each luminance value level. , By dividing by the range width of the uncorrected image. That is, the range change amount RV is expressed by a ratio between the range width of the corrected image and the range width of the uncorrected image. This range change amount RV is used as an evaluation index for evaluating the effect of gradation correction such as contrast correction.

第1、第2の実施形態と同様、レンジ変化量RVが1より大きい場合は、コントラストが改善されていることを示し、レンジ変化量RVの値が大きいほど改善度が高い。レンジ変化量RV=1の場合は、補正後においてもコントラストが維持されていることを示す。レンジ変化量RVが1より小さい場合は、補正後にコントラストが劣化していることを示す。この場合、その輝度値レベルで階調潰れが発生する可能性がある。レンジ変化量RV=0の場合は、補正後の画素値(輝度値)が一定となっていること(飽和)を示す。これは、補正により、いわゆる黒潰れや白飛びが発生したことを意味する。なお、コントラスト補正を行わず、補正前画像と補正後画像が同じである場合、レンジ変化量RV=1となる。   Similar to the first and second embodiments, when the range change amount RV is larger than 1, it indicates that the contrast is improved, and the degree of improvement is higher as the value of the range change amount RV is larger. A range change amount RV = 1 indicates that the contrast is maintained even after correction. When the range change amount RV is smaller than 1, it indicates that the contrast has deteriorated after correction. In this case, gradation collapse may occur at that luminance value level. The range change amount RV = 0 indicates that the corrected pixel value (luminance value) is constant (saturated). This means that so-called black crushing or whiteout occurs due to the correction. If contrast correction is not performed and the pre-correction image and the post-correction image are the same, the range change amount RV = 1.

次に、補正処理の評価を行う(ステップS36)。具体的には、ステップS35において算出されたレンジ変化量RVを確認し、レンジ変化量RVの値が大きければ、その補正手法について高評価を与え、レンジ変化量RVの値が小さければ、その補正手法について低評価を与える。評価の具体的な提示手法としては、第1、第2の実施形態と同様に行うことができる。   Next, the correction process is evaluated (step S36). Specifically, the range change amount RV calculated in step S35 is confirmed. If the value of the range change amount RV is large, the correction method is highly evaluated. If the value of the range change amount RV is small, the correction is made. Give a low rating for the method. A specific presentation method for evaluation can be performed in the same manner as in the first and second embodiments.

第3の実施形態においては、第1の実施形態と同様、画像全体に対して輝度値レベルごとのレンジ変化量RVが得られることになる。第1の実施形態との違いは、輝度値レベルを決定する補正前画像の画素が1画素であるか、部分画像を構成する複数画素であるか、である。1画素を基準とした場合、輝度値レベルごとに得られるヒストグラムに段差が生じる傾向がある。これに対して、部分画像を構成する複数画素を基準とした場合、輝度値レベルごとに得られるヒストグラムが滑らかな形状となる。   In the third embodiment, as in the first embodiment, a range change amount RV for each luminance value level is obtained for the entire image. The difference from the first embodiment is whether the pixel of the pre-correction image for determining the luminance value level is one pixel or a plurality of pixels constituting the partial image. When one pixel is used as a reference, there is a tendency that a step is generated in the histogram obtained for each luminance value level. On the other hand, when a plurality of pixels constituting the partial image are used as a reference, the histogram obtained for each luminance value level has a smooth shape.

<4.第4の実施形態>
<4.1.装置構成>
次に、第4の実施形態について説明する。第4の実施形態に係る補正評価装置のハードウェア構成は、第1〜第3の実施形態と同様、図1に示したようなものとなっており、第4の実施形態に係る補正評価装置103は、汎用のコンピュータに専用のプログラムを組み込むことにより実現することができる。
<4. Fourth Embodiment>
<4.1. Device configuration>
Next, a fourth embodiment will be described. The hardware configuration of the correction evaluation apparatus according to the fourth embodiment is as shown in FIG. 1 as in the first to third embodiments, and the correction evaluation apparatus according to the fourth embodiment. 103 can be realized by incorporating a dedicated program into a general-purpose computer.

図15は、本実施形態に係る補正評価装置の構成を示す機能ブロック図である。図15において、13は画像取込手段、24は部分画像設定手段、25は部分画像抽出手段、33はレンジ幅算出手段、43はレンジ変化量算出手段、53は画像記憶手段である。   FIG. 15 is a functional block diagram showing a configuration of the correction evaluation apparatus according to the present embodiment. In FIG. 15, 13 is an image capture means, 24 is a partial image setting means, 25 is a partial image extraction means, 33 is a range width calculation means, 43 is a range change amount calculation means, and 53 is an image storage means.

画像取込手段13は、画像記憶手段53に記憶された画像の中から指定された補正前画像および補正後画像を取り込む。部分画像設定手段24は、取り込んだ画像から抽出すべき部分画像を設定する。部分画像抽出手段25は、部分画像設定手段24により設定された部分画像を抽出する。レンジ幅算出手段33は、補正前画像および補正後画像の部分画像ごとに、その部分画像に属する画素のレンジ幅を算出する。レンジ変化量算出手段43は、各部分画像について、補正前画像と補正後画像のレンジ幅の変化量を算出する。画像記憶手段53は、コントラスト補正の対象となった補正前の画像である補正前画像と、補正前画像に対してコントラスト補正を行った後の画像である補正後画像を記憶している。上述のように、コントラスト補正は、階調補正という広い概念の一つである。本実施形態では、コントラスト補正を行うため、画素の輝度値を用いた場合を例にとって説明するが、本発明は、輝度値以外の様々な画素値を変化させることにより色調補正、ガンマ補正等の様々な階調補正を行う場合についても適用可能である。   The image capturing unit 13 captures the pre-correction image and the post-correction image specified from the images stored in the image storage unit 53. The partial image setting unit 24 sets a partial image to be extracted from the captured image. The partial image extraction unit 25 extracts the partial image set by the partial image setting unit 24. The range width calculation unit 33 calculates the range width of the pixels belonging to the partial image for each partial image of the pre-correction image and the post-correction image. The range change amount calculation unit 43 calculates the change amount of the range width between the pre-correction image and the post-correction image for each partial image. The image storage unit 53 stores a pre-correction image that is a pre-correction image that is a target for contrast correction, and a post-correction image that is an image after performing contrast correction on the pre-correction image. As described above, contrast correction is one of the broad concepts of gradation correction. In the present embodiment, a case where the luminance value of a pixel is used for contrast correction will be described as an example. However, the present invention changes various pixel values other than the luminance value to perform color tone correction, gamma correction, and the like. The present invention can also be applied to various gradation corrections.

画像取込手段13、部分画像設定手段24、部分画像抽出手段25、レンジ幅算出手段33、レンジ変化量算出手段43は、第1〜第3の実施形態と同様、CPU1が、記憶装置3に記憶されているプログラムを実行することにより実現される。画像記憶手段53は、第1〜第3の実施形態と同様、コントラスト補正の対象となった補正前の画像データである補正前画像と、補正前画像に対してコントラスト補正を行った後の画像データである補正後画像を記憶した記憶手段であり、記憶装置3により実現される。画像データとしては、単色のグレースケール画像を用いることもできるし、複数色のカラー画像を用いることもできる。また、画像データの階調としては、各画素の各色が6ビット64階調で表現されたものや、8ビット256階調で表現されたもの等、様々な階調のものを使用することができる。   The image capturing unit 13, the partial image setting unit 24, the partial image extracting unit 25, the range width calculating unit 33, and the range change amount calculating unit 43 are stored in the storage device 3 by the CPU 1 as in the first to third embodiments. This is realized by executing a stored program. As in the first to third embodiments, the image storage unit 53 includes an image before correction that is image data before correction that is a target of contrast correction, and an image after contrast correction is performed on the image before correction. A storage unit that stores a corrected image that is data, and is realized by the storage device 3. As the image data, a single-color gray scale image can be used, or a color image of a plurality of colors can be used. Further, as gradations of image data, it is possible to use various gradations such as those in which each color of each pixel is expressed by 6-bit 64 gradations and those expressed by 8-bit 256 gradations. it can.

図15に示した各構成手段は、現実には図1に示したように、コンピュータおよびその周辺機器等のハードウェアに専用のプログラムを搭載することにより実現される。すなわち、コンピュータが、専用のプログラムに従って各手段の内容を実行することになる。なお、本明細書において、コンピュータとは、CPU等の演算処理部を有し、データ処理が可能な装置を意味し、パーソナルコンピュータなどの汎用コンピュータだけでなく、タブレットやいわゆるスマートフォン等のデータ処理端末も含む。   Each component shown in FIG. 15 is actually realized by mounting a dedicated program on hardware such as a computer and its peripheral devices as shown in FIG. That is, the computer executes the contents of each means according to a dedicated program. In this specification, the computer means an apparatus having an arithmetic processing unit such as a CPU and capable of data processing, and is not only a general-purpose computer such as a personal computer but also a data processing terminal such as a tablet or a so-called smartphone. Including.

図1に示した記憶装置3には、CPU1を動作させ、コンピュータを、補正評価装置として機能させるための専用のプログラムが実装されている。この専用のプログラムを実行することにより、CPU1は、画像取込手段13、部分画像設定手段24、部分画像抽出手段25、レンジ幅算出手段33、レンジ変化量算出手段43としての機能を実現することになる。また、記憶装置3は、画像記憶手段53として機能するだけでなく、補正評価装置としての処理に必要な様々なデータを記憶する。   The storage device 3 shown in FIG. 1 is mounted with a dedicated program for operating the CPU 1 and causing the computer to function as a correction evaluation device. By executing this dedicated program, the CPU 1 realizes functions as the image capturing unit 13, the partial image setting unit 24, the partial image extraction unit 25, the range width calculation unit 33, and the range change amount calculation unit 43. become. The storage device 3 not only functions as the image storage unit 53 but also stores various data necessary for processing as the correction evaluation device.

<4.2.処理動作>
次に、図16に示したフローチャートを用いて、本発明第4の実施形態に係る階調補正の評価方法を、図1、図15に示した補正評価装置の処理動作とともに説明する。まず、第1〜第3の実施形態と同様、画像取込手段13が、画像記憶手段53に記憶された補正前画像、補正後画像を取り込む(ステップS41)。次に、取り込んだ補正前画像について、部分画像設定手段24が部分画像を設定する(ステップS42)。具体的には、まず、表示部6に表示された補正前画像を見ながら、利用者が指示入力部4を用いて、部分画像を設定する矩形領域を指定する。マウス等の指示入力部4を用いた矩形領域の指定は、公知の手法により行うことができる。補正前画像と補正後画像で同じ位置が部分画像として指定される必要があるため、一方の画像で矩形領域を指定すると他方の画像において同一位置に矩形領域が指定される。そして、部分画像設定手段24は、指定された矩形領域を部分画像として設定する。部分画像の設定は、他の異なる手法により行うことも可能である。他の異なる手法による部分画像の設定については、後述する。
<4.2. Processing action>
Next, the gradation correction evaluation method according to the fourth embodiment of the present invention will be described together with the processing operation of the correction evaluation apparatus shown in FIGS. 1 and 15 using the flowchart shown in FIG. First, as in the first to third embodiments, the image capturing unit 13 captures the pre-correction image and the post-correction image stored in the image storage unit 53 (step S41). Next, the partial image setting unit 24 sets a partial image for the captured pre-correction image (step S42). Specifically, first, the user designates a rectangular area for setting a partial image using the instruction input unit 4 while viewing the pre-correction image displayed on the display unit 6. Designation of a rectangular area using the instruction input unit 4 such as a mouse can be performed by a known method. Since it is necessary to designate the same position as a partial image in the pre-correction image and the post-correction image, when a rectangular area is designated in one image, the rectangular area is designated at the same position in the other image. Then, the partial image setting unit 24 sets the designated rectangular area as a partial image. The setting of the partial image can be performed by other different methods. The setting of partial images by other different methods will be described later.

図17は、設定された部分画像の例を示す図である。図17の例では、補正前画像において、部分画像が3箇所設定された例を示している。この場合、利用者が3箇所の領域を指定したことになる。図17の例では、3個の部分画像が、同一サイズ(縦、横の画素数)である例を示しているが、実際には、利用者が指定した領域のサイズになるため、必ずしも同一になるものではない。部分画像設定手段24は、補正後画像に対しても、補正後画像と同一座標に、部分画像を設定する。次に、取り込んだ補正前画像、補正後画像それぞれについて、部分画像抽出手段25が設定された部分画像を抽出する(ステップS43)。具体的には、事前に設定された領域を部分画像とし、各部分画像に属する画素群を選択画素群として抽出する。   FIG. 17 is a diagram illustrating an example of a set partial image. The example of FIG. 17 shows an example in which three partial images are set in the pre-correction image. In this case, the user has designated three areas. The example of FIG. 17 shows an example in which the three partial images have the same size (vertical and horizontal pixel numbers). However, since the size is actually the size of the area specified by the user, they are not necessarily the same. It will not be. The partial image setting unit 24 also sets a partial image at the same coordinates as the corrected image for the corrected image. Next, the partial image set by the partial image extraction means 25 is extracted from each of the captured pre-correction image and post-correction image (step S43). Specifically, an area set in advance is set as a partial image, and a pixel group belonging to each partial image is extracted as a selected pixel group.

次に、レンジ幅算出手段33が、補正前画像、補正後画像それぞれについて、各部分画像のレンジ幅を算出する(ステップS44)。具体的には、第2の実施形態のステップS23で実行したのと同様にして、各部分画像に対してレンジ幅の算出を行う。したがって、第4の実施形態においても、第1〜第3の実施形態と同様、標準偏差、最大値と最小値の差、中央値に近い所定割合の画素数の範囲の3つの定義のいずれかによりレンジ幅を算出する。   Next, the range width calculation means 33 calculates the range width of each partial image for each of the pre-correction image and the post-correction image (step S44). Specifically, the range width is calculated for each partial image in the same manner as executed in step S23 of the second embodiment. Therefore, in the fourth embodiment, as in the first to third embodiments, any one of the three definitions of the standard deviation, the difference between the maximum value and the minimum value, and the range of the predetermined number of pixels close to the median value is used. To calculate the range width.

ステップS44において、補正前画像の各部分画像、補正後画像の各部分画像のレンジ幅が算出されたら、次に、各部分画像のレンジ変化量を算出する(ステップS45)。具体的には、各部分画像について、補正前画像のレンジ幅、補正後画像のレンジ幅を用いて、第1〜第3の実施形態でも用いた上記〔数式1〕に従った処理を実行することにより、各輝度値レベルのレンジ変化量RVを算出する。   If the range width of each partial image of the pre-correction image and each partial image of the post-correction image is calculated in step S44, next, the range change amount of each partial image is calculated (step S45). Specifically, for each partial image, using the range width of the pre-correction image and the range width of the post-correction image, the process according to [Formula 1] used in the first to third embodiments is executed. Thus, the range change amount RV of each luminance value level is calculated.

第4の実施形態においては、レンジ変化量RVは、部分画像ごとに算出されるものであるため、上記〔数式1〕に示すように、各部分画像について、補正後画像のレンジ幅を、補正前画像のレンジ幅で除することにより算出される。このレンジ変化量RVは、コントラスト補正等の階調補正の効果を評価する評価指標として用いられる。   In the fourth embodiment, the range change amount RV is calculated for each partial image. Therefore, as shown in [Formula 1], the range width of the corrected image is corrected for each partial image. It is calculated by dividing by the range width of the previous image. This range change amount RV is used as an evaluation index for evaluating the effect of gradation correction such as contrast correction.

第1〜第3の実施形態と同様、レンジ変化量RVが1より大きい場合は、コントラストが改善されていることを示し、レンジ変化量RVの値が大きいほど改善度が高い。レンジ変化量RV=1の場合は、補正後においてもコントラストが維持されていることを示す。レンジ変化量RVが1より小さい場合は、補正後にコントラストが劣化していることを示す。この場合、その輝度値レベルで階調潰れが発生する可能性がある。レンジ変化量RV=0の場合は、補正後の画素値(輝度値)が一定となっていること(飽和)を示す。これは、補正により、いわゆる黒潰れや白飛びが発生したことを意味する。なお、コントラスト補正を行わず、補正前画像と補正後画像が同じである場合、レンジ変化量RV=1となる。   As in the first to third embodiments, when the range change amount RV is larger than 1, it indicates that the contrast is improved, and the degree of improvement is higher as the value of the range change amount RV is larger. A range change amount RV = 1 indicates that the contrast is maintained even after correction. When the range change amount RV is smaller than 1, it indicates that the contrast has deteriorated after correction. In this case, gradation collapse may occur at that luminance value level. The range change amount RV = 0 indicates that the corrected pixel value (luminance value) is constant (saturated). This means that so-called black crushing or whiteout occurs due to the correction. If contrast correction is not performed and the pre-correction image and the post-correction image are the same, the range change amount RV = 1.

次に、補正処理の評価を行う(ステップS46)。具体的には、ステップS45において算出されたレンジ変化量RVを確認し、レンジ変化量RVの値が大きければ、その補正手法について高評価を与え、レンジ変化量RVの値が小さければ、その補正手法について低評価を与える。部分画像ごとの評価が高い程、画像全体に対する補正の評価も高くなる。   Next, the correction process is evaluated (step S46). Specifically, the range change amount RV calculated in step S45 is confirmed. If the value of the range change amount RV is large, the correction method is highly evaluated, and if the value of the range change amount RV is small, the correction is made. Give a low rating for the method. The higher the evaluation for each partial image, the higher the evaluation of correction for the entire image.

図18は、本実施形態に係る補正評価装置による評価結果の一例を示す図である。図18に示すように、補正前画像(図中、「元画像」と表記)、2つの補正手法(補正A、補正B)により補正された2つの補正後画像(図中、「補正A」「補正B」と表記)の計3つの画像が並べて配置されている。そして、各画像には、上述の説明のようにして、指定された4つの矩形領域が表示されている。各矩形領域には、明部、中間部(明)、中間部(暗)、暗部のいずれであるかが対応付けられているが、これは、矩形領域を指定した者の主観により設定されたものである。また、図18に示すように、3つの画像の下部には、各矩形領域に対して、ステップS45の処理により算出されたレンジ変化量が「補正A」「補正B」に対応付けて配置される。図18に示したような評価結果は、表示部6により表示出力してもよいし、データ入出力I/F5を介してプリンタに印刷出力してもよい。   FIG. 18 is a diagram illustrating an example of an evaluation result by the correction evaluation apparatus according to the present embodiment. As shown in FIG. 18, an image before correction (denoted as “original image” in the figure) and two corrected images corrected by two correction methods (correction A and correction B) (“correction A” in the figure). A total of three images (denoted as “correction B”) are arranged side by side. In each image, four designated rectangular areas are displayed as described above. Each rectangular area is associated with a bright part, an intermediate part (bright), an intermediate part (dark), or a dark part, which is set by the subjectivity of the person who specified the rectangular area. Is. As shown in FIG. 18, the range change amount calculated by the process of step S <b> 45 is associated with “correction A” and “correction B” for each rectangular area at the bottom of the three images. The The evaluation result as shown in FIG. 18 may be displayed on the display unit 6 or may be printed out on a printer via the data input / output I / F 5.

<4.3.部分画像の設定>
上述のように、ステップS42における部分画像の設定は、異なる手法により行うことができる。以下、部分画像の設定について異なる3つの手法について説明する。
<4.3. Partial image settings>
As described above, the setting of the partial image in step S42 can be performed by different methods. Hereinafter, three different methods for setting partial images will be described.

<4.3.1.指定領域周辺の探索による設定>
まず、指定領域周辺の探索による設定について説明する。この場合も、上述の例と同様に、表示部6に表示された補正前画像を見ながら、利用者が指示入力部4を用いて、矩形領域を指定する。ただし、上述の例では、指定された矩形領域がそのまま部分画像として設定されたが、ここでは、指定された矩形領域を利用して、部分画像とする矩形領域を探索する。
<4.3.1. Setting by searching around specified area>
First, setting by searching around the designated area will be described. Also in this case, the user designates a rectangular area using the instruction input unit 4 while viewing the pre-correction image displayed on the display unit 6 as in the above example. However, in the above example, the designated rectangular area is set as a partial image as it is, but here, the designated rectangular area is used to search for a rectangular area as a partial image.

具体的には、利用者は、矩形領域を指定領域として指定するとともに、輝度値の条件を指定する。輝度値の条件としては、輝度値の範囲を特定する上限と下限を指定する。輝度値の範囲は、広すぎても良くないため、目的に応じて適切な範囲となるように指定される。   Specifically, the user designates a rectangular area as a designated area and designates a condition for luminance value. As the condition of the luminance value, an upper limit and a lower limit that specify the range of the luminance value are designated. Since the range of the luminance value may not be too wide, it is specified to be an appropriate range according to the purpose.

指定領域と輝度値の範囲が指定されたら、部分画像設定手段24が部分画像とする矩形領域である探索対象領域を探索する。具体的には、指定領域の周辺となる所定の範囲において、指定された条件となる輝度値をもつ探索対象領域を探索する。図19(a)に指定領域と探索対象領域の関係を示す。図19(a)においては、指定領域と同サイズ(同画素数)の探索対象領域を破線状の矩形で示している。探索対象領域のサイズを指定領域と異なるサイズに設定しておくことも可能である。画素の座標値を二次元座標系の(x,y)で表し、図面左右方向がx軸、図面上下方向をy軸とする。   When the designated area and the luminance value range are designated, the partial image setting unit 24 searches for a search target area which is a rectangular area as a partial image. Specifically, a search target area having a luminance value as a specified condition is searched in a predetermined range around the specified area. FIG. 19A shows the relationship between the designated area and the search target area. In FIG. 19A, the search target area having the same size (the same number of pixels) as the designated area is indicated by a broken-line rectangle. It is also possible to set the size of the search target area to a size different from the designated area. The coordinate value of the pixel is represented by (x, y) in a two-dimensional coordinate system, where the horizontal direction in the drawing is the x axis and the vertical direction in the drawing is the y axis.

そして、指定領域と1画素以上重複する矩形領域を全て探索対象領域として、各探索対象領域について、輝度ヒストグラムを算出する。探索順序は、自由に設定することができるが、図19(a)の例では、矢印で示したように、yを固定した状態でxの値を1ずつ増加させ、xが最大に達したら、yを1増加させてxを最小に戻すという処理を行って探索対象領域を移動していき、順次輝度ヒストグラムの算出を行う。   Then, a luminance histogram is calculated for each search target area, with all rectangular areas overlapping one or more pixels as the specified area as search target areas. The search order can be freely set, but in the example of FIG. 19A, as indicated by the arrow, the value of x is incremented by 1 with y fixed, and when x reaches the maximum. , Y is incremented by 1 and x is returned to the minimum, the region to be searched is moved, and luminance histograms are sequentially calculated.

そして、部分画像設定手段24は、算出された輝度ヒストグラムが、指定された条件となる探索対象領域を部分画像として設定する。探索対象領域が指定された条件となるか否かについては、様々な基準を設定しておくことができる。例えば、上記指定条件である輝度値の範囲に、所定%以上の画素値が含まれることを基準として設定しておくことができる。この場合、探索対象領域に含まれる画素数の所定%以上の輝度値が指定条件の輝度値の範囲に当てはまる場合に、その探索対象領域が部分画像として設定される。   Then, the partial image setting unit 24 sets, as a partial image, a search target region for which the calculated luminance histogram satisfies a specified condition. Various criteria can be set as to whether or not the search target area is a specified condition. For example, it can be set on the basis that a predetermined value or more of pixel values are included in the range of the luminance value as the specified condition. In this case, the search target area is set as a partial image when a luminance value of a predetermined percentage or more of the number of pixels included in the search target area falls within the luminance value range of the specified condition.

指定された条件となる探索対象領域が複数存在した場合は、様々な手法により絞り込むことができる。絞り込みの手法としては、その探索対象領域を候補領域として画面に表示し、利用者に選択させるようにしてもよいし、最も条件合致度の高い探索対象領域を部分画像に設定するようにしてもよい。   When there are a plurality of search target areas that satisfy the designated conditions, the search can be narrowed down by various methods. As a narrowing-down method, the search target area may be displayed as a candidate area on the screen and selected by the user, or the search target area with the highest degree of condition matching may be set as a partial image. Good.

<4.3.2.指定ポイント周辺の探索による設定>
次に、指定ポイント周辺の探索による設定について説明する。この場合、表示部6に表示された補正前画像を見ながら、利用者が指示入力部4を用いて、1点を指定ポイントとして指定する。そして、指定された指定ポイントを利用して、部分画像とする矩形領域を探索する。
<4.3.2. Setting by searching around specified points>
Next, setting by searching around the designated point will be described. In this case, the user designates one point as a designated point using the instruction input unit 4 while viewing the pre-correction image displayed on the display unit 6. Then, a rectangular area as a partial image is searched using the designated point designated.

具体的には、利用者は、補正前画像上の1点を指定ポイントとして指定するとともに、輝度値の条件を指定する。輝度値の条件としては、上述の例と同様、輝度値の範囲を特定する上限と下限を指定する。輝度値の範囲は、広すぎても良くないため、目的に応じて適切な範囲となるように指定される。   Specifically, the user designates one point on the pre-correction image as a designated point and designates a condition for luminance value. As the condition of the luminance value, an upper limit and a lower limit that specify the range of the luminance value are designated as in the above example. Since the range of the luminance value may not be too wide, it is specified to be an appropriate range according to the purpose.

指定ポイントと輝度値の範囲が指定されたら、部分画像設定手段24が部分画像とする矩形領域を探索する。具体的には、指定ポイントの周辺となる所定の範囲において、指定された条件となる輝度値をもつ矩形領域を探索する。図19(b)に指定領域と探索対象領域の関係を示す。図19(b)においては、所定のサイズ(画素数)の探索対象領域を破線状の矩形で示している。探索対象領域のサイズは、任意のサイズに設定しておくことができる。画素の座標値を二次元座標系の(x,y)で表し、図面左右方向がx軸、図面上下方向をy軸とする。   When the designated point and the range of the luminance value are designated, the partial image setting unit 24 searches for a rectangular area as a partial image. Specifically, a rectangular area having a luminance value as a designated condition is searched in a predetermined range around the designated point. FIG. 19B shows the relationship between the designated area and the search target area. In FIG. 19B, a search target area having a predetermined size (number of pixels) is indicated by a broken-line rectangle. The size of the search target area can be set to an arbitrary size. The coordinate value of the pixel is represented by (x, y) in a two-dimensional coordinate system, where the horizontal direction in the drawing is the x axis and the vertical direction in the drawing is the y axis.

そして、指定ポイントと所定距離範囲内の矩形領域を全て探索対象領域として、各探索対象領域について、輝度ヒストグラムを算出する。所定距離範囲としては、例えば、矩形領域の1以上の画素が、指定ポイントと3画素以内の範囲などと設定することができる。探索順序は、自由に設定することができるが、図19(b)の例では、矢印で示したように、yを固定した状態でxの値を1ずつ増加させ、xが最大に達したら、yを1増加させてxを最小に戻すという処理を行って探索対象領域を移動していき、順次輝度ヒストグラムの算出を行う。   Then, a luminance histogram is calculated for each search target area, with all the rectangular areas within a predetermined distance range from the specified point as search target areas. As the predetermined distance range, for example, one or more pixels in the rectangular area can be set as a range within 3 pixels from the designated point. The search order can be set freely, but in the example of FIG. 19B, as indicated by the arrow, the value of x is incremented by 1 with y fixed, and when x reaches the maximum. , Y is incremented by 1 and x is returned to the minimum, the region to be searched is moved, and luminance histograms are sequentially calculated.

そして、部分画像設定手段24は、算出された輝度ヒストグラムが、指定された条件となる探索対象領域を部分画像として設定する。探索対象領域が指定された条件となるか否かについては、様々な基準を設定しておくことができる。例えば、上記指定条件である輝度値の範囲に、所定%以上の画素値が含まれることを基準として設定しておくことができる。この場合、探索対象領域に含まれる画素数の所定%以上の輝度値が指定条件の輝度値の範囲に当てはまる場合に、その探索対象領域が部分画像として設定される。   Then, the partial image setting unit 24 sets, as a partial image, a search target region for which the calculated luminance histogram satisfies a specified condition. Various criteria can be set as to whether or not the search target area is a specified condition. For example, it can be set on the basis that a predetermined value or more of pixel values are included in the range of the luminance value as the specified condition. In this case, the search target area is set as a partial image when a luminance value of a predetermined percentage or more of the number of pixels included in the search target area falls within the luminance value range of the specified condition.

指定された条件となる探索対象領域が複数存在した場合は、様々な手法により絞り込むことができる。絞り込みの手法としては、その探索対象領域を候補領域として画面に表示し、利用者に選択させるようにしてもよいし、最も条件合致度の高い探索対象領域を部分画像に設定するようにしてもよい。   When there are a plurality of search target areas that satisfy the designated conditions, the search can be narrowed down by various methods. As a narrowing-down method, the search target area may be displayed as a candidate area on the screen and selected by the user, or the search target area with the highest degree of condition matching may be set as a partial image. Good.

<4.3.3.画像全体の中から輝度値による設定>
次に、画像全体の中から輝度値による設定について説明する。この場合、利用者は、指示入力部4を用いて、輝度値の条件のみを指定する。輝度値の条件としては、上述の例と同様、輝度値の範囲を特定する上限と下限を指定する。輝度値の範囲は、広すぎても良くないため、目的に応じて適切な範囲となるように指定される。
<4.3.3. Setting by brightness value from the whole image>
Next, setting by luminance value from the entire image will be described. In this case, the user uses the instruction input unit 4 to specify only the luminance value condition. As the condition of the luminance value, an upper limit and a lower limit that specify the range of the luminance value are designated as in the above example. Since the range of the luminance value may not be too wide, it is specified to be an appropriate range according to the purpose.

輝度値の範囲が指定されたら、部分画像設定手段24が部分画像とする矩形領域を探索する。具体的には、補正前画像の全範囲において、指定された条件となる輝度値をもつ矩形領域を探索する。図20に補正前画像と探索対象領域の関係を示す。図20においては、所定のサイズ(画素数)の探索対象領域を破線状の矩形で示している。探索対象領域のサイズは、任意のサイズに設定しておくことができる。画素の座標値を二次元座標系の(x,y)で表し、図面左右方向がx軸、図面上下方向をy軸とする。   When the range of the luminance value is designated, the partial image setting unit 24 searches for a rectangular area as a partial image. Specifically, a rectangular area having a luminance value as a specified condition is searched in the entire range of the pre-correction image. FIG. 20 shows the relationship between the pre-correction image and the search target area. In FIG. 20, a search target region having a predetermined size (number of pixels) is indicated by a broken-line rectangle. The size of the search target area can be set to an arbitrary size. The coordinate value of the pixel is represented by (x, y) in a two-dimensional coordinate system, where the horizontal direction in the drawing is the x axis and the vertical direction in the drawing is the y axis.

そして、補正前画像の全範囲内の矩形領域を全て探索対象領域として、各探索対象領域について、輝度ヒストグラムを算出する。探索順序は、自由に設定することができるが、図20の例では、矢印で示したように、yを固定した状態でxの値を1ずつ増加させ、xが最大に達したら、yを1増加させてxを最小に戻すという処理を行って探索対象領域を移動していき、順次輝度ヒストグラムの算出を行う。   Then, a luminance histogram is calculated for each search target area, with all rectangular areas within the entire range of the pre-correction image as search target areas. The search order can be set freely, but in the example of FIG. 20, as indicated by the arrow, the value of x is incremented by 1 with y fixed, and when x reaches the maximum, y is increased. The search target region is moved by performing a process of increasing x by 1 and returning x to the minimum, and sequentially calculating the luminance histogram.

そして、部分画像設定手段24は、算出された輝度ヒストグラムが、指定された条件となる探索対象領域を部分画像として設定する。探索対象領域が指定された条件となるか否かについては、様々な基準を設定しておくことができる。例えば、上記指定条件である輝度値の範囲に、所定%以上の画素値が含まれることを基準として設定しておくことができる。この場合、探索対象領域に含まれる画素数の所定%以上の輝度値が指定条件の輝度値の範囲に当てはまる場合に、その探索対象領域が部分画像として設定される。   Then, the partial image setting unit 24 sets, as a partial image, a search target region for which the calculated luminance histogram satisfies a specified condition. Various criteria can be set as to whether or not the search target area is a specified condition. For example, it can be set on the basis that a predetermined value or more of pixel values are included in the range of the luminance value as the specified condition. In this case, the search target area is set as a partial image when a luminance value of a predetermined percentage or more of the number of pixels included in the search target area falls within the luminance value range of the specified condition.

指定された条件となる探索対象領域が複数存在した場合は、様々な手法により絞り込むことができる。絞り込みの手法としては、その探索対象領域を候補領域として画面に表示し、利用者に選択させるようにしてもよいし、最も条件合致度の高い探索対象領域を部分画像に設定するようにしてもよい。   When there are a plurality of search target areas that satisfy the designated conditions, the search can be narrowed down by various methods. As a narrowing-down method, the search target area may be displayed as a candidate area on the screen and selected by the user, or the search target area with the highest degree of condition matching may be set as a partial image. Good.

<5.輝度値レベルへの分類について>
上記第1、第3の実施形態においては、画素の輝度値レベルへの分類を行う際、事前に設定された境界値を利用して複数の輝度値レベルを設定している。第1、第3の実施形態において、補正前画像全体のヒストグラムから、境界値を決定するようにすることもできる。以下、補正前画像全体のヒストグラムからの境界値の決定について説明する。
<5. Classification into luminance value levels>
In the first and third embodiments, when classifying pixels into luminance value levels, a plurality of luminance value levels are set using boundary values set in advance. In the first and third embodiments, the boundary value can be determined from the histogram of the entire image before correction. Hereinafter, determination of the boundary value from the histogram of the entire image before correction will be described.

図21は、0〜255の値をとる8ビット256階調のある画像から得られたヒストグラムを示す図である。事前に境界値が64および192に設定されている場合、図21(a)に示すように、0以上63以下(64未満)が暗部、64以上191以下(192未満)が中間部、192以上255以下が明部に設定される。   FIG. 21 is a diagram showing a histogram obtained from an 8-bit 256-gradation image having a value of 0-255. When the boundary values are set in advance to 64 and 192, as shown in FIG. 21A, 0 to 63 (less than 64) is a dark part, 64 to 191 or less (less than 192) is an intermediate part, and 192 or more 255 or less is set as the bright portion.

しかし、図21に示したヒストグラムの場合、暗部への画素の偏りが多く、好ましい分類であるとは言えない。このような状況を考慮して、補正前画像全体のヒストグラムから、境界値を決定する。具体的には、輝度値の度数分布を表現したヒストグラムのうち、近辺より度数の少ない箇所である、谷となる部分の輝度値を境界値とする。谷となる部分の決定は、公知の手法により行うことができる。例えば、ヒストグラムを数式化して、二回微分を行うことにより、変局点を特定し、その変局点の輝度値を境界値として決定する。境界値の数は、適宜設定しておくことができる。境界値の数を4個と設定した場合、変局点のうち、前後の度数の変化が大きい順に4個に決定する。そして決定された境界値を基準に、5つの輝度値レベルに分類する。図21(b)に、谷となる部分を境界値として設定し、5つの輝度値レベルに分類されたヒストグラムを示す。   However, in the case of the histogram shown in FIG. 21, there are many biases of pixels toward the dark part, which cannot be said to be a preferable classification. Considering such a situation, the boundary value is determined from the histogram of the entire image before correction. Specifically, in the histogram expressing the frequency distribution of luminance values, the luminance value of a valley portion that is a portion having a lower frequency than the vicinity is used as the boundary value. The part to be a valley can be determined by a known method. For example, an inflection point is specified by formulating a histogram and performing differentiation twice, and the luminance value of the inflection point is determined as a boundary value. The number of boundary values can be set as appropriate. When the number of boundary values is set to four, the number of inflection points is determined to be four in descending order of frequency change before and after. Then, the luminance values are classified into five luminance value levels based on the determined boundary value. FIG. 21B shows a histogram classified into five luminance value levels by setting a valley portion as a boundary value.

谷となる部分を決定する場合、輝度値の全範囲から所定数を選ぶのではなく、0以上63以下で1つ、64以上128以下で1つ、・・・等、別途条件を付加するようにしてもよい。   When determining the valley portion, a predetermined condition is added instead of selecting a predetermined number from the entire range of luminance values, one from 0 to 63, one from 64 to 128, etc. It may be.

<6.変形例>
上記実施形態では、画素の輝度値を変化させることによるコントラスト補正、明部補正、暗部補正を行った場合について説明したが、上述のように、本発明は、輝度値以外の様々な画素値を変化させることにより色調補正、明るさ補正、ガンマ補正等の様々な階調補正を行うことが可能である。その一例として、画素の各色の階調値を用いて色調補正を行う変形例について説明する。カメラ等で撮影した画像においては、撮影時の設定によっては画像が赤っぽくなったり、青っぽくなったりすることがある。その場合は、色毎の階調補正(色調補正)を適用し、バランスの良い画像を得る(補正する)ことができる。また、空や海、夕日などの好みが分かれる色を自身の好きな色に変更する場合にも色調補正が適用される。
<6. Modification>
In the above embodiment, the case where the contrast correction, the bright part correction, and the dark part correction are performed by changing the luminance value of the pixel has been described. However, as described above, the present invention uses various pixel values other than the luminance value. By changing it, various tone corrections such as color tone correction, brightness correction, and gamma correction can be performed. As an example, a modification example in which color tone correction is performed using the gradation value of each color of a pixel will be described. In an image taken with a camera or the like, the image may become reddish or bluish depending on the setting at the time of shooting. In that case, it is possible to obtain (correct) a well-balanced image by applying gradation correction (tone correction) for each color. The color tone correction is also applied when changing colors such as sky, sea, sunset, etc., to a color of your choice.

図22〜図24は、異なるトーンカーブに基づく補正手法による補正前画像(図中「入力」と表記)と補正後画像(図中「出力」と表記)の画素の各色の階調値の対応を示す図である。図22〜図24それぞれにおける左下端から右上端に向かう細めの線分は、図7、図8と同様、補正がなされない場合の基準線を示しており、基準線からずれた直線および曲線は、補正手法を規定するトーンカーブを示している。また、横軸、縦軸において3つに区分された範囲は、それぞれ0側(左下端)から暗部、中間部、明部を示している。   22 to 24 show correspondences between gradation values of respective colors of pixels of an image before correction (indicated as “input” in the figure) and an image after correction (indicated as “output” in the figure) by a correction method based on different tone curves. FIG. The thin line segment from the lower left end to the upper right end in each of FIGS. 22 to 24 shows a reference line when correction is not performed, as in FIGS. 7 and 8, and straight lines and curves deviated from the reference line are The tone curve defining the correction method is shown. Further, the ranges divided into three on the horizontal axis and the vertical axis indicate the dark part, the intermediate part, and the bright part from the 0 side (lower left end), respectively.

図22は、画像が黄色っぽい場合に、青色を強調させるように色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。画像が黄色っぽい場合は、青色を強めるもしくは、赤色と緑色を弱めれば良い。図22の例では青色を強めている。各色の階調値でレンジ変化量RVを算出すると、
赤色 暗部RV=1、中間部RV=1、明部RV=1
緑色 暗部RV=1、中間部RV=1、明部RV=1
青色 暗部RV>1、中間部RV<1、明部RV<1
という結果が得られる。図22の例では、青色のみ色調補正されており、かつ青色の暗部の階調値の範囲を広げる補正がされていることが分かる。
FIG. 22 is a diagram illustrating the correspondence between the gradation values of the respective colors of the pre-correction image and the post-correction image when the color tone correction is performed to enhance blue when the image is yellowish. If the image is yellowish, it is sufficient to increase blue or weaken red and green. In the example of FIG. 22, blue is intensified. When the range change amount RV is calculated with the gradation value of each color,
Red Dark part RV = 1, Intermediate part RV = 1, Bright part RV = 1
Green Dark part RV = 1, Intermediate part RV = 1, Bright part RV = 1
Blue Dark part RV> 1, Intermediate part RV <1, Bright part RV <1
The result is obtained. In the example of FIG. 22, it can be seen that only the blue color is corrected, and correction is performed to widen the range of gradation values in the dark part of blue.

図23は、画像が青っぽい場合に、赤色と緑色を強調し、青色を減衰させるように色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。画像が青っぽい場合は、赤色、緑色を変更しないもしくは強め、青色を変更しないもしくは弱めれば良い。図23の例では赤色と緑色を強め、青色を弱めている。各色の階調値でレンジ変化量RVを算出すると、
赤色 暗部RV>1、中間部RV<1、明部RV<1
緑色 暗部RV>1、中間部RV<1、明部RV<1
青色 暗部RV<1、中間部RV<1、明部RV>1
という結果が得られる。図23の例では、赤色、緑色は暗部の階調値の範囲を広げる補正がされており、青色は明部の階調値の範囲を広げる補正がされていることが分かる。
FIG. 23 is a diagram illustrating the correspondence between the gradation values of the respective colors of the pre-correction image and the post-correction image when the tone correction is performed so that red and green are emphasized and blue is attenuated when the image is bluish. If the image is bluish, red or green should not be changed or strengthened, and blue should not be changed or weakened. In the example of FIG. 23, red and green are strengthened and blue is weakened. When the range change amount RV is calculated with the gradation value of each color,
Red Dark part RV> 1, Intermediate part RV <1, Bright part RV <1
Green Dark part RV> 1, Intermediate part RV <1, Bright part RV <1
Blue Dark part RV <1, Intermediate part RV <1, Bright part RV> 1
The result is obtained. In the example of FIG. 23, it can be seen that red and green are corrected to increase the range of gradation values in the dark area, and blue are corrected to expand the range of gradation values in the bright area.

図24は、オフセットで色調補正をする場合の補正前画像と補正後画像の各色の階調値の対応を示す図である。画像が青っぽい場合に、赤色、緑色を変更しないもしくは強め、青色を変更しないもしくは弱めれば良い。図23の例では、画像が青っぽい場合に、オフセットで赤色と緑色を強め、青色を弱めている。各色の階調値でレンジ変化量RVを算出すると、
赤色 暗部RV=1、中間部RV=1、明部RV<1
緑色 暗部RV=1、中間部RV=1、明部RV<1(赤の明部RVよりは大きい)
青色 暗部RV<1、中間部RV=1、明部RV=1
という結果が得られる。図24の例では、赤色は、明部の範囲を狭めるようにオフセット(プラス方向)しており、緑色も同様に明部を狭めているがレンジ変化量RVを比較すると赤色よりもオフセット(プラス方向)が低いことが分かる。青色は暗部のレンジ変化量RVが低くなっているため、暗部を狭めるようにオフセット(マイナス方向)していることが分かる。なお、図22、図23に示したトーンカーブの傾き制御の補正と、図24に示したオフセットでの補正は併用可能であり、同様に評価可能である。
FIG. 24 is a diagram showing the correspondence between the gradation values of the respective colors of the pre-correction image and the post-correction image when color tone correction is performed with an offset. If the image is bluish, red and green should not be changed or strengthened, and blue should not be changed or weakened. In the example of FIG. 23, when the image is bluish, red and green are strengthened and blue is weakened by offset. When the range change amount RV is calculated with the gradation value of each color,
Red Dark part RV = 1, Intermediate part RV = 1, Bright part RV <1
Green Dark portion RV = 1, Intermediate portion RV = 1, Bright portion RV <1 (larger than red bright portion RV)
Blue Dark part RV <1, Intermediate part RV = 1, Bright part RV = 1
The result is obtained. In the example of FIG. 24, red is offset (plus direction) so as to narrow the range of the bright portion, and green is also narrowed similarly to the bright portion, but when the range change amount RV is compared, the offset (plus) is greater than that of red. (Direction) is low. In blue, since the range change amount RV of the dark part is low, it can be seen that the blue part is offset (minus direction) so as to narrow the dark part. Note that the correction of the tone curve inclination control shown in FIGS. 22 and 23 and the offset correction shown in FIG. 24 can be used in combination, and can be evaluated in the same manner.

以上、本発明の好適な実施形態について説明したが、本発明は上記実施形態に限定されず、種々の変形が可能である。例えば、上記実施形態では、画素が有する様々な値を用いて輝度値を算出し、この輝度値を用いて評価指標であるレンジ変化量を算出するようにしたが、上記変形例においても説明したように、レンジ変化量を算出するための画素値としては、輝度値に限定されず、画素が有する何等かの値を反映した値であればよい。   The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiments, and various modifications can be made. For example, in the above-described embodiment, the luminance value is calculated using various values of the pixel, and the range change amount that is the evaluation index is calculated using the luminance value. As described above, the pixel value for calculating the range change amount is not limited to the luminance value, and may be any value that reflects some value of the pixel.

また、上記第1の実施形態では、複数の輝度値レベルとして、暗部、中間部、明部の3つのレベルに分類したが、より多くの輝度値レベルに分類するようにしてもよい。例えば、中間部を1つだけでなく、複数設けるようにすることができる。図18に示した例では、中間部を2つ設けている。   In the first embodiment, the plurality of luminance value levels are classified into the three levels of the dark portion, the intermediate portion, and the bright portion. However, the luminance value levels may be classified into more luminance value levels. For example, a plurality of intermediate portions can be provided instead of only one. In the example shown in FIG. 18, two intermediate portions are provided.

また、上記実施形態に示した補正評価装置は、必ずしも補正評価に利用する必要はなく、レンジ変化量を算出する演算装置として用いることができる。演算装置として用いる場合、液晶ディスプレイ等の表示部を備えたタブレット等に、演算装置を組み込んでおくことにより、算出されたレンジ変化量に基づき、表示部のバックライトの明るさを調節するために用いることができる。   Further, the correction evaluation apparatus described in the above embodiment is not necessarily used for correction evaluation, and can be used as an arithmetic apparatus that calculates a range change amount. When used as an arithmetic device, in order to adjust the brightness of the backlight of the display unit based on the calculated range change amount by incorporating the arithmetic device into a tablet equipped with a display unit such as a liquid crystal display. Can be used.

1・・・CPU(Central Processing Unit)
2・・・RAM(Random Access Memory)
3・・・記憶装置
4・・・指示入力部
5・・・データ入出力I/F
6・・・表示部
10、11、12、13・・・画像取込手段
20、23・・・輝度値分類手段
21、22、25・・・部分画像抽出手段
24・・・部分画像設定手段
30、31、32、33・・・レンジ幅算出手段(統計値を求める手段)
40、41、42、43・・・レンジ変化量算出手段(評価指標を求める手段)
50、51、52、53・・・画像記憶手段
100、101、102、103・・・補正評価装置(演算装置)
1 ... CPU (Central Processing Unit)
2 ... RAM (Random Access Memory)
3 ... Storage device 4 ... Instruction input unit 5 ... Data input / output I / F
6 ... Display unit 10, 11, 12, 13 ... Image capturing means 20, 23 ... Luminance value classifying means 21, 22, 25 ... Partial image extracting means 24 ... Partial image setting means 30, 31, 32, 33 ... Range width calculating means (means for obtaining statistical values)
40, 41, 42, 43 ... Range change amount calculation means (means for obtaining evaluation index)
50, 51, 52, 53 ... Image storage means 100, 101, 102, 103 ... Correction evaluation apparatus (arithmetic apparatus)

Claims (31)

階調補正前の画像である補正前画像の画素値の統計値と、階調補正後の画像である補正後画像の画素値の統計値を求め、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法。
Obtain the statistical value of the pixel value of the pre-correction image that is the image before the gradation correction and the statistical value of the pixel value of the corrected image that is the image after the gradation correction,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
An evaluation method for gradation correction, wherein gradation evaluation is evaluated using the evaluation index.
前記補正前画像および前記補正後画像から、それぞれ所定の条件を満たす画素の集合を選択画素群として選択し、当該選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする請求項1に記載の階調補正の評価方法。   A set of pixels satisfying a predetermined condition is selected as a selected pixel group from the pre-correction image and the post-correction image, and pixel values of pixels belonging to the selected pixel group are obtained, and the statistics are calculated based on the pixel values. 2. The gradation correction evaluation method according to claim 1, wherein a value is obtained. 前記補正前画像、前記補正後画像それぞれについて前記選択画素群が複数存在し、各選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする請求項2に記載の階調補正の評価方法。   A plurality of the selected pixel groups exist for each of the pre-correction image and the post-correction image, pixel values of pixels belonging to each selected pixel group are acquired, and the statistical value is obtained based on the pixel values. The evaluation method for gradation correction according to claim 2. 前記所定の条件は画素値の範囲であることを特徴とする請求項2または請求項3に記載の階調補正の評価方法。   4. The gradation correction evaluation method according to claim 2, wherein the predetermined condition is a range of pixel values. 前記所定の条件は、前記補正前画像および前記補正後画像の一部である部分画像に含まれることであることを特徴とする請求項2または請求項3に記載の階調補正の評価方法。   4. The gradation correction evaluation method according to claim 2, wherein the predetermined condition is included in a partial image that is a part of the pre-correction image and the post-correction image. 前記部分画像は、前記補正前画像および前記補正後画像を格子状に分割した領域で特定されることを特徴とする請求項5に記載の階調補正の評価方法。   The gradation correction evaluation method according to claim 5, wherein the partial image is specified by an area obtained by dividing the pre-correction image and the post-correction image in a grid pattern. 階調補正前の画像である補正前画像に含まれる画素を、その画素値に応じて複数の画素値レベルに分類し、階調補正後の画像である補正後画像に含まれる画素を、前記補正前画像における同一位置の画素と同一画素値レベルに分類し、
前記補正前画像および前記補正後画像について、各画素値レベルに含まれる画素群の各画素の画素値の統計値を求め、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法。
The pixels included in the pre-correction image that is the image before gradation correction are classified into a plurality of pixel value levels according to the pixel values, and the pixels included in the corrected image that is the image after gradation correction are Classify the same pixel value level as the pixel at the same position in the pre-correction image,
For the pre-correction image and the post-correction image, obtain a statistical value of the pixel value of each pixel of the pixel group included in each pixel value level,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
An evaluation method for gradation correction, wherein gradation evaluation is evaluated using the evaluation index.
前記画素値の範囲は、ヒストグラムの谷となる部分に設定されるしきい値により決定されることを特徴とする請求項2、3、4、7のいずれか一項に記載の階調補正の評価方法。   8. The gradation correction range according to claim 2, wherein the range of pixel values is determined by a threshold value set in a portion that becomes a valley of a histogram. 9. Evaluation method. 階調補正前の画像である補正前画像、階調補正後の画像である補正後画像をそれぞれ格子状に分割した部分画像に含まれる画素群の各画素の画素値を用いて、前記補正前画像の画素値の統計値と、前記補正後画像の画素値の統計値を求め、
前記補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求め、
前記評価指標を用いて階調補正の評価をすることを特徴とする階調補正の評価方法。
The pixel value of each pixel of the pixel group included in the partial image obtained by dividing the pre-correction image, which is an image before gradation correction, and the post-correction image, which is an image after gradation correction, into a grid pattern, before the correction Obtain the statistical value of the pixel value of the image and the statistical value of the pixel value of the corrected image,
Using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction, an evaluation index is obtained,
An evaluation method for gradation correction, wherein gradation evaluation is evaluated using the evaluation index.
前記部分画像は、矩形状に配置された画素群単位で、画素値の範囲により分類されたものであることを特徴とする請求項5または請求項9に記載の階調補正の評価方法。   10. The gradation correction evaluation method according to claim 5, wherein the partial images are classified according to a range of pixel values in units of pixel groups arranged in a rectangular shape. 11. 前記部分画像は、画像上の指定位置に基づいて決定されることを特徴とする請求項5または請求項9に記載の階調補正の評価方法。   The gradation correction evaluation method according to claim 5, wherein the partial image is determined based on a designated position on the image. 前記評価指標は、前記補正前画像の画素値の統計値と補正後画像の画素値の統計値の比であることを特徴とする請求項1から請求項11のいずれか一項に記載の階調補正の評価方法。   The floor according to any one of claims 1 to 11, wherein the evaluation index is a ratio of a statistical value of a pixel value of the pre-correction image and a statistical value of a pixel value of the post-correction image. Evaluation method for tonal correction. 前記統計値は標準偏差に基づく値であることを特徴とする請求項1から請求項12のいずれか一項に記載の階調補正の評価方法。   13. The gradation correction evaluation method according to claim 1, wherein the statistical value is a value based on a standard deviation. 前記統計値は画素値の最大値と最小値の差に基づく値であることを特徴とする請求項1から請求項12のいずれか一項に記載の階調補正の評価方法。   The gradation correction evaluation method according to claim 1, wherein the statistical value is a value based on a difference between a maximum value and a minimum value of pixel values. 前記統計値は画素値が中央の所定割合に含まれる画素を特定し、特定された画素の画素値の最大値と最小値の差に基づく値であることを特徴とする請求項1から請求項12のいずれか一項に記載の階調補正の評価方法。   2. The statistical value is a value based on a difference between a maximum value and a minimum value of a pixel value of a specified pixel that identifies a pixel whose pixel value is included in a predetermined ratio in the center. 13. The gradation correction evaluation method according to any one of items 12. 階調補正前の画像である補正前画像の画素値の統計値と、階調補正後の画像である補正後画像の画素値の統計値を求める手段と、
前記補正前画像の画素値の統計値と前記補正後画像の画素値の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置。
Means for obtaining a statistical value of a pixel value of an image before correction that is an image before gradation correction and a statistical value of a pixel value of an image after correction that is an image after gradation correction;
Means for obtaining an evaluation index using the statistical value of the pixel value of the image before correction and the statistical value of the pixel value of the image after correction;
An arithmetic device comprising:
前記補正前画像および前記補正後画像から、それぞれ所定の条件を満たす画素の集合を選択画素群として選択し、当該選択画素群に属する画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする請求項16に記載の演算装置。   A set of pixels satisfying a predetermined condition is selected as a selected pixel group from the pre-correction image and the post-correction image, and pixel values of pixels belonging to the selected pixel group are obtained, and the statistics are calculated based on the pixel values. The arithmetic unit according to claim 16, wherein a value is obtained. 前記補正前画像、前記補正後画像それぞれについて前記選択画素群が複数存在し、各選択画素群に属する各画素の画素値を取得し、当該画素値に基づいて前記統計値を求めることを特徴とする請求項17に記載の演算装置。   A plurality of the selected pixel groups exist for each of the pre-correction image and the post-correction image, the pixel value of each pixel belonging to each selected pixel group is acquired, and the statistical value is obtained based on the pixel value. The arithmetic unit according to claim 17. 前記所定の条件は画素値の範囲であることを特徴とする請求項17または請求項18に記載の演算装置。   The computing device according to claim 17 or 18, wherein the predetermined condition is a range of pixel values. 前記所定の条件は、前記補正前画像および前記補正後画像の一部である部分画像に含まれることであることを特徴とする請求項17または請求項18に記載の演算装置。   19. The arithmetic device according to claim 17, wherein the predetermined condition is included in a partial image that is a part of the pre-correction image and the post-correction image. 前記部分画像は、前記補正前画像および前記補正後画像を格子状に分割した領域で特定されることを特徴とする請求項20に記載の演算装置。   21. The arithmetic device according to claim 20, wherein the partial image is specified by an area obtained by dividing the pre-correction image and the post-correction image in a grid pattern. 階調補正前の画像である補正前画像に含まれる画素を、その画素値である輝度値に応じて複数の輝度値レベルに分類し、階調補正後の画像である補正後画像に含まれる画素を、前記補正前画像における同一位置の画素と同一輝度値レベルに分類する輝度値分類手段と、
前記補正前画像および前記補正後画像について、各輝度値レベルに含まれる画素群の各画素の輝度値の統計値を求める手段と、
前記補正前画像の統計値と前記補正後画像の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置。
The pixels included in the pre-correction image that is the image before gradation correction are classified into a plurality of luminance value levels according to the luminance value that is the pixel value, and are included in the corrected image that is the image after gradation correction. Luminance value classification means for classifying pixels into the same luminance value level as the pixel at the same position in the pre-correction image;
Means for obtaining a statistical value of a luminance value of each pixel of a pixel group included in each luminance value level for the pre-correction image and the post-correction image;
Means for obtaining an evaluation index using the statistical value of the image before correction and the statistical value of the image after correction;
An arithmetic device comprising:
前記画素値の範囲は、ヒストグラムの谷となる部分に設定されるしきい値により決定されることを特徴とする請求項17、18、19、22のいずれか一項に記載の演算装置。   The arithmetic device according to any one of claims 17, 18, 19, and 22, wherein the range of the pixel value is determined by a threshold value set in a portion that becomes a valley of a histogram. 階調補正前の画像である補正前画像、階調補正後の画像である補正後画像から、それぞれ矩形状の部分画像に含まれる画素群を抽出する部分画像抽出手段と、
前記抽出された画素群の各画素の画素値を用いて、前記補正前画像の画素値の統計値と、前記補正後画像の画素値の統計値を求める手段と、
前記補正前画像の画素値の統計値と補正後画像の画素値の統計値を用いて評価指標を求める手段と、
を有することを特徴とする演算装置。
Partial image extraction means for extracting a pixel group included in each of the rectangular partial images from a pre-correction image that is an image before gradation correction and a corrected image that is an image after gradation correction;
Means for obtaining a statistical value of a pixel value of the image before correction and a statistical value of a pixel value of the image after correction using a pixel value of each pixel of the extracted pixel group;
Means for obtaining an evaluation index using a statistical value of the pixel value of the image before correction and a statistical value of the pixel value of the image after correction;
An arithmetic device comprising:
前記部分画像は、矩形状に配置された画素群単位で、画素値の範囲により分類されたものであることを特徴とする請求項20または請求項24に記載の演算装置。   The arithmetic device according to claim 20 or 24, wherein the partial images are classified by a range of pixel values in units of pixels arranged in a rectangular shape. 前記部分画像は、画像上の指定位置に基づいて決定されることを特徴とする請求項20または請求項24に記載の演算装置。   The arithmetic device according to claim 20 or 24, wherein the partial image is determined based on a designated position on the image. 前記評価指標は、前記補正前画像の画素値の統計値と補正後画像の画素値の統計値の比であることを特徴とする請求項16から請求項26のいずれか一項に記載の演算装置。   The calculation according to any one of claims 16 to 26, wherein the evaluation index is a ratio of a statistical value of a pixel value of the pre-correction image and a statistical value of a pixel value of the post-correction image. apparatus. 前記統計値は標準偏差に基づく値であることを特徴とする請求項16から請求項27のいずれか一項に記載の演算装置。   28. The arithmetic device according to claim 16, wherein the statistical value is a value based on a standard deviation. 前記統計値は画素値の最大値と最小値の差に基づく値であることを特徴とする請求項16から請求項27のいずれか一項に記載の演算装置。   The arithmetic unit according to any one of claims 16 to 27, wherein the statistical value is a value based on a difference between a maximum value and a minimum value of pixel values. 前記統計値は画素値が中央の所定割合に含まれる画素を特定し、特定された画素の画素値の最大値と最小値の差に基づく値であることを特徴とする請求項16から請求項27のいずれか一項に記載の演算装置。   17. The statistical value is a value based on a difference between a maximum value and a minimum value of a pixel value that specifies a pixel whose pixel value is included in a predetermined ratio in the center. The arithmetic device according to any one of 27. 請求項16から請求項30のいずれか一項に記載の演算装置として、コンピュータを機能させるためのプログラム。   A program for causing a computer to function as the arithmetic device according to any one of claims 16 to 30.
JP2015061040A 2014-09-22 2015-03-24 Evaluation method of tone correction, and arithmetic device Pending JP2016066990A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2014192210 2014-09-22
JP2014192210 2014-09-22

Publications (1)

Publication Number Publication Date
JP2016066990A true JP2016066990A (en) 2016-04-28

Family

ID=55805969

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015061040A Pending JP2016066990A (en) 2014-09-22 2015-03-24 Evaluation method of tone correction, and arithmetic device

Country Status (1)

Country Link
JP (1) JP2016066990A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019128810A (en) * 2018-01-25 2019-08-01 富士ゼロックス株式会社 Information processing apparatus and program
WO2020166147A1 (en) * 2019-02-14 2020-08-20 株式会社日立製作所 Leakage oil detection apparatus and leakage oil detection method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019128810A (en) * 2018-01-25 2019-08-01 富士ゼロックス株式会社 Information processing apparatus and program
WO2020166147A1 (en) * 2019-02-14 2020-08-20 株式会社日立製作所 Leakage oil detection apparatus and leakage oil detection method
JP2020134189A (en) * 2019-02-14 2020-08-31 株式会社日立製作所 Leakage oil detector and leakage oil detection method

Similar Documents

Publication Publication Date Title
JP5889431B2 (en) Image processing apparatus and image processing method
CN105282392B (en) Image processing apparatus and image processing method
JP3880553B2 (en) Image processing method and apparatus
CN101360250B (en) Immersion method and system, factor dominating method, content analysis method and parameter prediction method
CN106204690B (en) Image processing method and device
JP5870598B2 (en) Image white balance processing method and apparatus
US9449375B2 (en) Image processing apparatus, image processing method, program, and recording medium
CN108806638B (en) Image display method and device
CN103841401A (en) Apparatus and method for correcting depth map for three-dimensional image
JPWO2008133195A1 (en) Image quality adjustment capability measurement method, apparatus and program, and image quality adjustment method, apparatus and program
JP2017044841A5 (en)
JP6265710B2 (en) Image processing apparatus, computer program, and image processing method
JP6617432B2 (en) Image processing apparatus and program
JP2016066990A (en) Evaluation method of tone correction, and arithmetic device
JP2014078808A (en) Image processing apparatus and image processing method
US10438323B2 (en) Image brightness correction and noise suppression method, device, and recording medium for storing image processing program
CN103685972A (en) Image optimizing method and system employing same
CN109982012B (en) Image processing method and device, storage medium and terminal
JP6816352B2 (en) Projectors, projection systems and programs
US11580620B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable medium
JP2009050035A (en) Image processing method, image processing system, and image processing program
KR20100055138A (en) Apparatus and method for improving contrast
JP5911633B1 (en) Image processing device
KR102470242B1 (en) Image processing device, image processing method and program
JP2013250314A (en) Image processor, display device, information processor and image processing method