JP2007310466A - Image tilt detection device and image tilt detection processing program - Google Patents

Image tilt detection device and image tilt detection processing program Download PDF

Info

Publication number
JP2007310466A
JP2007310466A JP2006136482A JP2006136482A JP2007310466A JP 2007310466 A JP2007310466 A JP 2007310466A JP 2006136482 A JP2006136482 A JP 2006136482A JP 2006136482 A JP2006136482 A JP 2006136482A JP 2007310466 A JP2007310466 A JP 2007310466A
Authority
JP
Japan
Prior art keywords
angle
image
block
detection
hough transform
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.)
Granted
Application number
JP2006136482A
Other languages
Japanese (ja)
Other versions
JP4692764B2 (en
Inventor
Kunikazu Ueno
邦和 上野
Koichi Fujii
晃一 藤井
Shunsuke Kodaira
俊輔 小平
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
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 filed Critical Fuji Xerox Co Ltd
Priority to JP2006136482A priority Critical patent/JP4692764B2/en
Publication of JP2007310466A publication Critical patent/JP2007310466A/en
Application granted granted Critical
Publication of JP4692764B2 publication Critical patent/JP4692764B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image tilt detection device capable of detecting the tilt of an image without requiring a large amount of a processing time by simplified processing and with high dimensional accuracy. <P>SOLUTION: In a wavelet transformation part 1, multilevel wave let space conversion is performed to the image of a tilt detection object. An angle detection part 2 performs Hough transformation to at least an LL block of multiple hierarchies, creates two-dimensional histogram for a ρ-θ plane, obtains an angle θ from a point of a maximum frequency. Sequentially from a deep hierarchy side, a candidate range is set up based on the angle obtained in a lower hierarchy, the Hough transformation is performed in its candidate range, the angle is gradually obtained with a higher degree of the accuracy. The LL block with the wavelet space conversion performed is lower in resolution than that of an original image, and high speed processing is achieved. Moreover, because noise, a halftone dot and the like are separated into other high-frequency wave blocks, the angle can be detected without being influenced by these. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、画像の傾きを検出する技術に関するものである。   The present invention relates to a technique for detecting the inclination of an image.

旧来より画像の傾きを検出するための技術が多数案出され、実際に利用されてきている。代表的なものとして、以下のような従来技術がある。まず特許文献1に記載されている傾き検出技術は、角度θを順次変更しながら文書画像をθだけ回転させ、回転画像中に含まれる全黒画素を含む外接矩形を作成し、その外接矩形の面積が最小となる角度θを画像の傾き角とするものである。また特許文献2に記載されている技術は、黒画素の連結性から外接矩形を作成し。各外接矩形の一つの頂点について種々の方位に投影したヒストグラムを求め、最大頻度となる角度をスキュー角とするものである。   Many techniques for detecting the tilt of an image have been devised and used in practice. Typical examples include the following conventional techniques. First, the tilt detection technique described in Patent Document 1 rotates a document image by θ while sequentially changing the angle θ, creates a circumscribed rectangle including all black pixels included in the rotated image, The angle θ at which the area is minimized is used as the inclination angle of the image. The technique described in Patent Document 2 creates a circumscribed rectangle from the connectivity of black pixels. Histograms that are projected in various directions on one vertex of each circumscribed rectangle are obtained, and the angle with the maximum frequency is used as the skew angle.

別の方法として、例えば特許文献3に記載されている方法では、画像データをエッジ処理してから2値化し、2値画像に対してハフ変換を施し、ハフ変換により得られたパラメータ空間(ρ−θ平面)上で頻度が所定値以上となる座標グループを生成し、その座標グループから画像の角度を推定している。   As another method, for example, in the method described in Patent Document 3, the image data is subjected to edge processing and then binarized, the binary image is subjected to Hough transform, and the parameter space obtained by the Hough transform (ρ A coordinate group whose frequency is equal to or higher than a predetermined value on the -θ plane) is generated, and the angle of the image is estimated from the coordinate group.

特開平2−170280号公報JP-A-2-170280 特開平6−203202号公報JP-A-6-203202 特開平11−328408号公報JP 11-328408 A

本発明は、多大な処理時間を要することなく、簡単な処理によって精度よく画像の傾きを検出することができる画像傾き検出装置と、そのような画像傾き検出装置の機能をコンピュータに実行させる画像傾き検出処理プログラムを提供することを目的とするものである。   The present invention provides an image inclination detection device capable of detecting an image inclination with high accuracy by simple processing without requiring a large amount of processing time, and an image inclination for causing a computer to execute the function of such an image inclination detection device. The object is to provide a detection processing program.

本発明は、傾きの検出対象となる画像に対して多階層のウェーブレット空間変換を行い、階層の深い方から順に、少なくとも低周波ブロック(LLブロック)をハフ変換して画像の角度を検出してゆくことを特徴とするものである。   The present invention performs multi-layer wavelet space transformation on an image whose inclination is to be detected, and detects the angle of the image by performing Hough transform on at least a low frequency block (LL block) in order from the deepest layer. It is characterized by going.

より具体的には、ハフ変換によって得られたρ−θ平面の2次元ヒストグラムを作成し、最大頻度となる検知角度とその検知角度の分散値を求め、分散値が所定の閾値以下のときには、その検知角度をその階層における画像の角度として検出する。また、分散値が所定の閾値より大きい場合には、最大頻度となる検知角度から、縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択してハフ変換し、その階層における角度を検出することができる。あるいは、低周波ブロック以外のブロックを合成して、最大頻度となる検知角度を含む候補範囲についてハフ変換し、その階層における角度を検出することもできる。このような処理を、深い階層から浅い階層へと順に行えばよい。   More specifically, a two-dimensional histogram of the ρ-θ plane obtained by the Hough transform is created, a detection angle that is the maximum frequency and a variance value of the detection angle are obtained, and when the variance value is equal to or less than a predetermined threshold value, The detected angle is detected as the angle of the image in the hierarchy. Further, when the variance value is larger than a predetermined threshold value, one of the blocks (LH block or HL block) in which either the vertical or horizontal direction is a high frequency and the other is a low frequency is detected from the detection angle having the maximum frequency. You can select and Hough transform to detect the angle in that hierarchy. Alternatively, blocks other than the low-frequency block can be synthesized, and the Hough transform can be performed on the candidate range including the detection angle having the maximum frequency, and the angle in the hierarchy can be detected. Such processing may be performed in order from a deep hierarchy to a shallow hierarchy.

また本発明は、傾きの検出対象となる画像に対してウェーブレット空間変換を行い、ウェーブレット空間の低周波ブロック(LLブロック)をハフ変換して概略角度を検出した後、その概略角度から縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択してハフ変換し、画像の角度を検出することを特徴とするものである。あるいは、同様に概略角度を検出した後、低周波ブロック以外のブロック(LH,HL,HHブロック)を合成して、概略角度を含む候補範囲についてハフ変換し、画像の角度を検出することを特徴とするものである。この場合も、多階層のウェーブレット空間変換を行い、階層の深い方から順に処理を行い、より詳細な角度を検出するように構成することもできる。   Further, the present invention performs wavelet space conversion on an image whose inclination is to be detected, detects a rough angle by performing a Hough transform on a low frequency block (LL block) in the wavelet space, and then vertically or horizontally from the rough angle. One of the blocks whose direction is high frequency and the other is low frequency (LH block or HL block) is selected and subjected to Hough transform to detect the angle of the image. Alternatively, after detecting the approximate angle in the same manner, blocks other than the low-frequency block (LH, HL, HH block) are synthesized, and the Hough transform is performed on the candidate range including the approximate angle, and the angle of the image is detected. It is what. Also in this case, it is possible to perform multi-level wavelet space conversion, perform processing in order from the deepest level, and detect more detailed angles.

さらに本発明は、上述のような画像傾き検出装置の機能をコンピュータに実行させることを特徴とするものである。   Furthermore, the present invention is characterized by causing a computer to execute the function of the image tilt detection apparatus as described above.

本発明によれば、多階層にウェーブレット空間変換を行うことにより、深い階層では低周波ブロックのサイズは小さくなるため、高速な角度検出処理が可能である。また、例えば画像中に網点部分が存在していても網点がつぶれ、またノイズもつぶれたり除去されるため、これらの影響を受けずに角度を検出することができる。このとき、低周波ブロックを用いることによっても、さらにノイズの影響を受けずに角度を検出することができる。なお、深い階層ではブロックのサイズが小さいため、深い階層の低周波ブロックのみでは画像の角度としてはそれほどの精度が得られないが、深い階層から順に詳細に角度を求めてゆく階層的な角度検知を行うことによって、画像の傾きを精度よく求めることができるという効果がある。   According to the present invention, by performing wavelet space transformation on multiple hierarchies, the size of the low frequency block is reduced in the deep hierarchies, so that high-speed angle detection processing is possible. Further, for example, even when a halftone dot portion exists in the image, the halftone dot is crushed and noise is also crushed or removed, so that the angle can be detected without being affected by these. At this time, the angle can be detected without being influenced by noise even by using the low frequency block. In addition, since the block size is small in the deep hierarchy, the accuracy of the image angle cannot be obtained with only the low-frequency block in the deep hierarchy, but hierarchical angle detection that obtains angles in detail from the deep hierarchy in order. By performing the above, there is an effect that the inclination of the image can be obtained with high accuracy.

また、低周波ブロックをハフ変換して角度を検出した後、その角度から縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択してハフ変換して角度を検出したり、あるいは、低周波ブロック以外のブロックを合成して、より詳細な角度を検出するように構成しても、高速に精度よく画像の傾きを求めることができるという効果がある。   In addition, after detecting the angle by Hough transforming the low frequency block, either one of the block (LH block or HL block) in which either the vertical or horizontal direction is high frequency and the other is low frequency is selected. Even if it is configured to detect the angle by Hough transform, or to detect a more detailed angle by synthesizing blocks other than the low frequency block, it is possible to obtain the inclination of the image with high speed and accuracy. effective.

図1は、本発明の実施の一形態を示すブロック図である。図中、1はウェーブレット変換部、2は角度検出部である。ウェーブレット変換部1は、傾きの検出対象となる画像に対して多階層のウェーブレット空間変換を行う。   FIG. 1 is a block diagram showing an embodiment of the present invention. In the figure, 1 is a wavelet transform unit, and 2 is an angle detection unit. The wavelet transform unit 1 performs multi-layer wavelet space transform on an image whose inclination is to be detected.

角度検出部2は、ウェーブレット変換部1で変換した各階層の少なくとも低周波ブロック(LLブロック)をハフ変換し、変換結果から画像の角度を検出する。より具体的には、ウェーブレット空間変換の結果得られる低周波ブロックについて、2値化してハフ変換を施し、得られたρ−θ平面の2次元ヒストグラムを作成する。この2次元ヒストグラムから各検知角度の分散値を求める。分散値が小さければρ−θ平面に点がまとまっていることを示し、角度がある程度定まっているものと判断できる。従って、分散値が所定の閾値以下のときに、最大頻度となる検知角度を画像の角度として検出する。分散値が所定の閾値より大きい場合には、ある角度に特定できない場合を示しており、その場合には、低周波ブロック以外のブロックを用いることができる。例えば、低周波ブロックをハフ変換して得られた2次元ヒストグラムから最大頻度となる角度を求めておき、低周波ブロック以外の、縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択して2値化およびハフ変換して、低周波ブロックから求めた角度から所定範囲内で角度を検出する。LHブロックは水平成分を多く含み、HLブロックは垂直成分を多く含むので、低周波ブロックから得られた最大頻度となる角度が水平に近ければLHブロックを用い、垂直に近ければHLブロックを用いて、より詳細な角度検出を行えばよい。   The angle detection unit 2 performs Hough transform on at least the low frequency block (LL block) of each layer converted by the wavelet transform unit 1 and detects the angle of the image from the conversion result. More specifically, the low-frequency block obtained as a result of wavelet space transformation is binarized and subjected to Hough transformation, and a two-dimensional histogram of the obtained ρ-θ plane is created. The variance value of each detection angle is obtained from this two-dimensional histogram. If the dispersion value is small, it indicates that the points are collected on the ρ-θ plane, and it can be determined that the angle is fixed to some extent. Therefore, when the variance value is equal to or less than a predetermined threshold, the detection angle that is the maximum frequency is detected as the image angle. When the variance value is larger than a predetermined threshold, it indicates a case where the angle cannot be specified, and in that case, a block other than the low frequency block can be used. For example, a maximum frequency angle is obtained from a two-dimensional histogram obtained by Hough transform of a low-frequency block, and a block other than the low-frequency block has a high frequency in the vertical or horizontal direction and the other is a low-frequency block ( LH block or HL block) is selected, binarized and Hough transformed, and an angle is detected within a predetermined range from the angle obtained from the low frequency block. Since the LH block contains a lot of horizontal components and the HL block contains a lot of vertical components, the LH block is used if the angle of the maximum frequency obtained from the low frequency block is close to the horizontal, and the HL block is used if the angle is close to the vertical. More detailed angle detection may be performed.

そして、このような処理を、最も深い階層から浅い階層へ、階層的に順に角度を決定してゆく。このとき、ある階層で求めた角度をもとに、その角度を含む候補範囲を設定し、次の階層ではその候補範囲について細かい角度でのハフ変換を行って角度を検出してゆく。これにより、検出される角度は正しい角度へ次第に修正されてゆくことになり、最終的に精度よく画像の傾き角度を検出することができる。   Then, in such a process, the angles are determined hierarchically in order from the deepest hierarchy to the shallowest hierarchy. At this time, based on the angle obtained in a certain hierarchy, a candidate range including the angle is set, and in the next hierarchy, the angle is detected by performing a Hough transform at a fine angle on the candidate range. As a result, the detected angle is gradually corrected to the correct angle, and the tilt angle of the image can be finally detected with high accuracy.

上述の本発明の実施の一形態について、さらに説明してゆく。図2は、ウェーブレット変換部1において行うウェーブレット空間変換の説明図である。11〜16はフィルタ部である。一般的なウェーブレット空間変換は図2(A)に示すような構成により行われる。ここでは、1階層のみについて示している。フィルタ部11〜16は、フィルタ処理およびサブサンプリングを行うものであり、‘H’はハイパスフィルタ処理を、‘G’はローパスフィルタ処理を、それぞれ行う。また、‘↓2’は2画素に対して1画素を間引くサブサンプリングを行うことを示している。   The above-described embodiment of the present invention will be further described. FIG. 2 is an explanatory diagram of wavelet space transformation performed in the wavelet transformation unit 1. Reference numerals 11 to 16 denote filter units. A general wavelet space transformation is performed by a configuration as shown in FIG. Here, only one layer is shown. The filter units 11 to 16 perform filter processing and subsampling. 'H' performs high-pass filter processing and 'G' performs low-pass filter processing. Further, “↓ 2” indicates that sub-sampling is performed to thin out one pixel for two pixels.

まず、入力された画像に対して主走査方向に隣り合う2画素毎に、フィルタ部11ではハイパスフィルタ処理を行って1画素を間引く。またフィルタ部12ではローパスフィルタ処理を行って1画素を間引く。   First, for every two pixels adjacent to the input image in the main scanning direction, the filter unit 11 performs high-pass filter processing to thin out one pixel. The filter unit 12 performs low-pass filter processing to thin out one pixel.

フィルタ部11で処理された画像は、今度は副走査方向に隣り合う2画素毎に、フィルタ部13でハイパスフィルタ処理を行い、1画素を間引く。これにより主走査方向および副走査方向ともハイパスフィルタ処理を行って、主走査方向および副走査方向とも半分の解像度となった画像(HHブロック)が生成される。同様にフィルタ部14でローパスフィルタ処理を行い、1画素を間引く。これにより、主走査方向についてはハイパスフィルタ処理、副走査方向についてはローパスフィルタ処理を施した、主走査方向および副走査方向とも半分の解像度となった画像(HLブロック)が生成される。   The image processed by the filter unit 11 is then subjected to high-pass filter processing by the filter unit 13 every two pixels adjacent in the sub-scanning direction, and one pixel is thinned out. As a result, high-pass filter processing is performed in both the main scanning direction and the sub-scanning direction, and an image (HH block) having a half resolution in both the main scanning direction and the sub-scanning direction is generated. Similarly, the filter unit 14 performs low-pass filter processing and thins out one pixel. As a result, an image (HL block) having a half resolution in both the main scanning direction and the sub-scanning direction, which has been subjected to high-pass filter processing in the main scanning direction and low-pass filter processing in the sub-scanning direction, is generated.

また、フィルタ部12で処理された画像は、今度は副走査方向に隣り合う2画素毎に、フィルタ部15でハイパスフィルタ処理を行い、1画素を間引く。これにより、主走査方向についてはローパスフィルタ処理、副走査方向についてはハイパスフィルタ処理を施した、主走査方向および副走査方向とも半分の解像度となった画像(LHブロック)が生成される。同様に、フィルタ部16でローパスフィルタ処理を行い、1画素を間引く。これにより、主走査方向および副走査方向ともローパスフィルタ処理を行って、主走査方向および副走査方向とも半分の解像度となった画像(LLブロック)が生成される。   Further, the image processed by the filter unit 12 is subjected to high-pass filter processing by the filter unit 15 every two pixels adjacent in the sub-scanning direction, and one pixel is thinned out. As a result, an image (LH block) having a half resolution in both the main scanning direction and the sub-scanning direction, which has been subjected to low-pass filter processing in the main scanning direction and high-pass filter processing in the sub-scanning direction, is generated. Similarly, the filter unit 16 performs low-pass filter processing and thins out one pixel. Thereby, low pass filter processing is performed in both the main scanning direction and the sub-scanning direction, and an image (LL block) having a half resolution in both the main scanning direction and the sub-scanning direction is generated.

このようなウェーブレット空間変換によって、図2(B)に示した画像から図2(C)に示すようにLLブロック、HLブロック、LHブロック、HHブロックの4つのブロックが生成される。上述のような生成過程から分かるように、HHブロックには高周波成分が分離されており、細かに変化する画像成分が分離される。また、例えばノイズなどもこのHHブロックに分離される。HLブロックは、主走査方向にハイパスフィルタ処理、副走査方向にはローパスフィルタ処理を施したので、主走査方向については細かに変化するが、副走査方向には変化が緩やかな成分が分離される。例えば、副走査方向に延びる線分などがこのHLブロックに分離される。逆にLHブロックは、主走査方向にローパスフィルタ処理、副走査方向にはハイパスフィルタ処理を施したので、主走査方向については変化が緩やかであり、副走査方向には細かに変化する成分が分離される。例えば、主走査方向に延びる線分などがこのLHブロックに分離される。LLブロックは主走査方向および副走査方向ともにローパスフィルタ処理を行っているので低周波成分が分離されており、画像全体としての傾向がこのLLブロックに反映されている。従って、このLLブロックを参照することによって、画像全体としてどのような傾向にあるかが分かり、本発明においてはこのLLブロックから角度を検知している。   By such wavelet space transformation, four blocks of LL block, HL block, LH block, and HH block are generated from the image shown in FIG. 2B as shown in FIG. 2C. As can be seen from the generation process as described above, high frequency components are separated from the HH block, and image components that change finely are separated. Further, for example, noise and the like are also separated into the HH blocks. Since the HL block has been subjected to high-pass filter processing in the main scanning direction and low-pass filter processing in the sub-scanning direction, the main scanning direction changes finely, but components that change slowly in the sub-scanning direction are separated. . For example, a line segment extending in the sub scanning direction is separated into the HL blocks. On the other hand, the LH block has undergone low-pass filter processing in the main scanning direction and high-pass filter processing in the sub-scanning direction, so the change in the main scanning direction is gradual and components that change finely in the sub-scanning direction are separated. Is done. For example, a line segment extending in the main scanning direction is separated into the LH blocks. Since the LL block performs low-pass filter processing in both the main scanning direction and the sub-scanning direction, low frequency components are separated, and the tendency of the entire image is reflected in the LL block. Therefore, by referring to this LL block, it can be seen what the tendency of the entire image is, and in the present invention, the angle is detected from this LL block.

多階層のウェーブレット空間変換を行う場合には、上述のようにして得られた4つのブロックのうちのLLブロックを図2(A)に示した構成の入力として、処理を繰り返せばよい。2階層のウェーブレット空間変換を行った結果を図2(D)に示している。1回目の結果には‘1’を付し、2回目の結果には‘2’を付して示してある。太線で示したLL1ブロックについて再度のウェーブレット空間変換を行い、LL2、HL2、LH2、HH2ブロックを生成している。もちろん、同様にして3回以上のウェーブレット空間変換を行ってもよい。なお、説明の都合上、以下の例では2階層のウェーブレット空間変換を行うものとする。ウェーブレット変換部1では、入力された傾き検知の対象となる画像に対して、上述のような一般的な多階層のウェーブレット空間変換を行い、その結果を角度検出部2に渡す。   When performing multi-layer wavelet space transformation, the processing may be repeated using the LL block of the four blocks obtained as described above as the input of the configuration shown in FIG. FIG. 2D shows the result of performing two-layer wavelet space transformation. The first result is indicated by “1”, and the second result is indicated by “2”. Wavelet space transformation is performed again on the LL1 block indicated by the bold line, and LL2, HL2, LH2, and HH2 blocks are generated. Of course, three or more wavelet space transformations may be performed in the same manner. For convenience of explanation, in the following example, two-layer wavelet space transformation is performed. The wavelet transform unit 1 performs the general multi-layer wavelet space transform as described above on the input image for tilt detection, and passes the result to the angle detection unit 2.

角度検出部2では、ウェーブレット変換部1から渡された、ウェーブレット空間変換された画像を受け取り、最下層の階層から順に角度を検出して行き、より詳細な角度を求めてゆく。各階層での角度の検出は、少なくとも低周波成分が分離されたLLブロックをハフ変換し、変換結果から画像の角度を検出する。   The angle detection unit 2 receives the image subjected to wavelet space conversion passed from the wavelet conversion unit 1, detects angles in order from the lowest layer, and obtains more detailed angles. In the angle detection in each layer, the LL block from which at least low frequency components are separated is subjected to Hough transform, and the angle of the image is detected from the conversion result.

図3は、一般的なハフ変換の説明図である。ハフ変換は、x−y座標系における直線をρ−θ座標系(極座標系)における1点に変換するものである。変換式は、
ρ=X・cosθ+Y・sinθ
である。ρ、θが一意に決まれば(すなわちρ−θ座標系における1点は)、X、Yにおける一次式となり、x−y座標系における直線となる。
FIG. 3 is an explanatory diagram of a general Hough transform. The Hough transform converts a straight line in the xy coordinate system to one point in the ρ-θ coordinate system (polar coordinate system). The conversion formula is
ρ = X · cos θ + Y · sin θ
It is. If ρ and θ are uniquely determined (that is, one point in the ρ-θ coordinate system), the linear expression in X and Y becomes a straight line in the xy coordinate system.

ハフ変換では、x−y座標系における1点(X,Y)は、上述の変換式からX、Yに依存した三角関数式となり、ρ−θ座標系における曲線となる。このとき、図3(A)に示すようにx−y座標系における直線上の複数の点についてのρ−θ座標系における曲線は、図3(B)に示すように1点で交差する。従って、この交点を見つけてx−y座標系における直線を求めれば、画像中に存在する直線成分の角度が得られることになる。   In the Hough transform, one point (X, Y) in the xy coordinate system becomes a trigonometric function expression that depends on X and Y from the above-described conversion formula, and becomes a curve in the ρ-θ coordinate system. At this time, as shown in FIG. 3A, the curves in the ρ-θ coordinate system for a plurality of points on the straight line in the xy coordinate system intersect at one point as shown in FIG. Therefore, if this intersection is found and a straight line in the xy coordinate system is obtained, the angle of the straight line component existing in the image can be obtained.

もちろん、画像中には様々な直線成分が存在するため、ρ−θ座標系においては多数の交点が存在することになる。そのため、例えば2値画像のそれぞれの黒画素について変換した曲線の軌跡をρ−θ座標系における座標毎に計数してρ−θ座標系における2次元ヒストグラムを作成し、ヒストグラムのピークや分散値などから、画像中の直線成分を推測し、角度を検出すればよい。   Of course, since there are various linear components in the image, there are many intersections in the ρ-θ coordinate system. Therefore, for example, the trajectory of the curve converted for each black pixel of the binary image is counted for each coordinate in the ρ-θ coordinate system to create a two-dimensional histogram in the ρ-θ coordinate system, and the histogram peak, variance value, etc. From this, the linear component in the image is estimated and the angle is detected.

角度検出部2では、LLブロックをハフ変換の処理対象としているため、高周波成分、特にノイズなどの影響を受けにくく、また解像度が低くなっているため細かい部分はつぶれており、従って作成した2次元ヒストグラムにおいてピークができやすく、画像全体の傾向として角度を検出することができる。例えば網点部分などは、高周波成分としてHHブロックに分離され、LLブロックについてはローパスフィルタ処理およびサブサンプリングの際につぶされたり消去されてしまうため、個々の網点が角度の検出に影響することはない。   Since the angle detection unit 2 uses the LL block as a processing target for the Hough transform, it is not easily affected by high frequency components, particularly noise, and the resolution is low. A peak can be easily formed in a histogram, and an angle can be detected as a tendency of the entire image. For example, halftone dots are separated into HH blocks as high-frequency components, and LL blocks are crushed or deleted during low-pass filter processing and subsampling, so that each halftone dot affects angle detection. There is no.

また、LLブロックの大きさは元の画像(あるいは1つ上の階層のLLブロック)の1/4であり、変換すべき画素数も少ないため高速に処理を行うことができる。例えば図2(D)に示したLL2ブロックであれば、元の画像の1/16の画素しかなく、高速に処理を行うことができる。   Further, the size of the LL block is 1/4 of the original image (or the LL block in the next higher layer), and since the number of pixels to be converted is small, processing can be performed at high speed. For example, in the LL2 block shown in FIG. 2D, there are only 1/16 pixels of the original image, and processing can be performed at high speed.

例えばウェーブレット変換部1において2階層のウェーブレット空間変換を行った場合、角度検出部2ではLL2ブロックについて上述のようにしてハフ変換を行い、角度を検出することができる。しかし、LL2ブロックは上述のように元の画像の1/16しかなく、サブサンプリングによりつぶれも生じているため、得られた角度の精度が低い可能性がある。このとき、上述の2次元ヒストグラムにおいてピークの分散値を求めると、分散値が小さい場合(例えば分散値が所定の閾値以下の場合)には、ピークがはっきりと表れていることを示すため、得られた角度は精度よく求められていると言える。しかし分散値が大きい場合(例えば分散値が所定の閾値より大きい場合)には、ピークがそれほどはっきりと表れておらず、従って得られた角度はそれほど精度よく求められていない可能性がある。このような場合には、さらに精度よく角度を求める処理を行う。   For example, when the wavelet transform unit 1 performs two-level wavelet space transform, the angle detection unit 2 can perform the Hough transform on the LL2 block as described above to detect the angle. However, the LL2 block is only 1/16 of the original image as described above, and the sub-sampling also causes collapse, so the accuracy of the obtained angle may be low. At this time, when the variance value of the peak is obtained in the above-described two-dimensional histogram, when the variance value is small (for example, when the variance value is equal to or smaller than a predetermined threshold value), it is shown that the peak appears clearly. It can be said that the obtained angle is accurately calculated. However, when the variance value is large (for example, when the variance value is larger than a predetermined threshold value), the peak is not so clearly displayed, and thus the obtained angle may not be obtained with high accuracy. In such a case, processing for obtaining the angle with higher accuracy is performed.

さらに精度よく角度を求める方法として、1つ上の階層のLLブロックを用い、既に得られている角度を含む候補範囲でハフ変換を行い、精度を高めてゆくことができる。もちろんそのまま1つ上の階層の処理に移行してもよいが、ここでは、1つ上の階層の処理に移行する前に同じ階層の他のブロックを用いて精度を高める処理を行う。   Furthermore, as a method for obtaining the angle with high accuracy, it is possible to increase the accuracy by using the LL block in the upper layer and performing Hough transform in the candidate range including the angle already obtained. Of course, the process may be shifted to the process of the next higher level as it is, but here, the process of increasing the accuracy is performed using another block of the same level before moving to the process of the next higher level.

図2で説明したように、ウェーブレット空間変換を行うとHLブロックには垂直成分が、LHブロックには水平成分が含まれている。従って、ρ−θ平面の2次元ヒストグラムから得られた最大頻度の点に対応する画像の角度が垂直に近ければHLブロックを用い、水平に近ければLHブロックを用いることによって、さらに詳細な角度を検出することができる。例えばLLブロックから得られた角度が0°〜45°または135°〜180°であれば水平に近いと判断してLHブロックを用い、45°〜135°であれば垂直に近いと判断してHLブロックを用い、ハフ変換して角度を検出すればよい。このとき、LLブロックから得られた角度を含む候補範囲でハフ変換および角度の検出を行ってもよい。   As described with reference to FIG. 2, when wavelet space conversion is performed, the HL block includes a vertical component and the LH block includes a horizontal component. Therefore, if the angle of the image corresponding to the point of the maximum frequency obtained from the two-dimensional histogram on the ρ-θ plane is close to the vertical, the HL block is used, and if the angle is close to the horizontal, the LH block is used. Can be detected. For example, if the angle obtained from the LL block is 0 ° to 45 ° or 135 ° to 180 °, it is judged to be almost horizontal and the LH block is used, and if it is 45 ° to 135 °, it is judged to be nearly vertical. An angle may be detected by performing Hough transform using an HL block. At this time, Hough transform and angle detection may be performed in a candidate range including the angle obtained from the LL block.

あるいは、LLブロックを除くHLブロック、LHブロック、HHブロックを合成し、LLブロックから得られた角度を含む候補範囲でハフ変換および角度の検出を行うこともできる。例えばローパスフィルタ処理およびサブサンプリングによってつぶれたり白抜けが大きく発生している場合、高周波成分を利用することにより、さらに詳細な角度を検出することが可能である。このとき、候補範囲を設定しておけば、ノイズなどで全く異なる角度が検出されることはない。   Alternatively, the HL block, the LH block, and the HH block excluding the LL block can be combined, and the Hough transform and the angle detection can be performed within the candidate range including the angle obtained from the LL block. For example, when the image is crushed or white spots are largely generated by low-pass filter processing and sub-sampling, it is possible to detect a more detailed angle by using a high-frequency component. At this time, if a candidate range is set, a completely different angle is not detected due to noise or the like.

このようにLLブロック以外のブロックを用いて得られた角度を、当該階層における角度とし、その角度を1つ上の階層において修正してゆくことにより精度よく画像の角度を求めることができる。なお、例えば上述の2次元ヒストグラムから求めたピークの分散値が十分小さい場合には、それより上位の階層についての処理を行うことなく、最終的な画像の角度として出力することができる。また、十分な精度が得られれば、1層のみにおいてLLブロックからの角度検出とLLブロック以外のブロックからの角度検出の処理のみで、最終的な画像の角度としてもよい。   As described above, an angle obtained using a block other than the LL block is set as an angle in the hierarchy, and the angle of the image can be obtained with high accuracy by correcting the angle in the hierarchy one level higher. For example, when the variance value of the peak obtained from the above-described two-dimensional histogram is sufficiently small, the final image angle can be output without performing processing for higher layers. If sufficient accuracy is obtained, the angle of the final image may be obtained by only angle detection from the LL block and angle detection from blocks other than the LL block in only one layer.

図4および図5は、本発明の実施の一形態における動作の一例を示すフローチャートである。ここでは図2(D)に示すように2階層のウェーブレット空間変換をウェーブレット変換部1で行った場合に、角度検出部2で行う処理の一例について示している。図4は最下層(LL2、HL2、LH2、HH2)に対する角度検出の処理、図5はその上層(LL1、HL1、LH1、HH1)に対する角度検出の処理を示している。   4 and 5 are flowcharts showing an example of the operation in the embodiment of the present invention. Here, as shown in FIG. 2D, an example of processing performed by the angle detection unit 2 when two-layer wavelet space conversion is performed by the wavelet conversion unit 1 is shown. 4 shows the angle detection process for the lowermost layer (LL2, HL2, LH2, HH2), and FIG. 5 shows the angle detection process for the upper layer (LL1, HL1, LH1, HH1).

角度検出部2は、まず、最下層の低周波ブロックであるLL2ブロックを用いて角度検出処理を行う。S51において、LL2ブロックを2値化する。そしてS52において、2値化したLL2ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムは、0°≦θ≦180°の範囲で作成する必要がある。範囲が広いため、処理速度などを考慮して、どの程度の精度で角度を求めるかを決めておけばよい。例えば数度単位のヒストグラムでもよい。ここでは3°単位で2次元ヒストグラムを作成した。   The angle detection unit 2 first performs angle detection processing using the LL2 block, which is the lowest frequency block at the lowest level. In S51, the LL2 block is binarized. In S52, the Hough transform is performed on the binarized LL2 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time needs to be created in the range of 0 ° ≦ θ ≦ 180 °. Since the range is wide, it is only necessary to determine the degree of accuracy with which the angle is obtained in consideration of the processing speed and the like. For example, a histogram of several degrees may be used. Here, a two-dimensional histogram was created in units of 3 °.

S53において、S52で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρLL2 ,θLL2 )とする。また、このmax(ρLL2 ,θLL2 )についての分散値VLL2 を算出する。なお、この分散値VLL2 はθLL2 について求めるだけでもよい。 In S53, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S52. This is defined as max (ρ LL2 , θ LL2 ). Also, a variance value V LL2 is calculated for this max (ρ LL2 , θ LL2 ). The dispersion value V LL2 may be obtained only for θ LL2 .

