JP2006270387A - Image processor and method and program - Google Patents

Image processor and method and program Download PDF

Info

Publication number
JP2006270387A
JP2006270387A JP2005084175A JP2005084175A JP2006270387A JP 2006270387 A JP2006270387 A JP 2006270387A JP 2005084175 A JP2005084175 A JP 2005084175A JP 2005084175 A JP2005084175 A JP 2005084175A JP 2006270387 A JP2006270387 A JP 2006270387A
Authority
JP
Japan
Prior art keywords
document
scanning direction
image
image data
shift amount
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
Application number
JP2005084175A
Other languages
Japanese (ja)
Inventor
Kazuhiko Fukaya
和彦 深谷
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 JP2005084175A priority Critical patent/JP2006270387A/en
Publication of JP2006270387A publication Critical patent/JP2006270387A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processor and a method and a program capable of correcting the inclination of a read original image at a higher speed. <P>SOLUTION: When an original is inclined and read in the case of a reading by an image-data reading section 101, starting-point coordinates and end-point coordinates are extracted at every main scanning line by an original discriminating section 102, and the movement (the quantity of a displacement) in the horizontal direction and the vertical direction is computed by a displacement detecting section 103 from the extracted starting-point coordinates and end-point coordinates. The inclination is corrected by shifting a movement section in the horizontal direction and the vertical direction respectively by an inclination correcting section 104 on the basis of the computed movement (the quantity of the displacement). <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、スキャナなどの画像読取装置を用いて読み込んだ画像データに対して画像処理を行う画像処理装置および方法およびプログラムに関し、特に、画像の傾きを補正できるようにした画像処理装置および方法およびプログラムに関する。   The present invention relates to an image processing apparatus, method, and program for performing image processing on image data read using an image reading apparatus such as a scanner, and more particularly to an image processing apparatus, method, and method capable of correcting an image inclination. Regarding the program.

一般に、スキャナなどの画像読取装置を用いて原稿画像のイメージデータを形成する処理では、あらかじめ指定された基点に該原稿画像を配置し、読み取ることによってイメージデータである画像データの生成を行っている。このときの基点に指定される位置として、四隅のいずれかを指定することが大多数を占める。これは四隅を基点にすることで印刷される原稿画像の縦と横を読み取り面に対してそれぞれ水平垂直に配置しやすいなどの理由からである。   In general, in the process of forming image data of an original image using an image reading device such as a scanner, image data as image data is generated by arranging and reading the original image at a predetermined base point. . Designating one of the four corners as the position designated as the base point at this time occupies the majority. This is because, by using the four corners as base points, the vertical and horizontal sides of the printed document image can be easily arranged horizontally and vertically with respect to the reading surface.

しかしながら、ちょっとした配置ミスや静電気などが生じることにより原稿画像がずれて配置されてしまうことがあり、この場合、生成したイメージデータの画像データが斜めに作成され、場合によっては、原稿画像の一部が読み取られないなどの問題が発生することがある。   However, a slight misplacement or static electricity may cause the document image to be misaligned. In this case, the image data of the generated image data is created obliquely, and in some cases, a part of the document image is generated. May not be able to be read.

このため、スキャナなどによって読み取った原稿画像がユーザの所望のイメージとは異なった見づらい画像データになってしまうことがある。   For this reason, the document image read by the scanner or the like may be difficult to see image data different from the user's desired image.

特許文献1に開示された従来技術においては、複数の走査線における原稿部画像が存在する範囲を比較して画像の傾きを検出することにより、簡単にかつ迅速に画像の傾き角を検出することを可能にしており、さらにこの従来技術では、検出された傾き角に応じて画像の傾きを補正するも可能にしている。
特開平05−274475
In the prior art disclosed in Patent Document 1, the inclination angle of an image is detected easily and quickly by comparing the range in which the original image is present on a plurality of scanning lines and detecting the inclination of the image. In addition, this prior art also makes it possible to correct the inclination of the image according to the detected inclination angle.
JP 05-274475

しかしながら、特許文献1に開示された従来技術においては、読み込んだ画像データの傾きを補正する際に補正された画像データを再度、メモリ領域に格納する必要があり、多くの画像データを扱う場面においては、システムとしてメモリの肥大化を招く結果になってしまうという問題がある。さらに、メモリ領域に再格納することによる処理時間の増大を招いてしまうという問題がある。   However, in the prior art disclosed in Patent Document 1, it is necessary to store the corrected image data again in the memory area when correcting the inclination of the read image data. There is a problem that this results in an increase in memory as a system. Furthermore, there is a problem that processing time is increased due to re-storage in the memory area.

そこで、本発明は、読み取った原稿画像の傾きをより高速に補正できるようにした画像処理装置および方法およびプログラムを提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides an image processing apparatus, method, and program capable of correcting the inclination of a read original image at higher speed.

上記目的を達成するため、請求項1の発明は、原稿画像を画像読取装置で読み取って得た画像データの処理を行う画像処理装置において、前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを抽出する原稿識別手段と、前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を算出する第1のズレ量算出手段と、前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を算出する第2のズレ量算出手段と、前記第1のズレ量算出手段による主走査方向のズレ量と前記第2のズレ量算出手段による副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正する傾き補正手段とを具備することを特徴とする。   In order to achieve the above object, according to a first aspect of the present invention, in an image processing apparatus for processing image data obtained by reading an original image with an image reading apparatus, the image data is identified for each scanning line. Then, a document identifying means for extracting the start point coordinates and the end point coordinates of the document image portion, and a shift amount in the main scanning direction is calculated from the start point coordinates and the end point coordinates of the document image portion extracted by the document identifying means. A first shift amount calculation unit; a second shift amount calculation unit that calculates a shift amount in the sub-scanning direction from a start point coordinate and an end point coordinate of the document image portion extracted by the document identification unit; and the first shift amount. The inclination of the document portion in the image data is corrected by correcting the position of each pixel from the amount of deviation in the main scanning direction by the amount calculating means and the amount of deviation in the sub-scanning direction by the second deviation amount calculating means. Characterized by comprising a tilt correction means.

