JP4565396B2 - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP4565396B2
JP4565396B2 JP2006179008A JP2006179008A JP4565396B2 JP 4565396 B2 JP4565396 B2 JP 4565396B2 JP 2006179008 A JP2006179008 A JP 2006179008A JP 2006179008 A JP2006179008 A JP 2006179008A JP 4565396 B2 JP4565396 B2 JP 4565396B2
Authority
JP
Japan
Prior art keywords
unit
pixel group
angle detection
hough transform
angle
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.)
Active
Application number
JP2006179008A
Other languages
Japanese (ja)
Other versions
JP2008011135A (en
Inventor
俊哉 小山
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
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 Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2006179008A priority Critical patent/JP4565396B2/en
Publication of JP2008011135A publication Critical patent/JP2008011135A/en
Application granted granted Critical
Publication of JP4565396B2 publication Critical patent/JP4565396B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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 Patent Document 1, the following processing is performed when detecting the skew angle.

先ず、入力画像に対してフィルタリング処理を行い、当該フィルタリング処理によって濃淡差が強調された画像に対して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 Patent Document 1, after extracting coordinates having a frequency equal to or higher than a predetermined threshold in the Hough space, the number of extracted coordinates is integrated for each angle to generate a histogram, and the angle at which the frequency is maximum is obtained. A technique for estimating the skew angle of an image is also described.

特開平11−328408号公報JP 11-328408 A

しかしながら、上述した従来技術では、文書画像全体に対してハフ変換処理やヒストグラム生成処理を行う構成を採っているために、2値化画像にON画素(例えば、白を背景としたときの黒画素)の画素数が多いと、ハフ変換処理の際の演算処理に時間がかかることになるために、スキュー角検出の処理速度が遅くなるという問題がある。具体的には、ON画素数が少ない画像、例えば縮小画像の場合は、画像全体に対してハフ変換処理を行ってもスキュー角検出の処理速度へのインパクトがそれほど大きくないが、元解像度の画像の場合は、ON画素数が多く、演算処理に時間がかかるために、スキュー角検出の処理速度へのインパクトが大きい。   However, since the above-described conventional technology adopts a configuration in which the Hough conversion process and the histogram generation process are performed on the entire document image, ON pixels (for example, black pixels with a white background) are included in the binarized image. If the number of pixels is large, the calculation process during the Hough transform process takes time, and there is a problem that the processing speed of the skew angle detection becomes slow. Specifically, in the case of an image with a small number of ON pixels, for example, a reduced image, even if the Hough transform process is performed on the entire image, the impact on the processing speed of the skew angle detection is not so great, but the original resolution image In this case, since the number of ON pixels is large and the calculation process takes time, the impact on the processing speed of the skew angle detection is large.

また、画像全体に対してハフ変換処理を行うことにより、無用のON画素に対してもスキュー角検出の処理が行われることになるために、場合によっては、スキュー角の誤検出が発生することもある。   Also, by performing the Hough transform process on the entire image, the skew angle detection process is performed even on useless ON pixels. In some cases, an erroneous detection of the skew angle may occur. There is also.

スキュー角検出の処理速度を向上させるために、2値画像の輪郭を抽出することによってON画素数を減らし、輪郭画素の座標を基にスキュー角を検出する手法も考えられる。しかし、この手法を採ると、ON画素数が減ることによって演算の処理時間を短縮できるために、スキュー角検出の処理速度を向上できる反面、演算対象のON画素数が減ることによって検出精度が低下するという問題がある。   In order to improve the processing speed of the skew angle detection, a method of reducing the number of ON pixels by extracting the contour of the binary image and detecting the skew angle based on the coordinates of the contour pixel can be considered. However, if this method is adopted, the processing time of the calculation can be shortened by reducing the number of ON pixels, so that the processing speed of the skew angle detection can be improved, but the detection accuracy is reduced by reducing the number of ON pixels to be calculated. There is a problem of doing.

本発明は、上記課題に鑑みてなされたものであって、その目的とするところは、ハフ変換を用いた技術によってスキュー角を検出する処理において、検出精度を低下させることなく、スキュー角検出の処理速度の向上を可能にした画像処理装置および画像処理プログラムを提供することにある。   The present invention has been made in view of the above problems, and an object of the present invention is to perform skew angle detection without reducing detection accuracy in processing for detecting a skew angle by a technique using Hough transform. An object of the present invention is to provide an image processing apparatus and an image processing program capable of improving the processing speed.

上記目的を達成するために、本発明は、次のような構成を採っている。すなわち、入力画像を2値化した2値画像において連続する画素に対して同一ラベルを付与し、この同一ラベルが付与された連続画素群のうち、特徴量が所定基準を満たす連続画素群を特定画素群として抽出する。そして、この抽出した特定画素群に対してハフ変換による角度検出を行い、この検出した角度(スキュー角)を基に入力画像に対するスキュー補正を行うようにする。   In order to achieve the above object, the present invention adopts the following configuration. That is, the same label is assigned to consecutive pixels in the binary image obtained by binarizing the input image, and among the consecutive pixel groups to which the same label is assigned, the continuous pixel group whose feature amount satisfies a predetermined criterion is specified. Extract as a pixel group. Then, angle detection is performed on the extracted specific pixel group by Hough transform, and skew correction is performed on the input image based on the detected angle (skew angle).

スキュー角検出・補正を行う画像処理において、ハフ変換を用いた技術によって入力画像のスキュー角を検出するのに最もふさわしく、最も簡単で、最も精度が高い図形は、例えば、長い直線や細長い矩形、あるいは大きめの矩形である。そこで、特定画素群として抽出する所定基準を適宜設定することで、特定画素群として直線や細長い矩形、あるいは大きめの矩形などの図形を形成する連続画素群を抽出できる。そして、この抽出した特定画素群に対してハフ変換による角度検出を行ってスキュー角を検出することで、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形を形成する連続画素群に対してのみハフ変換処理が行われることになる。   In image processing that detects and corrects skew angle, the most suitable, simplest, and most accurate figure for detecting the skew angle of an input image using a technique using Hough transform is, for example, a long straight line, an elongated rectangle, Or it is a large rectangle. Therefore, by continuously setting a predetermined reference to be extracted as the specific pixel group, it is possible to extract a continuous pixel group that forms a figure such as a straight line, an elongated rectangle, or a large rectangle as the specific pixel group. The extracted specific pixel group is subjected to angle detection by Hough transform to detect a skew angle, and is a continuous pixel group that forms the most suitable, simplest, and most accurate figure for skew angle detection. The Hough transform process is performed only for.

また、上記目的を達成するために、本発明は、入力画像を2値化した2値画像の輪郭を示す画素を抽出し、この輪郭抽出した2値画像データに対するハフ変換処理によって前記入力画像の傾き角度を段階的に検出するとともに、多段階の角度検出処理の相互間において前段の角度検出処理でのハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での有用画素群を抽出して後段の角度検出処理に渡す。そして、最終段の角度検出処理で検出した角度(スキュー角)を基に入力画像に対するスキュー補正を行うようにする。   In order to achieve the above object, the present invention extracts a pixel indicating a contour of a binary image obtained by binarizing the input image, and performs a Hough transform process on the binary image data obtained by extracting the contour. The xy plane is detected based on one or more points that are frequently detected in the polar coordinate space by the Hough transform process in the angle detection process in the previous stage, while detecting the tilt angle in stages. The useful pixel group above is extracted and passed to the subsequent angle detection process. Then, the skew correction is performed on the input image based on the angle (skew angle) detected by the angle detection process at the final stage.

上記のスキュー角検出・補正処理において、輪郭抽出した2値画像データに対してハフ変換処理を実施後、ハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での有用画素群を抽出することで、当該有用画素群として直線や細長い矩形、あるいは大きめの矩形などの図形を形成する画素群を抽出できる。そして、この抽出した画素群に対してハフ変換による角度検出を行ってスキュー角を検出することで、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形を形成する画素群に対してのみハフ変換処理が行われることになる。   In the skew angle detection / correction process described above, after the Hough transform process is performed on the binary image data extracted from the contour, the xy plane is based on one or more points that are frequently used in the polar coordinate space by the Hough transform process. By extracting the above useful pixel group, it is possible to extract a pixel group that forms a figure such as a straight line, an elongated rectangle, or a large rectangle as the useful pixel group. Then, by detecting the skew angle by performing angle detection by the Hough transform on the extracted pixel group, the pixel group that forms the most suitable, simplest, and most accurate figure for the skew angle is detected. Only the Hough conversion process is performed.

本発明によれば、画像全体に対してではなく、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形を形成する連続画素群(特定画素群)に対してハフ変換処理を行うことで、スキュー角検出を高精度に行うことができ、また演算処理の対象となる画素数を最小限に抑えることができるために、演算時間を短縮できることによってスキュー角検出・補正の処理速度を向上できる。   According to the present invention, the Hough transform process is performed not on the entire image but on a continuous pixel group (specific pixel group) that forms the most suitable, simplest, and most accurate figure for detecting a skew angle. As a result, the skew angle can be detected with high accuracy, and the number of pixels subject to calculation processing can be minimized. It can be improved.

以下、本発明の実施の形態について図面を参照して詳細に説明する。   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 data input unit 10, an image processing unit 20, and an image data output unit 30.

画像データ入力部10は、イメージスキャナ等の画像読取装置からなり、文書原稿の画像を読み取ってその画像データを画像処理部20に入力する。なお、イメージスキャナ等の画像読取装置で読み取った画像データをサーバなどの記憶装置に一旦格納しておくシステム構成を採る場合には、サーバが画像データ入力部10として機能することになる。また、ファクシミリ装置にあっては、受信側のファクシミリ装置が画像データ入力部10として機能することになる。   The image data input unit 10 includes an image reading device such as an image scanner, reads an image of a document original, and inputs the image data to the image processing unit 20. In the case of adopting a system configuration in which image data read by an image reading device such as an image scanner is temporarily stored in a storage device such as a server, the server functions as the image data input unit 10. In the facsimile apparatus, the receiving facsimile apparatus functions as the image data input unit 10.

画像処理部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 data input unit 10, and based on the detected angle. In addition, skew correction is performed on the image data.

画像処理部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 / O circuit 22, a ROM 23, a RAM 24, an HDD (Hard Disk Drive) device 25, and the like, and these components are connected via a bus line 26. It is the structure connected so that mutual communication was possible.

CPU21は、演算処理を含む本画像処理部20全体の処理の制御を行う。I/O回路22は、画像データ入力部10および画像データ出力部30を含む周辺機器との入出力を管理する。ROM23は、CPU21による制御の下に実行される各種処理の処理プログラムを格納する。RAM24は、各種処理の実行時に使用される一次記憶装置である。HDD25は、CPU21による制御の下に処理された画像データや、外部から取り込んだ画像データなどを記憶する。   The CPU 21 controls processing of the entire image processing unit 20 including calculation processing. The I / O circuit 22 manages input / output with peripheral devices including the image data input unit 10 and the image data output unit 30. The ROM 23 stores processing programs for various processes executed under the control of the CPU 21. The RAM 24 is a primary storage device used when executing various processes. The HDD 25 stores image data processed under the control of the CPU 21 and image data captured from the outside.

画像データ出力部30は、画像処理部20でスキュー補正された画像データを、次段の例えば文字認識装置などの画像処理装置(図示せず)に対して出力する。なお、画像データ出力部30をプリンタやディスプレイ等の出力装置とその制御手段によって構成し、画像処理部20でスキュー補正された画像データに基づく画像を印刷(記録)紙に印刷出力したり、あるいは、表示画面上に表示出力したりすることも可能である。   The image data output unit 30 outputs the image data whose skew has been corrected by the image processing unit 20 to an image processing device (not shown) such as a character recognition device in the next stage. The image data output unit 30 includes an output device such as a printer or a display and its control means, and prints out an image based on the image data skew-corrected by the image processing unit 20 on printing (recording) paper, or It is also possible to display on the display screen.

[第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、座標抽出部204,ハフ(Hough)変換部205、角度算出部206およびスキュー補正部207を有する構成となっている。   As shown in FIG. 2, the image processing apparatus 20A according to the present embodiment includes a binarization unit 201, a labeling unit 202, a specific pixel group extraction unit 203, a coordinate extraction unit 204, a Hough conversion unit 205, and an angle calculation. The configuration includes a unit 206 and a skew correction unit 207.

2値化部201は、図1の画像データ入力部10から入力される、濃淡が複数ビットで表されている画像データを、入力画像中に含まれる例えば文字や線、絵柄や写真などの前景に属する画素を画素値が論理「1」のON画素(例えば、黒画素)、背景領域に属する画素を画素値が論理「0」のOFF画素(例えば、白画素)とした各画素値が1ビットの2値画像データに2値化してラベリング部202に供給する。   The binarization unit 201 converts the image data input from the image data input unit 10 in FIG. 1 and representing the shading with a plurality of bits into foregrounds such as characters, lines, patterns, and photographs included in the input image. Each pixel value is 1 when the pixel belonging to is an ON pixel (for example, a black pixel) with a logical value of “1” and the pixel belonging to the background area is an OFF pixel (for example, a white pixel) with a logical value of “0”. The image is binarized into bit binary image data and supplied to the labeling unit 202.

ラベリング部202は、2値化部201で2値化された2値画像(データ)において連続する画素(具体的には、ON画素)に対して同一ラベルを付与するラベリング処理を実行する。以下、同一ラベルが付与された連続する画素の集合を連続画素群と言う。   The labeling unit 202 executes a labeling process for assigning the same label to consecutive pixels (specifically, ON pixels) in the binary image (data) binarized by the binarization unit 201. Hereinafter, a set of continuous pixels assigned the same label is referred to as a continuous pixel group.

特定画素群抽出部203は、ラベリング部202でのラベリング処理によって同一ラベルが付与された連続画素群において、その特徴量が所定基準を満たす連続画素群については特定画素群として抽出する。ここに、連続画素群の特徴量は、当該連続画素群の外接矩形サイズ(縦・横の長さや縦横比)や連続画素群の画素数などである。   The specific pixel group extraction unit 203 extracts, as the specific pixel group, a continuous pixel group whose feature amount satisfies a predetermined criterion in the continuous pixel group to which the same label is given by the labeling process in the labeling unit 202. Here, the feature amount of the continuous pixel group is a circumscribed rectangle size (vertical / horizontal length and aspect ratio) of the continuous pixel group, the number of pixels of the continuous pixel group, and the like.

特定画素群抽出部203における特定画素群の抽出手法としては、次のような手法が考えられる。ただし、これらは一例に過ぎず、これらに限定されるものではない。   As a specific pixel group extraction method in the specific pixel group extraction unit 203, the following method can be considered. However, these are merely examples, and the present invention is not limited to these.

手法1:連続画素群の外接矩形のサイズ(縦・横の長さや矩形面積)が予め決められた所定サイズ以上の連続画素群を特定画素群として抽出する。
手法2:連続画素群の外接矩形の中でサイズ(縦・横の長さや矩形面積)が一番大きい連続画素群を特定画素群として抽出する。
手法3:連続画素群の画素数が予め決められた範囲(以上なども含む)の連続画素群を特定画素群として抽出する。
手法4:連続画素群の中で画素数が最も多い連続画素群を特定画素群として抽出する。
Method 1: A continuous pixel group having a size of a circumscribed rectangle of the continuous pixel group (vertical / horizontal length and rectangular area) having a predetermined size or more is extracted as a specific pixel group.
Method 2: A continuous pixel group having the largest size (vertical / horizontal length and rectangular area) is extracted as a specific pixel group among circumscribed rectangles of the continuous pixel group.
Method 3: A continuous pixel group having a predetermined number of pixels (including the above) is extracted as a specific pixel group.
Method 4: The continuous pixel group having the largest number of pixels among the continuous pixel groups is extracted as the specific pixel group.

手法5:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより直線性を算出し、その直線性が予め決められた基準を満たす連続画素群を特定画素群として抽出する。
手法6:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより直線性を算出し、最も直線性が高い連続画素群を特定画素群として抽出する。
手法7:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより直線性を算出し、最も直線性が高く、かつ、その直線性が予め決められた基準を満たす連続画素群を特定画素群として抽出する。
Method 5: A linear pixel is calculated from the size (vertical / horizontal length and aspect ratio) of the circumscribed rectangle of the continuous pixel group and the number of pixels of the continuous pixel group, and the linear pixel satisfies the predetermined criterion. Are extracted as a specific pixel group.
Method 6: The linearity is calculated from the size (vertical / horizontal length and aspect ratio) of the circumscribed rectangle of the continuous pixel group and the number of pixels of the continuous pixel group, and the continuous pixel group having the highest linearity is extracted as the specific pixel group To do.
Method 7: The linearity is calculated from the size (vertical / horizontal length and aspect ratio) of the circumscribed rectangle of the continuous pixel group and the number of pixels of the continuous pixel group, and the linearity is the highest and the linearity is determined in advance. A continuous pixel group that satisfies the specified criteria is extracted as a specific pixel group.

手法8:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより長方形度を算出し、その長方形度が予め決められた基準を満たす連続画素群を特定画素群として抽出する。
手法9:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより長方形度を算出し、最も長方形度が高い連続画素群を特定画素群として抽出する。
手法10:連続画素群の外接矩形のサイズ(縦・横の長さや縦横比)と連続画素群の画素数とより長方形度を算出し、最も長方形度が高く、かつ、その長方形度が予め決められた基準を満たす連続画素群を特定画素群として抽出する。
Method 8: A rectangular pixel is calculated from the size (vertical / horizontal length and aspect ratio) of the circumscribed rectangle of the continuous pixel group and the number of pixels in the continuous pixel group, and the continuous pixel group satisfies the predetermined criterion. Are extracted as a specific pixel group.
Method 9: Calculate the rectangularity from the size (vertical / horizontal length and aspect ratio) of the circumscribed rectangle of the continuous pixel group and the number of pixels of the continuous pixel group, and extract the continuous pixel group having the highest rectangularity as the specific pixel group To do.
Method 10: The rectangularity is calculated from the size of the circumscribed rectangle of the continuous pixel group (vertical / horizontal length and aspect ratio) and the number of pixels of the continuous pixel group, and the rectangularity is the highest and the rectangularity is determined in advance. A continuous pixel group that satisfies the specified criteria is extracted as a specific pixel group.

このような各種手法を用いて特定画素群の抽出を行うことにより、特定画素群として、ハフ変換を用いた技術によって入力画像のスキュー角を検出するのに最もふさわしく、最も簡単で、最も精度が高い図形、例えば直線や細長い矩形、あるいは大きめの矩形を形成する連続画素群を抽出することができる。   By extracting a specific pixel group using such various methods, it is most suitable, simplest, and most accurate to detect the skew angle of the input image by a technique using Hough transform as the specific pixel group. It is possible to extract a continuous pixel group that forms a high figure, for example, a straight line, an elongated rectangle, or a large rectangle.

一例として、CAD(Computer Aided Design)で作成した図面など、線と文字が混在する文書画像の場合を例に挙げると、当該文書画像に対して例えば上記手法7を用いて特定画素群の抽出を行うことにより、線と文字が混在する文書画像から直線のみを抽出することができる。直線は、後述するハフ変換の原理から明らかなように、ハフ変換を用いた技術によって入力画像のスキュー角を検出するのに最もふさわしく、最も簡単で、最も精度が高い図形といえる。   As an example, in the case of a document image in which lines and characters are mixed, such as a drawing created by CAD (Computer Aided Design), extraction of a specific pixel group is performed on the document image using the method 7 described above, for example. By doing so, it is possible to extract only a straight line from a document image in which lines and characters are mixed. As is apparent from the principle of the Hough transform described later, the straight line can be said to be the most suitable, simplest and most accurate figure for detecting the skew angle of the input image by the technique using the Hough transform.

なお、特定画素群抽出部203における特定画素群において、図形の包含関係より、抽出された特定画素群(図形)に包含される特定画素群については、抽出の対象から除外するようにする。   In the specific pixel group in the specific pixel group extraction unit 203, the specific pixel group included in the extracted specific pixel group (graphic) is excluded from the extraction target due to the graphic inclusion relationship.

座標抽出部204は、特定画素群抽出部203によって特定画素群として抽出された連続画素群の各ON画素の座標を抽出する。   The coordinate extraction unit 204 extracts the coordinates of each ON pixel of the continuous pixel group extracted as the specific pixel group by the specific pixel group extraction unit 203.

ハフ変換部205は、座標抽出部204で座標抽出された連続画素群に対して周知のハフ変換処理を行う。ここで、ハフ変換処理について説明する。x−y座標上における点(x、y)を通る直線に対し、原点からこの直線に垂線をおろし、その長さをρ、垂線がx軸とのなす角度をθとすると、前記直線はρ−θ座標上(極座標上)で、
ρ=xcosθ+ysinθ
を満たす、点(ρ、θ)に変換される。
The Hough conversion unit 205 performs a well-known Hough conversion process on the continuous pixel group whose coordinates have been extracted by the coordinate extraction unit 204. Here, the Hough conversion process will be described. With respect to a straight line passing through the point (x, y) on the xy coordinates, if a perpendicular is drawn from the origin to this straight line, the length is ρ, and the angle between the perpendicular and the x axis is θ, the straight line is ρ On the -θ coordinate (on the polar coordinate),
ρ = x cos θ + ysin θ
Is converted into a point (ρ, θ) that satisfies

そして、x−y座標上における点は複数の直線の集まり(交点)と考えると、x−y座標上における点(x、y)は、ρ−θ座標上(極座標上)では、
ρ=xcosθ+ysinθ(0≦θ<π)
なる曲線の式で表すことができる。この曲線がハフ曲線であり、このハフ曲線を求める処理がハフ変換である。すなわち、直線上にある複数の点に対しハフ変換処理をおこない、ρ−θ座標上(極座標上)にハフ曲線を描いていくと、それらのハフ曲線は1点で交わることになる。
When the point on the xy coordinate is considered as a collection (intersection) of a plurality of straight lines, the point (x, y) on the xy coordinate is on the ρ-θ coordinate (on the polar coordinate).
ρ = x cos θ + ysin θ (0 ≦ θ <π)
It can be expressed by the following curve formula. This curve is a Hough curve, and the process for obtaining this Hough curve is the Hough transform. That is, when a Hough transformation process is performed on a plurality of points on a straight line and a Hough curve is drawn on the ρ-θ coordinates (on the polar coordinates), these Hough curves intersect at one point.

これを利用し、座標抽出部204によって抽出された全てのON画素の座標に対して、1つの座標ごとに上記式の角度θを0〜πまで順次変化させ、この角度θの変化に対応して得られる距離ρをρ−θ座標上にプロットしていくと、多くの曲線が交わる点、すなわちプロットされた頻度の多い点が複数存在し、この点を算出すると、画像上に存在した直線を見つけることが可能となる。そしてこの直線の傾きが、画像の傾きと考えることができる。   Using this, the angle θ of the above equation is sequentially changed from 0 to π for each coordinate of all the ON pixel coordinates extracted by the coordinate extraction unit 204, and this change in the angle θ is dealt with. If the distance ρ obtained in this way is plotted on the ρ-θ coordinate, there will be a number of points where many curves intersect, that is, a number of frequently plotted points. Can be found. The inclination of this straight line can be considered as the inclination of the image.

なお、ハフ変換処理については、必ずしも、座標抽出された連続画素群の全ON画素に対して行う必要はない。すなわち、ハフ変換部205の前段に間引き処理回路を設けて、連続画素群のON画素を適当な比率で間引き処理を行い、残ったON画素に対してハフ変換処理を行うようにすることも可能である。間引き処理は、座標抽出処理の前処理として行うことも可能である。   Note that the Hough conversion process does not necessarily have to be performed on all the ON pixels of the continuous pixel group whose coordinates have been extracted. In other words, it is possible to provide a thinning processing circuit in the previous stage of the Hough conversion unit 205 so that the ON pixels of the continuous pixel group are thinned out at an appropriate ratio and the remaining ON pixels are subjected to the Hough conversion processing. It is. The thinning-out process can also be performed as a pre-process of the coordinate extraction process.

角度算出部206は、ハフ変換部205によるハフ変換の結果を基に、連続画素群(特定画素群)によって形成される図形(外接矩形/直線)の傾き角度を入力画像のスキュー角として算出する。具体的には、角度算出部206は、ハフ変換部205においてハフ変換されたρ−θ座標上において頻度の多い座標(ρ、θ)のθを参照して角度を求め、この角度をx−y平面における画像のスキュー角として算出する。この角度算出部206はハフ変換部205と共に、特許請求の範囲の角度検出手段を構成している。   The angle calculation unit 206 calculates the inclination angle of the figure (circumscribed rectangle / straight line) formed by the continuous pixel group (specific pixel group) as the skew angle of the input image based on the result of the Hough conversion by the Hough conversion unit 205. . Specifically, the angle calculation unit 206 obtains an angle with reference to θ of coordinates (ρ, θ) having a high frequency on the ρ-θ coordinate subjected to the Hough transform by the Hough transform unit 205, and calculates the angle as x−. Calculated as the skew angle of the image in the y plane. The angle calculation unit 206, together with the Hough conversion unit 205, constitutes the angle detection means in the claims.

スキュー補正部207は、角度算出部206で算出された入力画像のスキュー角を基に、当該スキュー角がゼロになるように入力画像を回転させることによってスキュー補正を行う。画像を回転させる手法としては、例えば、アフィン(Affine)変換などの周知の手法を用いることができる。   Based on the skew angle of the input image calculated by the angle calculation unit 206, the skew correction unit 207 performs skew correction by rotating the input image so that the skew angle becomes zero. As a method for rotating the image, for example, a known method such as affine transformation can be used.

上記構成の画像処理装置20Aの構成要素、即ち2値化部201、ラベリング部202、特定画素群抽出部203、座標抽出部204,ハフ変換部205、角度算出部206およびスキュー補正部207については、PC(パーソナルコンピュータ)のように、所定プログラムを実行することによって情報記憶処理、画像処理、演算処理等の各機能を実行するコンピュータ機器を利用してソフトウェア構成によって実現することが考えられる。   Regarding the components of the image processing apparatus 20A configured as described above, that is, the binarization unit 201, the labeling unit 202, the specific pixel group extraction unit 203, the coordinate extraction unit 204, the Hough transform unit 205, the angle calculation unit 206, and the skew correction unit 207. It may be realized by a software configuration using a computer device such as a PC (Personal Computer) that executes each function such as information storage processing, image processing, and arithmetic processing by executing a predetermined program.

ただし、ソフトウェア構成による実現に限られるものではなく、ハードウェア構成、あるいはハードウェアとソフトウェアの複合構成によって実現することも可能である。ソフトウェア構成によって実現する場合、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, there is a program that causes a computer to function as the binarization unit 201, the labeling unit 202, the specific pixel group extraction unit 203, the coordinate extraction unit 204, the Hough conversion unit 205, the angle calculation unit 206, and the skew correction unit 207. An image processing program according to the present invention is provided.

また、以下に説明する画像処理シーケンスにおける各ステップの処理を実行するプログラムが、本発明による画像処理プログラムであるとも言える。そして、これらの画像処理プログラムについては、あらかじめコンピュータ内にインストールしておくことが考えられる。ただし、あらかじめインストールされているのではなく、コンピュータ読み取り可能な記憶媒体に格納されて提供されるものであっても良く、または有線若しくは無線による通信手段を介して配信されるものであっても良い。   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実施形態に係るスキュー角検出・補正処理の手順の一例について、図3のフローチャートを用いて説明する。
(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値化画像(データ)において連続するON画素に対して同一ラベルを付与するラベリング処理を行う(ステップS13)。ここで、同一ラベルが付与された連続する画素の集合が連続画素群となる。   First, input image data is captured (step S11), and then the captured image data is binarized to generate binary image data (step S12). Next, continuous ON pixels in the binarized image (data). A labeling process for assigning the same label is performed (step S13). Here, a set of continuous pixels to which the same label is assigned becomes a continuous pixel group.

次に、先述した手法1〜10などの手法を用いて、同一ラベルが付与された連続画素群のうち、連続画素群の外接矩形サイズ(縦・横の長さや縦横比)や連続画素群の画素数等の特徴量が所定基準を満たす連続画素群を特定画素群として抽出し(ステップS14)、次いで特定画素群として抽出した連続画素群の各ON画素の座標を抽出する(ステップS15)。   Next, among the continuous pixel groups to which the same label is assigned using the above-described methods 1 to 10 and the like, the circumscribed rectangle size (vertical / horizontal length and aspect ratio) of the continuous pixel group and the continuous pixel group A continuous pixel group whose feature quantity such as the number of pixels satisfies a predetermined criterion is extracted as a specific pixel group (step S14), and then the coordinates of each ON pixel of the continuous pixel group extracted as the specific pixel group are extracted (step S15).

次に、座標抽出した連続画素群に対してハフ変換処理を行い(ステップS16)、次いで、ハフ変換結果を基に連続画素群(特定画素群)によって形成される図形(外接矩形/直線)の傾き角度を入力画像のスキュー角として算出する(ステップS17)。そして、算出したスキュー角を基に入力画像を回転させることによってスキュー補正を行い(ステップS18)、一連のスキュー角検出・補正処理を終了する。   Next, the Hough transform process is performed on the coordinate-extracted continuous pixel group (step S16), and then the figure (circumscribed rectangle / straight line) formed by the continuous pixel group (specific pixel group) based on the Hough transform result. The tilt angle is calculated as the skew angle of the input image (step S17). Then, the skew correction is performed by rotating the input image based on the calculated skew angle (step S18), and the series of skew angle detection / correction processing ends.

ところで、スキュー角検出・補正を行う画像処理において、ハフ変換を用いた技術によって入力画像のスキュー角を検出するのに最もふさわしく、最も簡単で、最も精度が高い図形は、先述したハフ変換の原理からも明らかなように、例えば長い直線や細長い矩形、あるいは大きめの矩形などの図形であると言える。   By the way, in image processing that detects and corrects skew angle, the most suitable, simplest, and most accurate figure for detecting the skew angle of the input image by the technique using Hough transform is the principle of Hough transform described above. As can be seen from the figure, it can be said to be a figure such as a long straight line, a long and narrow rectangle, or a large rectangle.

そこで、上述したように、2値化画像において連続する画素に対して同一ラベルを付与して連続画素群とし、複数の連続画素群のうち、特徴量が所定基準を満たす連続画素群を特定画素群として抽出することにより、スキュー角検出に有用な連続画素群、例えば、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形、具体的には長い直線や細長い矩形、あるいは大きめの矩形などの図形を形成する画素群を抽出できる。そして、この抽出した特定画素群のみを用いてハフ変換によるスキュー角検出を行うことにより、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形を形成する連続画素群に対してのみハフ変換処理が行われることになるために、スキュー角の検出精度を高めることができる。   Therefore, as described above, the same label is assigned to consecutive pixels in the binarized image to form a continuous pixel group, and among the plurality of continuous pixel groups, a continuous pixel group whose feature amount satisfies a predetermined criterion is specified pixel. By extracting as a group, continuous pixel groups useful for skew angle detection, for example, the most suitable, simplest and most accurate figure for skew angle detection, specifically long straight lines, elongated rectangles, or larger A pixel group forming a figure such as a rectangle can be extracted. Then, by performing skew angle detection by Hough transform using only the extracted specific pixel group, only the continuous pixel group that forms the most suitable, simplest, and most accurate figure for skew angle detection is used. Since the Hough transform process is performed, the accuracy of detecting the skew angle can be increased.

また、入力画像全体に対してハフ変換処理を行うのではなく、スキュー角検出に有用な連続画素群のみを特定画素群として抽出してハフ変換処理を行うことにより、スキュー角検出に有効に寄与しない文字や、短い直線、小さい矩形等の図形を演算処理の対象から除外することができるために、ハフ変換での演算処理の対象となる画素数を最小限に抑えることができる。その結果、ハフ変換での演算処理にかかる時間を短縮できるために、スキュー角を検出し、また当該スキュー角に基づいてスキュー補正する一連の処理の処理速度を向上できる。   In addition, instead of performing the Hough transform process on the entire input image, only the continuous pixel group useful for skew angle detection is extracted as a specific pixel group, and the Hough transform process is performed to effectively contribute to the skew angle detection. Since characters such as non-performing characters, short straight lines, small rectangles and the like can be excluded from the calculation processing target, the number of pixels to be subjected to the calculation processing in the Hough transform can be minimized. As a result, it is possible to reduce the time required for the arithmetic processing in the Hough transform, so that the processing speed of a series of processes for detecting the skew angle and correcting the skew based on the skew angle can be improved.

[第2実施形態]
図4は、本発明の第2実施形態に係る画像処理装置(画像処理部)20Bの機能構成例を示すブロック図である。
[Second Embodiment]
FIG. 4 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.

図4に示すように、本実施形態に係る画像処理装置20Bは、グレイ(Gray)変換部211、2値化部212、輪郭抽出部213、縮小部214、概略角度検出部215、頻度多点抽出部216、逆ハフ変換部217、拡大部218、膨張部219、論理積部220、ラベリング部221、所定特徴ラベル抽出部222、詳細角度検出部223およびスキュー補正部224を有する構成となっている。   As shown in FIG. 4, the image processing apparatus 20B according to the present embodiment includes a gray conversion unit 211, a binarization unit 212, a contour extraction unit 213, a reduction unit 214, an approximate angle detection unit 215, and a frequency multipoint. The configuration includes an extraction unit 216, an inverse Hough transform unit 217, an enlargement unit 218, an expansion unit 219, a logical product unit 220, a labeling unit 221, a predetermined feature label extraction unit 222, a detailed angle detection unit 223, and a skew correction unit 224. Yes.

グレイ変換部211は、入力画像がカラー画像の場合、例えば24ビットの画像データを例えば8ビットの画像データに変換する。2値化部212は、グレイ変換部211でグレイ変換された8ビットの画像データを、入力画像中に含まれる例えば文字や線、絵柄や写真などの前景に属する画素を画素値が論理「1」のON画素(例えば、黒画素)、背景領域に属する画素を画素値が論理「0」のOFF画素(例えば、白画素)とした各画素値が1ビットの2値画像データに2値化する。   When the input image is a color image, the gray conversion unit 211 converts, for example, 24-bit image data into, for example, 8-bit image data. The binarization unit 212 converts the 8-bit image data gray-converted by the gray conversion unit 211 into pixels belonging to the foreground, such as characters, lines, pictures, and photographs, included in the input image, with a logical value “1”. ”ON pixels (for example, black pixels), pixels that belong to the background area are set to OFF pixels (for example, white pixels) whose pixel value is logic“ 0 ”, and each pixel value is binarized into 1-bit binary image data To do.

輪郭抽出部213は、2値化部212で2値化された2値画像データのうち、ON画素で構成される領域の輪郭を示す画素を抽出し、ON画素で構成される領域の輪郭を示す輪郭2値画像データを生成する。   The contour extraction unit 213 extracts pixels indicating the contour of the region composed of ON pixels from the binary image data binarized by the binarization unit 212, and extracts the contour of the region composed of ON pixels. Contour binary image data to be shown is generated.

具体的には、例えば図5に示すように、注目画素を“X”とし、その周囲8画素を“A”〜“H”とすると、輪郭抽出部213は、注目画素“X”がOFF画素である場合、注目画素“X”はON画素で構成される領域の輪郭を示す画素では無いと判断する。注目画素“X”がON画素であり、かつ、周囲8画素“A”〜“H”の全てがON画素である場合も、注目画素“X”はON画素で構成される領域の輪郭を示す画素では無いと判断する。一方、注目画素“X”がON画素であり、周囲8画素“A”〜“H”のいずれかがOFF画素である場合、注目画素はON画素で構成される領域の輪郭を示す画素であると判断する。   Specifically, for example, as illustrated in FIG. 5, when the target pixel is “X” and the surrounding eight pixels are “A” to “H”, the contour extracting unit 213 determines that the target pixel “X” is an OFF pixel. In this case, it is determined that the target pixel “X” is not a pixel indicating the outline of the region formed by the ON pixels. Even when the target pixel “X” is an ON pixel and all of the surrounding eight pixels “A” to “H” are ON pixels, the target pixel “X” indicates the contour of the region composed of the ON pixels. Judge that it is not a pixel. On the other hand, when the pixel of interest “X” is an ON pixel and any of the surrounding 8 pixels “A” to “H” is an OFF pixel, the pixel of interest is a pixel indicating the outline of a region composed of ON pixels. Judge.

縮小部214は、輪郭抽出部213で輪郭抽出された輪郭2値画像データに対して、画像を例えば1/2に縮小する処理を行う。ここで入力画像に対して縮小処理を行うのは、次段の概略角度検出部215においてスキュー角を概略的に検出する際の処理速度を高めるためである。また、スキュー角を概略的に検出する場合は、入力画像を縮小した方が検出精度を高めることができる利点がある。   The reduction unit 214 performs a process of reducing the image to 1/2, for example, with respect to the contour binary image data extracted by the contour extraction unit 213. The reason why the reduction process is performed on the input image is to increase the processing speed when the skew angle is roughly detected in the next-stage approximate angle detection unit 215. In addition, when the skew angle is roughly detected, there is an advantage that the detection accuracy can be improved by reducing the input image.

概略角度検出部215は、座標抽出部2151、ハフ変換部2152および角度算出部2153によって検出され、縮小部214での縮小処理後の輪郭2値画像データに基づいて入力画像のスキュー角を概略的に、具体的には例えば数度を単位として検出する。   The approximate angle detection unit 215 is configured to roughly detect the skew angle of the input image based on the contour binary image data detected by the coordinate extraction unit 2151, the Hough transform unit 2152, and the angle calculation unit 2153 and subjected to the reduction process by the reduction unit 214. Specifically, for example, detection is performed in units of several degrees.

この概略角度検出部215において、座標抽出部2151は、縮小処理後の輪郭2値画像データに基づく縮小輪郭画像の各ON画素の座標を抽出する。ハフ変換部2152は、座標抽出部2151で座標抽出された輪郭画素群に対して周知のハフ変換処理を行って極座標(ρ−θ)に変換(投票)する。角度算出部2153は、ハフ変換部2152によるハフ変換の結果を基に、輪郭画素群によって形成される図形の傾き角度を入力画像の概略スキュー角として算出する。具体的には、角度算出部2153は、ハフ変換部2152においてハフ変換結果に基づきx−y平面における直線の傾き角度を入力画像のスキュー角として算出する。   In the approximate angle detection unit 215, the coordinate extraction unit 2151 extracts the coordinates of each ON pixel of the reduced contour image based on the contour binary image data after the reduction process. The Hough transform unit 2152 performs a well-known Hough transform process on the contour pixel group whose coordinates have been extracted by the coordinate extraction unit 2151 to convert (vote) it into polar coordinates (ρ−θ). The angle calculation unit 2153 calculates the inclination angle of the figure formed by the outline pixel group as the approximate skew angle of the input image based on the result of the Hough conversion by the Hough conversion unit 2152. Specifically, the angle calculation unit 2153 calculates the inclination angle of the straight line in the xy plane as the skew angle of the input image based on the Hough conversion result in the Hough conversion unit 2152.

頻度多点抽出部216は、ハフ変換部2152でのハフ変換によって得た極座標(ρ−θ)空間中で頻度(投票数)の多い1つ以上の点(ポイント)を抽出する。逆ハフ変換部217は、頻度多点抽出部216で抽出された頻度の多い1つ以上の点に対して逆ハフ変換処理を行うことにより、極座標空間の点をx−y平面上に戻す。極座標空間中の点をx−y平面上に戻せば直線となる。   The frequency multipoint extraction unit 216 extracts one or more points (points) having a high frequency (number of votes) in the polar coordinate (ρ−θ) space obtained by the Hough transform in the Hough transform unit 2152. The inverse Hough transform unit 217 returns the points in the polar coordinate space to the xy plane by performing an inverse Hough transform process on one or more frequently extracted points extracted by the frequent multipoint extraction unit 216. If a point in the polar coordinate space is returned to the xy plane, a straight line is obtained.

すなわち、極座標空間中で頻度の多い点を抽出し、この抽出した点に対して逆ハフ変換をかけてx−y平面上に戻すことにより、スキュー角検出に有用な(スキュー角検出に適した)画素群候補を抽出することができる。ここに、スキュー角検出に有用な画素群候補とは、直線性が高くかつ画素数の多い画素群、具体的には長い直線や細長い矩形などの図形を形成する画素群(画素の集合)のことである。   That is, by extracting a point having a high frequency in the polar coordinate space, and applying the inverse Hough transform to the extracted point and returning it to the xy plane, it is useful for skew angle detection (suitable for skew angle detection). ) Pixel group candidates can be extracted. Here, the pixel group candidate useful for skew angle detection is a pixel group having a high linearity and a large number of pixels, specifically, a pixel group (a set of pixels) that forms a figure such as a long straight line or an elongated rectangle. That is.

なお、ここでは、極座標空間中で頻度(投票数)の多い1つ以上のポイント(ρ,θ)を抽出し、この抽出したポイントに対して逆ハフ変換をかけてx−y平面上に戻すことによってスキャン角検出に有用な画素群、例えば直線を求めるとしたが、逆ハフ変換処理を用いるのではなく、頻度の多い1つ以上のポイント(ρ,θ)からx−y平面上での直線を求めるようにすることも可能である。   Here, one or more points (ρ, θ) with a high frequency (the number of votes) are extracted in the polar coordinate space, and the extracted points are subjected to inverse Hough transform and returned to the xy plane. Thus, a pixel group useful for scan angle detection, such as a straight line, is obtained, but instead of using an inverse Hough transform process, one or more frequent points (ρ, θ) are used on the xy plane. It is also possible to obtain a straight line.

拡大部218は、逆ハフ変換部217で逆ハフ変換された2値画像データに対して、元の画像サイズ、即ち縮小部214で1/2に縮小する前の画像サイズに戻すために、2倍に拡大する処理を行う。   In order to return the binary image data subjected to the inverse Hough transform by the inverse Hough transform unit 217 to the original image size, that is, the image size before being reduced to ½ by the reduction unit 214, the enlargement unit 218 Performs the process of enlarging to double.

膨張部219は、拡大部218で拡大処理された2値画像データに基づく画像のON画素に対して膨張処理を行う。具体的には、例えば図5に示すように、注目画素を“X”とし、その周囲8画素を“A”〜“H”とした場合、膨張部219は、注目画素“X”およびその周囲8画素“A”〜“H”のうち、一つでもON画素があれば、注目画素“X”をON画素とし、注目画素“X”およびその周囲8画素“A”〜“H”の全てがOFF画素であれば、注目画素“X”をOFF画素とする。   The expansion unit 219 performs expansion processing on the ON pixels of the image based on the binary image data expanded by the expansion unit 218. Specifically, for example, as illustrated in FIG. 5, when the target pixel is “X” and the surrounding eight pixels are “A” to “H”, the expansion unit 219 determines that the target pixel “X” and its surroundings If there is at least one ON pixel among the eight pixels “A” to “H”, the target pixel “X” is set as the ON pixel, and all of the target pixel “X” and the surrounding eight pixels “A” to “H” If is an OFF pixel, the target pixel “X” is set as an OFF pixel.

なお、この膨張処理は、注目画素“X”と、その周囲8画素を“A”〜“H”に着目して膨張処理を行う態様に限定されるものではなく、例えば、注目画素“X”を中心とする5×5画素の領域、あるいは、さらに大きな領域に着目して膨張処理を行うようにしても良いのは勿論である。   This expansion process is not limited to a mode in which the expansion process is performed by focusing attention on “A” to “H” for the pixel of interest “X” and the surrounding eight pixels. For example, the pixel of interest “X” Of course, the dilation processing may be performed by paying attention to a 5 × 5 pixel area centering on the pixel or a larger area.

論理積部220は、輪郭抽出部213で輪郭抽出された2値画像データと、膨張部219で膨張処理された2値画像データとの論理積をとる。このようにして、輪郭抽出後の2値画像データと膨張処理後の2値画像データとの論理積をとることにより、ハフ変換や逆ハフ変換などの演算処理における演算誤差に起因する直線の傾き誤差を排除して、本来の画像上にある直線の傾きを持ったx−y平面上の直線の2値画像データとして取り出すことができる。   The logical product unit 220 performs a logical product of the binary image data extracted by the contour extraction unit 213 and the binary image data expanded by the expansion unit 219. In this way, by taking the logical product of the binary image data after the contour extraction and the binary image data after the expansion process, the slope of the straight line caused by the calculation error in the calculation process such as the Hough transform or the inverse Hough transform The error can be eliminated, and it can be taken out as binary image data of a straight line on the xy plane having a straight line inclination on the original image.

頻度多点抽出部216、逆ハフ変換部217、拡大部218、膨張部219および論理積部220は、特許請求の範囲の有用画素群抽出手段に相当し、概略角度検出部215でのハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での画素群を抽出して詳細角度検出部223に渡す作用をなす。   The frequency multipoint extraction unit 216, the inverse Hough transform unit 217, the enlargement unit 218, the expansion unit 219, and the logical product unit 220 correspond to useful pixel group extraction means in the claims, and the Hough transform in the approximate angle detection unit 215. The pixel group on the xy plane is extracted on the basis of one or more points having a high frequency in the polar coordinate space by processing, and the detailed angle detection unit 223 is passed to the pixel group.

ラベリング部221は、論理積部220から出力される2値画像データに対して、当該2値画像データに基づく画像において連続するON画素に対して同一ラベルを付与するラベリング処理を実行する。所定特徴ラベル抽出部222は、ラベリング部221でのラベリング処理によって同一ラベルが付与された連続画素群において、その特徴量が所定基準を満たす連続画素群を、詳細角度検出部223での詳細スキュー角の検出に用いる連続画素群、例えば長い直線を表す連続画素群として抽出する。   The labeling unit 221 executes a labeling process for assigning the same label to the continuous ON pixels in the image based on the binary image data for the binary image data output from the logical product unit 220. The predetermined feature label extracting unit 222 selects a continuous pixel group whose feature amount satisfies a predetermined standard in the continuous pixel group to which the same label is given by the labeling process in the labeling unit 221, and the detailed skew angle in the detailed angle detection unit 223. For example, a continuous pixel group representing a long straight line.

このようにして、論理積部220から出力される2値画像データに対してラベリング処理を行い、かつ特徴量が所定基準を満たす連続画素群を抽出する処理を行うことにより、詳細スキュー角の検出に有用な直線成分のみを抽出し、それ以外のゴミ(ノイズ)成分については除去することができる。   In this way, the detailed skew angle is detected by performing the labeling process on the binary image data output from the AND unit 220 and extracting the continuous pixel group whose feature amount satisfies the predetermined standard. Only useful linear components can be extracted, and other dust (noise) components can be removed.

ただし、ラベリング部221および所定特徴ラベル抽出部222については必ずしも必要な構成要素ではなく、論理積部220において、詳細スキュー角の検出に有用な直線成分に対応した2値画像データのみを出力できるのであれば、ラベリング部221および所定特徴ラベル抽出部222を省略することも可能である。   However, the labeling unit 221 and the predetermined feature label extraction unit 222 are not necessarily necessary components, and the logical product unit 220 can output only binary image data corresponding to a linear component useful for detecting a detailed skew angle. If present, the labeling unit 221 and the predetermined feature label extraction unit 222 may be omitted.

詳細角度検出部223は、座標抽出部2231、ハフ変換部2232および角度算出部2233によって構成され、論理積部220から出力され、ラベリング部221および所定特徴ラベル抽出部222を経由して入力される2値画像データに基づいて入力画像のスキュー角を詳細に、具体的には概略角度検出部215での検出単位よりも細かい検出単位で検出する。   The detailed angle detection unit 223 includes a coordinate extraction unit 2231, a Hough conversion unit 2232, and an angle calculation unit 2233, and is output from the logical product unit 220 and input via the labeling unit 221 and the predetermined feature label extraction unit 222. Based on the binary image data, the skew angle of the input image is detected in detail, specifically, in a detection unit smaller than the detection unit in the approximate angle detection unit 215.

この詳細角度検出部223において、座標抽出部2231は、論理積部220からラベリング部221およびラベリング部221を介して入力される2値画像データに基づく直線の各ON画素の座標を抽出する。ハフ変換部2232は、座標抽出部2231で座標抽出された画素群に対して、概略角度検出部215で検出された概略スキュー角を基にハフ変換処理を行う。角度算出部2233は、ハフ変換部2232によるハフ変換の結果を基に、直線の傾き角度を入力画像の詳細スキュー角として、概略スキュー角の算出単位よりも詳細な単位(例えば、0.1度単位)で算出する。この詳細スキュー角が入力画像の最終的なスキュー角となる。   In the detailed angle detection unit 223, the coordinate extraction unit 2231 extracts the coordinates of each ON pixel of a straight line based on the binary image data input from the logical product unit 220 via the labeling unit 221 and the labeling unit 221. The Hough transform unit 2232 performs a Hough transform process on the pixel group extracted by the coordinate extraction unit 2231 based on the approximate skew angle detected by the approximate angle detection unit 215. Based on the result of the Hough transform by the Hough transform unit 2232, the angle calculation unit 2233 uses the inclination angle of the straight line as the detailed skew angle of the input image, and is a unit more detailed than the unit for calculating the approximate skew angle (for example, 0.1 degree). Unit). This detailed skew angle is the final skew angle of the input image.

スキュー補正部224は、詳細角度検出部223で検出された詳細スキュー角、即ち入力画像のスキュー角を基に、当該スキュー角がゼロになるように入力画像を回転させることによってスキュー補正を行う。画像を回転させる手法としては、第1実施形態の場合と同様に、例えばアフィン変換などの周知の手法を用いることができる。   Based on the detailed skew angle detected by the detailed angle detection unit 223, that is, the skew angle of the input image, the skew correction unit 224 performs skew correction by rotating the input image so that the skew angle becomes zero. As a method for rotating the image, for example, a known method such as affine transformation can be used as in the case of the first embodiment.

上記構成の第2実施形態に係る画像処理装置20Bでは、概略角度検出部215で概略スキュー角を検出し、この概略スキュー角を基に詳細角度検出部223で詳細スキュー角を検出するという具合に、概略角度検出部215および詳細角度検出部223による2段階での角度検出処理によって入力画像のスキュー角を検出するとしたが、2段階での角度検出処理に限られるものではなく、3段階以上の多段階での角度検出処理も可能である。   In the image processing apparatus 20B according to the second embodiment having the above-described configuration, the approximate angle detection unit 215 detects the approximate skew angle, and the detailed angle detection unit 223 detects the detailed skew angle based on the approximate skew angle. The skew angle of the input image is detected by the angle detection process in two steps by the approximate angle detection unit 215 and the detailed angle detection unit 223. However, the skew angle of the input image is not limited to the angle detection process in two steps, and is more than three steps. Multi-stage angle detection processing is also possible.

この場合、多段階の角度検出部の相互間には、前段の角度検出部でのハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での画素群を抽出して後段の角度検出部に渡す、例えば頻度多点抽出部216および逆ハフ変換部217を含む有用画素群抽出部を設けるようにすれば良い。   In this case, a pixel group on the xy plane is based on one or more points in the polar coordinate space by the Hough transform processing in the previous angle detection unit between the multi-stage angle detection units. For example, a useful pixel group extraction unit including a frequent multipoint extraction unit 216 and an inverse Hough transform unit 217 may be provided.

上記構成の画像処理装置20Bの構成要素、即ちグレイ変換部211、2値化部212、輪郭抽出部213、縮小部214、概略角度検出部215、頻度多点抽出部216、逆ハフ変換部217、拡大部218、膨張部219、論理積部220、ラベリング部221、所定特徴ラベル抽出部222、詳細角度検出部223およびスキュー補正部224については、所定プログラムを実行することによって情報記憶処理、画像処理、演算処理等の各機能を実行するコンピュータ機器を利用してソフトウェア構成によって実現することが考えられる。   The components of the image processing apparatus 20B having the above-described configuration, that is, the gray conversion unit 211, the binarization unit 212, the contour extraction unit 213, the reduction unit 214, the approximate angle detection unit 215, the frequency multipoint extraction unit 216, and the inverse Hough conversion unit 217 The enlargement unit 218, the expansion unit 219, the logical product unit 220, the labeling unit 221, the predetermined feature label extraction unit 222, the detailed angle detection unit 223, and the skew correction unit 224 execute information storage processing and image processing by executing predetermined programs. It may be realized by a software configuration using a computer device that executes functions such as processing and arithmetic processing.

ただし、ソフトウェア構成による実現に限られるものではなく、ハードウェア構成、あるいはハードウェアとソフトウェアの複合構成によって実現することも可能である。ソフトウェア構成によって実現する場合、グレイ変換部211、2値化部212、輪郭抽出部213、縮小部214、概略角度検出部215、頻度多点抽出部216、逆ハフ変換部217、拡大部218、膨張部219、論理積部220、ラベリング部221、所定特徴ラベル抽出部222、詳細角度検出部223およびスキュー補正部224としてコンピュータを機能させるプログラムが本発明による画像処理プログラムとなる。   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 gray conversion unit 211, the binarization unit 212, the contour extraction unit 213, the reduction unit 214, the approximate angle detection unit 215, the frequency multipoint extraction unit 216, the inverse Hough conversion unit 217, the enlargement unit 218, A program that causes a computer to function as the expansion unit 219, the logical product unit 220, the labeling unit 221, the predetermined feature label extraction unit 222, the detailed angle detection unit 223, and the skew correction unit 224 is an image processing program according to the present invention.

また、以下に説明する画像処理シーケンスにおける各ステップの処理を実行するプログラムが、本発明による画像処理プログラムであるとも言える。そして、これらの画像処理プログラムについては、あらかじめコンピュータ内にインストールしておくことが考えられる。ただし、あらかじめインストールされているのではなく、コンピュータ読み取り可能な記憶媒体に格納されて提供されるものであっても良く、または有線若しくは無線による通信手段を介して配信されるものであっても良い。   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 the flowchart of FIG.

先ず、多値の画像データを2値化して得られる2値画像データまたは直接入力される2値画像データを取り込み(ステップS21)、次いで、この取り込んだ2値画像データのうち、ON画素で構成される領域の輪郭を示す画素を抽出し、ON画素で構成される領域の輪郭を示す輪郭2値画像データを生成し(ステップS22)、次いで、この輪郭2値画像データに対して、画像を例えば1/2に縮小する処理を行う(ステップS23)。   First, binary image data obtained by binarizing multi-valued image data or directly input binary image data is captured (step S21). Next, the captured binary image data is composed of ON pixels. The pixel indicating the contour of the region to be extracted is extracted, contour binary image data indicating the contour of the region composed of ON pixels is generated (step S22), and then an image is extracted from the contour binary image data. For example, a process of reducing to 1/2 is performed (step S23).

次に、縮小処理後の輪郭2値画像データに基づいて入力画像の概略スキュー角を、輪郭画素群に対してハフ変換処理を行って極座標(ρ−θ)に変換し、このハフ変換結果を基に例えば数度を単位として検出し(ステップS24)、次いで、ハフ変換によって得た極座標空間中で頻度の多い1つ以上の点を抽出し(ステップS25)、次いで、この抽出した頻度の多い1つ以上の点に対して逆ハフ変換処理を行うことにより、極座標空間の点をx−y平面上に戻す(ステップS26)。   Next, the rough skew angle of the input image is converted into polar coordinates (ρ−θ) by performing a Hough transform process on the contour pixel group based on the contour binary image data after the reduction process, and the result of the Hough transform is Based on, for example, several degrees as a unit (step S24), one or more frequent points in the polar coordinate space obtained by the Hough transform are extracted (step S25), and then the extracted frequent frequency By performing an inverse Hough transform process on one or more points, the points in the polar coordinate space are returned to the xy plane (step S26).

次に、逆ハフ変換した2値画像データに対して、元の画像サイズに戻すために、2倍に拡大する処理を行い(ステップS27)、次いで、この拡大した2値画像データに基づく画像のON画素に対して膨張処理を行い(ステップS28)、次いで、この膨張処理後の2値画像データと2値画像データから輪郭抽出して得た2値画像データとの論理積をとる(ステップS29)。   Next, in order to restore the original image size to the binary image data subjected to inverse Hough transform, a process of enlarging the image twice is performed (step S27), and then the image based on the enlarged binary image data is processed. Expansion processing is performed on the ON pixels (step S28), and then logical product of the binary image data after the expansion processing and the binary image data obtained by contour extraction from the binary image data is obtained (step S29). ).