S54において、S53で求めたmax(ρLL2 ,θLL2 )についての分散値VLL2 が、所定の閾値THより大きいか否かを判定し、閾値TH以下である場合には十分な精度で角度が検出できたものとして、S55において、max(ρLL2 ,θLL2 )のθLL2 を入力された画像の傾き角度として出力し、処理を終える。これにより、以降の処理を行わなくてよいので、処理時間を短縮することができる。なお、さらに詳細に角度を求めるため、LL1ブロックの処理(S71)へ移行してもよい。 In S54, it is determined whether or not the variance value V LL2 for max (ρ LL2 , θ LL2 ) obtained in S53 is larger than a predetermined threshold value TH. as can be detected in S55, max (ρ LL2, θ LL2) is output as the inclination angle of the input image to theta LL2 of, the process ends. As a result, the subsequent processing does not have to be performed, and the processing time can be shortened. In addition, in order to obtain | require an angle in more detail, you may transfer to the process (S71) of LL1 block.

分散値VLL2 が所定の閾値THより大きい場合には、θLL2 を画像の角度として採用するには十分な精度ではないとして、この例では同じ階層のLLブロック以外のブロック、特にHLブロックかLHブロックのいずれかを用いて、さらに角度を求める。S56において、max(ρLL2 ,θLL2 )のθLL2 が0°<θLL2 <45°または135°<θLL2 <180°か否かを判断する。この角度の場合には傾きが水平に近いので、S57において処理対象をLH2ブロックとし、LH2ブロックを2値化する。S58において、2値化したLH2ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムも、S52と同様の精度で作成すればよい。あるいは、S56の条件の範囲内で精度を高めて2次元ヒストグラムを作成してもよい。ここではS52と同様、3°単位で2次元ヒストグラムを作成した。 If the variance value V LL2 is larger than the predetermined threshold TH, it is assumed that θ LL2 is not accurate enough to adopt the angle of the image, and in this example, blocks other than the LL block in the same hierarchy, particularly the HL block or LH Using any of the blocks, the angle is further determined. In S56, max (ρ LL2, θ LL2) of theta LL2 is 0 ° <θ LL2 <45 ° or 135 ° <θ LL2 <180 ° determines whether the. In the case of this angle, since the inclination is almost horizontal, the processing target is set as the LH2 block in S57, and the LH2 block is binarized. In S58, a Hough transform is performed on the binarized LH2 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time may be created with the same accuracy as in S52. Alternatively, a two-dimensional histogram may be created with increased accuracy within the range of the condition of S56. Here, as in S52, a two-dimensional histogram was created in units of 3 °.