また、請求項2の発明は、請求項1の発明において、前記傾き補正手段は、前記第1のズレ量算出手段により算出した主走査方向のズレ量の始点座標と終点座標がはじめに同一となる副走査方向の走査線を副走査方向の原稿部分の開始座標として傾き補正することを特徴とする。   According to a second aspect of the present invention, in the first aspect of the invention, the tilt correction unit is configured such that the start point coordinate and the end point coordinate of the shift amount in the main scanning direction calculated by the first shift amount calculation unit are the same at first. The tilt correction is performed using the scanning line in the sub-scanning direction as the start coordinate of the document portion in the sub-scanning direction.

また、請求項3の発明は、原稿画像を画像読取装置で読み取って得た画像データの処理を行う画像処理方法において、前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを原稿識別手段で抽出し、前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を第1のズレ量算出手段で算出し、前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を第2のズレ量算出手段で算出し、前記第1のズレ量算出手段による主走査方向のズレ量と前記第2のズレ量算出手段による副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正することを特徴とする。   According to a third aspect of the present invention, in the image processing method for processing image data obtained by reading an original image with an image reading apparatus, the image data is identified for each scanning line, and the original image portion is identified. The starting point coordinates and the end point coordinates of the part are extracted by the document identifying means, and the shift amount in the main scanning direction is calculated by the first shift amount calculating means from the start point coordinates and the end point coordinates of the document image portion extracted by the document identifying means. The amount of deviation in the sub-scanning direction is calculated by the second amount of deviation calculating means from the start point coordinates and the end point coordinates of the original image portion calculated and extracted by the original identifying means, and the main amount by the first amount of deviation calculating means is calculated. The inclination of the document portion in the image data is corrected by correcting the position of each pixel from the amount of deviation in the scanning direction and the amount of deviation in the sub-scanning direction by the second deviation amount calculating means.

また、請求項4の発明は、原稿画像を画像読取装置で読み取って得た画像データの処理をコンピュータを用いて行う画像処理プログラムであって、前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを抽出する第1のステップと、前記第1のステップにより抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を算出する第2のステップと、前記第1のステップにより抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を算出する第3のステップと、前記第2のステップによる主走査方向のズレ量と前記第3のステップによる副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正する第4のステップとを含むことを特徴とする。   According to a fourth aspect of the present invention, there is provided an image processing program for performing processing of image data obtained by reading an original image with an image reading apparatus using a computer, wherein the image data is converted into the original image portion for each scanning line. A first step of identifying and extracting a start point coordinate and an end point coordinate of the document image portion; and a deviation amount in the main scanning direction from the start point coordinate and the end point coordinate of the document image portion extracted by the first step. A second step of calculating, a third step of calculating a shift amount in the sub-scanning direction from the start point coordinates and the end point coordinates of the document image portion extracted in the first step, and a main step of the second step. A fourth scan for correcting the inclination of the document portion in the image data by correcting the position of each pixel from the shift amount in the scanning direction and the shift amount in the sub-scanning direction in the third step. Tsu, characterized in that it comprises a flop.

本発明によれば、スキャナなどの画像読取装置を用いて読み取った画像データの原稿部分を走査線ごとに識別し、その原稿部分の始点と終点の座標を抽出することで主走査方向、副走査方向の両方向のズレ量を算出して原稿の傾き補正を行うような構成にしたので、読み取った画像データに対して原稿部分の傾き補正を行うことができるためメモリの読み書きに要する時間を省略でき、より高速に傾き補正を行うことが可能となるという効果を奏する。   According to the present invention, a document portion of image data read by using an image reading device such as a scanner is identified for each scanning line, and the coordinates of the start point and end point of the document portion are extracted, so that the main scanning direction and sub-scanning are performed. Since the document skew correction is performed by calculating the amount of deviation in both directions, it is possible to correct the document skew for the read image data, so the time required for memory read / write can be omitted. As a result, the tilt correction can be performed at a higher speed.

以下、本発明に係わる画像処理装置および方法およびプログラムの一実施例を添付図面を参照して詳細に説明する。   Hereinafter, an image processing apparatus, method, and program according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

図1は、この発明に係わる画像処理装置および方法およびプログラムを適用して構成した画像処理装置の装置構成図である。   FIG. 1 is an apparatus configuration diagram of an image processing apparatus configured by applying an image processing apparatus, method and program according to the present invention.

図1において、この画像処理装置は、画像データ読取部101、原稿識別部102、ズレ検出部103、傾き補正部104、画像メモリ105、出力部106を具備して構成され、画像データ読取部101で読み取った画像データの傾きを傾き補正部104で補正し、補正された画像データを出力部106で出力する。   In FIG. 1, the image processing apparatus includes an image data reading unit 101, a document identification unit 102, a deviation detection unit 103, an inclination correction unit 104, an image memory 105, and an output unit 106. The inclination correction unit 104 corrects the inclination of the image data read in step S, and the corrected image data is output by the output unit 106.

画像データ読取部101は、CCD(Charge Coupled Devices:電荷結合素子)などにより構成され、原稿の読み取りを行うことで画像データを形成する。読み取った画像データは走査線(ライン)ごとにラインバッファに記憶される。   The image data reading unit 101 includes a CCD (Charge Coupled Device) or the like, and forms image data by reading a document. The read image data is stored in the line buffer for each scanning line (line).