次に、論理積演算後の2値画像データに対して、当該2値画像データに基づく画像において連続するON画素に対して同一ラベルを付与するラベリング処理を実行し(ステップS30)、次いで、同一ラベルが付与された連続画素群において、その特徴量が所定基準を満たす連続画素群を詳細スキュー角の検出に用いる連続画素群として抽出し(ステップS31)、次いで、概略スキュー角を基にハフ変換による技術を用いて詳細スキュー角を入力画像の最終的なスキュー角として検出する(ステップS32)。そして、この算出した詳細スキュー角を基に入力画像を回転させることによってスキュー補正を行い(ステップS33)、一連のスキュー角検出・補正処理を終了する。   Next, a labeling process is performed on the binary image data after the AND operation to give the same label to consecutive ON pixels in the image based on the binary image data (step S30), and then the same In the continuous pixel group to which a label is given, a continuous pixel group whose feature amount satisfies a predetermined criterion is extracted as a continuous pixel group used for detecting a detailed skew angle (step S31), and then Hough transform is performed based on the approximate skew angle. The detailed skew angle is detected as the final skew angle of the input image using the technique (step S32). Then, the skew correction is performed by rotating the input image based on the calculated detailed skew angle (step S33), and the series of skew angle detection / correction processing ends.

上述したように、輪郭抽出した2値画像データに対してハフ変換処理を実施後、ハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での有用画素群を抽出することで、当該有用画素群として長い直線や細長い矩形、あるいは大きめの矩形などの図形を形成する画素群を抽出できる。そして、この抽出した画素群に対してハフ変換による角度検出を行ってスキュー角検出を行うことにより、スキュー角の検出に最もふさわしく、最も簡単で、最も精度が高い図形を形成する画素群に対してのみハフ変換処理が行われることになるために、スキュー角の検出精度を高めることができる。   As described above, after performing the Hough transform process on the binary image data extracted from the contour, useful pixels on the xy plane based on one or more points having a high frequency in the polar coordinate space by the Hough transform process. By extracting a group, a pixel group that forms a figure such as a long straight line, a long and narrow rectangle, or a large rectangle can be extracted as the useful pixel group. Then, by performing angle detection by Hough transform on the extracted pixel group and performing skew angle detection, the pixel group that forms the most suitable, simplest, and most accurate figure for skew angle detection is obtained. Since the Hough conversion process is performed only in the above-described manner, the accuracy of detecting the skew angle can be increased.

