JP2007328652A - Image processing device and image processing program - Google Patents
Image processing device and image processing program Download PDFInfo
- Publication number
- JP2007328652A JP2007328652A JP2006160462A JP2006160462A JP2007328652A JP 2007328652 A JP2007328652 A JP 2007328652A JP 2006160462 A JP2006160462 A JP 2006160462A JP 2006160462 A JP2006160462 A JP 2006160462A JP 2007328652 A JP2007328652 A JP 2007328652A
- Authority
- JP
- Japan
- Prior art keywords
- angle
- image
- skew
- unit
- region
- 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
- Character Input (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、画像処理装置および画像処理プログラムに関し、特に画像読み取りの際に傾いて読み込まれた文書画像の傾き角度を検出し、その傾き補正を行う画像処理装置および画像処理プログラムに関する。 The present invention relates to an image processing apparatus and an image processing program, and more particularly to an image processing apparatus and an image processing program for detecting an inclination angle of a document image read in an inclined manner when reading an image and correcting the inclination.
文書画像をイメージスキャナで読み取った際に得られる画像データや、ファクシミリ装置が受信する画像データを解析し、文書画像から領域の切り出しを行うとともに、文書中に含まれる画像の種類や属性を判別し、そのうち文字と判別された領域に対しては文字認識処理を施し、画像として読み取った文書から文字あるいは文章を抽出する技術が知られている。 Analyzes the image data obtained when the document image is read by the image scanner and the image data received by the facsimile machine, extracts the region from the document image, and determines the type and attribute of the image included in the document. A technique is known in which character recognition processing is performed on an area determined as a character, and a character or a sentence is extracted from a document read as an image.
この種の画像処理の分野において、領域の切り出しや文字認識などの処理を正しく実行するためには、イメージスキャナや送信側のファクシミリ装置で読み取った文書画像に傾きが無いことが前提となる。したがって、読み込まれた画像に傾きがある場合には、領域の切り出しや文字認識などの処理を行う前処理として、画像の傾き角度(以下、「スキュー角」と記述する)を検出してその傾きを補正する、いわゆるスキュー(skew)補正を行う必要がある。 In the field of this type of image processing, in order to correctly execute processing such as segmentation and character recognition, it is premised that the document image read by the image scanner or the facsimile machine on the transmission side has no inclination. Therefore, when the read image has a tilt, as a pre-process for processing such as segmentation and character recognition, the tilt angle of the image (hereinafter referred to as “skew angle”) is detected and the tilt is detected. It is necessary to perform so-called skew correction.
従来、文書画像のスキュー角を検出し、その検出結果を基にしてスキュー補正を行う技術として、ハフ(Hough)変換を用いた技術が知られている(例えば、特許文献1参照)。この特許文献1記載の従来技術では、スキュー角の検出に当たって次のような処理を行うようにしている。
Conventionally, a technique using Hough transformation is known as a technique for detecting a skew angle of a document image and performing skew correction based on the detection result (see, for example, Patent Document 1). In the prior art described in
先ず、入力画像に対してフィルタリング処理を行い、当該フィルタリング処理によって濃淡差が強調された画像に対して2値化処理を行い2値画像を生成する。次に、生成した2値画像の各画素に対してハフ変換を行い、ハフ空間上にヒストグラムを作成し、ハフ空間上で頻度が所定の閾値以上となる座標を抽出する。そして、抽出した座標をグループ化した後、グループごとに代表点座標を抽出し、抽出した座標から画像のスキュー角を推定する。 First, a filtering process is performed on an input image, and a binarization process is performed on an image whose density difference is enhanced by the filtering process to generate a binary image. Next, a Hough transform is performed on each pixel of the generated binary image, a histogram is created in the Hough space, and coordinates whose frequency is equal to or higher than a predetermined threshold in the Hough space are extracted. Then, after the extracted coordinates are grouped, representative point coordinates are extracted for each group, and the skew angle of the image is estimated from the extracted coordinates.
また、特許文献1には、ハフ空間上で頻度が所定の閾値以上となる座標を抽出した後、抽出した座標の個数を角度ごとに積算してヒストグラムを生成し、頻度が最大となる角度を画像のスキュー角として推定する技術も記載されている。
Further, in
しかしながら、上述した従来技術では、文書画像全体に対してハフ変換処理やヒストグラム生成処理を行う構成を採っているために、例えば図7に示すように、文書画像に含まれる段落において上下あるいは左右に隣接する段落相互間で行が均等に傾いている(ずれている)場合に、その段落相互間での行の傾きを文書画像全体の傾き角度(スキュー角)と誤検出してしまったり、あるいは、文書画像全体として1つの傾き角度を決定することになるために、例えば図8に示すように、見開き原稿のように、左右ページで画像の傾き角度が異なる場合に、左右ページの両画像に対してスキュー補正を正しく行うことができなかったりする場合がある。 However, since the conventional technique described above employs a configuration in which the Hough transform process and the histogram generation process are performed on the entire document image, for example, as shown in FIG. If the lines are evenly inclined (shifted) between adjacent paragraphs, the line inclination between the paragraphs may be mistakenly detected as the inclination angle (skew angle) of the entire document image, or In order to determine one inclination angle for the entire document image, for example, as shown in FIG. 8, when the left and right pages have different inclination angles, as shown in FIG. On the other hand, skew correction may not be performed correctly.
本発明は、上記課題に鑑みてなされたものであって、その目的とするところは、画像のスキュー角検出およびその補正を高精度にて実現可能にした画像処理装置および画像処理プログラムを提供することにある。 The present invention has been made in view of the above problems, and an object of the present invention is to provide an image processing apparatus and an image processing program capable of detecting a skew angle of an image and correcting the image with high accuracy. There is.
上記目的を達成するために、本発明は、次のような構成を採っている。すなわち、入力画像中から白領域を探索し、この探索した白領域を基準に前記入力画像を複数の領域に分割し、この分割した領域単位にハフ変換による角度検出を行う。そして、この検出した領域単位の角度を基にスキュー角を求め、この求めたスキュー角を基に入力画像に対するスキュー補正を行うようにする。 In order to achieve the above object, the present invention adopts the following configuration. That is, a white area is searched from the input image, the input image is divided into a plurality of areas based on the searched white area, and angle detection is performed by Hough transform for each divided area. Then, a skew angle is obtained based on the detected angle of the region unit, and skew correction is performed on the input image based on the obtained skew angle.
スキュー角検出・補正を行う画像処理において、画像中から白領域を見つけ、当該白領域で区切られた分割領域単位にハフ変換による角度検出を行う。このように、分割領域単位で角度検出を行うことにより、他の領域との干渉を防ぎつつ分割領域個々の角度検出を行うことができる。そして、分割領域単位で検出した角度から画像全体の又は領域単位のスキュー角を算出し、当該スキュー角を基にスキュー補正を行う。 In the image processing for detecting and correcting the skew angle, a white area is found from the image, and angle detection is performed by Hough transform for each divided area divided by the white area. In this manner, by performing angle detection in units of divided areas, it is possible to detect the angles of individual divided areas while preventing interference with other areas. Then, a skew angle for the entire image or for each region is calculated from the angle detected for each divided region, and skew correction is performed based on the skew angle.
本発明によれば、他の領域との干渉を防ぎつつ分割領域個々の角度検出を行うことで、画像全体の又は領域単位のスキュー角をより正確に検出することができるために、スキュー角の検出およびその補正を高精度にて実現できる。 According to the present invention, by detecting the angle of each divided region while preventing interference with other regions, it is possible to more accurately detect the skew angle of the entire image or of the region unit. Detection and correction thereof can be realized with high accuracy.
以下、本発明の実施の形態について図面を参照して詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
図1は、本発明による画像処理装置を含む画像処理システムの構成例を示すブロック図である。図1に示すように、本画像処理システムは、画像データ入力部10、画像処理部20および画像データ出力部30を有する構成となっている。
FIG. 1 is a block diagram showing a configuration example of an image processing system including an image processing apparatus according to the present invention. As shown in FIG. 1, the image processing system includes an image
画像データ入力部10は、イメージスキャナ等の画像読取装置からなり、文書原稿の画像を読み取ってその画像データを画像処理部20に入力する。なお、イメージスキャナ等の画像読取装置で読み取った画像データをサーバなどの記憶装置に一旦格納しておくシステム構成を採る場合には、サーバが画像データ入力部10として機能することになる。また、ファクシミリ装置にあっては、受信側のファクシミリ装置が画像データ入力部10として機能することになる。
The image
画像処理部20は、本発明による画像処理装置に相当し、画像データ入力部10から入力される画像データに基づく画像(入力画像)のスキュー角(傾き角度)を検出し、その検出角度を基に画像データに対してスキュー補正を行う。
The image processing unit 20 corresponds to the image processing apparatus according to the present invention, detects a skew angle (tilt angle) of an image (input image) based on the image data input from the image
画像処理部20は、CPU(Central Processing Unit:中央演算装置)21、I/O回路22、ROM23、RAM24およびHDD(ハードディスクドライブ)装置25などを有し、これら構成要素がバスライン26を介して相互に通信可能に接続された構成となっている。
The image processing unit 20 includes a CPU (Central Processing Unit) 21, an I /
CPU21は、演算処理を含む本画像処理部20全体の処理の制御を行う。I/O回路22は、画像データ入力部10および画像データ出力部30を含む周辺機器との入出力を管理する。ROM23は、CPU21による制御の下に実行される各種処理の処理プログラムを格納する。RAM24は、各種処理の実行時に使用される一次記憶装置である。HDD25は、CPU21による制御の下に処理された画像データや、外部から取り込んだ画像データなどを記憶する。
The
画像データ出力部30は、画像処理部20でスキュー補正された画像データを、次段の例えば文字認識装置などの画像処理装置(図示せず)に対して出力する。なお、画像データ出力部30をプリンタやディスプレイ等の出力装置とその制御手段によって構成し、画像処理部20でスキュー補正された画像データに基づく画像を印刷(記録)紙に印刷出力したり、あるいは、表示画面上に表示出力したりすることも可能である。
The image
[第1実施形態]
図2は、本発明の第1実施形態に係る画像処理装置(画像処理部)20Aの機能構成例を示すブロック図である。
[First Embodiment]
FIG. 2 is a block diagram illustrating a functional configuration example of the image processing apparatus (image processing unit) 20A according to the first embodiment of the present invention.
図2に示すように、本実施形態に係る画像処理装置20Aは、2値化部201、白領域探索部202、領域分割部203、ハフ(Hough)変換部204、角度算出部205、全体角度算出部206およびスキュー補正部207を有する構成となっている。
As shown in FIG. 2, the image processing apparatus 20A according to the present embodiment includes a
2値化部201は、図1の画像データ入力部10から入力される、濃淡が複数ビットで表されている画像データを、入力画像中に含まれる例えば文字や線、絵柄や写真などの前景に属する画素を画素値が論理「1」のON画素(例えば、黒画素)、背景領域に属する画素を画素値が論理「0」のOFF画素(例えば、白画素)とした各画素値が1ビットの2値画像データに2値化して白領域探索部202および領域分割部203に供給する。
The
白領域探索部202は、2値化部201から供給される2値画像データを基に、当該画像データに基づく2値画像中から白領域(白帯)を探索する。この白領域探索部202は、白領域探索を行う際に、2値画像に対して論理和縮小、具体的にはm×n画素(m,nは2以上の任意の整数)、例えば4×4画素を単位とし、当該単位中の1画素でもON画素ならその単位を1画素のON画素とすることによって画像の縮小を行う。
Based on the binary image data supplied from the
この画像縮小については、図3に示すように、原画像(A)を段階的に、例えば縮小画像(B)→縮小画像(C)のように2段階で縮小しても良いし、1回で所定の倍率、例えば原画像(A)を縮小画像(C)に縮小しても良い。 As for this image reduction, as shown in FIG. 3, the original image (A) may be reduced in two steps, for example, reduced image (B) → reduced image (C). A predetermined magnification, for example, the original image (A) may be reduced to a reduced image (C).
領域分割部203は、2値化部201で2値化された画像を、白領域探索部202で探索された白領域を基準にして複数の領域に分割する。ここで、画像を複数の領域に分割する際に、完全に白領域で区切られている必要は無い。白領域を基準として大体領域分割されていれば良く、文字領域などについてはある程度なら分断されていても構わない。
The
ハフ変換部204は、領域分割部203で区切られた(分割された)領域単位で周知のハフ変換処理を行う。ここで、ハフ変換処理について説明する。画素の位置をx座標とy座標とで表した場合、原点から画素までの直線距離をρ、原点から画素への直線とx軸とのなす角度をθとすると、x−y座標上において座標(x,y)に位置する画素を通る全ての直線は、
ρ=xcosθ+ysinθ (0≦θ<π)
なる式で表すことができる。
The
ρ = x cos θ + ysin θ (0 ≦ θ <π)
It can be expressed by the following formula.
そして、座標(x,y)の位置に位置する画素について、上記式の角度θを0〜πまで順次変化させ、この角度θの変化に対応して得られる距離ρをρ−θ座標上にプロットしていくと、ある画素を通る全ての直線を、ρ−θ座標上(極座標上)で曲線として表すことができる。この曲線がハフ曲線であり、このハフ曲線を求める処理がハフ変換である。 Then, for the pixel located at the position of the coordinate (x, y), the angle θ of the above equation is sequentially changed from 0 to π, and the distance ρ obtained corresponding to the change of the angle θ is put on the ρ−θ coordinate. When plotted, all straight lines passing through a certain pixel can be represented as curves on the ρ-θ coordinates (on the polar coordinates). This curve is a Hough curve, and the process for obtaining this Hough curve is the Hough transform.
角度算出部205は、ハフ変換部204における領域単位でのハフ変換の結果を基に、分割領域単位で画像の傾き角度を算出する。具体的には、角度算出部205は、ハフ変換部204においてハフ変換されたx−y平面における直線の傾き角度を入力画像のスキュー角として分割領域ごとに算出する。この角度算出部205はハフ変換部204と共に、特許請求の範囲の角度検出手段を構成している。
The
全体角度算出部206は、特許請求の範囲のスキュー角算出手段に相当し、角度算出部205で算出された分割領域ごとの画像の傾き角度を基に分割前の画像全体のスキュー角を算出する。
The overall
全体角度算出部206における画像全体のスキュー角を算出する手法としては、次のような方式が考えられる。ただし、これらは一例に過ぎず、これらに限定されるものではない。
As a method for calculating the skew angle of the entire image in the overall
方式1:算出された角度の平均を画像全体のスキュー角とする。
方式2:算出された角度のうち、算出頻度の大きかった角度を画像全体のスキュー角とする。
方式3:算出された角度に対して、分割領域のサイズを係数とした重み付けの平均を画像全体のスキュー角とする。
方式4:算出された角度に対して、分割領域中のON画素数を係数とした重み付けの平均を画像全体のスキュー角とする。
Method 1: The average of the calculated angles is set as the skew angle of the entire image.
Method 2: Of the calculated angles, the angle with the highest calculation frequency is set as the skew angle of the entire image.
Method 3: With respect to the calculated angle, an average of weights using the size of the divided area as a coefficient is set as the skew angle of the entire image.
Method 4: With respect to the calculated angle, an average of weighting using the number of ON pixels in the divided area as a coefficient is set as the skew angle of the entire image.
スキュー補正部207は、全体角度算出部206で算出された画像全体のスキュー角を基に、当該スキュー角がゼロになるように入力画像を回転させることによってスキュー補正を行う。画像を回転させる手法としては、例えば、アフィン(Affine)変換などの周知の手法を用いることができる。
Based on the skew angle of the entire image calculated by the overall
上記構成の画像処理装置20Aの各構成要素、即ち2値化部201、白領域探索部202、領域分割部203、ハフ変換部204、角度算出部205、全体角度算出部206およびスキュー補正部207については、PC(パーソナルコンピュータ)のように、所定プログラムを実行することによって情報記憶処理、画像処理、演算処理等の各機能を実行するコンピュータ機器を利用してソフトウェア構成によって実現することが考えられる。
Each component of the image processing apparatus 20A having the above configuration, that is, a
ただし、ソフトウェア構成による実現に限られるものではなく、ハードウェア構成、あるいはハードウェアとソフトウェアの複合構成によって実現することも可能である。ソフトウェア構成によって実現する場合、2値化部201、白領域探索部202、領域分割部203、ハフ変換部204、角度算出部205、全体角度算出部206およびスキュー補正部207としてコンピュータを機能させるプログラムが本発明による画像処理プログラムとなる。
However, the present invention is not limited to the implementation by software configuration, and can also be implemented by a hardware configuration or a combined configuration of hardware and software. When realized by a software configuration, a program that causes a computer to function as the
また、以下に説明する画像処理シーケンスにおける各ステップの処理を実行するプログラムが、本発明による画像処理プログラムであるとも言える。そして、これらの画像処理プログラムについては、あらかじめコンピュータ内にインストールしておくことが考えられる。ただし、あらかじめインストールされているのではなく、コンピュータ読み取り可能な記憶媒体に格納されて提供されるものであっても良く、または有線若しくは無線による通信手段を介して配信されるものであっても良い。 It can also be said that the program for executing the processing of each step in the image processing sequence described below is the image processing program according to the present invention. These image processing programs may be installed in the computer in advance. However, it may be provided by being stored in a computer-readable storage medium instead of being installed in advance, or distributed via wired or wireless communication means. .
(スキュー角検出・補正処理)
次に、入力画像のスキュー角を検出し、その検出角度を基にスキュー補正を行う第1実施形態に係るスキュー角検出・補正処理の手順の一例について、図4のフローチャートを用いて説明する。
(Skew angle detection / correction processing)
Next, an example of a procedure of skew angle detection / correction processing according to the first embodiment in which a skew angle of an input image is detected and skew correction is performed based on the detected angle will be described with reference to the flowchart of FIG.
先ず、入力画像データを取り込み(ステップS11)、次いで、この取り込んだ画像データを2値化して2値画像データを作成する(ステップS12)。次に、2値画像データを基に当該画像データに基づく2値画像中から白領域(白帯)を探索し(ステップS13)、次いで、この探索した白領域を基準にして2値化画像複数の領域に分割する(ステップS14)。 First, input image data is captured (step S11), and then the captured image data is binarized to generate binary image data (step S12). Next, based on the binary image data, a white area (white band) is searched from the binary image based on the image data (step S13), and then a plurality of binarized images are searched based on the searched white area. (Step S14).
ここで、分割領域の数をnとするとき、分割領域の番号iを1にセットし(ステップS15)、i番目の分割領域に対してハフ変換処理を行い(ステップS16)、次いで、ハフ変換結果を基にi番目の分割領域の傾き角度を算出し(ステップS17)、次いで、分割領域の番号iをインクリメントする(ステップS18)。 Here, when the number of divided areas is n, the divided area number i is set to 1 (step S15), the Hough transform process is performed on the i-th divided area (step S16), and then the Hough transform is performed. Based on the result, the inclination angle of the i-th divided region is calculated (step S17), and then the number i of the divided region is incremented (step S18).
次に、分割領域の番号iが分割領域数nを越えたか否かを判断し(ステップS19)、分割領域数nを越えていなければ、ステップS16に戻ってn番目の分割領域まで、各分割領域ごとにステップS16からステップS18までの処理を繰り返して実行する。 Next, it is determined whether or not the number i of the divided areas exceeds the number n of divided areas (step S19). If the number i does not exceed the number n of divided areas, the process returns to step S16 to reach the nth divided area. The processing from step S16 to step S18 is repeatedly executed for each region.
全ての分割領域について傾き角度の算出処理が終わったら、算出した分割領域ごとの傾き角度を基に分割前の画像全体のスキュー角を算出する(ステップS20)。そして、算出した画像全体のスキュー角を基に入力画像を回転させることによってスキュー補正を行い(ステップS21)、一連のスキュー角検出・補正処理を終了する。 When the calculation process of the inclination angle is completed for all the divided areas, the skew angle of the entire image before the division is calculated based on the calculated inclination angle for each divided area (step S20). Then, the skew correction is performed by rotating the input image based on the calculated skew angle of the entire image (step S21), and the series of skew angle detection / correction processing ends.
上述したように、画像中から白領域(白帯)を見つけ、当該白領域で区切られた領域単位にハフ変換による角度検出を行い、分割領域単位で検出した角度から画像全体のスキュー角を算出することにより、他の領域との干渉を防ぎつつ分割領域個々の角度検出を行うことができ、その結果、画像全体のスキュー角をより正確に検出できるために、スキュー角の検出およびスキュー補正を高精度にて実現できる。 As described above, a white area (white band) is found in the image, angle detection is performed by Hough transform for each area divided by the white area, and the skew angle of the entire image is calculated from the angle detected for each divided area. By doing so, it is possible to detect the angle of each divided area while preventing interference with other areas, and as a result, the skew angle of the entire image can be detected more accurately. Can be realized with high accuracy.
例えば、図7に示すように、画像に含まれる段落において上下あるいは左右に隣接する段落間で行が均等に傾いている(ずれている)場合であっても、分割領域ごとに、即ち段落ごとに傾き角度を検出することにより、他の段落との干渉を防ぎつつ段落個々の角度検出を行うことができるために、段落間での行の傾きを画像全体のスキュー角度と誤検出してしまうのを回避できる。これにより、画像全体のスキュー角をより正確に検出できるために、スキュー角の検出およびスキュー補正を高精度にて実現できる。 For example, as shown in FIG. 7, even if the lines included in the image are evenly inclined (shifted) between adjacent paragraphs in the vertical and horizontal directions, for each divided region, that is, for each paragraph By detecting the tilt angle, it is possible to detect the angle of each paragraph while preventing interference with other paragraphs. Therefore, the tilt of the line between paragraphs is erroneously detected as the skew angle of the entire image. Can be avoided. Thereby, since the skew angle of the whole image can be detected more accurately, the detection of the skew angle and the skew correction can be realized with high accuracy.
[第2実施形態]
図5は、本発明の第2実施形態に係る画像処理装置(画像処理部)20Bの機能構成例を示すブロック図である。
[Second Embodiment]
FIG. 5 is a block diagram illustrating a functional configuration example of an image processing apparatus (image processing unit) 20B according to the second embodiment of the present invention.
図5に示すように、本実施形態に係る画像処理装置20Bは、2値化部211、白領域探索部212、領域分割部213、ハフ変換部214、角度算出部215、領域統合部216、画像分割部217、スキュー補正部218および画像合成部219を有する構成となっている。
As shown in FIG. 5, the image processing apparatus 20B according to the present embodiment includes a
2値化部211は、図1の画像データ入力部10から入力される画像データを基に、画像中に含まれる例えば文字や線、絵柄や写真等の前景に属する画素をON画素(例えば、黒画素)、背景領域に属する画素をOFF画素(例えば、白画素)とした各画素1bitの2値画像データを作成して白領域探索部212および領域分割部213に供給する。
Based on the image data input from the image
白領域探索部212は、2値化部211から供給される2値画像データを基に、当該画像データに基づく2値画像中から白領域(白帯)を探索する。この白領域探索部212は、白領域探索を行う際に、2値画像に対して論理和縮小、具体的にはm×n画素(m,nは2以上の任意の整数)、例えば4×4画素を単位とし、当該単位中の1画素でもON画素ならその単位を1画素のON画素とすることによって画像の縮小を行う。このとき、第1実施形態の場合と同様に、段階的に縮小しても良いし、1回で所定の倍率に縮小しても良い。
Based on the binary image data supplied from the
領域分割部213は、2値化部211で2値化された画像を、白領域探索部212で探索された白領域を基準にして複数の領域に分割する。
The
ハフ変換部214は、領域分割部213で区切られた(分割された)領域単位で周知のハフ変換処理を行う。角度算出部215は、ハフ変換部214における領域単位でのハフ変換の結果を基に、分割領域単位で画像の傾き角度を算出する。この角度算出部215はハフ変換部214と共に、特許請求の範囲の角度検出手段を構成しており、第1実施形態の場合と同様にして角度を検出(算出)する。
The
領域統合部216は、特許請求の範囲のスキュー角算出手段に相当し、角度算出部215で分割領域単位に算出された傾き角度を分割領域相互間で比較し、その比較結果が同一(概ね同一を含む)の傾き角度の場合に、同一の傾き角度ごとに分割領域を統合するとともに、同一の傾き角度を統合した領域のスキュー角とする。
The
画像分割部217は、領域統合部216での統合結果を基に、統合した領域を単位として入力画像を分割する。
The
スキュー補正部218は、画像分割部217で分割された画像ごとに、領域統合部216で統合した領域(分割した画像に対応)のスキュー角を基に、当該スキュー角がゼロになるように分割画像を回転させることによってスキュー補正を行う。画像を回転させる手法としては、例えば、アフィン(Affine)変換などの周知の手法を用いることができる。
The
画像合成部219は、スキュー補正部218で各々スキュー補正された分割画像を合成して入力画像に対応したスキュー補正後の画像を生成して出力する。
The
上記構成の画像処理装置20Bの各構成要素、即ち2値化部211、白領域探索部212、領域分割部213、ハフ変換部214、角度算出部215、領域統合部216、画像分割部217、スキュー補正部218および画像合成部219については、PCのように、所定プログラムを実行することによって情報記憶処理、画像処理、演算処理等の各機能を実行するコンピュータ機器を利用してソフトウェア構成によって実現することが考えられる。
Each component of the image processing apparatus 20B having the above configuration, that is, a
ただし、ソフトウェア構成による実現に限られるものではなく、ハードウェア構成、あるいはハードウェアとソフトウェアの複合構成によって実現することも可能である。ソフトウェア構成によって実現する場合、2値化部211、白領域探索部212、領域分割部213、ハフ変換部214、角度算出部215、領域統合部216、画像分割部217、スキュー補正部218および画像合成部219としてコンピュータを機能させるプログラムが本発明による画像処理プログラムとなる。
However, the present invention is not limited to the implementation by software configuration, and can also be implemented by a hardware configuration or a combined configuration of hardware and software. When realized by a software configuration, the
また、以下に説明する画像処理シーケンスにおける各ステップの処理を実行するプログラムが、本発明による画像処理プログラムであるとも言える。そして、これらの画像処理プログラムについては、あらかじめコンピュータ内にインストールしておくことが考えられる。ただし、あらかじめインストールされているのではなく、コンピュータ読み取り可能な記憶媒体に格納されて提供されるものであっても良く、または有線若しくは無線による通信手段を介して配信されるものであっても良い。 It can also be said that the program for executing the processing of each step in the image processing sequence described below is the image processing program according to the present invention. These image processing programs may be installed in the computer in advance. However, it may be provided by being stored in a computer-readable storage medium instead of being installed in advance, or distributed via wired or wireless communication means. .
(スキュー角検出・補正処理)
次に、入力画像のスキュー角を検出し、その検出角度を基にスキュー補正を行う第2実施形態に係るスキュー角検出・補正処理の手順の一例について、図6のフローチャートを用いて説明する。
(Skew angle detection / correction processing)
Next, an example of a procedure of skew angle detection / correction processing according to the second embodiment in which a skew angle of an input image is detected and skew correction is performed based on the detected angle will be described with reference to a flowchart of FIG.
先ず、入力画像データを取り込み(ステップS31)、次いで、この取り込んだ画像データを2値化して2値画像データを作成する(ステップS32)。次に、2値画像データを基に当該画像データに基づく2値画像中から白領域(白帯)を探索し(ステップS33)、次いで、この探索した白領域を基準にして2値化画像複数の領域に分割する(ステップS34)。 First, input image data is captured (step S31), and then the captured image data is binarized to generate binary image data (step S32). Next, based on the binary image data, a white area (white band) is searched from the binary image based on the image data (step S33), and then a plurality of binarized images are searched based on the searched white area. (Step S34).
ここで、分割領域の数をnとするとき、分割領域の番号iを1にセットし(ステップS35)、i番目の分割領域に対してハフ変換処理を行い(ステップS36)、次いで、ハフ変換結果を基にi番目の分割領域の傾き角度を算出し(ステップS37)、次いで、分割領域の番号iをインクリメントする(ステップS38)。 Here, when the number of divided areas is n, the divided area number i is set to 1 (step S35), the Hough transform process is performed on the i-th divided area (step S36), and then the Hough transform is performed. Based on the result, the inclination angle of the i-th divided region is calculated (step S37), and then the number i of the divided region is incremented (step S38).
次に、分割領域の番号iが分割領域数nを越えたか否かを判断し(ステップS39)、分割領域数nを越えていなければ、ステップS36に戻ってn番目の分割領域まで、各分割領域ごとにステップS36からステップS38までの処理を繰り返して実行する。 Next, it is determined whether or not the number i of the divided areas exceeds the number n of divided areas (step S39). If the number i does not exceed the number n of divided areas, the process returns to step S36 to the nth divided area. The processing from step S36 to step S38 is repeated for each region.
全ての分割領域について傾き角度の算出処理が終わったら、分割領域単位に算出した傾き角度を分割領域相互間で比較し、その比較結果が同一(概ね同一を含む)の傾き角度の場合に、同一の傾き角度ごとに分割領域を統合するとともに、同一の傾き角度を統合した領域のスキュー角とする(ステップS40)。 After the calculation of the tilt angle is completed for all the divided areas, the tilt angles calculated for each divided area are compared between the divided areas. If the comparison results are the same (including almost the same), the same. The divided areas are integrated for each inclination angle, and the skew angle of the integrated area is set to the same inclination angle (step S40).
次に、分割領域についての統合結果を基に、統合した領域を単位として入力画像を分割し(ステップS41)、次いで、分割した画像ごとに、統合した領域のスキュー角を基に分割画像を回転させることによってスキュー補正を行い(ステップS42)、次いで、スキュー補正した各分割画像を合成し(ステップS43)、一連のスキュー角検出・補正処理を終了する。 Next, based on the integration result for the divided areas, the input image is divided in units of the integrated areas (step S41), and then, for each divided image, the divided images are rotated based on the skew angle of the integrated area. Thus, the skew correction is performed (step S42), and then the divided images subjected to the skew correction are synthesized (step S43), and the series of skew angle detection / correction processing is completed.
上述したように、画像中から白領域(白帯)を見つけ、当該白領域で区切られた領域単位にハフ変換による角度検出を行い、分割領域単位で検出した角度からスキュー角を算出することにより、他の領域との干渉を防ぎつつ分割領域個々の角度検出を行うことができ、さらに同一の角度が検出された領域を統合して検出角度を統合領域のスキュー角として検出することができ、その結果、画像全体のスキュー角をより正確に検出できるために、スキュー角の検出およびスキュー補正を高精度にて実現できる。 As described above, by finding a white area (white band) from the image, performing angle detection by Hough transform for each area segmented by the white area, and calculating a skew angle from the angle detected for each divided area , It is possible to detect the angle of each of the divided areas while preventing interference with other areas, furthermore, by integrating the areas where the same angle is detected, the detection angle can be detected as the skew angle of the integrated area, As a result, since the skew angle of the entire image can be detected more accurately, the detection of the skew angle and the skew correction can be realized with high accuracy.
例えば、図8に示すように、見開き原稿のように、左右ページで画像の傾き角度が異なる場合であっても、統合した領域ごとに、即ち左右ページの両画像ごとにスキュー角を求めるとともに、統合した領域を基に入力画像を分割し、各分割画像ごとスキュー補正を行うことにより、他のページとの干渉を防ぎつつページ個々の角度検出を行い、かつスキュー補正を行うことができるために、左右ページの両画像ごとにスキュー角の検出およびスキュー補正を高精度にて実現できる。 For example, as shown in FIG. 8, even when the image tilt angle is different between the left and right pages as in a spread document, the skew angle is obtained for each integrated region, that is, for both the left and right pages, By dividing the input image based on the integrated area and performing skew correction for each divided image, it is possible to detect the angle of each page and prevent skew correction while preventing interference with other pages. In addition, skew angle detection and skew correction can be realized with high accuracy for both the left and right page images.
10…画像データ入力部、20,20A,20B…画像処理装置(画像処理部)、30…画像データ出力部、21…CPU、22…I/O回路、23…ROM、24…RAM、25…HDD(ハードディスクドライブ)装置、26…バスライン、201,211…2値化部、202,212…白領域探索部、203,213…領域分割部、204,214…ハフ変換部、205,215…角度算出部、206…全体角度算出部、207,218…スキュー補正部、216…領域統合部、217…画像分離部、219…画像合成部
DESCRIPTION OF
Claims (4)
前記探索手段が探索した前記白領域を基準に前記入力画像を複数の領域に分割する領域分割手段と、
前記領域分割手段が分割した領域単位にハフ変換による角度検出を行う角度検出手段と、
前記角度検出手段が検出した領域単位の角度を基にスキュー角を求めるスキュー角算出手段と、
前記スキュー角算出手段が求めた前記スキュー角を基に前記入力画像に対するスキュー補正を行うスキュー補正手段と
を備えることを特徴とする画像処理装置。 Search means for searching for a white area in the input image;
Area dividing means for dividing the input image into a plurality of areas based on the white area searched by the search means;
Angle detection means for performing angle detection by Hough transform for each area divided by the area dividing means;
A skew angle calculating means for obtaining a skew angle based on an angle of a region unit detected by the angle detecting means;
An image processing apparatus comprising: a skew correction unit that performs skew correction on the input image based on the skew angle obtained by the skew angle calculation unit.
ことを特徴とする請求項1記載の画像処理装置。 The image processing according to claim 1, wherein the skew angle calculation unit calculates a skew angle of the entire image before the division by the region dividing unit based on the angle of the region unit detected by the angle detection unit. apparatus.
ことを特徴とする請求項1記載の画像処理装置。 The skew angle calculation means compares the angle of the area unit detected by the angle detection means between areas, and in the case of the same angle, the areas are integrated for each same angle and the same angle is integrated. The image processing apparatus according to claim 1, wherein a skew angle of the region is used.
前記探索ステップで探索した前記白領域を基準に前記入力画像を複数の領域に分割する領域分割ステップと、
前記領域分割ステップで分割した領域単位にハフ変換による角度検出を行う角度検出ステップと、
前記角度検出ステップで検出した領域単位の角度を基にスキュー角を求めるスキュー角算出ステップと、
前記スキュー角算出ステップで求めた前記スキュー角を基に前記入力画像に対するスキュー補正を行うスキュー補正ステップと
の各処理をコンピュータに実行させることを特徴とする画像処理プログラム。
A search step for searching for a white region in the input image;
A region dividing step of dividing the input image into a plurality of regions based on the white region searched in the searching step;
An angle detection step of performing angle detection by Hough transform on the region units divided in the region division step;
A skew angle calculating step for obtaining a skew angle based on the angle of the region unit detected in the angle detecting step;
An image processing program that causes a computer to execute each processing of a skew correction step of performing skew correction on the input image based on the skew angle obtained in the skew angle calculation step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006160462A JP2007328652A (en) | 2006-06-09 | 2006-06-09 | Image processing device and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006160462A JP2007328652A (en) | 2006-06-09 | 2006-06-09 | Image processing device and image processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007328652A true JP2007328652A (en) | 2007-12-20 |
Family
ID=38929061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006160462A Pending JP2007328652A (en) | 2006-06-09 | 2006-06-09 | Image processing device and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007328652A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140300790A1 (en) * | 2013-04-04 | 2014-10-09 | Fuji Xerox Co., Ltd. | Image processing apparatus, and non-transitory computer readable medium storing image processing program |
JP2017016443A (en) * | 2015-07-01 | 2017-01-19 | 日立オムロンターミナルソリューションズ株式会社 | Paper sheets identification apparatus, and paper sheets identification method |
-
2006
- 2006-06-09 JP JP2006160462A patent/JP2007328652A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140300790A1 (en) * | 2013-04-04 | 2014-10-09 | Fuji Xerox Co., Ltd. | Image processing apparatus, and non-transitory computer readable medium storing image processing program |
JP2017016443A (en) * | 2015-07-01 | 2017-01-19 | 日立オムロンターミナルソリューションズ株式会社 | Paper sheets identification apparatus, and paper sheets identification method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8331670B2 (en) | Method of detection document alteration by comparing characters using shape features of characters | |
EP1569170A1 (en) | Characteristic region extraction device, characteristic region extraction method, and characteristic region extraction program | |
US20100329576A1 (en) | Method for detecting alterations in printed document using image comparison analyses | |
US7969631B2 (en) | Image processing apparatus, image processing method and computer readable medium storing image processing program | |
JP2001358925A (en) | Unit and method for image processing and recording medium | |
US8538191B2 (en) | Image correction apparatus and method for eliminating lighting component | |
US8306335B2 (en) | Method of analyzing digital document images | |
EP2536123B1 (en) | Image processing method and image processing apparatus | |
US8064636B2 (en) | Image processing apparatus and method of controlling the same | |
JP4565396B2 (en) | Image processing apparatus and image processing program | |
US8139237B2 (en) | Image generating apparatus, image processing apparatus, recording medium and computer readable recording medium | |
JP2014107685A (en) | Image processing apparatus | |
US9392140B2 (en) | Image processing apparatus | |
JP2010056691A (en) | Device and method for processing image | |
US8254693B2 (en) | Image processing apparatus, image processing method and program | |
JP4275973B2 (en) | Retouched image extraction apparatus, program, storage medium, and retouched image extraction method | |
KR20150099116A (en) | Method for recognizing a color character using optical character recognition and apparatus thereof | |
CN115410191B (en) | Text image recognition method, device, equipment and storage medium | |
JP2010066865A (en) | Difference extraction device and difference extraction program | |
JP2007328652A (en) | Image processing device and image processing program | |
US11570331B2 (en) | Image processing apparatus, image processing method, and storage medium | |
KR100350854B1 (en) | System and method of rotating binary images | |
JP4253265B2 (en) | Shadow detection apparatus, shadow detection method and shadow detection program, image processing apparatus using shadow detection apparatus, image processing method using shadow detection method, and image processing program using shadow detection program | |
JPH08221512A (en) | Device and method for processing image | |
JP4552757B2 (en) | Image processing apparatus, image processing method, and image processing program |