原稿識別部102は、画像データ読取部101により読み取られた画像データの原稿部分を識別する。読み取った画像データには上下左右に余白となるマージンが設けられているおり、このマージン以外の部分である原稿部分を識別する。特に、読み取った画像データの原稿部分が傾いた状態で読み取られた場合には、主走査線ごとに原稿部と非原稿部とを識別する。   The document identification unit 102 identifies the document part of the image data read by the image data reading unit 101. The read image data is provided with margins that are margins on the top, bottom, left, and right, and a document portion that is a portion other than the margin is identified. In particular, when the original portion of the read image data is read in an inclined state, the original portion and the non-original portion are identified for each main scanning line.

このとき、原稿部として識別されると、主走査線ごとに原稿部の始点座標と終点座標とを抽出し、抽出した始点座標と終点座標を主走査線ごとにレジスタに格納する。例えば、主走査線2ライン目の「始点座標:17」「終点座標:19」のように格納される。   At this time, when the document portion is identified, the start point coordinates and end point coordinates of the document portion are extracted for each main scanning line, and the extracted start point coordinates and end point coordinates are stored in the register for each main scanning line. For example, “start point coordinate: 17” and “end point coordinate: 19” of the second main scanning line are stored.

ズレ検出部103は、原稿識別部102により識別された原稿部分の始点座標と終点座標に基づいて水平方向(主走査線方向)と垂直方向(副走査線方向)の移動量(以下、「ズレ量」ともいう)を算出する。   The deviation detection unit 103 is based on the start point coordinate and the end point coordinate of the document part identified by the document identification unit 102, and is moved in the horizontal direction (main scanning line direction) and the vertical direction (sub-scanning line direction) (hereinafter referred to as “deviation”). (Also referred to as “quantity”).

このときの水平方向の移動量である水平移動量Xと垂直方向の移動量である垂直移動量Yの算出例を以下の図4に示す。   An example of calculating the horizontal movement amount X, which is the horizontal movement amount at this time, and the vertical movement amount Y, which is the vertical movement amount, is shown in FIG.

傾き補正部104は、画像データ読取部101により読み取った画像データを一時的に記憶するラインバッファを保持しており、ラインバッファに記憶された画像データに対して、ズレ検出部103で検出された水平移動量Xと垂直移動量Yに基づき各移動方向にその移動量分だけシフトさせることにより画像データ全体の傾きを補正する。   The inclination correction unit 104 holds a line buffer that temporarily stores the image data read by the image data reading unit 101, and is detected by the deviation detection unit 103 with respect to the image data stored in the line buffer. Based on the horizontal movement amount X and the vertical movement amount Y, the inclination of the entire image data is corrected by shifting each movement direction by the movement amount.

すなわち、傾き補正は主走査線方向の走査線(ライン)ごとに行われ、補正されたラインごとに画像メモリ105に画像データとして保存する。   That is, the inclination correction is performed for each scanning line (line) in the main scanning line direction, and is stored as image data in the image memory 105 for each corrected line.

画像メモリ105は、RAM(Random Access Memory)などにより構成され、画像データ読取部101で読み取った画像データに対して傾き補正部104で補正した画像データをラインごとに記憶し、全てのラインに対して補正された画像データを記憶する記憶領域である。   The image memory 105 is configured by a RAM (Random Access Memory) or the like, stores image data corrected by the inclination correction unit 104 for the image data read by the image data reading unit 101 for each line, and for all lines. This is a storage area for storing the corrected image data.

出力部106は、画像メモリ105に記憶された傾き補正後の画像データを出力する。例えば、ネットワーク回線を介して接続されたクライアントPCなどの上位装置に対して出力することが可能である。   The output unit 106 outputs the image data after tilt correction stored in the image memory 105. For example, it is possible to output to a host device such as a client PC connected via a network line.

このような構成によれば、画像データ読取部101での読み取り時に原稿が傾いて読み取られた場合、原稿識別部102で主走査線ごとに始点座標と終点座標を抽出し、抽出した始点座標と終点座標から水平方向と垂直方向との移動量(ズレ量)をズレ検出部103で算出する。そして、算出した移動量(ズレ量)に基づいて傾き補正部104で移動量分を水平方向、垂直方向それぞれにシフトさせることで傾き補正を行うことができる。   According to such a configuration, when the document is read while being tilted by the image data reading unit 101, the document identification unit 102 extracts the start point coordinates and the end point coordinates for each main scanning line, and the extracted start point coordinates and A displacement detection unit 103 calculates a movement amount (deviation amount) between the horizontal direction and the vertical direction from the end point coordinates. Then, the inclination correction can be performed by shifting the movement amount in the horizontal direction and the vertical direction by the inclination correction unit 104 based on the calculated movement amount (deviation amount).

図2は、図1に示す原稿識別部の処理の流れを示すフローチャートである。   FIG. 2 is a flowchart showing a flow of processing of the document identifying unit shown in FIG.

図2において、ユーザが読み取りを行う原稿を画像データ読み取り部にセットして読み取りの開始を指示すると処理が開始され、原稿の読み取りが行われ(S201)、初期化処理(FEフラグを「0(ゼロ)」に設定)が行われる(S202)。原稿の読み取りは主走査方向の1ラインごとに行われる。   In FIG. 2, when the user sets a document to be read in the image data reading unit and instructs to start reading, the process is started, the document is read (S201), and the initialization process (FE flag is set to “0”). Is set to “zero)”) (S202). Document reading is performed for each line in the main scanning direction.

