JP2005348081A - Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion - Google Patents

Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion Download PDF

Info

Publication number
JP2005348081A
JP2005348081A JP2004165093A JP2004165093A JP2005348081A JP 2005348081 A JP2005348081 A JP 2005348081A JP 2004165093 A JP2004165093 A JP 2004165093A JP 2004165093 A JP2004165093 A JP 2004165093A JP 2005348081 A JP2005348081 A JP 2005348081A
Authority
JP
Japan
Prior art keywords
brightness
lightness
area
shadow
histogram
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
JP2004165093A
Other languages
Japanese (ja)
Inventor
Mitsuharu Ohazama
光晴 大峡
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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering 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 Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2004165093A priority Critical patent/JP2005348081A/en
Publication of JP2005348081A publication Critical patent/JP2005348081A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve contrast of a shading portion in a brightness image, and to reduce discontinuity of brightness. <P>SOLUTION: A shading region detector 200 detects a shading region in a brightness image, and a shading region brightness converter 300 converts brightness so that the contrast in the shading region is improved. A gradation processor 400 performs gradation process on a group of near border pixels in the border adjoining region in the shading region adjacent to the border between the non-shading region containing a non-shading portion other than the shading region and the shading region, so that a group of further improved brightness for the group of near border pixels is determined not to cause discontinuity of brightness between the border adjoining region and its near region. The brightness of the group of near border pixels is changed to the group of brightness determined by the shading portion brightness converter, resulting in the group of brightness that has been further improved. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、人工衛星あるいは航空機等から地表を撮影して得た画像等の撮像画像に含まれる、ビル等の建物により生じる比較的大きい陰影部の画像のコントラストを改善して当該陰影部の画像を見やすい画像、すなわち、視認性を向上した画像にする、陰影部のコントラストを改善可能なプログラム及び陰影部のコントラストの改善方法に関する。   The present invention improves the contrast of an image of a relatively large shadow portion generated by a building such as a building and is included in a captured image such as an image obtained by photographing the ground surface from an artificial satellite or an aircraft, etc. The present invention relates to a program capable of improving the contrast of a shadow portion, and a method for improving the contrast of a shadow portion, which makes an image easy to see, that is, an image with improved visibility.

近年、人工衛星又は航空機等(以下、人工衛星等と呼ぶことがある)により地表を高所から撮影して得られる、地表を撮影した画像(以下、この画像を地理画像と呼ぶ場合がある)に関する地理画像データの利用が広まってきている。例えば、地図の生成や都市部での土地の利用状況の把握等である。しかし、都市部では高層ビル群等の高層建築物の陰となる部分(以下、陰部分と呼ぶことがある)及び影となる部分(以下、影部分と呼ぶことがある)は全体として非常に暗く、画像のコントラストが非常に小さく、視認性に欠ける場合が起きている。   In recent years, an image obtained by photographing the ground surface from a high place by an artificial satellite or an aircraft (hereinafter sometimes referred to as an artificial satellite) (hereinafter, this image may be referred to as a geographic image). The use of geographic image data regarding is becoming widespread. For example, generation of a map or grasping of land use status in an urban area. However, in urban areas, the shadows of high-rise buildings such as high-rise buildings (hereinafter sometimes referred to as shadows) and shadows (hereinafter sometimes referred to as shadows) are very large as a whole. There are cases where the image is dark and the contrast of the image is very small and the visibility is poor.

以下では、上記陰部分と影部分を合わせて陰影部と呼ぶことがある。ここで、陰部分は、例えばビル等の物体のうち、その物体の他の部分により太陽光が遮断され、太陽光が照射されなくなった部分である。例えばビルの壁面のうち太陽光が照射されていない壁面である。影部分は、ビル等の太陽光が照射された物体により地表等に投影される黒い部分である。   Hereinafter, the shadow portion and the shadow portion may be collectively referred to as a shadow portion. Here, the shaded part is a part of the object such as a building where sunlight is blocked by other parts of the object and no longer receives sunlight. For example, it is a wall surface of a building that is not irradiated with sunlight. A shadow part is a black part projected on the ground surface etc. by the object irradiated with sunlight, such as a building.

このように陰影部の濃度が低く、画像のコントラストが小さいと、その陰影部内にある物体を明瞭に識別することが難しくなるという、陰影部の視認性の問題が発生し、このことが地理画像データの利用時の問題の一つとなっている。そのため、従来からも陰影部内の視認性を向上させるための研究が活発に行われている。その一例として、特許文献1は、地理画像から影部分を削除する方法を提案している。具体的には、この提案では、衛星画像データに含まれる撮影日時情報とビル等の物体の高さ情報とを利用して、その物体への太陽光の照射方向、照射角度、当該物体の存在により発生する影の幅とその長さを算出し、算出された情報に基づいてビル等の物体の影部分の存在位置を決定し、当該決定に基づいて影部分を地理画像から削除する技術が提案されている。   Thus, if the density of the shadow portion is low and the contrast of the image is small, it becomes difficult to clearly identify an object in the shadow portion, which causes a problem of visibility of the shadow portion, which is a geographical image. This is one of the problems when using data. Therefore, research for improving the visibility in the shaded area has been actively conducted. As an example, Patent Document 1 proposes a method of deleting a shadow portion from a geographic image. Specifically, in this proposal, the shooting date and time information included in the satellite image data and the height information of an object such as a building are used to irradiate the object with sunlight, the irradiation angle, and the existence of the object. Is a technique for calculating the width and length of a shadow generated by determining the presence position of a shadow part of an object such as a building based on the calculated information, and deleting the shadow part from the geographic image based on the determination Proposed.

なお、地理画像と異なる他の画像についてではあるが、対象物に対する照明が悪いとかあるいは逆光で撮影された場合のように、対象物を撮影して得られる画像のコントラストが低い場合に、画像のコントラストを改善するための方法として、いくつかの手法は知られている。例えば、濃度ヒストグラムを均一化する手法あるいは濃度を線形又は非線形に変換するという手法自体は知られている(例えば、特許文献2、3、4及び非特許文献1参照)。また、画像のノイズを除去して画像を鮮明にする方法自体も知られている(例えば、非特許文献2参照)。
特開平10−269347号公報 特開2002−209115号公報 特開2001−118062号公報 特開2002−140700号公報 酒井幸市,「デジタル画像処理入門」,CQ出版株式会社,2002年10月1日,p.38−49 八木伸行、外5名,「C言語で学ぶ実践画像処理」,株式会社オーム社,1999年12月8日,p.54−63,84−97
As for other images different from geographic images, when the contrast of the image obtained by photographing the object is low, such as when the illumination on the object is bad or when the object is photographed with backlight, Several methods are known as methods for improving contrast. For example, a technique for making a density histogram uniform or a technique for converting density linearly or nonlinearly is known (see, for example, Patent Documents 2, 3, 4 and Non-Patent Document 1). Also known is a method of removing noise from an image to make the image clear (see, for example, Non-Patent Document 2).
Japanese Patent Laid-Open No. 10-269347 JP 2002-209115 A Japanese Patent Laid-Open No. 2001-118062 JP 2002-140700 A Sakai Yukiichi, “Introduction to Digital Image Processing”, CQ Publishing Co., Ltd., October 1, 2002, p. 38-49 Nobuyuki Yagi, 5 others, “Practical image processing learned in C language”, Ohm Co., Ltd., December 8, 1999, p. 54-63, 84-97

特許文献1に開示されている技術では、影部分のみの除去を行うことを提案しているので、影部分が投影された地上の物体に関する画像情報がなくなり、その物体を全く識別できなくなる。したがって、影部分を削除してもよいという用途にしか適用できない。更に、特許文献1では、陰部分の視認性の低さの問題は何も解決していない。   Since the technique disclosed in Patent Document 1 proposes to remove only the shadow portion, there is no image information regarding the object on the ground on which the shadow portion is projected, and the object cannot be identified at all. Therefore, it can be applied only to the usage where the shadow portion may be deleted. Furthermore, in patent document 1, the problem of the low visibility of a shadow part is not solved at all.

一般に陰影部を含むモノクロの濃淡画像内の陰影部の視認性を改善するには、それ自体知られている、濃度ヒストグラムの均一化あるいは線形変換又は非線変換を使用することが考えられる。しかし、発明者による実験ではこのようなコントラスト改善策を陰影部と非陰影部の両方を有する白黒画像全体に適用しても、陰影部の画像のコントラストはあまり改善されないことが分かった。そこで、本発明者は、陰影部のコントラスト改善のためには、非陰影部と区別して陰影部だけに対してコントラスト改善処理を施すことがよいと考えるに至った。しかし、本発明者による実験の結果、従来のコントラスト改善策である、濃度ヒストグラムの均一化あるいは線形変換あるいは非線形変換等の既に知られた処理を陰影部だけに適用しても、得られる画像はコントラストが高すぎたりあるいは逆に低すぎたりして、適切なコントラストが得られないということが判明した。したがって、本発明者は、陰影部という濃度の低い画像が大部分である特定の画像部分のコントラストの改善に適した新しいコントラスト改善方法が望ましいと考えるに至った。   In general, in order to improve the visibility of a shadow portion in a monochrome grayscale image including a shadow portion, it is conceivable to use uniformization of a density histogram or linear transformation or non-linear transformation known per se. However, in the experiment by the inventor, it has been found that even when such a contrast improvement measure is applied to the entire black-and-white image having both the shadow portion and the non-shadow portion, the contrast of the image in the shadow portion is not improved so much. Therefore, the present inventor has come to consider that it is preferable to perform contrast improvement processing only on the shadow portion in order to improve the contrast of the shadow portion, as distinguished from the non-shadow portion. However, as a result of experiments by the present inventor, even if the already known processing such as uniformity of density histogram or linear transformation or non-linear transformation, which is a conventional contrast improvement measure, is applied only to the shaded portion, the image obtained is It has been found that the contrast is too high or too low to provide an appropriate contrast. Therefore, the present inventor has come to consider that a new contrast improving method suitable for improving the contrast of a specific image portion where a low density image called a shadow portion is most desirable.

更に、発明者の検討の結果、非陰影部と区別して陰影部のみにコントラスト改善処理を施した場合、コントラスト改善後の陰影部の画像が不自然になる場合があることが判明した。特に、陰影部を検出するために使用する2値化のための閾値に近い濃度の領域の画像の濃度が近傍の領域に対して不連続になる場合があることが判明した。すなわち、陰影部として検出される領域と、そうでない領域との境界で濃度の不連続が生じることが分かった。更に、この問題は陰影部に対して施すコントラスト改善方法の種類によらないで生じることが分かった。例えば、従来の濃度ヒストグラムの均一化あるいは線形変換を陰影部のみに対して行ったときにも生じる場合があることが分かった。   Further, as a result of the inventor's investigation, it has been found that when the contrast improvement process is performed only on the shadow part as distinguished from the non-shadow part, the image of the shadow part after the contrast improvement may become unnatural. In particular, it has been found that the density of an image in an area having a density close to the threshold for binarization used for detecting a shadow portion may be discontinuous with respect to an adjacent area. That is, it has been found that density discontinuity occurs at the boundary between the region detected as the shadow portion and the region that is not. Further, it has been found that this problem occurs regardless of the type of contrast improvement method applied to the shadow portion. For example, it has been found that this may occur even when conventional density histogram equalization or linear conversion is performed only on the shaded portion.

陰影部の画像の視認性の問題及び上記濃度の不連続は、画像がモノクロ濃淡画像とカラー画像のいずれの場合にも生じる問題であることが判明した。したがって、本明細書では、両方の画像の明るさを表す画像値として明度を使用する。明度は、画像がモノクロの濃淡画像の場合には、その濃度自体である。画像がカラー画像の場合には、その画像の各画素の画像値として当該カラー画像から決定され、色相と彩度と組にして使用される明度を、本発明での明度として使用可能である。画像の明度は、明るい画像部分では値が大きいあるいは高いと呼び、暗い画像部分では値が小さいあるいは低いと呼ぶことにする。画像の明度に代えて濃度を議論するときも同様とする。   It has been found that the visibility problem of the shadow image and the discontinuity of the density are problems that occur when the image is a monochrome grayscale image or a color image. Therefore, in this specification, brightness is used as an image value representing the brightness of both images. The brightness is the density itself when the image is a monochrome grayscale image. When the image is a color image, the lightness determined from the color image as the image value of each pixel of the image and used in combination with the hue and the saturation can be used as the lightness in the present invention. The brightness of an image is called a value that is large or high in a bright image portion, and is called a value that is small or low in a dark image portion. The same applies when discussing density instead of image brightness.

したがって、本発明の目的は、非陰影部と区別して陰影部に対して明度のコントラスト改善処理を施した場合に生じる、2値化のための閾値に近い明度の領域とその近傍の領域との間で生じる明度の不連続とそれによる画像の不自然さを低減できる、陰影部のコントラストの改善方法及び陰影部のコントラストを改善可能なプログラムを提供することである。   Therefore, an object of the present invention is to generate a brightness area close to a threshold for binarization and a neighboring area, which occurs when brightness contrast improvement processing is performed on a shadow area in distinction from a non-shadow area. It is to provide a method for improving the contrast of a shadow part and a program capable of improving the contrast of a shadow part, which can reduce discontinuity of brightness occurring between them and unnaturalness of an image caused thereby.

本発明の他の目的は、従来のコントラスト改善方法よりも効果的に陰影部のコントラストを改善でき、更に、陰影部のコントラストの改善後に生じる、2値化のための閾値に近い明度の領域とその近傍の領域との間で生じる明度の不連続を低減できる、陰影部のコントラストの改善方法及び陰影部のコントラストを改善可能なプログラムを提供することである。   Another object of the present invention is to improve the shadow contrast more effectively than the conventional contrast improvement method, and further, a brightness region close to the threshold for binarization, which occurs after the shadow contrast improvement, To provide a method for improving the contrast of a shadow part and a program capable of improving the contrast of a shadow part, which can reduce the lightness discontinuity occurring between the adjacent areas.

上記目的を達成するために、本発明は、陰影部として検出された領域のうち、非陰影部として検出された領域に隣接する境界隣接領域内の複数の画素の明度をコントラスト改善のための値にいきなり変化させないで、当該境界隣接領域内の複数の画素の明度に対してグラデーション処理を施し、その処理により上記境界隣接領域内の複数の画素の明度を境界から離れるにしたがって、元の 明度変換前の明度に近い明度から明度変換後の明度に近い明度に変化させるものである。   In order to achieve the above object, the present invention provides a value for improving contrast of brightness of a plurality of pixels in a boundary adjacent region adjacent to a region detected as a non-shadow portion among regions detected as a shadow portion. Without changing suddenly, gradation processing is applied to the brightness of the pixels in the border adjacent area, and as the brightness of the pixels in the border adjacent area is moved away from the boundary, the original brightness conversion is performed. The brightness is changed from the brightness close to the previous brightness to the brightness close to the brightness after the brightness conversion.

より具体的には、請求項1に記載の陰影部のコントラストを改善可能なプログラムは、明度画像内の陰影部が存在する陰影部領域を検出する陰影部領域検出手段と、前記検出された陰影部領域内の複数の画素の明度に対して、前記陰影部領域のコントラストを改善するための明度を所定の明度変換規則にしたがって決定し、前記複数の画素の明度を当該決定された明度に変換する陰影部領域明度変換手段と、前記明度画像内の前記陰影部領域内の、非陰影部が存在する非陰影部領域との境界に隣接して位置する境界隣接領域内の一群の境界近傍画素に対してグラデーション処理を実行するグラデーション処理手段、としてコンピュータを機能させるものである。更に、前記グラデーション処理は、前記一群の境界近傍画素に対して一群の更に改善された明度を決定し、前記一群の境界近傍画素の明度を、前記陰影部領域明度変換手段により決定された一群の明度に代えて当該一群の更に改善された明度に変更する処理である。更に、当該一群の更に改善された明度は、前記一群の境界近傍画素のそれぞれの位置が前記境界から前記陰影部領域の内部に向けて離れるにつれて、それぞれの境界近傍画素の前記陰影部領域明度変換手段により決定される前の明度に近い明度からそれぞれの境界近傍画素の前記陰影部領域明度変換手段により決定された後の明度に近い明度に変化するものである。   More specifically, the program capable of improving the contrast of the shadow portion according to claim 1 includes a shadow portion region detecting means for detecting a shadow portion region where the shadow portion in the brightness image exists, and the detected shadow portion. The brightness for improving the contrast of the shaded area is determined according to a predetermined brightness conversion rule with respect to the brightness of a plurality of pixels in the partial area, and the brightness of the plurality of pixels is converted to the determined brightness. A group of pixels in the vicinity of the boundary in the boundary adjacent region located adjacent to the boundary between the shaded region brightness conversion means and the non-shadowed region where the non-shadowed portion exists in the shaded region in the brightness image. The computer is made to function as gradation processing means for executing gradation processing on the computer. Further, the gradation processing determines a group of further improved brightness values for the group of boundary neighboring pixels, and sets the brightness values of the group of boundary neighboring pixels to a group of groups determined by the shadow area lightness conversion means. It is the process which changes to the improved brightness of the said group instead of the brightness. Further, the improved brightness of the group is obtained by converting the brightness of the shaded area of each boundary neighboring pixel as the position of each of the neighboring pixels of the group moves away from the boundary toward the inside of the shaded area. The lightness close to the lightness before being determined by the means changes from the lightness close to the lightness before the lightness to the lightness close to the lightness after being determined by the shade area lightness conversion means of each of the pixels near the boundary.

ここで上記明度は、画像の明るさを表す画像値であり、画像がモノクロ濃淡画像の場合には濃度自体である。画像がカラー画像の場合には、その画像の各画素の画像値として当該カラー画像から決定され、色相と彩度と組にして使用される明度を上記明度として使用可能である。上記発明により、画像の陰影部領域に対してコントラストを向上するための明度を決定した後に、前記陰影部領域内の上記境界隣接領域内の一群の境界近傍画素の明度は、グラデーション処理により、一群の境界近傍画素のそれぞれの位置が前記境界から前記陰影部領域の内部に向けて離れるにつれて、それぞれの境界近傍画素の前記陰影部領域明度変換手段により明度が決定される前の明度に近い値からそれぞれの境界近傍画素の前記陰影部領域明度変換手段により決定された後の明度に近い値に変化するように変更される。したがって、陰影部領域と非陰影部領域との境界付近にある陰影部領域内の画素の明度は、陰影部領域明度変換手段により明度が決定される前の明度に近く、一方、上記境界より内部の画素の明度は、陰影部領域明度変換手段により決定された明度に近い明度になる。したがって、陰影部領域の境界隣接領域内では明度は急激には変化しない。こうして、2値化閾値に近い部分とその近傍との間では、明度の不連続は低減される。なお、上記発明は、カラー画像にも適用できる利点がある。   Here, the lightness is an image value representing the brightness of the image, and is the density itself when the image is a monochrome grayscale image. When the image is a color image, the lightness that is determined from the color image as the image value of each pixel of the image and is used in combination with hue and saturation can be used as the lightness. According to the above invention, after determining the brightness for improving the contrast with respect to the shadow area of the image, the brightness of the group of pixels near the boundary in the boundary adjacent area in the shadow area is determined by gradation processing. As the respective positions of the pixels in the vicinity of the boundary move away from the boundary toward the inside of the shaded area, the values near the brightness before the brightness is determined by the shaded area lightness conversion means of the pixels in the vicinity of the boundary. The value is changed so as to change to a value close to the lightness after being determined by the shaded area lightness conversion means of each boundary vicinity pixel. Therefore, the brightness of the pixels in the shaded area near the boundary between the shaded area and the non-shadowed area is close to the brightness before the brightness is determined by the shaded area brightness conversion means. The brightness of this pixel is close to the brightness determined by the shadow area brightness conversion means. Therefore, the brightness does not change abruptly in the boundary adjacent region of the shadow region. In this way, the lightness discontinuity is reduced between the portion close to the binarization threshold and the vicinity thereof. The above invention has an advantage that can be applied to a color image.

請求項2に記載の陰影部のコントラストを改善可能なプログラムは、請求項1において、前記境界隣接領域を前記境界からの距離に依存して複数のグラデーション領域に分割する境界隣接領域分割手段としてコンピュータを更に機能させるものである。更に、前記グラデーション処理は、各グラデーション領域内の複数の画素のそれぞれに対して、前記陰影部領域明度変換手段により明度が決定される前のそれぞれの画素の明度と、前記陰影部領域明度変換手段により決定されたそれぞれの画素の明度と、前記境界から当該グラデーション領域までの距離に依存してあらかじめ決定された当該グラデーション領域用の重みとを用いて、当該グラデーション領域内のそれぞれの画素のための前記更に改善された明度を決定するものである。これにより、境界隣接領域内での画素の明度を、陰影部内の画素の位置が内部になるにしたがい、陰影部領域明度変換手段による明度の決定前のその画素の明度に近い明度から前記陰影部領域明度変換手段により決定されたその画素の明度に近い明度まで漸次変化させることを、簡単な処理により実現できる。   The program capable of improving the contrast of the shadow portion according to claim 2 is a computer as boundary adjacent region dividing means according to claim 1, wherein the boundary adjacent region is divided into a plurality of gradation regions depending on a distance from the boundary. Is made to function further. Further, the gradation processing includes, for each of a plurality of pixels in each gradation area, the brightness of each pixel before the brightness is determined by the shadow area brightness conversion means, and the shadow area brightness conversion means. For each pixel in the gradation area, using the brightness of each pixel determined by and the weight for the gradation area determined in advance depending on the distance from the boundary to the gradation area. The further improved brightness is determined. As a result, the brightness of the pixel in the border adjacent region is determined based on the lightness close to the brightness of the pixel before the lightness is determined by the shadow region lightness conversion means in accordance with the position of the pixel in the shadow portion. The gradual change to the lightness close to the lightness of the pixel determined by the region lightness conversion means can be realized by a simple process.

請求項3に記載の陰影部のコントラストを改善可能なプログラムは、請求項1又は2において、前記検出された陰影部領域内の複数の画素に関する明度ヒストグラムを検出するヒストグラム検出手段と、検出された明度ヒストグラムから、当該陰影部領域に関する改善されたコントラストを表す目標明度ヒストグラムを決定する目標ヒストグラム決定手段、としてコンピュータを更に機能させるものである。
更に、前記陰影部領域明度変換手段により実行される前記所定の明度変換規則は、前記陰影部領域に関する改善後の明度ヒストグラムがほぼ前記目標明度ヒストグラムになるように、前記検出された陰影部領域内の複数の画素の明度を変換するための変換規則である。更に、前記目標ヒストグラム決定手段は、前記明度画像に対してあらかじめ定められた最大明度から最小明度までの範囲に拡大されるべき、前記明度ヒストグラムの中央領域を前記明度ヒストグラムに基づいて決定する中央領域決定手段と、前記明度ヒストグラムの前記中央領域を、前記最大明度から最小明度までの範囲に分布する拡大ヒストグラムに拡大する中央領域拡大手段と、前記明度ヒストグラムのうち、前記決定された中央領域より小さい明度に対するヒストグラム下側領域と、前記中央領域より大きい明度に対するヒストグラム上側領域とを組み合わせて、前記最小明度から前記最大明度までの明度範囲に画素が分布する組合せヒストグラムに変換し、当該変換で生成された前記組合せヒストグラムを前記中央領域変換手段により生成される前記拡大ヒストグラムと合成して前記目標明度ヒストグラムを生成する上下側領域拡大手段と、を備えるものである。
According to a third aspect of the present invention, there is provided a program capable of improving the contrast of the shadow portion according to the first or second aspect, and a histogram detection means for detecting a lightness histogram relating to a plurality of pixels in the detected shadow portion region. The computer is further caused to function as target histogram determination means for determining a target brightness histogram representing an improved contrast related to the shaded area from the brightness histogram.
Further, the predetermined lightness conversion rule executed by the shadow area lightness conversion means is that the improved lightness histogram related to the shadow area is substantially equal to the target lightness histogram. Is a conversion rule for converting the brightness of a plurality of pixels. Further, the target histogram determining means determines a central region of the lightness histogram to be expanded in a range from a predetermined maximum lightness to a minimum lightness for the lightness image based on the lightness histogram. Determining means; central area enlarging means for enlarging the central area of the brightness histogram into an enlarged histogram distributed in a range from the maximum brightness to the minimum brightness; and smaller than the determined central area of the brightness histogram A histogram lower region for lightness and a histogram upper region for lightness greater than the central region are combined to convert to a combined histogram in which pixels are distributed in the lightness range from the minimum lightness to the maximum lightness, and generated by the conversion The combined histogram is converted by the central area converting means. And upper and lower region growing means for generating the target intensity histogram by combining with the expanded histogram generated, in which comprises a.

