JP2012008914A - Image processing device and image processing program - Google Patents
Image processing device and image processing program Download PDFInfo
- Publication number
- JP2012008914A JP2012008914A JP2010146094A JP2010146094A JP2012008914A JP 2012008914 A JP2012008914 A JP 2012008914A JP 2010146094 A JP2010146094 A JP 2010146094A JP 2010146094 A JP2010146094 A JP 2010146094A JP 2012008914 A JP2012008914 A JP 2012008914A
- Authority
- JP
- Japan
- Prior art keywords
- color
- image
- boundary
- main
- limited
- 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
Links
Images
Landscapes
- Color Image Communication Systems (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
本発明は、画像処理装置及び画像処理プログラムに関するものである。 The present invention relates to an image processing apparatus and an image processing program.
従来より、例えばカラー画像を白黒のプリンタで出力する場合やデータ量を減らして保存する場合などでは、カラー画像を二値画像に変換することが行われている。カラー画像を単純に明度などによって二値画像に変換すると、例えば色文字が色相の異なる背景色中に存在する場合などでは、文字と背景がともに二値の一方の値に変換され、文字と背景の区別がなくなってしまう。 Conventionally, for example, when a color image is output by a monochrome printer or when the data amount is reduced and stored, the color image is converted into a binary image. When a color image is simply converted to a binary image by brightness, for example, when a color character exists in a background color with a different hue, the character and background are both converted to one of the binary values. The distinction is lost.
例えば特許文献1においては、カラー画像の輝度情報をもとに文字などの特定領域と背景などの周辺領域に分けて輝度補正を行い、モノクロ画像を得ている。この場合、ある色が文字と背景に用いられている場合に二値で出力すると、いずれか一方は二値画像に反映されない。また、特定領域として文字領域の境界から膨張させて得ており、その特定領域あるいは周辺領域の輝度を補正するため、込み入った画線を有する場合にはつぶれが発生する。
For example, in
また、例えば特許文献2においては、単色化する際に濃度差が予め決められた範囲内に含まれる場合に、境界線を生成して領域を分離している。例えば特許文献3においても、二値化した画像と境界線の画像を排他的論理和により合成して二値画像を得ている。
For example, in
本発明は、処理対象の画像中で色の違いにより表現されている情報の欠落を低減した二値画像を得ることができる画像処理装置及び画像処理プログラムを提供することを目的とするものである。 An object of the present invention is to provide an image processing apparatus and an image processing program capable of obtaining a binary image in which loss of information expressed by a color difference in a processing target image is reduced. .
本願請求項1に記載の発明は、処理対象の画像中で使用されている色を複数の主要色に限定した限定色画像を生成する限定色画像生成手段と、前記画像を二値化して二値画像を生成する二値画像生成手段と、前記限定色画像で異なる主要色が隣接するが前記二値画像では前記隣接する主要色ともいずれか一方の値に変換されている色境界を抽出する色境界抽出手段と、前記色境界を構成する主要色及び該主要色の領域に関する特徴から前記色境界のいずれの側を補正するかを決定する決定手段と、前記二値画像における前記色境界の前記決定手段で決定された側の値を補正する補正手段を有することを特徴とする画像処理装置である。 According to the first aspect of the present invention, limited color image generation means for generating a limited color image in which colors used in the image to be processed are limited to a plurality of main colors, and binarization by binarizing the image. A binary image generating unit that generates a value image and a color boundary in which different primary colors are adjacent to each other in the limited color image but are converted to one of the adjacent primary colors in the binary image are extracted. Color boundary extraction means; determination means for determining which side of the color boundary is to be corrected based on features relating to the primary color and the area of the primary color that constitutes the color boundary; and the color boundary of the binary image An image processing apparatus comprising correction means for correcting a value determined by the determination means.
本願請求項2に記載の発明は、処理対象の画像中で使用されている色を複数の主要色に限定した限定色画像を生成する限定色画像生成手段と、前記限定色画像を前記主要色または該主要色の領域または該主要色と他の主要色との隣接関係に従って二値化して二値画像を生成する二値画像生成手段と、前記限定色画像で異なる主要色が隣接するが前記二値画像では前記隣接する主要色ともいずれか一方の値に変換されている色境界を抽出する色境界抽出手段と、前記色境界を構成する主要色及び該主要色の領域に関する特徴から前記色境界のいずれの側を補正するかを決定する決定手段と、前記二値画像における前記色境界の前記決定手段で決定された側の値を補正する補正手段を有することを特徴とする画像処理装置である。 According to the second aspect of the present invention, a limited color image generating unit that generates a limited color image in which colors used in a processing target image are limited to a plurality of main colors, and the limited color image is converted into the main color. Or a binary image generating means for generating a binary image by binarizing according to an adjacent relationship between the primary color region or the primary color and another primary color, and different primary colors are adjacent to each other in the limited color image. In the binary image, the color boundary extraction means for extracting a color boundary that has been converted to one of the values of the adjacent main color, and the color from the characteristics relating to the main color constituting the color boundary and the area of the main color An image processing apparatus comprising: a determination unit that determines which side of the boundary is to be corrected; and a correction unit that corrects a value determined by the determination unit of the color boundary in the binary image. It is.
本願請求項3に記載の発明は、本願請求項1または請求項2に記載の発明における前記色境界抽出手段が、前記限定色画像全体から前記主要色の組み合わせのそれぞれについて前記色境界を抽出し、前記決定手段が、前記主要色の組み合わせのそれぞれについて当該主要色の組み合わせのいずれの主要色の側を補正するかを決定することを特徴とする画像処理装置である。
In the invention according to
本願請求項4に記載の発明は、本願請求項1から請求項3のいずれか1項に記載の発明における前記決定手段が、前記色境界を構成する前記主要色の領域に従って前記色境界のいずれの側を補正するかを決定することを特徴とする画像処理装置である。 According to a fourth aspect of the present invention, in the invention according to any one of the first to third aspects of the present invention, the deciding means according to any one of the first to third aspects of the present invention determines which of the color boundaries according to the region of the primary color constituting the color boundary. It is an image processing apparatus that determines whether to correct the side of the image.
本願請求項5に記載の発明は、コンピュータに、請求項1から請求項4のいずれか1項に記載の画像処理装置の機能を実行させるものであることを特徴とする画像処理プログラムである。
An invention according to
本願請求項1に記載の発明によれば、本構成を有しない場合に比べて、処理対象の画像中で色の違いにより表現されている情報の欠落を低減した二値画像を得ることができるという効果がある。
According to the invention described in
本願請求項2に記載の発明によれば、本構成を有しない場合に比べて、処理対象の画像中で色の違いにより表現されている情報の欠落を低減した二値画像を得ることができるという効果がある。
According to the invention described in
本願請求項3に記載の発明によれば、画像全体に対して統一した二値化処理を行うことができる。 According to the third aspect of the present invention, unified binarization processing can be performed on the entire image.
本願請求項4に記載の発明によれば、処理対象の画像中には存在したが欠落した色境界について、本構成を有しない場合に比べて適切な側を補正することができる。
According to the invention described in
本願請求項5に記載の発明によれば、本願請求項1から請求項4のいずれか1項に記載の発明の効果を得ることができる。
According to the invention of
図1は、本発明の第1の実施の形態を示す構成図である。図中、11は限定色画像生成部、12は二値画像生成部、13は色境界抽出部、14は決定部、15は補正部である。限定色画像生成部11は、処理対象の画像中で使用されている色を複数の主要色に限定した限定色画像を生成する。限定色画像の生成方法としては公知の手法を用いればよい。例えば、処理対象の画像中で使用されている色を色空間において解析し、例えば色ヒストグラムやクラスタリングなどによって主要色を抽出するとともに、処理対象の画像中で使用されている色を主要色のいずれかへ置換して行けばよい。あるいは、例えば輪郭追跡により領域分割を行い、各領域における主要色の抽出と各領域の色を主要色へ変換することにより限定色画像を生成してもよい。もちろん、他の方法であってもよい。
FIG. 1 is a block diagram showing a first embodiment of the present invention. In the figure, 11 is a limited color image generation unit, 12 is a binary image generation unit, 13 is a color boundary extraction unit, 14 is a determination unit, and 15 is a correction unit. The limited color
二値画像生成部12は、処理対象の画像を二値化して二値画像を生成する。二値化方法としては公知の手法を用いればよい。例えば処理対象の画像における各画素の明度を、予め決められた閾値、あるいは該画素と隣接する複数の画素を含めて決められる閾値と比較し、二値化すればよい。
The binary
色境界抽出部13は、限定色画像生成部11で生成された限定色画像では異なる主要色が隣接するが、その隣接する主要色のいずれも、二値画像生成部12で生成された二値画像ではいずれか一方の値に変換されている色境界を抽出する。このような色境界は、限定色画像では異なる色が隣接して境界が存在しているが、二値画像生成部12で生成された二値画像では境界が存在せず、処理対象の画像中で色の違いにより表現されている情報が欠落している箇所である。この色境界抽出部13で抽出した色境界が、決定部14及び補正部15の処理対象となる。色境界抽出部13は、色境界を抽出する毎に決定部14に受け渡して決定部14及び補正部15の処理を行うようにしてもよいし、処理対象の画像全体から色境界を抽出した後に決定部14に受け渡してもよい。また、限定色画像及び二値画像を走査して色境界を抽出して行くほか、主要色の組み合わせごとに色境界を抽出してもよい。
In the limited color image generated by the limited color
決定部14は、色境界抽出部13で抽出された色境界を構成する主要色及びその主要色の領域に関する特徴から、色境界のいずれの側を補正するかを決定する。主要色に関する特徴としては、当該主要色の明度や彩度、色相などがある。また、主要色の領域に関する特徴としては、当該主要色が使用されている領域の大きさ(画素数、外接矩形の大きさ)、長さ、太さや、包括関係(一方に含まれているか否か、包括度、重なり度合いなど)、複雑さなどがある。これらの特徴から、例えば判定度合いを表す関数Fを用いて色境界を構成する各主要色について判定度合いを算出し、いずれかを補正する側の主要色として決定すればよい。あるいは、上述の特徴から、例えば優先順位などに従って論理判定してもよい。なお、このような色境界のいずれの側を補正するかの決定は、それぞれの色境界において行ってもよいし、画像全体における色境界を構成する主要色の組ごとに行ってもよい。
The determining
補正部15は、二値画像生成部12で生成した二値画像における色境界抽出部13で抽出した色境界について、決定部14で決定された側の値を補正する。色境界抽出部13で抽出した色境界は、二値画像では境界が存在せずに二値のいずれか一方の値となっていることから、補正は、色境界の決定部14で決定された側の値を二値の他方の値に変更すればよい。これにより、二値画像においても色の違いが存在する色境界が分かるようになり、カラー情報が二値画像に反映されることになる。なお、補正する画素数などは予め決めておけばよい。
The correction unit 15 corrects the value determined by the
図2は、本発明の第1の実施の形態における処理の具体例の説明図である。図2(A)には処理対象の画像の具体例を示している。図2(A)に示した画像では、灰色の背景中に黒の文字「A」と、橙色の文字「B」と、緑の文字「C」が含まれた橙色の矩形とが存在している。なお、図示の都合上、色の違いは、黒については塗り潰し、他の色については斜線を異ならせて示している。 FIG. 2 is an explanatory diagram of a specific example of processing according to the first embodiment of this invention. FIG. 2A shows a specific example of an image to be processed. In the image shown in FIG. 2A, a black character “A”, an orange character “B”, and an orange rectangle including a green character “C” exist in a gray background. Yes. For convenience of illustration, the difference in color is indicated by black for the other color and different shaded lines for the other colors.
図2(A)に示した画像を処理対象とし、二値画像生成部12で二値化した二値画像を図2(B)に示している。この例では、二値を白と黒により示しており、黒の文字「A」が一方の値(黒)に、その他の部分は他方の値(白)になったものとしている。この二値画像では、橙の文字「B」や矩形、緑の文字「C」については反映されておらず、カラー情報が欠落していることになる。
FIG. 2B shows a binary image binarized by the binary
一方、限定色画像生成部11は図2(A)に示した処理対象の画像中の色を主要色に限定した限定色画像を生成する。例えば図2(A)に示した画像が画像読取装置等で読み取ったものであった場合には、読取誤差などによって境界部に異なる色が存在したり、本来はベタの部分でも色のばらつきが生じている場合がある。限定色画像を生成しておけば、次の色境界抽出部13で抽出する色境界が明確になる。図2(A)に示した例では、主要色として黒、灰、橙、緑が抽出され、これらの色以外については主要色のいずれかに変換して、限定色画像が生成される。ここでは図2(A)の画像で代用することとする。
On the other hand, the limited color
色境界抽出部13は、限定色画像生成部11で生成された限定色画像では異なる主要色が隣接するが、その隣接する主要色のいずれも、二値画像生成部12で生成された二値画像ではいずれか一方の値に変換されている色境界を抽出する。この具体例では、図2(A)と図2(B)を比較して分かるように、図2(A)で存在する灰色と橙の境界、及び、橙と緑の境界は、図2(B)に示す二値画像ではいずれも境界の両側において白で示されている。すなわち、灰色と橙が隣接する境界では、隣接する主要色である灰色と橙のいずれも、二値画像では二値の一方の値(白)に変換されている。また、橙と緑が隣接する境界でも、隣接する主要色である橙と緑のいずれも、二値画像では二値の一方の値(白)に変換されている。従って、灰色と橙の境界、及び、橙と緑の境界を、ここでは修正処理の対象となる色境界として抽出する。抽出した色境界を、図2(C)に破線により示している。
In the limited color image generated by the limited color
決定部14は、色境界抽出部13で抽出された色境界を構成する主要色及びその主要色の領域に関する特徴から、色境界のいずれの側を補正するかを決定し、補正部15は、二値画像生成部12で生成した二値画像における色境界抽出部13で抽出した色境界について、決定部14で決定された側の値を補正する。まず、橙と緑の色境界について、いずれの側を補正するかを決定する。ここでは緑の側を補正するものと決定部14で決定し、補正部15が緑の側を補正するものとする。橙と緑の色境界について緑の側を補正した結果を図2(D)に示している。また、灰色と橙の色境界についても、いずれの側を補正するかを決定する。ここでは橙の側を補正するものと決定部14で決定し、補正部15が橙の側を補正するものとする。灰色と橙の色境界について橙の側を補正した結果を図2(D)に反映し、図2(E)に示している。
The
この図2(E)に示した二値画像が処理結果として出力されることになる。図2(B)に示した二値画像では消失していた橙の文字「B」や矩形、緑の文字「C」の輪郭が現れ、カラー情報が欠落せずに存在が分かるようになる。 The binary image shown in FIG. 2E is output as the processing result. In the binary image shown in FIG. 2B, the outlines of the orange character “B”, the rectangle, and the green character “C” that have disappeared appear, and the presence of color information is not lost.
図3は、込み入った図形における色境界の一方の側を補正する一例の説明図である。上述のように、色境界を構成する主要色のうち、いずれの側を補正するかを決定部14で決定し、決定した側について色境界の補正を行っている。例えば図3(A)に示すように込み入った図形が存在する場合を考える。ここでは斜線を異ならせて色の違いを示しているが、いずれの色も二値画像では一方の値に変換されているものとする。ここでは二値を白と黒とし、白に変換されているものとする。
FIG. 3 is an explanatory diagram of an example of correcting one side of a color boundary in a complicated figure. As described above, the
例えば、図3(A)において存在する色境界の両側を補正すると、その結果は図3(B)に示すものとなる。入り組んだ部分はつぶれてしまい、消失している。これに対して、色境界の一方を補正すると図3(B)に示す二値画像となり、入り組んだ部分は二値画像に反映されている。色境界の一方の側を補正することにより、込み入った部分が存在する細かいまたは小さい文字などについて、二値画像に反映されるようにしている。 For example, when both sides of the color boundary existing in FIG. 3A are corrected, the result is as shown in FIG. The complicated part is crushed and disappears. On the other hand, when one of the color boundaries is corrected, the binary image shown in FIG. 3B is obtained, and the complicated portion is reflected in the binary image. By correcting one side of the color boundary, fine or small characters with complicated portions are reflected in the binary image.
色境界のいずれの側を補正するかは、上述のように決定部14において、色境界を構成する主要色に関する特徴、及び、その主要色の領域に関する特徴から決定する。その具体例について、いくつか説明する。例えば、上述した判定度合いを表す関数Fを用いる場合、その関数Fとしては、
F=α×太さ+β×大きさ+γ×包括度−δ×彩度
を用いるとよい。ここで、係数α、β、γ、δは予め与えられる正数である。関数Fの値が小さい主要色の側を色境界において補正する側として決定し、補正すればよい。太さは、判定対象の色境界から別の色境界までの距離であり、文字であれば線幅でよい。大きさは、当該色境界を含む主要色の領域の広さであり、例えば画素数から求めてもよいし、当該領域の外接矩形の大きさでもよい。図4は、包括度の一例の説明図である。包括度は、色境界を構成する一方の主要色の領域の外接矩形が、他方の主要色の領域の外接矩形と重なっていない部分の面積比率である。図4に示す例では、理解しやすくするために、2つの外接矩形を横にずらして記載しているが、横にずれずに重なっているとした場合、外接矩形1の半分が外接矩形2と重なっているので、重なっていない部分の面積比率は1/2である。また、外接矩形2については2/3が外接矩形1と重なっているので、重なっていない部分の面積比率は1/3である。あるいは、包含されているか否かで包括度を決定してもよい。彩度は当該主要色の彩度を用いればよい。
As described above, which side of the color boundary is to be corrected is determined by the
F = α × thickness + β × size + γ × inclusion level−δ × saturation may be used. Here, the coefficients α, β, γ, and δ are positive numbers given in advance. The main color side having a small value of the function F may be determined as the side to be corrected at the color boundary and corrected. The thickness is a distance from a color boundary to be determined to another color boundary, and may be a line width if it is a character. The size is the size of the main color region including the color boundary, and may be obtained from the number of pixels, for example, or may be the size of a circumscribed rectangle of the region. FIG. 4 is an explanatory diagram of an example of the comprehensiveness. The comprehensiveness is an area ratio of a portion where a circumscribed rectangle of one main color area constituting the color boundary does not overlap with a circumscribed rectangle of the other main color area. In the example shown in FIG. 4, for ease of understanding, the two circumscribed rectangles are shifted to the side. Therefore, the area ratio of the non-overlapping portion is ½. In addition, since 2/3 of the circumscribed
この関数Fの具体例では、太さが太く、大きく、他の主要色の外接矩形と重ならず、彩度が低いほど、関数Fの値は大きくなり、逆に細くて小さく、他の主要色の外接矩形に重なり、彩度が高いほど、値は小さくなる。関数Fの値が小さいほど、背景と前景のうち前景らしいことが推測され、関数Fの値が大きいほど背景らしいことが推測される。図3でも示したが、込み入った図形では前景と推測される側を補正することとし、関数Fの小さい色領域の境界を補正する側として決定して補正すればよい。 In this specific example of the function F, the value of the function F increases as the thickness is thicker and larger, does not overlap with the circumscribed rectangles of other main colors, and the saturation is lower. The higher the saturation is, the smaller the value. It is estimated that the smaller the value of the function F is, the more likely the foreground is between the background and the foreground, and the larger the value of the function F, the more likely it is the background. As shown in FIG. 3, in the complicated figure, the side estimated as the foreground is corrected, and the correction may be made by determining the side of the color region having a small function F as the side to be corrected.
例えば図2に示した例において、橙の矩形中に緑の文字「C」が存在する部分において、橙と緑の色境界では、緑の文字「C」の方が細く、小さく、橙の矩形に包含されている。従って、橙の矩形から算出される関数Fの値よりも、緑の文字「C」から算出される関数Fの値の方が小さくなる。従って、橙と緑の色境界では緑の側を補正することと決定し、緑の側を補正することになる。 For example, in the example shown in FIG. 2, in the portion where the green character “C” is present in the orange rectangle, the green character “C” is narrower and smaller at the orange-green color boundary. Is included. Therefore, the value of the function F calculated from the green character “C” is smaller than the value of the function F calculated from the orange rectangle. Accordingly, it is determined that the green side is corrected at the orange / green color boundary, and the green side is corrected.
なお、文字などでは太さが変化することもあることから、太さの平均と太さの分散を用いて上述の関数Fを変形し、
F=α1×太さの平均+α2×太さの分散+β×大きさ+γ×包括度−δ×彩度
としてもよい。ここで、係数α1、α2、β、γ、δは予め与えられる正数である。関数Fの値が小さい主要色の側を色境界において補正する側として決定し、補正すればよい。もちろん、このほかの主要色の色に関する特徴、主要色の領域に関する特徴を用いた関数としてもよいし、判定度合いを算出する関数としてどのような式を用いるかについても変更してよい。
Since the thickness of characters and the like may change, the above function F is modified using the average thickness and variance of the thickness,
F = α1 × average thickness + α2 × thickness dispersion + β × size + γ × inclusion level−δ × saturation. Here, the coefficients α1, α2, β, γ, and δ are positive numbers given in advance. The main color side having a small value of the function F may be determined as the side to be corrected at the color boundary and corrected. Of course, it may be a function using other characteristics relating to the color of the main color and characteristics relating to the area of the main color, or what expression is used as a function for calculating the determination degree.
色境界のいずれの側を補正するかを決定部14で決定する際には、上述の関数により算出した判定度合いを用いる方法のほか、主要色の色の特徴や領域の特徴から、例えば優先順位などに従って論理判定してもよい。一例としては、
S1.包括度の小さい主要色の側を補正する側として決定する
S2.太さの小さい主要色の側を補正する側として決定する
S3.領域の大きさが小さい主要色の側を補正する側として決定する
S4.彩度が大きい主要色の側を補正する側として決定する
と順位付けしておき、S1から順に2つの主要色について特徴値の差が予め与えられた閾値以内の場合に、そのステップの内容で補正する側を決定し、閾値よりも大きい場合には次に進むこととして判定して行く。例えばS1では色境界を構成する2つの主要色の領域の包括度の差が予め与えられている閾値以内であれば、包括度が小さい主要色の側を補正する側として決定する。また、包括度の差が予め与えられている閾値以内であればS2に進み、太さの比較を行う。このようにして、順に判定を行って行けばよい。S4でも彩度差が予め与えられた閾値以内であれば、いずれかの主要色の側を強制的に補正する側として決定すればよい。もちろん、ここに示した順位付け及び各判定項目は一例であって、他の判定項目を使用してもよいし、順序についてもこの例に限られるものではない。
When the
S1. Determine the side of the main color with a low coverage as the side to be corrected S2. Determine the side of the main color with a small thickness as the side to be corrected S3. The main color side having a small area size is determined as the correction side. S4. Prioritizing that the side of the main color with high saturation is determined as the side to be corrected, if the difference between the feature values of the two main colors in order from S1 is within a predetermined threshold, correction is performed with the contents of that step. The side to be performed is determined, and if it is larger than the threshold value, it is determined that the process proceeds to the next. For example, in S1, if the difference in coverage between the two main color regions constituting the color boundary is within a predetermined threshold value, the side of the main color having a lower coverage is determined as the correction side. On the other hand, if the difference in inclusiveness is within a predetermined threshold, the process proceeds to S2, and the thickness is compared. In this way, the determination may be made in order. Even in S4, if the saturation difference is within a predetermined threshold value, one of the main colors may be determined as a side to be forcibly corrected. Of course, the ranking and each determination item shown here are only examples, and other determination items may be used, and the order is not limited to this example.
上述の判定は、色境界ごとに行ってもよいし、あるいは、画像中で一括して判定してもよい。色境界毎に行う場合でも、ある色境界において行った決定は、当該色境界を構成する主要色の組とともに記憶しておき、その主要色の組では他の色境界でもその決定を反映するとよい。二値画像において統一的に色境界の部分が補正されることになる。 The above-described determination may be performed for each color boundary, or may be performed collectively in the image. Even when it is performed for each color boundary, a determination made at a certain color boundary is stored together with a set of main colors constituting the color boundary, and the determination may be reflected at other color boundaries in the set of main colors. . Color boundary portions are corrected uniformly in the binary image.
また、画像中で一括して判定する場合には、ある2つの主要色が隣接する色境界が画像中に複数存在する場合があることから、補正する側の決定に使用する色境界を特定するか、あるいは各色境界における特徴を統計的に処理するとよい。例えば、ある2つの主要色が隣接する色境界が存在する各主要色の領域のうち、太さが最大の一方の主要色の領域と、その領域に隣接する他方の主要色の領域のうち太さが最大の領域とを対象とし、補正する側を決定すればよい。あるいは太さの分散を使用し、太さの分散が最小の一方の主要色の領域と、その領域に隣接する他方の主要色の領域のうち太さの分散が最小の領域とを対象とし、補正する側を決定すればよい。また、太さに代えて領域の大きさを使用し、大きさが最大の一方の主要色の領域と、その領域に隣接する他方の主要色の領域のうち大きさが最大の領域とを対象とし、補正する側を決定すればよい。もちろん、他の特徴を使用してもよい。これらの代表させた領域を使用して補正する側を決定したら、その決定を当該2つの主要色が隣接する他の色境界についても用いる。また、このような補正する側の決定を、色領域を構成する2つの主要色の組ごとに行えばよい。 Further, when determining in a lump in an image, there may be a plurality of color boundaries in which two main colors are adjacent to each other. Therefore, the color boundary used for determining the correction side is specified. Alternatively, the characteristics at each color boundary may be processed statistically. For example, among the main color areas where there is a color boundary where two main colors are adjacent to each other, one main color area having the maximum thickness and the other main color area adjacent to the area are thick. It is only necessary to determine a correction side with respect to a region having a maximum length. Alternatively, using the variance of thickness, targeting the area of one main color with the smallest thickness variance and the area with the smallest thickness variance among the other major color areas adjacent to that area, What is necessary is just to determine the side to correct. In addition, the size of the area is used instead of the thickness, and the area of the one main color with the largest size and the area with the largest size among the areas of the other main color adjacent to the area are targeted. And the correction side may be determined. Of course, other features may be used. Once these representative regions are used to determine the side to be corrected, the determination is also used for other color boundaries adjacent to the two main colors. In addition, such correction side determination may be performed for each set of two main colors constituting the color region.
各色境界における特徴を統計的に処理する場合には、隣接する2つの主要色の組ごとに、当該2つの主要色が隣接する1または複数の色境界における特徴量を集計して、集計結果からいずれの側を補正するかを決定すればよい。あるいは、各色境界においていずれの側を補正するかを判定した後、いずれの側を補正すると判定した色境界が多かったかにより、当該2つの主要色の組についていずれの側を補正するかを決定してもよい。 When statistically processing the features at each color boundary, for each set of two adjacent main colors, the feature amounts at one or more color boundaries adjacent to the two main colors are totaled, and the total results are calculated. It suffices to determine which side is to be corrected. Alternatively, after determining which side of each color boundary is to be corrected, it is determined which side is to be corrected for the set of the two main colors depending on which side is determined to be corrected. May be.
このようないずれの側を補正するかの決定を、色境界を構成する2つの主要色の組ごとに行い、その2つの主要色の組が隣接する色境界に対しては、いずれの色境界についても決定した側を補正部15で統一的に補正すればよい。 Such a determination of which side is corrected is performed for each set of two main colors constituting the color boundary, and for which color boundary adjacent to the two main color sets, which color boundary The determined side may be uniformly corrected by the correction unit 15.
図5は、本発明の第2の実施の形態を示す構成図である。図1に示した本発明の第1の実施の形態と異なる部分について主に説明して行く。この第2の実施の形態では、二値画像生成部12は限定色画像生成部11で生成した限定色画像を二値化する例を示している。
FIG. 5 is a block diagram showing a second embodiment of the present invention. Differences from the first embodiment of the present invention shown in FIG. 1 will be mainly described. In the second embodiment, the binary
二値画像生成部12は、主要色の色(具体的には、明度、彩度、色相など)、主要色の領域(大きさ、長さ、太さ、包括関係、複雑さなど)、主要色と他の主要色との隣接関係(主要色と他の主要色とが隣接する部分の長さや隣接している個数など)などに応じて、限定色画像生成部11で生成した限定色画像を二値化し、二値画像を生成する。
The binary
例えば、二値の一方の値に変換するか否かを判定するための判定度合いを表す関数Gを用い、
G=α×太さ+β×大きさ+γ×包括度−δ×彩度
により判定度合いを算出する。ここで、係数α、β、γ、δは予め与えられる正数である。算出された判定度合いが予め決められた値以下であれば、二値の一方の値(例えば黒)に変換し、そうでなければ二値の他方の値(例えば白)に変換すればよい。太さは、ある主要色と隣接する境界から別の境界までの距離であり、文字であれば線幅でよい。大きさは、当該主要色の領域の広さであり、例えば画素数から求めてもよいし、当該領域の外接矩形の大きさでもよい。包括度は、一方の主要色の領域の外接矩形が、隣接する他方の主要色の領域の外接矩形と重なっていない部分の面積比率である。彩度は当該主要色の彩度を用いればよい。算出される判定度合いが小さいほど前景の図形であることが想定され、大きいほど背景であることが想定される。それぞれに応じた二値のいずれかの値に変換すればよい。
For example, using a function G representing a degree of determination for determining whether to convert to one of binary values,
G = α × thickness + β × size + γ × inclusion level−δ × saturation degree is calculated. Here, the coefficients α, β, γ, and δ are positive numbers given in advance. If the calculated degree of determination is less than or equal to a predetermined value, it is converted to one of the binary values (for example, black), otherwise it is converted to the other binary value (for example, white). The thickness is a distance from a boundary adjacent to a certain primary color to another boundary, and may be a line width if it is a character. The size is the width of the region of the main color, and may be obtained from the number of pixels, for example, or may be the size of a circumscribed rectangle of the region. The comprehensiveness is an area ratio of a portion where a circumscribed rectangle of one main color region does not overlap with a circumscribed rectangle of the other adjacent main color region. The saturation may be the saturation of the main color. It is assumed that the lower the calculated degree of determination is, the more the foreground figure is, and the larger the background is, the higher the background. What is necessary is just to convert into the binary value according to each.
あるいは、二値の値を変更する度合いを表す関数Hを用い、
H=ε×隣接する部分の長さ
により度合いを算出する。ここで、係数εは予め与えられる正数である。算出された度合いの値が予め決められた値より大きい隣接する主要色については、二値の値を異ならせればよい。
Alternatively, a function H representing the degree of changing the binary value is used,
The degree is calculated from H = ε × length of adjacent portions. Here, the coefficient ε is a positive number given in advance. For adjacent main colors whose calculated degree values are larger than a predetermined value, the binary values may be different.
このようにして生成された二値画像は色境界抽出部13に渡され、限定色画像生成部11で生成された限定色画像では異なる主要色が隣接するが、その隣接する主要色のいずれも、二値画像ではいずれか一方の値に変換されている色境界が抽出される。そして、決定部14で色境界のいずれの側を補正するかを決定し、決定された側を補正部15で補正する。色境界抽出部13,決定部14、補正部15の処理については上述の第1の実施の形態で説明したとおりである。
The binary image generated in this way is passed to the color
図6は、本発明の第2の実施の形態における処理の具体例の説明図である。図6(A)には処理対象の画像の具体例を示しており、図2(A)に示したものである。図6(A)に示した画像では、灰色の背景中に黒の文字「A」と、橙色の文字「B」と、緑の文字「C」が含まれた橙色の矩形とが存在している。なお、図示の都合上、色の違いは、黒については塗り潰し、他の色については斜線を異ならせて示している。 FIG. 6 is an explanatory diagram of a specific example of processing according to the second embodiment of the present invention. FIG. 6A shows a specific example of an image to be processed, which is shown in FIG. In the image shown in FIG. 6A, a black character “A”, an orange character “B”, and an orange rectangle including a green character “C” are present in a gray background. Yes. For convenience of illustration, the difference in color is indicated by black for the other color and different shaded lines for the other colors.
図6(A)に示した画像を処理対象とし、限定色画像生成部11は図6(A)に示した処理対象の画像中の色を主要色に限定した限定色画像を生成する。この例では、主要色として黒、灰、橙、緑が抽出され、これらの色以外については主要色のいずれかに変換して限定色画像が生成される。ここでは図6(A)の画像で代用することとする。
The limited color
二値画像生成部12は、限定色画像生成部11で生成した限定色画像を、主要色の隣接関係に応じて二値化し、二値画像を生成する。二値画像生成部12で二値化した二値画像を図6(B)に示している。この例では、二値を白と黒により示しており、黒の文字「A」と橙の文字「B」とともに、橙の矩形及びその中の緑の文字「C」についても一方の値(黒)に変換され、背景となる灰色の部分は他方の値(白)に変換されたものとしている。この二値画像では、橙の矩形の中の緑の文字「C」については反映されておらず、処理対象の画像中で色の違いにより表現されている情報が欠落していることになる。
The binary
色境界抽出部13は、限定色画像生成部11で生成された限定色画像では異なる主要色が隣接するが、その隣接する主要色のいずれも、二値画像生成部12で生成された二値画像ではいずれか一方の値に変換されている色境界を抽出する。この具体例では、図6(A)で存在する橙と緑の境界は、図6(B)に示す二値画像ではいずれも境界の両側とも、二値画像では二値の一方の値(黒)に変換されている。従って、橙と緑の境界を、ここでは修正処理の対象となる色境界として抽出する。抽出した色境界を、図6(C)に破線により示している。
In the limited color image generated by the limited color
決定部14は、色境界抽出部13で抽出された橙と緑が隣接する色境界について、橙と緑の領域に関する特徴から、橙と緑のいずれの側を補正するかを決定する。ここでは、緑の側を補正することと決定したものとしている。補正部15は、二値画像生成部12で生成した二値画像における色境界抽出部13で抽出した色境界について、決定部14で決定された側の値を補正する。ここでは、橙と緑が隣接する色境界において、二値画像の緑の側を補正する。補正した結果を図6(D)に示している。
The
この図6(D)に示した二値画像が処理結果として出力されることになる。図6(B)に示した二値画像では消失していた緑の文字「C」の輪郭が現れ、処理対象の画像中で色の違いにより表現されている情報が欠落せずに存在が分かるようになる。 The binary image shown in FIG. 6D is output as the processing result. In the binary image shown in FIG. 6B, the outline of the green character “C” that has disappeared appears, and the information represented by the difference in color in the image to be processed is present without being lost. It becomes like this.
図7は、本発明の各実施の形態で説明した機能をコンピュータプログラムで実現した場合におけるコンピュータプログラム及びそのコンピュータプログラムを格納した記憶媒体とコンピュータの一例の説明図である。図中、21はプログラム、22はコンピュータ、31は光磁気ディスク、32は光ディスク、33は磁気ディスク、34はメモリ、41はCPU、42は内部メモリ、43は読取部、44はハードディスク、45はインタフェース、46は通信部である。
FIG. 7 is an explanatory diagram of an example of a computer program, a storage medium storing the computer program, and a computer when the functions described in the embodiments of the present invention are realized by the computer program. In the figure, 21 is a program, 22 is a computer, 31 is a magneto-optical disk, 32 is an optical disk, 33 is a magnetic disk, 34 is a memory, 41 is a CPU, 42 is an internal memory, 43 is a reading unit, 44 is a hard disk, 45 is An
上述の本発明の各実施の形態で説明した各部の機能を全部あるいは部分的に、コンピュータにより実行可能なプログラム21によって実現してもよい。その場合、そのプログラム21およびそのプログラムが用いるデータなどは、コンピュータが読み取り可能な記憶媒体に記憶させておけばよい。記憶媒体とは、コンピュータのハードウェア資源に備えられている読取部43に対して、プログラムの記述内容に応じて、磁気、光、電気等のエネルギーの変化状態を引き起こして、それに対応する信号の形式で、読取部43にプログラムの記述内容を伝達するものである。例えば、光磁気ディスク31,光ディスク32(CDやDVDなどを含む)、磁気ディスク33,メモリ34(ICカード、メモリカード、フラッシュメモリなどを含む)等である。もちろんこれらの記憶媒体は、可搬型に限られるものではない。
You may implement | achieve the function of each part demonstrated by each embodiment of the above-mentioned all or part by the program 21 which can be performed by computer. In that case, the program 21 and the data used by the program may be stored in a computer-readable storage medium. The storage medium is a signal of a corresponding signal that causes a change state of energy such as magnetism, light, electricity, etc. according to the description content of the program to the
これらの記憶媒体にプログラム21を格納しておき、例えばコンピュータ22の読取部43あるいはインタフェース45にこれらの記憶媒体を装着することによって、コンピュータからプログラム21を読み出し、内部メモリ42またはハードディスク44(磁気ディスクやシリコンディスクなどを含む)に記憶し、CPU41によってプログラム21を実行することによって、上述の本発明の実施の一形態で説明した機能が全部あるいは部分的に実現される。あるいは、通信路を介してプログラム21をコンピュータ22に転送し、コンピュータ22では通信部46でプログラム21を受信して内部メモリ42またはハードディスク44に記憶し、CPU41によってプログラム21を実行することによって実現してもよい。
The program 21 is stored in these storage media, and the program 21 is read from the computer by, for example, mounting these storage media on the
コンピュータ22には、このほかインタフェース45を介して様々な装置と接続してもよい。例えば情報を表示する表示手段や利用者からの情報を受け付ける受付手段等も接続されていてもよい。また、例えば画像読取装置がインタフェース45を介して接続され、画像読取装置で読み取った画像あるいは該画像に処理を施した画像を処理対象の画像として本発明の各実施の形態で説明した処理を行ってもよい。処理後の二値画像は、ハードディスク44に記憶させ、またはインタフェース45を介して記憶媒体に記憶させ、あるいは通信部46を通じて外部へ転送してもよい。さらに、出力装置としての画像形成装置がインタフェース45を介して接続されていてもよく、処理後の二値画像を形成してもよい。
In addition, the
もちろん、部分的にハードウェアによって構成することもできるし、全部をハードウェアで構成してもよい。あるいは、他の構成とともに本発明の各実施の形態で説明した機能の全部あるいは部分的に含めたプログラムとして構成してもよい。もちろん、他の用途に適用する場合には、その用途におけるプログラムと一体化してもよい。 Of course, it may be partially configured by hardware, or all may be configured by hardware. Or you may comprise as a program which included all or one part of the function demonstrated by each embodiment of this invention with other structures. Of course, when applied to other purposes, it may be integrated with the program for that purpose.
11…限定色画像生成部、12…二値画像生成部、13…色境界抽出部、14…決定部、15…補正部、21…プログラム、22…コンピュータ、31…光磁気ディスク、32…光ディスク、33…磁気ディスク、34…メモリ、41…CPU、42…内部メモリ、43…読取部、44…ハードディスク、45…インタフェース、46…通信部。
DESCRIPTION OF
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010146094A JP2012008914A (en) | 2010-06-28 | 2010-06-28 | Image processing device and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010146094A JP2012008914A (en) | 2010-06-28 | 2010-06-28 | Image processing device and image processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012008914A true JP2012008914A (en) | 2012-01-12 |
Family
ID=45539354
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010146094A Pending JP2012008914A (en) | 2010-06-28 | 2010-06-28 | Image processing device and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012008914A (en) |
-
2010
- 2010-06-28 JP JP2010146094A patent/JP2012008914A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7965892B2 (en) | Image processing apparatus, control method thereof, and program | |
JP6743092B2 (en) | Image processing apparatus, image processing control method, and program | |
JP5847063B2 (en) | Image processing device | |
US8538191B2 (en) | Image correction apparatus and method for eliminating lighting component | |
JP2008310817A (en) | Method for detecting line structure from text map and image processor | |
JP5870745B2 (en) | Image processing apparatus, binarization threshold value calculation method, and computer program | |
US9438767B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP2010074342A (en) | Image processing apparatus, image forming apparatus, and program | |
JP5151708B2 (en) | Image processing apparatus and image processing program | |
US9424488B2 (en) | Applying a segmentation engine to different mappings of a digital image | |
JP5725276B2 (en) | Binarization processing apparatus, image processing apparatus, binarization processing program, image processing program | |
JP3957734B1 (en) | Program, information storage medium, 2D code generation system, 2D code | |
JP5333787B2 (en) | Image processing apparatus and image processing program | |
JP2005275854A (en) | Image processor, image processing method, image processing program and recording medium with this program stored thereon | |
JP2012008914A (en) | Image processing device and image processing program | |
US11570331B2 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5459481B2 (en) | Image processing apparatus and image processing program | |
JP5245991B2 (en) | BRIGHTNESS CORRECTION PROGRAM, BRIGHTNESS CORRECTION METHOD, AND BRIGHTNESS CORRECTION DEVICE | |
JP6091400B2 (en) | Image processing device | |
JP6486082B2 (en) | Image processing apparatus, image processing method, and program | |
JP2009164897A (en) | Binarizing device and binarization processing program | |
JP4890351B2 (en) | Image processing apparatus, image processing program, computer-readable recording medium storing the image processing program, and image processing method | |
JP3957735B1 (en) | Program, information storage medium, 2D code generation system, 2D code | |
JP2015088910A (en) | Image processing device | |
US9396418B2 (en) | Information processing apparatus, information processing method, and storage medium for processing an image and a pattern included in an XOR-and-XOR rendering command set |