読み取った主走査方向1ラインに対して原稿部と非原稿部を識別する原稿部輪郭読取処理を行う(S203)。1ライン全てが非原稿部である場合にはそのライン上に原稿部がないことを識別する。それに対して、一画素でも原稿部を識別した場合には識別した原稿部の始点座標と終点座標とを抽出する。   A document portion outline reading process for identifying a document portion and a non-document portion is performed for one line in the main scanning direction read (S203). If all the lines are non-original parts, it is identified that there is no original part on that line. On the other hand, when the document portion is identified even with one pixel, the start point coordinates and end point coordinates of the identified document portion are extracted.

1ライン上全てが非原稿部であるか判断し(S204)、少なくとも一画素、原稿部を識別した場合(S204でNO)には、識別した原稿部の始点座標と終点座標とを主走査方向のラインごとにレジスタに格納する座標格納処理を行う(S205)。そして、原稿部を識別したことを受けて初期化処理したFEフラグを「0(ゼロ)」から「1」に更新する(S206)。   It is determined whether all of one line is a non-original part (S204), and when at least one pixel and an original part are identified (NO in S204), the start point coordinates and end point coordinates of the identified original part are determined in the main scanning direction. A coordinate storing process for storing in the register for each line is performed (S205). Then, the FE flag that has been initialized in response to the identification of the document portion is updated from “0 (zero)” to “1” (S206).

FEフラグの更新完了または主走査方向のライン全てが非原稿部である(S204でYES)ことを受けて、FEフラグが「0(ゼロ)」であるか判断する(S207)。すなわち、ライン全てが非原稿部である場合にはFEフラグが「0(ゼロ)」であって、少なくとも一画素、原稿部を識別した場合にはFEフラグが「1」であることを判断する。   In response to the completion of the update of the FE flag or the fact that all lines in the main scanning direction are non-original portions (YES in S204), it is determined whether the FE flag is “0 (zero)” (S207). That is, if all lines are non-original parts, the FE flag is “0 (zero)”, and if at least one pixel is identified, the FE flag is “1”. .

FEフラグが「0(ゼロ)」の場合(S207でYES)には、再度、原稿部輪郭読取処理203から繰り返し処理を行う。FEフラグが「0(ゼロ)」でない場合(S207でNO)には、続いて、全てのラインに対して上記の処理を実行したか判断し(S208)、全てのラインに対して実行していない場合(S208でNO)には、同様に原稿部輪郭読取処理203から繰り返し処理を行う。全てのラインを実行した場合には処理を終了する。   If the FE flag is “0 (zero)” (YES in S207), the document part contour reading process 203 is repeated again. If the FE flag is not “0 (zero)” (NO in S207), it is subsequently determined whether the above processing has been executed for all lines (S208), and is executed for all lines. If there is not (NO in S208), the document part outline reading process 203 is similarly repeated. If all lines have been executed, the process is terminated.

これにより、読み取った画像データに対して原稿部と非原稿部とを識別することができ、原稿部と識別された場合には主走査方向の走査線ごとに始点座標と終点座標をレジスタに記憶することができる。   As a result, it is possible to discriminate between the original portion and the non-original portion with respect to the read image data. When the original portion is identified, the start point coordinates and the end point coordinates are stored in the register for each scanning line in the main scanning direction. can do.

図3は、図1に示すズレ検出部と傾き補正部の処理の流れを示すフローチャートである。   FIG. 3 is a flowchart showing a flow of processing of the deviation detecting unit and the inclination correcting unit shown in FIG.

図3では、原稿識別部で原稿部と非原稿部とが識別されると処理が開始され、原稿識別部でレジスタに格納された主走査線ごとの始点座標と終点座標とから垂直方向の移動量(垂直移動量:Y)と水平方向の移動量(水平移動量:X)を算出し(S301)、垂直方向の移動量Yが存在するか判断する(S302)。移動量が存在する場合(S302でYES)には、画像データ読取部により読み取った画像データが一時的に記憶されたラインバッファから1ラインごとに画像データを取得して、算出した垂直移動量Yと水平移動量Xとに基づいて画素をシフトさせることにより傾き補正を行い、同時に画像データを画像メモリに出力する。   In FIG. 3, the process starts when the document identification unit identifies the document part and the non-document part, and the document identification unit moves in the vertical direction from the start point coordinates and the end point coordinates stored in the register in the register. An amount (vertical movement amount: Y) and a horizontal movement amount (horizontal movement amount: X) are calculated (S301), and it is determined whether there is a vertical movement amount Y (S302). If there is a movement amount (YES in S302), the image data read by the image data reading unit is acquired for each line from the line buffer in which the image data is temporarily stored, and the calculated vertical movement amount Y And the horizontal movement amount X to correct the tilt by shifting the pixels, and simultaneously output the image data to the image memory.

垂直移動量Yが存在しない場合(S302でNO)には、画像データの傾きが存在しないと判断して処理を終了する。   If the vertical movement amount Y does not exist (NO in S302), it is determined that there is no inclination of the image data, and the process ends.

これにより、傾いた状態で読み取った画像データの主走査線ごとの移動量(ズレ量)を算出することができ、これに基づいた傾き補正ができるようになる。   Thereby, it is possible to calculate the movement amount (deviation amount) for each main scanning line of the image data read in a tilted state, and to perform tilt correction based on this.

図4は、ズレ検出部による垂直移動量と水平移動量の具体的な算出例を示す図である。   FIG. 4 is a diagram illustrating a specific calculation example of the vertical movement amount and the horizontal movement amount by the deviation detection unit.