これにより、陰影部領域の明度ヒストグラムに基づいて、陰影部領域の改善後の目標ヒストグラムを決定でき、陰影部領域の明度のコントラストをこの目標ヒストグラムとなるように改善することができる。更に、陰影部領域の明度変換前の明度ヒストグラムの中央領域を、画像が持ちうる最小明度から最大明度までに分布するように拡大することができ、更に、この拡大対象から除外されたヒストグラム下側領域とヒストグラム上側領域を組み合わせて、最小明度から最大明度までの範囲に画素が分布する組み合わせヒストグラムに変換し、そのヒストグラムを上記拡大ヒストグラムと合成して目標ヒストグラムとするので、陰影部領域の明度を、元のヒストグラム下側領域とヒストグラム上側領域に属する明度を有していた画素の情報を除去しないで、かつ、明度の分布範囲を最小明度から最大明度までの範囲に拡大でき、陰影部領域の明度のコントラストを改善することが可能になる。更に、コントラストを改善した陰影部に関して、請求項1から3の少なくとも一つについて上に説明した効果も生じる。   As a result, the target histogram after improvement of the shadow area can be determined based on the brightness histogram of the shadow area, and the brightness contrast of the shadow area can be improved to become this target histogram. Furthermore, the central area of the lightness histogram of the shadow area before lightness conversion can be expanded so that it is distributed from the minimum lightness to the maximum lightness that the image can have. The area and the upper area of the histogram are combined to convert to a combined histogram in which pixels are distributed in the range from the minimum brightness to the maximum brightness, and the histogram is combined with the enlarged histogram to obtain the target histogram. The brightness distribution range can be expanded from the minimum brightness to the maximum brightness without removing the information of the pixels having the brightness belonging to the original lower histogram area and the upper histogram area, and the shadow area can be expanded. It becomes possible to improve brightness contrast. Furthermore, the effect described above with respect to at least one of claims 1 to 3 is also produced with respect to the shaded portion with improved contrast.

請求項4に記載の陰影部のコントラストを改善可能なプログラムは、請求項1から3のいずれか一つにおいて、前記プログラムは、前記明度画像を複数のブロックに分割する領域分割手段としてコンピュータを更に機能させるプログラムであり、前記陰影部領域明度変換手段は、前記複数のブロックのそれぞれ毎に、それぞれに含まれた陰影部領域のコントラストを改善するための明度を決定するものである。これにより、陰影部領域のコントラストをブロック毎にブロックに合わせて改善できる。   According to a fourth aspect of the present invention, there is provided the program capable of improving the contrast of the shadow portion according to any one of the first to third aspects. The shaded area brightness conversion means determines brightness for improving the contrast of the shaded area included in each of the plurality of blocks. Thereby, the contrast of a shadow part area | region can be improved according to a block for every block.

本発明によれば、明度画像から検出された非陰影部領域と区別して、検出された陰影部領域に対してコントラスト改善処理を施した場合に生じる、2値化閾値に近い部分とその近傍との間に生じる明度の不連続を減少できる。
更に、本発明の望ましい態様では、従来のコントラスト改善方法よりも効果的に陰影部のコントラストを改善でき、更に、陰影部のコントラストの改善により生じる、2値化閾値に近い部分とその近傍との間に生じる明度の不連続を減少できる。
According to the present invention, a portion close to the binarization threshold and its vicinity, which are generated when the contrast improvement processing is performed on the detected shadow portion region, distinguished from the non-shadow portion region detected from the brightness image, Lightness discontinuities that occur during
Furthermore, in a desirable aspect of the present invention, the contrast of the shadow portion can be improved more effectively than the conventional contrast improvement method, and further, the portion near the binarization threshold value and the vicinity thereof caused by the improvement of the contrast of the shadow portion. Lightness discontinuities that occur in between can be reduced.

以下、本発明に係る陰影部のコントラストを改善可能なプログラム及び陰影部のコントラストの改善方法の実施の形態を図面を参照して詳細に説明する。
図1は、本発明に係る、画像の陰影部のコントラストを改善可能な装置の一つの実施形態の概略ブロック図である。符号1は、上記装置の一つの実施の形態の全体を指す。本装置1は、例えばパソコン又はワークステーションにより実現される処理装置10と、メインメモリとして使用されるRAM(ランダムアクセスメモリ)(図示せず)及び磁気ディスク記憶装置のような補助記憶装置(図示せず)とを含む記憶装置20と、入出力装置30とを備えている。入出力装置30は、キーボード及びマウス等のポインティングデバイスを含む入力装置31と、CRTディスプレイ装置等の表示装置32又はプリンタ33などの出力装置を備えている。入力装置31はパラメータの入力やコマンドの起動などに使われる。表示装置32又はプリンタ33は、陰影部のコントラストを改善すべき画像あるいは当該画像から生成された陰影部のコントラストが改善された画像などの表示又は印字に使われる。記憶装置20内にデータが記憶されるときに、当該データが図示しないRAMと図示しない補助記憶装置のいずれに記憶されるかは、あらかじめ当該データ毎に決められている。
Embodiments of a program capable of improving the contrast of a shadow portion and a method for improving the contrast of a shadow portion according to the present invention will be described below in detail with reference to the drawings.
FIG. 1 is a schematic block diagram of one embodiment of an apparatus capable of improving the contrast of a shaded portion of an image according to the present invention. Reference numeral 1 denotes the whole of one embodiment of the apparatus. The apparatus 1 includes, for example, a processing device 10 realized by a personal computer or a workstation, and a RAM (Random Access Memory) (not shown) used as a main memory and an auxiliary storage device (not shown) such as a magnetic disk storage device. And the input / output device 30. The input / output device 30 includes an input device 31 including a pointing device such as a keyboard and a mouse, and an output device such as a display device 32 such as a CRT display device or a printer 33. The input device 31 is used for inputting parameters and starting commands. The display device 32 or the printer 33 is used to display or print an image for which the contrast of a shadow portion should be improved or an image generated from the image with an improved contrast of the shadow portion. When data is stored in the storage device 20, it is determined in advance for each piece of data whether the data is stored in a RAM (not shown) or an auxiliary storage device (not shown).

陰影部のコントラストを改善可能なプログラムは、記憶装置20に記憶され処理装置10に組み込まれ実行されるが、図では分かりやすさのために、本プログラム40とそれを構成する複数のモジュールを処理装置10を示すブロックの内部に記載している。陰影部のコントラストを改善可能なプログラム40は、カラー形式変換部100と、陰影部領域検出部200と、陰影部領域明度変換部300と、グラデーション処理部400と、カラー形式逆変換部500というモジュールを含む。陰影部領域明度変換部300は、陰影部領域ヒストグラム検出部600と、目標ヒストグラム生成部700と、明度変換部800というモジュールを含む。グラデーション処理部400は、グラデーション領域決定部900と、グラデーション処理実行部950というモジュールを含む。   The program capable of improving the contrast of the shadow portion is stored in the storage device 20 and is executed by being incorporated in the processing device 10, but for the sake of easy understanding in the figure, the program 40 and a plurality of modules constituting the program 40 are processed. It is described inside the block showing the device 10. The program 40 capable of improving the contrast of the shadow portion includes a color format conversion unit 100, a shadow region detection unit 200, a shadow region brightness conversion unit 300, a gradation processing unit 400, and a color format reverse conversion unit 500. including. The shadow area brightness conversion unit 300 includes a shadow area histogram detection unit 600, a target histogram generation unit 700, and a brightness conversion unit 800. The gradation processing unit 400 includes modules called a gradation region determination unit 900 and a gradation processing execution unit 950.

処理装置10は、プログラム40内のそれぞれのモジュールが実行されたときに、カラー画像情報を変換する機能ブロックと、陰影部領域を検出する機能ブロックと、陰影部領域のコントラストを改善するように陰影部領域の明度を変換する機能ブロックと、非陰影部領域との境界に位置する、陰影部領域内の境界隣接領域に対して、明度の急激な変化を防止するためのグラデーション処理を実行する機能ブロックと、カラー画像情報を逆変換する機能ブロックという複数の機能ブロックとしてコンピュータを動作させる。したがって、処理装置10とプログラム40のこれらのモジュールにより、それぞれのモジュールに対応する複数の機能ブロックが実現されることになる。したがって、処理装置10と、記憶装置20と、入出力装置30と、カラー形式変換部100、陰影部領域検出部200、陰影部領域明度変換部300と、グラデーション処理部400と、カラー形式逆変換部500は、本発明に係る。画像の陰影部のコントラストを改善可能な装置の一つの実施の形態を実現することになる。   When each module in the program 40 is executed, the processing apparatus 10 has a functional block for converting color image information, a functional block for detecting a shadow area, and a shadow so as to improve the contrast of the shadow area. Function to execute a gradation process to prevent a sudden change in brightness on the border adjacent area in the shadow area located at the boundary between the function block that converts the brightness of the partial area and the non-shadow area The computer is operated as a plurality of functional blocks called blocks and functional blocks for inversely converting color image information. Therefore, a plurality of functional blocks corresponding to each module are realized by these modules of the processing apparatus 10 and the program 40. Therefore, the processing device 10, the storage device 20, the input / output device 30, the color format conversion unit 100, the shadow region detection unit 200, the shadow region brightness conversion unit 300, the gradation processing unit 400, and the color format inverse conversion. The part 500 relates to the present invention. One embodiment of the apparatus capable of improving the contrast of the shadow portion of the image is realized.

プログラム40は、本発明に係る、陰影部のコントラストを改善可能なプログラムの一つの実施の形態を実現するものであり、記録媒体に記録してあるいはネットワークを介して記憶装置20に記憶され処理装置10で実行される。プログラム40は、記録媒体に記録されて又はネットワークを介して販売可能である。処理装置10がプログラム40を実行して陰影部のコントラストを改善する手順は、本発明に係る陰影部のコントラストの改善方法の一つの実施の形態を実現する。   The program 40 realizes one embodiment of a program according to the present invention that can improve the contrast of a shadow portion, and is recorded on a recording medium or stored in the storage device 20 via a network and is processed. 10 is executed. The program 40 can be recorded on a recording medium or sold via a network. The procedure in which the processing device 10 executes the program 40 to improve the contrast of the shadow portion realizes one embodiment of the method for improving the contrast of the shadow portion according to the present invention.

記憶装置20には、あらかじめ陰影部のコントラストを改善する対象とするカラー画像データ21が記憶され、カラー画像データ21をプログラム40により処理して、明度データ(以下、改善対象明度データと呼ぶことがある)22と、彩度データ22Aと、色相データ22Bと、2値画像データ23Aと、陰影部領域データ23Bと、実ヒストグラムデータ24Aと、目標ヒストグラムデータ24Bと、明度変換データ25と、コントラスト改善後明度データ26と、グラデーション領域データ27と、グラデーション処理後明度データ28と、改善後カラー画像データ29が生成され、記憶装置20に格納される。以下では断らない限り、本実施の形態では、カラー画像データ21は、カラーの多値画像のデータであると仮定する。より具体的には、本実施の形態では、陰影部を含む画像の例として、例えば人工衛星や航空機等の高度飛翔体から地表を撮影して得られたカラーの地理画像が使用される。   The storage device 20 stores in advance color image data 21 that is a target for improving the contrast of the shadow portion, and the color image data 21 is processed by the program 40 to obtain brightness data (hereinafter referred to as improvement target brightness data). 22), saturation data 22A, hue data 22B, binary image data 23A, shadow area data 23B, actual histogram data 24A, target histogram data 24B, brightness conversion data 25, and contrast improvement. Post-brightness data 26, gradation area data 27, post-gradation lightness data 28, and improved color image data 29 are generated and stored in the storage device 20. In the present embodiment, it is assumed that the color image data 21 is color multi-valued image data unless otherwise specified. More specifically, in the present embodiment, as an example of an image including a shadow portion, a color geographic image obtained by photographing the ground surface from an altitude flying object such as an artificial satellite or an aircraft is used.

プログラム40の処理の概要は以下のとおりである。当該地理画像を表すカラー画像データ21を変換して改善対象明度データ22と、彩度データ22Aと、色相データ22Bを生成する。当該改善対象明度データ22から、画像内の陰影部を含む陰影部領域を検出し、当該陰影部領域を表す陰影部領域データ23Bを生成する。生成された陰影部領域データ23Bが示す当該陰影部領域に含まれる複数の画素の明度に関する実ヒストグラムデータ24Aを検出し、その実ヒストグラムデータ24Aから、コントラストが改善された目標とする目標ヒストグラムデータ24Bを決定する。当該陰影部領域の前記複数の画素の明度を変換するための明度変換データ25を、前記検出された実ヒストグラムデータ24Aと前記決定された目標ヒストグラムデータ24Bとに依存して生成し、生成された明度変換データ25に基づいて前記陰影部領域内の前記複数の画素の明度を変換してコントラスト改善後明度データ26を生成する。   The outline of the processing of the program 40 is as follows. The color image data 21 representing the geographic image is converted to generate improvement target lightness data 22, saturation data 22A, and hue data 22B. From the improvement target lightness data 22, a shadow part region including a shadow part in the image is detected, and shadow part region data 23B representing the shadow part region is generated. Actual histogram data 24A relating to the brightness of a plurality of pixels included in the shaded area indicated by the generated shaded area data 23B is detected, and target histogram data 24B with improved contrast is obtained from the actual histogram data 24A. decide. Lightness conversion data 25 for converting the lightness of the plurality of pixels in the shadow area is generated depending on the detected actual histogram data 24A and the determined target histogram data 24B. Based on the lightness conversion data 25, the lightness of the plurality of pixels in the shaded area is converted to generate post-contrast lightness data 26.

上記陰影部領域データ23Bが示す当該陰影部領域内の、非陰影部領域との境界に隣接する境界隣接領域に位置する、グラデーション処理を実行すべき複数のグラデーション領域を決定し、それぞれのグラデーション領域を指定するグラデーション領域データ27を生成する。複数のグラデーション領域は、例えば、上記境界隣接領域内の、上記境界から陰影部領域の内部に向けて異なる距離に位置するように決定される。上記グラデーション領域データ27が指定する上記複数のグラデーション領域に対応してあらかじめ決定された重みに応じて、上記コントラスト改善後明度データ26内の、上記境界隣接領域の明度を変換し、グラデーション処理後明度データ28を生成する。そのグラデーション処理後明度データ28と、上記彩度データ22Aと、上記色相データ22Bとを合成して、改善後カラー画像データ29を生成する。   A plurality of gradation areas to be subjected to gradation processing are determined, which are located in a boundary adjacent area adjacent to the boundary with the non-shadow area in the shadow area indicated by the shadow area data 23B, and each gradation area is determined. The gradation area data 27 for designating is generated. For example, the plurality of gradation areas are determined to be located at different distances from the boundary toward the inside of the shadow area in the boundary adjacent area. In accordance with the weight determined in advance corresponding to the plurality of gradation areas specified by the gradation area data 27, the brightness of the border adjacent area in the brightness data after contrast improvement 26 is converted, and the brightness after gradation processing is converted. Data 28 is generated. The post-gradation lightness data 28, the saturation data 22A, and the hue data 22B are combined to generate improved color image data 29.

図2は、改善対象明度データ21が示す地理画像の一例を示す図である。この地理画像は、人工衛星により地上を撮影して得られた実際の地理画像である。この画像内には複数のビルが存在し、道路が複数の箇所に存在し、複数の自動車が路上に存在している。図では、陰影部でないところでは、太陽光が直接照射されていて、明度が非常に高いが、一方、明度が低い陰影部がビルの壁面あるいは路上の多くの場所に存在している。陰影部の内部はほとんど識別できないくらい明度のコントラストが少ない。画像全体としては、明度の分布は非常に広く、陰影部が非常にコントラストが低い状態にあり、陰影部の視認性が低い。   FIG. 2 is a diagram illustrating an example of a geographic image indicated by the improvement target brightness data 21. This geographic image is an actual geographic image obtained by photographing the ground with an artificial satellite. In this image, there are a plurality of buildings, roads exist at a plurality of locations, and a plurality of automobiles exist on the road. In the figure, sunlight is directly radiated where it is not a shaded part, and the brightness is very high. On the other hand, a shaded part with a low brightness exists in many places on the wall surface of the building or on the road. The contrast of lightness is so small that the inside of the shaded part is hardly discernable. As a whole image, the brightness distribution is very wide, the shadow portion is in a very low contrast state, and the visibility of the shadow portion is low.