また、入力画像全体に対してハフ変換処理を行うのではなく、初段の角度検出部では輪郭抽出した2値画像データに対して、2段目以降ではスキュー角検出に有用な画素群のみを抽出してハフ変換処理を行うことにより、スキュー角検出に有効に寄与しない文字や、短い直線、小さい矩形等の図形を演算処理の対象から除外することができるために、ハフ変換での演算処理の対象となる画素数を最小限に抑えることができる。その結果、ハフ変換での演算処理にかかる時間を短縮できるために、スキュー角を検出し、また当該スキュー角に基づいてスキュー補正する一連の処理の処理速度を向上できる。   Also, instead of performing the Hough transform process on the entire input image, only the pixel group useful for skew angle detection is extracted from the second stage onward for the binary image data extracted at the first stage angle detection unit. By performing the Hough transform process, characters that do not contribute to skew angle detection, short straight lines, small rectangles, and other figures can be excluded from the computation process. The number of target pixels can be minimized. As a result, it is possible to reduce the time required for the arithmetic processing in the Hough transform, so that it is possible to improve the processing speed of a series of processes for detecting the skew angle and correcting the skew based on the skew angle.

本発明による画像処理装置を含む画像処理システムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the image processing system containing the image processing apparatus by this invention. 本発明の第1実施形態に係る画像処理装置の機能構成例を示すブロック図である。It is a block diagram which shows the function structural example of the image processing apparatus which concerns on 1st Embodiment of this invention. 第1実施形態に係るスキュー角検出・補正処理の手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure of the skew angle detection and correction process which concerns on 1st Embodiment. 本発明の第2実施形態に係る画像処理装置の機能構成例を示すブロック図である。It is a block diagram which shows the function structural example of the image processing apparatus which concerns on 2nd Embodiment of this invention. 輪郭抽出部による輪郭抽出の説明図である。It is explanatory drawing of the contour extraction by a contour extraction part. 第2実施形態に係るスキュー角検出・補正処理の手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure of the skew angle detection and correction process which concerns on 2nd Embodiment.