図4には、画像データ読取部により読み取った状態での画像データを示しており、ここに示す図では、原稿の右肩が左肩に比べて高い位置で読み取れた例を示している。   FIG. 4 shows image data in a state of being read by the image data reading unit. In the drawing shown here, an example in which the right shoulder of the document is read at a position higher than the left shoulder is shown.

この画像データにおいて、原稿識別部102によって原稿部として識別される走査線ごとの始点座標と終点座標は以下のようになる。   In this image data, the starting point coordinates and the ending point coordinates for each scanning line identified as the document part by the document identifying part 102 are as follows.

1ライン目は、原稿部が識別されないため始点座標、終点座標ともに存在しない
2ライン目は、始点座標:17、終点座標:19
3ライン目は、始点座標:11、終点座標:19
4ライン目は、始点座標: 5、終点座標:19
5ライン目は、始点座標: 2、終点座標:20
6ライン目は、始点座標: 2、終点座標:20
7ライン目は、始点座標: 2、終点座標:20
8ライン目は、始点座標: 3、終点座標:20
上記に示す原稿部の始点座標と終点座標の情報によって5ライン目と6ライン目の始点座標、終点座標がともに同値になり、このことから5ライン目を垂直方向の基準に設定する。これは、各ラインの水平方向のズレ量が始点座標と終点座標が一度同値になった後に、再度、水平方向のズレ量が発生することによるものである。
In the first line, since the original part is not identified, neither the start point coordinates nor the end point coordinates exist. The second line has start point coordinates: 17 and end point coordinates: 19
The third line has a start point coordinate: 11 and an end point coordinate: 19
The fourth line has a start point coordinate of 5 and an end point coordinate of 19
The fifth line has start point coordinates: 2, end point coordinates: 20
The 6th line has start point coordinates: 2, end point coordinates: 20
The seventh line has a start point coordinate: 2 and an end point coordinate: 20.
On the 8th line, start point coordinate: 3, end point coordinate: 20
The starting point coordinates and the ending point coordinates of the fifth line and the sixth line are equal to each other based on the information on the starting point coordinates and the ending point coordinates of the original portion described above. Therefore, the fifth line is set as the vertical reference. This is because the horizontal shift amount of each line again occurs after the start point coordinate and the end point coordinate are once the same value.

すなわち、2ライン目から5ライン目の情報で読み取った原稿全体の垂直方向のズレ量Yが算出されることになり、5ライン目以降で順次、水平方向のズレ量Xが算出されることになる。ここに示す例では、8ライン目で水平方向へのズレ量が「1」となる。   That is, the vertical deviation amount Y of the entire original read by the information from the second line to the fifth line is calculated, and the horizontal deviation amount X is sequentially calculated from the fifth line onward. Become. In the example shown here, the amount of deviation in the horizontal direction at the eighth line is “1”.

そして、垂直方向のズレ量Yは、画像データを6ライン目まで読み取った時点で算出することができ、水平方向のズレ量Xは、原稿部が識別される最後のラインまで読み取った時点で算出することができる。   The vertical displacement amount Y can be calculated when the image data is read up to the sixth line, and the horizontal displacement amount X is calculated when the original line is read to the last line. can do.

これにより算出されたズレ量は、
1ライン目がズレ量Y:0、ズレ量X:0
2ライン目がズレ量Y:0、ズレ量X:0
3ライン目がズレ量Y:1、ズレ量X:0
4ライン目がズレ量Y:2、ズレ量X:0
5ライン目がズレ量Y:3、ズレ量X:0
6ライン目がズレ量Y:3、ズレ量X:0
7ライン目がズレ量Y:3、ズレ量X:0
8ライン目がズレ量Y:3、ズレ量X:1
となる。1ライン目から4ライン目までのズレ量Xは基準となる5ライン目に至る前の読み取り段階であるため「0(ゼロ)」となる。また、5ライン目が基準であってその5ライン目と始点座標、終点座標ともに等しい値である6ライン目のズレ量Xは「0(ゼロ)」となる。さらに、7ライン目も5ライン目、6ライン目と始点座標と終点座標が同じであるため同様にズレ量Xは「0(ゼロ)」となる。
The amount of deviation calculated by this is
The first line is misalignment amount Y: 0, misalignment amount X: 0
The second line is misalignment amount Y: 0, misalignment amount X: 0
The third line is misalignment amount Y: 1, misalignment amount X: 0
The fourth line is misalignment amount Y: 2, misalignment amount X: 0
The fifth line is misalignment amount Y: 3, misalignment amount X: 0
The sixth line is misalignment amount Y: 3, misalignment amount X: 0
The seventh line is misalignment amount Y: 3, misalignment amount X: 0
Eighth line is misalignment amount Y: 3, misalignment amount X: 1
It becomes. The deviation amount X from the first line to the fourth line is “0 (zero)” because it is the reading stage before the fifth line as a reference. Further, the shift amount X of the sixth line, which is based on the fifth line and has the same start point coordinates and end point coordinates as the fifth line, is “0 (zero)”. Further, since the start point coordinates and the end point coordinates of the seventh line are the same as those of the fifth and sixth lines, the deviation amount X is similarly “0 (zero)”.

そして、8ライン目で始点座標が基準となる5ライン目の始点座標「2」に比べて1つズレた「3」となっていることから8ライン目のズレ量Xは「1」と算出できる。   Then, since the start point coordinate at the 8th line is “3” which is shifted by 1 from the start point coordinate “2” at the 5th line, the shift amount X at the 8th line is calculated as “1”. it can.

垂直方向、水平方向への移動量(ズレ量Y、ズレ量X)分を移動量分だけシフトさせることにより傾き補正を行うと、以下のようになる。   When tilt correction is performed by shifting the amount of movement in the vertical and horizontal directions (deviation amount Y, deviation amount X) by the amount of movement, the following results.