図30は従来技術による明度ヒストグラムの線形変換とその問題点を説明するための図である。線形変換は、同図(a)に示すように明度ヒストグラムの明度の分布範囲[a+1,b−1]を、拡大された明度の分布範囲[a',b']に変換することにより明度のコントラストを拡大する手法である。任意の画素の明度i(a+1≦i≦b−1)が明度i'(a'≦i'≦b')に変換される。例えば、同図(b)の明度ヒストグラムに示すように、画像の明度の範囲が実質的に明度の分布範囲[a+1,b−1]内である場合、a'=0、b'=MAX(最高の明度)のときは、変換後の明度の範囲[a',b']は、同図(c)のヒストグラムに示すように、明度の最大の分布範囲[0,MAX]となり、明度のコントラストが改善される。   FIG. 30 is a diagram for explaining the linear conversion of the brightness histogram according to the prior art and its problems. In the linear conversion, the brightness distribution range [a + 1, b−1] of the brightness histogram is converted into an enlarged brightness distribution range [a ′, b ′] as shown in FIG. This is a technique for enlarging contrast. The lightness i (a + 1 ≦ i ≦ b−1) of an arbitrary pixel is converted into lightness i ′ (a ′ ≦ i ′ ≦ b ′). For example, as shown in the brightness histogram of FIG. 4B, when the brightness range of the image is substantially within the brightness distribution range [a + 1, b−1], a ′ = 0, b ′ = MAX ( In the case of (maximum brightness), the converted brightness range [a ′, b ′] is the maximum brightness distribution range [0, MAX] as shown in the histogram of FIG. Contrast is improved.

図31は、陰影部と明るい非陰影部を含む画像の明度ヒストグラムとその画像に対する従来技術による線形変換を行った結果得られる画像の明度ヒストグラムを模式的に示す図である。同図(a)は、陰影部と明るい非陰影部を含む画像(例えば図2)に対する明度ヒストグラムを模式的に示す図であり、同図(b)は、この明度ヒストグラムに対して線形変換をした結果得られる明度ヒストグラムの例を示す図である。同図(a)から分かるように、図2に例示したような画像では、陰影部の明度の最小値a+1も、画像が取りうる明度の最小値0に近く、かつ非陰影部の明度の最大値b−1も、画像が取りうる明度の最大値MAXに近い。このような画像に線形変換を施しても、得られる明度ヒストグラムの明度の分布範囲は、図31(b)に示すように、同図(a)に示した元の明度の分布範囲に比べてそれほど大きくは拡大されない。したがって、図2のような画像に対しては、従来の線形変換では、陰影部のコントラストの改善は難しい。   FIG. 31 is a diagram schematically illustrating a lightness histogram of an image including a shadow portion and a bright non-shaded portion and a lightness histogram of an image obtained as a result of performing linear conversion on the image according to the related art. FIG. 6A is a diagram schematically showing a brightness histogram for an image (for example, FIG. 2) including a shadow portion and a bright non-shadow portion, and FIG. It is a figure which shows the example of the brightness histogram obtained as a result. As can be seen from FIG. 2A, in the image illustrated in FIG. 2, the minimum brightness value a + 1 of the shadow portion is close to the minimum brightness value 0 that the image can take and the maximum brightness value of the non-shadow portion is obtained. The value b-1 is also close to the maximum brightness value MAX that the image can take. Even if such an image is subjected to linear transformation, the brightness distribution range of the brightness histogram obtained is larger than the original brightness distribution range shown in FIG. 31A, as shown in FIG. It is not enlarged so much. Therefore, for the image as shown in FIG. 2, it is difficult to improve the contrast of the shadow portion by the conventional linear conversion.

また、ダイナミックレンジの拡大のために、線形変換する明度の分布範囲[a+1,b−1]を図31(a)内の画素が現に存在する明度範囲のうちの一部の範囲に制限して、その範囲内の画素のみの明度を明度の最大の範囲[0,MAX]に変換することも考えられるが、この場合には、明度iがi≦a+1となる明度の画素は処理後に明度が0となり、つぶれという現象が起きる。また、b−1≦iとなる明度の画素は処理後に明度がMAXとなり、白とびという現象が起きる。白とびとつぶれが起きるとその部分の情報が失われるという問題がある。
一方、従来の明度ヒストグラムの均一化では、得られる画像は明度のコントラストが強すぎ、ノイズも多く発生して見にくい画像になってしまう。
Further, in order to expand the dynamic range, the brightness distribution range [a + 1, b−1] to be linearly converted is limited to a part of the brightness range in which the pixels in FIG. It is also conceivable to convert the lightness of only the pixels within the range to the maximum lightness range [0, MAX]. In this case, the lightness pixel whose lightness i is i ≦ a + 1 has a lightness after processing. It becomes 0 and the phenomenon of crushing occurs. In addition, a pixel of brightness that satisfies b-1 ≦ i has a brightness of MAX after processing, and a phenomenon of overexposure occurs. There is a problem that information on the part is lost when overexposure occurs.
On the other hand, with the conventional uniformity of the brightness histogram, the obtained image has too high brightness contrast, and a lot of noise is generated, resulting in an image that is difficult to see.

本発明では、図2のような画像に含まれたコントラストが低い陰影部の視認性を向上するために、陰影部が存在する陰影部領域を検出して、その陰影部領域内の画素の明度を、陰影部のコントラストを向上させるように変換する。なお、本実施の形態では、画像全体を陰影部と非陰影部の2つの領域に分け、陰影部領域に対してコントラストを改善する処理を施す方法を採る。しかし、画像によっては陰影部領域内の画素の明度の分布が場所によって大きく異なる場合もあり得る。その場合には、陰影部領域を複数のブロックに分割して各ブロック毎に、そのブロック内の陰影部領域のコントラストを向上するための処理を当該陰影部領域に施しても良い。   In the present invention, in order to improve the visibility of a shadow part with a low contrast included in the image as shown in FIG. 2, the shadow part area where the shadow part exists is detected, and the brightness of the pixels in the shadow part area is detected. Is converted so as to improve the contrast of the shadow portion. In the present embodiment, a method is adopted in which the entire image is divided into two areas, a shadow area and a non-shadow area, and a process for improving the contrast is performed on the shadow area. However, depending on the image, the brightness distribution of the pixels in the shaded area may vary greatly depending on the location. In that case, the shadow area may be divided into a plurality of blocks, and processing for improving the contrast of the shadow area in each block may be performed for each block.

図1に戻り、プログラム40は、まずカラー形式変換部100を実行する。図3はR、G、Bの3原色に関するカラー画像情報でカラー画像を定義するRGBカラーモデルを示す図である。カラー画像データ21は、図3に示すRGBカラーモデルで定義されたR、G、Bの3原色に関するカラー画像情報を有するデータであると仮定する。ここで、R、G、Bは、値0から1の範囲を有すると仮定する。カラー形式変換部100は、カラー画像データ21のRGBカラー画像情報を、色相(H)、明度(I)、彩度(S)からなるHIS空間のカラー画像情報に変換して、改善対象明度データ22、彩度データ22A、色相データ22Bを生成する。HISの明度Iは明度Lと呼ばれることもある。   Returning to FIG. 1, the program 40 first executes the color format conversion unit 100. FIG. 3 is a diagram showing an RGB color model that defines a color image with color image information relating to the three primary colors R, G, and B. The color image data 21 is assumed to be data having color image information regarding the three primary colors R, G, and B defined by the RGB color model shown in FIG. Here, it is assumed that R, G, and B have values ranging from 0 to 1. The color format conversion unit 100 converts the RGB color image information of the color image data 21 into color image information in the HIS space consisting of hue (H), lightness (I), and saturation (S), and the lightness data to be improved. 22. Saturation data 22A and hue data 22B are generated. The lightness I of the HIS is sometimes called lightness L.

図4は、カラー画像情報を定義される双六角錐カラーモデルを示す図である。本実施の形態では、HIS空間のカラー画像情報として、図4に示す双六角錐カラーモデルで定義されるカラー画像情報を使用する。ここで、Hは色相であり、0〜360度の値を採る。Iは明度であり、0〜1の実数値を採る。Sは彩度であり、0〜1の値を採る。以下では、図2は、カラー形式変換部100により生成された改善対象明度データ22の一例が示す地理画像であるとする。なお、明度Iはカラー画像の明るさの成分を表しており、カラー画像情報から生成されたモノクロ画像の明度と一致する。なお、図3に示すHIS空間のカラー画像情報に代えて他のカラーモデルを使用することもできる。また、カラー画像データ21自体が図3に示すHIS空間のカラー画像情報を持つデータであってもよい。その場合には、カラー形式変換部100は実行する必要はないことはいうまでもない。本発明では、明度は画像の明るさを表す情報であればよく、カラーモデルの種別は限定されない。なお、双六角錐カラーモデル及びRGB→HIS変換のアルゴリズムについては、例えば、平林雅英、「C言語による最新プログラム辞典 第2巻」、 株式会社技術評論者、1992年11月27日、 p.104−110(以下参考文献と呼ぶ)を参照。   FIG. 4 is a diagram showing a bihexagonal color model in which color image information is defined. In this embodiment, color image information defined by the bihexagonal pyramid color model shown in FIG. 4 is used as color image information in the HIS space. Here, H is a hue and takes a value of 0 to 360 degrees. I is lightness, and takes a real value from 0 to 1. S is saturation and takes a value of 0 to 1. In the following, FIG. 2 is assumed to be a geographic image shown by an example of the improvement target brightness data 22 generated by the color format conversion unit 100. The lightness I represents the brightness component of the color image and matches the lightness of the monochrome image generated from the color image information. It should be noted that other color models can be used in place of the color image information in the HIS space shown in FIG. Further, the color image data 21 itself may be data having color image information in the HIS space shown in FIG. In that case, needless to say, the color format conversion unit 100 need not be executed. In the present invention, the lightness may be information indicating the brightness of the image, and the type of the color model is not limited. Regarding the bihexagonal pyramid color model and the algorithm of RGB → HIS conversion, see, for example, Masahide Hirabayashi, “Latest Program Dictionary Volume 2 in C Language”, Technical Reviewer, Inc., November 27, 1992, p. 104-110 (hereinafter referred to as references).

図1に戻り、プログラム40は、つぎに陰影部領域検出部200を実行する。図5は、陰影部領域検出部200の概略フローチャートを示す。陰影部領域検出部200は、2値化部210とノイズ除去部220というモジュールとを含み、これらのモジュールをこの順番で順次実行する。2値化部210は、適当な2値化閾値を用いて改善対象明度データ22を2値化して、改善対象明度データ22の画素に対応する画素を有する2値画像データ23Aに変換する。すなわち、2値化の閾値より小さい明度を有する画素を、陰影部が存在する陰影部領域に属する画素として検出し、その画素に対応する、2値画像データ23Aの画素の値を1とし、上記2値化の閾値以上の大きい明度を有する画素を非陰影部が存在する非陰影部領域に属する画素として検出し、その画素に対応する2値画像データ23A内の画素の値を0にする。   Returning to FIG. 1, the program 40 next executes the shadow area detection unit 200. FIG. 5 is a schematic flowchart of the shadow area detection unit 200. The shadow area detection unit 200 includes modules called a binarization unit 210 and a noise removal unit 220, and these modules are sequentially executed in this order. The binarization unit 210 binarizes the improvement target lightness data 22 using an appropriate binarization threshold value, and converts the binarized image data 23 </ b> A having pixels corresponding to the pixels of the improvement target lightness data 22. That is, a pixel having a lightness smaller than the binarization threshold is detected as a pixel belonging to the shaded area where the shaded part exists, and the value of the pixel of the binary image data 23A corresponding to the pixel is set to 1. A pixel having a lightness greater than the binarization threshold is detected as a pixel belonging to a non-shadow portion area where a non-shadow portion exists, and the value of the pixel in the binary image data 23A corresponding to the pixel is set to zero.

2値化部210は、上記閾値をモード法、判別分析法、Pタイル法、微分ヒストグラム法などの種々の周知技術のいずれかを用いて、改善対象明度データ22から決定することができる。どの方法で閾値を決定するのが適切であるかは、改善対象明度データ22によって異なるので、改善対象明度データ22に合わせて適切な方法を選択すればよい。一般的には、判別分析法を用いると陰影部領域と非陰影部領域を区分しやすい。本実施の形態でも具体的な処理においては判別分析法を使用する。判別分析法は、ある値ftにて画像全体の明度のヒストグラムを2つのクラス(級)に分けた場合、級間分散÷(クラス1の級内分散+クラス2の級内分散)の算出結果が最大となるときのftを閾値として決定する手法である。   The binarization unit 210 can determine the threshold value from the improvement target lightness data 22 using any of various known techniques such as a mode method, a discriminant analysis method, a P tile method, and a differential histogram method. The appropriate method for determining the threshold value depends on the improvement target lightness data 22, and an appropriate method may be selected in accordance with the improvement target lightness data 22. In general, when a discriminant analysis method is used, it is easy to distinguish a shadow area from a non-shadow area. Also in this embodiment, discriminant analysis is used in specific processing. In the discriminant analysis method, when the brightness histogram of the entire image is divided into two classes (classes) at a certain value ft, the calculation result of inter-class variance / (class 1 intra-class variance + class 2 intra-class variance) This is a method of determining ft as a threshold value when s is maximum.

図6は、2値化部210により図2に示す画像から生成された2値画像データ23Aが表す画像の例を示す図である。2値化部210の処理により単に閾値で2値化して陰影部領域を検出しようとすると、非常に小さな領域までも検出してしまい、検出された陰影部領域がノイズとなり見にくい画像となってしまう。例えば、この図に示すように、道路の境界線の一部あるいはビルの屋上の境界線の一部というような小さな画像部分も検出されている。このような画像部分は、元の地理画像中の、陰影部以外の明るい領域に存在した部分的に暗い部分である。これらは、陰影部を示す画像部分ではなく、これらが陰影部領域内にあると、陰影部領域から見ると、これらの画像部分はノイズである。更に、陰影部内に明るい小さな物体が存在したときに、明るい小さな画像が検出されることがある。このような画像は、本来は陰影部領域として検出されるべきであるが、非陰影部領域として検出されるので、陰影部領域からみると、ノイズ部分である。あるいは陰影部領域の境界がギザギザになる場合もある。   FIG. 6 is a diagram illustrating an example of an image represented by the binary image data 23 </ b> A generated from the image illustrated in FIG. 2 by the binarization unit 210. If the binarization unit 210 simply binarizes with a threshold value and tries to detect a shadow area, even a very small area is detected, and the detected shadow area becomes noise and is difficult to see. . For example, as shown in this figure, a small image portion such as a part of the boundary line of the road or a part of the boundary line of the roof of the building is also detected. Such an image portion is a partially dark portion existing in a bright region other than the shaded portion in the original geographic image. These are not image portions showing shadow portions, but if they are in the shadow portion region, these image portions are noises when viewed from the shadow portion region. Furthermore, a bright small image may be detected when a bright small object is present in the shaded area. Such an image should be detected as a shaded area, but is detected as a non-shadowed area, so that it is a noise part when viewed from the shaded area. Or the boundary of a shadow part area | region may become jagged.

ノイズ除去部220(図5)は、このような、陰影部ではないと考えられる、黒い小さい画像、細い線、あるいは逆に陰影部として検出されるべき明るい小さい画像あるいは輪郭のギザギザ等をノイズとして除去する。同様に、ノイズ除去部220は、非陰影部ではないと考えられる、白い小さい画像、細い線等をノイズとして除去する。ノイズ除去には、膨張収縮処理やラベリング処理による小面積除去処理などが知られている(例えば、非特許文献2参照)。   The noise removing unit 220 (FIG. 5) uses a black small image, a thin line, or a bright small image to be detected as a shaded portion or a jagged outline, as noise. Remove. Similarly, the noise removing unit 220 removes white small images, thin lines, and the like, which are considered not to be non-shaded parts, as noise. Known examples of noise removal include small area removal processing such as expansion / contraction processing and labeling processing (see, for example, Non-Patent Document 2).

図7は、ノイズ除去部220の処理の一例を示す概略フローチャートである。まず、2値画像データ23Aを読み込み(ステップS221)、膨張収縮回数α、小面積サイズβを利用者により入力装置31から入力させる(ステップS222)。つぎに非陰影部領域に関して、膨張→収縮→収縮→膨張の順番でそれぞれ1画素分ずつα回行う。すなわち、非陰影部領域を膨張又は収縮するように、α回膨張処理(ステップS223)、α回収縮処理(ステップS224)、α回収縮処理(ステップS225) α回膨張処理(ステップS226)を実行する。以上の処理を行うことで2値画像データ23Aから、ノイズとなる細長い黒色又は白色の領域が消え、また、ギザギザの輪郭が滑らかな輪郭になる。αとしては例えば値2を使用することができる。図7に示したように、膨張処理の総回数(今の場合は4)と収縮処理の総回数(今の場合は4)は同じであることが必要である。ノイズ除去部220は、つぎに面積がβ以下の領域を除去するための処理を行い微小領域を除去する。すなわち、β以下のサイズの黒領域を白領域に変換し(ステップS227)、β以下の白領域を黒領域に変換する(ステップS228)。βとしては、例えば800画素を使用することができる。本実施の形態では、黒領域を白領域に変換する処理(ステップS227)の後に白領域を黒領域に変換する処理(ステップS228)を行ったが、順番を逆にしてもよい。以上の処理結果を陰影部領域データ23Bとして記憶装置20に保存する(ステップS229)。   FIG. 7 is a schematic flowchart illustrating an example of processing of the noise removing unit 220. First, the binary image data 23A is read (step S221), and the number of expansions and contractions α and the small area size β are input from the input device 31 by the user (step S222). Next, the non-shaded area is subjected to α times for each pixel in the order of expansion → shrinkage → shrinkage → expansion. That is, the α-time expansion process (step S223), the α-time contraction process (step S224), the α-time contraction process (step S225), and the α-time expansion process (step S226) are executed so as to expand or contract the non-shadow region. To do. By performing the above processing, the elongated black or white region that becomes noise disappears from the binary image data 23A, and the jagged contour becomes a smooth contour. For example, the value 2 can be used as α. As shown in FIG. 7, the total number of expansion processes (4 in this case) and the total number of contraction processes (4 in this case) need to be the same. Next, the noise removing unit 220 performs processing for removing a region having an area of β or less to remove a minute region. That is, a black area having a size of β or less is converted into a white area (step S227), and a white area having a size of β or less is converted into a black area (step S228). As β, for example, 800 pixels can be used. In the present embodiment, the process of converting the white area into the black area (step S228) is performed after the process of converting the black area into the white area (step S227), but the order may be reversed. The above processing result is stored in the storage device 20 as the shadow area data 23B (step S229).

以上においては、膨張収縮処理は非陰影部領域に関して行うとしたが、そのようにすると、目視したときに陰影部と見える領域内の画素は陰影部領域に属する画素として検出されないことが生じるが、目視したときに非陰影部と見える領域内の画素は、非陰影部領域に属する画素として検出されないことは少ない。このため、画像内の明るい部分が明瞭に見え、画像が鮮明に見える。逆に、膨張収縮処理を陰影部領域に関して行う、すなわち陰影部領域を膨張及び収縮するように上記膨張収縮処理を行うと、逆の現象が起きて、目視したときに非陰影部領域に属すると見える画素が、陰影部領域に属する画素であると検出される場合が生じ、上記の実施の形態の場合と比べて画像が不鮮明に見える。   In the above, the expansion / contraction process is performed on the non-shadow region, but if it is done as such, pixels in the region that appears to be a shadow region when visually observed may not be detected as pixels belonging to the shadow region, It is rare that pixels in a region that appears to be a non-shadow portion when visually observed are not detected as pixels belonging to the non-shadow portion region. For this reason, the bright part in an image looks clear, and an image looks clear. On the contrary, if the expansion / contraction process is performed on the shadow area, that is, if the expansion / contraction process is performed so as to expand and contract the shadow area, the reverse phenomenon occurs and it belongs to the non-shadow area when visually observed. There are cases where a visible pixel is detected as a pixel belonging to the shaded area, and the image looks unclear compared to the case of the above embodiment.

膨張収縮の順序は、図7に示されたように、膨張を先に行うほうがよい。そうすると、目視して陰影部領域に属すると見える画素の一部がまちがって非陰影部領域に属する画素であると検出されることが起きるが、逆に、目視して非陰影部領域に属すると見える画素はほぼ確実に非陰影部領域に属する画素であると検出される。このような処理をした後の画像は、非陰影部は明確に見えるので、利用者から見ると、画像としては見やすく、鮮明に見えることになる。膨張と収縮の順序を図7の場合と逆の順序で行うと、目視して陰影部領域に属すると見える画素はほとんどそのまま陰影部領域に属する画素として検出されるが、目視して非陰影部領域に属すると見える画素の一部がまちがって陰影部領域に属する画素として検出されることが起きる。このように収縮処理を先に行って得られる場合よりも前者のように膨張を先に実施するほうが、得られる画像は画像全体としては利用者にとっては見やすい画像になる。   As for the order of expansion and contraction, as shown in FIG. 7, it is better to perform the expansion first. As a result, some of the pixels that are visually recognized to belong to the shaded area may be detected as pixels belonging to the non-shadowed area, but conversely, if they belong to the non-shadowed area, The visible pixel is almost certainly detected as a pixel belonging to the non-shaded area. Since the non-shaded portion of the image after such processing is clearly visible, it is easy to see as an image and is clear when viewed from the user. When the order of expansion and contraction is performed in the reverse order of the case of FIG. 7, pixels that can be visually observed to belong to the shaded area are almost detected as pixels that belong to the shaded area. A part of pixels that appear to belong to a region may be mistakenly detected as pixels belonging to a shaded region. In this way, when the expansion is performed first as in the former case, the obtained image becomes an easy-to-view image for the user as a whole.

βの値は、非陰影部領域と陰影部領域で異なる値にすることが望ましい場合もある。例えば、非陰影部領域ではβ=500画素、陰影部領域ではβ=1500画素とする。このように、陰影部領域でのβを非陰影部領域でのβより大きくする(例えば2〜3倍にする)と、陰影部領域では、非陰影部領域に比べて比較的大きなゴミと思われる領域を除去することができ、利用者から見ると処理後の画像はノイズが少ないと見える利点がある。一方、非陰影部領域では、陰影部領域では除去されるような比較的大きな領域も削除されないので、非陰影部では画像の解像度が高く見えることになり、利用者にとってはより鮮明な画像に見えるという利点がある。   It may be desirable that the value of β be different between the non-shadow area and the shadow area. For example, β = 500 pixels in the non-shadow area, and β = 1500 pixels in the shadow area. In this way, if β in the shadow area is made larger than β in the non-shadow area (for example, 2 to 3 times), the shadow area is considered to be relatively large dust compared to the non-shadow area. This is advantageous in that the processed image can be seen with less noise when viewed from the user. On the other hand, in the non-shaded area, a relatively large area that is removed in the shaded area is not deleted, so that the resolution of the image looks high in the non-shaded area, and the image looks clearer to the user. There is an advantage.

陰影部領域データ23Bの各画素は、改善対象明度データ22の一つの画素に対応していて、改善対象明度データ22内の対応する画素が陰影部領域内に位置しているか否かを示す2値の画像データである。陰影部領域データ23Bの各画素の値は、陰影部が存在する領域内では1であり、それ以外の領域内では0であるが、陰影部領域データ23Bの画素の値は、これらとは逆の値を持つように定めてもよい。   Each pixel of the shadow area data 23B corresponds to one pixel of the improvement target brightness data 22, and indicates whether or not the corresponding pixel in the improvement brightness data 22 is located in the shadow area. Value image data. The value of each pixel in the shadow area data 23B is 1 in the area where the shadow area exists, and 0 in the other areas, but the pixel value in the shadow area data 23B is opposite to these. It may be determined to have a value of.

図8は、ノイズ除去部220の処理の後に得られる陰影部領域データ23Bが表す、陰影部領域の例を示す図である。黒色で示された領域がその領域である。図から分かるように、ビルなどの比較的大きな陰影部だけが示され、図6に含まれたノイズ部分は、除去されている。本発明では、陰影部のコントラストを改善するために陰影部領域に対して明度変換を行う。明度変換を行うのは、図2の画像のうち、図8の黒色で示された陰影部領域に含まれた画素に対してである。   FIG. 8 is a diagram illustrating an example of the shadow area represented by the shadow area data 23 </ b> B obtained after the processing of the noise removing unit 220. The area shown in black is that area. As can be seen from the figure, only a relatively large shadow portion such as a building is shown, and the noise portion included in FIG. 6 is removed. In the present invention, in order to improve the contrast of the shadow portion, the brightness conversion is performed on the shadow portion area. The lightness conversion is performed on the pixels included in the shaded area shown in black in FIG. 8 in the image of FIG.

図1に戻り、プログラム40は、つぎに陰影部領域明度変換部300を実行する。陰影部領域明度変換部300は、陰影部領域ヒストグラム検出部600を実行する。陰影部領域ヒストグラム検出部600は、陰影部領域内にある複数の画素についての明度ヒストグラムを検出し、検出されたヒストグラムを表す実ヒストグラムデータ24Aを記憶装置20に記憶する。なお、画像内の画素のうち陰影部領域に属さない画素は、本実施の形態では処理されない。非陰影部は太陽光が照射されている箇所であるため既に見やすい画像であるためである。本実施の形態では、陰影部領域にだけ明度変換を行うことにより処理時間も短縮できる。   Returning to FIG. 1, the program 40 then executes the shaded area brightness conversion unit 300. The shadow area brightness conversion unit 300 executes the shadow area histogram detection unit 600. The shadow area histogram detection unit 600 detects a lightness histogram for a plurality of pixels in the shadow area, and stores actual histogram data 24A representing the detected histogram in the storage device 20. In addition, the pixel which does not belong to a shadow part area | region among the pixels in an image is not processed in this Embodiment. This is because the non-shaded part is an image that is already easy to see because it is a portion irradiated with sunlight. In this embodiment, the processing time can be shortened by performing the brightness conversion only on the shaded area.

陰影部領域明度変換部300は、つぎに目標ヒストグラム生成部700を実行する。目標ヒストグラム生成部700は、陰影部領域に属する画素のコントラストを改良した後の目標ヒストグラムを決定し、決定された目標ヒストグラムを表す目標ヒストグラムデータ24Bを生成して記憶装置20に格納する。図9は、目標ヒストグラム生成部700の処理の概要を説明するための図である。同図(a)において、f(i)は、実ヒストグラムデータ24Aが表すヒストグラムを模式的に表す関数であり、明度iを有する画素数を示す関数である。図において、Aはヒストグラムの下側領域、Bは中央領域、Cは上側領域を示す。   The shadow area lightness conversion unit 300 then executes the target histogram generation unit 700. The target histogram generation unit 700 determines a target histogram after improving the contrast of the pixels belonging to the shaded area, generates target histogram data 24B representing the determined target histogram, and stores it in the storage device 20. FIG. 9 is a diagram for explaining the outline of the processing of the target histogram generation unit 700. In FIG. 9A, f (i) is a function that schematically represents the histogram represented by the actual histogram data 24A, and is a function that indicates the number of pixels having the lightness i. In the figure, A indicates the lower region of the histogram, B indicates the central region, and C indicates the upper region.

本実施の形態では、実ヒストグラムの中央領域Bを、同図(b)に示すように、画像が取りうる最小明度0から最大明度MAXまでの範囲の明度を有するように拡大されたヒストグラムg(i)に変換する。このとき、同(a)に示すヒストグラムの下側領域Aと上側領域Cに属する明度を有する複数の画素は、従来技術によれば、同図(b)に示すように、明度0又はMAXにそれぞれ変換される。このままなら、条件i≦a+1を満たす明度iは処理後に明度が0となり、つぶれという現象が起きる。また、条件b−1≦iとなる明度iは処理後に明度がMAXとなり、白とびという現象が起きる。白とびやつぶれが起きるとその部分の情報が失われるという問題がある。このような問題をなくすために、本実施の形態では、それらの領域を組合せ、それらの組み合わされた領域の画素に関する、同図(c)に示すように、最小明度0から最大明度MAXの範囲に画素が分布するヒストグラム(本明細書では、このヒストグラムを組合せヒストグラムと呼んでいる)に変換し、上記拡大されたヒストグラムg(i)と上記組合せヒストグラムとを合成して、目標ヒストグラムh(i)を生成する。本実施の形態では、上記組合せヒストグラムの例として、同図(c)に示すように、最小明度0から最大明度MAXの範囲で画素数がほぼ一様であるヒストグラムを使用している。   In the present embodiment, the central area B of the real histogram is expanded so that the image has a brightness in the range from the minimum brightness 0 to the maximum brightness MAX that the image can take, as shown in FIG. i). At this time, according to the prior art, a plurality of pixels having lightness belonging to the lower area A and the upper area C of the histogram shown in (a) have a lightness of 0 or MAX as shown in FIG. Each is converted. If this is the case, the brightness i satisfying the condition i ≦ a + 1 becomes 0 after processing, and a phenomenon of collapse occurs. Further, the lightness i satisfying the condition b-1 ≦ i has a lightness of MAX after processing and a phenomenon of overexposure occurs. There is a problem that when the overexposure or collapse occurs, the information in that part is lost. In order to eliminate such a problem, in the present embodiment, these areas are combined, and the range of the minimum brightness 0 to the maximum brightness MAX, as shown in FIG. Is converted to a histogram in which pixels are distributed (in the present specification, this histogram is referred to as a combined histogram), and the enlarged histogram g (i) and the combined histogram are combined to obtain a target histogram h (i ) Is generated. In the present embodiment, as an example of the combination histogram, a histogram having a substantially uniform number of pixels in the range from the minimum brightness 0 to the maximum brightness MAX is used as shown in FIG.

これにより、同図(a)に示すヒストグラムの中央領域Bが最小明度0から最大明度MAXまでの最大範囲に拡大され、このときに変換されなかった同図(a)の下側領域Bと上側領域Cに属する画素が、無視されることなく、同図(c)に示すように、組み合わされて最小明度0から最大明度MAXの範囲に画素が分布する組合せヒストグラムに属するように、目標ヒストグラムh(i)が決定される。本発明では、このように元のヒストグラムの下側領域Aと上側領域Cに属する画素を切り出し、同図(c)に示すように最小明度0から最大明度MAXの範囲に画素が分布する組合せヒストグラムに属させることをクリッピングと呼ぶことがある。上記下側領域Aの明度限界値と上記上側領域Cの明度限界値をそれぞれ下側限界値又は上側限界値と呼ぶことがあり、あるいはそれぞれの限界値を下側クリッピング値及び上側クリッピング値と呼ぶことがある。目標ヒストグラム生成部700の処理の詳細は後に説明する。   As a result, the central area B of the histogram shown in FIG. 10A is expanded to the maximum range from the minimum brightness 0 to the maximum brightness MAX, and the lower area B and the upper side that are not converted at this time are converted. The target histogram h is set so that the pixels belonging to the region C belong to the combined histogram in which the pixels are combined and distributed in the range of the minimum brightness 0 to the maximum brightness MAX as shown in FIG. (i) is determined. In the present invention, the pixels belonging to the lower area A and the upper area C of the original histogram are cut out as described above, and the combined histogram in which the pixels are distributed in the range of the minimum brightness 0 to the maximum brightness MAX as shown in FIG. It may be called clipping to belong to. The lightness limit value of the lower region A and the lightness limit value of the upper region C may be referred to as a lower limit value or an upper limit value, respectively, or the respective limit values are referred to as a lower clipping value and an upper clipping value. Sometimes. Details of the processing of the target histogram generation unit 700 will be described later.

図1に戻り、陰影部領域明度変換部300は、つぎに明度変換部800を実行する。明度変換部800は、まず明度変換データ25を生成する。この明度変換データ25は、改善対象明度データ22の画像の陰影部領域の画素の明度のヒストグラムが目標ヒストグラムデータ24Bが示すヒストグラムを有する画像に変換するためのデータであり、この明度変換データ25は、実ヒストグラムデータ24Aと目標ヒストグラムデータ24Bとに基づいて生成される。明度変換部800は、つぎに改善対象明度データ22の陰影部領域に対して明度変換を明度変換データ25に基づいて実行し、明度ヒストグラムが図9(c)に例示された目標ヒストグラムにほぼ等しくなるように、陰影部領域の画素の明度を変換してコントラスト改善後明度データ26を生成し、記憶装置20に記憶する。明度変換部800の処理の詳細は後に説明する。   Returning to FIG. 1, the shadow area lightness conversion unit 300 next executes the lightness conversion unit 800. The lightness conversion unit 800 first generates lightness conversion data 25. The brightness conversion data 25 is data for converting the brightness histogram of the pixels in the shaded area of the image of the improvement target brightness data 22 into an image having the histogram indicated by the target histogram data 24B. Are generated based on the actual histogram data 24A and the target histogram data 24B. Next, the lightness conversion unit 800 performs lightness conversion on the shaded area of the improvement target lightness data 22 based on the lightness conversion data 25, and the lightness histogram is substantially equal to the target histogram illustrated in FIG. 9C. As described above, the lightness data 26 after the contrast improvement is generated by converting the lightness of the pixels in the shadow area, and is stored in the storage device 20. Details of the processing of the brightness conversion unit 800 will be described later.