S59において、S58で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρLH2 ,θLH2 )とする。また、このmax(ρLH2 ,θLH2 )についての分散値VLH2 を算出する。なお、この分散値VLH2 についても、θLH2 に対して求めればよい。 In S59, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S58. Let this be max (ρ LH2 , θ LH2 ). Also, a variance value V LH2 is calculated for this max (ρ LH2 , θ LH2 ). Note that the dispersion value V LH2 may be obtained for θ LH2 .

S60において、S59で求めたmax(ρLH2 ,θLH2 )についての分散値VLH2 が、所定の閾値THより大きいか否かを判定し、閾値TH以下である場合には十分な精度で角度が検出できたものとして、S61において、max(ρLH2 ,θLH2 )のθLH2 を入力された画像の傾き角度として出力し、処理を終える。この場合も、ここまでの処理で終了させることにより、傾き検出のための処理時間を短縮することができる。なお、さらに詳細に角度を求めるため、LL1ブロックの処理(S71)へ移行してもよい。 In S60, it is determined whether or not the variance value V LH2 for max (ρ LH2 , θ LH2 ) obtained in S59 is greater than a predetermined threshold value TH. as can be detected in S61, max (ρ LH2, θ LH2) outputs as the tilt angle of the input image to theta LH2 of, the process ends. Also in this case, the processing time for inclination detection can be shortened by ending with the processing so far. In addition, in order to obtain | require an angle in more detail, you may transfer to the process (S71) of LL1 block.