まず、1ライン目から4ライン目までは画像データの画素が存在しない状態になる。 First, there is no image data pixel from the first line to the fourth line.

次に、5ライン目で2ライン目の座標17から19の画素、3ライン目の座標11から16の画素、4ライン目の座標5から10の画素、5ライン目の座標2から4の画素がマスクされる。このとき、水平方向のズレ量Xは「0(ゼロ)」であるため水平方向へのシフトは行われない。 Next, on the fifth line, the pixels on the second line from coordinates 17 to 19; the third line on the coordinates from 11 to 16; the fourth line on the coordinates from 5 to 10; the fifth line on the coordinates from 2 to 4 Is masked. At this time, since the horizontal shift amount X is “0 (zero)”, the shift in the horizontal direction is not performed.

また、6ライン目で3ライン目の座標17から19の画素、4ライン目の座標11から16の画素、5ライン目の座標5から10の画素、6ライン目の座標2から4の画素がマスクされる。このときも水平方向のズレ量Xは「0(ゼロ)」であるため水平方向へのシフトは行われない。 In the sixth line, pixels 17 to 19 on the third line, pixels 11 to 16 on the fourth line, pixels 5 to 10 on the fifth line, and pixels 2 to 4 on the sixth line. Masked. At this time as well, the horizontal shift amount X is “0 (zero)”, so the shift in the horizontal direction is not performed.

以下同様に、主走査方向の走査線ごとに処理を行うと図6に示すような画像データに補正される。   Similarly, when processing is performed for each scanning line in the main scanning direction, the image data is corrected as shown in FIG.

図5は、図1に示す傾き補正部の処理の流れを示すフローチャートである。   FIG. 5 is a flowchart showing a flow of processing of the inclination correction unit shown in FIG.

図5において、ズレ検出部で垂直移動量と水平移動量が算出されると、算出された垂直移動量が存在しない(垂直方向の移動量がゼロ)か判断し(S501)、垂直移動量が存在しない場合(S501でYES)には、処理を終了する。また、垂直移動量が存在する場合(S501でNO)には、読み取った画像データに傾きが存在するとして、ズレ検出部で算出した垂直方向の移動量Yに基づいてラインごとにシフトする垂直傾き補正処理を行う(S502)。   In FIG. 5, when the displacement detection unit calculates the vertical movement amount and the horizontal movement amount, it is determined whether or not the calculated vertical movement amount exists (the vertical movement amount is zero) (S501). If it does not exist (YES in S501), the process ends. If there is a vertical movement amount (NO in S501), it is assumed that there is an inclination in the read image data, and the vertical inclination is shifted for each line based on the vertical movement amount Y calculated by the deviation detection unit. Correction processing is performed (S502).

次に、算出された水平移動量が存在しない(水平方向の移動量がゼロ)か判断し(S503)、水平方向の移動量が存在しない場合(S503でYES)には、次のラインに対する垂直傾き補正処理(S502)を行う。   Next, it is determined whether the calculated horizontal movement amount does not exist (the horizontal movement amount is zero) (S503). If there is no horizontal movement amount (YES in S503), the vertical movement with respect to the next line is determined. An inclination correction process (S502) is performed.

水平方向の移動量が存在する場合(S503でNO)には、ズレ検出部で算出した水平方向の移動量Xに基づいてラインごとにシフトする水平傾き補正処理を行う(S504)。   If there is a horizontal movement amount (NO in S503), a horizontal inclination correction process is performed to shift line by line based on the horizontal movement amount X calculated by the shift detection unit (S504).

これにより、水平方向、垂直方向ともに原稿部がシフトされ、傾きが補正された状態となる。   As a result, the document portion is shifted in both the horizontal direction and the vertical direction, and the inclination is corrected.

図6は、図4に示す読み取られた画像データに対して傾き補正を行った補正後の画像データを示す図である。   FIG. 6 is a diagram showing corrected image data obtained by performing tilt correction on the read image data shown in FIG.

図6には、図4に示す各ラインに対して以下のように補正される。   In FIG. 6, correction is performed as follows for each line shown in FIG.

主走査方向1〜4ライン目:
画像データなし
主走査方向5ライン目:
主走査方向5ライン目の副走査方向2〜4ライン目
主走査方向4ライン目の副走査方向5〜10ライン目
主走査方向3ライン目の副走査方向11〜16ライン目
主走査方向2ライン目の副走査方向17〜19ライン目
主走査方向6ライン目:
主走査方向6ライン目の副走査方向2〜4ライン目
主走査方向5ライン目の副走査方向5〜10ライン目
主走査方向4ライン目の副走査方向11〜16ライン目
主走査方向3ライン目の副走査方向17〜19ライン目
主走査方向7ライン目:
主走査方向7ライン目の副走査方向2〜4ライン目
主走査方向6ライン目の副走査方向5〜10ライン目
主走査方向5ライン目の副走査方向11〜16ライン目
主走査方向4ライン目の副走査方向17〜19ライン目
主走査方向8ライン目:
主走査方向8ライン目の副走査方向3〜4ライン目
主走査方向7ライン目の副走査方向5〜10ライン目
主走査方向6ライン目の副走査方向11〜16ライン目
主走査方向5ライン目の副走査方向17〜20ライン目
これにより、主走査方向、副走査方向ともに傾き補正を行った画像データを形成することができる。
1st to 4th lines in the main scanning direction:
No image data 5th line in the main scanning direction:
2nd to 4th lines in the sub-scanning direction of the 5th line in the main scanning direction
4th line in the main scanning direction 5th to 10th lines in the sub scanning direction
11th to 16th lines in the sub-scanning direction in the 3rd line in the main scanning direction
17th to 19th lines in the sub-scanning direction of the second line in the main scanning direction 6th line in the main scanning direction:
6th line in the main scanning direction 2nd to 4th lines in the sub-scanning direction
5th to 10th lines in the sub-scanning direction of the 5th line in the main scanning direction
11th to 16th lines in the sub-scanning direction of the 4th line in the main scanning direction
17th to 19th lines in the sub-scanning direction of the 3rd line in the main scanning direction 7th line in the main scanning direction:
7th line in the main scanning direction 2nd to 4th lines in the sub-scanning direction
5th to 10th lines in the sub-scanning direction of the 6th line in the main scanning direction
11th to 16th lines in the sub-scanning direction of the fifth line in the main scanning direction
4th line in the main scanning direction 17th to 19th lines in the sub scanning direction 8th line in the main scanning direction:
8th line in the main scanning direction 3rd to 4th lines in the sub-scanning direction
5th to 10th lines in the sub-scanning direction of the 7th line in the main scanning direction
11th to 16th lines in the sub-scanning direction of the 6th line in the main scanning direction
Thus, the image data in which the tilt correction is performed in both the main scanning direction and the sub-scanning direction can be formed.