明度変換部800は、改善対象明度データ22内の画素の明度を更新する代わりに、当該改善対象明度データ22をコピーしたコピー画像データ(図示せず)を記憶装置20に記憶し、このコピー画像データ内の陰影部領域に属する画素の明度の変換後の値を決定し、その画素の明度を決定された変換後の明度で置換すればよい。それにより、陰影部領域の明度が変換された画像データ(コントラスト改善後明度データ)を元の改善対象明度データ22とは別に生成することができる。あるいは、元の改善対象明度データ22のコピー画像データを生成して記憶装置20に記憶して、上記明度変換を元の改善対象明度データ22内の陰影部領域に対して実行してもよい。   Instead of updating the lightness of the pixels in the improvement target lightness data 22, the lightness conversion unit 800 stores, in the storage device 20, copy image data (not shown) obtained by copying the improvement target lightness data 22, and this copy image. What is necessary is just to determine the converted value of the brightness of the pixel belonging to the shaded area in the data and replace the brightness of the pixel with the determined converted brightness. Thereby, the image data (lightness data after contrast improvement) in which the lightness of the shadow area is converted can be generated separately from the original improvement target lightness data 22. Alternatively, copy image data of the original improvement target lightness data 22 may be generated and stored in the storage device 20, and the lightness conversion may be performed on the shadow area in the original improvement target lightness data 22.

いずれの方法でも、元の改善対象明度データ22と同じ内容の画像データと、元の改善対象明度データ22内の陰影部領域の明度が更新された画像データを得ることができる。あるいは同じ結果データが得られるならば、他の方法でもよい。したがって、明度変換部800の実行はいずれの方法を使用してもよいので、本明細書では、改善対象明度データ22のコピー画像データを更新する場合も、説明の簡単化のためと分かりやすさのために元の改善対象明度データ22を更新すると呼ぶ場合があるが、その場合でも、その更新処理は、改善対象明度データ22のコピー画像を更新する場合も含むものである。   In any method, it is possible to obtain image data having the same content as the original improvement target lightness data 22 and image data in which the lightness of the shadow area in the original improvement target lightness data 22 is updated. Alternatively, other methods may be used as long as the same result data can be obtained. Therefore, any method may be used for the execution of the lightness conversion unit 800. Therefore, in this specification, even when the copy image data of the improvement target lightness data 22 is updated, it is easy to understand for the sake of simplification. For this reason, it may be called to update the original improvement target lightness data 22, but even in that case, the update process includes a case where a copy image of the improvement target lightness data 22 is updated.

図10は、図2に示す改善対象明度データ22を陰影部領域明度変換部300により明度変換して得られるコントラスト改善後明度データ26が表す画像の例を示す図である。陰影部領域の明度を変換したため、陰影部領域のコントラストが元の改善対象明度データ22(図2)より改善されており、その視認性が高まっている。例えば、画面ほぼ中央でやや右上がり方向に延びる道路及び右下がり方向にに延びる道路のうち陰影部内にある部分でも、自動車を示す白いスポット画像が見ることができる。   FIG. 10 is a diagram illustrating an example of an image represented by contrast-improved brightness data 26 obtained by performing brightness conversion on the improvement target brightness data 22 illustrated in FIG. Since the brightness of the shaded area is converted, the contrast of the shaded area is improved from the original improvement target brightness data 22 (FIG. 2), and the visibility is increased. For example, a white spot image showing a car can be seen even in a portion within a shaded portion of a road extending slightly upward to the right and a road extending downward to the right in the approximate center of the screen.

しかし、いくつかの箇所で、明度の変化が不自然になっている。以下にいくつかの不自然な領域の例を説明する。
(ケース1)領域10a、10b、10cで例示される、陰影部領域と非陰影部領域の境界に沿って帯状に延びている領域では明度が急激に高くなっており、その近傍の明度に比べると明度が不連続になっている。
(ケース2)領域10dは、ビルのひとつの壁面の一部を表している領域であり、元の改善対象明度データ22(図2)では、目視したときには陰影部と見えるが、図10では、壁面の水平方向の経路に沿っての明度は、途中で急に増大しており、その部分で明度が不連続となっている。
(ケース3)領域10eは、図2からも分かるように、ビルの屋上の一部に他のビルの影が投影されている領域であるが、図10では、この領域10eには、ビルの屋上の明るい領域とその領域に隣接した黒い影領域と、その下方に位置する白い領域が含まれている。これらの黒い領域とその下方の白い領域との間では明度が不連続となっている。図2を参照すると、この領域10e内の上記黒い領域とそれに隣接する下方の領域は、領域10dと同じく、ほぼ明度が連続している同じ陰影部に属する領域である。それにも拘わらず図10では、これらの二つの領域の明度は不連続に変化している。
However, in some places, the change in brightness is unnatural. Some examples of unnatural areas are described below.
(Case 1) In the region extending in a band shape along the boundary between the shaded region and the non-shadowed region, exemplified by the regions 10a, 10b, and 10c, the brightness is rapidly increased, and compared with the brightness in the vicinity thereof And the brightness is discontinuous.
(Case 2) The region 10d is a region representing a part of one wall surface of the building, and in the original improvement target lightness data 22 (FIG. 2), it appears as a shaded part when viewed, but in FIG. The lightness along the horizontal path of the wall surface suddenly increases in the middle, and the lightness is discontinuous at that portion.
(Case 3) As can be seen from FIG. 2, the area 10e is an area in which the shadow of another building is projected on a part of the roof of the building. In FIG. A bright area on the roof, a black shadow area adjacent to the area, and a white area located below the area are included. The brightness is discontinuous between these black areas and the white area below them. Referring to FIG. 2, the black area in the area 10e and a lower area adjacent to the black area are areas belonging to the same shaded portion where brightness is almost continuous, similar to the area 10d. Nevertheless, in FIG. 10, the brightness of these two regions changes discontinuously.

以上のような明度が不連続な領域は、陰影部領域明度変換部300による明度変換の結果生じたものである。上記ケース1で説明した領域10aから10cは、図2と詳細に比較すると、これらの部分は、図2では目視したときには非陰影部領域と見えるが、目視したときの陰影部領域に隣接している領域であることが分かる。すなわち、領域10a等は、目視したときには非陰影部に属すると見えるが、明度が低く2値化閾値より低い領域である。改善対象明度データ22から決定された2値化閾値が、目視したときの陰影部と目視したときの非陰影部の境界に来るとは限らないで、その境界の明度より大きくなることが起きる。この場合には、上に記載したように、目視したときの非陰影部の一部の明度が2値化の閾値より小さくなることがおきる。   The region where the lightness is discontinuous as described above is a result of the lightness conversion by the shadow region lightness conversion unit 300. The areas 10a to 10c described in the case 1 are compared with FIG. 2 in detail. These areas appear to be non-shaded areas when viewed in FIG. 2, but are adjacent to the shaded areas when viewed. It can be seen that this is an area. That is, the region 10a or the like is a region having low brightness and lower than the binarization threshold, although it appears to belong to a non-shaded part when visually observed. The binarization threshold value determined from the improvement target lightness data 22 does not always come to the boundary between the shaded part when viewed and the non-shadowed part when viewed, but may be larger than the brightness of the boundary. In this case, as described above, the brightness of a part of the non-shadow portion when visually observed may be smaller than the threshold value for binarization.

図11は、このような領域10a等とその近傍における明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。図で点線が明度変換前の明度を示し、破線が明度変換された後の明度を示す。実線は後に述べるグラデーション処理後の明度を示す。これらの線種の違いは後に述べる図12、13にも当てはまる。領域10a等の近傍は、目視したときの非陰影部と目視したときの陰影部とが見える領域である。しかし、目視したときの非陰影部では2値化の閾値より小さい明度を持つ部分と2値化閾値より大きい明度を持つ部分とが含まれている。目視したときの非陰影部領域のうち、2値化のための閾値より明度が低い領域があると、その領域は陰影部領域に属する領域として検出される。目視したときの非陰影部領域内のその他の領域は非陰影部領域として検出される。   FIG. 11 is a diagram schematically showing the brightness distribution before the brightness conversion, the brightness distribution after the brightness conversion, and the brightness distribution after the gradation process in the area 10a and the vicinity thereof. In the figure, the dotted line indicates the brightness before the brightness conversion, and the broken line indicates the brightness after the brightness conversion. The solid line indicates the brightness after gradation processing described later. These line type differences also apply to FIGS. The vicinity of the region 10a or the like is a region where a non-shadow portion when viewed and a shadow portion when viewed are visible. However, the non-shaded portion when visually observed includes a portion having a lightness smaller than the binarization threshold and a portion having a lightness larger than the binarization threshold. If there is a region whose brightness is lower than the threshold for binarization in the non-shadow region when viewed, the region is detected as a region belonging to the shadow region. Other areas in the non-shadow area when visually observed are detected as non-shadow areas.

領域10a等は、前者の領域である。このような領域は、陰影部領域明度変換部300による明度変換を受け、その結果、2値化閾値に近い明度を有する画素の明度は、図9(c)に示されたように大きい値の明度に変換される。このため、領域10a等のような領域の明度は明度変換後に非常に大きくなる。近傍の、目視したときに非陰影部と見え、実際の明度が2値化閾値より大きいために非陰影部領域として検出される領域の明度は、明度変換を受けない。したがって、領域10a等の領域の明度は、近傍の目視したときに非陰影部と見える領域の明度よりも大きくなり、これが原因となって、領域10a等の明度が極端に大きくなる領域が発生し、目視したときには明度の不連続が発生しているように見える。   The area 10a and the like are the former areas. Such a region is subjected to lightness conversion by the shadow region lightness conversion unit 300. As a result, the lightness of a pixel having a lightness close to the binarization threshold value has a large value as shown in FIG. Converted to lightness. For this reason, the brightness of the area such as the area 10a becomes very large after the brightness conversion. The brightness of an area that is detected as a non-shaded part area because it appears as a non-shadow part when viewed in the vicinity and the actual brightness is greater than the binarization threshold value does not undergo brightness conversion. Therefore, the brightness of the area such as the area 10a is larger than the brightness of the area that appears to be a non-shaded part when the vicinity is visually observed, and this causes an area where the brightness of the area 10a or the like becomes extremely large. When viewed, the discontinuity of brightness appears to have occurred.

図12は、上記ケース2で説明した図10内の領域10dが含まれるビルの壁面上での図のほぼ水平方向の経路に沿っての明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。領域10dが含まれるビルの壁面では、明度変換前は、目視したときには図2では壁面全体が陰影部と見える。しかし、目視したときの陰影部でも明度が場所により異なり2値化の閾値より小さい明度を持つ部分と2値化閾値より大きい明度を持つ部分とが含まれている。改善対象明度データ22から決定された2値化の閾値が、目視したときの陰影部と目視したときの非陰影部の境界に来るとは限らないで、目視した陰影部の明度分布の範囲の中に含まれることが起きる。したがって、上のような二つの部分が目視したときの陰影部に含まれることが起きる。陰影部領域のうち、2値化のための閾値より明度が低い領域があると、その領域は陰影部領域に属する領域として検出される。目視したときの陰影部領域内のうち、閾値より高い領域は非陰影部領域として検出される。   FIG. 12 shows the lightness distribution before the lightness conversion, the lightness distribution after the lightness conversion, and the lightness distribution after the lightness conversion on the wall surface of the building including the region 10d in FIG. It is a figure which shows typically the brightness distribution after a gradation process. On the wall surface of the building including the region 10d, the entire wall surface is seen as a shaded portion in FIG. However, the shaded portion when visually observed also includes a portion whose brightness varies depending on the location and a portion having a brightness smaller than the binarization threshold and a portion having a brightness greater than the binarization threshold. The threshold of binarization determined from the brightness data 22 to be improved does not always come to the boundary between the shaded portion when visually observed and the non-shadowed portion when visually observed. It happens to be included. Therefore, the two parts as described above are included in the shaded part when visually observed. If there is an area having a lightness lower than the threshold for binarization in the shadow area, the area is detected as an area belonging to the shadow area. Of the shaded area when viewed, an area higher than the threshold is detected as a non-shadowed area.

領域10dでは、両方の領域が含まれている。前者の領域は、先の領域10a等と同じく、陰影部領域明度変換部300による明度変換を受け、その結果、2値化閾値に近い明度を有する画素の明度は、図9(c)に示されたように大きな値の明度に変換される。このため、領域10dのような領域のうち、閾値より明度が低い領域の明度は明度変換後に非常に大きくなる。近傍の、目視したときの陰影部と見え、実際の明度が2値化閾値より大きいために非陰影部領域として検出される領域の明度は、明度変換を受けない。したがって、領域10dのうち、閾値より低く閾値に近い領域の明度は、近傍の目視したときに陰影部と見えるが、閾値より高い明度を有する近傍の領域の明度よりもはるかに大きくなり、これが原因となって、領域10dの一部では明度が極端に大きくなり、目視したときには明度の不連続が発生しているように見える。   In the area 10d, both areas are included. The former area is subjected to lightness conversion by the shadow area lightness conversion unit 300 as in the previous area 10a and the like, and as a result, the lightness of pixels having lightness close to the binarization threshold is shown in FIG. Converted to a large value brightness. For this reason, the lightness of the region having lightness lower than the threshold among the regions such as the region 10d becomes very large after the lightness conversion. The brightness of an area detected as a non-shadow area is not subjected to brightness conversion because it appears as a shadow area when viewed in the vicinity and the actual brightness is greater than the binarization threshold. Therefore, in the region 10d, the lightness of the region lower than the threshold value and close to the threshold value appears as a shaded portion when the vicinity is visually observed, but is much larger than the lightness value of the nearby region having a lightness value higher than the threshold value. Thus, the brightness becomes extremely large in a part of the region 10d, and it appears that discontinuity of the brightness occurs when visually observed.

図13は、上記ケース3で説明した図10の領域10eが含まれるビルの屋上における、図のほぼ垂直方向の経路に沿っての明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。領域10eが含まれるビルの屋上では、明度変換前は、目視したときには明らかに非陰影部と見える領域と、陰影部と見える領域とがある。しかし、領域10dの場合に説明したように、目視したときの陰影部でも明度が場所により異なり、2値化の閾値より小さい明度を持つ部分と2値化閾値より大きい明度を持つ部分とが含まれている。このような二つの部分が目視したときの陰影部に含まれることが起きる理由は、領域10dについて説明したのと同じ理由である。   FIG. 13 shows the lightness distribution before the lightness conversion, the lightness distribution after the lightness conversion, and the gradation process on the roof of the building including the area 10e shown in FIG. It is a figure which shows the latter brightness distribution typically. On the rooftop of the building including the area 10e, before lightness conversion, there are an area that can be clearly seen as a non-shadow part and an area that can be seen as a shadow part when visually observed. However, as described in the case of the region 10d, the brightness varies depending on the location even in the shaded portion when visually observed, and includes a portion having a brightness smaller than the binarization threshold and a portion having a brightness greater than the binarization threshold. It is. The reason why such two portions are included in the shaded portion when visually observed is the same reason as described for the region 10d.

目視したときの陰影部領域のうち、2値化のための閾値より明度が低い領域があると、その領域は陰影部領域に属する領域として検出される。目視したときの陰影部領域内のうち、閾値より高い領域は非陰影部領域として検出される。したがって、領域10eでは、明るい非陰影部領域(第1の領域)と、その領域に隣接して、目視したときに陰影部と見えるが、明度が閾値より高く、非陰影部領域として検出される領域(第2の領域)と、目視したときに陰影部と見え、かつ、明度が閾値より低く閾値に近く陰影部領域として検出される領域(第3の領域)という3つの領域がある。第3の領域の明度は明度変換により高くなり、上記第2の領域よりも明度が高くなり、第2の領域と第3の領域の間で明度が不連続となる。   If there is a region whose brightness is lower than the threshold for binarization in the shadow region when visually observed, the region is detected as a region belonging to the shadow region. Of the shaded area when viewed, an area higher than the threshold is detected as a non-shadowed area. Therefore, in the area 10e, a bright non-shadow area (first area) and a shadow area when viewed by being adjacent to the bright area are visible, but the brightness is higher than the threshold value and is detected as a non-shadow area. There are three regions: a region (second region) and a region (third region) that appears as a shaded portion when visually observed, and is detected as a shaded portion region whose brightness is lower than the threshold and close to the threshold. The brightness of the third area is increased by the brightness conversion, the brightness is higher than that of the second area, and the brightness is discontinuous between the second area and the third area.

以上に説明したように、陰影部領域明度変換部300により陰影部領域に対してコントラスト改善のための明度変換を行うと、陰影部領域のコントラストが改善され、その視認性が向上するが、反面一部の領域10a〜10e等において、明度の不連続が発生する。既に説明したように、そのような明度の不連続は、2値化閾値より低いために、陰影部領域検出部200により陰影部領域として検出されるが、その明度がその閾値に近いために、陰影部領域明度変換部300による明度変換により、非常に大きな明度に変換されることによることが判明した。   As described above, when the shadow area brightness conversion unit 300 performs brightness conversion for improving the contrast of the shadow area, the contrast of the shadow area is improved and the visibility is improved. In some areas 10a to 10e, etc., lightness discontinuity occurs. As already described, since such a lightness discontinuity is lower than the binarization threshold value, it is detected as a shadow region by the shadow region detection unit 200, but because the lightness is close to the threshold value, It has been found that the lightness conversion by the shadow area lightness conversion unit 300 results in conversion to a very large lightness.

閾値より低く閾値に近い明度を有する画素は、検出された陰影部領域に属し、検出された非陰影部領域に隣接する領域(本明細書では境界隣接領域と呼ぶ)にある画素である。本実施の形態では、上記明度変換後の明度の不連続を低減するために、閾値より低く閾値に近い明度を有する画素の明度を明度変換後の明度に変更しないで、境界から陰影部領域の内部に向かうに連れて漸次明度変換後の明度に近づく値を有する、更に改善された明度に変換する処理(グラデーション処理と呼ぶ)を実行する。   A pixel having a brightness lower than the threshold and close to the threshold is a pixel that belongs to the detected shadow area and is in an area adjacent to the detected non-shadow area (referred to as a boundary adjacent area in this specification). In the present embodiment, in order to reduce the discontinuity of the lightness after the lightness conversion, the lightness of the pixels having lightness lower than the threshold value and close to the threshold value is not changed to the lightness value after the lightness conversion. As it goes inward, a process of converting to a further improved brightness having a value that approaches the brightness after the brightness conversion (referred to as gradation process) is executed.

図1に戻り、プログラム40は、つぎにグラデーション処理部400を実行する。グラデーション処理部400は、まずグラデーション領域決定部900を実行する。グラデーション領域決定部900は、陰影部領域データ23Bに基づいて、グラデーション領域データ27を生成する。グラデーション領域データ27は、グラデーション処理を実行する、境界隣接領域内の複数のグラデーション領域を指定するデータである。   Returning to FIG. 1, the program 40 next executes the gradation processing unit 400. The gradation processing unit 400 first executes the gradation area determination unit 900. The gradation area determination unit 900 generates gradation area data 27 based on the shadow area data 23B. The gradation area data 27 is data for designating a plurality of gradation areas in the boundary adjacent area for executing gradation processing.

図14は、複数のグラデーション領域とグラデーション領域データ27を説明するための図である。同図(a)は、陰影部領域データ23Bの値を示す図である。図では、陰影部領域データ23Bを、改善対象明度データ22上の画素の座標x、yと同じ座標位置における陰影部領域データ23Bの値を表すデータS(x,y)でもって表している。本実施の形態では、陰影部領域データS(x,y)(23B)は、陰影部領域231内では値1を有し、非陰影部領域232内では値0を有する。同図(b)は、グラデーション領域データ27を模式的に示す図である。図ではグラデーション領域データ27を、同様に座標x、yの画素位置に対するグラデーション領域データの値を表すデータG(x,y)でもって表している。図に示されるように、陰影部領域231内の、非陰影部領域232に隣接する境界隣接領域270に複数のグラデーション領域271から274が設けられている。本実施の形態では、グラデーション段階数Gnumを4と仮定している。本実施の形態ではグラデーション段階数Gnumはユーザが指定可能になっている。境界隣接領域270に設定されるグラデーション領域の数は、グラデーション段階数に等しい。   FIG. 14 is a diagram for explaining a plurality of gradation areas and gradation area data 27. FIG. 6A shows the value of the shaded area data 23B. In the figure, the shaded area data 23B is represented by data S (x, y) representing the value of the shaded area data 23B at the same coordinate position as the coordinates x, y of the pixel on the improvement target lightness data 22. In the present embodiment, the shadow area data S (x, y) (23B) has a value 1 in the shadow area 231 and a value 0 in the non-shadow area 232. FIG. 2B schematically shows the gradation area data 27. In the figure, the gradation area data 27 is similarly represented by data G (x, y) representing the value of the gradation area data with respect to the pixel position of coordinates x and y. As shown in the drawing, a plurality of gradation areas 271 to 274 are provided in the boundary adjacent area 270 adjacent to the non-shadow area 232 in the shadow area 231. In the present embodiment, it is assumed that the gradation stage number Gnum is 4. In the present embodiment, the gradation level number Gnum can be specified by the user. The number of gradation regions set in the boundary adjacent region 270 is equal to the number of gradation steps.

本実施の形態では複数のグラデーション領域271から274は、陰影部領域231に対して1画素分の収縮処理を繰り返し実行することにより生成される。各グラデーション領域271から274に対しては、重みとして順次、1/(Gnum+1)= 0.2ずつ大きくなる値0.2〜0.8が割り当てられ、これらの重みが、グラデーション領域271から274のそれぞれ内の画素に対応するグラデーション領域データG(x,y)(27)内の画素に格納される。したがって、グラデーション領域データG(x,y)(27)は、改善対象明度データ22の各画素に対応して、このような重みデータ以外に重みデータを識別可能にするデータを保持するようにしてもよい。例えば、重み0.2、0.4等に順に番号2、3、…というように番号を与えて、各グラデーション領域データG(x,y)(27)には、この番号を記憶するようにしてもよい。このような重みを識別可能にするデータも、本発明に関しては重みを表すデータと見なす。   In the present embodiment, the plurality of gradation areas 271 to 274 are generated by repeatedly executing contraction processing for one pixel on the shadow area 231. The gradation areas 271 to 274 are assigned weight values of 0.2 to 0.8 sequentially increasing as 1 / (Gnum + 1) = 0.2, and these weights correspond to the pixels in the gradation areas 271 to 274, respectively. Stored in the pixels in the gradation area data G (x, y) (27). Therefore, the gradation area data G (x, y) (27) retains data that makes it possible to identify the weight data in addition to the weight data corresponding to each pixel of the improvement target brightness data 22. Also good. For example, numbers such as numbers 2, 3,... May be given in order to the weights 0.2, 0.4, etc., and this number may be stored in each gradation area data G (x, y) (27). Data that makes such weights identifiable is also regarded as data representing weights for the present invention.

各グラデーション領域に対応した上記重みは、このようにあらかじめ決定されるが、本実施の形態では、重みはグラデーション段階数(=グラデーション領域数)に依存して自動的に決定されるようになっている。更に、グラデーション領域データG(x,y)(27)は、いずれかのグラデーション領域に属する画素に対応して、そのグラデーション領域に対して決定された重みを表すデータを保持することにより、その画素がグラデーション領域に属する画素であることを示すとともに、そのグラデーション領域に対する重みも表している。   The weight corresponding to each gradation area is determined in advance as described above, but in this embodiment, the weight is automatically determined depending on the number of gradation steps (= number of gradation areas). Yes. Further, the gradation area data G (x, y) (27) corresponds to a pixel belonging to any gradation area, and holds data representing the weight determined for the gradation area, thereby obtaining the pixel. Indicates that the pixel belongs to the gradation area, and also represents the weight for the gradation area.

図15は、陰影部領域データ23Bが示す陰影部領域(図8)に対して決定された複数のグラデーション領域の存在範囲を示す図である。図において、灰色で示された領域が複数のグラデーション領域を含む境界隣接領域の存在範囲を示す。   FIG. 15 is a diagram showing the existence ranges of a plurality of gradation areas determined for the shadow area (FIG. 8) indicated by the shadow area data 23B. In the figure, the area shown in gray indicates the existence range of the boundary adjacent area including a plurality of gradation areas.

図16は、グラデーション領域決定部900の処理の一例の概略フローチャートである。グラデーション領域決定部900は、まず、ステップS901で、使用するグラデーション段階数Gnumを入力装置31からユーザに入力させる。つぎに、ステップS902で、陰影部領域データS(x,y)を作業用データT(x,y)とグラデーション領域データG(x,y)にコピーする。作業用データT(x,y)は、改善対象明度データ22の各画素(x,y)の位置に対応した陰影部領域データS(x,y)の画素の2値のデータを収容可能なデータである。この時点では、グラデーション領域データG(x,y)(27)と作業用データT(x,y)は、図14(a)に示される陰影部領域データS(x,y)(23)と同じデータとなる。   FIG. 16 is a schematic flowchart of an example of processing of the gradation area determination unit 900. In step S901, the gradation area determination unit 900 first causes the user to input the gradation stage number Gnum to be used from the input device 31. In step S902, the shadow area data S (x, y) is copied to the work data T (x, y) and the gradation area data G (x, y). The work data T (x, y) can accommodate binary data of pixels of the shadow area data S (x, y) corresponding to the position of each pixel (x, y) of the improvement target brightness data 22. It is data. At this time, the gradation area data G (x, y) (27) and the work data T (x, y) are the shadow area data S (x, y) (23) shown in FIG. The same data.