分散値VLH2 が所定の閾値THより大きい場合には、θLH2 を画像の角度として採用するには十分な精度ではないとして、さらに詳細に角度を求めるため、LL1ブロックの処理(S71)へ移行する。 If the variance value V LH2 is larger than the predetermined threshold value TH, it is determined that the angle is not sufficiently accurate to adopt θ LH2 as the image angle, and the process proceeds to the processing of the LL1 block (S71) in order to obtain the angle in more detail. To do.

S56でmax(ρLL2 ,θLL2 )のθLL2 が0°<θLL2 <45°または135°<θLL2 <180°ではないと判断された場合、すなわち45°<θLL2 <135°の場合には、傾きが垂直に近いので、S62において処理対象をHL2ブロックとし、HL2ブロックを2値化する。S63において、2値化したHL2ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムも、S58と同様の精度で作成すればよい。 S56 in max (ρ LL2, θ LL2) if the theta LL2 is determined not to be 0 ° <θ LL2 <45 ° or 135 ° <θ LL2 <180 ° , i.e. when the 45 ° <θ LL2 <135 ° Since the inclination is nearly vertical, the processing target is set as the HL2 block in S62, and the HL2 block is binarized. In S63, a Hough transform is performed on the binarized HL2 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time may be created with the same accuracy as in S58.

