Picture processor and its method
Abstract
Problem to be solved.To properly correct each scene in an object picture by correcting picture data based on correction information prepared by composing correcting information with respect to the whole area of picture data and correcting information with respect to a mask area based on weighting data.
Solution.Correcting information with respect to the whole area of picture data and correcting information with respect to a mask area are prepared based on the distribution of luminance, weighting data are prepared based on the distribution of the mask area, and these two pieces of correcting information are composed based on weighting data to prepare correcting information to correct picture data. In this device, a weighting data preparing part 8 prepares the weighting data based on mask data stored in a picture buffer 3 to store in the buffer 3. A picture correcting part 9 corrects picture data stored in the buffer 3 based on an LUT stored in an LUT holding part 5 and the weighting data stored in the buffer 3 and stores it in the buffer 3.
Term
Term ended
Projected expiry passed 27 August 2019, 7.1 years ago.
- Priority and filed
- Published
- Projected expiry
- Today
12 claims: 8 independent, 4 dependent
- 1[Claims] 1. A luminance distribution acquisition means for obtaining a first luminance distribution in an entire region of image data and a second luminance distribution in a mask region of the image data. A correction information creating means for creating a first correction information for the entire area of the image data and a second correction information for the mask area based on the first and second luminance distributions. A weight data creating means for creating weight data based on the distribution of the mask area, and An image correction means that synthesizes the first and second correction information based on the weight data to create a third correction information, and corrects the image data based on the third correction information. An image processing device characterized by having. 【特許請求の範囲】 【請求項1】 画像データの全領域における第1の輝度分布と前記画像データのマスク領域における第2の輝度分布を求める輝度分布取得手段と、 前記第1及び第2の輝度分布に基づいて、画像データの全領域に対する第1の補正情報及び前記マスク領域に対する第2の補正情報を作成する補正情報作成手段と、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成手段と、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正手段と、 を有することを特徴とする画像処理装置。
- 4The first aspect of the present invention, wherein the image correction means creates a third correction information by synthesizing the first and second correction information by a weighted average based on the weight data. Image processing equipment. 【請求項4】 前記画像補正手段は、前記重みデータに基づいて前記第1及び第2の補正情報を加重平均により合成して第3の補正情報を作成することを特徴とする請求項1記載の画像処理装置。
- 6The first aspect of the present invention, wherein the weight data creating means creates the weight data so that the weight value changes linearly at the boundary between the masked region and the non-masked region of the image. Image processing equipment. 【請求項6】 前記重みデータ作成手段は、画像のマスク領域と非マスク領域との境界において、重み値が直線的に変化するように前記重みデータを作成することを特徴とする請求項1記載の画像処理装置。
- 8A luminance distribution acquisition means for obtaining a first luminance distribution in a masked region of image data and a second luminance distribution in a non-masked region of the image data. A correction information creating means for creating a first correction information for the masked region and a second correction information for the non-masked region based on the first and second luminance distributions. A weight data creating means for creating weight data based on the distribution of the mask area, and An image correction means that synthesizes the first and second correction information based on the weight data to create a third correction information, and corrects the image data based on the third correction information. An image processing device characterized by having. 【請求項8】 画像データのマスク領域における第1の輝度分布と前記画像データの非マスク領域における第2の輝度分布を求める輝度分布取得手段と、 前記第1及び第2の輝度分布に基づいて、前記マスク領域に対する第1の補正情報及び前記非マスク領域に対する第2の補正情報を作成する補正情報作成手段と、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成手段と、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正手段と、 を有することを特徴とする画像処理装置。
- 9A histogram acquisition step for obtaining a first histogram in an entire area of image data and a second histogram in a mask area of the image data. A correction information creation step of creating a first correction information for the entire area of the image data and a second correction information for the mask area based on the first and second histograms. A weight data creation step of creating weight data based on the distribution of the mask area, and An image correction step of synthesizing the first and second correction information based on the weight data to create a third correction information, and correcting the image data based on the third correction information. An image processing method characterized by having. 【請求項9】 画像データの全領域における第1のヒストグラムと前記画像データのマスク領域における第2のヒストグラムを求めるヒストグラム取得工程と、 前記第1及び第2のヒストグラムに基づいて、画像データの全領域に対する第1の補正情報及び前記マスク領域に対する第2の補正情報を作成する補正情報作成工程と、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成工程と、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正工程と、 を有することを特徴とする画像処理方法。
- 10A histogram acquisition step of obtaining a first histogram in a masked region of image data and a second histogram in a non-masked region of the image data. A correction information creation step of creating a first correction information for the masked region and a second correction information for the non-masked region based on the first and second histograms. A weight data creation step of creating weight data based on the distribution of the mask area, and An image correction step of synthesizing the first and second correction information based on the weight data to create a third correction information, and correcting the image data based on the third correction information. An image processing method characterized by having. 【請求項10】 画像データのマスク領域における第1のヒストグラムと前記画像データの非マスク領域における第2のヒストグラムを求めるヒストグラム取得工程と、 前記第1及び第2のヒストグラムに基づいて、前記マスク領域に対する第1の補正情報及び前記非マスク領域に対する第2の補正情報を作成する補正情報作成工程と、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成工程と、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正工程と、 を有することを特徴とする画像処理方法。
- 11A recording medium in which a program code for image correction processing is recorded, and the program code is at least The code of the histogram acquisition process for obtaining the first histogram in the entire area of the image data and the second histogram in the mask area of the image data, and Based on the first and second histograms, the code of the correction information creation step for creating the first correction information for the entire area of the image data and the second correction information for the mask area, and the code of the correction information creation step. The code of the weight data creation process that creates weight data based on the distribution of the mask area, and A code for an image correction step in which the first and second correction information are combined based on the weight data to create a third correction information, and the image data is corrected based on the third correction information. A recording medium characterized by having. 【請求項11】 画像補正処理のプログラムコードが記録された記録媒体であって、該プログラムコードは少なくとも、 画像データの全領域における第1のヒストグラムと前記画像データのマスク領域における第2のヒストグラムを求めるヒストグラム取得工程のコードと、 前記第1及び第2のヒストグラムに基づいて、画像データの全領域に対する第1の補正情報及び前記マスク領域に対する第2の補正情報を作成する補正情報作成工程のコードと、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成工程のコードと、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正工程のコードと、 を有することを特徴とする記録媒体。
- 12A recording medium in which a program code for image correction processing is recorded, and the program code is at least The code of the histogram acquisition process for obtaining the first histogram in the masked area of the image data and the second histogram in the non-masked area of the image data, and Based on the first and second histograms, the code of the correction information creation step for creating the first correction information for the masked region and the second correction information for the non-masked region, and The code of the weight data creation process that creates weight data based on the distribution of the mask area, and A code for an image correction step in which the first and second correction information are combined based on the weight data to create a third correction information, and the image data is corrected based on the third correction information. A recording medium characterized by having. 【請求項12】 画像補正処理のプログラムコードが記録された記録媒体であって、該プログラムコードは少なくとも、 画像データのマスク領域における第1のヒストグラムと前記画像データの非マスク領域における第2のヒストグラムを求めるヒストグラム取得工程のコードと、 前記第1及び第2のヒストグラムに基づいて、前記マスク領域に対する第1の補正情報及び前記非マスク領域に対する第2の補正情報を作成する補正情報作成工程のコードと、 前記マスク領域の分布に基づいて重みデータを作成する重みデータ作成工程のコードと、 前記重みデータに基づいて前記第1及び第2の補正情報を合成して第3の補正情報を作成し、該第3の補正情報に基づいて前記画像データを補正する画像補正工程のコードと、 を有することを特徴とする記録媒体。
Independent claims8
240 paragraphs in 1 section, as filed
Description: TECHNICAL FIELD [Detailed description of the invention]
【0001】
[Technical field to which the invention belongs]
The present invention relates to an image processing apparatus that corrects image data and a method thereof.
【0002】
[Conventional technology]
In an image processing device that forms a multi-valued image, a so-called image having a clearer contrast is obtained by adjusting the brightness value of the brightest highlight portion or the darkest shadow portion in the image. White balance adjustment is being performed.
【0003】
When white balance adjustment is performed in a conventional image processing device, the R, of the pixels excluding the pixels whose brightness is equal to or higher than a predetermined threshold value in a predetermined high brightness region where the brightness in the image is several percent from the highest brightness side. The G and B average values were calculated, and each pixel was corrected based on the average value.
【0004】
[Problems to be Solved by the Invention]
However, in the above-mentioned conventional image processing apparatus, the image is corrected regardless of the scene of the target image, that is, without considering the image features. Therefore, if the white balance is adjusted for an image with a high brightness level as a whole, such as a portrait with a white wall in the background, it will be judged as overexposure inside the device, so the white wall part is appropriate. Although it was corrected to a normal state, there was a problem that the important person part became very dark.
【0005】
The present invention has been made to solve the above-mentioned problems, and an object of the present invention is to provide an image processing device and a method thereof capable of performing appropriate correction for each scene in a target image.
【0006】
[Means for solving problems]
As one means for achieving the above object, the image processing apparatus of the present invention has the following configuration.
【0007】
That is, based on the brightness distribution acquisition means for obtaining the first brightness distribution in the entire region of the image data and the second brightness distribution in the mask region of the image data, and the first and second brightness distributions, the image data The correction information creating means for creating the first correction information for the entire area and the second correction information for the mask area, the weight data creating means for creating weight data based on the distribution of the mask area, and the weight data. Based on the above, the first and second correction information are combined to create a third correction information, and the image correction means for correcting the image data based on the third correction information is provided. To do.
【0008】
Further, the mask is based on the brightness distribution acquisition means for obtaining the first brightness distribution in the masked region of the image data and the second brightness distribution in the non-masked region of the image data, and the first and second brightness distributions. In the correction information creating means for creating the first correction information for the region and the second correction information for the non-masked region, the weight data creating means for creating the weight data based on the distribution of the masked region, and the weight data. Based on the above, the first and second correction information are combined to create a third correction information, and the image correction means for correcting the image data based on the third correction information is provided. To do.
【0009】
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment according to the present invention will be described in detail with reference to the drawings.
【0010】
<First Embodiment> [Device Configuration] First, a configuration for performing image correction in the image processing device of the present embodiment is shown in FIG. 1 and will be described in detail. The present embodiment is characterized in that correction processing is performed using a plurality of lookup tables. The configuration of the image processing unit shown in FIG. 1 is as follows: image input unit 2, image buffer 3, histogram holding unit 4, lookup table holding unit 5, histogram creating unit 6, lookup table creating unit 7, weight data creating unit 8, Includes image correction unit 9 and image output unit 10.
【0011】
The image input unit 2 reads the image data and the mask data from the input image holding unit 1 and writes them to the image buffer 3. The image buffer 3 holds image data, mask data, and weight data. The histogram holding unit 4 holds a histogram of the entire image data and a histogram of the mask area. The look-up table holding unit 5 (hereinafter, LUT holding unit 5) holds a lookup table (hereinafter, LUT) used at the time of correction processing. The histogram creating unit 6 creates a histogram based on the image data and the mask data stored in the image buffer 3, and stores the result in the histogram holding unit 4. The look-up table creation unit 7 (hereinafter referred to as LUT creation unit 7) calculates the parameters required for correction based on the histogram stored in the histogram holding unit 4, creates a LUT, and produces the result in the LUT holding unit. Store in 5. The weight data creation unit 8 creates weight data based on the mask data stored in the image buffer 3, and stores the result in the image buffer 3. The image correction unit 9 corrects the image data stored in the image buffer 3 based on the LUT stored in the LUT holding unit 5 and the weight data stored in the image buffer 3, and then re-images the image. Store in buffer 3. The image output unit 10 reads the image data from the image buffer 3 and writes it to the output image holding unit 11.
【0012】
Reference numeral 12 denotes a controller that controls the entire device, and includes a CPU 13, a ROM 14, and a RAM 15. The CPU 13 realizes the control peculiar to the present embodiment shown in the flowchart described later by reading the control program held in the ROM 14 onto the RAM 15 and executing the control program.
【0013】
[Image correction method] FIG. 2 shows an outline flowchart of the image correction process according to the configuration shown in FIG. The process shown in the flowchart is realized by the CPU 13 executing the control program held in the ROM 14.
【0014】
In step S1, the image input unit 2 reads the image data and the mask data from the input image holding unit 1 and stores them in the image buffer 3.
【0015】
In step S2, the histogram creating unit 6 creates a histogram based on the image data and the mask data stored in the image buffer 3, and stores the result in the histogram holding unit 4. Figure 3 shows the details of the operation of the histogram creation unit 6.
【0016】
In step S3, the LUT creating unit 7 calculates the parameters required for correction based on the histogram stored in the histogram holding unit 4, creates a LUT, and stores the result in the LUT holding unit 5. Figure 4 shows the details of the operation of the LUT creation unit 7.
【0017】
In step S4, the weight data creation unit 8 creates weight data based on the mask data stored in the image buffer 3, and stores the result in the image buffer 3. Figure 5 shows the details of the operation of the weight data creation unit 8.
【0018】
In step S5, the image correction unit 9 corrects the image data stored in the image buffer 3 based on the LUT stored in the LUT holding unit 5 and the weight data stored in the image buffer 3. Store in image buffer 3 again.
【0019】
In step S6, the image output unit 10 outputs the image data held in the image buffer 3 by writing it to the output image holding unit 12.
【0020】
[Histogram Creation Process] FIG. 3 shows a flowchart of the histogram creation process in the histogram creation unit 6. This is a detailed representation of step S3 in FIG.
【0021】
In step S11, the image data and the mask data are taken out from the image buffer 3 one pixel at a time. The image data stores the luminance data (R, G, B) of each RGB color, and the mask data stores data indicating the presence or absence of a mask.
【0022】
In step S12, the brightness L of the pixel is obtained from the RGB value of the image data according to the following equation.
【0023】
L = (3R + 6G + B) / 10 As shown in the above equation, in the present embodiment, an example in which the luminance value is weighted and averaged with a weight of R: G: B = 3: 6: 1 will be described, but of course, other weighting may be performed. For example, the weight may be calculated based on the average value of the maximum value and the minimum value of RGB.
【0024】
In step S13, the histogram stored in the histogram holding unit 4 is updated. The histogram holding unit 4 uses a histogram HistL of brightness L calculated based on the above equation, HistR, HistG, HistB storing cumulative brightness values of each RGB color for each brightness L value of the pixel, and mask data. It holds a histogram HistLMsk, of luminance L in the masked area. The initial state of each histogram is 0. In addition, each histogram is updated according to the following formula.
【0025】
HistR [L] = HistR [L] + R HistG [L] = HistG [L] + G HistB [L] = HistB [L] + B HistL [L] = HistL [L] +1 In step S14, it is checked whether or not the pixel is masked by referring to the mask data. If it is masked, the process proceeds to step S15, and if it is not masked, the process proceeds to step S16.
【0026】
In step S15, the histogram of the mask area stored in the histogram holding unit 4 is updated according to the following equation.
【0027】
HistLMsk [L] = HistLMsk [L] +1 In step S16, it is checked whether or not the histogram creation process is completed for all pixels, and if it is not completed, the process returns to step S11.
【0028】
An example of the histogram HistL of brightness L created in this embodiment is shown in FIG.
【0029】
[LUT Creation Process] FIG. 4 shows a flowchart of the LUT creation process in the LUT creation unit 7. This is a detailed representation of step S3 in FIG.
【0030】
In step S21, the maximum brightness of the image is obtained from the histogram HistL stored in the histogram holding unit 4. In the histogram illustrated in FIG. 9, the maximum brightness is "252".
【0031】
In step S22, a predetermined amount is sequentially decremented from the logical maximum brightness of 255, and each time a comparison is made with the maximum brightness obtained in step S21, the brightness LH'at the time when the maximum brightness becomes larger is calculated. Ask. Then, in the luminance region of LH'or less, the luminance region (highlight region) including a predetermined ratio of the total number of pixels is obtained. For example, assuming that the predetermined amount to be sequentially reduced in the histogram shown in FIG. 9 is "10", LH'becomes "245" by sequentially comparing the maximum brightness "252" with 255, 245, 235 .... Then, when the luminance region including 1% of the total number of pixels is obtained as the luminance region in the luminance region below LH', the highlight point LH, which is the minimum luminance value of the highlight region, becomes "234".
【0032】
Then, the average brightness (RH, GH, BH) for each RGB in the highlight region (the region where the brightness is LH or more and LH'or less) is calculated according to the following formula.
【0033】
[Number 1]
<img file="JP2001069352A_D0001.tif" />【0034】
Next, in step S23, the minimum brightness of the image is obtained from the histogram HistL stored in the histogram holding unit 4. In the histogram illustrated in FIG. 9, the minimum brightness is "5".
【0035】
In step S24, a predetermined amount is sequentially added from 0, which is the logical minimum brightness, and each time a predetermined amount is compared with the minimum brightness obtained in step S23, the brightness LS'at the time when the minimum brightness becomes larger. Ask for. Then, in the luminance region of LS'or higher, the luminance region (shadow region) including a predetermined ratio of the total number of pixels is obtained. For example, assuming that the predetermined amount to be sequentially added in the histogram shown in FIG. 9 is "10", the minimum brightness "5" is sequentially compared with 0, 10, 20, ..., And the LS'is "10". ". Then, when the brightness region including 1% of the total number of pixels is obtained as the shadow region in the brightness region above the LS', the shadow point LS, which is the maximum brightness value of the shadow region, becomes 22.
【0036】
Then, the average brightness (RS, GS, BS) for each RGB in the shadow region (the region where the brightness is LS'or more and LS or less) is calculated according to the following formula.
【0037】
[Number 2]
<img file="JP2001069352A_D0002.tif" />【0038】
Next, in step S25, LUTR, LUTG, and LUTB, which are RGB LUTs, are created based on the RH, GH, BH, RS, GS, and BS obtained above, and are stored in the LUT holding unit 5. An example of the created LUT is shown in Fig. 10 (a).
【0039】
Also, LHTmp = (3RH + 6GH + BH) / 10 LSTmp = (3RS + 6GS + BS) / 10 Create a LUT Tmp, which is a LUT for HistL correction, based on the brightness LHTmp and LSTmp obtained by.
【0040】
As shown in the above equation, in the present embodiment, an example in which the luminance value is weighted and averaged with a weight of R: G: B = 3: 6: 1 will be described, but of course, other weighting may be performed. For example, the weight may be calculated based on the average value of the maximum value and the minimum value of RGB.
【0041】
In step S26, HistL and HistLMsk are corrected with reference to LUTTmp. The HistL and HistLMsk will be used later when calculating the exposure compensation amount.
【0042】
In step S27, the average brightness of the image is obtained from the HistL corrected in step S26, a LUTL which is an exposure compensation LUT is created according to a well-known method, and the LUTL is stored in the LUT holding unit 5.
【0043】
In step S28, the average brightness of the mask area is obtained from the corrected HistLMsk, a LUTLMsk which is an exposure compensation LUT is created according to a well-known method, and the LUTLMsk is stored in the LUT holding unit 5. Figure 10 (b) shows an example of LUTL and LUTL Msk.
【0044】
Hereinafter, the created LUT will be described in detail with reference to FIG. The LUTR, LUTG, and LUTB shown in FIG. 10A are LUTs for correcting contrast and color cast. Here, the highlight gamma is set in the order of G, B, R. By strengthening G and B with respect to R in this way, it is possible to correct, for example, the color cast of an image that has a bluish tint. At the same time, the contrast can be corrected.
【0045】
On the other hand, the LUTLMsk and LUTL shown in FIG. 10B are LUTs for correcting the exposure in the mask region and the region other than the mask region. As described above, in the present embodiment, by performing correction using two types of LUTs, appropriate correction can be performed for each region.
【0046】
[Weight data creation process] FIG. 5 shows a flowchart of the weight data creation process in the weight data creation unit 8. This is a detailed representation of step S4 in FIG.
【0047】
In step S31, 0 is assigned to j which will be used as a counter thereafter. Also, all the weight data WgtImg stored in the image buffer 3 are initialized to 0. However, when the mask data MskImg [0] corresponding to the first pixel in the processing unit pixel group is masked, 10 is assigned to the corresponding weight data WgtImg [0].
【0048】
In step S32, check whether MskImg [j] is masked. If it is masked, the process proceeds to step S33, and if it is not masked, the process proceeds to step S39.
【0049】
In step S33, the value of WgtImg [j] is examined, and if it is less than 5, the process proceeds to step S34, and if it is 5 or more, the process proceeds to step S37. In step S34, WgtImg [j] is updated according to the update rule 1 described later. The details of the update rule 1 are shown in FIG. 7 and will be described later.
【0050】
Then, after incrementing the counter j in step S35, it is checked in step S36 whether or not the weight data creation process is completed for all pixels. If all pixels have not been completed, the process returns to step S32.
【0051】
In step S37, the value of WgtImg [j] is examined, and if it is 10, the process proceeds to step S38, otherwise the process proceeds to step S35. After substituting 10 for WgtImg [j + 1] in step S38, the process proceeds to step S35.
【0052】
In step S39, the value of WgtImg [j] is examined, and if it is greater than 5, the process proceeds to step S40, and if it is 5 or less, the process proceeds to step S35. In step S40, WgtImg [j] is updated according to the update rule 2 described later. The details of the update rule 2 are shown in FIG. 8 and will be described later.
【0053】
Hereinafter, the update law 1 and the update law 2 referred to when updating the weight data WgtImg [j] will be described in detail.
【0054】
Update Law 1 Figure 7 shows the update rule 1 of the weight data WgtImg [j]. This is a detailed representation of step S34 in FIG. Hereinafter, j will be described as the index value of interest in step S34.
【0055】
First, in step S51, the value of WgtImg [j-4] is compared with 1, and the larger one is substituted for WgtImg [j-4]. Next, in step S52, the value of WgtImg [j-3] is compared with 2, and the larger one is substituted for WgtImg [j-3]. Next, in step S53, the value of WgtImg [j-2] is compared with 3, and the larger one is assigned to WgtImg [j-2]. Next, in step S54, the value of WgtImg [j-1] is compared with 4, and the larger one is substituted for WgtImg [j-1].
【0056】
Then, 5 to 10 are substituted into WgtImg [j] to WgtImg [j + 5] in sequence from steps S55 to S60. If the index value (j-5 to j + 5) is out of the image data, the corresponding step is not processed.
【0057】
Update Law 2 Figure 8 shows the update rule 2 of the weight data WgtImg [j]. This is a detailed representation of step S40 of FIG. Hereinafter, j will be described as the index value of interest in step S40.
【0058】
First, in step S61, the value of WgtImg [j-5] is compared with 9, and the smaller one is substituted for WgtImg [j-5]. Next, in step S62, the value of WgtImg [j-4] is compared with 8, and the smaller one is substituted for WgtImg [j-4]. Next, in step S63, the value of WgtImg [j-3] is compared with 7, and the smaller one is substituted for WgtImg [j-3]. Next, in step S64, the value of Wgtimg [j-2] is compared with 6, and the smaller one is assigned to WgtImg [j-2].
【0059】
Then, 5 to 0 are substituted into WgtImg [j-1] to WgtImg [j + 4] in order from steps S65 to S70. If the index value (j-5 to j + 5) is out of the image data, the corresponding step is not processed.
【0060】
The weight data in the present embodiment are created and combined by scanning in the vertical direction and the horizontal direction.
【0061】
Hereinafter, a specific example of weight data creation will be described with reference to FIGS. 12 and 13.
【0062】
Example of weight data creation 12 and 13 show examples of creating weighted data when the weighted average is not considered and when the weighted average is performed.
【0063】
FIG. 12A shows mask data showing how the 7th to 12th pixels and the 14th to 18th pixels are masked. FIG. 12 (b) shows the weight data corresponding to the mask data of FIG. 12 (a) when the weighted average is not taken into consideration. In this case, since the weighted average is not taken into consideration, the weight value corresponding to the masked pixel is 10, and the weight value corresponding to the unmasked pixel is 0.
【0064】
Next, the case where the weighted average is taken into consideration will be described. FIG. 13 (a) shows mask data having the same pattern as that of FIG. 12 (a). Hereinafter, the flow of processing for creating weighted data in consideration of the weighted average will be described in detail with reference to FIGS. 13 (b) to 13 (g). In FIGS. 13 (b) to 13 (g), 0 in italics indicates the value initialized in step S31.
【0065】
First, since MskImg [0] to MskImg [6] are not masked, the values of the corresponding weight data WgtImg [0] to WgtImg [6] remain 0, and the weight data shown in FIG. 13 (b) is can get. At this time, each step is executed in the flow of S32 S39 S35 S36 in FIG.
【0066】
Next, since MskImg [7] is masked and the value of the corresponding weight data WgtImg [7] is 0 (initial value), the values of WgtImg [3] to WgtImg [12] are set according to the above update rule 1. It is updated to obtain the weight data shown in FIG. 13 (c). At this time, each step is executed in the flow of S32 S33 S34 S35 S36 in FIG.
【0067】
Next, since MskImg [8] to MskImg [11] are masked and the corresponding weight data WgtImg [8] to WgtImg [11] are all greater than 5 and less than 10, the weight data values are It remains unchanged in Figure 13 (c). At this time, each step is executed in the flow of S32 S33 S37 S35 S36 in FIG.
【0068】
Next, since MskImg [12] is masked and the value of the corresponding weight data WgtImg [12] is 10, 10 is substituted for WgtImg [13], and the weight data shown in FIG. 13 (d) is obtained. can get. At this time, each step is executed in the flow of S32 S33 S37 S38 S35 S36 in FIG.
【0069】
Next, since MskImg [13] is not masked and the value of the corresponding weight data WgtImg [13] is greater than 5, the values of WgtImg [10] to MskImg [17] are updated according to the above update rule 2. Then, the weight data shown in FIG. 13 (e) is obtained. At this time, each step is executed in the flow of S32 S39 S40 S35 S36 in FIG.
【0070】
Next, since MskImg [14] is masked and the value of the corresponding weight data WgtImg [14] is less than 5, the values of WgtImg [14] to WgtImg [19] are updated according to the above update rule 1 and shown in the figure. The weight data shown in 13 (f) is obtained. At this time, each step is executed in the flow of S32 S33 S34 S35 S36 in FIG.
【0071】
Next, since MskImg [15] to MskImg [18] are masked and the corresponding weight data WgtImg [15] to WgtImg [18] are all greater than 5 and less than 10, the weight data values are It remains unchanged in Figure 13 (f). At this time, each step is executed in the flow of S32 S33 S37 S35 S36 in FIG.
【0072】
Next, since MskImg [19] is not masked and the value of the corresponding weight data WgtImg [19] is greater than 5, the values of WgtImg [17] to MskImg [23] are updated according to the above update rule 2. Then, the weight data shown in FIG. 13 (g) is obtained. At this time, each step is executed in the flow of S32 S39 S40 S35 S36 in FIG.
【0073】
Next, since MskImg [20] to MskImg [25] are not masked and the corresponding weight data WgtImg [20] to WgtImg [25] are all less than 5, the weight data values are shown in Figure 13. It remains unchanged at (g). At this time, each step is executed in the flow of S32 S33 S37 S35 S36 in FIG.
【0074】
By performing the process described above for all pixels one row or one column at a time, weight data related to rows and columns is created.
【0075】
Weight data composition example Next, a specific example in the case of synthesizing the weight data related to the rows and columns created as described above as two-dimensional weight data will be described with reference to FIG.
【0076】
FIG. 14A shows mask data, and the shaded area shows the mask area. FIG. 14B shows weight data created by scanning in the horizontal direction. FIG. 14 (c) shows weight data created by scanning in the vertical direction. Then, FIG. 14 (d) is the weight data obtained by synthesizing the two weight data shown in FIGS. 14 (b) and 14 (c).
【0077】
For the composite weight data shown in FIG. 14 (d), the values at the same positions in FIGS. 14 (b) and 14 (c) are compared, and if the position is masked, the smaller value must be masked. It was created by selecting the larger value.
【0078】
[Image correction processing] FIG. 6 shows a flowchart of the image correction processing in the image correction unit 9. This is a detailed representation of step S5 in FIG.
【0079】
In step S41, w used as a weight counter is initialized to 0. In step S42, a new LUT (LUTLTmp) is created by weighted averaging the LUTL and LUTLMsk stored in the LUT holding unit 5 with w: 10-w. An example of this weighted averaged LUTL Tmp is shown in FIG.
【0080】
LUTLTmp [n] = (w × LUTL [n] + (10-w) × LUTLMsk [n]) / 10 However, n is 0 or more and 255 or less.
【0081】
In step S43, the image data and the weight data stored in the image buffer 3 are taken out for one pixel. Here, the image data stores the luminance (R, G, B) of each RGB color, and the weight data stores the weight values from 0 to 10 per pixel.
【0082】
In step S44, the value of the weight data of the pixel is compared with w, and if they match, the process proceeds to step S45, but if they do not match, the process proceeds to step S46.
【0083】
In step S45, the image data taken out from the image buffer 3 is corrected according to the following equation based on the weighted averaged LUTL Tmp, LUTR, LUTG, and LUTB, and the result is overwritten in the image buffer 3.
【0084】
R = LUTL Tmp [LUTR [R]] G = LUTLTmp [LUTG [G]] B = LUTLTmp [LUTB [B]] In step S46, it is checked whether or not the correction process is completed for all pixels, and if all pixels are completed, the process proceeds to step S47, and if not, the process proceeds to step S43.
【0085】
In step S47, w is incremented, and in step S48, it is checked whether or not w exceeds 10. If w exceeds 10, the process ends, but if it does not exceed 10, the process returns to step S42.
【0086】
As described above, according to the present embodiment, the image data is corrected by changing the LUT in the masked area and the other areas (non-masked areas), so that the image data is appropriate for each area. You can make corrections. Further, by creating a LUT so that the corrected pixel value changes smoothly at the mask boundary, it is possible to prevent the occurrence of a pseudo contour at the boundary.
【0087】
Therefore, for example, by creating mask data for the human skin part and changing the correction LUT between the skin and the non-skin part, the pseudo contour does not occur even when the skin part is corrected more preferably. ..
【0088】
<Second Embodiment> Hereinafter, the second embodiment according to the present invention will be described. Since the configuration of the image processing unit in the second embodiment is the same as that in the first embodiment described above, the description thereof will be omitted.
【0089】
In the first embodiment described above, an example of creating a LUT based on the histogram of the mask region and the histogram of the entire image has been described. In the second embodiment, an example of creating a LUT based on a histogram of a masked region and a histogram of an unmasked region (unmasked region) will be described.
【0090】
[Histogram Creation Process] FIG. 15 shows a flowchart of the histogram creation process in the histogram creation unit 6 of the second embodiment. That is, it corresponds to the flowchart of FIG. 3 in the first embodiment.
【0091】
In step S71, the image data and the mask data are taken out from the image buffer 3 one pixel at a time. The image data stores the luminance data (R, G, B) of each RGB color, and the mask data stores data indicating the presence or absence of a mask.
【0092】
In step S72, the brightness L of the pixel is obtained from the RGB value of the image data according to the following equation.
【0093】
L = (3R + 6G + B) / 10 As shown in the above equation, in the present embodiment, an example in which the luminance value is weighted and averaged with a weight of R: G: B = 3: 6: 1 will be described, but of course, other weighting may be performed. For example, the weight may be calculated based on the average value of the maximum value and the minimum value of RGB.
【0094】
In step S73, the histogram stored in the histogram holding unit 4 is updated. The histogram holding unit 4 uses a histogram HistL of brightness L calculated based on the above equation, HistR, HistG, HistB storing cumulative brightness values of each RGB color for each brightness L value of the pixel, and mask data. It holds a histogram HistLMsk, of luminance L in the masked area. The initial state of each histogram is 0, and the update is performed in the same manner as in the first embodiment.
【0095】
In step S74, it is checked whether or not the pixel is masked by referring to the mask data. If it is masked, the process proceeds to step S75, and if it is not masked, the process proceeds to step S76.
【0096】
In step S75, the histogram of the mask area stored in the histogram holding unit 4 is updated according to the following equation.
【0097】
HistLMsk [L] = HistLMsk [L] +1 On the other hand, in step S76, the histogram of the non-masked region stored in the histogram holding unit 4 is updated.
【0098】
HistLUnMsk [L] = HistLUnMsk [L] +1 In step S77, it is checked whether or not the histogram creation process is completed for all pixels, and if it is not completed, the process returns to step S71.
【0099】
In the second embodiment, the histogram HistLMsk [L] of the masked area and the histogram HistLUnMsk [L] of the non-masked area are created as described above. The processing after the histogram creation in the second embodiment is the same as that in the first embodiment, but in particular, HistL in steps S26 and S27 of FIG. 4 showing the operation of the LUT creation unit 7 is changed to HistLUnMsk in the second embodiment. Equivalent to.
【0100】
[Other Embodiments]
In the first and second embodiments described above, an example in which the luminance data is carried out assuming that the luminance data is a digital value from 0 to 255 has been described, but the present invention limits these values, for example, the maximum value of the data to 255. It is not something that is done. Further, the present invention can be realized not only by creating a histogram based on the brightness but also by the halftone dot density and the like.
【0101】
Further, in each of the above embodiments, an example in which the weight data is linearly changed in 10 steps at the boundary between the masked region and the non-masked region when the weight data is created has been described. Of course, it may be changed according to a curve, a logarithmic curve, etc., and it is not limited to 10 steps. Further, it goes without saying that the method of changing the weight data and the number of steps may be changed between the vertical direction and the horizontal direction.
【0102】
Even if the present invention is applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), the present invention is a device composed of one device (for example, a copier, a facsimile machine, etc.). May be applied to.
【0103】
Another object of the present invention is to supply a storage medium in which a program code of software that realizes the functions of the above-described embodiment is recorded to a system or device, and a computer (or CPU or MPU) of the system or device is a storage medium. Needless to say, it can be achieved by reading and executing the program code stored in. In this case, the program code itself read from the storage medium realizes the function of the above-described embodiment, and the storage medium storing the program code constitutes the present invention. As a storage medium for supplying the program code, for example, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a non-volatile memory card, a ROM, or the like can be used.
【0104】
Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also the OS (operating system) running on the computer is activated based on the instructions of the program code. Needless to say, there are cases where a part or all of the actual processing is performed and the processing realizes the functions of the above-described embodiment.
【0105】
Further, the program code read from the storage medium is written in the memory provided in the function expansion card inserted in the computer or the function expansion unit connected to the computer, and then the function is expanded based on the instruction of the program code. Needless to say, there are cases where a CPU provided in a card or a function expansion unit performs a part or all of the actual processing, and the processing realizes the functions of the above-described embodiment.
【0106】
When the present invention is applied to the storage medium, the storage medium corresponds to the flowchart described above (FIGS. 2, FIG. 3, FIG. 4, FIG. 5, FIG. 6, FIG. 7, FIG. 8, FIG. 15). It will store the program code.
【0107】
[Effect of the invention]
As described above, according to the present invention, it is possible to perform appropriate correction for each scene in the target image.
[Simple explanation of drawings]
[Figure 1]
A block diagram showing a configuration for performing image correction in one embodiment of the present invention. [Figure 2]
Flowchart showing the outline of image correction processing, [Fig. 3]
Flowchart showing histogram creation process, [Fig. 4]
Flowchart showing lookup table creation process, [Fig. 5]
Flowchart showing weight data creation process, [Fig. 6]
Flowchart showing image correction processing, [Fig. 7]
Flowchart showing weight data update rule 1, [Fig. 8]
Flowchart showing weight data update rule 2, [Fig. 9]
Diagram showing an example of a histogram, [Fig. 10]
Diagram showing an example of a lookup table, [Fig. 11]
A diagram showing an example of synthesizing a look-up table using a weighted average, [Fig. 12]
A diagram showing an example of weighted data without considering the weighted average, [Fig. 13]
Figure showing an example of weighted data when weighted average is taken into account, [Fig. 14]
The figure which shows the composition example of the weight data, [Fig. 15]
It is a flowchart which shows the histogram making process in 2nd Embodiment.
[Explanation of symbols]
1 Input image holder 2 Image input section 3 image buffer 4 Histogram holder 5 Look-up table holder 6 Histogram creation section 7 Look-up table creation department 8 Weight data creation unit 9 Image correction unit 10 Image output section 11 Output image holder
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| US7860339B2 | Cited by | United States of America | Applicant |
| JP2014121019A | Cited by | Japan | Search report |
| KR101248858B1 | Cited by | Republic of Korea | Search report |
| JP2010278708A | Cited by | Japan | Search report |
| JP2013176171A | Cited by | Japan | Search report |
| WO2005027040A1 | Cited by | World Intellectual Property Organization (WIPO) | International search |
| US8165417B2 | Cited by | United States of America | Applicant |
| US7945115B2 | Cited by | United States of America | Applicant |
| US7783126B2 | Cited by | United States of America | Applicant |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 24171799 | Japan | A | |
| JP19990241717 | – | – | – |
8 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Decision of refusalA02 | A02 | |
| Notification of resignation of power of attorneyRD04 | RD04 | |
| Notification of resignation of power of attorneyRD04 | RD04 | |
| Request for written amendment filedA521 | A521 | |
| Notification of reasons for refusalA131 | A131 | |
| Report on retrievalA977 | A977 | |
| Written request for application examinationA621 | A621 | |
| Notification of appointment of power of attorneyRD03 | RD03 |
Numbers
- Publication
- 2001-69352
- Publication, DOCDB
- 2001069352
- Publication, EPODOC
- JP2001069352
- Application
- 24171799
- Application, DOCDB
- 24171799
- Application, EPODOC
- JP19990241717
Titles2
- Japanese
- 【発明の名称】画像処理装置およびその方法
- English
- [Title of Invention] Image Processing Device and Method Therefor
Classification
- IPC, 6
- G06T5 00
- G06T7 00
- H04N1 407
- H04N1 46
- H04N1 387
- H04N1 60