つぎにステップS903でカウンタiを1に初期化する。つぎにステップS904で作業用データT(x,y)に対して収縮処理を行う。これは、検出された陰影部領域231(図14(a))に対して収縮処理を行うのと同じである。収縮処理の結果、陰影部領域231に含まれなくなった画素が構成する領域が第1のグラデーション領域271として使用される。したがって、ステップS905において、収縮処理により作業用データT(x,y)の値が1から0に変化した画素に対応するグラデーション領域データG(x,y)(27)内の、グラデーション領域271に属する画素に、重みとして値i/(Gnum+1)(今の段階では0.2 )を格納する。   In step S903, the counter i is initialized to 1. In step S904, contraction processing is performed on the work data T (x, y). This is the same as performing the contraction process on the detected shadow area 231 (FIG. 14A). As a result of the contraction process, an area formed by pixels that are no longer included in the shaded area 231 is used as the first gradation area 271. Accordingly, in step S905, the gradation area 271 in the gradation area data G (x, y) (27) corresponding to the pixel whose value of the work data T (x, y) has changed from 1 to 0 by the contraction process is displayed. The value i / (Gnum + 1) (0.2 at this stage) is stored as a weight in the pixel to which it belongs.

ステップS906でカウンタiをインクリメントする。ステップS907でi>Gnumか否かを判断し、そうならば、グラデーション領域決定部900の処理を終了し、そうでないならステップS904に戻り、そのステップ以降の処理を繰り返す。すなわち、作業用データT(x,y)を更に1画素分収縮する処理を実行し、順次グラデーション領域272から274を決定し、それぞれに属する画素に重み0.4 、0.6 、0.8 を順次格納する。こうして、グラデーション領域データS(x,y)(27)内の、グラデーション領域271から274のそれぞれに属する複数の画素に0でない重みが格納されて、グラデーション領域決定部900の処理が終了する。   In step S906, the counter i is incremented. In step S907, it is determined whether i> Gnum. If so, the process of the gradation area determining unit 900 is terminated. If not, the process returns to step S904, and the processes after that step are repeated. That is, processing for further contracting the working data T (x, y) by one pixel is executed, gradation areas 272 to 274 are sequentially determined, and weights 0.4, 0.6, and 0.8 are sequentially stored in the pixels belonging to the gradation areas. In this way, the non-zero weight is stored in the plurality of pixels belonging to each of the gradation areas 271 to 274 in the gradation area data S (x, y) (27), and the processing of the gradation area determining unit 900 is completed.

以上から分かるように、複数のグラデーション領域内の画素に対する重みは、画素の位置が非陰影領域と陰影領域との境界に隣接する領域では一番小さく、画素の位置が非陰影領域と陰影領域との境界から陰影領域内部に行くほど大きくなるように決定されている。なお、以上においては、陰影部領域の最も外側の領域である第1のグラデーション領域271に対する重みは0でない値としたが、グラデーション領域の数を一つ増やし、第1のグラデーション領域の重みを0にして、その後第2のグラデーション領域272以降の重みを順次、0.2 、0.4 、…としてもよい。この場合には、第1のグラデーション領域271では、後に説明するように、改善対象明度データ22の画像がそのまま使用されることになる。   As can be seen from the above, the weight for the pixels in the plurality of gradation areas is the smallest in the area where the pixel position is adjacent to the boundary between the non-shadow area and the shadow area, and the pixel position is the non-shadow area and the shadow area. It is determined so as to increase as it goes from the boundary to the inside of the shadow area. In the above description, the weight for the first gradation area 271 that is the outermost area of the shadow area is a non-zero value, but the number of gradation areas is increased by one and the weight of the first gradation area is set to 0. Then, the weights after the second gradation area 272 may be sequentially set to 0.2, 0.4,. In this case, in the first gradation area 271, as will be described later, the image of the improvement target brightness data 22 is used as it is.

図1に戻り、グラデーション処理部400は、その後、グラデーション処理実行部950を実行する。グラデーション処理実行部950は、検出された陰影部領域と非陰影部領域の境界部分の明度の不連続さを緩和し、境界における画像を滑らかにするための処理としてグラデーション処理を実行する。グラデーション処理実行部950は、コントラスト改善後明度データ26をコピーしたコピー画像データ(図示せず)を記憶装置20に記憶し、先に生成されたグラデーション領域データ27を用いて、このコピー画像データ内のグラデーション領域内に属する画素の明度の変換後の値を決定して、その決定された変換後の明度でもってそのコピー画像データのその画素の明度を更新してグラデーション処理後明度データ28として記憶装置20に記憶する。   Returning to FIG. 1, the gradation processing unit 400 then executes the gradation processing execution unit 950. The gradation processing execution unit 950 executes gradation processing as a process for reducing the discontinuity in brightness at the boundary between the detected shadow area and the non-shadow area and smoothing the image at the boundary. The gradation processing execution unit 950 stores copy image data (not shown) obtained by copying the contrast-improved brightness data 26 in the storage device 20, and uses the previously generated gradation area data 27 to store the copy image data in the copy image data. The brightness value after conversion of the pixels belonging to the gradation area is determined, and the brightness of the pixel of the copy image data is updated with the determined brightness after conversion, and stored as the brightness data 28 after gradation processing. Store in device 20.

グラデーション処理実行部950は、改善対象明度データ22の座標(x,y)における明度をIo(x,y)、コントラスト改善後明度データ26の座標(x,y)における明度をIc(x,y)、グラデーション処理により得られるグラデーション処理後明度データ28の座標(x,y)における明度をIg(x,y)とすると、次式1に従い、グラデーション処理後明度データIg(x,y)(28)を決定する。   The gradation processing execution unit 950 sets the brightness at the coordinates (x, y) of the brightness data 22 to be improved to Io (x, y) and the brightness at the coordinates (x, y) of the brightness data 26 after contrast improvement as Ic (x, y). ) If the lightness at the coordinates (x, y) of the lightness data 28 after gradation processing obtained by gradation processing is Ig (x, y), the lightness data Ig (x, y) after gradation processing Ig (x, y) (28 ).

Ig(x,y) = Ic(x,y)×G(x,y)+Io(x,y)×{1−G(x,y)} (1)
すなわち、重みG(x,y)が0である、非陰影部領域の画素に対しては、グラデーション処理後明度データIg(x,y)(28)は、改善対象明度データIo(x,y)(22)に等しくなり、重みG(x,y)が1である、陰影部領域の画素に対しては、グラデーション処理後明度データIg(x,y)(28)は、コントラスト改善後明度データIc(x,y)(26)に等しくなる。重みG(x,y)が0と1の間であるグラデーション領域内の画素に対しては、改善対象明度データIo(x,y)(22)とコントラスト改善後明度データIc(x,y)(26)とをそれぞれ重み(1−G(x,y))と重みG(x,y)とを用いて加算してグラデーション処理後明度データIg(x,y)(28)が決定されている。
Ig (x, y) = Ic (x, y) × G (x, y) + Io (x, y) × {1−G (x, y)} (1)
That is, for the pixels in the non-shaded area where the weight G (x, y) is 0, the post-gradation lightness data Ig (x, y) (28) is the improvement target lightness data Io (x, y). ) (22) and the weight G (x, y) is 1, the shaded region brightness data Ig (x, y) (28) is the post-contrast brightness value. It becomes equal to the data Ic (x, y) (26). For pixels in the gradation area where the weight G (x, y) is between 0 and 1, the improvement target brightness data Io (x, y) (22) and the contrast improved brightness data Ic (x, y) (26) is added using the weight (1-G (x, y)) and the weight G (x, y), respectively, and the gradation-processed brightness data Ig (x, y) (28) is determined. Yes.

境界隣接領域270内の画素に対する重みは、当該画素が非陰影領域と陰影領域との境界から陰影領域内部に行くほど重みが大きくなるように決定されるので、境界隣接領域270内の画素に対するグラデーション処理後明度データIg(x,y)(28)は、画素が上記境界に近いときには、改善対象明度データIo(x,y)(22)に近くなり、画素が陰影領域内部に行くにしたがって、コントラスト改善後明度データIc(x,y)(26)に近づくことになる。したがって、陰影部領域内にあり上記境界に近い画素に対して、グラデーション処理後明度データIg(x,y)(28)は急激に変化することはなく、明度の不連続さが小さくなる。   The weights for the pixels in the boundary adjacent region 270 are determined so that the weight increases as the pixel moves from the boundary between the non-shadow region and the shadow region to the inside of the shadow region. The post-processing lightness data Ig (x, y) (28) is close to the improvement target lightness data Io (x, y) (22) when the pixel is close to the boundary, and as the pixel goes into the shadow area, The lightness data Ic (x, y) (26) after the contrast improvement is approached. Therefore, the lightness data Ig (x, y) (28) after gradation processing does not change abruptly for pixels in the shaded area and close to the boundary, and the lightness discontinuity is reduced.

図17は、グラデーション処理を実行した結果得られるグラデーション処理後明度データ28が表す明度画像の例を示す図である。この画像は、図2に例示した明度画像を表す改善対象明度データ22から生成された、コントラストが改善された明度画像(図10)を表すコントラスト改善後明度データ26に基づいて生成されたグラデーション処理後明度データ28が表す明度画像である。この図には、図10に例示したような、明度が不連続となる領域が存在していない。すなわち、図10に陰影部領域として検出された領域10a、10b、10cのような、陰影部と非陰影部との境界に位置する領域での明度の不連続はなくなり、領域10d、10eのような目視したときに一つの陰影部と見える領域内における、2値化閾値より高い明度の部分と2値化閾値より低い明度の部分との間の明度の不連続はほぼ解消されている。このように、グラデーション処理を実行することにより境界での明度の変化は滑らかになり、不自然さは緩和される。   FIG. 17 is a diagram illustrating an example of the brightness image represented by the brightness data 28 after the gradation process obtained as a result of executing the gradation process. This image is a gradation process generated based on the post-contrast lightness data 26 representing the lightness image with improved contrast (FIG. 10) generated from the lightness data 22 to be improved representing the lightness image illustrated in FIG. It is the brightness image which the back brightness data 28 represents. In this figure, there is no region where the brightness is discontinuous, as illustrated in FIG. That is, there is no discontinuity in lightness in regions located at the boundary between the shaded portion and the non-shadowed portion, such as the regions 10a, 10b, and 10c detected as the shaded region in FIG. The discontinuity of the brightness between the portion having the brightness higher than the binarization threshold and the portion having the brightness lower than the binarization threshold in the region that can be seen as one shaded portion when being visually observed is almost eliminated. As described above, by executing the gradation process, the change in brightness at the boundary becomes smooth, and the unnaturalness is reduced.

例えば図10内の領域10a、10b、10cに関しては、図11に示したように、目視したときに非陰影部と見えるが2値化閾値より小さい明度を有するために、陰影部に属すると検出された領域のグラデーション処理後の明度は、目視したときの隣接する非陰影部の明度に近い明度から、隣接する目視したときに陰影部と見え、2値化閾値より小さいために陰影部領域明度変換部300により明度変換を受けた後の明度に近い明度までの範囲で変化している。したがって、陰影部領域明度変換部300により生じた明度が急に変化するという現象がグラデーション処理後に解消されていることが分かる。更に、グラデーション処理を行っても、もともとある陰影部分と日向の部分との明度差は残る。しかし、人にはもともと存在する陰影と日向の部分との境界は自然に見えるため問題はない。   For example, the regions 10a, 10b, and 10c in FIG. 10 are detected as belonging to a shaded portion because they appear as non-shadowed portions when viewed visually but have a lightness smaller than the binarization threshold as shown in FIG. Since the brightness after gradation processing of the displayed area is lighter than the brightness of the adjacent non-shaded area when viewed visually, it appears as a shaded area when viewed adjacently and is smaller than the binarization threshold value. It changes in the range up to the lightness close to the lightness after the lightness conversion is performed by the conversion unit 300. Therefore, it can be seen that the phenomenon that the lightness caused by the shadow area lightness conversion unit 300 changes suddenly is eliminated after gradation processing. Furthermore, even if gradation processing is performed, the brightness difference between the originally shaded portion and the sunny portion remains. However, there is no problem for humans because the boundary between the shadow that originally exists and the part of the sun appears natural.

より具体的には、図10内の領域10dに関しては、図12に示したように、この領域は、目視したときに非陰影部と見えるが、2値化閾値より少し大きい明度を有するために、非陰影部に属すると検出され、陰影部領域明度変換部300による明度変換を受けない領域と、隣接する目視したときに陰影部と見え、2値化閾値より小さい明度を有するために、陰影部領域として検出され、陰影部領域明度変換部300により明度変換を受ける領域とが含まれている。後者の領域では、グラデーション処理後の明度は、隣接する目視したときに陰影部と見えるが、2値化閾値より大きいために陰影部領域明度変換部300による明度変換を受けない明度に近い明度から、目視したときに陰影部と見え、明度が閾値より小さいために明度変換を受けた後の明度に近い明度まで変化している。したがって、陰影部領域明度変換部300により生じた明度が急に変化するという現象がグラデーション処理後に解消されることが分かる。   More specifically, as shown in FIG. 12, regarding the region 10d in FIG. 10, this region appears to be a non-shaded portion when visually observed, but has a lightness slightly larger than the binarization threshold. , The region that is detected as belonging to the non-shadow portion and is not subjected to the lightness conversion by the shadow portion region lightness conversion unit 300, appears adjacent to the shadow portion when viewed visually, and has a lightness smaller than the binarization threshold. And a region which is detected as a partial region and is subjected to lightness conversion by the shaded region lightness conversion unit 300. In the latter area, the lightness after gradation processing appears to be a shaded part when viewed adjacently, but since it is larger than the binarization threshold, the lightness from the lightness close to the lightness not subjected to lightness conversion by the shaded area lightness conversion unit 300 When viewed, it appears as a shaded portion, and since the brightness is smaller than the threshold value, the brightness changes to a brightness close to the brightness after the brightness conversion. Therefore, it can be seen that the phenomenon that the lightness caused by the shadow area lightness conversion unit 300 changes suddenly is eliminated after gradation processing.

同様に、図10内の領域10eに関しては、図13に示したように、この領域は、目視したときに陰影部と見える領域と、目視したときに非陰影部と見える領域とが隣接していているが、目視したときに陰影部と見える領域には、2値化閾値より少し大きい明度を有するために非陰影部に属すると検出され、陰影部領域明度変換部300による明度変換を受けない領域と、隣接する目視したときに陰影部と見え、2値化閾値より小さい明度を有するために陰影部領域として検出され、陰影部領域明度変換部300による明度変換を受ける領域とが含まれている。後者の領域では、グラデーション処理後の明度は、領域10dの場合と同じく、隣接する目視したときに陰影部と見えるが、2値化閾値より大きいために陰影部領域明度変換部300による明度変換を受けない明度に近い明度から、目視したときに陰影部と見え、明度が閾値より小さいために明度変換を受けた後の明度に近い明度まで変化している。したがって、陰影部領域明度変換部300により生じた明度が急に変化するという現象がグラデーション処理後に解消されることが分かる。   Similarly, regarding the region 10e in FIG. 10, as shown in FIG. 13, this region is adjacent to a region that appears as a shaded portion when viewed and a region that appears as a non-shadowed portion when viewed. However, the region that appears to be a shadow portion when visually observed has a lightness that is slightly larger than the binarization threshold, and thus is detected as belonging to a non-shadow portion, and is not subjected to lightness conversion by the shadow region lightness conversion unit 300. An area and an area that appears as a shadow part when viewed adjacently and has a lightness smaller than a binarization threshold and is detected as a shadow part area and subjected to lightness conversion by the shadow part lightness conversion unit 300 are included. Yes. In the latter area, the lightness after gradation processing appears to be a shaded part when adjacent to it as in the case of the area 10d. It changes from a lightness close to the lightness not received to a shaded portion when visually observed, and to a lightness close to the lightness after undergoing lightness conversion because the lightness is smaller than the threshold value. Therefore, it can be seen that the phenomenon that the lightness caused by the shadow area lightness conversion unit 300 changes suddenly is eliminated after gradation processing.

なお、グラデーション段階数が少ないと、陰影部領域の明度変換の結果、明度が急上昇した部分の一部のみでしか明度の急激な変化が抑えられず、明度の急激な変化を抑えきれない部分が残ることになる。したがって、グラデーション段階数はある程度の大きさを有する必要がある。しかし、グラデーション段階数を多くすると、次のような現象が発生し、問題になることがある。(a) 影の端が暗いままとなり、その部分が目立ち、画像が見づらくなる。この現象の影響は、小さめの影ほど強くなる。(b) 複数のグラデーション領域は、図15に示されたように、非陰影部領域を縁取りするように位置する。グラデーション段階数が多いと、この縁取り部分が太くなり、画像が縁取りにより不自然に見える。以上から、グラデーション段階数は多すぎず少なすぎないことが重要であり、試行錯誤の結果4〜6程度がよいことが判明した。そこで、本実施の形態ではグラデーション段階数Gnumを4とした。   If the number of gradation steps is small, as a result of the brightness conversion of the shadow area, only a part of the part where the brightness has risen sharply can be suppressed, and there is a part that can not suppress the rapid change in brightness. Will remain. Therefore, the number of gradation steps needs to have a certain size. However, if the number of gradation steps is increased, the following phenomenon may occur and become a problem. (a) The edge of the shadow remains dark, the portion is noticeable, and the image is difficult to see. The effect of this phenomenon becomes stronger with smaller shadows. (b) As shown in FIG. 15, the plurality of gradation areas are positioned so as to border the non-shadow area. If the number of gradation steps is large, the border becomes thick and the image looks unnatural due to the border. From the above, it is important that the number of gradation steps is not too large and not too small, and as a result of trial and error, it is found that about 4 to 6 is good. Therefore, the gradation step number Gnum is set to 4 in the present embodiment.

図1に戻ると、プログラム40は、つぎにカラー形式逆変換部500を実行する。この処理では、グラデーション処理後明度データ28と彩度データ22Aと色相データ22Bを用いて、HIS→RGB変換を行い、RGBモデルの改善後カラー画像データ29を生成して記憶装置20に格納する。なお、HIS→RGB変換のアルゴリズムについては、例えば前述の参考文献を参照。   Returning to FIG. 1, the program 40 then executes the color format inverse conversion unit 500. In this process, HIS → RGB conversion is performed using the brightness data 28 after gradation processing, the saturation data 22A, and the hue data 22B, and improved color image data 29 of the RGB model is generated and stored in the storage device 20. For the HIS → RGB conversion algorithm, see, for example, the aforementioned reference.

以下においては、陰影部領域の明度のコントラストを改善するのに好適な陰影部領域明度変換部300の処理を説明する。陰影部領域明度変換部300は、既に説明したように、まず陰影部領域ヒストグラム検出部600により、改善対象明度データ22のうち、陰影部領域データ23Bが示す陰影部領域内の画素に関する実ヒストグラムデータ24Aを生成した後に、目標ヒストグラム生成部700が目標ヒストグラムデータ24Bを決定する。   In the following, the process of the shadow area lightness conversion unit 300 suitable for improving the brightness contrast of the shadow area will be described. As described above, the shadow region brightness conversion unit 300 first uses the shadow region histogram detection unit 600 to perform actual histogram data related to pixels in the shadow region indicated by the shadow region data 23B in the improvement target lightness data 22. After generating 24A, the target histogram generation unit 700 determines target histogram data 24B.

図18は、目標ヒストグラム生成部700の概略フローチャートである。目標ヒストグラム生成部700は、中央領域決定部710と、中央領域拡大部720と、上下側領域拡大部730という複数のモジュールを含み、これらのモジュールをこの順に順次実行する。目標ヒストグラム生成部700は、まず中央領域決定部710を実行する。   FIG. 18 is a schematic flowchart of the target histogram generator 700. The target histogram generation unit 700 includes a plurality of modules including a central region determination unit 710, a central region enlargement unit 720, and an upper and lower side region enlargement unit 730, and sequentially executes these modules in this order. The target histogram generation unit 700 first executes the center area determination unit 710.

図19は、中央領域決定部710の処理の一例の概略フローチャートである。本実施の形態では、改善対象明度データ22内に存在する陰影部領域に属する画素の総数Nsに対して一定の比率Rを有する、明度が小さい側の画素の集合を下側領域Aとし、当該陰影部領域内総画素数Nsに対して一定の比率Rを有する、明度が大きい側の画素の集合を上側領域Cと定める。一定の比率Rは、利用者にあらかじめ指定させておく。   FIG. 19 is a schematic flowchart of an example of processing of the central area determination unit 710. In the present embodiment, the lower region A is a set of pixels having a constant ratio R with respect to the total number Ns of pixels belonging to the shaded region existing in the improvement target lightness data 22 and having a lower lightness. A set of pixels on the higher brightness side having a constant ratio R with respect to the total number Ns of pixels in the shaded area is defined as the upper area C. The constant ratio R is specified in advance by the user.

図19において、まず、明度値nを初期値0に設定し(ステップS711)、得られたヒストグラムデータを表す関数f(i)に基づいて、最小の明度値0から明度値n迄の画素数の累積値が上記陰影部領域内総画素数Nsと一定の比率Rとの積Ns×Rを越えたか否かを判定し(ステップS712)、越えていないときには、明度値nを値1だけ増大する(ステップS713)ことを繰り返し、ステップS712において、初めて画素数の積算値が上記積を越えたと判断されたときに、そのときの明度値nの値を、ヒストグラム下限領域Aの上限明度aに設定する(ステップS714)。中央領域Bの下限明度はa+1になる。   In FIG. 19, first, the brightness value n is set to an initial value 0 (step S711), and the number of pixels from the minimum brightness value 0 to the brightness value n is determined based on the function f (i) representing the obtained histogram data. It is determined whether or not the accumulated value exceeds the product Ns × R of the total number of pixels Ns in the shaded area and a certain ratio R (step S712). If not, the brightness value n is increased by 1 (Step S713) is repeated, and when it is determined in Step S712 that the integrated value of the number of pixels has exceeded the product for the first time, the value of the brightness value n at that time is set as the upper limit brightness a of the histogram lower limit area A. Setting is made (step S714). The lower limit lightness of the central area B is a + 1.

その後ステップS715において、明度値nの値を1だけ増やして、最小の明度値0から明度値nまでの値に対する画素数の累積値が陰影部領域内総画素数Nsと(1−R)との積にNs×(1−R)を初めて越えるとステップS716で判定されるまで、明度値nを値1増大することを繰り返し(ステップS717)、上記累積値が初めて上記積を越えたときに、そのときの明度値nより1小さい値をヒストグラムの上側領域Cの下限明度bとする(ステップS718)。中央領域Bの上限はb−1となる。   Thereafter, in step S715, the value of the lightness value n is increased by 1, and the cumulative value of the number of pixels with respect to the value from the minimum lightness value 0 to the lightness value n is the total number of pixels Ns in the shadow area and (1-R). When Ns × (1−R) exceeds Ns × (1−R) for the first time, the brightness value n is repeatedly incremented by 1 until it is determined in Step S716 (Step S717), and when the cumulative value exceeds the product for the first time. The value 1 smaller than the lightness value n at that time is set as the lower limit lightness b of the upper area C of the histogram (step S718). The upper limit of the central area B is b-1.

これにより、中央領域Bとして、明度a+1からb−1までの明度に対するヒストグラム部分が決定される。ヒストグラムの下側領域の最大明度はaとなり、上側領域Cの最小明度はbとなる。なお、以上のようにして求めた値a、bをそれぞれヒストグラムの中央領域Cの最小明度、最大明度としてもよいことは言うまでもない。このときには、下側領域Aの上限明度はa−1となり、上側領域Cの下限明度はb+1となる。   As a result, a histogram portion for the lightness from lightness a + 1 to b-1 is determined as the central region B. The maximum brightness of the lower area of the histogram is a, and the minimum brightness of the upper area C is b. Needless to say, the values a and b obtained as described above may be used as the minimum brightness and the maximum brightness of the central area C of the histogram, respectively. At this time, the upper limit brightness of the lower area A is a-1, and the lower limit brightness of the upper area C is b + 1.

こうして中央領域決定部710の処理が終了すると、中央領域拡大部720が実行される。中央領域拡大部720は、決定された中央領域Bの下限明度a+1と上限明度b−1とを使用して、図9(a)に示した中央領域Bに対して、図31(a)に示したような線形変換を実施し、図9(b)に示したように、中央領域Bは、最小明度0から最大明度MAXまでの拡大された明度範囲に分布する拡大ヒストグラムg(i)に変換する。なお、ここでは、中央領域Bを拡大するために線形変換を使用したが、場合により非線形変換等の他の変換を使用してもよい。   When the processing of the central area determination unit 710 is completed in this way, the central area enlargement unit 720 is executed. The central area enlargement unit 720 uses the lower limit lightness a + 1 and the upper limit lightness b-1 of the determined central area B, and the central area B shown in FIG. As shown in FIG. 9B, the center region B is expanded into an enlarged histogram g (i) distributed in the enlarged brightness range from the minimum brightness 0 to the maximum brightness MAX. Convert. Here, linear transformation is used to enlarge the central region B, but other transformations such as nonlinear transformation may be used in some cases.