S64において、S63で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρHL2 ,θHL2 )とする。また、このmax(ρHL2 ,θHL2 )についての分散値VHL2 を算出する。なお、この分散値VHL2 についても、θHL2 に対して求めればよい。 In S64, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S63. Let this be max (ρ HL2 , θ HL2 ). Also, a variance value V HL2 is calculated for this max (ρ HL2 , θ HL2 ). Note that the variance value V HL2 may be obtained for θ HL2 .

S65において、S64で求めたmax(ρHL2 ,θHL2 )についての分散値VHL2 が、所定の閾値THより大きいか否かを判定し、閾値TH以下である場合には十分な精度で角度が検出できたものとして、S66において、max(ρHL2 ,θHL2 )のθHL2 を入力された画像の傾き角度として出力し、処理を終える。これにより、傾き角度の検出処理時間を短縮することができる。なお、さらに詳細に角度を求めるため、LL1ブロックの処理(S71)へ移行してもよい。 In S65, it is determined whether or not the variance value V HL2 for max (ρ HL2 , θ HL2 ) obtained in S64 is greater than a predetermined threshold value TH. If the variance value is equal to or less than the threshold value TH, the angle is sufficiently accurate. as can be detected in S66, max (ρ HL2, θ HL2) is output as the inclination angle of the input image to theta HL2 of, the process ends. Thereby, the detection processing time of the inclination angle can be shortened. In addition, in order to obtain | require an angle in more detail, you may transfer to the process (S71) of LL1 block.