符号の説明Explanation of symbols

10…画像データ入力部、20,20A,20B…画像処理装置(画像処理部)、30…画像データ出力部、21…CPU、22…I/O回路、23…ROM、24…RAM、25…HDD(ハードディスクドライブ)装置、26…バスライン、201,212…2値化部、202,221…ラベリング部、203…特定画素群抽出部、204,2151,2231…座標抽出部、205,2152,2232…ハフ変換部、206,2153,2233…角度算出部、207,224…スキュー補正部、214…縮小部、215…概略角度検出部、216…頻度多点抽出部、217…逆ハフ変換部、218…拡大部、219…膨張部、220…論理積部、222…所定特徴ラベル抽出部、223…詳細角度検出部   DESCRIPTION OF SYMBOLS 10 ... Image data input part, 20, 20A, 20B ... Image processing apparatus (image processing part), 30 ... Image data output part, 21 ... CPU, 22 ... I / O circuit, 23 ... ROM, 24 ... RAM, 25 ... HDD (Hard Disk Drive) device, 26 ... bus line, 201, 212 ... binarization unit, 202, 221 ... labeling unit, 203 ... specific pixel group extraction unit, 204, 2151, 2231 ... coordinate extraction unit, 205, 2152, 2232 ... Hough transform unit, 206, 2153, 2233 ... Angle calculation unit, 207, 224 ... Skew correction unit, 214 ... Reduction unit, 215 ... Rough angle detection unit, 216 ... Frequency multi-point extraction unit, 217 ... Inverse Hough transform unit 218 ... Enlargement unit, 219 ... Expansion unit, 220 ... Logical product unit, 222 ... Predetermined feature label extraction unit, 223 ... Detailed angle detection unit