図9(b)に示したように、従来技術での線形変換では、元のヒストグラムの下側領域Aに属する画素の明度は明度0のところに変換され、元の上側領域Cに属していた画素の明度は明度の最大明度MAXのところに変換されるが、本実施の形態では、これらの領域に属していた画素には上記線形変換を施さない。すなわち、図18に戻り、目標ヒストグラム生成部700は、中央領域拡大部720の実行後に上下側領域拡大部730を実行する。上下側領域拡大部730は、これらの領域A、Cの画素を、図9(c)に示したように、これらの領域A、Cを組み合わせて最小明度から最大明度MAXまでに画素が分布する組合せヒストグラムに変換し、変換で生成される組合せヒストグラムを先に生成された拡大ヒストグラムg(i)と合成して目標ヒストグラムh(i)を生成する。この結果、従来技術で生じる白とびとつぶれは生じない。上記のように、上下側領域拡大部730による処理は、線形変換で発生するオーバーフローした画素を、線形変換後の明度のヒストグラムの下部に配置する処理であるとも言える。本明細書では、このような処理をクリッピングとも呼ぶことがある。   As shown in FIG. 9B, in the linear conversion in the prior art, the brightness of the pixels belonging to the lower area A of the original histogram is converted to the brightness 0 and belongs to the original upper area C. The brightness of the pixel is converted to the maximum brightness MAX of the brightness, but in the present embodiment, the linear conversion is not performed on the pixels belonging to these regions. That is, returning to FIG. 18, the target histogram generation unit 700 executes the upper and lower side region enlargement unit 730 after the execution of the central region enlargement unit 720. As shown in FIG. 9C, the upper and lower side region enlargement unit 730 distributes pixels from the minimum brightness to the maximum brightness MAX by combining these areas A and C, as shown in FIG. 9C. Conversion into a combination histogram is performed, and the combination histogram generated by the conversion is combined with the previously generated enlarged histogram g (i) to generate a target histogram h (i). As a result, the overexposure that occurs in the prior art does not occur. As described above, it can be said that the processing performed by the upper and lower side area enlargement unit 730 is a process of placing an overflowed pixel generated by linear conversion below the brightness histogram after linear conversion. In this specification, such processing may be referred to as clipping.

図20は、上下側領域拡大部730の処理の一例の概略フローチャートである。ステップS731では、元の実ヒストグラムの下側領域Aの画素数の累積と上側領域Cの画素数の累積との総和を、異なる明度の総数である(MAX+1)で割ることにより平均画素数aveを計算する。この平均画素数aveは、これらの下側領域Aと上側領域Cとの組合せに対する組合せヒストグラムとして、最小明度から最大明度までの明度範囲で一様なヒストグラムを使用する場合の各明度における画素数を与えるものである。ステップS732以降では、この組合せヒストグラムと、先に線形変換で得られた拡大されたヒストグラムg(i)とを合成して目標ヒストグラムh(i)を生成するようになっている。   FIG. 20 is a schematic flowchart of an example of processing of the upper and lower region enlargement unit 730. In step S731, the average number of pixels ave is obtained by dividing the sum of the accumulation of the number of pixels in the lower region A of the original actual histogram and the accumulation of the number of pixels in the upper region C by the total number of different brightness (MAX + 1). calculate. The average number of pixels ave is the number of pixels at each brightness when a uniform histogram is used in the brightness range from the minimum brightness to the maximum brightness as a combination histogram for the combination of the lower area A and the upper area C. To give. In step S732 and subsequent steps, the combined histogram and the enlarged histogram g (i) previously obtained by the linear transformation are combined to generate the target histogram h (i).

まず、ステップS732では、明度iを最小値0に設定する。その後ステップS733で、明度iに対して拡大されたヒストグラムg(i)と平均画素数averとを加算して、合成後のヒストグラムを表す関数h(i)を計算する。その後ステップS733で明度iを1だけ増大して、明度が最大明度MAXを超えない範囲でステップS734の計算を繰り返す。こうして、先に得られた拡大されたヒストグラムと上記組合せヒストグラムを合成したヒストグラムh(i)が得られ、このヒストグラムh(i)が、目標ヒストグラムとして使用される。この目標ヒストグラムを表す目標ヒストグラムデータ24Bが記憶装置20に格納される。   First, in step S732, the brightness i is set to the minimum value 0. Thereafter, in step S733, the enlarged histogram g (i) and the average pixel number aver are added to the brightness i, and a function h (i) representing the combined histogram is calculated. Thereafter, in step S733, the lightness i is increased by 1, and the calculation in step S734 is repeated within a range where the lightness does not exceed the maximum lightness MAX. Thus, a histogram h (i) obtained by combining the previously obtained enlarged histogram and the combination histogram is obtained, and this histogram h (i) is used as the target histogram. Target histogram data 24B representing the target histogram is stored in the storage device 20.

なお、ステップS731において計算された平均画素数averは、一般には整数ではない。したがって、合成後の目標ヒストグラムh(i)も整数でなくなる。しかし、ステップS733で目標ヒストグラムh(i)を決定するときには、画素数h(i)を、整数となるように決定するものとする。   Note that the average pixel number aver calculated in step S731 is generally not an integer. Accordingly, the combined target histogram h (i) is not an integer. However, when the target histogram h (i) is determined in step S733, the number of pixels h (i) is determined to be an integer.

そのための一つの方法は、平均画素数averが整数でないときには、ステップS733において、拡大されたヒストグラムの画素数g(i)と平均画素数averを加算するときに、明度iに応じて加算する平均画素数averの値としてステップS731で計算された平均画素数averを越えない最大の整数と、それより1大きな整数との一組の整数を交互に選んで使用し、全ての明度iに対して使用した平均画素数averの総和が、ステップS731の平均の計算式の分子で計算された総画素数に等しくなるように、明度iに応じて平均画素数averを調整すればよい。もちろん、他の方法を使用することもできる。以下では、このようにして、目標ヒストグラムの画素数h(i)が整数になるように決定されるとする。   One method for this is to calculate the average to be added according to the brightness i when adding the pixel number g (i) of the enlarged histogram and the average pixel number aver in step S733 when the average pixel number aver is not an integer. As a value of the pixel number aver, a set of integers of the maximum integer not exceeding the average pixel number aver calculated in step S731 and an integer larger than that are alternately selected and used for all the brightness i. The average pixel number aver may be adjusted according to the lightness i so that the total sum of the used average pixel number aver is equal to the total pixel number calculated by the numerator of the average calculation formula in step S731. Of course, other methods can be used. In the following, it is assumed that the number of pixels h (i) in the target histogram is determined to be an integer in this way.

なお、目標ヒストグラムの画素数h(i)は非整数のままにして、後で明度変換するときに、上に述べたのと類似の方法を使用して、非整数の平均値h(i)に対して割り当てる画素の数が整数となるように、割り当てる画素数を調整してもよい。こうして目標ヒストグラム生成部700の処理が終わる。   It should be noted that when the pixel number h (i) of the target histogram is left as a non-integer and brightness conversion is performed later, a non-integer average value h (i) is used by using a method similar to that described above. The number of assigned pixels may be adjusted so that the number of assigned pixels becomes an integer. Thus, the processing of the target histogram generation unit 700 is finished.

図1に戻り、プログラム40はつぎに明度変換部800を実行する。図21は、明度変換部800の概略フローチャートである。明度変換部800は、明度変換データ生成部810と、明度変換実行部830という複数のモジュールを含み、これらのモジュールを順次実行する。明度変換部800は、まず明度変換データ生成部810を実行し、明度変換データ25を生成する。このデータは、改善対象明度データ22の陰影部領域の画素の明度のヒストグラムが、実ヒストグラムデータ24Aから目標ヒストグラムデータ24Bに変化するように、それらの画素の明度を変換するためのデータである。明度変換データ生成部810の処理の詳細を説明する前に明度変換がどのように行われるかを説明する。   Returning to FIG. 1, the program 40 next executes the lightness conversion unit 800. FIG. 21 is a schematic flowchart of the lightness conversion unit 800. The lightness conversion unit 800 includes a plurality of modules, a lightness conversion data generation unit 810 and a lightness conversion execution unit 830, and sequentially executes these modules. The lightness conversion unit 800 first executes the lightness conversion data generation unit 810 to generate the lightness conversion data 25. This data is data for converting the brightness of the pixels in the shaded area of the improvement target brightness data 22 so that the brightness of those pixels changes so that the actual histogram data 24A changes to the target histogram data 24B. Before describing the details of the processing of the lightness conversion data generation unit 810, how lightness conversion is performed will be described.

図22は、実ヒストグラムデータ24Aと目標ヒストグラムデータ24Bとに基づいて行われる明度変換を説明するための図である。同図(a)は、陰影部領域内の画素に関する実ヒストグラムデータ24Aの例を示す図である。同図(b)は、目標ヒストグラムデータ24Bの例を示す図である。同図(c)は、同図(a)に示す実ヒストグラムデータ24Aを表す関数f(i)のグラフを示す図である。同図(d)は、同図(b)に示す目標ヒストグラムデータ24Bを表す関数h(i)のグラフを示す図である。同図(c)では、同じ明度の画素に関しては、同じ斜線等の模様を用いて画素数が示されている。同図(d)では、同図(c)の明度が変換される前の画素に対して用いた模様が、明度が変換された後の画素にも付けられている。   FIG. 22 is a diagram for explaining brightness conversion performed based on the actual histogram data 24A and the target histogram data 24B. FIG. 6A is a diagram showing an example of actual histogram data 24A relating to pixels in the shaded area. FIG. 6B is a diagram showing an example of the target histogram data 24B. FIG. 10C is a graph showing a function f (i) representing the actual histogram data 24A shown in FIG. FIG. 4D is a graph showing a function h (i) representing the target histogram data 24B shown in FIG. In FIG. 5C, the pixels having the same brightness are shown using the same hatched pattern or the like. In FIG. 6D, the pattern used for the pixel before the lightness conversion in FIG. 5C is also applied to the pixel after the lightness conversion.

例えば、目標ヒストグラムデータ24Bの明度0には、実ヒストグラムデータ24Aの明度0、1のそれぞれ一つの画素と、明度2の2個の画素のうちの一つの合計3つの画素が割り当てられる。同様に、目標ヒストグラムデータ24Bの明度1には、実ヒストグラムデータ24Aの明度2の2個の画素のうちの残りの一つと、現明度3の3つの画素のうちの2個の画素との合計3個の画素が割り当てられる。同様に、目標ヒストグラムデータ24Bの明度2には、実ヒストグラムデータ24Aの明度3の3個の画素のうちの残りの一つと、現明度4の4つの画素のうちの3個の画素との合計4個の画素が割り当てられる。同様に、目標ヒストグラムデータ24Bの明度3には、実ヒストグラムデータ24Aの明度4の4個の画素のうちの残りの一つと、現明度5の5つの画素のうちの4個の画素との合計5個の画素が割り当てられる。以下、同様である。   For example, the lightness 0 of the target histogram data 24B is assigned a total of three pixels, one pixel each of lightness 0 and 1 of the actual histogram data 24A and one of the two pixels of lightness 2. Similarly, the lightness 1 of the target histogram data 24B includes the sum of the remaining one of the two pixels of lightness 2 of the actual histogram data 24A and the two pixels of the three pixels of current lightness 3. Three pixels are allocated. Similarly, the lightness 2 of the target histogram data 24B includes the sum of the remaining one of the three pixels of lightness 3 of the actual histogram data 24A and the three pixels of the four pixels of current lightness 4. Four pixels are allocated. Similarly, the lightness 3 of the target histogram data 24B includes the sum of the remaining one of the four pixels of lightness 4 of the actual histogram data 24A and the four pixels of the five pixels of current lightness 5. Five pixels are allocated. The same applies hereinafter.

図23は、図22(a)と(b)に示された実ヒストグラムデータ24Aと目標ヒストグラムデータ24Bに対する明度変換データ25の例としての明度変換テーブルの例を示す図である。以下では、明度変換テーブルも参照符号25を引用して明度変換テーブル25と呼ぶ場合もある。明度変換データ25は、変換元の画素の明度i(25a)と、当該明度iを有する変換対象画素の総数f(i)(25b)と、当該明度iに対する変換先明度T(i)(25c)と、同じ明度iに対する変換先明度T(i)が複数個ある場合には、同じ明度iの変換対象画素の総数f(i)のうちそれぞれの変換先明度T(i)に変換される部分変換対象画素数(25d)とを含む。   FIG. 23 is a diagram showing an example of a brightness conversion table as an example of the brightness conversion data 25 for the actual histogram data 24A and the target histogram data 24B shown in FIGS. 22 (a) and 22 (b). Hereinafter, the lightness conversion table may also be referred to as the lightness conversion table 25 by quoting the reference numeral 25. The lightness conversion data 25 includes the lightness i (25a) of the conversion source pixel, the total number f (i) (25b) of conversion target pixels having the lightness i, and the conversion destination lightness T (i) (25c) for the lightness i. ) And a plurality of conversion destination lightness T (i) for the same lightness i, of the total number f (i) of conversion target pixels having the same lightness i, each of the conversion target lightnesses T (i) is converted. And the number of pixels subject to partial conversion (25d).

変換先明度T(i)(25c)は、目標ヒストグラムh(i)となるように、元画像のヒストグラムデータ24Aを低明度から順に足し合わせていき、明度変換する際の各画素の明度の割当てを再構成する。もちろん高明度の画素から順に割り当てるようにしてもよい。この際、同じ変換元の明度iに対する変換先の明度T(i)(25c)が複数個ある場合には、それぞれの変換先明度毎に、その明度に変換されるべき部分変換対象画素数を決めてある。なお、元の画素の明度の変換にあたっては、明度変換対象画素の総数から、それぞれの変換先明度に変換される画素をランダムに決定する。この決定については、後に例を用いて更に詳しく説明する。   The destination lightness T (i) (25c) is the target histogram h (i), and the histogram data 24A of the original image is added in order from the lowest lightness, and the lightness assignment of each pixel at the time of lightness conversion is performed. Reconfigure. Of course, the pixels may be assigned in order from the pixel with the highest brightness. At this time, when there are a plurality of conversion destination brightness T (i) (25c) for the same conversion source brightness i, the number of partial conversion target pixels to be converted to the brightness for each conversion destination brightness is determined. I have decided. Note that when converting the lightness of the original pixels, the pixels to be converted into the respective lightness values of the conversion destination are randomly determined from the total number of lightness conversion target pixels. This determination will be described in more detail later using an example.

図24は、明度変換データ生成部810の処理の一例の概略フローチャートであり、ここでは、明度変換データ25として、図23に例示した明度変換テーブル25を生成する。以下では、図22(a)又は(c)に示した変換元の実ヒストグラムデータ24Aと図22(b)又は(d)に示した目標ヒストグラムデータ24Bとを適宜参照して、明度変換データ生成部810の処理を説明する。   FIG. 24 is a schematic flowchart of an example of processing of the lightness conversion data generation unit 810. Here, the lightness conversion table 25 illustrated in FIG. 23 is generated as the lightness conversion data 25. Hereinafter, lightness conversion data generation is performed by appropriately referring to the conversion source actual histogram data 24A shown in FIG. 22 (a) or (c) and the target histogram data 24B shown in FIG. 22 (b) or (d). The processing of the unit 810 will be described.

明度変換データ生成部810は、まずステップS811で、明度iを0にセットし、変数HighとLowを0にセットする。変数Highは、目標の明度iに割り当てる元の画像の明度の最大明度であり、変数Lowは、目標の明度iに割り当てる元の画像の明度の最小値である。ステップS812で、明度iが最大明度MAX以下であるか否かを判定し、そうであれば、ステップS813にて変数Sumを初期値0にセットする。変数Sumは、目標ヒストグラムの明度iにおける画素数h(i)に対する割当て候補とされた元の画像の画素の数を表す。   In step S811, the lightness conversion data generation unit 810 first sets the lightness i to 0 and sets the variables High and Low to 0. The variable High is the maximum brightness of the original image assigned to the target brightness i, and the variable Low is the minimum brightness of the original image assigned to the target brightness i. In step S812, it is determined whether or not the brightness i is equal to or less than the maximum brightness MAX. If so, the variable Sum is set to an initial value 0 in step S813. The variable Sum represents the number of pixels of the original image that are candidates for assignment to the number of pixels h (i) at lightness i of the target histogram.

つぎにステップS814において変数Sumが、目標ヒストグラムの明度iにおける画素数h(i)より小さいか否かを判定する。すなわち、目標ヒストグラムの明度iにおける画素数h(i)より小さいときには、元の画像の明度Highの画素を割り当てられる可能性があることになる。ステップS814での判定の結果がYesであれば、ステップS815において、元の実ヒストグラムデータ24Aの明度Highでの画素数f(High)、今の例ではf(0)を変数Sumに加算し、変数Highの値を1だけ増大する。今の例では、変数Sumは、f(0)に等しくなり、変数Highは値1になる。その後、ステップS814以降が再度実行される。ステップS814では、ステップS815で更新された変数Sumの更新後の値が目標ヒストグラムデータ24Bの明度iにおける画素数h(i)より小さいか否かを判定する。小さい限り、ステップS815が繰り返される。   In step S814, it is determined whether the variable Sum is smaller than the number of pixels h (i) at the brightness i of the target histogram. That is, when the pixel count h (i) is smaller than the pixel number h (i) at the lightness i of the target histogram, there is a possibility that a pixel having a lightness High in the original image may be assigned. If the result of determination in step S814 is Yes, in step S815, the number of pixels f (High) at the lightness High of the original actual histogram data 24A, in this example, f (0) is added to the variable Sum. Increase the value of the variable High by 1. In this example, the variable Sum is equal to f (0), and the variable High has the value 1. Thereafter, step S814 and subsequent steps are executed again. In step S814, it is determined whether or not the updated value of the variable Sum updated in step S815 is smaller than the number of pixels h (i) at the brightness i of the target histogram data 24B. Step S815 is repeated as long as it is smaller.

図22(a)又は(c)の場合には、目標ヒストグラムデータ24Bの明度0における画素数h(0)は3であり、元の画像の明度0、1、2における画素数はそれぞれ1、1、2であるので、Sumがf(0)(=1)になり、変数Highが1になり、その後にSumがf(0)+f(1)=2に増大され、変数Highも値2に増大された後も、ステップS814では、Sumはまだ目標画素数h(0)(=3)より小さいと判断され、ステップS815で再度Sumに次の元の画素数f(2)が加算されてSumの値はf(0)+f(1)+f(2)(=4)になり、変数Highが3に増大される。加算後のSumの値4は、目標の画素数h(0)=3より大きくなる。このことは、目標の明度i=0に対して、元の画像の明度0、1の画素を割り付けることができるが、明度2の画素は全てを割り付けられないことを意味する。したがって、処理はステップS816に移る。そこでは、変数Highが1だけ減じられ、今の例では値2になり、差分Deltを次式2により求める。   In the case of FIG. 22 (a) or (c), the number of pixels h (0) at lightness 0 of the target histogram data 24B is 3, and the number of pixels at lightness 0, 1, 2 of the original image is 1, respectively. Since 1, 2, Sum becomes f (0) (= 1), the variable High becomes 1, and then Sum is increased to f (0) + f (1) = 2, and the variable High also has the value 2 In step S814, it is determined that Sum is still smaller than the target pixel number h (0) (= 3), and the next original pixel number f (2) is added to Sum again in step S815. Thus, the value of Sum becomes f (0) + f (1) + f (2) (= 4), and the variable High is increased to 3. The sum value 4 after the addition is larger than the target pixel number h (0) = 3. This means that pixels of lightness 0 and 1 in the original image can be assigned to the target lightness i = 0, but all pixels of lightness 2 cannot be assigned. Therefore, the process proceeds to step S816. There, the variable High is decremented by 1, resulting in a value of 2 in the present example, and the difference Delt is determined by the following equation 2.

Delt=f(High)−(Sum−h(i)) (2)
ここで、(Sum−h(i))は、割当て候補の画素の総数Sumのうち、目標の画素数h(i)を越えた画素の総数であり、差分Deltは、割当て候補の画素のうちの最大の明度の画素数f(High)のうち、上記目標の画素数h(i)を越えた画素の総数分だけ少ない画素の数、すなわち、画素数f(High)のうち目標の明度iに割当て可能な画素の数を表す。例えば、図22(a)又は(c)の場合には、Sumは4であり、h(0)は3であり、f(2)は2であるので、上記差分Deltは1となる。すなわち、元の画像の明度2の2個の画素のうち1個は目標の明度0に割り当てられるが、残りの1個は、目標の明度0には割り当てられないことを示している。
Delt = f (High) − (Sum−h (i)) (2)
Here, (Sum−h (i)) is the total number of pixels exceeding the target pixel number h (i) in the total number Sum of allocation candidate pixels, and the difference Delt is the allocation candidate pixel Out of the maximum number of pixels f (High), the number of pixels smaller by the total number of pixels exceeding the target pixel number h (i), that is, the target brightness i of the number of pixels f (High). Represents the number of pixels that can be assigned to. For example, in the case of FIG. 22 (a) or (c), Sum is 4, h (0) is 3, and f (2) is 2, so the difference Delt is 1. That is, one of the two pixels of lightness 2 of the original image is assigned to the target lightness 0, but the remaining one is not assigned to the target lightness 0.

ステップS817では、変数Low(今の場合には0)が変数High(今の場合は2)より小さいので、ステップS818において、変数Tmpが変数Lowの値(今の場合は0)にセットされ、ステップS820で、明度変換テーブル25の明度Tmap(今の例では0)に対する変換先明度T(Tmap)(今の例ではT(0))として明度i(今の例では0)を設定する。すなわち、陰影部領域内の明度0に変換先T(0)として明度0が決定される。ステップS820が繰り返される毎に、ステップS819で変数Tmpが変数Highより小さいか否かが判定され、小さいときにステップS820が繰り返される。こうしてステップS820が繰り返され、変数Tmpを1だけ増大し、同様に元の明度1に対する変換先明度T(1)として明度0が決定される。   In step S817, the variable Low (0 in this case) is smaller than the variable High (2 in this case), so in step S818, the variable Tmp is set to the value of the variable Low (0 in this case) In step S820, the lightness i (0 in the present example) is set as the conversion destination lightness T (Tmap) (T (0) in the present example) for the lightness Tmap (0 in the present example) of the lightness conversion table 25. That is, the lightness 0 in the shaded area is determined as the conversion destination T (0). Each time step S820 is repeated, it is determined in step S819 whether or not the variable Tmp is smaller than the variable High. When the variable Tmp is smaller, step S820 is repeated. In this way, step S820 is repeated, and the variable Tmp is increased by 1. Similarly, the lightness 0 is determined as the conversion lightness T (1) for the original lightness 1.

以上により、元の画素の明度iが0、1のときには、変換先の明度はいずれも明度0であると決定される。このように変換元の明度に対して変換先の明度が決定された場合には、明度変換テーブル25内の、変換元明度iに対応した変換先明度T(i)(25c)に、当該決定された変換先の明度が格納される。ステップS820では、更に変数Tmpを1だけ増大する。その結果、変数Tmpは2になる。その後ステップS819において、変数Tmpが変数Highより小さくないと判断されると、処理はステップS821に移る。   As described above, when the lightness i of the original pixel is 0 or 1, the lightness of the conversion destination is determined to be lightness 0. When the lightness of the conversion destination is determined for the lightness of the conversion source in this way, the determination is made to the conversion destination lightness T (i) (25c) corresponding to the conversion source lightness i in the lightness conversion table 25. The brightness of the converted destination is stored. In step S820, the variable Tmp is further increased by 1. As a result, the variable Tmp becomes 2. Thereafter, when it is determined in step S819 that the variable Tmp is not smaller than the variable High, the process proceeds to step S821.

ステップS821では、変換元の画像の明度Highに対する画素数f(High)(例えばf(2)(=2))のうち、式2で計算した差分Deltの数だけの画素(今の例では1個)を目標の明度iに割り当てる。すなわち、この画素の対してT(High)=iとする。すなわち、今の例では、元の明度2の画素1個に対して変換先明度T(2)=0が決定される。元の画像の明度High(今の例では2)を有する画素の数は2であるので、目標の明度i(今の例では0)に割り当てられる画素の総数(部分変換対象画素数)は1となる。この部分変換対象画素数が、明度変換テーブル25内に、変換元の明度Highと変換先目標の明度iとの組に対応して部分変換対象画素数25dとして格納される。以下でも部分変換対象画素数が決定されるごとに、その部分変換対象画素数が明度変換テーブル25内に部分変換対象画素数25dとして格納される。   In step S821, out of the number of pixels f (High) (for example, f (2) (= 2)) with respect to the brightness High of the conversion source image, the number of pixels corresponding to the number of difference Delts calculated by Expression 2 (1 in this example). Are assigned to the target brightness i. That is, T (High) = i for this pixel. That is, in the present example, the conversion destination lightness T (2) = 0 is determined for one pixel having the original lightness 2. Since the number of pixels having lightness High (2 in this example) of the original image is 2, the total number of pixels (number of pixels to be partially converted) assigned to the target lightness i (0 in this example) is 1. It becomes. This partial conversion target pixel number is stored in the lightness conversion table 25 as a partial conversion target pixel number 25d corresponding to the combination of the conversion source lightness High and the conversion target lightness i. Hereinafter, every time the number of pixels subject to partial conversion is determined, the number of pixels subject to partial conversion is stored in the brightness conversion table 25 as the number of pixels subject to partial conversion 25d.