分散値VHL2 が所定の閾値THより大きい場合には、θHL2 を画像の角度として採用するには十分な精度ではないとして、さらに詳細に角度を求めるため、LL1ブロックの処理(S71)へ移行する。 If the variance value V HL2 is larger than the predetermined threshold value TH, it is determined that the angle is not accurate enough to adopt θ HL2 as the image angle, and the process proceeds to the processing of the LL1 block (S71) in order to obtain the angle in more detail. To do.

次にS71以降の処理により、これまで求めた角度をもとにして次の階層(LL1、HL1、LH1、HH1)に対する角度検出の処理を行う。S71において、LL1ブロックを2値化する。そしてS72において、2値化したLL1ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムは、S79やS84(またはS73)で求めた角度を含む候補範囲について、詳細に2次元ヒストグラムを作成する。例えば、先に求めた角度を中心に±3°の範囲を候補範囲とし、0.1°単位で2次元ヒストグラムを作成した。   Next, an angle detection process for the next hierarchy (LL1, HL1, LH1, HH1) is performed based on the angles obtained so far by the processes after S71. In S71, the LL1 block is binarized. In S72, the Hough transform is performed on the binarized LL1 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time creates a two-dimensional histogram in detail for the candidate range including the angle obtained in S79 and S84 (or S73). For example, a range of ± 3 ° centered on the previously obtained angle is set as a candidate range, and a two-dimensional histogram is created in units of 0.1 °.

S73において、S72で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρLL1 ,θLL1 )とする。また、このmax(ρLL1 ,θLL1 )についての分散値VLL1 を算出する。なお、この分散値VLL1 はθLL1 について求めるだけでもよい。 In S73, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S72. This is defined as max (ρ LL1 , θ LL1 ). Further, a variance value V LL1 for this max (ρ LL1 , θ LL1 ) is calculated. The variance value V LL1 may be obtained only for θ LL1 .

S74において、S73で求めたmax(ρLL1 ,θLL1 )についての分散値VLL1 が、所定の閾値THより大きいか否かを判定し、閾値TH以下である場合には十分な精度で角度が検出できたものとして、S75において、max(ρLL1 ,θLL1 )のθLL1 を入力された画像の傾き角度として出力し、処理を終える。この時点で傾き角度を出力できれば、以降の処理を行わない分だけ処理時間を短縮することができる。 In S74, it is determined whether or not the variance value V LL1 for max (ρ LL1 , θ LL1 ) obtained in S73 is larger than a predetermined threshold value TH. as can be detected in S75, and outputs a tilt angle of max (ρ LL1, θ LL1) entered the theta LL1 of the image, the process ends. If the tilt angle can be output at this time, the processing time can be shortened by the amount that the subsequent processing is not performed.

分散値VLL1 が所定の閾値THより大きい場合には、θLL1 を画像の角度として採用するには十分な精度ではないとして、この例では同じ階層のLLブロック以外のブロック、特にHLブロックかLHブロックのいずれかを用いて、さらに角度を求める。S76において、max(ρLL1 ,θLL1 )のθLL1 が0°<θLL1 <45°または135°<θLL1 <180°か否かを判断する。この角度の場合には傾きが水平に近いので、S77において処理対象をLH1ブロックとし、LH1ブロックを2値化する。S78において、2値化したLH1ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムも、S72と同様の精度で作成すればよい。あるいは、S73で得られた角度をもとに候補範囲を狭め、精度を高めて2次元ヒストグラムを作成してもよい。ここではS72と同様の候補範囲で、0.1°単位で2次元ヒストグラムを作成した。 If the variance value V LL1 is larger than the predetermined threshold value TH, it is assumed that the accuracy is not sufficient to adopt θ LL1 as the angle of the image. In this example, blocks other than the LL block of the same hierarchy, particularly the HL block or LH Using any of the blocks, the angle is further determined. In S76, max (ρ LL1, θ LL1) θ LL1 of determining whether 0 ° <θ LL1 <either 45 ° or 135 ° <θ LL1 <180 ° . In the case of this angle, since the inclination is almost horizontal, the processing target is set to the LH1 block in S77, and the LH1 block is binarized. In S78, the Hough transform is performed on the binarized LH1 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time may be created with the same accuracy as in S72. Alternatively, the candidate range may be narrowed based on the angle obtained in S73, and the two-dimensional histogram may be created with improved accuracy. Here, a two-dimensional histogram is created in units of 0.1 ° in the same candidate range as S72.

S79において、S78で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρLH1 ,θLH1 )とする。S80において、max(ρLH1 ,θLH1 )のθLH1 を入力された画像の傾き角度として出力し、処理を終える。 In S79, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S78. Let this be max (ρ LH1 , θ LH1 ). In S80, max (ρ LH1 , θ LH1 ) θ LH1 is output as the tilt angle of the input image, and the process ends.

S76でmax(ρLL1 ,θLL1 )のθLL1 が0°<θLL1 <45°または135°<θLL1 <180°ではないと判断された場合、すなわち45°<θLL1 <135°の場合には、傾きが垂直に近いので、S81において処理対象をHL1ブロックとし、HL1ブロックを2値化する。S82において、2値化したHL1ブロックについてハフ変換を行い、ρ−θ平面の2次元ヒストグラムを作成する。このとき作成する2次元ヒストグラムも、S78と同様の候補範囲及び精度で作成すればよい。 S76 in max (ρ LL1, θ LL1) If theta LL1 of is determined not to be 0 ° <θ LL1 <45 ° or 135 ° <θ LL1 <180 ° , i.e. when the 45 ° <θ LL1 <135 ° Since the inclination is nearly vertical, the processing target is set as the HL1 block in S81, and the HL1 block is binarized. In S82, a Hough transform is performed on the binarized HL1 block to create a two-dimensional histogram on the ρ-θ plane. The two-dimensional histogram created at this time may be created with the same candidate range and accuracy as in S78.

S83において、S82で作成した2次元ヒストグラムから最大頻度の(ρ,θ)を求める。これをmax(ρHL1 ,θHL1 )とする。S84において、max(ρHL1 ,θHL1 )のθHL1 を入力された画像の傾き角度として出力し、処理を終える。 In S83, the maximum frequency (ρ, θ) is obtained from the two-dimensional histogram created in S82. Let this be max (ρ HL1 , θ HL1 ). In S84, max (ρ HL1, θ HL1) is output as the inclination angle of the input image to theta HL1 of, the process ends.

このように、多階層のウェーブレット変換を行って階層的に角度を検出することによって、精度よく画像の傾き角度を検出することができる。しかも、元の画像のままで同じ精度で角度を検出する場合に比べて高速に検出することができる。   As described above, the angle of the image can be detected with high accuracy by performing multi-layer wavelet transform and detecting the angle hierarchically. In addition, the angle can be detected at a higher speed than when the angle is detected with the same accuracy as the original image.

なお、上述の動作例では分散値の判定を行うための閾値を区別していないが、同じであってもよいし、各階層や、各階層のLLブロックとLH、HLブロックに対する閾値を異ならせてもよい。もちろん、それぞれを任意に設定することができる。   In the above operation example, threshold values for determining a variance value are not distinguished, but they may be the same, or different threshold values may be used for each layer or LL block of each layer and LH and HL blocks. May be. Of course, each can be set arbitrarily.