Claims (4)

入力画像を2値化した2値画像の輪郭を示す画素を抽出する輪郭抽出手段と、
前記輪郭抽出手段で輪郭抽出された2値画像データに対するハフ変換処理によって前記入力画像の傾き角度を段階的に検出する多段階の角度検出手段と、
前記多段階の角度検出手段の相互間において前段の角度検出手段でのハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での有用画素群を抽出して後段の角度検出手段に渡す有用画素群抽出手段と、
前記多段階の角度検出手段における最終段の角度検出手段が検出した角度を基に前記入力画像に対するスキュー補正を行うスキュー補正手段と
を備えることを特徴とする画像処理装置。
Contour extracting means for extracting pixels indicating the contour of the binary image obtained by binarizing the input image;
Multi-stage angle detection means for detecting the inclination angle of the input image in stages by Hough transform processing on the binary image data extracted by the contour extraction means;
A useful pixel group on the xy plane is extracted based on one or more points having a high frequency in the polar coordinate space by the Hough transform process in the previous angle detecting means between the multi-stage angle detecting means. Useful pixel group extraction means to be passed to the subsequent angle detection means,
An image processing apparatus comprising: a skew correction unit configured to perform skew correction on the input image based on an angle detected by the last-stage angle detection unit in the multi-stage angle detection unit.
前記有用画素群抽出手段は、
前記極座標空間中で頻度の多い1つ以上のポイントを抽出する頻度多点抽出手段と、
前記頻度多点抽出手段で抽出された頻度の多い1つ以上の点に対して逆ハフ変換処理を行う逆ハフ変換手段と
を有することを特徴とする請求項記載の画像処理装置。
The useful pixel group extracting means includes
A frequency multipoint extraction means for extracting one or more points having a high frequency in the polar coordinate space;
The image processing apparatus according to claim 1, characterized in that it has an inverse Hough transform means for performing inverse Hough transform processing to the one or more points often frequently extracted by the frequency multipoint extracting means.
前記有用画素群抽出手段が抽出した前記有用画素群の各画素に対して膨張処理を行う膨張手段と、
前記膨張手段で膨張処理された2値画像データと前記輪郭抽出手段で輪郭抽出された2値画像データとの論理積をとって前記後段の角度検出手段に渡す論理積手段と
をさらに備えることを特徴とする請求項記載の画像処理装置。
Expansion means for performing expansion processing on each pixel of the useful pixel group extracted by the useful pixel group extraction means;
A logical product unit that takes a logical product of the binary image data expanded by the expansion unit and the binary image data extracted by the contour extraction unit and passes the logical product to the subsequent angle detection unit. The image processing apparatus according to claim 1, wherein:
入力画像を2値化した2値画像の輪郭を示す画素を抽出する輪郭抽出ステップと、
前記輪郭抽出ステップで輪郭抽出した2値画像データに対するハフ変換処理によって前記入力画像の傾き角度を段階的に検出する多段階の角度検出ステップと、
前記多段階の角度検出ステップの相互間において前段の角度検出ステップでのハフ変換処理による極座標空間中で頻度の多い1つ以上のポイントを基にx−y平面上での有用画素群を抽出して後段の角度検出ステップに渡す有用画素群抽出ステップと、
前記多段階の角度検出ステップにおける最終段の角度検出ステップで検出した角度を基に前記入力画像に対するスキュー補正を行うスキュー補正ステップと
の各処理をコンピュータに実行させることを特徴とする画像処理プログラム。
A contour extracting step for extracting pixels indicating the contour of the binary image obtained by binarizing the input image;
A multi-step angle detection step of detecting the tilt angle of the input image stepwise by a Hough transform process on the binary image data extracted in the contour extraction step;
A useful pixel group on the xy plane is extracted based on one or more points having a high frequency in the polar coordinate space by the Hough transform process in the angle detection step in the previous stage between the multi-stage angle detection steps. Useful pixel group extraction step passed to the angle detection step at the later stage,
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 an angle detected in a final angle detection step in the multi-stage angle detection step.
JP2006179008A 2006-06-29 2006-06-29 Image processing apparatus and image processing program Active JP4565396B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006179008A JP4565396B2 (en) 2006-06-29 2006-06-29 Image processing apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006179008A JP4565396B2 (en) 2006-06-29 2006-06-29 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2008011135A JP2008011135A (en) 2008-01-17
JP4565396B2 true JP4565396B2 (en) 2010-10-20