以上の処理によって、本発明の画像処理装置では、読み取った画像データが傾いた状態にあってもその傾きを補正することができる。   Through the above processing, the image processing apparatus of the present invention can correct the tilt of the read image data even when the read image data is tilted.

さらに、画像メモリへの記憶時に傾き補正を行うことができる。   Further, tilt correction can be performed during storage in the image memory.

従って、本発明を適用することにより、傾き角の検出やメモリの読み書きにかかる読み書き処理が不要となるためより高速に傾き補正を行うことができるようになるという効果を期待できる。   Therefore, by applying the present invention, it is possible to expect an effect that the tilt correction can be performed at a higher speed since the read / write processing related to the detection of the tilt angle and the read / write of the memory becomes unnecessary.

また、傾きのない画像データを短時間で出力することが可能となる。   Further, it is possible to output image data having no inclination in a short time.

なお、上記フローチャートに示す処理は、コンピュータにより実行可能な画像処理プログラムによっても実現できる。   The processing shown in the flowchart can also be realized by an image processing program that can be executed by a computer.

本発明は、上記し、且つ図面に示す実施例に限定することなく、その要旨を変更しない範囲内で適宜変形して実施できるものである。   The present invention is not limited to the embodiments described above and shown in the drawings, and can be implemented with appropriate modifications within the scope not changing the gist thereof.

本発明は、スキャナなどの画像読取装置を用いて読み込んだ画像データの傾きを補正する画像処理装置および方法およびプログラムに適用可能であり、特に、画像データの原稿部分の傾きをより高速に補正するのに有用である。   The present invention can be applied to an image processing apparatus, method, and program for correcting the inclination of image data read using an image reading apparatus such as a scanner, and in particular, correcting the inclination of a document portion of image data at higher speed. Useful for.

この発明に係わる画像処理装置および方法およびプログラムを適用して構成した画像処理装置の装置構成図。1 is a block diagram of an image processing apparatus configured by applying an image processing apparatus, method and program according to the present invention. 図1に示す原稿識別部の処理の流れを示すフローチャート。3 is a flowchart showing a flow of processing of a document identification unit shown in FIG. 図1に示すズレ検出部と傾き補正部の処理の流れを示すフローチャート。The flowchart which shows the flow of a process of the deviation detection part and inclination correction | amendment part which are shown in FIG. 画像データ読取部により原稿が傾いた状態で読み取られた画像データを示す図。The figure which shows the image data read in the state in which the original document inclined by the image data reading part. 図1に示す傾き補正部の処理の流れを示すフローチャート。The flowchart which shows the flow of a process of the inclination correction | amendment part shown in FIG. 図4に示す読み取られた画像データに対して傾き補正を行った補正後の画像データを示す図。The figure which shows the image data after correction which performed inclination correction with respect to the read image data shown in FIG.

符号の説明Explanation of symbols

101 画像データ読取部
102 原稿識別部
103 ズレ検出部
104 傾き補正部
105 画像メモリ
106 出力部
DESCRIPTION OF SYMBOLS 101 Image data reading part 102 Document identification part 103 Displacement detection part 104 Inclination correction part 105 Image memory 106 Output part

Claims (4)

