JP2004304637A - Image processing method and image processing apparatus - Google Patents

Image processing method and image processing apparatus Download PDF

Info

Publication number
JP2004304637A
JP2004304637A JP2003096755A JP2003096755A JP2004304637A JP 2004304637 A JP2004304637 A JP 2004304637A JP 2003096755 A JP2003096755 A JP 2003096755A JP 2003096755 A JP2003096755 A JP 2003096755A JP 2004304637 A JP2004304637 A JP 2004304637A
Authority
JP
Japan
Prior art keywords
block
image
level
pixel
blocks
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
JP2003096755A
Other languages
Japanese (ja)
Inventor
Rieko Izume
理恵子 井爪
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.)
Minolta Co Ltd
Original Assignee
Minolta 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 Minolta Co Ltd filed Critical Minolta Co Ltd
Priority to JP2003096755A priority Critical patent/JP2004304637A/en
Publication of JP2004304637A publication Critical patent/JP2004304637A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing method and an image processing apparatus capable of properly carrying out the white board contrast emphasis processing. <P>SOLUTION: An image is divided into a plurality of blocks each comprising a plurality of pixels, a group of blocks comprising a prescribed number of blocks respectively longitudinally and laterally wherein each of all the blocks includes a target block, is set, and each target block is decided to be located at a corner remotest from a center O of the image in each block of the block group. Then a prescribed number of blocks with low luminance is extracted from the block group, an average Yab of a block background level of the blocks is calculated and the average Yab is set to the block background level of the target block. The processing above is sequentially carried out from the block located in the middle of the image toward the blocks located at the peripheral of the image. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、白板等を撮影した画像の下地とばし処理を行う画像処理方法及び画像処理装置に関する。
【0002】
【従来の技術】
一般に、デジタルカメラは、画像処理により撮影された画像の画質を自在に制御できるため、撮影の目的や被写体の種類に応じて撮影画像の画質に対して適切な処理を行うことにより、銀塩フィルムに撮影するカメラに比してより好適な画質の画像を得ることができるという利点を有する。このため、通常の写真撮影だけでなく、例えば会議場でホワイトボードに描かれた文字や図形等を撮影することにも利用される。
【0003】
デジタルカメラで文字や図形等が描かれたホワイトボードを撮影する場合、その撮影の目的はホワイトボード上の文字や図形等の情報を記録することにある。このため、上記のような撮影画像については、ホワイトボードの白地部分を確実に純白色にする、所謂下地とばし処理を行うことにより、文字や図形等の情報部分の明瞭度を向上させることが求められる。
【0004】
下記特許文献には、ホワイトボードを撮影する場合に、ホワイトボードの下地(白板部分)をとばし、文字や図形等の情報部分の明瞭度を向上させることを目的として、被写体光像を三原色の色成分の画素信号として取り込み、色成分の画像毎に、各色成分の画素信号を用いて所定の白地レベル以上の画素信号を白色飽和レベルに変換するγ特性を設定し、このγ特性を用いてガンマ補正を行うように構成したものが開示されている。
【0005】
【特許文献】
特開平10−210287号公報
【0006】
【発明が解決しようとする課題】
ところで、ホワイトボードが例えば電灯の光を反射している場合には、このホワイトボードを撮像して得られる画像は、照度ムラが生じていて見辛いものとなる。
【0007】
上記特許文献では、この照度ムラを低減すべく、撮像画像を複数のブロックに分割し、各ブロックに含まれる画素データのレベル分布のヒストグラムを用いて該ブロックの白地レベルを決定するとともに、この白地レベルを該ブロックの中心画素の白地レベルと設定して、隣接するブロックの中心画素間の画素の白地レベルを、これらの中心画素の白地レベルを用いて線形補間により決定するようにしている。
【0008】
しかしながら、ブロックの中心画素間の画素の白地レベルを決定する場合に、上記のように各ブロックに含まれる画素データのレベル分布のヒストグラムを用いて得た該ブロックの白地レベルをそのまま利用すると、電灯光の反射光を撮像した画素の周辺に位置する画素の白地レベルが、本来の白地レベルとは異なる場合がある。特に、電灯光の反射光を撮像した画素の位置に近い画素については、線形補間により算出した白地レベルが、電灯光の反射光を撮像した画素の白地レベルの割合が大きいものとなることにより、実際の白地レベルとは大きく異なることが多く、下地とばし処理を適切に行うことは困難であった。
【0009】
本発明は、上記事情に鑑みてなされたものであり、下地とばし処理を適切に行うことのできる画像処理方法及び画像処理装置を提供することを目的とする。
【0010】
【課題を解決するための手段】
請求項1に記載の発明は、画像を複数の画素からなる複数のブロックに分割し、分割されたブロックごとに下地レベルを設定し、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行い、前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出することを特徴とする画像処理方法である。
【0011】
請求項5に記載の発明は、画像を複数の画素からなる複数のブロックに分割する分割手段と、分割されたブロックごとに下地レベルを設定する設定手段と、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行う平滑化処理手段と、前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する算出手段とを備えることを特徴とする画像処理装置である。
【0012】
請求項1または5に記載の発明によれば、画像を複数の画素からなる複数のブロックに分割されたブロックごとに下地レベルを設定し、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行うようにしたから、電灯光の反射光等を撮像した画素を有するブロックの下地レベルについて、電灯光の反射光等を撮像していない他のブロックの下地レベルとの差が縮小される。
【0013】
これにより、平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する際に、各ブロックの中心画素やこの中心画素間に位置する画素の下地レベルが、本来の下地レベルと大きく異なる値となるのを回避することができ、その結果、適切な下地とばし処理を行うことができる。
【0014】
請求項2に記載の発明は、請求項1に記載の画像処理方法において、前記所定のブロックは、該所定のブロックが属するブロック群のブロックのうち、前記画像の中心から最も遠い位置に位置するものであることを特徴とするものである。
【0015】
この発明によれば、前記ブロック群における前記所定のブロックを、該所定のブロックが属するブロック群のブロックのうち、画像の中心から最も遠い位置に位置するように設定したから、電灯光の反射光が写る可能性の少ない画像の中央に、より近いブロックで下地レベルが算出されることとなる。これにより、各画素の下地レベルをより適切に設定することができる。
【0016】
請求項3に記載の発明は、請求項1または2に記載の画像処理方法において、前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うことを特徴とするものである。
【0017】
この発明によれば、前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うようにしたので、電灯光の反射光等が写る可能性の少ない画像の中央に位置する画素から平滑化処理が行われることとなる。これにより、画素の下地レベルをより適切に設定することができる。
【0018】
請求項4に記載の発明は、請求項1ないし3のいずれかに記載の画像処理方法において、前記平滑化処理は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とするものであることを特徴とするものである。
【0019】
この発明によれば、前記平滑化処理は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とするものとしたので、ブロック群の中に、電灯光の反射光等を撮像したブロックが存在した場合であっても、このブロックを用いて平滑化処理が行われるのをできるだけ回避することができ、その結果、画素の下地レベルをより適切に設定することができる。
【0020】
【発明の実施の形態】
本発明の実施形態について説明する。
【0021】
図1は、本発明に係る画像処理方法を採用するデジタルカメラの制御ブロック図である。
【0022】
図1に示すように、デジタルカメラ1は、光学系2、撮像素子3、信号処理部4、A/D変換部5、画像処理部6、画像メモリ7、制御部8、記憶部22、VRAM23、表示部24及び操作部25を備えて構成されている。
【0023】
光学系2は、光軸方向に駆動されるズームレンズを含み、被写体の光像を撮像素子3の結像面上に結像するものである。
【0024】
撮像素子3は、例えばフォトダイオード等の複数の光電変換素子がマトリックス状に2次元配列され、各光電変換素子の受光面に、それぞれR(赤),G(緑),B(青)の色フィルタが1:2:1の比率で配設されてなるCCDカラーエリアセンサである。
【0025】
撮像素子3は、光学系2により結像された被写体の光像を、例えば1/30(秒)毎にR(赤),G(緑),B(青)の色成分の電気信号(画像信号)に変換し、R,G,B各色の画像信号として出力する。
【0026】
撮像素子3は、図略のタイミングジェネレータ等により、撮像素子3の露出動作の開始及び終了や、撮像素子3における各画素の出力信号の読出し(水平同期、垂直同期、転送)等の撮像動作が制御される。
【0027】
信号処理部4は、CDS(相関二重サンプリング)回路やAGC(オートゲインコントロール)回路等を有し、撮像素子3から出力されるアナログの画像信号に、CDS回路により画像信号のノイズの低減を行って、AGC回路により画像信号のレベル調整を行う等の所定のアナログ信号処理を施すものである。
【0028】
A/D変換部5は、信号処理部4により出力されたアナログ値のR,G,Bの画像信号を、複数のビットからなるデジタル値の画像信号(以下、デジタル信号という)にそれぞれ変換するものである。
【0029】
画像処理部6は、A/D変換部5によりA/D変換されたR,G,Bの各デジタル信号に、黒レベルを基準の黒レベルに補正する黒レベル補正、光源に応じた白の基準に基づいて、R(赤)、G(緑)、B(青)の各色成分のデジタル信号のレベル変換を行うホワイトバランス、R(赤),G(緑),B(青)のデジタル信号のγ特性を補正するγ補正を行うものである。
【0030】
画像メモリ7は、画像処理部6から出力される画像を一時的に記憶するとともに、この画像データに対し制御部8により後述の処理を行うための作業領域として用いられるメモリである。画像メモリ7は、例えばRAM等である。
【0031】
制御部8は、例えば制御プログラムを記憶するROMや一時的にデータを記憶するRAMからなる図略の記憶部が内蔵されたマイクロコンピュータからなり、上述したデジタルカメラ1内の各部分の駆動を有機的に制御して、デジタルカメラ1の撮影動作を統括的に制御するものである。
【0032】
また、本実施形態においては、例えば文字や図等が描かれたホワイトボード等を撮影した場合に、この制御部8が、ホワイトボードの白地部分(文字等が描かれていない部分)を確実に純白色にし、かつ文字の明瞭化を行うための画像処理を行うところに特徴を有している。
【0033】
ここで、この画像処理の概略について説明すると、画像処理部6から出力されるR,G,Bの各デジタル信号を、以下の処理上の都合から、輝度信号Y及び色差信号Cr,Cbに変換する。そして、画像全体を複数のブロックに分割し、ブロックごとに、輝度Yについてのヒストグラムを生成する。
【0034】
次に、生成したヒストグラムにおいて、ある輝度(後述する平均輝度Ya)から低輝度側及び高輝度側に度数の極大部(ピーク)を探索し、このピークを用いて各ブロックにおける下地レベル(後述するブロック下地レベル)を設定する。次に、このブロック下地レベルを補正(平滑化)した後、この補正後のブロック下地レベルから画素ごとの下地レベル(後述する画素下地レベル)を算出する。
【0035】
次に、上記画素下地レベルを用いて、画素ごとに階調補正を行った後、ノイズの除去処理及び文字等の断線部分の連結処理を行い、黒色ではなく、赤や黄等の輝度の比較的高いインクで書かれた文字等を見やすくするための階調補正を行う。
【0036】
そして、文字領域等の彩度を向上させる処理及び輪郭補正処理を行った後、輝度信号Y及び色差信号Cr,Cbを元のR,G,Bの各デジタル信号に変換して終了する。
【0037】
以上のような画像処理を実現すべく、図1に示すように、制御部8は、RGB−YCrCb変換部9、ブロック設定部10、ヒストグラム生成部11、ブロック下地レベル設定部12、平滑化処理部13、画素下地レベル演算部14、第1階調補正処理部15、ノイズ除去・連結部16、第1彩度補正部17、第2階調補正処理部18、第2彩度補正部19、輪郭補正部20及びYCrCb−RGB変換部21を備える。
【0038】
なお、以下の説明において、文字等が描かれたホワイトボードの板面のうち、文字等が描かれた部分を文字領域、何も描かれていない白色の部分を白板領域というものとする。
【0039】
RGB−YCrCb変換部9は、輝度のヒストグラムを生成するため、画像処理部から出力されるR,G,Bの各デジタル信号を、次式(1)〜(3)に従って、輝度信号Y及び色差信号Cr,Cbに変換するものである。
【0040】
Y=0.299R+0.587G+0.114B …(1)
Cr=0.500R−0.419G−0.081B …(2)
Cb=−0.169R−0.332G+0.500B …(3)
ブロック設定部10は、RGB−YCrCb変換部9による変換処理後の画像を所定数のブロックに分割するものである。例えば、ブロック設定部10は、図2(a)に示すように、文字「ABC」が板面に書かれたホワイトボードを撮像素子3により撮像し、RGB−YCrCb変換部9により変換処理した画像を、図2(b)に示すように、複数のブロックに分割する。
【0041】
その際、本実施形態では、ブロック設定部10は、例えば、できるだけレンズの周辺光量落ちが発生している部分だけで一つのブロックが構成されるように、レンズの周辺光量落ちが発生している範囲の大きさに比してできる限り小さいサイズに分割する。
【0042】
これは、上述したように、各ブロックにおけるブロック下地レベルの設定を、ある輝度から低輝度側及び高輝度側に度数のピークを探索することにより行うことから、1つのブロックに、この周辺光量落ちが発生している部分と発生していない部分とが混在していると、例えば、そのブロックの適切なブロック下地レベルが、周辺光量落ちが発生している部分の輝度レベルであっても、周辺光量落ちが発生していない部分の輝度レベルがそのブロックのブロック下地レベルとして設定される場合が生じ、ブロック下地レベル設定部12により不適切なブロック下地レベルが設定される虞があるからである。
【0043】
なお、レンズの周辺光量落ちとは、レンズの外周側に入射する光が、レンズに対して斜めに入射することにより、レンズの単位面積あたりに入射される光量が、レンズの中央部に入射する光よりも少なくなり、その結果、画像の周辺(特に四隅)が暗くなる現象をいう。
【0044】
また、上記のようにRGB−YCrCb変換部9による変換処理後の画像を複数のブロックに分割するのは、ホワイトボードに手書きされたものは文字密度(白地部分に対する文字部分の比率)のばらつきが大きく、しかも写真撮影の場合は、光源が一定でなく、画像内で照度分布が大きく異なって撮像画像内の照度ムラが大きいことから、撮像画像の各部位の文字密度及び照度に応じたブロック下地レベルを設定するためである。
【0045】
ヒストグラム生成部11は、ブロック設定部10により生成された各ブロックに対し、ブロックの画素における輝度Yのヒストグラムを作成するものである。
【0046】
図3は、輝度Yについての度数分布を示す各種のヒストグラムであり、横軸は輝度Y、縦軸は画素数Nである。
【0047】
例えば、輝度の低いインク(例えば黒のインク)で描かれた文字の領域、白板領域、光源(例えば電灯の光)を反射した領域やホワイトボードの金属枠の領域を撮像した画素の数が比較的多いブロックの場合、そのヒストグラムは、図3(a)に示すように、文字領域の比較的低い或る輝度レベルで画素数が極大となり(矢印A)、白板領域の比較的高い或る輝度レベルで画素数が極大となり(矢印B)、光源を反射した領域及びホワイトボードの金属枠の領域の高い或る輝度レベルで画素数が極大となる(矢印C)。
【0048】
また、非常に輝度の低い物体の領域、白板領域、光源(例えば電灯の光)を反射した領域及びホワイトボードの金属枠の領域を撮像した画素の数が比較的多いブロックのヒストグラムは、例えば図3(b)に示すように、上記物体の領域の非常に低い或る輝度レベルで画素数が極大となり(矢印D)、白板領域の比較的高い或る輝度レベルで画素数が極大となり(矢印E)、光源を反射した領域及びホワイトボードの金属枠の領域の高い或る輝度レベルで画素数が極大となる(矢印F)。
【0049】
また、輝度の低いインクで描かれた文字の領域、及び図3(a)の矢印Cや図3(b)の矢印Fに示すピークの輝度レベルよりもさらに高い、光源を反射した領域等を撮像した画素の数が比較的多いブロックのヒストグラムは、例えば図3(c)に示すように、文字領域の比較的低い或る輝度レベルで画素数が極大となり(矢印G)、光源を反射した領域及びホワイトボードの金属枠の領域の非常に高い或る輝度レベルで画素数が極大となる(矢印H)。
【0050】
さらに、輝度の低いインク(例えば黒のインク)で描かれた文字の領域、白板領域、光源(例えば電灯の光)を反射した領域及びホワイトボードの金属枠の領域に加えて、例えばオレンジ色や黄色等のインクで書かれた文字等、輝度が白板領域とやや近似する文字領域を撮像した画素を有するブロックについては、そのヒストグラムを忠実に作成すると、例えば図3(d)に示すように、図3(a)に示すヒストグラムに対し、さらに白板領域の輝度レベルよりやや低い輝度レベルにおいてピーク(矢印I)を有するものとなる。
【0051】
しかし、上述したように、各ブロックにおけるブロック下地レベルの設定を、或る輝度から低輝度側及び高輝度側に度数のピークを探索することにより行うことから、オレンジ色等のインクで書かれた文字等の領域の輝度が、白板領域の輝度と後述する画像全体の輝度との間の値となった場合、白板領域の輝度をブロック下地レベルと設定すべきところを、オレンジ色のインクで書かれた文字等の領域の輝度をブロック下地レベルと誤って設定される虞がある。
【0052】
そこで、本実施形態においては、図3(e)に示すように、色差信号Cr,Cbの値が所定の閾値以下、すなわち彩度の低い画素データだけを用いてヒストグラムを作成することにより、白板領域と近似する文字領域の輝度レベルにおけるピークを予め除去しておくようにしている。
【0053】
ブロック下地レベル設定部12は、撮影対象の目的物の背景(上記の例ではホワイトボードの白板領域)を下地というものとすると、ブロックごとに作成したヒストグラムを用いて、各ブロックに対して下地の輝度レベルを設定するものである。なお、このように設定したブロックにおける下地の輝度レベルをブロック下地レベルという。
【0054】
ブロック下地レベル設定部12は、まず、ホワイトボードの板面の平均輝度を算出する。ここで、ホワイトボードは、画像の中央部分に存在する可能性が高いと考えられるから、ブロック下地レベル設定部12は、図2(c)に示すように、ホワイトボードの板面の平均輝度を正確に算出するために、画像の中央部分(例えば画像全体の縦横それぞれ60%の中央部分)から平均輝度Yaを算出する。
【0055】
そして、上記のような各種のヒストグラムにおいて、複数の極大値を有する輝度レベルのうち、算出した画像の平均輝度Yaに最も近い輝度レベルを、ブロック下地レベルとして設定する。
【0056】
例えば、あるブロックについてのヒストグラムが、図4(a)に示すものとなったとし、算出された画像の平均輝度Yaが図4(a)に示す輝度であるものとすると、まず、平均輝度Yaから高輝度側(矢印Pの方向)に、各輝度レベルにおける頻度値(度数)の大小を判定していく。そして、最初に現れたピークをピークYとする。
【0057】
なお、このピークYの検出は、例えば、或る輝度レベルの頻度値について、高輝度側の異なる複数の輝度レベルよりも頻度値が高いか否か、及び低輝度側の異なる複数の輝度レベルよりも頻度値が高いか否かを判定し、これらの比較対象の輝度レベルの頻度値より高いか、もしくは同一の場合に、ピークであると判定することにより行う。
【0058】
ここで、図4(b)に示すような非常に高い輝度レベル(矢印J)がブロック下地レベルとして設定されると、次のような不具合がある。
【0059】
すなわち、後述する画素下地レベル演算部14では、各ブロックのブロック下地レベルを、該ブロックの中心位置に位置する画素の下地レベルとみなして、各ブロックの中心画素間に位置する画素の下地レベルを線形補間により算出するため、高い輝度レベルが当該ブロックのブロック下地レベルとして設定されると、画素下地レベル演算部14により算出する中心画素間の画素、特に中心画素の近傍に位置する画素の下地レベルが、当該画素が属するブロックのブロック下地レベルと大きく異なるものとなる場合が生じる。
【0060】
本実施形態では、このような不具合を防止すべく、図4(c)に示すように、上述した非常に高い輝度レベルよりも小さい上限値Ymax(輝度レベルを256階調で表現するものとすると例えば250階調)を設定し、この上限値Ymaxまでの輝度レベルについて頻度値の大小判定を行うようにしている。
【0061】
これにより、ブロックが、非常に高い輝度(本実施形態においては、階調が250を超える輝度)を有する被写体を撮像した画素が存在するものであっても、このような輝度がブロック下地レベルとして設定されるのを防止することができる。
【0062】
一方、図4(b)に示すようなヒストグラムを有するブロックの場合には、平均輝度Yaから上限値Ymaxまでの間にピークを有しないので、上記のように上限値Ymaxまで頻度値の大小判定を行っても、ピークは検出されない。また、例えば、ブロック内のすべての画素が、平均輝度Yaよりも低い輝度を有するものである場合にも、ピークは検出されない。
【0063】
この場合には、上記平均輝度Yaを、該ブロックのブロック下地レベルとして設定することにより、背景(白地)の輝度レベルに近い輝度レベルをブロック下地レベルとして設定することができる。
【0064】
次に、図4(a)に示すヒストグラムにおいて、図4(d)に示すように、平均輝度Yaから低輝度側(矢印Qの方向)に、各輝度レベルにおける頻度値の大小を判定していく。このとき、最初に現れたピークをピークYとする。
【0065】
なお、このピークYの検出は、ピークYの検出と同様、例えば、ある輝度レベルの頻度値について、高輝度側の異なる複数の輝度レベルよりも頻度値が高いか否か、及び低輝度側の異なる複数の輝度レベルよりも頻度値が高いか否かを判定し、これらの比較対象の輝度レベルの頻度値より高いか、もしくは同一の場合に、ピークであると判定することにより行う。
【0066】
また、図4(e)に示すように、ホワイトボードに貼着しているマグネットや非常に暗い背景など、非常に低い輝度レベルがブロック下地レベルとして設定されると、次のような不具合がある。
【0067】
すなわち、上記と同様、後述する画素下地レベル演算部14では、各ブロックのブロック下地レベルを、該ブロックの中心位置に位置する画素の下地レベルとみなして、各ブロックの中心画素間に位置する画素の下地レベルを線形補間により算出するため、低い輝度レベルが当該ブロックのブロック下地レベルとして設定されると、画素下地レベル演算部14により算出する中心画素間の画素の下地レベルが、当該画素が属するブロックのブロック下地レベルと大きく異なるものとなる場合が生じる。
【0068】
本実施形態では、このような不具合を防止すべく、図4(f)に示すように、上述した非常に低い輝度レベルよりも大きい下限値Ymin(輝度レベルを256階調で表現するものとすると例えば10階調)を設定し、この下限値Yminまでの輝度レベルについて頻度値の大小判定を行うようにしている。
【0069】
一方、図4(e)に示すようなヒストグラムを有するブロックの場合、平均輝度Yaから下限値Yminまでの間にピークを有しないので、上記のように下限値Yminまで頻度値の大小判定を行っても、ピークは検出されない。また、例えば、ブロック内のすべての画素が、平均輝度Yaよりも高い輝度を有するものである場合にも、ピークは検出されない。
【0070】
この場合には、上記平均輝度Yaを、該ブロックのブロック下地レベルとして設定することにより、背景の輝度レベルに近い輝度レベルをピークレベルとして設定することができる。
【0071】
以上のように、高輝度側のピークYと低輝度側のピークYとを検出した場合には、いずれか平均輝度Yaに近い方を、そのブロックのブロック下地レベルYbとして設定する。例えば、図4(g)においては、
Ya−Y>Y−Ya …(4)
であるから、高輝度側のピークYをそのブロックのブロック下地レベルYbとして設定する。
【0072】
ところで、ホワイトボードに写った光源や、該ホワイトボードの金属枠の領域、あるいはホワイトボードに貼着されたマグネットなどの領域の輝度が上限値Ymaxと下限値Yminとの間の値であった場合でも、これらの領域を撮像したブロックにあっては、該ブロックの輝度のヒストグラムのみに基づいてブロック下地レベルを設定するように構成すると、高い輝度レベルまたは低い輝度レベルが当該ブロックのブロック下地レベルとして設定されることとなる。
【0073】
しかし、上記と同様、後述する画素下地レベル演算部14では、各ブロックのブロック下地レベルを、該ブロックの中心位置に位置する画素の下地レベルとみなして、各ブロックの中心画素間に位置する画素の下地レベルを線形補間により算出するため、高い輝度レベルまたは低い輝度レベルが当該ブロックのブロック下地レベルとして設定されると、画素下地レベル演算部14により算出する中心画素間の画素の下地レベルが、当該画素が属するブロックのブロック下地レベルと大きく異なるものとなる場合が生じる。
【0074】
平滑化処理部13は、この問題を回避すべく、全ての画素について、画像の中央に位置するブロックから周辺に位置するブロックに向かって順番に、ブロック下地レベル設定部12により設定した各ブロックのブロック下地レベルの平滑化(隣接するブロックとのブロック下地レベルの差を小さくすること)を行うものである。
【0075】
平滑化処理を画像の中央に位置するブロックから周辺に位置するブロックに向かって順番に行うのは、電灯光の反射光等が写る可能性の少ない画像の中央に位置する画素から平滑化処理を行うことで、より適切な画素下地レベルを設定するためである。
【0076】
図5は、平滑化処理部13による平滑化処理を説明するための図である。
【0077】
図5に示すように、平滑化処理部13は、平滑化を行う対象のブロック(以下、注目ブロックという、図5において斜線で示す)に対して平滑化処理を行うにあたり、当該注目ブロックを含む、縦横それぞれ所定数のブロック(本実施形態では、縦横それぞれ3ブロック)からなるブロック群を用いる。
【0078】
その際、この平滑化に用いるブロック(以下、平滑化ブロックという)を、注目ブロックが画像の中心Oから最も離間する角部に位置するように決定する。例えば、図5に示すように、画像全体を画像の中心Oを含む線分で縦横それぞれ2等分割し、注目ブロックが左上領域T1に位置するときには、注目ブロックが左上角部に位置するように平滑化ブロックを決定する。
【0079】
これと同様に、注目ブロックが左下領域T2に位置するときには、注目ブロックが左下角部に位置するように平滑化ブロックを決定し、右上領域T3に位置するときには、注目ブロックが右上角部に位置するように平滑化ブロックを決定し、右下領域T4に位置するときには、注目ブロックが右下角部に位置するように平滑化ブロックを決定する。
【0080】
なお、図5は、各領域T1〜T4における1組の注目ブロック及び平滑化ブロックをそれぞれ抽出し描いたものである。
【0081】
このように平滑化ブロックを設定するのは、光源の反射やホワイトボードの金属枠が存在する領域は、画像の周辺に位置することが多い一方、より画面中央に近い領域は、光源などの影響を受けていない領域が存在する可能性が高いことから、光源などの影響を受けていない、画面中央側のブロックを注目ブロックの平滑化に利用することで、注目ブロックのブロック下地レベルと、隣接するブロックのブロック下地レベルとの差が小さくなり、適切に平滑化を行うことができるからである。
【0082】
平滑化処理部13は、このように設定した平滑化ブロックと注目ブロックとの中で、輝度の低い所定数(本実施形態では3つ)のブロックを抽出し、これらのブロックのブロック下地レベルの平均Yabを算出して、この平均値Yabを注目ブロックのブロック下地レベルに設定する。
【0083】
また、図5(b)に示すように、光源の反射光が写っている可能性の少ない画像の中央に位置するブロックから平滑化処理を行って、ブロック下地レベルを適切に設定すべく、例えば右上領域T3におけるブロックに番号を付したとき、平滑化処理部13は、例えば1→2→6→5→9→10→11→7→3→4→8→12→・・・や、1→2→6→5→3→7→11→10→9→4→8→12→・・・、あるいは、1→2→5→3→6→9→4→7→10→8→11→12・・・や、1→2→5→9→6→3→4→7→10→8→11→12・・・などのように、画像の中央側に位置するブロックから周辺側に位置するブロックに向かって順番に平滑化処理を行っていく。
【0084】
画素下地レベル演算部14は、平滑化処理部13により平滑化処理が施された各ブロックのブロック下地レベルを、それぞれ対応するブロックの中心位置に位置する画素(以下、中心画素という)の下地レベルとみなした上で、各中心画素間に位置する画素の下地レベル(以下、画素下地レベルという)を線形補間により算出する。
【0085】
図6において、1つのマスが1つのブロックを表すものとし、ブロックB1の中心画素G1の画素下地レベルをY1、ブロックB2の中心画素G2の画素下地レベルをY2、ブロックB3の中心画素G3の画素下地レベルをY3、ブロックB4の中心画素G4の画素下地レベルをY4とすると、例えばブロックB1内の任意の画素Gxの画素下地レベルYを、これらの画素下地レベルY1〜Y4により算出する。
【0086】
すなわち、画素Gxの画素下地レベルYを次式(5)
=(α・Y1+β・Y2+γ・Y3+δ・Y4)/4 …(5)
により算出する。なお、α,β,γ,δは重み係数であり、各重み係数は、画素Gxから各ブロックB1〜B4の中心画素G1〜G4までの距離に比例する関係を有する。
【0087】
第1階調補正処理部15は、画素下地レベル演算部14により算出された画素下地レベルを用いて、画素ごとに、図7に示すような補正関数を設定し、この補正関数に基づいて階調補正を行うものである。
【0088】
図7は、第1階調補正処理部15による階調補正の補正関数を示すものであり、横軸は、第1階調補正処理部15の入力(RGB−YCrCb変換処理後の画像の画素の輝度レベル)、縦軸は、第1階調補正処理部15の出力である。
【0089】
図7に示す補正関数の場合は、入力が100未満のときには、出力を0とし、入力が画素下地レベル演算部14により算出された画素下地レベルYβ以上のときには、出力を255とする。また、入力レベルが100から上記画素下地レベルYβまでの間においては、入力と出力とを線形的な関係とし、この線形関数にしたがって階調補正を行う。
【0090】
この階調補正によれば、RGB−YCrCb変換処理後の画像における各画素の輝度レベルが、当該画素の画素下地レベル演算部14により算出された画素下地レベルYβ以上であるものについて、その輝度レベルが最高輝度(本実施形態ではY=255)に変換されるので、背景(白板)とすべき領域が、純白色に設定される。
【0091】
また、次式(6)で表される輝度レベルY
={25500/(355−Yβ)} …(6)
を境界とし、この値Yより小さい輝度レベルを有する画素については、出力レベルが入力レベルより小さい値に変換されることから、輝度レベルが上記式(6)に示すYの値より小さい輝度レベルを有する文字領域について、背景とのコントラストが大きくされる。
【0092】
ところで、画像処理部6により画像処理が施された画像に、小さな点状のノイズが含まれている場合、ノイズが発生している部分の画素については、ノイズが発生していない場合における当該画素の画素下地レベルより低い輝度レベルを有することとなる。したがって、このような画素については、図7に示す補正関数による階調補正を行っても、純白色(階調を255)に変換することができない。
【0093】
また、例えば図7に示すように、入力レベルが画素下地レベル演算部14により算出された画素下地レベルYβ以上である領域については、第1階調補正処理部15による階調補正により、最高輝度(階調255)に変換されることから、RGB−YCrCb変換処理後の画像における文字の一部分に、画素下地レベル演算部14により算出された画素下地レベルYβ以上である領域(インクが薄い領域やかすれている領域等)が存在した場合には、この部分で筆跡が途切れることとなる。
【0094】
ノイズ除去・連結部16は、このようなノイズを除去して本来の背景色(純白色)に補正するとともに、筆跡が途切れた部分(断線部分)を連結する処理を行うものである。
【0095】
図8は、ノイズ除去・連結部16によるノイズ除去・連結処理を説明するための図である。
【0096】
例えば図8(a)に示すように、ノイズや途切れた部分が存在するものとすると、全ての画素について、当該画素の周囲に位置する8つの画素との輝度レベルの平均値を算出し、当該画素の輝度レベルをその平均の輝度レベルに設定する(以下、この処理を平均値処理という)。これにより、図8(b)に示すように、平均値処理後の画像は、文字やノイズがぼやけたものとなる。
【0097】
そして、ノイズ除去・連結部16は、平均値処理後の画像であって、輝度レベルが最高輝度でない画素について、例えば所定の方向に所定数以上連続しているか否かを判定し、連続する画素数が所定数より少ない場合には、その画素は孤立点、すなわちノイズと判定し、輝度レベルを最高輝度に変換する。これにより、図8(c)に示すように、ノイズを除去することができる(以下、この処理を孤立点除去処理という)。
【0098】
また、文字の途切れた部分を連結し、且つぼかした文字を明瞭にするため、ノイズ除去・連結部16は、第1階調補正処理後の画像と平均値処理・孤立点除去処理後の画像とを比較して、次のような処理を行う。
【0099】
すなわち、ノイズ除去・連結部16は、第1階調補正処理後の画像及び平均値処理・孤立点除去処理後の画像において、輝度レベルがともに最高輝度である画素については、白板領域を撮像したものであると判断し、その画素の輝度レベルを最高輝度(純白色)に設定する。
【0100】
また、ノイズ除去・連結部16は、第1階調補正処理後の画像においては最高輝度を有し、平均値処理及び孤立点除去後に最高輝度でなくなった画素については、次のように処理する。
【0101】
第1階調補正処理後の画像においては最高輝度を有し、平均値処理及び孤立点除去後に最高輝度でなくなった画素には、本来、文字領域とすべき、上記の階調補正によって筆跡が途切れた部分の画素と、第1階調補正処理後の画像においては最高輝度を有していたが平均値処理後に最高輝度でなくなった、文字領域とすべきではない画素(例えば、図8(b)の矢印Lで示す領域の画素)とが含まれている。
【0102】
そこで、本実施形態では、図8(e)に示すように、上記所定の方向に上記所定数以上連続している2個の画素列のうち一方の画素列が他方の画素列の延長線上に存在するか否かを判断することにより、断線部分及びその断線部分における筆跡の方向(矢印K)を第1階調補正処理後の画像から検出するとともに、文字領域とすべき領域の画素(図8(e)の斜線部分)を検出する。
【0103】
そして、この文字領域とすべき領域の画素については、上記の階調補正によって文字の筆跡が途切れ、この途切れた部分が平均値処理により繋がったものと判断して、文字領域と考えられる周辺の画素を用いて輝度レベルを算出する。すなわち、当該画素の周辺に位置する8つの画素の輝度レベルの平均値をその輝度レベルに設定する。これにより、断線部分が連結される。
【0104】
一方、上述の文字領域とすべきではない画素については、その輝度レベルを最高輝度(純白色)に設定する。
【0105】
また、ノイズ除去・連結部16は、第1階調補正処理後の画像においては最高輝度を有さず、平均値処理及び孤立点除去処理後に最高輝度となった画素については、ノイズ(孤立点)を撮像し、このノイズが孤立点除去処理によって除去されたものと判断して、その画素の輝度レベルを孤立点除去処理において変換された最高輝度に維持する。
【0106】
また、ノイズ除去・連結部16は、第1階調補正処理後の画像及び平均値処理・孤立点除去処理後の輝度レベルがともに最高輝度でない画素については、文字領域を撮像したものであると判断し、その画素の輝度レベルを第1階調補正処理後の画像における当該画素の輝度レベルに設定する。
【0107】
これにより、図8(d)に示すように、図8(a)に対しノイズが除去され、且つ文字の途切れた部分が連結され、且つぼかした文字が明瞭化された画像が得られる。
【0108】
第1彩度補正部17は、ノイズ除去・連結部16による処理後の輝度が最高輝度(階調255)に変換された画素について、彩度を有することのないように、色差信号Cr,Cbの値を0にする補正を行うものである。
【0109】
第2階調補正処理部18は、最高輝度を有しない画素を、文字領域を撮像した画素であると判断して、図9に示すような補正関数により階調補正を行うものである。
【0110】
図9においては、入力レベルが128以下のときには、出力レベルを入力レベルと同一とし、例えばオレンジ色のインクで書かれた文字等、色の薄い文字等を見やすくするために、入力レベルが128より大きく255以下のときには、補正関数の傾きを入力レベルが128以下の場合の補正関数に比して緩やかにすることで、階調128を超える比較的高い輝度を有する画素が撮像した画像について、暗めに階調補正される。なお、この階調補正は、制御部8の各部による各種処理が終了した画像を所定の画像形成装置で印刷した場合に、上記のような文字を見やすくすることを特に考慮して行われている。
【0111】
第2彩度補正部19は、ホワイトボードに書かれた文字等を見やすくするために、階調補正後の文字領域に対して、色差信号Cr,Cbに所定のゲインをかけて、彩度を増加させるものである。
【0112】
輪郭補正部20は、周知の一般的な手法により、文字等の輪郭を強調する輪郭補正を行うものである。
【0113】
YCrCb−RGB変換部21は、輪郭補正部20により輪郭補正が施された輝度信号Y及び色差信号Cr,Cbを、次式(7)〜(9)にしたがって、RGBの画像信号に変換するものである。
【0114】
R=Y+1.402Cr …(7)
G=Y−0.714Cr−0.344Cb …(8)
B=Y+1.772Cb …(9)
記憶部22は、制御部8における上述した各種の処理が施された画像を記憶するものである。
【0115】
VRAM23は、表示部24に表示される画像のバッファメモリであり、表示部24の画素数に対応した画像の記憶容量を有する。
【0116】
表示部24は、制御部8における上述した各種の処理が施され、VRAM23に一時的に記憶された画像を表示するものである。
【0117】
操作部25は、ホワイトボード等を撮影するため、制御部8に上述の各種処理を実行させるモードと、これらの処理を行わないで通常の撮影動作を実行させるモードとを切り替えるための操作部を含む。
【0118】
次に、本発明の画像処理方法の手順について説明する。
【0119】
図10は、本発明の画像処理方法の手順を示すフローチャートである。
【0120】
図10に示すように、まず、画像処理部6によりR,G,Bの各デジタル信号が出力される(ステップ♯1)と、RGB−YCrCb変換部9により、これらのデジタル信号が輝度信号Y及び色差信号Cr,Cbに変換された(ステップ♯2)後、ブロック設定部10により、画像全体が複数のブロックに分割され(ステップ♯3)、ヒストグラム生成部11により、ブロックごとにブロックの画素における輝度Yのヒストグラムが生成される(ステップ♯4)。
【0121】
そして、ブロック下地レベル設定部12により、生成したヒストグラムを用いて各ブロックにおけるブロック下地レベルが設定され(ステップ♯5)、平滑化処理部13により、このブロック下地レベルが平滑化された(ステップ♯6)後、画素下地レベル演算部14により、この平滑化処理後のブロック下地レベルから画素ごとに画素下地レベルが算出される(ステップ♯7)。
【0122】
次に、第1階調補正処理部15により、上記画素下地レベルを用いて、画素ごとに階調補正が行われ(ステップ♯8)、ノイズ除去・連結部16により、ノイズの除去処理及び文字等の断線部分の連結処理が行われる(ステップ♯9)。
【0123】
そして、ノイズ除去・連結部16による処理後の画素の輝度が最高輝度を有しない場合(ステップ♯10でYES)には、第2階調補正処理部18により、その画素の輝度に対し図9に示す補正関数により階調補正が行われた(ステップ♯11)後、第2彩度補正部19により、文字領域等の彩度を向上するための処理が行われる(ステップ♯12)。一方、ステップ♯10において、ノイズ除去・連結部16による処理後の画素の輝度が最高輝度を有する場合(ステップ♯10でNO)には、第1彩度補正部により、その画素について、色差信号Cr,Cbの値を0にする補正が行われる(ステップ♯13)。
【0124】
そして、ステップ♯12又は♯13の処理が終了すると、輪郭補正部20により輪郭補正処理が行われた(ステップ♯14)後、YCrCb−RGB変換部21により輝度信号Y及び色差信号Cr,CbをR,G,Bの各デジタル信号に変換される(ステップ♯15)。
【0125】
図11は、図10のステップ♯5のブロック下地レベル設定部12によるブロック下地レベル設定処理の詳細な手順を示すフローチャートである。
【0126】
図11に示すように、ホワイトボードの板面の平均輝度Yaが算出され(ステップ♯21)、この平均輝度Yaから高輝度側に上限値Ymaxまで、各輝度レベルにおける頻度値の大小判定が行われる(ステップ♯22)。
【0127】
そして、ピークが存在したか否かが判定され(ステップ♯23)、ピークが存在する場合(ステップ♯23でYES)には、最初に検出されたピークYが高輝度側のピークとして設定され(ステップ♯24)、ピークが存在しない場合(ステップ♯23でNO)には、平均輝度Yaが高輝度側のピークとして設定される(ステップ♯25)。
【0128】
次に、平均輝度Yaから低輝度側に下限値Yminまで、各輝度レベルにおける頻度値の大小判定が行われ(ステップ♯26)、ピークが存在したか否かが判定される(ステップ♯27)。
【0129】
その結果、ピークが存在する場合(ステップ♯27でYES)には、最初に検出されたピークYが低輝度側のピークとして設定され(ステップ♯28)、ピークが存在しない場合(ステップ♯27でNO)には、平均輝度Yaが低輝度側のピークとして設定される(ステップ♯29)。
【0130】
そして、ステップ♯24及び♯28で設定された高輝度側のピークYと低輝度側のピークYとについて、いずれか平均輝度Yaに近い方が、そのブロックのブロック下地レベルYbとして設定される(ステップ♯30)。
【0131】
以上の処理が全てのブロックについて終了するまで(ステップ♯31でNO)、処理対象のブロックを順番に変えて(ステップ♯32)、ステップ♯22〜♯30までの処理が行われ、全てのブロックについてブロック下地レベル設定処理が終了する(ステップ♯31でYES)と、ブロック下地レベル設定部12による処理を終了する。
【0132】
図12は、図10におけるステップ♯6の平滑化処理部13による平滑化処理の詳細な手順を示すフローチャートである。
【0133】
図12に示すように、まず、注目ブロックが、画像の左上領域に位置するとき(ステップ♯41でYES)、この注目ブロックが左上角部に位置するように平滑化ブロックが決定され(ステップ♯42)、注目ブロックが、画像の左下領域に位置するとき(ステップ♯43でYES)、この注目ブロックが左下角部に位置するように平滑化ブロックが決定され(ステップ♯44)、注目ブロックが、画像の右上領域に位置するとき(ステップ♯45でYES)、この注目ブロックが右上角部に位置するように平滑化ブロックが決定され(ステップ♯46)、注目ブロックが右下領域に位置するとき(ステップ♯45でNO)、この注目ブロックが右下角部に位置するように平滑化ブロックが決定される(ステップ♯47)。
【0134】
ステップ♯41,♯43,♯45、♯47のいずれかで決定された平滑化ブロックと注目ブロックとの中で、輝度の低い3つのブロックが抽出された(ステップ♯48)後、これらのブロックのブロック下地レベルの平均Yabが算出され(ステップ♯49)、この平均値Yabが注目ブロックのブロック下地レベルに設定される(ステップ♯50)。
【0135】
以上の処理が全てのブロックについて終了するまで(ステップ♯51でNO)、処理対象のブロックを順番に変えて(ステップ♯52)、ステップ♯41〜♯50までの処理が行われ、全てのブロックについて平滑化処理が終了する(ステップ♯51でYES)と、平滑化処理部13による処理を終了する。
【0136】
図13は、図10におけるステップ♯9のノイズ除去・連結部16によるノイズ除去・連結処理の詳細な手順を示すフローチャートである。
【0137】
図13に示すように、全ての画素について、当該画素の周囲に位置する8つの画素との輝度レベルの平均値を算出し、当該画素の輝度レベルをその平均の輝度レベルに設定する平均値処理が行われ(ステップ♯61)、輝度レベルが最高輝度でない画素について、例えば所定の方向に所定数以上連続しているか否かを判定し、連続する画素数が所定数より少ない場合に、その画素の輝度レベルを最高輝度に変換する孤立点除去処理が行われる(ステップ♯62)。
【0138】
そして、第1階調補正処理後の画像及び平均値処理・孤立点除去処理後の画像において、輝度レベルがともに最高輝度である画素(ステップ♯63,♯64でYES)については、その画素の輝度レベルが最高輝度に設定される(ステップ♯65)。
【0139】
一方、第1階調補正処理後の画像においては最高輝度を有し(ステップ♯63でYES)、平均値処理及び孤立点除去後に最高輝度でなくなった(ステップ♯64でNO)画素については、文字領域とすべき画素であるか否かが判定され(ステップ♯66)、文字領域とすべき画素である場合(ステップ♯66でYES)には、文字領域と考えられる周辺の画素を用いて輝度レベルが算出され(ステップ♯67)、文字領域とすべきでない画素である場合(ステップ♯66でNO)には、その画素の輝度レベルが最高輝度に設定される(ステップ♯68)。
【0140】
また、第1階調補正処理後の画像においては最高輝度を有さず(ステップ♯63でNO)、平均値処理及び孤立点除去処理後に最高輝度となった(ステップ♯69でYES)画素については、その画素の輝度レベルが孤立点除去処理において変換された最高輝度に維持され(ステップ♯70)、第1階調補正処理後の画像及び平均値処理・孤立点除去処理後の輝度レベルがともに最高輝度でない(ステップ♯63,♯69でNO)画素については、その画素の輝度レベルが第1階調補正処理後の画像における当該画素の輝度レベルに設定される(ステップ♯71)。
【0141】
このように、ブロックごとに設定したブロック下地レベルを、平滑化ブロックを用いて平滑化するようにしたから、光源の反射光等を撮像した画素を有するブロックのブロック下地レベルについて、光源の反射光等を撮像していない他のブロックのブロック下地レベルとの差を縮小することができる。
【0142】
これにより、平滑化処理により算出されたブロック下地レベルを用いて、各ブロックの中心画素及びこの中心画素間に位置する画素の白地レベルを算出する際に、各ブロックの中心画素やこの中心画素間に位置する画素の画素下地レベルが、本来の画素下地レベルと大きく異なる値となるのを回避することができ、その結果、適切な下地とばし処理を行うことができる。
【0143】
また、平滑化ブロックを、注目ブロックが画像の中心Oから最も離間する角部に位置するように決定し、電灯光の反射光が写る可能性の少ない画像の中央に、より近いブロックでブロック下地レベルを算出するようにしたから、画素下地レベルをより適切に設定することができる。
【0144】
また、画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に平滑化処理を行うことで、電灯光の反射光等が写る可能性の少ない画像の中央に位置する画素から平滑化処理を行うようにしたので、画素下地レベルをより適切に設定することができる。
【0145】
また、注目ブロックのブロック下地レベルを、この注目ブロックが属するブロック群における各ブロックのブロック下地レベルのうち、輝度の低い方の複数のブロックのブロック下地レベルの平均値とするようにしたので、ブロック群の中に、電灯光の反射光等を撮像したブロックが存在した場合であっても、このブロックを用いて平滑化処理が行われるのをできるだけ回避することができ、画素下地レベルをより適切に設定することができる。
【0146】
なお、本発明は、上記実施形態に限らず、次の変形形態(1),(2)が採用可能である。
【0147】
(1)上記実施形態においては、RGB−YCrCb変換部9、ブロック設定部10、ヒストグラム生成部11、ブロック下地レベル設定部12、平滑化処理部13、画素下地レベル演算部14、第1階調補正処理部15、ノイズ除去・連結部16、第1彩度補正部17、第2階調補正処理部18、第2彩度補正部19、輪郭補正部20及びYCrCb−RGB変換部21をデジタルカメラ1に搭載する場合について説明したが、これに限らず、図14に示すように、パーソナルコンピュータ26(以下、PC26という)の制御部27に搭載するように構成してもよい。
【0148】
この場合、図14に示すように、PC26は、例えばデジタルカメラなどの画像入力装置28からγ補正等の処理を施した画像を取り込み、上述のようにヒストグラムの生成、ブロック下地レベルの設定、平滑化処理、画素下地レベルの算出、ノイズ除去・連結処理等を行った後、ハードディスク装置等の画像記憶装置29に記憶する。
【0149】
また、この画像を紙面への印刷等の出力を行う場合には、PC26は、画像記憶装置29から該画像を取り込み、プリンタ等の画像出力装置29に画像を送出し、その画像出力装置30にプリントアウトを行わせるようにしてもよい。なお、操作部31は、制御部27にヒストグラムの生成処理等の実行を指示する入力を行うためのもので、マウスやキーボードを指す。
【0150】
(2)図14に示すPC26及び上記実施形態におけるデジタルカメラ1は、所定のプログラムにより、機能的に、RGB−YCrCb変換部9,32、ブロック設定部10,33、ヒストグラム生成部11,34、ブロック下地レベル設定部12,35、平滑化処理部13,36、画素下地レベル演算部14,37、第1階調補正処理部15,38、ノイズ除去・連結部16,39、第1彩度補正部17,40、第2階調補正処理部18,41、第2彩度補正部19,42、輪郭補正部20,43及びYCrCb−RGB変換部21,44を備えて、各種の処理を実行するようにしたものであるが、これに限られず、ハードウェアにより、これらの処理を実行する構成としてもよい。
【0151】
なお、所定のプログラムにより、制御部8,27に上記各部を備える場合には、例えばフレキシブルディスク、CD−R、あるいはDVD−Rなどの外部の記録媒体との間でデータの読み書きを行う図略の装置を用いて、PC26を、RGB−YCrCb変換部9,32、ブロック設定部10,33、ヒストグラム生成部11,34、ブロック下地レベル設定部12,35、平滑化処理部13,36、画素下地レベル演算部14,37、第1階調補正処理部15,38、ノイズ除去・連結部16,39、第1彩度補正部17,40、第2階調補正処理部18,41、第2彩度補正部19,42、輪郭補正部20,43及びYCrCb−RGB変換部21,44として機能させるためのプログラムを記録した記録媒体から該プログラムをインストールするようにし、PC26はこのプログラムをインストールすることで、機能的にRGB−YCrCb変換部9,32等を備えるように構成するとよい。
【0152】
以上、本明細書で開示された主な発明を次にまとめる。
【0153】
[付記1] 画像を複数の画素からなる複数のブロックに分割し、分割されたブロックごとに下地レベルを設定し、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行い、前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出することを特徴とする画像処理方法。
【0154】
[付記2] 前記所定のブロックは、該所定のブロックが属するブロック群のブロックのうち、前記画像の中心から最も遠い位置に位置するものであることを特徴とする付記1に記載の画像処理方法。
【0155】
[付記3] 前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うことを特徴とする付記1または2に記載の画像処理方法。
【0156】
[付記4] 前記平滑化処理は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とするものであることを特徴とする付記1ないし3のいずれかに記載の画像処理方法。
【0157】
[付記5] 画像を複数の画素からなる複数のブロックに分割する分割手段と、分割されたブロックごとに下地レベルを設定する設定手段と、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行う平滑化処理手段と、前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する算出手段とを備えることを特徴とする画像処理装置。
【0158】
[付記6] 前記平滑化処理手段は、前記所定のブロックを、該所定のブロックが属するブロック群のブロックのうち、前記画像の中心から最も遠い位置に位置するように設定することを特徴とする付記5に記載の画像処理装置。
【0159】
[付記7] 前記平滑化処理手段は、前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うことを特徴とする付記5または6に記載の画像処理装置。
【0160】
[付記8] 前記平滑化処理手段は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とすることを特徴とする請求項5ないし7のいずれかに記載の画像処理装置。
【0161】
[付記9] 画像処理装置に、
画像を複数の画素からなる複数のブロックに分割する分割手段と、
分割されたブロックごとに下地レベルを設定する設定手段と、
複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行う平滑化処理手段と、
前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する算出手段
としての機能を搭載するためのプログラム。
【0162】
[付記10] 画像処理装置に、
画像を複数の画素からなる複数のブロックに分割する分割手段と、
分割されたブロックごとに下地レベルを設定する設定手段と、
複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行う平滑化処理手段と、
前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する算出手段
としての機能を搭載するためのプログラムが記録された、前記画像処理装置により読取可能な記録媒体。
【0163】
【発明の効果】
請求項1または5に記載の発明によれば、画像を複数の画素からなる複数のブロックに分割されたブロックごとに下地レベルを設定し、複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行うようにしたから、電灯光の反射光等を撮像した画素を有するブロックの下地レベルについて、電灯光の反射光等を撮像していない他のブロックの下地レベルとの差を縮小することができる。
【0164】
これにより、平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する際に、各ブロックの中心画素やこの中心画素間に位置する画素の下地レベルが、本来の下地レベルと大きく異なる値となるのを回避することができ、その結果、下地とばし処理を適切に行うことができる。
【0165】
請求項2に記載の発明によれば、前記ブロック群における前記所定のブロックを、該所定のブロックが属するブロック群のブロックのうち、画像の中心から最も遠い位置に位置するように設定したから、電灯光の反射光が写る可能性の少ない画像の中央に、より近いブロックで下地レベルが算出されることとなる。これにより、各画素の下地レベルをより適切に設定することができる。
【0166】
請求項3に記載の発明によれば、前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うようにしたので、電灯光の反射光等が写る可能性の少ない画像の中央に位置する画素から平滑化処理が行われることとなる。これにより、画素の下地レベルをより適切に設定することができる。
【0167】
請求項4に記載の発明によれば、前記平滑化処理は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とするものとしたので、ブロック群の中に、電灯光の反射光等を撮像したブロックが存在した場合であっても、このブロックを用いて平滑化処理が行われるのをできるだけ回避することができ、その結果、画素の下地レベルをより適切に設定することができる。
【図面の簡単な説明】
【図1】本発明に係る画像処理方法を採用するデジタルカメラの制御ブロック図である。
【図2】(a)は画像の一例を示す図、(b)は(a)に示す画像を複数のブロックに分割した様子を示す図、(c)は平均輝度を算出する対象の領域を示す図である。
【図3】各種のヒストグラムの例を示す図である。
【図4】ブロック下地レベルの設定処理を説明するための図である。
【図5】平滑化処理を説明するための図である。
【図6】画素下地レベルの算出処理を説明するための図である。
【図7】算出した画素下地レベルを用いて画素ごとに行う階調補正の補正関数を示す図である。
【図8】ノイズ除去・連結部によるノイズ除去・連結処理を説明するための図である。
【図9】階調補正の補正関数を示す図である。
【図10】本発明の画像処理方法の手順を示すフローチャートである。
【図11】図10のステップ♯5のブロック下地レベル設定部によるブロック下地レベル設定処理の詳細な手順を示すフローチャートである。
【図12】図10のステップ♯6の平滑化処理部による平滑化処理の詳細な手順を示すフローチャートである。
【図13】図10のステップ♯9のノイズ除去・連結部によるノイズ除去・連結処理の詳細な手順を示すフローチャートである。
【図14】本発明に係る画像処理を実行する機能をパーソナルコンピュータに搭載した場合に、画像を撮像し、その画像を記憶したり記録紙等に出力するように構成されたシステムのブロック図である。
【符号の説明】
8,27 制御部
9,32 RGB−YCrCb変換部
10,33 ブロック設定部
11,34 ヒストグラム生成部
12,35 ブロック下地レベル設定部
13,36 平滑化処理部
14,37 画素下地レベル演算部
15,38 第1階調補正処理部
16,39 ノイズ除去・連結部
17,40 第1彩度補正部
18,41 第2階調補正処理部
19,42 第2彩度補正部
20,43 輪郭補正部
21,44 YCrCb−RGB変換部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing method and an image processing apparatus for performing a background removal process on an image obtained by photographing a white board or the like.
[0002]
[Prior art]
In general, a digital camera can freely control the image quality of an image captured by image processing. Therefore, by performing appropriate processing on the image quality of the captured image according to the purpose of shooting and the type of subject, a silver halide film can be used. This is advantageous in that an image with more favorable image quality can be obtained as compared with a camera that shoots images at a higher speed. For this reason, it is used not only for normal photographing but also for photographing, for example, characters and figures drawn on a whiteboard in a conference hall.
[0003]
When photographing a whiteboard on which characters, figures, and the like are drawn by a digital camera, the purpose of the photographing is to record information such as characters and figures on the whiteboard. For this reason, it is necessary to improve the clarity of information portions such as characters and figures by performing a so-called background removal process for ensuring that the white background portion of the whiteboard is pure white for the captured image as described above. Can be
[0004]
Japanese Patent Application Laid-Open Publication No. H11-163873 discloses that, when photographing a whiteboard, an object light image is converted into three primary colors in order to improve the clarity of information portions such as characters and figures by skipping the background (whiteboard portion) of the whiteboard. Γ characteristic for converting a pixel signal of a predetermined white background level or higher into a white saturation level using the pixel signal of each color component for each color component image, and using this γ characteristic A configuration configured to perform the correction is disclosed.
[0005]
[Patent Document]
JP-A-10-210287 [0006]
[Problems to be solved by the invention]
By the way, when the white board reflects, for example, the light of an electric lamp, an image obtained by imaging the white board has uneven illuminance and is hard to see.
[0007]
In the above-mentioned patent document, in order to reduce the illuminance unevenness, a captured image is divided into a plurality of blocks, and a white background level of each block is determined using a histogram of a level distribution of pixel data included in each block. The level is set as the white background level of the center pixel of the block, and the white background level of the pixel between the center pixels of the adjacent blocks is determined by linear interpolation using the white background levels of these center pixels.
[0008]
However, when determining the white background level of the pixel between the center pixels of the block, if the white background level of the block obtained by using the histogram of the level distribution of the pixel data included in each block as described above is used as it is, In some cases, the white background level of a pixel located around the pixel where the reflected light is imaged is different from the original white background level. In particular, for a pixel close to the position of the pixel that captured the reflected light of the electric light, the white background level calculated by linear interpolation has a large percentage of the white background level of the pixel that has captured the reflected light of the electric light. It often differs greatly from the actual white background level, and it has been difficult to properly perform the background removal processing.
[0009]
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an image processing method and an image processing apparatus that can appropriately perform background removal processing.
[0010]
[Means for Solving the Problems]
According to the first aspect of the present invention, an image is divided into a plurality of blocks including a plurality of pixels, a background level is set for each of the divided blocks, and a background level of a predetermined block in a block group including a plurality of blocks is set. Performing a smoothing process on the basis of the average value of the background level in a predetermined number of blocks among the other blocks in the block group, and using the background level calculated by the smoothing process, the center pixel and the center of each block. An image processing method comprising calculating a background level of a pixel located between pixels.
[0011]
According to a fifth aspect of the present invention, there is provided a dividing unit that divides an image into a plurality of blocks including a plurality of pixels, a setting unit that sets a background level for each of the divided blocks, and a predetermined unit in a block group including a plurality of blocks. Means for performing a smoothing process for setting the background level of the block to an average value of the background levels in a predetermined number of blocks among the other blocks in the block group; and calculating the background level calculated by the smoothing process. An image processing apparatus comprising: a calculating unit configured to calculate a base pixel of a central pixel of each block and a pixel located between the central pixels.
[0012]
According to the first or fifth aspect of the present invention, a background level is set for each of blocks obtained by dividing an image into a plurality of blocks including a plurality of pixels, and the background level of a predetermined block in a block group including a plurality of blocks is set. Is set to the average value of the background level in a predetermined number of blocks among the other blocks in the block group, so that the background level of the block having the pixel in which the reflected light or the like of the electric light is imaged is obtained. In addition, the difference from the background level of another block that does not image the reflected light of the electric light or the like is reduced.
[0013]
Thereby, when calculating the background level of the center pixel of each block and the pixels located between the center pixels using the background level calculated by the smoothing process, the center pixel of each block and the space between the center pixels are calculated. It is possible to avoid that the background level of the located pixel is significantly different from the original background level, and as a result, it is possible to perform appropriate background removal processing.
[0014]
According to a second aspect of the present invention, in the image processing method according to the first aspect, the predetermined block is located at a position farthest from the center of the image among blocks in a block group to which the predetermined block belongs. It is characterized by being.
[0015]
According to this invention, since the predetermined block in the block group is set to be located farthest from the center of the image among the blocks of the block group to which the predetermined block belongs, the reflected light of the electric light is The background level is calculated in a block closer to the center of the image in which is unlikely to appear. Thus, the background level of each pixel can be set more appropriately.
[0016]
According to a third aspect of the present invention, in the image processing method according to the first or second aspect, the smoothing process is performed in order from a block group located at the center of the image to a block group located on the peripheral side. It is characterized by the following.
[0017]
According to the present invention, since the smoothing process is performed in order from the block group located at the center of the image to the block group located on the peripheral side, there is little possibility that reflected light of electric light or the like is captured. The smoothing process is performed from the pixel located at the center of the image. This makes it possible to more appropriately set the background level of the pixel.
[0018]
According to a fourth aspect of the present invention, in the image processing method according to any one of the first to third aspects, the smoothing process includes setting a background level of the predetermined block to a background level of each block in the block group. Among them, the average value of the background levels of a plurality of blocks having a lower luminance is used.
[0019]
According to the present invention, in the smoothing processing, the background level of the predetermined block is set to an average value of the background levels of a plurality of blocks having lower luminance among the background levels of the blocks in the block group. Therefore, even if there is a block in which an image of the reflected light of the electric light or the like is present in the block group, it is possible to avoid performing the smoothing process using this block as much as possible. As a result, the background level of the pixel can be set more appropriately.
[0020]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described.
[0021]
FIG. 1 is a control block diagram of a digital camera employing the image processing method according to the present invention.
[0022]
As shown in FIG. 1, the digital camera 1 includes an optical system 2, an image sensor 3, a signal processing unit 4, an A / D conversion unit 5, an image processing unit 6, an image memory 7, a control unit 8, a storage unit 22, and a VRAM 23. , A display unit 24 and an operation unit 25.
[0023]
The optical system 2 includes a zoom lens driven in the direction of the optical axis, and forms an optical image of a subject on an image plane of the image sensor 3.
[0024]
The image pickup device 3 includes a plurality of photoelectric conversion elements such as photodiodes, which are two-dimensionally arranged in a matrix, and R (red), G (green), and B (blue) colors are provided on a light receiving surface of each photoelectric conversion element. This is a CCD color area sensor in which filters are arranged at a ratio of 1: 2: 1.
[0025]
The image sensor 3 converts the optical image of the subject formed by the optical system 2 into electrical signals (images) of R (red), G (green), and B (blue) color components every 1/30 (second), for example. ), And output as image signals of R, G, and B colors.
[0026]
The image pickup device 3 performs an image pickup operation such as start and end of an exposure operation of the image pickup device 3 and readout (horizontal synchronization, vertical synchronization, and transfer) of an output signal of each pixel in the image pickup device 3 by a timing generator or the like (not shown). Controlled.
[0027]
The signal processing unit 4 includes a CDS (correlated double sampling) circuit, an AGC (auto gain control) circuit, and the like. The analog image signal output from the image sensor 3 is used to reduce noise of the image signal by the CDS circuit. Then, predetermined analog signal processing such as adjusting the level of an image signal by an AGC circuit is performed.
[0028]
The A / D conversion unit 5 converts the analog R, G, and B image signals output by the signal processing unit 4 into digital value image signals (hereinafter, referred to as digital signals) including a plurality of bits. Things.
[0029]
The image processing unit 6 performs black level correction for correcting the black level to a reference black level for each of the R, G, and B digital signals A / D-converted by the A / D conversion unit 5, and a white level corresponding to the light source. White balance for performing level conversion of digital signals of each color component of R (red), G (green), and B (blue) based on a reference, digital signals of R (red), G (green), and B (blue) The gamma correction is performed to correct the gamma characteristic.
[0030]
The image memory 7 is a memory that temporarily stores an image output from the image processing unit 6 and is used as a work area for performing a process described later on the image data by the control unit 8. The image memory 7 is, for example, a RAM.
[0031]
The control unit 8 includes a microcomputer having a built-in storage unit (not shown) including, for example, a ROM for storing a control program and a RAM for temporarily storing data, and drives each unit in the digital camera 1 described above. In this way, the photographing operation of the digital camera 1 is comprehensively controlled.
[0032]
In the present embodiment, for example, when a white board or the like on which characters, figures, and the like are drawn is taken, the control unit 8 ensures that a white background portion (a portion on which characters and the like are not drawn) of the white board is taken. It is characterized in that it is made pure white and image processing for clarifying characters is performed.
[0033]
Here, the outline of this image processing will be described. Each of the R, G, B digital signals output from the image processing unit 6 is converted into a luminance signal Y and color difference signals Cr, Cb for the following processing convenience. I do. Then, the entire image is divided into a plurality of blocks, and a histogram for the luminance Y is generated for each block.
[0034]
Next, in the generated histogram, a maximum part (peak) of the frequency is searched for on a low luminance side and a high luminance side from a certain luminance (an average luminance Ya described later), and the base level (described later) is used for each block using this peak. Block background level). Next, after correcting (smoothing) the block base level, a base level (pixel base level described later) for each pixel is calculated from the corrected block base level.
[0035]
Next, after performing tone correction for each pixel using the above-described pixel base level, noise removal processing and connection processing of broken portions such as characters are performed, and the luminance of red, yellow, etc., not black, is compared. Tone correction is performed to make characters and the like written with high-quality ink easy to see.
[0036]
Then, after performing the processing for improving the saturation of the character area and the like and the outline correction processing, the luminance signal Y and the color difference signals Cr, Cb are converted into the original R, G, B digital signals, and the processing is terminated.
[0037]
As shown in FIG. 1, the control unit 8 includes an RGB-YCrCb conversion unit 9, a block setting unit 10, a histogram generation unit 11, a block base level setting unit 12, and a smoothing process for realizing the above-described image processing. Unit 13, pixel background level calculation unit 14, first gradation correction processing unit 15, noise removal / connection unit 16, first saturation correction unit 17, second gradation correction processing unit 18, second saturation correction unit 19 , A contour correction unit 20 and a YCrCb-RGB conversion unit 21.
[0038]
In the following description, on the surface of the whiteboard on which characters and the like are drawn, a portion where the characters and the like are drawn is referred to as a character region, and a white portion where nothing is drawn is referred to as a white plate region.
[0039]
The RGB-YCrCb conversion unit 9 converts the R, G, and B digital signals output from the image processing unit into a luminance signal Y and a color difference according to the following equations (1) to (3) in order to generate a luminance histogram. The signals are converted into signals Cr and Cb.
[0040]
Y = 0.299R + 0.587G + 0.114B (1)
Cr = 0.500R-0.419G-0.081B (2)
Cb = −0.169R−0.332G + 0.500B (3)
The block setting unit 10 divides the image after the conversion processing by the RGB-YCrCb conversion unit 9 into a predetermined number of blocks. For example, as illustrated in FIG. 2A, the block setting unit 10 captures an image of a whiteboard on which a character “ABC” is written on a plate surface by using the image sensor 3 and converts the whiteboard by the RGB-YCrCb conversion unit 9. Is divided into a plurality of blocks as shown in FIG.
[0041]
At this time, in the present embodiment, the block setting unit 10 generates a peripheral light drop of the lens so that, for example, only one portion where the peripheral light drop of the lens is generated constitutes one block as much as possible. Divide the size into as small as possible compared to the size of the range.
[0042]
This is because, as described above, the setting of the block base level in each block is performed by searching for a frequency peak from a certain luminance to a low luminance side and a high luminance side. If there is a mixture of a part where the light is generated and a part where the light is not generated, for example, even if the appropriate block base level of the block is the luminance level of the part where the peripheral light intensity drop occurs, This is because the luminance level of the portion where the light quantity drop does not occur may be set as the block base level of the block, and the block base level setting unit 12 may set an inappropriate block base level.
[0043]
In addition, the amount of light incident on the outer peripheral side of the lens is obliquely incident on the lens, so that the amount of light incident per unit area of the lens is incident on the central portion of the lens. This is a phenomenon in which light is less than light, and as a result, the periphery (particularly, four corners) of an image is dark.
[0044]
Also, as described above, the image after the conversion processing by the RGB-YCrCb conversion unit 9 is divided into a plurality of blocks because the variation in the character density (the ratio of the character portion to the white background portion) of the handwritten on the whiteboard is caused. In the case of photographing, the light source is not constant, and the illuminance distribution in the image is greatly different due to the uneven illuminance in the captured image. This is for setting the level.
[0045]
The histogram generation unit 11 generates a histogram of the luminance Y in the pixels of the block for each block generated by the block setting unit 10.
[0046]
FIG. 3 shows various histograms showing the frequency distribution of the luminance Y. The horizontal axis represents the luminance Y, and the vertical axis represents the number of pixels N.
[0047]
For example, the number of pixels that image a region of a character drawn with low-luminance ink (for example, black ink), a region of a white plate, a region of reflecting a light source (for example, light of a light), or a region of a metal frame of a whiteboard are compared. In the case of a block with many targets, as shown in FIG. 3A, the number of pixels is maximized at a relatively low luminance level in a character area (arrow A), and a relatively high luminance in a white board area is obtained, as shown in FIG. The number of pixels is maximized at the level (arrow B), and the number of pixels is maximized at a certain high brightness level in the area reflecting the light source and the area of the metal frame of the whiteboard (arrow C).
[0048]
Further, a histogram of a block having a relatively large number of pixels that image a region of an object having a very low luminance, a white plate region, a region reflecting a light source (for example, light of a lamp), and a region of a metal frame of a whiteboard is shown in FIG. As shown in FIG. 3 (b), the number of pixels is maximized at a very low luminance level in the region of the object (arrow D), and the number of pixels is maximized at a relatively high luminance level in the white board region (arrow D). E), the number of pixels is maximized at a certain high luminance level in the area reflecting the light source and the area of the metal frame of the whiteboard (arrow F).
[0049]
In addition, a region of a character drawn with low-luminance ink, a region that reflects a light source and that is higher than the luminance level of the peak indicated by the arrow C in FIG. 3A or the arrow F in FIG. In the histogram of a block having a relatively large number of imaged pixels, for example, as shown in FIG. 3C, the number of pixels is maximized at a relatively low luminance level of a character area (arrow G), and the light source is reflected. At a very high luminance level in the area and in the area of the metal frame of the whiteboard, the number of pixels is maximal (arrow H).
[0050]
Further, in addition to the area of characters drawn with low-luminance ink (for example, black ink), the area of a white plate, the area of reflecting a light source (for example, light of an electric light), and the area of a metal frame of a white board, for example, For a block having pixels obtained by imaging a character region whose luminance is slightly similar to a white plate region, such as a character written with ink such as yellow, if the histogram is faithfully created, for example, as shown in FIG. The histogram shown in FIG. 3A has a peak (arrow I) at a luminance level slightly lower than the luminance level of the white plate area.
[0051]
However, as described above, since the setting of the block base level in each block is performed by searching for a frequency peak from a certain luminance to a low luminance side and a high luminance side, it is written with ink such as orange. When the brightness of the area such as a character becomes a value between the brightness of the white board area and the brightness of the entire image described later, the place where the brightness of the white board area should be set as the block base level is written with orange ink. There is a possibility that the luminance of the area of the drawn character or the like is erroneously set as the block base level.
[0052]
Therefore, in the present embodiment, as shown in FIG. 3 (e), the value of the color difference signals Cr and Cb is equal to or less than a predetermined threshold value, that is, a histogram is created using only pixel data with low saturation, so that a white board is created. The peak in the luminance level of the character area similar to the area is removed in advance.
[0053]
Assuming that the background of the object to be photographed (the whiteboard area of the whiteboard in the above example) is referred to as a background, the block background level setting unit 12 uses the histogram created for each block to set the background of each block. This is for setting the luminance level. Note that the luminance level of the background in the block set in this way is called a block background level.
[0054]
The block base level setting unit 12 first calculates the average luminance of the surface of the whiteboard. Here, since it is considered that the whiteboard is likely to exist in the center of the image, the block base level setting unit 12 sets the average luminance of the surface of the whiteboard as shown in FIG. In order to calculate accurately, the average luminance Ya is calculated from the central part of the image (for example, the central part of 60% in the vertical and horizontal directions of the entire image).
[0055]
Then, in the various histograms as described above, a luminance level closest to the average luminance Ya of the calculated image among the luminance levels having a plurality of local maxima is set as the block base level.
[0056]
For example, assuming that the histogram for a certain block is as shown in FIG. 4A and that the calculated average luminance Ya of the image is the luminance shown in FIG. 4A, first, the average luminance Ya , The magnitude of the frequency value (frequency) at each luminance level is determined from the high luminance side (the direction of arrow P). Then, a peak Y H peaks first appeared.
[0057]
The detection of the peak Y H, for example, a certain luminance level of frequency values, or higher frequency value than the plurality of luminance levels different high luminance side whether, and the low luminance side of a plurality of different luminance levels It is determined whether or not the frequency value is higher than the frequency value of the luminance level to be compared, or if the frequency value is higher than or equal to the frequency value of the luminance level to be compared, it is determined to be a peak.
[0058]
Here, if a very high luminance level (arrow J) as shown in FIG. 4B is set as the block base level, the following problem occurs.
[0059]
That is, the pixel background level calculation unit 14, which will be described later, considers the block background level of each block as the background level of the pixel located at the center position of the block, and determines the background level of the pixels located between the center pixels of each block. When a high luminance level is set as the block base level of the block to be calculated by the linear interpolation, the base level of the pixels between the center pixels calculated by the pixel base level calculation unit 14, particularly the pixels located near the center pixel, is calculated. May be significantly different from the block base level of the block to which the pixel belongs.
[0060]
In the present embodiment, in order to prevent such a problem, as shown in FIG. 4C, it is assumed that the upper limit value Ymax (the luminance level is expressed by 256 gradations) smaller than the above-described extremely high luminance level. For example, 250 gradations) are set, and the magnitude of the frequency value is determined for the luminance level up to the upper limit Ymax.
[0061]
Accordingly, even if a block includes a pixel that captures an object having an extremely high luminance (in this embodiment, a luminance whose gradation exceeds 250), such luminance is set as a block base level. Setting can be prevented.
[0062]
On the other hand, in the case of a block having a histogram as shown in FIG. 4B, since there is no peak between the average luminance Ya and the upper limit Ymax, the magnitude of the frequency value is determined up to the upper limit Ymax as described above. Is performed, no peak is detected. Further, for example, even when all the pixels in the block have luminance lower than the average luminance Ya, no peak is detected.
[0063]
In this case, by setting the average luminance Ya as the block base level of the block, a luminance level close to the luminance level of the background (white background) can be set as the block base level.
[0064]
Next, in the histogram shown in FIG. 4A, as shown in FIG. 4D, the magnitude of the frequency value at each luminance level is determined from the average luminance Ya to the lower luminance side (the direction of arrow Q). Go. At this time, a peak Y L peaks first appeared.
[0065]
The detection of the peak Y L, as well as the detection of the peak Y H, for example, the frequency value of a certain brightness level, whether the high frequency value than the plurality of luminance levels different high luminance side and low luminance It is determined whether or not the frequency value is higher than a plurality of luminance levels different from each other, and if the frequency value is higher than or equal to the frequency value of the luminance level to be compared, the peak is determined.
[0066]
Further, as shown in FIG. 4E, when a very low luminance level such as a magnet attached to a whiteboard or a very dark background is set as the block base level, the following problem occurs. .
[0067]
That is, in the same manner as described above, the pixel background level calculation unit 14, which will be described later, regards the block background level of each block as the background level of the pixel located at the center position of the block, and determines the pixels located between the center pixels of each block. When the low luminance level is set as the block base level of the block, the base level of the pixel between the center pixels calculated by the pixel base level calculation unit 14 is determined by the linear interpolation. In some cases, the level of the block greatly differs from the block base level.
[0068]
In this embodiment, in order to prevent such a problem, as shown in FIG. 4F, it is assumed that the lower limit value Ymin (the luminance level is expressed by 256 gradations), which is larger than the extremely low luminance level described above. (For example, 10 tones), and the magnitude of the frequency value is determined for the luminance level up to the lower limit Ymin.
[0069]
On the other hand, in the case of a block having a histogram as shown in FIG. 4E, since there is no peak between the average luminance Ya and the lower limit Ymin, the magnitude of the frequency value is determined up to the lower limit Ymin as described above. However, no peak is detected. Further, for example, even when all the pixels in the block have a luminance higher than the average luminance Ya, no peak is detected.
[0070]
In this case, by setting the average luminance Ya as the block base level of the block, a luminance level close to the background luminance level can be set as the peak level.
[0071]
As described above, when detecting the peak Y L peak Y H and the low-luminance side of the high-luminance side, the closer to either the average luminance Ya, set as a block ground level Yb of the block. For example, in FIG.
Ya-Y L> Y H -Ya ... (4)
Since it is, to set the peak Y H of the high luminance side as a block ground level Yb of the block.
[0072]
By the way, when the brightness of the light source reflected on the whiteboard, the area of the metal frame of the whiteboard, or the area of the magnet attached to the whiteboard is a value between the upper limit value Ymax and the lower limit value Ymin. However, in a block in which these regions are imaged, if the block base level is set based on only the histogram of the luminance of the block, the high luminance level or the low luminance level is set as the block base level of the block. Will be set.
[0073]
However, in the same manner as described above, the pixel background level calculation unit 14, which will be described later, regards the block background level of each block as the background level of the pixel located at the center position of the block, and determines the pixels located between the center pixels of each block. In order to calculate the background level of the block by linear interpolation, if a high brightness level or a low brightness level is set as the block base level of the block, the base level of the pixel between the central pixels calculated by the pixel base level calculation unit 14 is In some cases, the level greatly differs from the block base level of the block to which the pixel belongs.
[0074]
In order to avoid this problem, the smoothing processing unit 13 performs the processing for each of the blocks set by the block background level setting unit 12 in order from the block located at the center of the image to the blocks located at the periphery for all the pixels. This is for smoothing the block base level (reducing the difference between the block base levels of adjacent blocks).
[0075]
Performing the smoothing process in order from the block located at the center of the image to the blocks located at the periphery is because the smoothing process is performed from the pixel located at the center of the image where the reflected light of the electric light is unlikely to appear. By doing so, a more appropriate pixel background level is set.
[0076]
FIG. 5 is a diagram for explaining the smoothing process performed by the smoothing processing unit 13.
[0077]
As shown in FIG. 5, when performing the smoothing process on a block to be smoothed (hereinafter, referred to as a target block, which is indicated by oblique lines in FIG. 5), the smoothing processing unit 13 includes the target block. , A block group including a predetermined number of blocks in each of the vertical and horizontal directions (in the present embodiment, three blocks in each of the vertical and horizontal directions).
[0078]
At this time, a block used for the smoothing (hereinafter, referred to as a smoothing block) is determined such that the target block is located at a corner farthest from the center O of the image. For example, as shown in FIG. 5, the entire image is divided into two equal parts in the vertical and horizontal directions by a line segment including the center O of the image, and when the target block is located in the upper left area T1, the target block is located in the upper left corner. Determine the smoothing block.
[0079]
Similarly, when the target block is located in the lower left area T2, the smoothed block is determined so that the target block is located in the lower left corner, and when the target block is located in the upper right area T3, the smoothed block is located in the upper right corner. When the block is located in the lower right area T4, the smoothed block is determined so that the target block is located in the lower right corner.
[0080]
FIG. 5 is a diagram in which a set of a target block and a smoothed block in each of the regions T1 to T4 are extracted and drawn.
[0081]
The reason for setting the smoothing block in this way is that the area where the reflection of the light source or the metal frame of the whiteboard exists is often located at the periphery of the image, while the area closer to the center of the screen is affected by the light source etc. Since there is a high possibility that there is an area that has not been affected by light, the block on the center side of the screen, which is not affected by the light source, is used for smoothing the block of interest. This is because the difference between the target block and the block base level is reduced, and the smoothing can be performed appropriately.
[0082]
The smoothing processing unit 13 extracts a predetermined number (three in this embodiment) of low-brightness blocks from the smoothed block and the target block set in this way, and calculates the block base level of these blocks. The average Yab is calculated, and the average Yab is set to the block base level of the target block.
[0083]
Further, as shown in FIG. 5B, in order to set a block base level appropriately by performing a smoothing process from a block located at the center of an image in which the reflected light of the light source is unlikely to be reflected, for example, When the blocks in the upper right area T3 are numbered, the smoothing processing unit 13 performs, for example, 1 → 2 → 6 → 5 → 9 → 10 → 11 → 7 → 3 → 4 → 8 → 12 →. → 2 → 6 → 5 → 3 → 7 → 11 → 10 → 9 → 4 → 8 → 12 → ... or 1 → 2 → 5 → 3 → 6 → 9 → 4 → 7 → 10 → 8 → 11 From the block located at the center of the image to the periphery, such as → 12 ..., 1 → 2 → 5 → 9 → 6 → 3 → 4 → 7 → 10 → 8 → 11 → 12 ... The smoothing process is performed in order toward the located block.
[0084]
The pixel base level calculation unit 14 sets the block base level of each block subjected to the smoothing processing by the smoothing processing unit 13 to the base level of a pixel located at the center position of the corresponding block (hereinafter, referred to as a center pixel). Then, the background level of the pixels located between the center pixels (hereinafter, referred to as pixel background level) is calculated by linear interpolation.
[0085]
In FIG. 6, it is assumed that one cell represents one block, the pixel base level of the center pixel G1 of the block B1 is Y1, the pixel base level of the center pixel G2 of the block B2 is Y2, and the center pixel G3 of the block B3 is a pixel. the ground level Y3, when the pixel ground level of the center pixel G4 block B4 Y4, for example a pixel background level Y G of an arbitrary pixel Gx in the block B1, is calculated by these pixels background level Y1 to Y4.
[0086]
That is, the pixel ground level Y G of the pixel Gx is calculated by the following equation (5).
Y G = (α · Y1 + β · Y2 + γ · Y3 + δ · Y4) / 4 (5)
It is calculated by: Note that α, β, γ, and δ are weighting factors, and each weighting factor has a relationship proportional to the distance from the pixel Gx to the center pixel G1 to G4 of each of the blocks B1 to B4.
[0087]
The first gradation correction processing unit 15 sets a correction function as shown in FIG. 7 for each pixel using the pixel background level calculated by the pixel background level calculation unit 14, and based on the correction function, The key correction is performed.
[0088]
FIG. 7 shows the correction function of the gradation correction by the first gradation correction processing unit 15, and the horizontal axis indicates the input (the pixel of the image after the RGB-YCrCb conversion processing) of the first gradation correction processing unit 15. The vertical axis represents the output of the first gradation correction processing unit 15.
[0089]
In the case of the correction function shown in FIG. 7, the output is set to 0 when the input is less than 100, and the output is set to 255 when the input is equal to or higher than the pixel base level Yβ calculated by the pixel base level calculator 14. Further, when the input level is between 100 and the above-described pixel base level Yβ, the input and output are set to have a linear relationship, and gradation correction is performed according to this linear function.
[0090]
According to the gradation correction, the brightness level of each pixel in the image after the RGB-YCrCb conversion process is equal to or higher than the pixel base level Yβ calculated by the pixel base level calculation unit 14 of the pixel. Is converted to the highest luminance (Y = 255 in the present embodiment), so that the area to be set as the background (white plate) is set to pure white.
[0091]
Further, the luminance level Y Q represented by the following equation (6)
YQ = {25500 / (355-Yβ)} (6)
And a pixel having a luminance level smaller than the value YQ is converted into a value smaller than the input level, so that the luminance level is smaller than the value of YQ shown in the above equation (6). The contrast of the character area having the level with the background is increased.
[0092]
By the way, when the image processed by the image processing unit 6 includes small point-like noise, the pixel in the portion where the noise is generated is the pixel in the case where the noise is not generated. Has a luminance level lower than the pixel base level. Therefore, such a pixel cannot be converted to pure white (gradation is 255) even if gradation correction is performed by the correction function shown in FIG.
[0093]
For example, as shown in FIG. 7, in a region where the input level is equal to or higher than the pixel base level Yβ calculated by the pixel base level calculation unit 14, the first brightness correction processing unit 15 performs the gradation correction to obtain the highest luminance. (Gray level 255), a part of the character in the image after the RGB-YCrCb conversion processing has an area (e.g., a thin ink area) If there is a blurred area, the handwriting will be interrupted at this part.
[0094]
The noise removing / connecting unit 16 removes such noise and corrects it to the original background color (pure white), and also connects the part where the handwriting is interrupted (disconnected part).
[0095]
FIG. 8 is a diagram for explaining the noise removal / connection process performed by the noise removal / connection unit 16.
[0096]
For example, as shown in FIG. 8A, when it is assumed that noise or a discontinuous portion exists, an average value of luminance levels of all pixels and eight pixels located around the pixel is calculated, and The luminance level of the pixel is set to the average luminance level (hereinafter, this processing is referred to as average value processing). As a result, as shown in FIG. 8B, the image after the average value processing has blurred characters and noise.
[0097]
Then, the noise removing / connecting unit 16 determines whether or not the pixels having the luminance level which is not the highest luminance in the image after the average value processing are continuous, for example, by a predetermined number or more in a predetermined direction. If the number is smaller than the predetermined number, the pixel is determined as an isolated point, that is, noise, and the luminance level is converted to the maximum luminance. Thus, as shown in FIG. 8C, noise can be removed (hereinafter, this process is referred to as an isolated point removal process).
[0098]
In addition, in order to connect the broken portions of the character and clarify the blurred character, the noise removing / connecting unit 16 performs the image processing after the first gradation correction processing and the image after the average value processing and the isolated point removing processing. And the following processing is performed.
[0099]
In other words, the noise removing / connecting unit 16 images the white board region of the pixel having the highest luminance in both the image after the first gradation correction processing and the image after the average value processing and the isolated point removing processing. Is determined, and the luminance level of the pixel is set to the maximum luminance (pure white).
[0100]
In addition, the noise removing / connecting unit 16 has the highest luminance in the image after the first gradation correction processing, and processes the pixel that has become the highest luminance after the average value processing and the removal of the isolated point as follows. .
[0101]
Pixels that have the highest luminance in the image after the first gradation correction processing and no longer have the highest luminance after the average value processing and the removal of the isolated points have handwriting due to the above gradation correction, which should be a character area. The pixel in the interrupted portion and the pixel which had the highest luminance in the image after the first gradation correction processing but did not have the highest luminance after the average value processing and which should not be a character area (for example, FIG. b) pixels in the area indicated by the arrow L).
[0102]
Therefore, in the present embodiment, as shown in FIG. 8 (e), one of the two pixel rows that are continuous in the predetermined direction for the predetermined number or more is placed on an extension of the other pixel row. By judging whether or not there is, the broken portion and the direction of the handwriting (arrow K) in the broken portion are detected from the image after the first gradation correction processing, and the pixels (FIG. 8 (e) is detected.
[0103]
Then, regarding the pixels in the area to be the character area, the handwriting of the character is interrupted by the above-described gradation correction, and it is determined that the interrupted portion is connected by the average value processing, and the surrounding area considered as the character area is determined. The luminance level is calculated using the pixels. That is, the average value of the luminance levels of the eight pixels located around the pixel is set as the luminance level. Thereby, the disconnected portions are connected.
[0104]
On the other hand, the brightness level of the pixel which should not be the above-described character area is set to the highest brightness (pure white).
[0105]
Further, the noise removal / connection unit 16 does not have the highest luminance in the image after the first gradation correction processing, and generates noise (isolated point) for the pixel having the highest luminance after the average value processing and the isolated point removal processing. ), And it is determined that the noise has been removed by the isolated point removal processing, and the luminance level of the pixel is maintained at the maximum luminance converted in the isolated point removal processing.
[0106]
In addition, the noise removal / connection unit 16 determines that the image after the first gradation correction process and the pixel whose brightness level after the average value process / isolated point removal process is not the highest brightness are both images of the character region. It is determined, and the luminance level of the pixel is set to the luminance level of the pixel in the image after the first gradation correction processing.
[0107]
As a result, as shown in FIG. 8 (d), an image is obtained in which noise is removed from FIG. 8 (a), broken portions of the characters are connected, and blurred characters are clarified.
[0108]
The first chroma correction unit 17 generates the chrominance signals Cr and Cb so that the pixel whose luminance after the processing by the noise removal / connection unit 16 is converted to the highest luminance (gradation 255) does not have chroma. Is corrected to make the value of 0 zero.
[0109]
The second gradation correction processing unit 18 determines that a pixel having no highest luminance is a pixel in which a character area is imaged, and performs gradation correction using a correction function as shown in FIG.
[0110]
In FIG. 9, when the input level is 128 or less, the output level is set to be the same as the input level, and the input level is set to a value lower than 128 to make it easier to see light-colored characters such as characters written in orange ink. When the input image level is 255 or less, the slope of the correction function is made gentler than the correction function when the input level is 128 or less, so that an image captured by a pixel having a relatively high luminance exceeding the gray scale 128 can be darkened. Is corrected. Note that this gradation correction is performed with particular consideration to make the above-described characters easier to see when an image on which various processes have been completed by the respective units of the control unit 8 is printed by a predetermined image forming apparatus. .
[0111]
The second saturation correction unit 19 applies a predetermined gain to the color difference signals Cr and Cb on the character area after gradation correction to make it easier to see the characters and the like written on the whiteboard, and adjusts the saturation. Is to increase.
[0112]
The contour correction unit 20 performs a contour correction for enhancing a contour of a character or the like by a known general method.
[0113]
The YCrCb-RGB conversion unit 21 converts the luminance signal Y and the chrominance signals Cr and Cb subjected to the contour correction by the contour correction unit 20 into RGB image signals according to the following equations (7) to (9). It is.
[0114]
R = Y + 1.402Cr (7)
G = Y-0.714Cr-0.344Cb (8)
B = Y + 1.772Cb (9)
The storage unit 22 stores the image on which the various processes described above in the control unit 8 have been performed.
[0115]
The VRAM 23 is a buffer memory of an image displayed on the display unit 24, and has a storage capacity of an image corresponding to the number of pixels of the display unit 24.
[0116]
The display unit 24 displays an image that has been subjected to the various processes described above in the control unit 8 and temporarily stored in the VRAM 23.
[0117]
The operation unit 25 switches an operation unit for switching between a mode in which the control unit 8 executes the above-described various processes and a mode in which a normal imaging operation is performed without performing these processes in order to shoot a whiteboard or the like. Including.
[0118]
Next, the procedure of the image processing method of the present invention will be described.
[0119]
FIG. 10 is a flowchart showing the procedure of the image processing method of the present invention.
[0120]
As shown in FIG. 10, first, each of the R, G, and B digital signals is output by the image processing unit 6 (step # 1), and the RGB-YCrCb conversion unit 9 converts these digital signals into the luminance signal Y. After being converted into the color difference signals Cr and Cb (step # 2), the entire image is divided into a plurality of blocks by the block setting unit 10 (step # 3), and the histogram generation unit 11 outputs the pixels of the blocks for each block. Is generated (step # 4).
[0121]
Then, the block base level setting unit 12 sets the block base level in each block using the generated histogram (step # 5), and the smoothing processing unit 13 smoothes the block base level (step # 5). 6) Thereafter, the pixel base level calculation unit 14 calculates a pixel base level for each pixel from the block base level after the smoothing process (step # 7).
[0122]
Next, the first gradation correction processing unit 15 performs gradation correction for each pixel using the above-described pixel base level (step # 8), and the noise removal / connection unit 16 performs noise removal processing and character Then, the connection processing of the disconnection part such as is performed (step # 9).
[0123]
If the luminance of the pixel after processing by the noise removal / connection unit 16 does not have the maximum luminance (YES in step # 10), the second gradation correction processing unit 18 compares the luminance of the pixel with the luminance of FIG. After the gradation correction is performed by the correction function shown in (1) (Step # 11), the second saturation correction section 19 performs processing for improving the saturation of the character area and the like (Step # 12). On the other hand, in step # 10, if the luminance of the pixel after the processing by the noise removing / connecting unit 16 has the highest luminance (NO in step # 10), the first chroma correction unit uses the color difference signal for the pixel. Correction is performed to set the values of Cr and Cb to 0 (step # 13).
[0124]
Then, when the processing of step # 12 or # 13 is completed, the contour correction processing is performed by the contour correction section 20 (step # 14), and then the luminance signal Y and the color difference signals Cr, Cb are converted by the YCrCb-RGB conversion section 21. The digital signals are converted into R, G, and B digital signals (step # 15).
[0125]
FIG. 11 is a flowchart showing a detailed procedure of the block base level setting process by the block base level setting unit 12 in step # 5 of FIG.
[0126]
As shown in FIG. 11, the average luminance Ya of the surface of the whiteboard is calculated (step # 21), and the magnitude of the frequency value at each luminance level is determined from the average luminance Ya to the upper limit Ymax on the higher luminance side. (Step # 22).
[0127]
Then, it is determined whether a peak is present (step # 23), when the peak is present (YES in step # 23), the first detected peak Y H is set as the peak of the high-luminance side If no peak exists (step # 24) (NO in step # 23), average luminance Ya is set as a peak on the high luminance side (step # 25).
[0128]
Next, the magnitude of the frequency value at each luminance level is determined from the average luminance Ya to the lower luminance side to the lower limit Ymin (step # 26), and it is determined whether or not a peak exists (step # 27). .
[0129]
As a result, when the peak is present (YES in step # 27), if the first detected peak Y L is set as the peak on the low luminance side (step # 28), there is no peak (step # 27 In (NO), the average luminance Ya is set as the peak on the low luminance side (step # 29).
[0130]
Then, the peak Y L peak Y H and the low-luminance side of the high-luminance side, which is set in step ♯24 and # 28, closer to either the average luminance Ya is set as a block ground level Yb of the block (Step # 30).
[0131]
Until the above processing is completed for all the blocks (NO in step # 31), the blocks to be processed are sequentially changed (step # 32), and the processing of steps # 22 to # 30 is performed, and all the blocks are processed. When the block background level setting process is completed (YES in step # 31), the process by the block background level setting unit 12 ends.
[0132]
FIG. 12 is a flowchart showing a detailed procedure of the smoothing process by the smoothing processing unit 13 in step # 6 in FIG.
[0133]
As shown in FIG. 12, first, when the target block is located in the upper left area of the image (YES in step # 41), a smoothing block is determined so that the target block is located in the upper left corner (step # 4). 42), when the target block is located in the lower left area of the image (YES in step # 43), a smoothing block is determined so that the target block is located in the lower left corner (step # 44), and the target block is determined. When the block is located in the upper right area of the image (YES in step # 45), the smoothed block is determined so that the target block is located in the upper right corner (step # 46), and the target block is located in the lower right area. At this time (NO in step # 45), a smoothing block is determined so that the target block is located at the lower right corner (step # 47).
[0134]
After extracting three blocks with low luminance from the smoothed block and the target block determined in any of steps # 41, # 43, # 45, and # 47 (step # 48), these blocks are extracted. Is calculated (step # 49), and the average value Yab is set as the block background level of the target block (step # 50).
[0135]
Until the above processing is completed for all the blocks (NO in step # 51), the blocks to be processed are sequentially changed (step # 52), and the processing of steps # 41 to # 50 is performed, and all the blocks are processed. When the smoothing process is completed for () (YES in step # 51), the process by the smoothing processing unit 13 ends.
[0136]
FIG. 13 is a flowchart showing a detailed procedure of the noise removal / connection process by the noise removal / connection unit 16 in step # 9 in FIG.
[0137]
As shown in FIG. 13, for all pixels, an average value processing is performed to calculate the average value of the luminance levels of eight pixels located around the pixel and set the luminance level of the pixel to the average luminance level. Is performed (step # 61), and it is determined whether or not the pixel whose luminance level is not the highest luminance is continuous in a predetermined direction for a predetermined number or more. If the number of continuous pixels is smaller than the predetermined number, Is performed to convert the luminance level of the pixel to the maximum luminance (step # 62).
[0138]
Then, in the image after the first gradation correction processing and the image after the average value processing and the isolated point removal processing, for the pixel having the highest luminance level (YES in steps # 63 and # 64), the value of the pixel is determined. The luminance level is set to the maximum luminance (step # 65).
[0139]
On the other hand, for the pixel having the highest luminance in the image after the first gradation correction processing (YES in step # 63), and no longer having the highest luminance after the average value processing and the removal of the isolated point (NO in step # 64), It is determined whether or not the pixel is to be a character area (step # 66). If the pixel is to be a character area (YES in step # 66), surrounding pixels considered to be a character area are used. The brightness level is calculated (step # 67), and if the pixel is not a character area (NO in step # 66), the brightness level of that pixel is set to the highest brightness (step # 68).
[0140]
Further, the image after the first gradation correction processing does not have the highest luminance (NO in step # 63), and has the highest luminance after the average value processing and the isolated point removal processing (YES in step # 69). Is that the luminance level of the pixel is maintained at the maximum luminance converted in the isolated point removal processing (step # 70), and the image after the first gradation correction processing and the luminance level after the average value processing and the isolated point removal processing are For a pixel having neither maximum luminance (NO in steps # 63 and # 69), the luminance level of the pixel is set to the luminance level of the pixel in the image after the first gradation correction processing (step # 71).
[0141]
As described above, since the block base level set for each block is smoothed using the smoothing block, the block base level of the block having the pixel that captures the reflected light of the light source and the like is determined based on the reflected light of the light source. Can be reduced from the block background level of other blocks that do not image the data.
[0142]
Thus, when calculating the center pixel of each block and the white background level of the pixel located between the center pixels using the block base level calculated by the smoothing process, the center pixel of each block and the space between the center pixels are calculated. Can be prevented from having a value that is significantly different from the original pixel background level, and as a result, appropriate background removal processing can be performed.
[0143]
In addition, the smoothing block is determined such that the block of interest is located at the corner farthest away from the center O of the image, and the block base with a block closer to the center of the image where the reflected light of the electric light is less likely to appear. Since the level is calculated, the pixel base level can be set more appropriately.
[0144]
In addition, by performing smoothing processing in order from the block group located at the center of the image to the block group located on the peripheral side, the pixel located at the center of the image where the reflected light of the electric light is unlikely to be reflected can be obtained. Since the smoothing process is performed, the pixel base level can be set more appropriately.
[0145]
Further, the block base level of the block of interest is set to be the average value of the block base levels of a plurality of blocks having lower luminance among the block base levels of the blocks in the block group to which the block of interest belongs. Even in the case where there is a block in which the reflected light of the electric light is captured in the group, it is possible to avoid performing the smoothing process using this block as much as possible, and to set the pixel base level more appropriately. Can be set to
[0146]
The present invention is not limited to the above embodiment, and the following modifications (1) and (2) can be adopted.
[0147]
(1) In the above embodiment, the RGB-YCrCb conversion unit 9, the block setting unit 10, the histogram generation unit 11, the block base level setting unit 12, the smoothing processing unit 13, the pixel base level calculation unit 14, the first gradation The correction processing unit 15, the noise removal / connection unit 16, the first saturation correction unit 17, the second tone correction processing unit 18, the second saturation correction unit 19, the contour correction unit 20, and the YCrCb-RGB conversion unit 21 Although the case of mounting on the camera 1 has been described, the present invention is not limited to this, and it may be configured to be mounted on the control unit 27 of a personal computer 26 (hereinafter, referred to as PC 26) as shown in FIG.
[0148]
In this case, as shown in FIG. 14, the PC 26 takes in an image subjected to processing such as γ correction from an image input device 28 such as a digital camera, and generates a histogram, sets a block base level, After performing the conversion process, the calculation of the pixel background level, the noise removal / connection process, and the like, the image data is stored in the image storage device 29 such as a hard disk device.
[0149]
When the image is to be output such as printed on paper, the PC 26 fetches the image from the image storage device 29, sends the image to the image output device 29 such as a printer, and sends the image to the image output device 30. You may make it print out. The operation unit 31 is used to input an instruction to the control unit 27 to execute a histogram generation process and the like, and indicates a mouse or a keyboard.
[0150]
(2) The PC 26 shown in FIG. 14 and the digital camera 1 in the above embodiment are functionally controlled by RGB-YCrCb conversion units 9 and 32, block setting units 10 and 33, histogram generation units 11 and 34 by a predetermined program. Block background level setting units 12 and 35, smoothing processing units 13 and 36, pixel background level calculation units 14 and 37, first gradation correction processing units 15 and 38, noise removal / connection units 16 and 39, first saturation Correction sections 17 and 40, second tone correction sections 18 and 41, second saturation correction sections 19 and 42, contour correction sections 20 and 43, and YCrCb-RGB conversion sections 21 and 44 to perform various processes. Although the processing is executed, the present invention is not limited to this, and a configuration in which these processings are executed by hardware may be adopted.
[0151]
In the case where the control units 8 and 27 are provided with the above-described units according to a predetermined program, for example, data is read from and written to an external recording medium such as a flexible disk, CD-R, or DVD-R. PC 26 is converted to RGB-YCrCb conversion units 9 and 32, block setting units 10 and 33, histogram generation units 11 and 34, block background level setting units 12 and 35, smoothing processing units 13 and 36, Background level calculation units 14 and 37, first gradation correction processing units 15 and 38, noise removal / connection units 16 and 39, first saturation correction units 17 and 40, second gradation correction processing units 18 and 41, 2 The program is installed from a recording medium on which a program for functioning as the saturation correction units 19 and 42, the outline correction units 20 and 43, and the YCrCb-RGB conversion units 21 and 44 is recorded. So as to Lumpur, PC 26 is by installing the program, may functionally configured with a like RGB-YCrCb conversion unit 9, 32.
[0152]
The main inventions disclosed in the present specification are summarized below.
[0153]
[Supplementary Note 1] The image is divided into a plurality of blocks including a plurality of pixels, a background level is set for each of the divided blocks, and a background level of a predetermined block in a block group including a plurality of blocks is set in the block group. A smoothing process is performed to set the average value of the background level in a predetermined number of blocks among the other blocks, and the block is located between the center pixel of each block and the center pixel using the background level calculated by the smoothing process. An image processing method comprising calculating a background level of a pixel.
[0154]
[Supplementary Note 2] The image processing method according to Supplementary Note 1, wherein the predetermined block is a block located farthest from the center of the image among blocks of a block group to which the predetermined block belongs. .
[0155]
[Supplementary Note 3] The image processing method according to Supplementary Note 1 or 2, wherein the smoothing process is performed in order from a block group located at the center of the image to a block group located on a peripheral side.
[0156]
[Supplementary Note 4] In the smoothing process, the background level of the predetermined block is set to an average value of the background levels of a plurality of blocks having lower luminance among the background levels of the blocks in the block group. 4. The image processing method according to any one of supplementary notes 1 to 3, wherein
[0157]
[Supplementary Note 5] Dividing means for dividing an image into a plurality of blocks including a plurality of pixels, setting means for setting a background level for each of the divided blocks, and a background level of a predetermined block in a block group including a plurality of blocks Using a background level calculated by the smoothing processing means to perform a smoothing process to make the average value of the background level in a predetermined number of blocks among the other blocks in the block group, each block An image processing apparatus comprising: a calculating unit configured to calculate a background level of a central pixel of the image and a pixel located between the central pixels.
[0158]
[Supplementary Note 6] The smoothing processing means sets the predetermined block so as to be located farthest from the center of the image among blocks of a block group to which the predetermined block belongs. The image processing device according to attachment 5.
[0159]
[Supplementary Note 7] The supplementary note 5 or 6, wherein the smoothing processing unit performs the smoothing process in order from a block group located at the center of the image to a block group located on a peripheral side. Image processing device.
[0160]
[Supplementary Note 8] The smoothing processing unit may set the background level of the predetermined block to an average value of the background levels of a plurality of blocks having lower luminance among the background levels of the blocks in the block group. The image processing apparatus according to any one of claims 5 to 7, wherein:
[0161]
[Supplementary Note 9] In the image processing apparatus,
Dividing means for dividing an image into a plurality of blocks each including a plurality of pixels;
Setting means for setting a background level for each divided block;
Smoothing processing means for performing a smoothing process for setting the ground level of a predetermined block in a block group including a plurality of blocks to an average value of ground levels in a predetermined number of blocks among other blocks in the block group;
A program for mounting a function as calculation means for calculating a background level of a center pixel of each block and pixels located between the center pixels using the background level calculated by the smoothing process.
[0162]
[Supplementary Note 10] In the image processing apparatus,
Dividing means for dividing an image into a plurality of blocks each including a plurality of pixels;
Setting means for setting a background level for each divided block;
Smoothing processing means for performing a smoothing process for setting the ground level of a predetermined block in a block group including a plurality of blocks to an average value of ground levels in a predetermined number of blocks among other blocks in the block group;
Using the background level calculated by the smoothing process, a program for mounting a function as a calculation unit for calculating a background level of a center pixel of each block and a pixel located between the center pixels is recorded. A recording medium readable by the image processing device.
[0163]
【The invention's effect】
According to the first or fifth aspect of the present invention, a background level is set for each of blocks obtained by dividing an image into a plurality of blocks including a plurality of pixels, and the background level of a predetermined block in a block group including a plurality of blocks is set. Is set to the average value of the background level in a predetermined number of blocks among the other blocks in the block group, so that the background level of the block having the pixel in which the reflected light or the like of the electric light is imaged is obtained. In addition, it is possible to reduce the difference from the background level of another block that does not capture the reflected light of the electric light or the like.
[0164]
Thereby, when calculating the background level of the center pixel of each block and the pixels located between the center pixels using the background level calculated by the smoothing process, the center pixel of each block and the space between the center pixels are calculated. It is possible to prevent the background level of the located pixel from being significantly different from the original background level, and as a result, the background removal processing can be appropriately performed.
[0165]
According to the invention described in claim 2, since the predetermined block in the block group is set to be located at a position farthest from the center of the image among the blocks of the block group to which the predetermined block belongs, The background level is calculated in a block closer to the center of the image where the reflected light of the electric light is less likely to be reflected. Thus, the background level of each pixel can be set more appropriately.
[0166]
According to the invention described in claim 3, the smoothing processing is performed in order from the block group located at the center of the image to the block group located on the peripheral side. The smoothing process is performed from the pixel located at the center of the image that is less likely to be captured. This makes it possible to more appropriately set the background level of the pixel.
[0167]
According to the invention described in claim 4, the smoothing process includes setting the background level of the predetermined block to the background level of a plurality of blocks having lower luminance among the background levels of the blocks in the block group. Since the average value is used, even if there is a block in which the reflected light of the electric light or the like is captured in the block group, the smoothing process using this block is avoided as much as possible. As a result, the background level of the pixel can be set more appropriately.
[Brief description of the drawings]
FIG. 1 is a control block diagram of a digital camera employing an image processing method according to the present invention.
2A is a diagram illustrating an example of an image, FIG. 2B is a diagram illustrating a state in which the image illustrated in FIG. 2A is divided into a plurality of blocks, and FIG. FIG.
FIG. 3 is a diagram illustrating examples of various histograms.
FIG. 4 is a diagram for explaining processing for setting a block base level.
FIG. 5 is a diagram illustrating a smoothing process.
FIG. 6 is a diagram illustrating a process of calculating a pixel base level.
FIG. 7 is a diagram illustrating a correction function of gradation correction performed for each pixel using a calculated pixel background level.
FIG. 8 is a diagram for explaining noise removal / connection processing by a noise removal / connection unit;
FIG. 9 is a diagram illustrating a correction function of gradation correction.
FIG. 10 is a flowchart illustrating a procedure of an image processing method according to the present invention.
11 is a flowchart illustrating a detailed procedure of a block base level setting process by a block base level setting unit in step # 5 of FIG. 10;
FIG. 12 is a flowchart illustrating a detailed procedure of a smoothing process by a smoothing processing unit in Step # 6 of FIG. 10;
FIG. 13 is a flowchart showing a detailed procedure of noise removal / connection processing by the noise removal / connection unit in step # 9 of FIG. 10;
FIG. 14 is a block diagram of a system configured to capture an image and store the image or output the image to recording paper or the like when the function of executing image processing according to the present invention is mounted on a personal computer. is there.
[Explanation of symbols]
8, 27 control unit 9, 32 RGB-YCrCb conversion unit 10, 33 block setting unit 11, 34 histogram generation unit 12, 35 block background level setting unit 13, 36 smoothing processing unit 14, 37 pixel background level calculation unit 15, 38 first tone correction processing section 16, 39 noise removal / connection section 17, 40 first saturation correction section 18, 41 second tone correction processing section 19, 42 second saturation correction section 20, 43 contour correction section 21,44 YCrCb-RGB converter

Claims (5)

画像を複数の画素からなる複数のブロックに分割し、
分割されたブロックごとに下地レベルを設定し、
複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行い、
前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出することを特徴とする画像処理方法。
Divide the image into multiple blocks of multiple pixels,
Set the background level for each divided block,
Performs a smoothing process to set the ground level of a predetermined block in a block group including a plurality of blocks to an average value of the ground level in a predetermined number of blocks among other blocks in the block group,
An image processing method, wherein a background level of a central pixel of each block and pixels located between the central pixels is calculated using the background level calculated by the smoothing process.
前記所定のブロックは、該所定のブロックが属するブロック群のブロックのうち、前記画像の中心から最も遠い位置に位置するものであることを特徴とする請求項1に記載の画像処理方法。The image processing method according to claim 1, wherein the predetermined block is a block located farthest from the center of the image among blocks of a block group to which the predetermined block belongs. 前記画像の中央に位置するブロック群から周辺側に位置するブロック群に向かって順に前記平滑化処理を行うことを特徴とする請求項1または2に記載の画像処理方法。3. The image processing method according to claim 1, wherein the smoothing processing is performed in order from a block group located at a center of the image to a block group located on a peripheral side. 4. 前記平滑化処理は、前記所定のブロックの下地レベルを、前記ブロック群における各ブロックの下地レベルのうち、輝度の低い方の複数のブロックの下地レベルの平均値とするものであることを特徴とする請求項1ないし3のいずれかに記載の画像処理方法。The smoothing process is characterized in that the background level of the predetermined block is an average value of the background levels of a plurality of blocks having lower luminance among the background levels of the blocks in the block group. The image processing method according to claim 1. 画像を複数の画素からなる複数のブロックに分割する分割手段と、
分割されたブロックごとに下地レベルを設定する設定手段と、
複数のブロックからなるブロック群における所定のブロックの下地レベルを、前記ブロック群における他のブロックのうち所定個数のブロックにおける下地レベルの平均値とする平滑化処理を行う平滑化処理手段と、
前記平滑化処理により算出された下地レベルを用いて、各ブロックの中心画素及び前記中心画素間に位置する画素の下地レベルを算出する算出手段と
を備えることを特徴とする画像処理装置。
Dividing means for dividing an image into a plurality of blocks each including a plurality of pixels;
Setting means for setting a background level for each divided block;
Smoothing processing means for performing a smoothing process for setting the ground level of a predetermined block in a block group including a plurality of blocks to an average value of ground levels in a predetermined number of blocks among other blocks in the block group;
An image processing apparatus comprising: a calculating unit configured to calculate a center pixel of each block and a background level of a pixel located between the center pixels using the background level calculated by the smoothing process.
JP2003096755A 2003-03-31 2003-03-31 Image processing method and image processing apparatus Pending JP2004304637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003096755A JP2004304637A (en) 2003-03-31 2003-03-31 Image processing method and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003096755A JP2004304637A (en) 2003-03-31 2003-03-31 Image processing method and image processing apparatus

Publications (1)

Publication Number Publication Date
JP2004304637A true JP2004304637A (en) 2004-10-28

Family

ID=33408712

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003096755A Pending JP2004304637A (en) 2003-03-31 2003-03-31 Image processing method and image processing apparatus

Country Status (1)

Country Link
JP (1) JP2004304637A (en)

Similar Documents

Publication Publication Date Title
US7057653B1 (en) Apparatus capable of image capturing
CN101322416B (en) Image signal processing device and image signal processing method
KR101099401B1 (en) Image processing apparatus and computer-readable medium
US7710470B2 (en) Image processing apparatus that reduces noise, image processing method that reduces noise, electronic camera that reduces noise, and scanner that reduces noise
EP1515545A1 (en) Image processing apparatus and method, recording medium, and program for correcting shading of a captured image
US20060232692A1 (en) Image pickup apparatus
JPH10126796A (en) Digital camera for dynamic and still images using dual mode software processing
JP2002010108A (en) Device and method for processing image signal
JP2011003048A (en) Image processing apparatus and image processing program
JP2003304549A (en) Camera and image signal processing system
JP4031299B2 (en) Color image signal processing method, color image output apparatus, and photographing apparatus
JP4725520B2 (en) Image processing device, non-imaging color signal calculation device, and image processing method
JP2004304635A (en) Image processing method and image processing apparatus
JP2004304641A (en) Image processing method and image processing apparatus
JP3730063B2 (en) Color component generation apparatus, color component generation method, and multicolor image pickup apparatus using the same
JP2006333113A (en) Imaging device
JP2006157599A (en) Imaging device
JP2004304637A (en) Image processing method and image processing apparatus
JP2010177929A (en) Image processing apparatus and method, and program
JP3064961B2 (en) Electronic still camera
JP3697464B2 (en) Document image processing apparatus, imaging apparatus, and document image processing program
JP3198983B2 (en) Electronic still camera
JP3976898B2 (en) Image processing method, apparatus, and recording medium
JP4478981B2 (en) Color noise reduction method and color imaging apparatus
JP4954658B2 (en) Image processing device

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20050615