Family

ID=39068948

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006179008A Active JP4565396B2 (en) 2006-06-29 2006-06-29 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP4565396B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909544A (en) * 2017-10-31 2018-04-13 珠海丹德图像技术有限公司 A kind of method for correcting image and system

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101567048B (en) 2008-04-21 2012-06-06 夏普株式会社 Image identifying device and image retrieving device
JP5208147B2 (en) * 2010-03-09 2013-06-12 三菱電機株式会社 Camera calibration device for in-vehicle camera
KR101580594B1 (en) * 2015-07-06 2015-12-28 국방과학연구소 Method for line extraction of high resolution satellite images using regular grid-based hough transform
CN110084167B (en) * 2019-04-19 2022-11-04 中国航空无线电电子研究所 Scale data image processing method and device
CN111768378A (en) * 2020-06-29 2020-10-13 广东电网有限责任公司 Crimping hardware tool live-line detection method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11126254A (en) * 1997-10-24 1999-05-11 Pfu Ltd Image processor and program storage medium
JP2002084420A (en) * 2000-09-07 2002-03-22 Fuji Xerox Co Ltd Image processing unit, image processing method and recording medium with stored image processing program
JP2005184685A (en) * 2003-12-22 2005-07-07 Fuji Xerox Co Ltd Image processing device, program, and recording medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11126254A (en) * 1997-10-24 1999-05-11 Pfu Ltd Image processor and program storage medium
JP2002084420A (en) * 2000-09-07 2002-03-22 Fuji Xerox Co Ltd Image processing unit, image processing method and recording medium with stored image processing program
JP2005184685A (en) * 2003-12-22 2005-07-07 Fuji Xerox Co Ltd Image processing device, program, and recording medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107909544A (en) * 2017-10-31 2018-04-13 珠海丹德图像技术有限公司 A kind of method for correcting image and system