原稿画像を画像読取装置で読み取って得た画像データの処理を行う画像処理装置において、
前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを抽出する原稿識別手段と、
前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を算出する第1のズレ量算出手段と、
前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を算出する第2のズレ量算出手段と、
前記第1のズレ量算出手段による主走査方向のズレ量と前記第2のズレ量算出手段による副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正する傾き補正手段と
を具備することを特徴とする画像処理装置。
In an image processing apparatus that processes image data obtained by reading a document image with an image reading apparatus,
Document identifying means for identifying the document image portion of the image data for each scanning line and extracting the start point coordinates and the end point coordinates of the document image portion;
First shift amount calculation means for calculating a shift amount in the main scanning direction from the start point coordinates and end point coordinates of the document image portion extracted by the document identification means;
Second displacement amount calculating means for calculating a displacement amount in the sub-scanning direction from the start point coordinates and the end point coordinates of the document image portion extracted by the document identifying means;
By correcting the position of each pixel from the shift amount in the main scanning direction by the first shift amount calculating unit and the shift amount in the sub-scanning direction by the second shift amount calculating unit, the inclination of the document portion in the image data is corrected. An image processing apparatus comprising: an inclination correction unit for correcting.
前記傾き補正手段は、
前記第1のズレ量算出手段により算出した主走査方向のズレ量の始点座標と終点座標がはじめに同一となる副走査方向の走査線を副走査方向の原稿部分の開始座標として傾き補正する
ことを特徴とする請求項1記載の画像処理装置。
The inclination correction means includes
Inclination correction is performed by using a scanning line in the sub-scanning direction in which the start point coordinate and the end point coordinate of the shift amount in the main scanning direction calculated by the first shift amount calculating unit are the same as the start coordinates of the original portion in the sub-scanning direction. The image processing apparatus according to claim 1, wherein:
原稿画像を画像読取装置で読み取って得た画像データの処理を行う画像処理方法において、
前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを原稿識別手段で抽出し、
前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を第1のズレ量算出手段で算出し、
前記原稿識別手段により抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を第2のズレ量算出手段で算出し、
前記第1のズレ量算出手段による主走査方向のズレ量と前記第2のズレ量算出手段による副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正する
ことを特徴とする画像処理方法。
In an image processing method for processing image data obtained by reading an original image with an image reading device,
Identifying the original image portion of the image data for each scanning line, and extracting the start point coordinates and the end point coordinates of the original image portion by an original identification means;
A first shift amount calculating unit calculates a shift amount in a main scanning direction from a start point coordinate and an end point coordinate of the document image portion extracted by the document identification unit;
A second shift amount calculating unit calculates a shift amount in the sub-scanning direction from a start point coordinate and an end point coordinate of the document image portion extracted by the document identifying unit;
By correcting the position of each pixel from the shift amount in the main scanning direction by the first shift amount calculating unit and the shift amount in the sub-scanning direction by the second shift amount calculating unit, the inclination of the document portion in the image data is corrected. An image processing method characterized by correcting.
原稿画像を画像読取装置で読み取って得た画像データの処理をコンピュータを用いて行う画像処理プログラムであって、
前記画像データを走査線ごとに前記原稿画像部分を識別し、該原稿画像部分の始点座標と終点座標とを抽出する第1のステップと、
前記第1のステップにより抽出された前記原稿画像部分の始点座標と終点座標から主走査方向のズレ量を算出する第2のステップと、
前記第1のステップにより抽出された前記原稿画像部分の始点座標と終点座標から副走査方向のズレ量を算出する第3のステップと、
前記第2のステップによる主走査方向のズレ量と前記第3のステップによる副走査方向のズレ量から各画素の位置を補正することにより前記画像データにおける原稿部分の傾きを補正する第4のステップと
を含むことを特徴とする画像処理プログラム。
An image processing program that uses a computer to process image data obtained by reading a document image with an image reading device,
A first step of identifying the original image portion of the image data for each scanning line, and extracting a start point coordinate and an end point coordinate of the original image portion;
A second step of calculating a shift amount in the main scanning direction from a start point coordinate and an end point coordinate of the document image portion extracted in the first step;
A third step of calculating a shift amount in the sub-scanning direction from a start point coordinate and an end point coordinate of the document image portion extracted in the first step;
Fourth step of correcting the inclination of the document portion in the image data by correcting the position of each pixel from the amount of deviation in the main scanning direction by the second step and the amount of deviation in the sub-scanning direction by the third step. An image processing program comprising:
JP2005084175A 2005-03-23 2005-03-23 Image processor and method and program Pending JP2006270387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005084175A JP2006270387A (en) 2005-03-23 2005-03-23 Image processor and method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005084175A JP2006270387A (en) 2005-03-23 2005-03-23 Image processor and method and program

Publications (1)

Publication Number Publication Date
JP2006270387A true JP2006270387A (en) 2006-10-05

Family

ID=37205890

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005084175A Pending JP2006270387A (en) 2005-03-23 2005-03-23 Image processor and method and program

Country Status (1)

Country Link
JP (1) JP2006270387A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009124674A (en) * 2007-10-26 2009-06-04 Murata Mach Ltd Image processing apparatus, image scanning apparatus, image processing method, and image processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009124674A (en) * 2007-10-26 2009-06-04 Murata Mach Ltd Image processing apparatus, image scanning apparatus, image processing method, and image processing program

Similar Documents

Publication Publication Date Title
JP3249605B2 (en) Document edge detection device
JP4784500B2 (en) Image tilt correction apparatus and image tilt correction method
JP3670571B2 (en) Image reading device
CN104966092B (en) A kind of image processing method and device
US9171218B2 (en) Image processing apparatus, image processing method, and computer readable medium that recognize overlapping elements in handwritten input
JP2001143062A (en) Rotational conversion of image using block transfer
JP2006270387A (en) Image processor and method and program
KR100350854B1 (en) System and method of rotating binary images
JP2009284190A (en) Image reading apparatus and image reading system
JP2001101399A (en) Method for detecting image inclination, method for detecting margin, method for correcting image inclination and document image processor
JP2006094099A (en) Image processor, and image processing method and program
JP4282467B2 (en) Image area separation method
JP2007011528A (en) Method for searching position of recognition target item in ocr processing
TWI799050B (en) Electronic device and method for detecting and recognizing character
CN110072032B (en) Image processing apparatus
US10375261B2 (en) Image scanning apparatus
JP2007328652A (en) Image processing device and image processing program
JP2010152456A (en) Image processor and image processing method and program using image processing method
JP2007249580A (en) Image processor, image processing program and image processing method
JP2008258980A (en) Image information processor, and image inclination angle calculation method
JP4890425B2 (en) Method and program for creating mask image for manga frame image
TWI632527B (en) Image capture and output method
JP2004241827A (en) Image processing apparatus, image processing method, image processing program, and storage medium
JP2016178367A (en) Image processing device and computer program
JP2005057813A (en) Image scanner