また、この例では2階層の場合について示したが、3階層以上であっても同様にして階層的に角度を検出することができる。さらに、LHブロックまたはHLブロックを用いずにLLブロックのみにより階層的に角度を検出することもできる。あるいは、LHブロック、HLブロック、HHブロックを合成してハフ変換し、2次元ヒストグラムを作成して最大頻度の(ρ,θ)から当該階層の角度を求めてもよい。   In this example, the case of two layers is shown, but the angle can be detected hierarchically in the same manner even if there are three or more layers. Furthermore, it is possible to detect angles hierarchically only by the LL block without using the LH block or the HL block. Alternatively, the LH block, the HL block, and the HH block may be combined and Hough transformed, a two-dimensional histogram may be created, and the angle of the layer may be obtained from the maximum frequency (ρ, θ).

図6は、本発明の画像傾き検出装置の機能をコンピュータプログラムで実現した場合におけるコンピュータプログラム及びそのコンピュータプログラムを格納した記憶媒体の一例の説明図である。図中、21はプログラム、22はコンピュータ、31は光磁気ディスク、32は光ディスク、33は磁気ディスク、34はメモリ、41は光磁気ディスク装置、42は光ディスク装置、43は磁気ディスク装置である。   FIG. 6 is an explanatory diagram of an example of a computer program and a storage medium storing the computer program when the function of the image tilt detection apparatus of the present invention is realized by a computer program. In the figure, 21 is a program, 22 is a computer, 31 is a magneto-optical disk, 32 is an optical disk, 33 is a magnetic disk, 34 is a memory, 41 is a magneto-optical disk apparatus, 42 is an optical disk apparatus, and 43 is a magnetic disk apparatus.

上述の各実施の形態で説明した各部の機能の一部または全部を、コンピュータにより実行可能なプログラム21によって実現することが可能である。その場合、そのプログラム21およびそのプログラムが用いるデータなどは、コンピュータが読み取り可能な記憶媒体に記憶することも可能である。記憶媒体とは、コンピュータのハードウェア資源に備えられている読取装置に対して、プログラムの記述内容に応じて、磁気、光、電気等のエネルギーの変化状態を引き起こして、それに対応する信号の形式で、読取装置にプログラムの記述内容を伝達できるものである。例えば、光磁気ディスク31,光ディスク32(CDやDVDなどを含む)、磁気ディスク33,メモリ34(ICカード、メモリカードなどを含む)等である。もちろんこれらの記憶媒体は、可搬型に限られるものではない。   Part or all of the functions of the units described in the above embodiments can be realized by a program 21 that can be executed by a computer. In this case, the program 21 and data used by the program can be stored in a computer-readable storage medium. A storage medium is a signal format that causes a state of change in energy such as magnetism, light, electricity, etc. according to the description of a program to a reader provided in the hardware resources of a computer. Thus, the description content of the program can be transmitted to the reading device. For example, there are a magneto-optical disk 31, an optical disk 32 (including a CD and a DVD), a magnetic disk 33, a memory 34 (including an IC card, a memory card, and the like). Of course, these storage media are not limited to portable types.

これらの記憶媒体にプログラム21を格納しておき、例えばコンピュータ22の光磁気ディスク装置41,光ディスク装置42,磁気ディスク装置43,あるいは図示しないメモリスロットにこれらの記憶媒体を装着することによって、コンピュータからプログラム21を読み出し、本発明の画像傾き検出装置の機能を実行することができる。あるいは、ネットワークなどを介してプログラム21をコンピュータ22に転送し、実行させてもよい。   By storing the program 21 in these storage media and mounting these storage media in, for example, the magneto-optical disk device 41, the optical disk device 42, the magnetic disk device 43, or a memory slot (not shown) of the computer 22, The program 21 can be read to execute the function of the image tilt detection apparatus of the present invention. Alternatively, the program 21 may be transferred to the computer 22 via a network or the like and executed.

もちろん、一部の機能についてハードウェアによって構成することもできるし、すべてをハードウェアで構成してもよい。あるいは、他の構成とともに本発明も含めたプログラムとして構成することも可能である。例えば複写機などの画像形成装置における制御プログラムとともに1つのプログラムとして構成し、原稿の傾きを検知するように構成することもできる。もちろん、他の用途に適用する場合には、その用途におけるプログラムとの一体化も可能である。   Of course, some functions may be configured by hardware, or all may be configured by hardware. Alternatively, it can be configured as a program including the present invention together with other configurations. For example, it may be configured as one program together with a control program in an image forming apparatus such as a copying machine so as to detect the inclination of the document. Of course, in the case of application to other purposes, integration with a program for that purpose is also possible.

本発明の実施の一形態を示すブロック図である。It is a block diagram which shows one Embodiment of this invention. ウェーブレット変換部1において行うウェーブレット空間変換の説明図である。It is explanatory drawing of the wavelet space transformation performed in the wavelet transformation part 1. FIG. 一般的なハフ変換の説明図である。It is explanatory drawing of general Hough conversion. 本発明の実施の一形態における動作の一例を示すフローチャートである。It is a flowchart which shows an example of the operation | movement in one Embodiment of this invention. 本発明の実施の一形態における動作の一例を示すフローチャート(続き)である。It is a flowchart (continuation) which shows an example of the operation | movement in one Embodiment of this invention. 本発明の画像傾き検出装置の機能をコンピュータプログラムで実現した場合におけるコンピュータプログラム及びそのコンピュータプログラムを格納した記憶媒体の一例の説明図である。It is explanatory drawing of an example of the storage medium which stored the computer program in the case of implement | achieving the function of the image inclination detection apparatus of this invention with a computer program, and the computer program.

符号の説明Explanation of symbols

1…ウェーブレット変換部、2…角度検出部、11〜16…フィルタ部、21…プログラム、22…コンピュータ、31…光磁気ディスク、32…光ディスク、33…磁気ディスク、34…メモリ、41…光磁気ディスク装置、42…光ディスク装置、43…磁気ディスク装置。   DESCRIPTION OF SYMBOLS 1 ... Wavelet transformation part, 2 ... Angle detection part, 11-16 ... Filter part, 21 ... Program, 22 ... Computer, 31 ... Magneto-optical disk, 32 ... Optical disk, 33 ... Magnetic disk, 34 ... Memory, 41 ... Magneto-optical Disk device 42... Optical disk device 43.

Claims (9)