Also Published As

Publication number Publication date
JP2008011135A (en) 2008-01-17

Similar Documents

Publication Publication Date Title
US7965892B2 (en) Image processing apparatus, control method thereof, and program
JP5934762B2 (en) Document modification detection method by character comparison using character shape characteristics, computer program, recording medium, and information processing apparatus
JP2001092919A (en) Method for determining angle of torsion of two- dimensional bar code
JP2002133426A (en) Ruled line extracting device for extracting ruled line from multiple image
JP4565396B2 (en) Image processing apparatus and image processing program
JP5005732B2 (en) Image forming apparatus and image processing method
KR20150099116A (en) Method for recognizing a color character using optical character recognition and apparatus thereof
US6983071B2 (en) Character segmentation device, character segmentation method used thereby, and program therefor
JP2003115031A (en) Image processor and its method
US11570331B2 (en) Image processing apparatus, image processing method, and storage medium
JP2004086436A (en) Image processor, image processing method, program, and storage medium
KR20000025647A (en) Method for processing image using shading algorithm
JP2007328652A (en) Image processing device and image processing program
US20020164087A1 (en) System and method for fast rotation of binary images using block matching method
Shirali-Shahreza et al. Persian/Arabic text font estimation using dots
JP5146199B2 (en) Difference extraction apparatus and difference extraction program
JP4194309B2 (en) Document direction estimation method and document direction estimation program
JP2019021085A (en) Image processing program, image processing method, and image processing device
JP2003281469A (en) Method for processing document image
JP4785158B2 (en) Image data tilt correction method and image input apparatus
JPH05128305A (en) Area dividing method
JP2715930B2 (en) Line detection method
JP2674475B2 (en) Character reader
JPH06215181A (en) Character/character string segmenting method and character recognizing device
JP2023034823A (en) Image processing apparatus, and control method, and program for image processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090210

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20091009

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100507

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100622

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100709

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100722

R150 Certificate of patent or registration of utility model

Ref document number: 4565396

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130813

Year of fee payment: 3

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350