その後ステップS822では、次の式3により、元の画像の明度Highの画素の数f(High)を、元の画像の明度Highの画素のうちの未割当ての画素の総数に設定しなおす。
f(High)=Sum−h(i) (3)
Thereafter, in step S822, the number f (High) of pixels with high brightness of the original image is reset to the total number of unallocated pixels among the pixels with high brightness of the original image by the following equation 3.
f (High) = Sum−h (i) (3)

今の例では、この値は1に等しい。ステップS822では、更に、変数Lowを変数Highの値(今の例では2)に等しくし、目標の明度iを1だけ増大して値3にする。今の例では、明度iは値1になる。その後処理はステップS812に戻る。目標のヒストグラムの明度1の画素数は、図22(b)又は(d)の場合には3であるから、目標の明度1には、上記f(High)の値(未割当ての画素1個分)がステップS815にて変数Sumに加算され、Sumは値1になり、変数Highは1だけ増大され、値3になる。ステップS814が再度実行された場合、今の仮定のようにSum(=1)が画素数h(1)(=3)より小さく、そのときにはステップS815が再度実行され、変数Sumにf(3)の値(今の例では3)が加算され、Sumは4になる。その後、変数Highが1だけ増大され4になる。ステップS814では、変数Sum(=4)が、目標の画素数h(1)(今の例では3)より大きくなるので、処理はステップS816に再度移る。   In the current example, this value is equal to 1. In step S822, the variable Low is further made equal to the value of the variable High (2 in this example), and the target brightness i is increased by 1 to a value of 3. In the present example, the lightness i has a value of 1. Thereafter, the process returns to step S812. Since the number of pixels of brightness 1 in the target histogram is 3 in the case of FIG. 22B or 22D, the value of f (High) (one unassigned pixel) is used for the brightness 1 of the target. Minute) is added to the variable Sum in step S815, Sum becomes the value 1, the variable High is increased by 1, and becomes the value 3. When Step S814 is executed again, Sum (= 1) is smaller than the number of pixels h (1) (= 3) as in the present assumption. At that time, Step S815 is executed again, and the variable Sum is set to f (3). (3 in this example) is added, and Sum becomes 4. Thereafter, the variable High is increased by 1 to 4. In step S814, the variable Sum (= 4) is larger than the target pixel number h (1) (3 in the present example), so the process returns to step S816.

ステップS816では、変数Highの値を1だけ減らして3に戻す。更に、上に説明した式2により差分Deltを計算する。今の場合には、この差分Deltは2になる。その後ステップS817では、今の場合、変数Lowが2であり、変数Highは3であるので、変数Lowが変数Highより小さいと判断され、ステップS818において、変数Tmpが変数Lowの値2に設定され、ステップS819にて、変数Tmpは変数Highより小さいと判断されるので、ステップS820で、元の明度2の画素のうち、未割当ての画素1個に対する割当て先の明度T(2)として明度1が決定される。すなわち、元の明度2の2個の画素のうち、未割当ての画素1個に明度1が割り当てられる。こうして、元の明度2の2個の画素に対して、目標の明度0に割り当てられる部分変換対象画素数が1であり、目標の明度1に割り当てられる部分変換対象画素数が1となる。   In step S816, the value of variable High is decreased by 1 and returned to 3. Further, the difference Delt is calculated by the equation 2 described above. In this case, the difference Delt is 2. Thereafter, in step S817, since the variable Low is 2 and the variable High is 3, in this case, it is determined that the variable Low is smaller than the variable High. In step S818, the variable Tmp is set to the value 2 of the variable Low. In step S819, since it is determined that the variable Tmp is smaller than the variable High, in step S820, the lightness 1 as the lightness T (2) of the assignment destination for one unassigned pixel among the original lightness 2 pixels. Is determined. That is, lightness 1 is assigned to one unassigned pixel among the two pixels having original lightness 2. Thus, for the two pixels having the original lightness 2, the number of partial conversion target pixels assigned to the target lightness 0 is 1, and the number of partial conversion target pixels assigned to the target lightness 1 is 1.

その後、変数Tmpが1だけ増大されて3になると、ステップS819では、変数Tmpは変数High(3)より小さくないと判断され、処理はステップS821に移る。ステップS821では、既に述べたように、明度High(=3)を有する元の画素数f(High)(今の例では3)のうち、ステップS816で計算された差分Delt(今の場合は値2)の数の画素に対して割当て先の明度T(3)として、明度i(今の例では1である)を決定する。割当て先を選択する確率は、割当て画素数(今の場合は2)/割当て候補の画素数(今の場合は3)により決まる2/3である。こうして、元の明度3の画素3個のうちの2個に対して明度1が割り当てられる。   Thereafter, when the variable Tmp is increased by 1 to 3, it is determined in step S819 that the variable Tmp is not smaller than the variable High (3), and the process proceeds to step S821. In step S821, as described above, the difference Delt (value in this case) calculated in step S816 out of the original number of pixels f (High) (3 in this example) having brightness High (= 3). The lightness i (1 in the present example) is determined as the lightness T (3) of the assignee for the number of pixels of 2). The probability of selecting an assignment destination is 2/3 determined by the number of assigned pixels (in this case, 2) / the number of assignment candidate pixels (in this case, 3). In this way, lightness 1 is assigned to two of the three pixels having the original lightness 3.

その後、既に述べたように明度3の元の画素の未割当ての画素数を上に述べた式3により計算され、その数が、元の画素の明度3に対する画素数f(High)に設定される。以下、同様にして、元の画像の後続の明度の画素に対して、新たな割当て先の明度T(i)が決定される。なお、以上の説明では、ステップS817による判定では変数Lowが変数Highより小さくないという場合は発生しなかった。このような場合が発生するのは、ステップS822を実行して変数Lowを変数Highの値に等しくした後に、ステップS815が実行されて、変数Sumが未割当ての元の画素の画素数の値f(High)にされ、更に画素数f(High)が次の目標の明度の画素数h(i)より小さい場合には、ステップS814では変数Sumが画素数h(i)より小さいと判断される。そのときは、処理はステップS816に移る。その場合、ステップS816では、差分Deltが式2にしたがって計算され、その値は画素数h(i)と等しくなる。このような場合には、その後ステップS817では、変数Lowが変数Highより小さくない(両者が等しい)と判定されることになる。この場合には処理はステップS821に移る。ステップS821の処理は既に説明したとおりであるので、省略する。以上のようにして、明度変換データ生成部810により、図23に示したような明度変換テーブル25が生成される。   Thereafter, as described above, the number of unallocated pixels of the original pixel having the brightness of 3 is calculated by the above-described equation 3, and the number is set to the number of pixels f (High) with respect to the brightness of the original pixel of 3. The In the same manner, the lightness T (i) of the new assignment destination is determined for the subsequent lightness pixels of the original image. In the above description, the case where the variable Low is not smaller than the variable High does not occur in the determination in step S817. Such a case occurs because step S822 is executed to make the variable Low equal to the value of the variable High, and then step S815 is executed to set the value f of the number of pixels of the original pixel to which the variable Sum is not assigned. If the pixel number f (High) is smaller than the pixel number h (i) of the next target brightness, it is determined in step S814 that the variable Sum is smaller than the pixel number h (i). . In that case, the process proceeds to step S816. In that case, in step S816, the difference Delt is calculated according to Equation 2, and its value is equal to the number of pixels h (i). In such a case, in step S817, it is determined that the variable Low is not smaller than the variable High (both are equal). In this case, the process proceeds to step S821. Since the process of step S821 is as already described, it is omitted. As described above, the lightness conversion data generation unit 810 generates the lightness conversion table 25 as shown in FIG.

図21に戻り、明度変換部800は、明度変換データ生成部810の実行後に明度変換実行部830を実行する。この処理では、改善対象明度データ22をコピーしたコピー画像データ(図示せず)を記憶装置20に記憶し、先に生成された明度変換テーブル25を用いて、このコピー画像データ内の陰影部領域に属する画素の明度に対する変換後の明度を決定し、その画素の明度を決定された変換後の明度で置換すればよい。   Returning to FIG. 21, the lightness conversion unit 800 executes the lightness conversion execution unit 830 after the lightness conversion data generation unit 810 executes. In this process, copy image data (not shown) obtained by copying the improvement target lightness data 22 is stored in the storage device 20, and a shadow area in the copy image data is generated using the lightness conversion table 25 generated previously. What is necessary is just to determine the brightness after conversion with respect to the brightness of the pixel belonging to, and replace the brightness of the pixel with the determined brightness after conversion.

例えば、図23の明度変換テーブル25の場合には、変換元明度iが0、1の場合には、それらに対する変換先明度T(0)、T(1)はいずれも0である。元の画素の明度iを変換するときに、同じ変換元の明度iに対する変換先の明度T(i)が複数個ある場合には、上に述べたように、それぞれの変換先明度毎に、その明度に変換されるべき部分変換対象画素数が決定され、明度変換テーブル25に格納されている。このような画素の明度の変換にあたっては、明度変換対象画素の総数分の画素から、それぞれの変換先明度に変換される画素を、部分変換対象画素数/明度変換対象画素の総数の確率で決定すればよい。   For example, in the case of the lightness conversion table 25 in FIG. 23, when the conversion source lightness i is 0 or 1, the conversion destination lightnesses T (0) and T (1) are 0. When the lightness i of the original pixel is converted, if there are a plurality of lightness T (i) of the conversion destination for the same lightness i of the same conversion source, as described above, for each conversion lightness, The number of partial conversion target pixels to be converted to the lightness is determined and stored in the lightness conversion table 25. When converting the lightness of such pixels, the pixels to be converted into the respective conversion lightnesses are determined from the total number of pixels of the lightness conversion target pixels with the probability of the partial conversion target pixel number / the total number of lightness conversion target pixels. do it.

例えば、図23の明度変換テーブルの場合、元の明度iが2の場合には変換先明度T(2)は、0と1の二つがあり、それぞれに対する部分変換対象画素数はいずれも1である。したがって、元の明度iが2の変換対象画素の総数2のうち、1個ずつが変換先明度0と1に変換される。この元の明度2の2個の画素のそれぞれに対して、変換先明度0と1を、部分変換対象画素数/明度変換対象画素の総数の確率、すなわちいずれの変換先に対しても1/2の確率でランダムに決定すればよい。同様に、元の明度iが3の場合には、明度変換対象画素の総数は3であり、変換先明度は1と2の二つがあり、それぞれに変換されるべき部分変換対象画素数は2と1である。したがって、明度変換対象画素の総数3の画素を、2/3、1/3の確率でランダムに変換先明度1と2に変換すればよい。   For example, in the case of the lightness conversion table of FIG. 23, when the original lightness i is 2, the conversion lightness T (2) has two, 0 and 1, and the number of partial conversion target pixels for each is 1 is there. Therefore, one of the total number 2 of the conversion target pixels having the original lightness i of 2 is converted into the conversion lightness 0 and 1. For each of the two pixels with the original lightness 2, conversion destination lightness 0 and 1 is set to the number of partial conversion target pixels / probability of the total number of lightness conversion target pixels, that is, 1 / It may be determined randomly with a probability of 2. Similarly, when the original lightness i is 3, the total number of lightness conversion target pixels is 3, the conversion destination lightness has two, 1 and 2, and the number of partial conversion target pixels to be converted to each is 2 And 1. Therefore, the total of three pixels of lightness conversion target pixels may be converted to conversion destination lightness 1 and 2 at random with a probability of 2/3 and 1/3.

明度2の2個の画素の明度の変換先をランダムに決定するには、異なる変換先明度値を、それぞれの変換先明度に対する部分変換対象画素数だけ生成して、合計で明度変換対象画素の総数に等しい変換先明度値のグループを生成し、明度が2である変換すべき画素が最初に見つかった場合には、このグループからランダムに一つの変換先明度値を取りだし、その値をその変換すべき画素の変換先の明度値とし、当該グループからも、上記取り出された変換先明度値を削除するようにして、後続の明度2を有する変換すべき画素の明度を上記グループを使用してランダムに決定すればよい。   In order to randomly determine the lightness conversion destinations of the two pixels having the lightness value 2, different conversion lightness values are generated by the number of partial conversion target pixels for the respective conversion lightness values, and the lightness conversion target pixels in total are generated. A group of destination lightness values equal to the total number is generated, and when a pixel to be converted with a lightness of 2 is first found, one destination lightness value is randomly extracted from this group, and that value is converted into that The brightness value of the pixel to be converted is set as the brightness value of the pixel to be converted, and the extracted brightness value of the conversion destination is also deleted from the group. What is necessary is just to determine at random.

以上に説明した陰影部領域明度変換部300の処理から分かるように、元の画像のヒストグラムの下側領域の画素数又は上側領域の画素数と全画素数との比率Rの値を調整することにより、明度変換後の画像のコントラストを自由に調整することができる。すなわち、比率Rを大きくするほど、下側領域と上側領域のいずれの領域についても、それらに含まれる画素の数が多くなり、それらの画素の明度が、最小明度から最大明度の明度範囲に画素が分布する組合せヒストグラムになるように変換されるので、コントラストは強くなり、はっきりと視認できるようになる。また、比率Rを小さくすればコントラストは、強くはないが、その分、自然な画像になる。図10の例は、R=0.05とした場合に得られた画像である。   As can be understood from the processing of the shadow area lightness conversion section 300 described above, the value of the ratio R between the number of pixels in the lower area of the histogram of the original image or the number of pixels in the upper area and the total number of pixels is adjusted. Thus, the contrast of the image after brightness conversion can be freely adjusted. That is, as the ratio R is increased, the number of pixels included in both the lower region and the upper region increases, and the brightness of those pixels falls within the brightness range from the minimum brightness to the maximum brightness. Therefore, the contrast becomes strong and can be clearly recognized. Further, if the ratio R is reduced, the contrast is not strong, but a natural image corresponding to that. The example of FIG. 10 is an image obtained when R = 0.05.

図25は、図2の画像から検出された陰影部領域データ23Bの明度のヒストグラムを示す図であり、図31(a)で模式的に示したヒストグラムの実例を示す。このヒストグラムでは、明度の低いところに多くの画素があり、全体として最小明度から最大明度近くまで明度が分布していることがわかる。   FIG. 25 is a diagram showing a histogram of brightness of the shadow area data 23B detected from the image of FIG. 2, and shows an actual example of the histogram schematically shown in FIG. In this histogram, it can be seen that there are many pixels at low brightness, and the brightness is distributed from the minimum brightness to the maximum brightness as a whole.

図26は、本実施の形態における陰影部領域明度変換部300の処理を実行して得られた、図10に示されたコントラスト改善画像内の陰影部領域の明度のヒストグラムを示す図である。図25に比べて明度分布は最小値0から最大値MAXまでの全範囲に拡がっており、頻度の分布も特定の明度に過度に集中していない。このヒストグラムは、図10に示された画像が示すように、陰影部領域の明度のコントラストがよくなり、視認性が改善されたことを反映している。   FIG. 26 is a diagram illustrating a brightness histogram of the shaded area in the contrast-improved image shown in FIG. 10 obtained by executing the process of the shaded area brightness conversion unit 300 in the present embodiment. Compared to FIG. 25, the lightness distribution extends over the entire range from the minimum value 0 to the maximum value MAX, and the frequency distribution is not excessively concentrated on the specific lightness. As shown in the image shown in FIG. 10, this histogram reflects that the brightness contrast of the shaded area is improved and the visibility is improved.

図27は、図2の画像の陰影部領域に対して、図31を参照して説明された従来技術による線形変換を行った結果得られた画像の例を示す図である。陰影部のコントラストが強くなり、視認性が改善されていて、車や、建物の輪郭がわかりやすくなった。しかし、建物の明るい部分の明度変化がなくなり、一様に白く跳んでいたり、道路の暗い部分が一様に暗くなっていて道路構造を把握しにくい。つまり、白とびとつぶれが起こっていて、図10に示す本実施の形態で得られた画像より画像全体としては視認性は劣る。   FIG. 27 is a diagram illustrating an example of an image obtained as a result of performing the linear transformation according to the conventional technique described with reference to FIG. 31 on the shaded area of the image of FIG. The contrast of the shaded area has increased, visibility has improved, and the outlines of cars and buildings have become easier to understand. However, the brightness change of the bright part of the building disappears, and it jumps uniformly in white, or the dark part of the road is uniformly dark, making it difficult to grasp the road structure. That is, overexposure occurs, and the visibility of the entire image is inferior to that of the image obtained in the present embodiment shown in FIG.

図28は、上記図27の画像の陰影部領域の明度のヒストグラムを示す図である。図25のヒストグラムに比べて、明度分布範囲は最小値0から最大値MAXまでの全範囲に拡がっている点では図26と同じであるが、図28では、最小明度と最大明度での画素数が極端に多くなっている。このことは、図28に示された画像で見られる白とびとつぶれが起こっていることを示している。   FIG. 28 is a diagram showing a brightness histogram of the shaded area in the image of FIG. Compared to the histogram of FIG. 25, the brightness distribution range is the same as that of FIG. 26 in that it extends over the entire range from the minimum value 0 to the maximum value MAX, but in FIG. 28, the number of pixels at the minimum brightness and the maximum brightness. Has become extremely large. This indicates that overexposure seen in the image shown in FIG. 28 occurs.

図29は、比較のために図2の陰影部領域に対して、従来技術によるヒストグラム均一化を行った結果得られた画像を示す図である。同図では、陰影部内の視認性は高いが、コントラストが強すぎ、ノイズが目立つ。また、陰影部と非陰影部との境界で明度が極端に変化しているため、不自然な画像となっている。これに対し、図10に示した本実施の形態により得られた画像では、このようなノイズが少なく、より自然な画像となっていて、視認性は優れている。   FIG. 29 is a diagram showing an image obtained as a result of performing histogram equalization according to the conventional technique for the shaded area in FIG. 2 for comparison. In the figure, the visibility in the shaded area is high, but the contrast is too strong and noise is conspicuous. Further, since the brightness changes extremely at the boundary between the shadow portion and the non-shadow portion, the image is unnatural. On the other hand, the image obtained by the present embodiment shown in FIG. 10 has less noise, is a more natural image, and has excellent visibility.

したがって、本実施の形態で示したように、陰影部領域明度変換部300により陰影部領域の明度を変換することにより陰影部領域のコントラストを改善できるだけでなく、自然な明度変化をする画像を得ることができる。すなわち、明度のヒストグラムの中央領域に対して線形変換するとともに、明度のヒストグラムの下側領域と上側領域の画素に対してヒストグラム均一化を施した結果、従来の線形変換のみで得られるコントラストよりは強く、従来のヒストグラム均一化のみを行った場合よりは弱いコントラストを有し、いわば両方の変換の中間程度のコントラストを有するように陰影部のコントラスト改善でき、かつ、陰影部の変換後の画像をより自然な画像にすることができる。すなわち、陰影部内の視認性と画像の自然さを両立するように、陰影部の画像を改良できている。   Therefore, as shown in the present embodiment, by converting the lightness of the shadow region by the shadow region lightness conversion unit 300, not only can the contrast of the shadow region be improved, but an image having a natural lightness change can be obtained. be able to. In other words, as a result of performing linear transformation on the central area of the brightness histogram and uniforming the histogram on the lower area and upper area pixels of the brightness histogram, the contrast obtained by only the conventional linear transformation is obtained. It is strong and has a weaker contrast than when only conventional histogram equalization is performed, so that the contrast of the shadow part can be improved so as to have a contrast of about the middle of both conversions, and the image after conversion of the shadow part is A more natural image can be obtained. That is, the image of the shadow portion can be improved so as to achieve both the visibility in the shadow portion and the naturalness of the image.

以上のようにして明度変換実行部830が実行されると、明度変換部800の処理が終了し、陰影部領域明度変換部300の処理が終了する。図1に戻り、プログラム40は、陰影部領域明度変換部300の実行後にグラデーション処理部400を既に述べたようにして実行する。   When the lightness conversion execution unit 830 is executed as described above, the processing of the lightness conversion unit 800 ends, and the processing of the shadow area lightness conversion unit 300 ends. Returning to FIG. 1, the program 40 executes the gradation processing unit 400 as described above after the execution of the shadow area lightness conversion unit 300.

本実施の形態では陰影部領域明度変換部300により実行される明度変換は、非常に有効であるが、得られる画像では、図10の領域10aから10eに例示されるように、いくつかの領域では明度の不連続が発生し、画像がそれらの領域では不自然に見えるという問題が残っている。本実施の形態でのグラデーション処理部400を更に実行することにより、このような問題が改善されることは、既に説明したとおりである。   In the present embodiment, the lightness conversion executed by the shadow area lightness conversion unit 300 is very effective. However, there remains a problem that lightness discontinuities occur and the image looks unnatural in those areas. As described above, this problem can be improved by further executing the gradation processing unit 400 in the present embodiment.

本発明は、上記の実施の形態に限定されるものではなく、本発明の要旨を変更しない範囲で変更又は修正して他の形態で実施してもよいことは言うまでもない。上記実施の形態で使用されたグラデーション処理部400は、本実施の形態における陰影部領域明度変換部300の実行結果に対して実行されるのが有効であるが、グラデーション処理部400自体は、従来の線形変換の結果得られる画像(例えば図27)あるいは従来のヒストグラム均一化により得られる画像(例えば図29)に対しても適用でき、それらの処理により発生する明度の不連続を現象させる効果を有する。   It goes without saying that the present invention is not limited to the above-described embodiment, and may be implemented in other forms with changes or modifications within the scope not changing the gist of the present invention. The gradation processing unit 400 used in the above embodiment is effective to be executed on the execution result of the shadow area lightness conversion unit 300 in the present embodiment, but the gradation processing unit 400 itself has been conventionally used. The present invention can be applied to an image obtained as a result of the linear transformation (for example, FIG. 27) or an image obtained by conventional histogram equalization (for example, FIG. 29). Have.

また、上記実施の形態では、陰影部を一つのブロックと考えて処理を施した。しかし、本発明は改善対象明度画像を複数のブロックに分割した場合にも適用可能である。例えば、影が重なり合うことによってさまざまな明度を持つ陰影部分が含まれている場合には、陰影部分を一つのブロックに属すると考えた場合、暗い陰影部のコントラストが十分に改善されない可能性がある。そのような場合には、画像を複数のブロックに分割して各ブロック毎に陰影部領域のコントラストを改善するように、ブロック毎に変換後の明度を決定することが可能となる。また、既に述べたように、元の画像のヒストグラムの下側領域の画素数又は上側領域の画素数と全画素数との比率Rの値をブロックごとに調整することが可能となり、例えば、陰影部部分領域をコントラストを付けてはっきり見たいブロックと、陰影部分領域を自然なコントラストで見たいブロックとを区別して、それぞれのブロックに適した比率Rを使用することも可能になる。   Moreover, in the said embodiment, the shadow part was considered as one block, and it processed. However, the present invention can also be applied to the case where the brightness image to be improved is divided into a plurality of blocks. For example, when shadows with shadows with various brightness levels are included due to overlapping shadows, the contrast of dark shadows may not be improved sufficiently if the shadows are considered to belong to one block. . In such a case, it is possible to determine the brightness after conversion for each block so that the image is divided into a plurality of blocks and the contrast of the shadow area is improved for each block. Further, as described above, it is possible to adjust the value of the ratio R between the number of pixels in the lower region of the histogram of the original image or the number of pixels in the upper region and the total number of pixels for each block. It is also possible to distinguish between a block in which a partial partial area is desired to be clearly seen and a block in which a shadow partial area is desired to be viewed in a natural contrast, and a ratio R suitable for each block can be used.

また、以上の実施の形態では、元のヒストグラムの中央領域を線形変換を用いて拡大したが、線形変換に代えて他の変換、例えば非線形変換、区分線形変換を用いてもよい。また。元のヒストグラムの下側領域と上側領域を組み合わせて、最小明度から最大明度までの明度範囲に画素が分布する組合せヒストグラムを使用するときに、全明度範囲に対してほぼ一様となるようにヒストグラムを使用したが、これに代えて完全に一様でなくてもよく、ほぼ一様であればよい。更には、ほぼ一様でなくてもよく、例えば、全明度範囲において不均一に分布するように変換してもよい。   In the above embodiment, the central region of the original histogram is expanded using linear transformation, but other transformations such as nonlinear transformation and piecewise linear transformation may be used instead of linear transformation. Also. When combining the lower area and the upper area of the original histogram and using a combined histogram in which pixels are distributed over the brightness range from the minimum brightness to the maximum brightness, the histogram will be almost uniform over the entire brightness range. However, instead of this, it is not necessary to be completely uniform. Furthermore, it may not be substantially uniform, for example, it may be converted so as to be unevenly distributed in the entire brightness range.