傾きの検出対象となる画像に対して多階層のウェーブレット空間変換を行う変換手段と、各階層の少なくとも低周波ブロックをハフ変換し前記画像の角度を検出する検出手段を有することを特徴とする画像傾き検出装置。   An image comprising: transform means for performing multi-layer wavelet space transform on an image whose inclination is to be detected; and detection means for detecting an angle of the image by performing Hough transform on at least a low-frequency block in each layer. Tilt detection device. 前記検出手段は、階層の最も深い低周波ブロックをハフ変換して角度を検出した後、所定の精度まで順に階層の深い側から低周波ブロックをハフ変換して角度を修正してゆくことを特徴とする請求項1に記載の画像傾き検出装置。   The detecting means detects the angle by performing a Hough transform on the deepest low-frequency block and then corrects the angle by performing a Hough transform on the low-frequency block from the deeper side in order to a predetermined accuracy. The image inclination detection apparatus according to claim 1. 前記検出手段は、階層が浅いほど細かい角度でハフ変換を行い、ある階層について、前の階層で得られた角度をもとに候補範囲を設定し、該候補範囲について細かい角度でのハフ変換を行って角度を求めることを特徴とする請求項2に記載の画像傾き検出装置。   The detection means performs a Hough transform at a finer angle as the hierarchy is shallower, sets a candidate range based on an angle obtained at a previous hierarchy for a certain hierarchy, and performs a Hough transformation at a fine angle for the candidate range. The image inclination detection device according to claim 2, wherein the angle is obtained by performing the calculation. 前記検出手段は、ハフ変換によって得られたρ−θ平面の2次元ヒストグラムを作成し、各検知角度の分散値を求め、分散値が所定の閾値以下のときに最大頻度となる検知角度を前記画像の角度として検出することを特徴とする請求項1ないし請求項3のいずれか1項に記載の画像傾き検出装置。   The detection means creates a two-dimensional histogram of the ρ-θ plane obtained by the Hough transform, obtains a dispersion value of each detection angle, and determines a detection angle that has a maximum frequency when the dispersion value is equal to or less than a predetermined threshold value. The image inclination detection device according to any one of claims 1 to 3, wherein the image inclination detection device detects the angle of the image. 前記検出手段は、低周波ブロックについてハフ変換により得られたρ−θ平面の2次元ヒストグラムから最大頻度となる検知角度および該検知角度の分散値を求め、分散値が所定の閾値より大きい場合には、前記検知角度から、縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択してハフ変換し、角度を検出することを特徴とする請求項1ないし請求項4のいずれか1項に記載の画像傾き検出装置。   The detection means obtains a detection angle having a maximum frequency and a variance value of the detection angle from a two-dimensional histogram of the ρ-θ plane obtained by the Hough transform for the low frequency block, and when the variance value is larger than a predetermined threshold value. Is characterized in that either one of a block (LH block or HL block) having either a high frequency in the vertical or horizontal direction and a low frequency in the other is selected from the detected angle and subjected to Hough transform to detect the angle. The image inclination detection apparatus according to any one of claims 1 to 4. 前記検出手段は、低周波ブロックについてハフ変換により得られたρ−θ平面の2次元ヒストグラムから最大頻度となる検知角度および各検知角度の分散値を求め、分散値が所定の閾値より大きい場合には、低周波ブロック以外のブロックを合成して前記検知角度を含む候補範囲についてハフ変換し、角度を検出することを特徴とする請求項1ないし請求項4のいずれか1項に記載の画像傾き検出装置。   The detection means obtains the detection frequency and the variance value of each detection angle from the two-dimensional histogram of the ρ-θ plane obtained by the Hough transform for the low frequency block, and when the variance value is larger than a predetermined threshold value 5. The image inclination according to claim 1, wherein blocks other than the low-frequency block are synthesized and Hough transform is performed on a candidate range including the detection angle, and the angle is detected. Detection device. 傾きの検出対象となる画像に対してウェーブレット空間変換を行う変換手段と、ウェーブレット空間の低周波ブロックをハフ変換して概略角度を検出し前記概略角度から縦あるいは横方向のいずれかが高周波で他方が低周波のブロック(LHブロックまたはHLブロック)のいずれか一方を選択してハフ変換し前記画像の角度を検出する検出手段を有することを特徴とする画像傾き検出装置。   A conversion means for performing wavelet space conversion on an image whose inclination is to be detected, and a Hough transform of a low-frequency block in the wavelet space to detect an approximate angle, and either the vertical or horizontal direction from the approximate angle has a high frequency and the other An image inclination detection apparatus comprising: a detecting unit that selects any one of low-frequency blocks (LH block or HL block), performs Hough transform, and detects the angle of the image. 傾きの検出対象となる画像に対してウェーブレット空間変換を行う変換手段と、ウェーブレット空間の低周波ブロックをハフ変換して概略角度を検出した後、他のブロックを合成して前記概略角度を含む候補範囲についてハフ変換し前記画像の角度を検出する検出手段を有することを特徴とする画像傾き検出装置。   A conversion unit that performs wavelet space conversion on an image whose inclination is to be detected, and a candidate that includes the approximate angle by synthesizing other blocks after detecting an approximate angle by Hough transforming a low-frequency block in the wavelet space An image tilt detection apparatus comprising detection means for performing a Hough transform on a range and detecting an angle of the image. コンピュータに、入力された画像の傾きを検出する処理を実行させる画像傾き検出処理プログラムであって、請求項1ないし請求項8のいずれか1項に記載の画像傾き検出装置の機能をコンピュータに実行させることを特徴とする画像傾き検出処理プログラム。   An image inclination detection processing program for causing a computer to execute a process of detecting an inclination of an input image, wherein the function of the image inclination detection device according to any one of claims 1 to 8 is executed on a computer. An image inclination detection processing program characterized in that
JP2006136482A 2006-05-16 2006-05-16 Image tilt detection apparatus and image tilt detection processing program Expired - Fee Related JP4692764B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006136482A JP4692764B2 (en) 2006-05-16 2006-05-16 Image tilt detection apparatus and image tilt detection processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006136482A JP4692764B2 (en) 2006-05-16 2006-05-16 Image tilt detection apparatus and image tilt detection processing program

Publications (2)

Publication Number Publication Date
JP2007310466A true JP2007310466A (en) 2007-11-29
JP4692764B2 JP4692764B2 (en) 2011-06-01

Family

ID=38843284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006136482A Expired - Fee Related JP4692764B2 (en) 2006-05-16 2006-05-16 Image tilt detection apparatus and image tilt detection processing program

Country Status (1)

Country Link
JP (1) JP4692764B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233947A (en) * 2018-03-05 2019-09-13 光宝电子(广州)有限公司 The method and its image processing system of image angle detection

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11328408A (en) * 1998-05-12 1999-11-30 Advantest Corp Device for processing data and information storage medium
JP2004227406A (en) * 2003-01-24 2004-08-12 Ricoh Co Ltd Image processor, program and storage medium
JP2004236230A (en) * 2003-01-31 2004-08-19 Ricoh Co Ltd Image processing apparatus, program, and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11328408A (en) * 1998-05-12 1999-11-30 Advantest Corp Device for processing data and information storage medium
JP2004227406A (en) * 2003-01-24 2004-08-12 Ricoh Co Ltd Image processor, program and storage medium
JP2004236230A (en) * 2003-01-31 2004-08-19 Ricoh Co Ltd Image processing apparatus, program, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233947A (en) * 2018-03-05 2019-09-13 光宝电子(广州)有限公司 The method and its image processing system of image angle detection

Also Published As

Publication number Publication date
JP4692764B2 (en) 2011-06-01

Similar Documents

Publication Publication Date Title
US8768052B2 (en) Image processing apparatus, image processing method, and non-transitory computer readable medium
KR101117837B1 (en) Multi-image feature matching using multi-scale oriented patches
US10839508B2 (en) Integrated circuit image alignment and stitching
US20140125666A1 (en) Apparatus and method for generating depth map of stereoscopic image
JP4522468B2 (en) Image discrimination device, image search device, image search program, and recording medium
BRPI0708452A2 (en) model-based distortion correction method and apparatus
CN111353961B (en) Document curved surface correction method and device
Chen et al. Binary Image Steganalysis Based on Distortion Level Co-Occurrence Matrix.
US20160245641A1 (en) Projection transformations for depth estimation
US20080025643A1 (en) Image processing system, method for processing image and computer readable medium
Sommer et al. Primitect: Fast continuous hough voting for primitive detection
CN1411046A (en) Pattern evaluating apparatus, pattern evaluating method and program
KR101377910B1 (en) Image processing method and image processing apparatus
JP4565396B2 (en) Image processing apparatus and image processing program
JP4692764B2 (en) Image tilt detection apparatus and image tilt detection processing program
JP5699621B2 (en) Image processing apparatus, pixel interpolation method, and program
Shapiro et al. On hausdorff distance measures
US20100158381A1 (en) Image processing device, image processing method, and computer readable medium
JP2007323381A (en) Image inclination detector, image processor, image inclination detection program and image processing program
CN111709419A (en) Method, system and equipment for positioning banknote serial number and readable storage medium
US8155376B2 (en) Image processor, image forming apparatus, image processing method and computer readable medium
CN111402282B (en) Image processing method and device
US8059906B2 (en) Image processing apparatus, image processing method, computer-readable medium and computer data signal
JP2007328652A (en) Image processing device and image processing program
JP4716029B2 (en) Image attribute discrimination device and image attribute discrimination program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101027

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101202

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: 20110126

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: 20110208

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

Free format text: PAYMENT UNTIL: 20140304

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4692764

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees