JP2007295210A - Image processing apparatus, image processing method, image processing program, and recording medium recording the same - Google Patents
Image processing apparatus, image processing method, image processing program, and recording medium recording the same Download PDFInfo
- Publication number
- JP2007295210A JP2007295210A JP2006119979A JP2006119979A JP2007295210A JP 2007295210 A JP2007295210 A JP 2007295210A JP 2006119979 A JP2006119979 A JP 2006119979A JP 2006119979 A JP2006119979 A JP 2006119979A JP 2007295210 A JP2007295210 A JP 2007295210A
- Authority
- JP
- Japan
- Prior art keywords
- image
- line segment
- image processing
- run length
- extracting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
【課題】画像中の線分抽出処理の内容を改善することで、画像の傾き補正の実行速度を向上させ得る画像処理装置を提供する。
【解決手段】画像の傾きを補正する画像処理装置において、画像データを入力する画像入力手段と、該画像内の線分群を抽出する線分抽出手段と、該線分と所定の基準方向との角度を検出する角度検出手段と、該角度検出手段の検出結果に基づいて前記画像を回転させる画像回転手段と、を有し、前記線分抽出手段は、前記画像のエッジ領域からなるエッジ領域群を抽出するエッジ領域抽出手段と、該エッジ領域群に基づいて、所定長さ以上のランレングスからなるランレングス群を抽出するランレングス抽出手段と、を有する画像処理装置とする。
【選択図】 図3An image processing apparatus capable of improving the execution speed of image inclination correction by improving the content of line segment extraction processing in an image.
In an image processing apparatus for correcting the inclination of an image, an image input means for inputting image data, a line segment extraction means for extracting a line segment group in the image, and the line segment and a predetermined reference direction. An angle detection means for detecting an angle; and an image rotation means for rotating the image based on a detection result of the angle detection means, wherein the line segment extraction means is an edge region group consisting of edge regions of the image The image processing apparatus includes an edge region extracting unit for extracting a run length and a run length extracting unit for extracting a run length group composed of run lengths having a predetermined length or more based on the edge region group.
[Selection] Figure 3
Description
本発明は、画像の傾き補正を高速に処理する画像処理装置、画像処理方法、画像処理プログラム、およびこの画像処理プログラムを記録した記録媒体に関する。 The present invention relates to an image processing apparatus, an image processing method, an image processing program, and a recording medium on which the image processing program is recorded.
近年のハードウェアの進歩に伴い、PCのみならず、PDA、携帯電話などをターゲットとした各種情報の電子配信サービスが広がっている。 With recent advances in hardware, various information electronic distribution services targeting not only PCs but also PDAs, mobile phones, and the like are expanding.
例えばマンガを電子配信する場合、コンテンツを画像データとして作成することとなる。この場合、既存の校正済み書籍を基に、(1)原稿のスキャナ入力、(2)画像の傾き補正、(3)各種画像処理による画像の整形、(4)コマ切り出し・エフェクト付与などの人手編集、(5)コンテンツ出力、までの作成過程を辿るのが一般的である。この過程の中で(4)の人手編集以外は、処理の自動化がなされ、ローコストでコンテンツが作成されている。 For example, when manga is distributed electronically, content is created as image data. In this case, on the basis of the existing proofread books, manual operations such as (1) document scanner input, (2) image inclination correction, (3) image shaping by various image processing, (4) frame cutout / effect addition, etc. It is general to follow the creation process up to editing and (5) content output. In this process, except for manual editing (4), the process is automated and the content is created at a low cost.
また上記の一連の過程において、(2)の画像の傾き補正処理は重要な処理の一つである。特に商用コンテンツの場合、その品質を保持するために、高精度に傾きを補正しておく必要がある。 In the above-described series of processes, the image inclination correction process (2) is one of important processes. In particular, in the case of commercial content, it is necessary to correct the inclination with high accuracy in order to maintain the quality.
このような要請に対し、入力画像の傾きを自動的に補正する従来技術は、電子ファイリングシステムや、OCR[Optical Character Reader:光学式文字読取装置]の前処理機能として、既に各種方式で実現されている。また、マンガに特化したものとしては、例えば特許文献1に開示されているものが挙げられる。
In response to such a request, the conventional technology for automatically correcting the tilt of the input image has already been realized in various methods as a pre-processing function of an electronic filing system or OCR [Optical Character Reader]. ing. Moreover, as what specialized in the manga, the thing currently disclosed by
特許文献1に開示されている従来技術は、画像のエッジ画素を抽出し、エッジ画素を連結し、連結したエッジ画素列に方向コードを付与し、方向コードを統合する処理を設けている。これにより、主にマンガのコマ線に該当する画像中の水平・垂直線分を抽出し、抽出した複数の線分の傾き角度から、原稿の傾きを決定し、傾きを補正するものである。
しかしながらこの従来技術は、エッジ画素を連結する際に、注目エッジ画素の8近傍画素を所定の回転方向(従来技術では時計まわり)に見て最初にあたる未連結エッジ画素を連結する処理、すなわち「画素単位の処理」を繰り返すものである。そのため、比較的処理負担が大きく、実行速度が低下するという問題が発生していた。 However, according to this conventional technique, when edge pixels are connected, a process of connecting the first unconnected edge pixel, ie, “pixel”, when the neighboring pixels of the target edge pixel are viewed in a predetermined rotation direction (clockwise in the conventional technique). Unit processing "is repeated. Therefore, there has been a problem that the processing load is relatively large and the execution speed is reduced.
そこで上記の問題点に鑑み、本発明は、画像中の線分抽出処理の内容を改善することで、画像の傾き補正の実行速度を向上させ得る画像処理装置の提供を目的とする。 In view of the above problems, an object of the present invention is to provide an image processing apparatus capable of improving the execution speed of image inclination correction by improving the content of line segment extraction processing in an image.
上記目的を達成すべく、本発明に係る画像処理装置は、画像の傾きを補正する画像処理装置において、画像データを入力する画像入力手段と、該画像内の線分群を抽出する線分抽出手段と、該線分と所定の基準方向との角度を検出する角度検出手段と、該角度検出手段の検出結果に基づいて前記画像を回転させる画像回転手段と、を有し、前記線分抽出手段は、前記画像のエッジ領域からなるエッジ領域群を抽出するエッジ領域抽出手段と、該エッジ領域群に基づいて、所定長さ以上のランレングスからなるランレングス群を抽出するランレングス抽出手段と、を有する構成(第1の構成)とする。 In order to achieve the above object, an image processing apparatus according to the present invention comprises an image input means for inputting image data and a line segment extraction means for extracting a line segment group in the image in the image processing apparatus for correcting the inclination of the image. Angle detection means for detecting an angle between the line segment and a predetermined reference direction, and image rotation means for rotating the image based on a detection result of the angle detection means, and the line segment extraction means An edge region extraction means for extracting an edge region group consisting of edge regions of the image, and a run length extraction means for extracting a run length group consisting of run lengths of a predetermined length or more based on the edge region group; It is set as the structure (1st structure) which has.
本構成によれば、画像の傾き補正に用いられる線分群を、予め抽出されたランレングス群に基づいて抽出することができる。そのため上記した従来技術のように、1画素単位でエッジ画素を連結して線分を抽出するようなものに比べて、画像の傾き補正の実行速度を向上させることができる。また、エッジ領域群を抽出するエッジ領域抽出手段を有しているため、ランレングス群の抽出処理を容易に行うことが可能となっている。 According to this configuration, it is possible to extract a line segment group used for image inclination correction based on a run length group extracted in advance. For this reason, the execution speed of image inclination correction can be improved as compared with the conventional technique in which edge pixels are connected in units of one pixel and line segments are extracted. In addition, since the edge region extraction means for extracting the edge region group is provided, the run length group extraction process can be easily performed.
なおここでの「線分」とは、画像中における画素の集合体であって、その集合状態によりある基準方向(例えば水平方向や垂直方向など)との角度が検出され得るものである。また「線分群」とは、線分の集合(単数である場合も含む)を指すものである。 Here, the “line segment” is an aggregate of pixels in an image, and an angle with a reference direction (for example, a horizontal direction or a vertical direction) can be detected based on the aggregate state. A “line segment group” refers to a set of line segments (including a single segment group).
また「エッジ」とは、異なる属性(例えば黒と白)の画素がある走査方向に隣り合うとき、その境界部に存在する画素を指し、「エッジ領域」とは、エッジの近傍をも含めた一定領域内の画素の集合を指し、「エッジ領域群」とは、エッジ領域の集合(単数の場合も含む)を指す。また「ランレングス」とは、ある走査方向に連続する画素の集合体である。また「ランレングス群」は、ランレングスの集合(単数の場合も含む)を指す。 “Edge” refers to a pixel existing at the boundary when pixels having different attributes (for example, black and white) are adjacent to each other in the scanning direction, and “edge region” includes the vicinity of the edge. A set of pixels in a certain area is referred to, and an “edge area group” refers to a set of edge areas (including a single area). The “run length” is an aggregate of pixels that are continuous in a certain scanning direction. The “run length group” refers to a set of run lengths (including a single case).
また上記第1の構成において、前記線分抽出手段は、前記ランレングス群において、所定の連結関係にあるランレングス同士を統合する統合手段を有し、該統合を行うことにより、前記線分を抽出する構成(第2の構成)としてもよい。 In the first configuration, the line segment extraction unit includes an integration unit that integrates run lengths having a predetermined connection relationship in the run length group, and the line segment is obtained by performing the integration. It is good also as a structure (2nd structure) to extract.
本構成によれば、所定の連結関係にあるランレングス同士が統合されることによって線分が抽出されるため、該抽出処理を画一的かつ確実に実行することができる。なお「連結関係」は、線分を抽出するという目的に沿うものであれば、その内容は限定されない。 According to this configuration, since the line segments are extracted by integrating run lengths having a predetermined connection relationship, the extraction process can be executed uniformly and reliably. The content of the “connection relationship” is not limited as long as it meets the purpose of extracting line segments.
また上記第1または第2の構成において、前記エッジ領域抽出手段は、前記画像のエッジからなるエッジ群を抽出するエッジ抽出手段と、画像を膨張させる膨張手段と、を備えた構成(第3の構成)としてもよい。 In the first or second configuration, the edge region extraction unit includes an edge extraction unit that extracts an edge group including the edges of the image, and an expansion unit that expands the image (third configuration). Configuration).
本構成によれば、画像からエッジ群が抽出され、各エッジを膨張手段によって膨張させることができるから、エッジ領域群の抽出を適切に行うことができる。なおここでの「膨張」とは、ある属性を持つ画素に対し、その画素の近傍の画素(例えば接している4画素や、取り囲む8画素など)についても同じ属性と認識することである。 According to this configuration, the edge group is extracted from the image, and each edge can be expanded by the expansion means. Therefore, the edge region group can be appropriately extracted. Here, “expansion” means that a pixel having a certain attribute is recognized as the same attribute for pixels in the vicinity of the pixel (for example, four pixels in contact with each other and eight surrounding pixels).
また上記第1または第2の構成において、前記エッジ領域抽出手段は、前記画像のエッジからなるエッジ群を抽出するエッジ抽出手段を備え、前記エッジの近傍の画素を抽出することにより、前記エッジ領域群を抽出する構成(第4の構成)としてもよい。 In the first or second configuration, the edge region extraction unit includes an edge extraction unit that extracts an edge group including the edges of the image, and extracts the pixels in the vicinity of the edge, thereby extracting the edge region. It is good also as a structure (4th structure) which extracts a group.
本構成によれば、画像からエッジ群が抽出され、エッジの近傍の画素を抽出することによりエッジ領域群が抽出されるから、該処理を適切に行うことができる。なおここでの「エッジの近傍の画素」とは、例えばエッジ画素に接している4画素やエッジ画素を取り囲む8画素などとしてもよく、後に適切な線分群を抽出するという趣旨に沿う限り、その内容は限定されない。 According to this configuration, the edge group is extracted from the image, and the edge region group is extracted by extracting the pixels in the vicinity of the edge. Therefore, the processing can be appropriately performed. The “pixels in the vicinity of the edge” here may be, for example, 4 pixels in contact with the edge pixel or 8 pixels surrounding the edge pixel, and as long as the appropriate line segment group is extracted later, The content is not limited.
また上記第2から第4の何れかの構成において、前記統合手段は、一のランレングスと他のランレングスが、主走査方向または副走査方向において互いに接している場合に、これらのランレングスを統合させる構成(第5の構成)としてもよい。 Further, in any one of the second to fourth configurations, the integration unit may calculate the run length when one run length and another run length are in contact with each other in the main scanning direction or the sub scanning direction. It is good also as a structure (5th structure) to integrate.
本構成によれば、ランレングス同士が統合された結果、途切れの無い線分を抽出することが可能となる。そのため、該線分を用いた角度検出処理を容易に行うことができる。なおここでの「主走査方向」は、ランレングス抽出に係る走査方向のことである。また以下、画像平面上において「主走査方向」に直交する方向を「副走査方向」とする。 According to this configuration, as a result of the integration of run lengths, it is possible to extract a line segment without interruption. Therefore, the angle detection process using the line segment can be easily performed. The “main scanning direction” here is a scanning direction related to run length extraction. Hereinafter, a direction orthogonal to the “main scanning direction” on the image plane is referred to as a “sub-scanning direction”.
また上記第2から第5の何れかの構成において、前記線分抽出手段は、前記ランレングスの副走査方向の座標に基づく参照範囲情報を用いて、前記統合を行う構成(第6の構成)としてもよい。 In any one of the second to fifth configurations, the line segment extraction unit performs the integration using reference range information based on the coordinates of the run length in the sub-scanning direction (sixth configuration). It is good.
本構成によれば、参照範囲情報(あるランレングスについて、前記連結関係の有無を調べる範囲を定める情報)を用いて統合処理がなされるから、該処理の効率向上が実現でき、ひいては画像の傾き補正をより高速に実行することができる。すなわち、線分を抽出するという目的から、あるランレングスに対する統合対象は、副走査方向において近接したランレングスに限定されることが多い。そこで参照範囲情報を用いて、例えば連結関係のないことが明らかなランレングスを予め調査対象から排除することにより、統合処理の効率向上がなされる。 According to this configuration, since the integration process is performed using the reference range information (information for determining a range for checking the presence or absence of the connection relationship for a certain run length), the efficiency of the process can be improved, and the inclination of the image Correction can be performed at a higher speed. That is, for the purpose of extracting line segments, the integration targets for a certain run length are often limited to run lengths close in the sub-scanning direction. Therefore, by using reference range information, for example, by eliminating run lengths that are apparently not connected, from the investigation object in advance, the efficiency of the integration process is improved.
また上記第2から第6の何れかの構成において、前記線分抽出手段は、前記ランレングス群における各ランレングスのうち副走査方向に隣り合うものを分類する処理を、前記ランレングス群における各ランレングスについて行い、該分類結果に基づいて、前記統合を行う構成(第7の構成)としてもよい。 Further, in any one of the second to sixth configurations, the line segment extraction unit performs a process of classifying the run lengths adjacent to each other in the sub-scanning direction among the run lengths in the run length group. It is good also as a structure (7th structure) which performs about a run length and performs the said integration based on this classification result.
本構成によれば、当該分類結果に基づいて、各ランレングスに隣り合うもののみを連結関係の調査対象とすることができるから、前記統合処理を極めて効率の良いものとすることができる。なおここでの「副走査方向」は、ランレングス抽出に係る副走査方向を指す。 According to this configuration, based on the classification result, only those adjacent to each run length can be investigated as a connection relationship, so that the integration process can be made extremely efficient. Here, the “sub-scanning direction” refers to a sub-scanning direction related to run-length extraction.
また本発明に係る画像処理装置は、画像の傾きを補正する画像処理装置において、画像データを入力する画像入力手段と、該画像内の線分を抽出する線分抽出手段と、該線分と所定の基準方向との角度を検出する角度検出手段と、該角度検出手段の検出結果に基づいて、前記画像を回転させる画像回転手段と、を有する構成(第8の構成)とする。 An image processing apparatus according to the present invention is an image processing apparatus that corrects an inclination of an image, an image input unit that inputs image data, a line segment extraction unit that extracts a line segment in the image, and the line segment. An angle detection unit that detects an angle with a predetermined reference direction and an image rotation unit that rotates the image based on the detection result of the angle detection unit (eighth configuration).
また本発明に係る画像処理方法は、画像の傾きを補正する画像処理方法であって、画像データを入力する画像入力ステップと、該画像内の線分群を抽出する線分抽出ステップと、該線分と所定の基準方向との角度を検出する角度検出ステップと、該検出結果に基づいて前記画像を回転させる画像回転ステップと、を有する方法(第9の方法)とする。 The image processing method according to the present invention is an image processing method for correcting the inclination of an image, wherein an image input step for inputting image data, a line segment extraction step for extracting a line segment group in the image, and the line An angle detection step for detecting an angle between the minute and a predetermined reference direction, and an image rotation step for rotating the image based on the detection result (a ninth method).
また上記第9の方法において、前記線分抽出ステップは、前記画像のエッジからなるエッジ群を抽出するエッジ抽出ステップと、該エッジの近傍の画素を抽出することにより、エッジ領域群を抽出するエッジ領域抽出ステップと、該エッジ領域群に基づいて、所定長さ以上のランレングスからなるランレングス群を抽出するランレングス抽出ステップと、を含み、前記ランレングス群において、所定の連結関係にあるランレングス同士を統合することにより、前記線分群を抽出する方法(第10の方法)であってもよい。 In the ninth method, the line segment extracting step includes an edge extracting step for extracting an edge group consisting of edges of the image, and an edge for extracting an edge region group by extracting pixels in the vicinity of the edge. A region extraction step and a run length extraction step for extracting a run length group consisting of run lengths having a predetermined length or more based on the edge region group, and in the run length group, a run having a predetermined connection relationship is included. A method (tenth method) for extracting the line segment group by integrating the lengths may be used.
本方法によれば、線分抽出ステップにおいて、エッジ群の抽出、エッジ領域群の抽出、およびランレングス群の抽出を経ることで、所定の基準方向との角度を検出するための線分を適切に抽出させることが可能となる。 According to this method, in the line segment extraction step, the line segment for detecting the angle with the predetermined reference direction is appropriately selected through the extraction of the edge group, the extraction of the edge region group, and the extraction of the run length group. Can be extracted.
また、上記第1から第8の何れかの構成に係る画像処理装置を動作させる画像処理プログラムであって、コンピュータを上記の各手段として機能させるための画像処理プログラムであれば、上記した内容の画像処理を、適切なハードウェアを備えたコンピュータに実行させることができる。また、上記画像処理プログラムが記録されたコンピュータ読取り可能な記録媒体も有用である。 An image processing program for operating the image processing apparatus according to any one of the first to eighth configurations, wherein the image processing program causes a computer to function as each of the above-described means. Image processing can be executed by a computer equipped with appropriate hardware. A computer-readable recording medium on which the image processing program is recorded is also useful.
本発明の構成によれば、画像の傾き補正に用いられる線分群を、予め抽出されたランレングス群に基づいて抽出することができる。そのため上記した従来技術のように、1画素単位でエッジ画素を連結して線分を抽出するようなものに比べて、画像の傾き補正の実行速度を向上させることができる。また、エッジ領域群を抽出するエッジ領域抽出手段を有しているため、ランレングス群の抽出処理を容易に行うことが可能となっている。 According to the configuration of the present invention, it is possible to extract a line segment group used for image inclination correction based on a run length group extracted in advance. For this reason, the execution speed of image inclination correction can be improved as compared with the conventional technique in which edge pixels are connected in units of one pixel and line segments are extracted. In addition, since the edge region extraction means for extracting the edge region group is provided, the run length group extraction process can be easily performed.
以下、図面を用いて本発明の実施の形態を説明する。
図1は、本発明にかかる画像処理装置のハードウェア構成を示すブロック図である。
図1を参照して、本発明にかかる画像処理装置は、画像処理装置全体を制御する制御部101と、データが格納されているメモリ部102と、入力処理部103と、入力装置104と、線分抽出部105と、角度検出部106と、回転処理部107で構成されており、各処理部はバス108で接続されている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing a hardware configuration of an image processing apparatus according to the present invention.
Referring to FIG. 1, an image processing apparatus according to the present invention includes a
制御部101は、一般的にはCPU[Central Processing Unit]が該当するが、何らかのハードウェアで構成されていても良い。本願では、画像処理装置全体を制御するブロックを制御部と呼び、その構成は限定しない。
The
メモリ部102は、一般的にはROM[Read Only Memory]とRAM[Random Access Memory]で構成されるが、例えばRAMだけでも良い。本願では、画像処理装置の各種データを保持するブロックをメモリ部と呼び、その構成は限定しない。
The
入力処理部103は、入力装置104とつながっており、入力装置から入力された画像データを2値化し、バス108を介してメモリ部102へ格納する。入力装置104は、一般にはスキャナやカメラなどの画像入力装置である。本願では、画像データを入力する装置を入力装置と呼び、また、その入力データを処理するブロックを入力処理部と呼び、それらの構成は限定しない。
The
線分抽出部105は、入力された2値画像から線分を抽出するブロックであり、角度検出部106は、線分や画像の角度を検出するブロックであり、回転処理部107は、指定した角度に基づき画像を回転するブロックである。これら、線分抽出部105、角度検出部106、および回転処理部107は、CPUを用いてプログラムで実装する事も、何らかのハードウェアで実装する事も可能であり、その構成は限定しない。
The line
図4は、本実施形態にかかる画像処理装置のメモリ部(図1の102)の構成図である。メモリ部102は、入力画像バッファ401、2値画像バッファ402、線分画像バッファ403、エッジ画像バッファ404、線分座標バッファ405、ランレングスバッファ406、候補線分バッファ407、高速検索テーブルバッファ408で構成される。
FIG. 4 is a configuration diagram of the memory unit (102 in FIG. 1) of the image processing apparatus according to the present embodiment. The
このうち、401〜404の画像バッファは、通常、ヘッダー部とデータ部で構成される画像データを格納するものである。通常、ヘッダー部には、少なくとも横画素数や縦画素数が格納される部分がある。一般的にこのような画像データ形式は多数存在し、ヘッダー部やデータ部の構成も様々であるが、本願ではその構成は限定しない。 Among these, the image buffers 401 to 404 normally store image data composed of a header portion and a data portion. Usually, the header portion includes a portion that stores at least the number of horizontal pixels and the number of vertical pixels. In general, there are a large number of such image data formats, and there are various configurations of the header portion and the data portion, but the configurations are not limited in the present application.
図5は、本実施形態にかかる画像処理装置のメモリ部102における、線分座標バッファ(図4の405)の1つの線分データに対する構成図である。
FIG. 5 is a configuration diagram for one line segment data in the line segment coordinate buffer (405 in FIG. 4) in the
線分データは線分抽出部(図1の105)により複数個抽出される。その線分データ1つに対して、線分方向フラグ501、開始X座標502、開始Y座標503、終了X座標504、終了Y座標505、および線分角度506で構成される。線分方向フラグ501には、線分の方向を示すフラグ値が格納され、本実施形態では、水平線分の場合には「1」が、垂直線分の場合には「0」が格納される。502〜505には線分の外接矩形座標が格納される。なお本願では水平方向をX、垂直方向をYと表す。線分角度506には、その線分を対象として検出された基準方向(例えば水平方向)との角度が入る。
A plurality of line segment data is extracted by a line segment extraction unit (105 in FIG. 1). For each piece of line segment data, a line
図6は、本実施形態にかかる画像処理装置のメモリ部(図1の102)における、ランレングスバッファ(図4の406)の1つのランレングスデータに対する構成図である。 FIG. 6 is a configuration diagram for one run-length data in the run-length buffer (406 in FIG. 4) in the memory unit (102 in FIG. 1) of the image processing apparatus according to the present embodiment.
ランレングスデータは線分抽出部(図1の105)により複数個抽出される。そのランレングスデータ1つに対して、統合ラベル601、ラン方向フラグ602、副走査方向座標603、主走査方向開始座標604、および主走査方向終了座標605で構成される。
A plurality of run length data are extracted by a line segment extraction unit (105 in FIG. 1). One run length data is composed of an
統合ラベル601には、統合されたランレングスデータで同じラベル値が付与される。ラン方向フラグ602には、ラン方向を示すフラグ値が格納され、本実施形態では水平ランの場合には「1」が、垂直ランの場合には「0」が格納される。副走査方向座標603には、ラン方向を主走査方向とし、これに直交する副走査方向の座標が付与される。水平ランの場合には垂直方向の座標が、垂直ランの場合には水平方向座標が格納される。604と605には、ラン方向を主走査方向としたランの開始座標と終了座標が、各々格納される。
The same label value is given to the
図7は、本実施形態にかかる画像処理装置のメモリ部(図1の102)の候補線分バッファ(図4の407)における、1つの候補線分データに対する構成図である。 FIG. 7 is a configuration diagram for one candidate line segment data in the candidate line segment buffer (407 in FIG. 4) of the memory unit (102 in FIG. 1) of the image processing apparatus according to the present embodiment.
候補線分データは線分抽出部(図1の105)により複数個抽出される。その候補線分データ1つに対して、統合ラベル701、線分方向フラグ702、開始X座標703、開始Y座標704、終了X座標705、終了Y座標705、評価値707、採用フラグ708で構成される。
A plurality of candidate line segment data are extracted by a line segment extraction unit (105 in FIG. 1). One candidate line segment data is composed of an
統合ラベル701は、候補線分データ毎にユニークな値が付与される。702〜706は、図5の501〜505と同じ意味の情報となる。評価値707は、その候補線分データの評価値が格納される。採用フラグ708は、その候補線分データが採用されたかどうかを示すフラグであり、採用された場合には「1」が、不採用の場合には「0」が入る。なお、採用された候補線分データの702〜706が、501〜505にコピーされる。
The
図8は、本実施形態にかかる画像処理装置のメモリ部(図1の102)における、高速検索テーブルバッファ(図4の408)の1つの高速検索テーブルデータに対する構成図である。 FIG. 8 is a configuration diagram for one high-speed search table data in the high-speed search table buffer (408 in FIG. 4) in the memory unit (102 in FIG. 1) of the image processing apparatus according to the present embodiment.
副走査方向座標801には、ランレングスが存在する副走査方向座標が格納される。開始インデックス802には、ランレングスバッファ内で、801に格納されている副走査座標を有する始めてのランレングスデータインデックスが、終了インデックス803には、ランレングスバッファ内で、801に格納されている副走査座標を有する最後のランレングスデータインデックスが、それぞれ格納される。
The sub-scanning direction coordinate 801 stores the sub-scanning direction coordinate where the run length exists. The
以上が、本発明にかかるブロック図および各データ構造の説明である。以下では、フローチャートを基に本発明の実施例を説明する。図2は、本発明にかかる画像処理装置の全体フローチャートである。この図を基に本発明の全体処理を説明する。 The block diagram and each data structure according to the present invention have been described above. Hereinafter, an embodiment of the present invention will be described based on a flowchart. FIG. 2 is an overall flowchart of the image processing apparatus according to the present invention. The overall processing of the present invention will be described with reference to this figure.
入力処理部103により、入力装置104から画像データを入力する。入力した画像データは入力画像バッファ401に格納される(S201)。入力処理部103により、入力画像バッファ401の内容が読み込まれ2値化処理を行う(S202)。なお、2値化処理とは、モノクロデータ(1画素が例えば0〜255の値で、多諧調で表現されているデータ)に対して、ある閾値を定め、黒の場合は「1」、白の場合は「0」にする処理である。
Image data is input from the
一般的な入力画像データは、カラー、モノクロ、2値などそのデータ形式にバリエーションが考えられるが、カラーの場合は一旦モノクロ化して2値化すればよい。また、2値化には、判別分析など各種手法があるが、本発明ではその2値方式は限定しない。 For general input image data, variations in the data format such as color, monochrome, binary, etc. are conceivable, but in the case of color, it may be converted into monochrome once and binarized. There are various methods such as discriminant analysis for binarization, but the binary method is not limited in the present invention.
2値画像データが2値画像バッファ402に格納される(S203)。線分抽出部105により、2値画像バッファ402に格納された2値画像データを基に線分抽出を行う。この結果は線分画像バッファ403と線分座標バッファ405に格納される(S204)。なお線分抽出処理の内容については、改めて詳述する。
The binary image data is stored in the binary image buffer 402 (S203). The line
角度検出部106により、線分画像バッファ403と線分座標バッファ405に格納された外接矩形座標(502〜505)を基に、線分毎の角度が検出される。検出された角度は線分角度506として格納される(S205)。
The
なお、線分を対象とした角度の検出方法は、例えば、線分画像を微小角度毎に回転させ、その主走査方向の周辺部分(黒画素のヒスグラム)を求め、その周辺分布の分散が最小となる角度を線分の角度として検出する方式などが考えられるが、本発明ではその方式は限定しない。 Note that the angle detection method for line segments is, for example, rotating a line segment image at every minute angle to obtain the peripheral part (black pixel histogram) in the main scanning direction and minimizing the variance of the peripheral distribution. A method of detecting the angle as a line segment angle is conceivable, but the method is not limited in the present invention.
角度検出部106により、線分毎の線分角度506を基に画像全体の角度を決定する(206)。この画像角度決定方法は、例えば、特許文献1に記載されている式1の重み付き平均法などが考えられるが、本発明ではその方式は限定しない。
The
制御部101により、角度検出部106により決定された画像角度を基に、角度検出処理が収束したかどうかを判定する(S207)。収束した場合S209へ分岐し、収束していない場合はS208へ分岐する。角度検出処理が収束していない場合、決定された角度を基に2値画像を回転し、新たな2値画像データを作成しS203に戻る。
The
角度検出処理が収束した場合、決定された角度を基に入力画像バッファ401に格納されている入力画像データを回転し、傾き補正処理を終了する(209)。なお、画像の回転方法は、単純なアフィン変換、線形補間、3次補間などが考えられるが、本発明ではその方式は限定しない。以上が、本発明の全体処理の説明である。
If the angle detection process has converged, the input image data stored in the
図3は、本発明にかかる画像処理装置の線分抽出部のフローチャートであり、図2の全体フローチャートの線分抽出204を詳細化したものである。以下ではこの図3をもとに、本発明の特長となる線分抽出処理を説明する。また、図9は、本発明にかかる画像処理装置の線分抽出処理が対象とする、2値化後の入力画像データの一例である。図9を見て分かる通り、この入力画像は半時計方向に傾いている。
FIG. 3 is a flowchart of the line segment extraction unit of the image processing apparatus according to the present invention, which details the
線分抽出部105により、入力画像図9に対して、エッジ画像抽出(S301)と膨張処理(S302)が行われてエッジ領域群が得られ、この情報がエッジ画像バッファ404に格納される。エッジ画像の抽出方法は、例えば、水平・垂直方向に走査し、白画素(本発明では、画素値が0の画素)から黒画素(本発明では、画素値が1の画素)に変化する箇所を求め、その画素をエッジとして黒画素とし、エッジ以外を白画素とする方法が考えられるが、本発明ではその方式は限定しない。
The line
また、膨張処理の方法は、画像中の全画素を順に走査し、注目画素が黒(エッジ画素)の場合、その4近傍や8近傍画素を全て黒画素に変換する方法などが考えられるが、本発明ではその方式は限定しない。なお、図10は、図9の入力画像に対して、エッジ画像抽出と膨張処理を行った結果の画像である。すなわち膨張処理は、エッジの近傍の画素を抽出し、この抽出した画素にエッジと同じ属性を与えることによって、エッジ領域群を生成する処理ともいえる。 In addition, as a method of expansion processing, all pixels in the image are sequentially scanned, and when the pixel of interest is black (edge pixel), a method of converting all the four or eight neighboring pixels into black pixels can be considered. In the present invention, the method is not limited. FIG. 10 shows an image obtained as a result of performing edge image extraction and expansion processing on the input image shown in FIG. That is, the dilation process is a process of generating an edge region group by extracting pixels in the vicinity of the edge and giving the extracted pixel the same attribute as the edge.
線分抽出部105により、エッジ画像バッファ404を水平・垂直に走査し、長いランレングスだけを抽出し、結果がランレングスバッファ406に格納される(S303)。なおランレングスとは、主走査方向に連続する画素の集合体である。
The line
1つのランレングス毎に図6で示されるデータが作成され、ランレングスバッファ406に格納される。また、長いランレングスとは、例えば、画像のサイズに応じて設定される閾値を用いる方法が考えられる。本願では特にその方式は限定しないが、本発明では、画像の縦もしくは横サイズを30で割った値を閾値として、それよりも長いランレングスだけを抽出するものとする。
The data shown in FIG. 6 is created for each run length and stored in the
図11は、図10の画像に対して、水平・垂直の長いランレングスだけを抽出した結果を図示した図である。この段階で、抽出された1つのランレングスデータ毎に、図6で示すランレングスバッファ406のデータは下表1の通り設定される。
FIG. 11 is a diagram illustrating a result of extracting only a long horizontal / vertical run length from the image of FIG. At this stage, the data of the
また、この段階でのランレングスとランレングスバッファ406の関係を、より具体的に図14に示す。図14の1401は画像を示す。なお原点は左上とする。水平方向には、x0、xs、xeの3つの座標があり、垂直方向には、ys、ye、y0がある。1402は垂直方向のランレングスであり、1403は水平方向のランレングスを示す。
Further, FIG. 14 shows more specifically the relationship between the run length and the
1402の垂直ランレングスの場合、その副走査方向座標はx0であり、その主走査(ラン)方向の開始座標はys、終了座標はyeとなっている。1043の水平ランレングスの場合、その副走査方向座標はy0であり、その主走査(ラン)方向の開始座標はxs、終了座標はxeとなっている。この場合のランレングスバッファ406は、図14の下表に示す内容となっている。
In the case of 1402 vertical run length, the sub-scanning direction coordinate is x0, the start coordinate in the main scanning (run) direction is ys, and the end coordinate is ye. In the case of the 1043 horizontal run length, the sub-scanning direction coordinate is y0, the main scanning (run) direction start coordinate is xs, and the end coordinate is xe. The run-
次に、線分抽出部105により、水平ランと垂直ランを分けて順に走査し、隣り合うラン(水平ランの場合は上下に存在するラン、垂直ランの場合は左右に存在するラン)で、連結関係が存在するものに同じ統合ラベルを付与する方式で、ラン同士を統合する(S304)。なお、連結関係を調べる際には、以下の条件を満足する場合に連結しないと判断する。
Next, the line
条件1:
(注目ランの主走査方向開始座標)−1≧(統合候補ランの主走査方向終了座標)
条件2:
(注目ランの主走査方向終了座標)+1≦(統合候補ランの主走査方向開始座標)
Condition 1:
(Starting coordinate in the main scanning direction of the target run) −1 ≧ (coordinate in the main scanning direction of the integration candidate run)
Condition 2:
(End coordinate in the main scanning direction of the target run) + 1 ≦ (Starting coordinate in the main scanning direction of the integration candidate run)
上記判断により、ランレングス同士が、主走査方向または副走査方向において互いに接している場合(一角を共有する場合も含む)には、連結関係を有するものとされ、そうでない場合には、連結関係を有さないものとされる。なお、連結関係の判断に係る条件は、適切な線分を抽出する目的に沿うものであれば、他の内容であっても構わない。 Based on the above determination, when run lengths are in contact with each other in the main scanning direction or the sub-scanning direction (including a case where a corner is shared), it is assumed that they have a connection relationship. It is assumed that it does not have. Note that the conditions relating to the determination of the connection relationship may be other contents as long as they meet the purpose of extracting an appropriate line segment.
条件1と条件2とも満足しない統合候補ランに、注目ランと同じ統合ラベルを付与する。この判断を、一切の新たな統合が発生しなくなるまで繰り返し、ランの統合を行う。統合処理の結果、連結関係が存在すると判断れたランには、ランレングスバッファ406の、統合ラベル601に、同じ統合ラベル値(1から始まる自然数)が付与される。
The same integration label as that of the target run is assigned to the integration candidate run that does not satisfy both
次に、線分抽出部105により、統合が完了したランレングスバッファ406を走査し、同じ統合ラベルが付与されているランレングスを対象に候補線分バッファ407が作成される(S304)。この段階で、抽出された1つの候補線分データ毎に、図7で示す候補線分バッファ407のデータは下表2の通り設定される。
Next, the line
次に、線分抽出部105により、候補線分バッファ407を走査し、次式1に基づき評価値を計算する(S305)。
Next, the candidate
式1:(評価値)=(主走査方向の長さ)2÷(副走査方向の長さ) Formula 1: (Evaluation value) = (Length in the main scanning direction) 2 ÷ (Length in the sub scanning direction)
この式1は、細長い線分程大きくなる評価値である。線分毎の評価値は対応する候補線分バッファ407の評価値707に格納される。次に、この評価値707を走査し、大きいものから順にある数(本発明では10)だけを採用線分として抽出する。採用と決定したものは、対応する候補線分バッファ407の採用フラグ708に採用を示す「1」が格納される。
This
次に、線分抽出部105により、候補線分バッファ407を走査し、採用フラグ708が「1」になっている採用線分だけの線分画像が作成され、線分画像バッファ403に格納される(S306)。図12は、図11のランレングス抽出結果に基づき、線分統合、採用線分が決定された結果、線分画像バッファ403に格納された画像の図である。
Next, the line
次に、線分抽出部105により、候補線分バッファ407を走査し、採用フラグ708が「1」になっている採用線分だけを対象として、その情報を線分座標バッファ405にコピーする(S307)。この場合、線分方向フラグ702が501に、開始X座標703が502に、開始Y座標704が503に、終了X座標705が504に、終了Y座標706が505にそれぞれコピーされる。
Next, the line
以上が、本発明にかかる画像処理装置の線分抽出処理である。上述の通り、従来技術では1画素単位にエッジ画素を連結していたが、本発明では、ランレングスという複数の画素を統合した単位処理できるため、高速化が実現できる。また、ランレングスの抽出はハード化が容易であり、その場合、さらなる高速化も期待できる。 The above is the line segment extraction processing of the image processing apparatus according to the present invention. As described above, edge pixels are connected in units of one pixel in the prior art. However, in the present invention, unit processing that integrates a plurality of pixels called run lengths can be performed, so that high speed can be realized. In addition, the run length can be easily extracted, and in that case, further increase in speed can be expected.
しかしながら、図3のフローチャートの線分抽出304では、注目ランレングスに対して連結関係の存在するランレングスを、ランレングスバッファ406内を全て走査して探すことになり、この部分に冗長な処理が含まれる。結局は、隣り合うラン(水平ランの場合は上下に存在するラン。垂直ランの場合は左右に存在するラン)に対して、条件1、条件2で連結関係を判断するため、注目ランレングスの副走査方向座標に対して、±1の副走査方向座標を有するランレングスだけを対象にすればよく、全走査することが冗長である。この問題を解決し、さらに高速化を図る手段を本発明は提供する。
However, in the
図15は、本発明にかかる線分抽出部105の線分抽出(水平・垂直ラン統合)304を詳細化したフローチャートである。また、図16は、ランレングスとランレングスバッファ406の関連図である。まず、図16を基に高速化の原理を説明する。
FIG. 15 is a detailed flowchart of the line segment extraction (horizontal / vertical run integration) 304 of the line
図16は便宜上水平方向のランレングスだけを図示しているが原理は垂直方向のランレングスでも同様である。そのため、以降の説明では、水平・垂直を区別せず、ラン方向を主走査方向と、ラン方向に直行する方向を副走査方向と呼ぶ。 FIG. 16 shows only the horizontal run length for the sake of convenience, but the principle is the same for the vertical run length. Therefore, in the following description, without distinguishing between horizontal and vertical, the run direction is referred to as the main scanning direction, and the direction orthogonal to the run direction is referred to as the sub-scanning direction.
図16の1601は画像を示し、1602はランレングスバッファを示す。ランレングスは副走査方向に1座標毎にずらし、1つの副走査方向座標に対して主走査方向にランを抽出する。そのため、ランレングスは大局的に見れば副走査方向の順に並んでいる。ただし、1つの副走査方向座標に対してランレングスが存在しない場合も、また、複数存在する場合もある。この関係を図16では示しており、画像1601内のランレングスを着色矩形(注目ランレングスについては斜線矩形)で示し、それに対応するランレングスバッファ406内の格納場所を破線矢印で示している。
In FIG. 16, 1601 indicates an image, and 1602 indicates a run-length buffer. The run length is shifted by one coordinate in the sub-scanning direction, and a run is extracted in the main scanning direction with respect to one sub-scanning direction coordinate. For this reason, the run lengths are arranged in the order of the sub-scanning direction when viewed globally. However, there may be no run length or a plurality of run lengths for one sub-scanning direction coordinate. This relationship is shown in FIG. 16, and the run length in the
注目ランレングスに対して、全ランレングスバッファ要素である1602の全てを評価対象とする必要はなく、注目ランレングスの副走査方向座標に対して、±1の副走査方向座標を有するもの(副走査方向に隣り合うもの)だけを対象とすればよいことが分かる。具体的には、図16ではこの範囲は、1603から1604の間だけとなる。
All the run
すなわち、ランレングス群における各ランレングスのうち、副走査方向に隣り合うものを分類する処理を、ランレングス群における各ランレングスについて行っておく。そしてこの分類結果に係る情報(ランレングスの副走査方向の座標に基づく参照範囲情報)を用いて、ランレングス同士の連結関係の有無の調査を行うこととする。本発明の線分抽出(水平・垂直ランレングスの統合)の高速化手法はこの内容に着目しており、以下、図15を用いて説明する。 In other words, among the run lengths in the run length group, a process of classifying adjacent run lengths in the sub-scanning direction is performed for each run length in the run length group. Then, by using information related to the classification result (reference range information based on the run-length coordinates in the sub-scanning direction), it is determined whether or not there is a connection relationship between the run lengths. The speed-up method of line segment extraction (integration of horizontal and vertical run lengths) of the present invention pays attention to this content, and will be described below with reference to FIG.
まず、高速検索テーブル408を作成する(S1501)。この高速検索テーブル408は1つのデータが図8で示されるデータであり、ランレングスバッファ406の全要素を走査し、同じラン方向フラグと同じ副走査方向座標を持つ2つ以上のランレングスに対して、ランレングスバッファ406内のインデックス番号の小さいものを開始インデックス802に、ランレングスバッファ406内のインデックス番号の大きいものを終了インデックス803に、順次格納することで作成する。
First, the high-speed search table 408 is created (S1501). In the high-speed search table 408, one piece of data is the data shown in FIG. 8, all elements of the
もし、ある副走査方向座標に対して、1つもランレングスが存在しない場合は、図8のデータは作成されず、また、1つだけランレングスが存在する場合は、開始インデックス802と終了インデックス803の値は、同じ値となる。(その1つのランレングスを示すランレングスバッファ406内のインデックス番号となる。)
If no run length exists for a certain sub-scanning direction coordinate, the data of FIG. 8 is not created, and if only one run length exists, the
次に、各種変数を0クリアする(S1502)。この変数はメモリ上の変数でもレジスタでも、ハードウェアのカウンターでもなんでも良い。本発明では「統合ラベル」と「統合フラグ」と「現統合ラベル」3変数を使用する。 Next, various variables are cleared to 0 (S1502). This variable can be a memory variable, a register, or a hardware counter. In the present invention, three variables “integrated label”, “integrated flag”, and “current integrated label” are used.
次に、注目ランレングスを設定する(S1503)。これは、ランレングスバッファ406内のインデックス番号を1つずつインクリメントして、現在統合対象となるラン方向フラグ602を有しているものを探し、注目ランレングスに設定する。
Next, an attention run length is set (S1503). This increments the index number in the run-
注目ランレングスに既に統合ラベルが付与されている場合(統合ラベルが未統合を示す「−1」でない場合)、その値を「現統合ラベル」変数に設定する。「−1」の場合「統合ラベル」変数の値を「現統合ラベル」変数に設定し、「統合ラベル」変数の値をインクリメントする。また、注目ランレングスの統合ラベル601には、統合ラベルの値を設定する。
If the target run length has already been given an integrated label (if the integrated label is not “−1” indicating unintegrated), the value is set in the “current integrated label” variable. In the case of “−1”, the value of the “integrated label” variable is set to the “current integrated label” variable, and the value of the “integrated label” variable is incremented. In addition, an integrated label value is set in the
次に、走査開始/終了インデックスを取得する(S1504)。開始インデックスは、高速検索テーブル408を走査し、その副走査方向座標801が、注目ランレングスの副走査方向座標603の「−1」の座標値となるものの開始インデックス802とし、終了インデックスは、高速検索テーブル408を走査し、その副走査方向座標801が、注目ランレングスの副走査方向座標603の「+1」の座標値となるものの終了インデックス802とすることで取得できる。
Next, a scan start / end index is acquired (S1504). The start index scans the high-speed search table 408, and the sub-scanning direction coordinate 801 is a
図16で言えば、斜線矩形を注目ランレングスとした場合、開始インデックスが1603として、終了インデックスが1604として取得される。なお、開始インデックスが設定できない場合は、「(注目ランレングスの副走査方向座標)−1」に統合すべきランレングスが無いため、開始インデックスを「(注目ランレングスのインデックス番号)+1」と設定し、終了インデックスが設定できない場合は、同様の理由で終了インデックスを「(注目ランレングスのインデックス番号)−1」と設定する。 In FIG. 16, when the hatched rectangle is the target run length, the start index is acquired as 1603 and the end index is acquired as 1604. If the start index cannot be set, there is no run length to be integrated into “(target run length sub-scanning direction coordinate) −1”, and therefore the start index is set to “(target run length index number) +1”. If the end index cannot be set, the end index is set to “(target run length index number) −1” for the same reason.
次に、開始インデックスから終了インデックスで示されるランレングスバッファ406内の各ランレングスデータを順に走査し、注目ランレングスに対して、条件1、条件2で統合可能か判断し、統合できる場合は、そのランレングスの統合ラベル601に「現統合ラベル」変数の値を設定し、「統合フラグ」変数の値をインクリメントする(S1505)。
Next, each run-length data in the run-
注目ランレングスが終了かどうか判断し、まだ、存在する場合はS1503へ分岐する。もうない場合はS1507へ分岐する(S1506)。「統合フラグ変数」が「0」であるかどうかを判断し、「0」でない場合はS1502へ分岐する。「0」の場合は統合処理が完了したとして終了する(S1507)。 It is determined whether or not the run length of interest ends, and if it still exists, the process branches to S1503. If there is no more, the process branches to S1507 (S1506). It is determined whether the “integration flag variable” is “0”. If it is not “0”, the process branches to S1502. In the case of “0”, it is determined that the integration process is completed (S1507).
以上のように、本発明にかかる画像処理装置は、傾き補正を高速に処理する手段を提供する。なお本発明にかかる画像処理装置が、図9の入力画像に対して傾きを補正した結果の画像を、図13に示す。特に、高速処理が要求される複写機などの場合、本発明にかかる画像処理装置は有効に活用される。 As described above, the image processing apparatus according to the present invention provides means for processing tilt correction at high speed. FIG. 13 shows an image obtained as a result of correcting the tilt of the input image shown in FIG. 9 by the image processing apparatus according to the present invention. In particular, in the case of a copying machine or the like that requires high-speed processing, the image processing apparatus according to the present invention is effectively used.
さらに、上述した構成の画像処理装置を動作させる画像処理プログラムを提供することもできる。このようなプログラムであれば、適切なハードウェアを備えているコンピュータに、上述した利点を享受し得る画像処理を行わせることが可能となる。 Furthermore, an image processing program for operating the image processing apparatus having the above-described configuration can be provided. With such a program, it is possible to cause a computer equipped with appropriate hardware to perform image processing that can enjoy the above-described advantages.
またこのようなプログラムは、コンピュータに付属するフレキシブルディスク、CD−ROM[Compact Disc _Read Only Memory]、ROM[Read Only Memory]、RAM[Random Access Memory]およびメモリカードなどのコンピュータ読み取り可能な記録媒体にて記録させて、プログラムを提供することもできる。また、ネットワークを介したダウンロードによって、プログラムを提供することもできる。 Such a program is stored in a computer-readable recording medium such as a flexible disk attached to the computer, a CD-ROM [Compact Disc_Read Only Memory], a ROM [Read Only Memory], a RAM [Random Access Memory], and a memory card. It is also possible to provide a program by recording them. A program can also be provided by downloading via a network.
提供されるプログラム製品は、ハードディスクなどのプログラム格納部にインストールされて実行される。なお、プログラム製品は、プログラム自体とプログラムが記録された記録媒体とを含む。今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The provided program product is installed in a program storage unit such as a hard disk and executed. The program product includes the program itself and a recording medium on which the program is recorded. The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
本発明の画像処理装置、画像処理方法、画像処理プログラム、記録媒体は、高速処理が要求される複写機などに適用可能である。 The image processing apparatus, image processing method, image processing program, and recording medium of the present invention can be applied to a copying machine that requires high-speed processing.
101 制御部
102 メモリ部
103 入力処理部
104 入力装置
105 線分抽出部
106 角度検出部
107 回転処理部
108 バス
401 入力画像バッファ
402 2値画像バッファ
403 線分画像バッファ
404 エッジ画像バッファ
405 線分座標バッファ
406 ランレングスバッファ
407 候補線分バッファ
408 高速検索テーブルバッファ
1401 画像
1402 垂直方向のランレングス
1403 水平方向のランレングス
1601 画像
1602 ランレングスバッファ
DESCRIPTION OF
Claims (12)
画像データを入力する画像入力手段と、
該画像内の線分群を抽出する線分抽出手段と、
該線分と所定の基準方向との角度を検出する角度検出手段と、
該角度検出手段の検出結果に基づいて前記画像を回転させる画像回転手段と、を有し、
前記線分抽出手段は、
前記画像のエッジ領域からなるエッジ領域群を抽出するエッジ領域抽出手段と、
該エッジ領域群に基づいて、所定長さ以上のランレングスからなるランレングス群を抽出するランレングス抽出手段と、を有することを特徴とする画像処理装置。 In an image processing apparatus that corrects the tilt of an image,
Image input means for inputting image data;
Line segment extraction means for extracting line segments in the image;
Angle detection means for detecting an angle between the line segment and a predetermined reference direction;
Image rotation means for rotating the image based on the detection result of the angle detection means,
The line segment extracting means includes
Edge region extraction means for extracting an edge region group consisting of edge regions of the image;
An image processing apparatus comprising: a run length extracting unit that extracts a run length group including run lengths having a predetermined length or more based on the edge region group.
前記ランレングス群において、所定の連結関係にあるランレングス同士を統合する統合手段を有し、
該統合を行うことにより、前記線分を抽出することを特徴とする請求項1に記載の画像処理装置。 The line segment extracting means includes
In the run length group, having an integration means for integrating run lengths in a predetermined connection relationship,
The image processing apparatus according to claim 1, wherein the line segment is extracted by performing the integration.
前記画像のエッジからなるエッジ群を抽出するエッジ抽出手段と、
画像を膨張させる膨張手段と、を備えたことを特徴とする請求項1または請求項2に記載の画像処理装置。 The edge region extraction means includes
Edge extraction means for extracting an edge group consisting of edges of the image;
The image processing apparatus according to claim 1, further comprising an expansion unit configured to expand an image.
前記画像のエッジからなるエッジ群を抽出するエッジ抽出手段を備え、
前記エッジの近傍の画素を抽出することにより、前記エッジ領域群を抽出することを特徴とする請求項1または請求項2に記載の画像処理装置。 The edge region extraction means includes
Edge extraction means for extracting an edge group consisting of edges of the image,
The image processing apparatus according to claim 1, wherein the edge region group is extracted by extracting pixels in the vicinity of the edge.
一のランレングスと他のランレングスが、主走査方向または副走査方向において互いに接している場合に、これらのランレングスを統合させることを特徴とする請求項2から請求項4の何れかに記載の画像処理装置。 The integration means includes
5. The run length according to claim 2, wherein when one run length and another run length are in contact with each other in the main scanning direction or the sub-scanning direction, these run lengths are integrated. Image processing apparatus.
前記ランレングスの副走査方向の座標に基づく参照範囲情報を用いて、前記統合を行うことを特徴とする請求項2から請求項5の何れかに記載の画像処理装置。 The line segment extracting means includes
The image processing apparatus according to claim 2, wherein the integration is performed using reference range information based on coordinates in the sub-scanning direction of the run length.
前記ランレングス群における各ランレングスのうち副走査方向に隣り合うものを分類する処理を、前記ランレングス群における各ランレングスについて行い、
該分類結果に基づいて、前記統合を行うことを特徴とする請求項2から請求項6の何れかに記載の画像処理装置。 The line segment extracting means includes
A process for classifying adjacent run lengths in the run length group in the sub-scanning direction is performed for each run length in the run length group,
The image processing apparatus according to claim 2, wherein the integration is performed based on the classification result.
画像データを入力する画像入力手段と、
該画像内の線分を抽出する線分抽出手段と、
該線分と所定の基準方向との角度を検出する角度検出手段と、
該角度検出手段の検出結果に基づいて、前記画像を回転させる画像回転手段と、
を有することを特徴とする画像処理装置。 In an image processing apparatus that corrects the tilt of an image,
Image input means for inputting image data;
Line segment extraction means for extracting line segments in the image;
Angle detection means for detecting an angle between the line segment and a predetermined reference direction;
Image rotation means for rotating the image based on the detection result of the angle detection means;
An image processing apparatus comprising:
画像データを入力する画像入力ステップと、
該画像内の線分群を抽出する線分抽出ステップと、
該線分と所定の基準方向との角度を検出する角度検出ステップと、
該検出結果に基づいて前記画像を回転させる画像回転ステップと、
を有することを特徴とする画像処理方法。 An image processing method for correcting image inclination,
An image input step for inputting image data;
A line segment extraction step of extracting a line segment group in the image;
An angle detection step of detecting an angle between the line segment and a predetermined reference direction;
An image rotation step for rotating the image based on the detection result;
An image processing method comprising:
前記画像のエッジからなるエッジ群を抽出するエッジ抽出ステップと、
該エッジの近傍の画素を抽出することにより、エッジ領域群を抽出するエッジ領域抽出ステップと、
該エッジ領域群に基づいて、所定長さ以上のランレングスからなるランレングス群を抽出するランレングス抽出ステップと、を含み、
前記ランレングス群において、所定の連結関係にあるランレングス同士を統合することにより、前記線分群を抽出することを特徴とする請求項9に記載の画像処理方法。 The line segment extraction step includes:
An edge extraction step of extracting an edge group consisting of edges of the image;
An edge region extraction step of extracting an edge region group by extracting pixels in the vicinity of the edge;
A run length extraction step for extracting a run length group consisting of run lengths of a predetermined length or more based on the edge region group, and
The image processing method according to claim 9, wherein in the run length group, the line group group is extracted by integrating run lengths having a predetermined connection relationship.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006119979A JP2007295210A (en) | 2006-04-25 | 2006-04-25 | Image processing apparatus, image processing method, image processing program, and recording medium recording the same |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006119979A JP2007295210A (en) | 2006-04-25 | 2006-04-25 | Image processing apparatus, image processing method, image processing program, and recording medium recording the same |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2007295210A true JP2007295210A (en) | 2007-11-08 |
Family
ID=38765390
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006119979A Pending JP2007295210A (en) | 2006-04-25 | 2006-04-25 | Image processing apparatus, image processing method, image processing program, and recording medium recording the same |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2007295210A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010009420A (en) * | 2008-06-27 | 2010-01-14 | Canon Inc | Image processing apparatus and image processing method |
| US8411170B2 (en) | 2009-01-30 | 2013-04-02 | Nikon Corporation | Image processing device and image processing program |
| CN115096878A (en) * | 2022-04-06 | 2022-09-23 | 新绎健康科技有限公司 | A kind of detection method and system of stool test paper |
| WO2023195216A1 (en) * | 2022-04-07 | 2023-10-12 | 株式会社島津製作所 | Data processing method, program, image processing device, and scanning probe microscope |
-
2006
- 2006-04-25 JP JP2006119979A patent/JP2007295210A/en active Pending
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010009420A (en) * | 2008-06-27 | 2010-01-14 | Canon Inc | Image processing apparatus and image processing method |
| US8411170B2 (en) | 2009-01-30 | 2013-04-02 | Nikon Corporation | Image processing device and image processing program |
| CN115096878A (en) * | 2022-04-06 | 2022-09-23 | 新绎健康科技有限公司 | A kind of detection method and system of stool test paper |
| WO2023195216A1 (en) * | 2022-04-07 | 2023-10-12 | 株式会社島津製作所 | Data processing method, program, image processing device, and scanning probe microscope |
| JPWO2023195216A1 (en) * | 2022-04-07 | 2023-10-12 | ||
| JP7740527B2 (en) | 2022-04-07 | 2025-09-17 | 株式会社島津製作所 | Data processing method, program, image processing device, and scanning probe microscope |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3308032B2 (en) | Skew correction method, skew angle detection method, skew correction device, and skew angle detection device | |
| US6043823A (en) | Document processing system which can selectively extract and process regions of a document | |
| US5335290A (en) | Segmentation of text, picture and lines of a document image | |
| JP5854802B2 (en) | Image processing apparatus, image processing method, and computer program | |
| JP2001109895A (en) | Processing method for digital images | |
| US6968085B2 (en) | Document matching and annotation lifting | |
| JPH11219407A (en) | Document image recognition device and storage medium for document image recognition program | |
| EP1017011A2 (en) | Block selection of table features | |
| JP4535584B2 (en) | Digital image processing method | |
| US8077976B2 (en) | Image search apparatus and image search method | |
| US6947596B2 (en) | Character recognition method, program and recording medium | |
| JPH0418351B2 (en) | ||
| JP2007295210A (en) | Image processing apparatus, image processing method, image processing program, and recording medium recording the same | |
| JPH064704A (en) | Ruled line discriminating method and area discriminating method | |
| JP3187895B2 (en) | Character area extraction method | |
| JP2006072839A (en) | Image processing method, image processing apparatus, image processing program, and recording medium | |
| JP2001101399A (en) | Image skew detection / margin detection / skew correction method and document image processing apparatus | |
| JP3402755B2 (en) | Area division method | |
| JP3817442B2 (en) | Image recognition apparatus, image recognition method, program for realizing image recognition method, and recording medium for the program | |
| JP2003331299A (en) | Reduced image display device, method, program, and recording medium recording program | |
| JP6922365B2 (en) | Document processing equipment and programs | |
| JP3380024B2 (en) | Document image processing method and document image processing apparatus | |
| JP2001076158A (en) | Image processing method and apparatus and medium | |
| JP6127685B2 (en) | Information processing apparatus, program, and shape recognition method | |
| JP3024234B2 (en) | Document image ruled line extraction device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20071116 |