上記実施の形態では、コントラスト改善対象の画像はカラー画像であるとしたが、本発明は、モノクロ濃淡画像にも適用でき、モノクロ濃淡画像の場合には、色相は任意に指定し、彩度0のカラー画像と考えて、その画像の明度データに対して処理を行えばよい。あるいは、モノクロ濃淡画像の場合には、その濃度データを上記実施の形態における改善対象明度データ22として使用して、陰影部領域明度変換部300とグラデーション処理部400を実行し、カラー形式変換部100とカラー形式逆変換部500を実行しなければよい。   In the above embodiment, the contrast improvement target image is a color image. However, the present invention can also be applied to a monochrome grayscale image. In the case of a monochrome grayscale image, the hue is arbitrarily designated and the saturation is 0. And processing the lightness data of the image. Alternatively, in the case of a monochrome grayscale image, the shaded area lightness conversion unit 300 and the gradation processing unit 400 are executed using the density data as the improvement target lightness data 22 in the above embodiment, and the color format conversion unit 100. And the color format inverse conversion unit 500 need not be executed.

本発明に係る画像の陰影部のコントラストを改善可能な装置の一つの実施形態の概略ブロック図である。It is a schematic block diagram of one Embodiment of the apparatus which can improve the contrast of the shadow part of the image based on this invention. 改善対象画像データが示す地理画像の一例を示す図である。It is a figure which shows an example of the geographic image which improvement object image data shows. R、G、Bの3原色に関するカラー画像情報でカラー画像を定義するRGBカラーモデルを示す図である。It is a figure which shows the RGB color model which defines a color image with the color image information regarding three primary colors of R, G, and B. カラー画像情報を定義される双六角錐カラーモデルを示す図である。It is a figure which shows the bihexagonal pyramid color model in which color image information is defined. 陰影部領域検出部の概略フローチャートを示す。The schematic flowchart of a shadow part area | region detection part is shown. 2値化部により図2の画像から生成された2値画像の例を示す図である。It is a figure which shows the example of the binary image produced | generated from the image of FIG. 2 by the binarization part. ノイズ除去部の処理の一例を示す概略フローチャートである。It is a schematic flowchart which shows an example of a process of a noise removal part. ノイズ除去部の処理の後に得られる陰影部領域データが表す陰影部領域の例を示す図である。It is a figure which shows the example of the shadow part area | region which the shadow part area | region data obtained after the process of a noise removal part represents. 目標ヒストグラム生成部の処理の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the process of a target histogram production | generation part. 図2に示す改善対象明度データを陰影部領域明度変換部により明度変換して得られるコントラスト改善後明度データを示す図である。It is a figure which shows the brightness data after contrast improvement obtained by lightness conversion of the improvement object brightness data shown in FIG. 2 by a shadow part area | region lightness conversion part. 図10内の領域10a等とその近傍における明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。It is a figure which shows typically the brightness distribution before the brightness conversion in the area | region 10a etc. in FIG. 10, the brightness distribution after the brightness conversion, and the brightness distribution after the gradation process. 図10内の領域10dが含まれるビルの壁面上での図のほぼ水平方向の経路に沿っての明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。FIG. 10 schematically shows a lightness distribution before lightness conversion, a lightness distribution after lightness conversion, and a lightness distribution after gradation processing along a substantially horizontal path in the figure on the wall surface of the building including the region 10d in FIG. FIG. 図10内の領域10eが含まれるビルの屋上で図のほぼ垂直方向の経路に沿っての0明度変換前の明度分布、明度変換後の明度分布及びグラデーション処理後の明度分布を模式的に示す図である。10 schematically shows a lightness distribution before 0 lightness conversion, a lightness distribution after lightness conversion, and a lightness distribution after gradation processing on a rooftop of a building including the region 10e in FIG. FIG. 複数のグラデーション領域とグラデーション領域データを説明するための図である。It is a figure for demonstrating several gradation area | regions and gradation area | region data. 陰影部領域データが示す図8の陰影部領域に対して決定された複数のグラデーション領域の存在範囲を示す図である。It is a figure which shows the existing range of the some gradation area | region determined with respect to the shadow part area | region of FIG. 8 which a shadow part area | region data shows. グラデーション領域決定部の処理の一例の概略フローチャートである。It is a schematic flowchart of an example of a process of a gradation area | region determination part. グラデーション処理を実行した結果得られるグラデーション処理後明度データが表す明度画像の例を示す図である。It is a figure which shows the example of the brightness image which the brightness data after gradation process obtained as a result of performing gradation process represents. 目標ヒストグラム生成部の概略フローチャートである。It is a schematic flowchart of a target histogram production | generation part. 中央領域決定部の処理の一例の概略フローチャートである。It is a schematic flowchart of an example of a process of a center area | region determination part. 上下側領域拡大部730の処理の一例の概略フローチャートである。12 is a schematic flowchart of an example of processing of an upper and lower side region enlargement unit 730. 明度変換部の概略フローチャートである。It is a schematic flowchart of a brightness conversion part. 実ヒストグラムデータと目標ヒストグラムデータとに基づいて行われる明度変換を説明するための図である。It is a figure for demonstrating the brightness conversion performed based on real histogram data and target histogram data. 明度変換データの例としての明度変換テーブルの例を示す図である。It is a figure which shows the example of the lightness conversion table as an example of lightness conversion data. 明度変換データ生成部の処理の一例の概略フローチャートである。It is a schematic flowchart of an example of a process of the brightness conversion data generation part. 図2の画像から検出された陰影部領域データの明度のヒストグラムを示す図である。It is a figure which shows the histogram of the brightness of the shadow part area | region data detected from the image of FIG. 陰影部領域明度変換部の処理を実行して得られたコントラスト改善画像の陰影部領域の明度のヒストグラムの例を示す図である。It is a figure which shows the example of the histogram of the brightness of the shadow part area | region of the contrast improvement image obtained by performing the process of a shadow part area | region brightness conversion part. 図2の画像の陰影部領域に対して従来技術による線形変換を行った結果得られた画像の例を示す図である。It is a figure which shows the example of the image obtained as a result of performing the linear transformation by a prior art with respect to the shadow part area | region of the image of FIG. 図27の画像の陰影部領域の明度のヒストグラムを示す図である。It is a figure which shows the histogram of the brightness of the shadow part area | region of the image of FIG. 図2の陰影部領域に対して従来技術によるヒストグラム均一化を行った結果得られた画像を示す図である。It is a figure which shows the image obtained as a result of performing the histogram equalization by a prior art with respect to the shadow part area | region of FIG. 従来技術による明度ヒストグラムの線形変換とその問題点を説明するための図である。It is a figure for demonstrating the linear transformation of the brightness histogram by a prior art, and its problem. 陰影部と明るい非陰影部を含む画像の明度ヒストグラムとその画像に対する従来技術による線形変換を行った結果得られる画像の明度ヒストグラムを模式的に示す図である。It is a figure which shows typically the brightness histogram of the image obtained as a result of performing the linear transformation by the prior art to the image which contains the shadow part and the bright non-shadow part, and the image.

符号の説明Explanation of symbols

270…境界隣接領域、271から274…グラデーション領域、f(i)…実ヒストグラムを表す関数、g(i)…実ヒストグラムの中央領域の範囲を拡大した後の拡大ヒストグラムを表す関数、h(i)…目標ヒストグラムを表す関数。   270 ... border adjacent area, 271 to 274 ... gradation area, f (i) ... function representing the real histogram, g (i) ... function representing the enlarged histogram after enlarging the central area of the real histogram, h (i ) ... Function that represents the target histogram.

Claims (8)

明度画像内の陰影部が存在する陰影部領域を検出する陰影部領域検出手段と、
前記検出された陰影部領域内の複数の画素の明度に対して、前記陰影部領域のコントラストを改善するための明度を所定の明度変換規則にしたがって決定し、前記複数の画素の明度を当該決定された明度に変換する陰影部領域明度変換手段と、
前記明度画像内の前記陰影部領域内の、非陰影部が存在する非陰影部領域との境界に隣接して位置する境界隣接領域内の一群の境界近傍画素に対してグラデーション処理を実行するグラデーション処理手段、
としてコンピュータを機能させ、
前記グラデーション処理は、前記一群の境界近傍画素に対して一群の更に改善された明度を決定し、前記一群の境界近傍画素の明度を、前記陰影部領域明度変換手段により決定された一群の明度に代えて当該一群の更に改善された明度に変更する処理であり、
当該一群の更に改善された明度は、前記一群の境界近傍画素のそれぞれの位置が前記境界から前記陰影部領域の内部に向けて離れるにつれて、それぞれの境界近傍画素の前記陰影部領域明度変換手段により決定される前の明度に近い明度からそれぞれの境界近傍画素の前記陰影部領域明度変換手段により決定された後の明度に近い明度に変化するものである、
ことを特徴とする陰影部のコントラストを改善可能なプログラム。
A shadow area detection means for detecting a shadow area where a shadow area exists in the brightness image;
With respect to the brightness of a plurality of pixels in the detected shadow area, the brightness for improving the contrast of the shadow area is determined according to a predetermined brightness conversion rule, and the brightness of the plurality of pixels is determined A shaded area lightness conversion means for converting the lightness to
A gradation for performing gradation processing on a group of pixels near the boundary in the boundary adjacent region located adjacent to the boundary with the non-shadow portion region where the non-shadow portion exists in the shadow portion region in the brightness image Processing means,
Function as a computer
The gradation processing determines a group of further improved brightness values for the group of boundary neighboring pixels, and converts the brightness values of the group of boundary neighboring pixels to the group of brightness values determined by the shadow area lightness conversion means. Instead, it is a process of changing to a further improved brightness of the group,
The further improved brightness of the group is obtained by the shade area lightness conversion means of each boundary vicinity pixel as the respective positions of the group of boundary vicinity pixels move away from the boundary toward the inside of the shadow area. It changes from a lightness close to the lightness before being determined to a lightness close to the lightness after being determined by the shadow area lightness conversion means of each boundary neighboring pixel.
A program that can improve the contrast of shadows.
前記境界隣接領域を前記境界からの距離に依存して複数のグラデーション領域に分割する境界隣接領域分割手段、
としてコンピュータを更に機能させ、
前記グラデーション処理は、各グラデーション領域内の複数の画素のそれぞれに対して、前記陰影部領域明度変換手段により明度が決定される前のそれぞれの画素の明度と、前記陰影部領域明度変換手段により決定されたそれぞれの画素の明度と、前記境界から当該グラデーション領域までの距離に依存してあらかじめ決定された当該グラデーション領域用の重みとを用いて、当該グラデーション領域内のそれぞれの画素のための前記更に改善された明度を決定する、
ことを特徴とする請求項1に記載の陰影部のコントラストを改善可能なプログラム。
Boundary adjacent region dividing means for dividing the boundary adjacent region into a plurality of gradation regions depending on a distance from the boundary;
As a computer,
The gradation processing is determined for each of a plurality of pixels in each gradation area by the brightness of each pixel before the brightness is determined by the shadow area brightness conversion means and the shadow area brightness conversion means. Using the brightness of each pixel that has been determined and the weight for the gradation region that is predetermined depending on the distance from the boundary to the gradation region, the further for each pixel in the gradation region Determine improved brightness,
The program capable of improving the contrast of a shadow portion according to claim 1.
前記検出された陰影部領域内の複数の画素に関する明度ヒストグラムを検出するヒストグラム検出手段と、
検出された明度ヒストグラムから、当該陰影部領域に関する改善されたコントラストを表す目標明度ヒストグラムを決定する目標ヒストグラム決定手段、
としてコンピュータを更に機能させ、
前記陰影部領域明度変換手段により実行される前記所定の明度変換規則は、前記陰影部領域に関する改善後の明度ヒストグラムがほぼ前記目標明度ヒストグラムになるように、前記検出された陰影部領域内の複数の画素の明度を変換するための変換規則であり、
前記目標ヒストグラム決定手段は、
前記明度画像に対してあらかじめ定められた最大明度から最小明度までの範囲に拡大されるべき、前記明度ヒストグラムの中央領域を前記明度ヒストグラムに基づいて決定する中央領域決定手段と、
前記明度ヒストグラムの前記中央領域を、前記最大明度から最小明度までの範囲に分布する拡大ヒストグラムに拡大する中央領域拡大手段と、
前記明度ヒストグラムのうち、前記決定された中央領域より小さい明度に対するヒストグラム下側領域と、前記中央領域より大きい明度に対するヒストグラム上側領域とを組み合わせて、前記最小明度から前記最大明度までの明度範囲に画素が分布する組合せヒストグラムに変換し、当該変換で生成された前記組合せヒストグラムを前記中央領域変換手段により生成される前記拡大ヒストグラムと合成して前記目標明度ヒストグラムを生成する上下側領域拡大手段と、
を備える、
ことを特徴とする請求項1又は2に記載の陰影部のコントラストを改善可能なプログラム。
Histogram detection means for detecting a brightness histogram relating to a plurality of pixels in the detected shadow area;
A target histogram determination means for determining a target brightness histogram representing an improved contrast relating to the shaded area from the detected brightness histogram;
As a computer,
The predetermined brightness conversion rule executed by the shadow area brightness conversion means includes a plurality of values in the detected shadow area so that an improved brightness histogram related to the shadow area is substantially the target brightness histogram. Is a conversion rule for converting the brightness of the pixel of
The target histogram determination means includes
A central area determining means for determining a central area of the brightness histogram based on the brightness histogram to be expanded to a range from a predetermined maximum brightness to a minimum brightness for the brightness image;
A central area enlarging means for enlarging the central area of the brightness histogram to an enlarged histogram distributed in a range from the maximum brightness to the minimum brightness;
A pixel in a brightness range from the minimum brightness to the maximum brightness by combining a histogram lower area for brightness smaller than the determined center area and a histogram upper area for brightness greater than the center area in the brightness histogram. Is converted into a combined histogram, and the combined histogram generated by the conversion is combined with the expanded histogram generated by the central region converting means to generate the target brightness histogram, and upper and lower area expanding means,
Comprising
The program capable of improving the contrast of the shadow portion according to claim 1 or 2.
前記明度画像を複数のブロックに分割する領域分割手段、
としてコンピュータを更に機能させるプログラムであり、
前記陰影部領域明度変換手段は、前記複数のブロックのそれぞれ毎に、それぞれに含まれた陰影部領域のコントラストを改善するための明度を決定する、
ことを特徴とする請求項1から3のいずれか一つに記載の陰影部のコントラストを改善可能なプログラム。
Area dividing means for dividing the brightness image into a plurality of blocks;
As a program to further function the computer,
The shadow area lightness conversion means determines the lightness for improving the contrast of the shadow area included in each of the plurality of blocks;
The program capable of improving the contrast of a shadow portion according to any one of claims 1 to 3.
明度画像内の陰影部が存在する陰影部領域を検出する陰影部領域検出ステップと、
前記検出された陰影部領域内の複数の画素の明度に対して、前記陰影部領域のコントラストを改善するための明度を所定の明度変換規則にしたがって決定し、前記複数の画素の明度を当該決定された明度に変換する陰影部明度変換ステップと、
前記明度画像内の前記陰影部領域内の、非陰影部が存在する非陰影部領域との境界に隣接して位置する境界隣接領域内の一群の境界近傍画素に対してグラデーション処理を実行するグラデーション処理ステップと、
を含み、
前記グラデーション処理は、前記一群の境界近傍画素に対して一群の更に改善された明度を決定し、前記一群の境界近傍画素の明度を、前記陰影部明度変換ステップで決定された一群の明度に代えて当該一群の更に改善された明度に変更する処理であり、
当該一群の更に改善された明度は、前記一群の境界近傍画素のそれぞれの位置が前記境界から前記陰影部領域の内部に向けて離れるにつれて、それぞれの境界近傍画素の前記陰影部明度変換ステップで決定される前の明度に近い明度からそれぞれの境界近傍画素の前記陰影部明度変換ステップで決定された後の明度に近い明度に変化するものである、
ことを特徴とする陰影部のコントラストの改善方法。
A shadow area detection step for detecting a shadow area where a shadow area exists in the brightness image;
With respect to the brightness of a plurality of pixels in the detected shadow area, the brightness for improving the contrast of the shadow area is determined according to a predetermined brightness conversion rule, and the brightness of the plurality of pixels is determined A shading portion lightness conversion step for converting to a lightness value,
A gradation for performing gradation processing on a group of pixels near the boundary in the boundary adjacent region located adjacent to the boundary with the non-shadow portion region where the non-shadow portion exists in the shadow portion region in the brightness image Processing steps;
Including
The gradation processing determines a group of further improved brightness values for the group of boundary neighboring pixels, and replaces the brightness values of the group of boundary neighboring pixels with the group of brightness values determined in the shadow portion brightness conversion step. The process of changing to a further improved brightness of the group,
The further improved brightness of the group is determined in the shadow part brightness conversion step of each boundary neighboring pixel as the position of each of the group of boundary neighboring pixels moves away from the boundary toward the inside of the shadow part region. Changes from a lightness close to the lightness before being changed to a lightness close to the lightness after being determined in the shaded portion lightness conversion step of each pixel near the boundary,
A method for improving the contrast of a shadow portion characterized by the above.
前記境界隣接領域を前記境界からの距離に依存して複数のグラデーション領域に分割する境界隣接領域分割ステップ、
を更に含み、
前記グラデーション処理は、各グラデーション領域内の複数の画素のそれぞれに対して、前記陰影部明度変換ステップで明度が決定される前のそれぞれの画素の明度と、前記陰影部明度変換ステップで決定されたそれぞれの画素の明度と、前記境界から当該グラデーション領域までの距離に依存してあらかじめ決定された当該グラデーション領域用の重みとを用いて、当該グラデーション領域内のそれぞれの画素のための前記更に改善された明度を決定する、
ことを特徴とする請求項5に記載の陰影部のコントラストの改善方法。
A boundary adjacent region dividing step for dividing the boundary adjacent region into a plurality of gradation regions depending on a distance from the boundary;
Further including
The gradation processing is determined in the lightness of each pixel before the lightness is determined in the shadow part lightness conversion step and in the shadow part lightness conversion step for each of a plurality of pixels in each gradation region. The further improvement for each pixel in the gradation area using the brightness of each pixel and the weight for the gradation area determined in advance depending on the distance from the boundary to the gradation area. Determine the brightness
The method for improving the contrast of a shadow portion according to claim 5.
前記検出された陰影部領域内の複数の画素に関する明度ヒストグラムを検出するヒストグラム検出ステップと、
検出された明度ヒストグラムから、当該陰影部領域に関する改善されたコントラストを表す目標明度ヒストグラムを決定する目標ヒストグラム決定ステップと、
を更に含み、
前記陰影部明度変換ステップで実行される前記所定の明度変換規則は、前記陰影部領域に関する改善後の明度ヒストグラムがほぼ前記目標明度ヒストグラムになるように、前記検出された陰影部領域内の複数の画素の明度を変換するための変換規則であり、
前記目標ヒストグラム決定ステップは、
前記明度画像に対してあらかじめ定められた最大明度から最小明度までの範囲に拡大されるべき、前記明度ヒストグラムの中央領域を前記明度ヒストグラムに基づいて決定する中央領域決定ステップと、
前記明度ヒストグラムの前記中央領域を、前記最大明度から最小明度までの範囲に分布する拡大ヒストグラムに拡大する中央領域拡大ステップと、
前記明度ヒストグラムのうち、前記決定された中央領域より小さい明度に対するヒストグラム下側領域と、前記中央領域より大きい明度に対するヒストグラム上側領域とを組み合わせて、前記最小明度から前記最大明度までの明度範囲に画素が分布する組合せヒストグラムに変換し、当該変換で生成された前記組合せヒストグラムを前記中央領域変換ステップで生成される前記拡大ヒストグラムと合成して前記目標明度ヒストグラムを生成する上下側領域拡大ステップと、
とを含む、
ことを特徴とする請求項5又は6に記載の陰影部のコントラストの改善方法。
A histogram detection step of detecting a brightness histogram for a plurality of pixels in the detected shaded area;
A target histogram determination step for determining a target brightness histogram representing an improved contrast with respect to the shaded area from the detected brightness histogram;
Further including
The predetermined lightness conversion rule executed in the shadow part lightness conversion step includes a plurality of lightness values in the detected shadow part region so that an improved lightness histogram related to the shadow part region becomes substantially the target lightness histogram. It is a conversion rule for converting the brightness of a pixel,
The target histogram determination step includes
A central region determining step for determining a central region of the lightness histogram to be expanded in a range from a predetermined maximum lightness to a minimum lightness for the lightness image, based on the lightness histogram;
A central region enlargement step of enlarging the central region of the brightness histogram into an enlarged histogram distributed in a range from the maximum brightness to the minimum brightness;
A pixel in a brightness range from the minimum brightness to the maximum brightness by combining a histogram lower area for brightness smaller than the determined center area and a histogram upper area for brightness greater than the center area in the brightness histogram. Is converted into a combined histogram, and the combined histogram generated by the conversion is combined with the expanded histogram generated in the central region converting step to generate the target brightness histogram, and an upper and lower region expanding step,
Including
7. The method for improving the contrast of a shadow portion according to claim 5 or 6, wherein:
前記明度画像を複数のブロックに分割する領域分割ステップ、
を更に含み、
前記陰影部領域明度変換ステップは、前記複数のブロックのそれぞれ毎にそれぞれに含まれた陰影部領域のコントラストを改善するための明度を決定する、
ことを特徴とする請求項5から7のいずれか一つに記載の陰影部のコントラストの改善方法。
An area dividing step of dividing the brightness image into a plurality of blocks;
Further including
The shade area brightness conversion step determines brightness for improving the contrast of the shadow area included in each of the plurality of blocks.
The method for improving the contrast of a shadow portion according to any one of claims 5 to 7.
JP2004165093A 2004-06-02 2004-06-02 Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion Pending JP2005348081A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004165093A JP2005348081A (en) 2004-06-02 2004-06-02 Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004165093A JP2005348081A (en) 2004-06-02 2004-06-02 Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion

Publications (1)

Publication Number Publication Date
JP2005348081A true JP2005348081A (en) 2005-12-15

Family

ID=35500045

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004165093A Pending JP2005348081A (en) 2004-06-02 2004-06-02 Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion

Country Status (1)

Country Link
JP (1) JP2005348081A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013162516A (en) * 2012-02-06 2013-08-19 Nhn Corp Exposure measuring method and apparatus based on composition for automatic image correction
JP2014199640A (en) * 2013-03-29 2014-10-23 ヒョンデ エムエヌソフト インコーポーレイティッドHYUNDAI MNSOFT,Inc. Shadow removal method and device of aerial or satellite photograph

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013162516A (en) * 2012-02-06 2013-08-19 Nhn Corp Exposure measuring method and apparatus based on composition for automatic image correction
US8885937B2 (en) 2012-02-06 2014-11-11 Nhn Corporation Exposure measuring method and apparatus based on composition for automatic image correction
JP2014199640A (en) * 2013-03-29 2014-10-23 ヒョンデ エムエヌソフト インコーポーレイティッドHYUNDAI MNSOFT,Inc. Shadow removal method and device of aerial or satellite photograph

Similar Documents

Publication Publication Date Title
JP3915563B2 (en) Image processing apparatus and image processing program
JP2006191487A (en) Threshold matrix generation method and device, and recording medium
CN103745436B (en) LiDAR point cloud data shape filtering method based on regional prediction
JP4776705B2 (en) Image processing apparatus and method
JP5173898B2 (en) Image processing method, image processing apparatus, and program
JP4853653B2 (en) Image processing apparatus and image processing program
CN108335267A (en) A kind of processing method of depth image, device, equipment and storage medium
KR20020008245A (en) Intelligent interpolation methods for automatic generation of an accurate digital elevation model
CN113327315A (en) Multi-level detail model generation method and device
CN106023105B (en) Binary image generation method and system for plant leaves
JP2005348081A (en) Program capable of improving contrast of shading portion, and improvement method of contrast of shading portion
JP3026706B2 (en) Image processing device
JP4167600B2 (en) Program capable of correcting shadow portion luminance and shadow portion luminance correction method
JP2003216959A (en) Method, device and program for extracting outline
WO2011086594A1 (en) Image processing apparatus and method therefor
JP4340888B2 (en) Image processing apparatus, image processing method, image processing program, and storage medium
CN107292840B (en) Image restoration method and device, computer-readable storage medium and terminal
CN111932566B (en) Model contour diagram generation method, device and system
JP3092769B2 (en) Image processing device
JP2009134350A (en) Method and apparatus for improving quality of image
JP2010154269A (en) Method, apparatus, and program for making image to be high quality
JP3972625B2 (en) Image processing apparatus and image processing method
JP6159211B2 (en) Target image generation support apparatus, target image generation support method, and program
JP2002077622A (en) Image processing apparatus and recording medium
JPH10255036A (en) Dynamic binarizing method for gray level image