JP2016096379A - Compression apparatus - Google Patents

Compression apparatus Download PDF

Info

Publication number
JP2016096379A
JP2016096379A JP2014229832A JP2014229832A JP2016096379A JP 2016096379 A JP2016096379 A JP 2016096379A JP 2014229832 A JP2014229832 A JP 2014229832A JP 2014229832 A JP2014229832 A JP 2014229832A JP 2016096379 A JP2016096379 A JP 2016096379A
Authority
JP
Japan
Prior art keywords
image data
data
compressed
block
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014229832A
Other languages
Japanese (ja)
Other versions
JP6354532B2 (en
Inventor
純司 前田
Junji Maeda
純司 前田
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.)
Brother Industries Ltd
Original Assignee
Brother Industries 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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2014229832A priority Critical patent/JP6354532B2/en
Publication of JP2016096379A publication Critical patent/JP2016096379A/en
Application granted granted Critical
Publication of JP6354532B2 publication Critical patent/JP6354532B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To effectively perform a processing for image data showing a reading image of an original.SOLUTION: A compression circuit compresses reading image data of an original provided by a reading device, and generates corresponded compressed image data. More specifically, the compressed image data that vertically reverses the reading image of original in a sub-scanning direction is generated (D). The compression circuit processes and compresses an image data group in a pixel block of the reading image data in each pixel block so as to be vertically reversed a position of the pixel in the pixel block. Thus, the compressed image data that has compressed block data showing a revered image in each pixel block is generated (C). Thereafter, the compression circuit replaces the compressed block data included in the compressed image data in the sub-scanning direction in a group unit of the pixel block along a main scanning direction, and generates the compressed image data that is vertically reversed the reading image in the sub-scanning direction (D).SELECTED DRAWING: Figure 3

Description

本発明は、画像データを圧縮する機能を備えた装置に関する。   The present invention relates to an apparatus having a function of compressing image data.

従来、原稿を読み取って、その読取画像を表す画像データを生成する画像読取システムが知られている。画像データを圧縮して、圧縮後の画像データである圧縮画像データを生成する圧縮装置もまた知られている。画像データの圧縮方式としては、例えばJPEG方式が知られている。JPEG方式では、画像データをブロック単位で圧縮する。   2. Description of the Related Art Conventionally, an image reading system that reads a document and generates image data representing the read image is known. A compression device that compresses image data and generates compressed image data that is image data after compression is also known. As a compression method for image data, for example, the JPEG method is known. In the JPEG method, image data is compressed in units of blocks.

圧縮画像データを伸長する伸長装置としては、圧縮画像データが表す画像を180度回転させる処理を実行しつつ、圧縮画像データを伸長する装置が知られている(例えば特許文献1参照)。この伸長装置では、圧縮画像データが、末尾からブロック毎に順に読み出される。各ブロック内の画素データは、末尾から順に読み出される。この読み出しにより、圧縮画像データが表す画像は、伸長後の画像データにおいて180度回転した画像に変換される。   As an expansion device that expands compressed image data, a device that expands compressed image data while executing a process of rotating an image represented by the compressed image data by 180 degrees is known (see, for example, Patent Document 1). In this decompression device, the compressed image data is read in order from the end for each block. Pixel data in each block is read sequentially from the end. By this reading, the image represented by the compressed image data is converted into an image rotated 180 degrees in the decompressed image data.

特開平9−219782号公報JP-A-9-2197882

ところで、原稿全体が読み取られた後、原稿の読取画像を表す圧縮画像データに対し、読取画像を反転又は回転させるための画像処理を加える従来技術では、効率的に上記画像処理を実行し、上記画像処理後の圧縮画像データを生成又は出力することが難しい。   By the way, in the prior art in which image processing for reversing or rotating the read image is performed on the compressed image data representing the read image of the original after the entire original is read, the image processing is efficiently executed, It is difficult to generate or output compressed image data after image processing.

従って、本発明の一側面では、原稿の読取画像を表す画像データに対する画像処理を効率的に実行できることが望ましい。   Therefore, in one aspect of the present invention, it is desirable that image processing for image data representing a read image of a document can be efficiently executed.

本発明の一側面に係る圧縮装置は、圧縮ユニットと、加工ユニットとを備える。圧縮ユニットは、原稿の読取画像を表す画像データを圧縮することによって、画像データに対応する圧縮画像データを生成する。画像データは、原稿を主走査方向に沿うライン毎に読み取る読取動作を、副走査方向に複数回実行することにより生成され得る。   A compression device according to one aspect of the present invention includes a compression unit and a processing unit. The compression unit generates compressed image data corresponding to the image data by compressing the image data representing the read image of the document. The image data can be generated by executing a reading operation for reading the document for each line along the main scanning direction a plurality of times in the sub scanning direction.

圧縮ユニットは、画素ブロック毎に、画像データにおける画素ブロック内のデータであるブロックデータを、画素ブロック内の各画素の位置を副走査方向に反転させるように加工して圧縮することにより、圧縮ブロックデータを生成する構成にされ得る。画素ブロックは、主走査方向に所定画素数及び副走査方向に所定ライン数の領域として定められ得る。圧縮ユニットは、上記圧縮画像データとして、読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成する構成にされ得る。   The compression unit compresses block data, which is data in the pixel block in the image data, for each pixel block by processing and compressing the position of each pixel in the pixel block in the sub-scanning direction. It can be configured to generate data. The pixel block can be defined as a region having a predetermined number of pixels in the main scanning direction and a predetermined number of lines in the sub-scanning direction. The compression unit may be configured to generate compressed image data having a plurality of compressed block data corresponding to the entire area of the read image as the compressed image data.

加工ユニットは、圧縮ユニットにより生成された圧縮画像データを加工する。加工ユニットは、バンド単位で、圧縮画像データが有する圧縮ブロックデータを並び替えることにより、圧縮画像データが表す画像を、読取画像を副走査方向に反転した画像に変換するように、圧縮画像データを加工する構成にされ得る。ここで言うバンド単位は、主走査方向に沿う画素ブロックの組に対応する圧縮ブロックデータの組単位であり得る。   The processing unit processes the compressed image data generated by the compression unit. The processing unit rearranges the compressed block data included in the compressed image data in units of bands, thereby converting the compressed image data so that the image represented by the compressed image data is converted into an image obtained by inverting the read image in the sub-scanning direction. It can be configured to work. The band unit mentioned here may be a set unit of compressed block data corresponding to a set of pixel blocks along the main scanning direction.

本発明の一側面によれば、ブロックデータを加工及び圧縮することにより、画素位置が副走査方向において反転した圧縮ブロックデータを生成する。このため、画素位置を反転させずに圧縮ブロックデータを生成する場合よりも、効率的に読取画像を反転した圧縮画像データを生成することができる。従って、本発明の一側面によれば、原稿の読取動作により生成される画像データに対する画像反転に係る処理を、効率的に実行することができる。   According to one aspect of the present invention, compressed block data in which pixel positions are inverted in the sub-scanning direction is generated by processing and compressing the block data. Therefore, compressed image data obtained by inverting the read image can be generated more efficiently than when compressed block data is generated without inverting the pixel position. Therefore, according to one aspect of the present invention, it is possible to efficiently execute processing related to image inversion with respect to image data generated by a document reading operation.

ところで、圧縮ユニットは、上記圧縮画像データとして、バンド単位で圧縮ブロックデータの組に対してマーカを付した圧縮画像データを生成する構成にされてもよい。この場合、加工ユニットは、圧縮画像データ内のマーカに基づいて、バンド単位の圧縮ブロックデータの組を特定する構成にされ得る。圧縮ブロックデータの組の特定は、上記マーカを用いることで、効率的又は容易に行い得る。   By the way, the compression unit may be configured to generate compressed image data in which a marker is attached to a set of compressed block data in band units as the compressed image data. In this case, the processing unit may be configured to identify a set of compressed block data in band units based on the markers in the compressed image data. The set of compressed block data can be efficiently or easily performed by using the marker.

圧縮ユニットは、上記圧縮画像データとして、JPEG方式の圧縮画像データを生成する構成にされてもよい。この場合、圧縮ユニットは、バンド単位で圧縮ブロックデータの組に対してリスタートマーカを付したJPEG方式の圧縮画像データを生成する構成にされ得る。   The compression unit may be configured to generate JPEG compressed image data as the compressed image data. In this case, the compression unit may be configured to generate JPEG compressed image data in which a restart marker is attached to a set of compressed block data in band units.

加工ユニットは、圧縮画像データ内のリスタートマーカに基づいて、バンド単位の圧縮ブロックデータの組を特定する構成にされ得る。加工ユニットは、バンド単位で圧縮ブロックデータを並び替え、更にはリスタートマーカを付け直すようにして、圧縮画像データを加工する構成にされてもよい。   The processing unit may be configured to specify a set of compressed block data in band units based on a restart marker in the compressed image data. The processing unit may be configured to process the compressed image data by rearranging the compressed block data in band units and re-adding the restart marker.

圧縮ユニットは、画像データの全体が提供される前に上記圧縮を開始する構成にされてもよい。圧縮ユニットには、画像データを構成する先頭ラインから末尾ラインまでのライン単位のデータであるライン画像データの夫々が順次提供され得る。この場合、圧縮ユニットは、末尾ラインまでのライン画像データが提供される前に上記圧縮を開始する構成にされ得る。   The compression unit may be configured to start the compression before the entire image data is provided. Each of the line image data, which is data in line units from the first line to the last line constituting the image data, can be sequentially provided to the compression unit. In this case, the compression unit may be configured to start the compression before line image data up to the last line is provided.

この構成を有する圧縮装置によれば、圧縮画像データの生成に必要なデータ記憶領域(作業領域)のサイズを抑えることができる。従って、記憶容量の小さい記憶デバイスを用いて効率的に圧縮画像データを生成することが可能である。   According to the compression apparatus having this configuration, the size of the data storage area (work area) necessary for generating the compressed image data can be suppressed. Therefore, it is possible to efficiently generate compressed image data using a storage device having a small storage capacity.

また、画素ブロック単位で画像データを圧縮する場合、圧縮方式によっては、ダミーデータを追加する必要が生じ得る。即ち、ダミーデータの追加により、画像データのライン数を形式上、画素ブロックのライン数の整数倍とする必要が生じ得る。ダミーデータは、余白画像を表す画像データであり得る。   When image data is compressed in units of pixel blocks, it may be necessary to add dummy data depending on the compression method. In other words, the addition of dummy data may necessitate that the number of lines of image data be an integer multiple of the number of lines of pixel blocks. The dummy data can be image data representing a blank image.

この場合、仮にダミーデータを画像データの末尾ライン側に追加すると、上記加工ユニットによる加工後の圧縮画像データでは、ダミーデータに基づく余白画像が、圧縮画像データが表す画像全体の先頭側に表れる。即ち、余白画像を除く真の読取画像が画像全体の末尾側に偏って表れる。この偏りは、ユーザに不満を及ぼす可能性がある。   In this case, if dummy data is added to the end line side of the image data, in the compressed image data processed by the processing unit, a blank image based on the dummy data appears on the top side of the entire image represented by the compressed image data. That is, the true read image excluding the blank image appears biased toward the end of the entire image. This bias can be frustrating to the user.

そこで、圧縮装置には、画像データの先頭ラインよりも前に所定ライン数分のダミーデータを追加する追加ユニットが設けられてもよい。この場合、圧縮ユニットは、追加ユニットによりダミーデータが追加された画像データであるダミー付画像データにおける画素ブロック毎に、画素ブロック内の各画素の位置を副走査方向に反転するように加工した圧縮ブロックデータを生成して、圧縮画像データを生成する構成にされ得る。   Therefore, the compression apparatus may be provided with an additional unit that adds dummy data for a predetermined number of lines before the head line of the image data. In this case, the compression unit performs compression so that the position of each pixel in the pixel block is reversed in the sub-scanning direction for each pixel block in the image data with dummy, which is image data to which dummy data is added by the additional unit. It may be configured to generate block data and generate compressed image data.

但し、上記ダミーデータの追加時点においては、画像データの先頭ラインから末尾ラインまでのライン数が不明であることに起因して、画像データの先頭ラインよりも前に追加すべきダミーデータのライン数の適値を特定できない場合がある。従って、追加ユニットは、上記ダミー付画像データとして、先頭ラインよりも前に追加するダミーデータのライン数が異なる複数のダミー付画像データを生成する構成にされてもよい。   However, at the time when the dummy data is added, the number of lines of dummy data to be added before the first line of the image data due to the unknown number of lines from the first line to the last line of the image data. In some cases, it is not possible to specify an appropriate value. Therefore, the additional unit may be configured to generate a plurality of dummy image data having different numbers of lines of dummy data to be added before the first line as the dummy image data.

この場合、追加ユニットは、画像データの先頭ラインより前及び末尾ラインより後の少なくとも一方にダミーデータを追加することにより、画素ブロックのライン数に対して整数倍のライン数を有するダミー付画像データを生成する構成にされ得る。   In this case, the adding unit adds dummy data to at least one before the first line and after the last line of the image data, thereby adding dummy image data having a number of lines that is an integral multiple of the number of lines of the pixel block. Can be configured to generate.

圧縮ユニットは、これら複数のダミー付画像データの夫々に関して、ダミー付画像データにおける画素ブロック毎に画素ブロック内の各画素の位置を副走査方向に反転するように加工した圧縮ブロックデータを生成して、このダミー付画像データの全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成することにより、複数の圧縮画像データを生成する構成にされ得る。   The compression unit generates, for each of the plurality of dummy image data, compressed block data processed so as to invert the position of each pixel in the pixel block for each pixel block in the dummy image data in the sub-scanning direction. In addition, by generating compressed image data having a plurality of compressed block data corresponding to the entire area of the dummy image data, a plurality of compressed image data can be generated.

この場合、加工ユニットは、上記複数の圧縮画像データの内の一つを加工対象に選択し、選択した圧縮画像データが有する圧縮ブロックデータを、バンド単位で、先頭ライン側と末尾ライン側とが反転するように並び替える構成にされ得る。加工ユニットは、この並び替えにより、圧縮画像データが表す画像を、原稿の読取画像を副走査方向に反転した画像に変換するように、圧縮画像データを加工する構成にされ得る。   In this case, the processing unit selects one of the plurality of compressed image data as a processing target, and the compressed block data included in the selected compressed image data is divided into band units in the first line side and the last line side. It can be set as the structure rearranged so that it may invert. The processing unit can be configured to process the compressed image data so as to convert the image represented by the compressed image data into an image obtained by inverting the read image of the document in the sub-scanning direction by this rearrangement.

具体的に、加工ユニットは、複数の圧縮画像データの内、末尾ラインより後に付されるダミーデータのライン数が最小の圧縮画像データを、加工対象に選択する構成にされ得る。こうした選択により、加工後の圧縮画像データが表す反転画像の先頭側においてダミーデータにより表される余白が最小となる圧縮画像データを加工対象に選択することができる。   Specifically, the processing unit may be configured to select compressed image data having a minimum number of lines of dummy data attached after the end line among a plurality of compressed image data as a processing target. By such selection, the compressed image data having the minimum margin represented by the dummy data on the top side of the inverted image represented by the compressed image data after processing can be selected as the processing target.

また、圧縮ユニットには、原稿の片面毎の画像データが提供されてもよい。即ち、圧縮ユニットは、原稿の両面の内、第一の片面の読取画像を表す画像データ、及び、原稿の両面の内、第二の片面の読取画像を表す画像データが提供されてもよい。これら画像データは、原稿の両面をライン毎に読み取る読取動作を複数回実行することにより生成され得る。   The compression unit may be provided with image data for each side of the document. That is, the compression unit may be provided with image data representing a first one-side scanned image of both sides of the document and image data representing a second one-sided scanned image of both sides of the document. These image data can be generated by executing a reading operation for reading both sides of the document for each line a plurality of times.

この場合、圧縮ユニットは、第一の片面の読取画像を表す画像データについては、画素ブロック内の各画素の位置を副走査方向に反転する加工をせずに、画素ブロック毎の圧縮ブロックデータを生成して、読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成する構成にされ得る。   In this case, for the image data representing the read image on the first single side, the compression unit converts the compressed block data for each pixel block without performing the process of inverting the position of each pixel in the pixel block in the sub-scanning direction. It can be configured to generate and generate compressed image data having a plurality of compressed block data corresponding to the entire area of the read image.

換言すれば、圧縮ユニットは、第二の片面の読取画像を表す画像データについては、画素ブロック毎に、当該画素ブロック内の各画素の位置を副走査方向に反転する加工をした圧縮ブロックデータを生成して、読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成する構成にされ得る。   In other words, for the image data representing the read image on the second single side, the compression unit converts the compressed block data obtained by reversing the position of each pixel in the pixel block in the sub-scanning direction for each pixel block. It can be configured to generate and generate compressed image data having a plurality of compressed block data corresponding to the entire area of the read image.

加工ユニットは、第一及び第二の片面に対応する圧縮画像データの内、第二の片面に対応する圧縮画像データが有する圧縮ブロックデータをバンド単位で並び替えることにより、第二の片面に対応する圧縮画像データが表す画像を、第二の片面の読取画像を副走査方向に反転した画像に変換するように、圧縮画像データを加工する構成にされ得る。   The processing unit corresponds to the second single side by rearranging the compressed block data included in the compressed image data corresponding to the second single side among the compressed image data corresponding to the first and second single side in band units. The compressed image data may be processed so as to convert the image represented by the compressed image data to be converted into an image obtained by inverting the read image on the second single side in the sub-scanning direction.

長辺綴じ用の両面印刷原稿を読み取って、短辺綴じ用の両面印刷原稿を生成するための圧縮画像データを生成する場合等には、原稿裏面の読取画像を上下反転させる必要が生じ得る。このような原稿の生成過程で、上述した圧縮装置を用いれば、効率的に短辺綴じに適合した圧縮画像データを生成することが可能である。   When a double-sided printed original for long-side binding is read to generate compressed image data for generating a double-sided printed original for short-side binding, the read image on the back side of the original may need to be turned upside down. If the above-described compression device is used in such a document generation process, it is possible to efficiently generate compressed image data suitable for short-edge binding.

画像読取装置の構成を表すブロック図である。1 is a block diagram illustrating a configuration of an image reading apparatus. 長辺綴じ用の原稿と短辺綴じ用の原稿との相違を説明した図である。FIG. 6 is a diagram illustrating a difference between a long-side binding original and a short-side binding original. 読取画像の上下反転画像を表す圧縮画像データの基本的な生成手順を説明した図である。It is a figure explaining the basic production | generation procedure of the compressed image data showing the upside down image of the read image. 読取画像の上下反転画像を表す圧縮画像データの生成手順を、ダミーデータの挿入手順を含む形態で説明した図である。It is the figure explaining the production | generation procedure of the compressed image data showing the upside down image of the read image in the form including the insertion procedure of dummy data. 原稿のうら面の読取画像データに対応する圧縮画像データを生成するJPEG圧縮回路の詳細構成を表すブロック図である。3 is a block diagram illustrating a detailed configuration of a JPEG compression circuit that generates compressed image data corresponding to read image data on the back side of a document. FIG. 圧縮ユニット及び圧縮画像データの詳細構成を表すブロック図である。It is a block diagram showing the detailed structure of a compression unit and compressed image data. 図7Aは、読取画像データからの画素データ群の読出順を矢印で示した図であり、図7Bは、ダミー付画像データを構成する画素データ群のDCT変換部への入力順を矢印で示した図である。FIG. 7A is a diagram showing the reading order of the pixel data group from the read image data by arrows, and FIG. 7B shows the input order to the DCT conversion unit of the pixel data group constituting the dummy image data by arrows. It is a figure. 圧縮ユニットが実行する処理を表すフローチャートである。It is a flowchart showing the process which a compression unit performs. 図9Aは、加工ユニットが実行する処理を表すフローチャートであり、図9Bは、上段に加工対象の圧縮画像データの構成を示し、下段に反転圧縮画像データの構成を示す図である。FIG. 9A is a flowchart showing processing executed by the processing unit, and FIG. 9B is a diagram showing the configuration of compressed image data to be processed in the upper stage and the configuration of inverted compressed image data in the lower stage. JPEG圧縮回路の動作を示すタイムチャートである。It is a time chart which shows operation | movement of a JPEG compression circuit. 図10に続くJPEG圧縮回路の動作を示すタイムチャートである。11 is a time chart showing the operation of the JPEG compression circuit following FIG. 10.

以下に本発明の実施例について、図面と共に説明する。但し、本発明は、下記実施例によって何ら限定して解釈されない。特許請求の範囲に記載した文言のみによって特定される発明の本質を逸脱しない範囲において考え得るあらゆる態様が本発明の実施形態である。   Embodiments of the present invention will be described below with reference to the drawings. However, the present invention is not construed as being limited in any way by the following examples. Embodiments of the present invention are all aspects that can be considered without departing from the essence of the invention specified only by the words of the claims.

図1に示す本実施例の画像読取装置1は、原稿Pを光学的に読み取る機能、及び、原稿Pの読取画像を表す画像データを、圧縮画像データに変換して記憶する機能を有する。この画像データは、JPEG方式の圧縮画像データに変換される。画像読取装置1は、例えばオートドキュメントフィーダ型のスキャナ装置として構成される。   The image reading apparatus 1 of the present embodiment shown in FIG. 1 has a function of optically reading a document P, and a function of converting image data representing a read image of the document P into compressed image data and storing it. This image data is converted into JPEG compressed image data. The image reading apparatus 1 is configured as an auto document feeder type scanner apparatus, for example.

画像読取装置1は、コピー機又はファクシミリ装置であってもよい。画像読取装置1は、圧縮画像データを用いて、原稿Pの読取画像を用紙に印刷することによりコピー機能を実現する構成にされ得る。画像読取装置1は、スキャナ機能、プリンタ機能、コピー機能及びファクシミリ機能の内の二以上を備えたディジタル複合機としても構成され得る。   The image reading apparatus 1 may be a copier or a facsimile machine. The image reading apparatus 1 can be configured to realize a copy function by printing a read image of a document P on paper using compressed image data. The image reading apparatus 1 can also be configured as a digital multi-function peripheral having two or more of a scanner function, a printer function, a copy function, and a facsimile function.

この画像読取装置1は、CPU11と、ROM13と、RAM15と、読取デバイス20と、読取制御回路31と、A/D(アナログ/ディジタル)変換器33と、読取補正回路35と、画像処理回路37とを備える。   The image reading apparatus 1 includes a CPU 11, a ROM 13, a RAM 15, a reading device 20, a reading control circuit 31, an A / D (analog / digital) converter 33, a reading correction circuit 35, and an image processing circuit 37. With.

CPU11、ROM13、RAM15、読取制御回路31、読取補正回路35、及び、画像処理回路37は、バスを介して互いに接続される。画像読取装置1は、図示しないユーザインタフェースを備えた構成にされ得る。この場合、画像読取装置1は、ユーザインタフェースを介して、ユーザからの操作を受け付けたり、ユーザに対する各種情報を表示したり音声出力したりすることができる。   The CPU 11, the ROM 13, the RAM 15, the reading control circuit 31, the reading correction circuit 35, and the image processing circuit 37 are connected to each other via a bus. The image reading apparatus 1 may be configured with a user interface (not shown). In this case, the image reading apparatus 1 can accept an operation from the user, display various information for the user, and output a sound via the user interface.

CPU11は、ROM13に記録されたプログラムに従う処理を実行することにより、画像読取装置1全体を統括制御し、各種機能を実現する。RAM15は、CPU11による処理実行時に、作業領域として使用される。画像読取装置1は、ROM13として、又は、それとは別に、電気的にデータ書換可能なメモリ(フラッシュROM又はEEPROM等)を備え得る。   The CPU 11 performs overall control of the image reading apparatus 1 by executing processing according to a program recorded in the ROM 13 to realize various functions. The RAM 15 is used as a work area when the CPU 11 executes processing. The image reading apparatus 1 may include a memory (flash ROM, EEPROM, or the like) that can electrically rewrite data as the ROM 13 or separately from the ROM 13.

図1の破線によって示される矩形領域内には、読取デバイス20の細部を概略的に示す。図示されるように、読取デバイス20は、原稿Pの第一面(おもて面)を光学的に読み取るためのイメージセンサ21Aと、原稿Pの第二面(うら面)を光学的に読み取るためのイメージセンサ21Bと、搬送機構と、を備える。   Details of the reading device 20 are schematically shown in the rectangular area indicated by the dashed lines in FIG. As illustrated, the reading device 20 optically reads an image sensor 21A for optically reading the first surface (front surface) of the document P and the second surface (back surface) of the document P. Image sensor 21 </ b> B and a transport mechanism.

読取デバイス20が備える搬送機構は、矢印で示されるように、原稿Pを副走査方向に搬送する構成される。この搬送機構は、原稿Pの搬送経路23上に、搬送ローラ25及び従動ローラ26からなる第一のローラ対と、排紙ローラ27及び従動ローラ28からなる第二のローラ対とを備える。   The transport mechanism provided in the reading device 20 is configured to transport the document P in the sub-scanning direction as indicated by an arrow. The transport mechanism includes a first roller pair including a transport roller 25 and a driven roller 26 and a second roller pair including a paper discharge roller 27 and a driven roller 28 on the transport path 23 of the document P.

搬送ローラ25及び排紙ローラ27は、図示しない共通する電動モータ又は個別の電動モータからの動力を受けて回転する。原稿トレイから搬送ローラ25と従動ローラ26との間に供給される原稿Pは、この回転により副走査方向下流に搬送される。搬送ローラ25及び排紙ローラ27の回転は、読取制御回路31により制御される。これにより、原稿Pは、所定速度で副走査方向に搬送される。   The conveyance roller 25 and the paper discharge roller 27 are rotated by receiving power from a common electric motor (not shown) or individual electric motors. The document P supplied from the document tray between the transport roller 25 and the driven roller 26 is transported downstream in the sub-scanning direction by this rotation. The rotation of the transport roller 25 and the paper discharge roller 27 is controlled by the reading control circuit 31. Thereby, the document P is conveyed in the sub-scanning direction at a predetermined speed.

但し、読取デバイス20が備える搬送機構は、図1に示される構成に限定されるものではない。搬送機構は、イメージセンサ21A,21Bと原稿Pとの相対位置を副走査方向に変化させることが可能な機構であればよい。   However, the transport mechanism provided in the reading device 20 is not limited to the configuration shown in FIG. The transport mechanism may be any mechanism that can change the relative position between the image sensors 21A and 21B and the document P in the sub-scanning direction.

イメージセンサ21A,21Bは夫々、副走査方向に直交する主走査方向に沿って1ライン分の画像を読取可能なラインセンサとして構成される。これらイメージセンサ21A,21Bは、読取制御回路31により制御されて、主走査方向に沿うライン毎に、原稿Pを読み取る読取動作を行う。   Each of the image sensors 21A and 21B is configured as a line sensor that can read an image for one line along the main scanning direction orthogonal to the sub-scanning direction. These image sensors 21 </ b> A and 21 </ b> B are controlled by the reading control circuit 31 to perform a reading operation of reading the document P for each line along the main scanning direction.

イメージセンサ21A,21Bの夫々は、読取動作の繰返しにより、原稿Pの対応する面(おもて面又はうら面)の読取画像を表す画像データを生成する。以下では、原稿Pの両面を構成する各面の読取画像を表す片面単位(換言すればページ単位)の画像データのことを、読取画像データDIと表現する。   Each of the image sensors 21A and 21B generates image data representing a read image of a corresponding surface (a front surface or a back surface) of the document P by repeating the reading operation. Hereinafter, image data in one-sided units (in other words, in page units) representing the read images on each side constituting both sides of the document P will be expressed as read image data DI.

詳述すると、イメージセンサ21A,21Bは、主走査方向に沿って配列された画素毎の撮像素子を有したラインセンサとして構成にされ得る。この場合、イメージセンサ21A,21Bの夫々は、原稿Pの1ライン分の読取画像を表すライン画像データとして、光電効果により撮像素子に蓄積された電荷に対応する値を示す画素データを、1ライン分の各画素に対して有するライン画像データを生成する構成にされ得る。このように、ライン画像データは、画素データの一群を有した構成にされる。   More specifically, the image sensors 21A and 21B can be configured as line sensors having image sensors for each pixel arranged along the main scanning direction. In this case, each of the image sensors 21 </ b> A and 21 </ b> B has, as line image data representing a read image for one line of the original P, pixel data indicating a value corresponding to the charge accumulated in the image sensor due to the photoelectric effect, for one line. It can be configured to generate line image data for each pixel of minutes. As described above, the line image data has a group of pixel data.

読取制御回路31は、CPU11からの命令に従って、読取デバイス20を制御することにより、イメージセンサ21A,21Bによる原稿Pの読取動作、及び、搬送機構による原稿Pの搬送動作を制御する。この制御により、読取動作は、原稿Pが副走査方向に所定量移動する度に実行され、原稿Pの第一面及び第二面の夫々に関して、ライン画像データを構成要素とする読取画像データDIが生成される。   The reading control circuit 31 controls the reading device 20 according to a command from the CPU 11, thereby controlling the reading operation of the document P by the image sensors 21A and 21B and the transporting operation of the document P by the transport mechanism. With this control, the reading operation is executed every time the document P moves by a predetermined amount in the sub-scanning direction, and the read image data DI having line image data as a constituent element for each of the first surface and the second surface of the document P. Is generated.

イメージセンサ21A,21Bにおいて、原稿Pの第一面及び第二面の夫々に関してライン毎に生成されるライン画像データは、順次A/D変換器33に入力される。A/D変換器33に入力されたライン画像データは、アナログデータからディジタルデータに変換された後、読取補正回路35に入力される。   In the image sensors 21 </ b> A and 21 </ b> B, line image data generated for each line with respect to each of the first surface and the second surface of the document P is sequentially input to the A / D converter 33. The line image data input to the A / D converter 33 is converted from analog data to digital data and then input to the reading correction circuit 35.

読取補正回路35は、A/D変換器33から入力される第一面及び第二面のライン画像データの夫々に対し、シェーディング補正を含む各種補正処理を行う。読取補正回路35によって補正された第一面及び第二面のライン画像データは、RAM15に記憶される。このようにしてRAM15には、第一面及び第二面の夫々に関して、読取画像データDIを構成するライン画像データ群、換言すれば、読取画像データDIを構成する画素データ群が、読取デバイス20の読取動作に合わせて順次記憶される。   The reading correction circuit 35 performs various correction processes including shading correction on each of the line image data of the first surface and the second surface input from the A / D converter 33. The line image data of the first surface and the second surface corrected by the reading correction circuit 35 is stored in the RAM 15. In this manner, the RAM 15 stores the line image data group constituting the read image data DI, in other words, the pixel data group constituting the read image data DI, with respect to each of the first surface and the second surface. Are sequentially stored in accordance with the reading operation.

画像処理回路37は、読取画像データDIを構成する画素データ群に対する圧縮処理を実行する一方、必要に応じて各種画像処理を実行する構成にされる。この画像処理回路37は、JPEG圧縮回路40A,40Bを備える。JPEG圧縮回路40Aは、原稿Pの第一面に対応する読取画像データDIをJPEG圧縮して、その圧縮画像データを生成する。JPEG圧縮回路40Bは、原稿Pの第二面に対応する読取画像データDIをJPEG圧縮して、その圧縮画像データを生成する。生成された圧縮画像データは、RAM15に記憶される。   The image processing circuit 37 is configured to execute compression processing on the pixel data group constituting the read image data DI, and execute various image processing as necessary. The image processing circuit 37 includes JPEG compression circuits 40A and 40B. The JPEG compression circuit 40A JPEG compresses the read image data DI corresponding to the first surface of the document P, and generates the compressed image data. The JPEG compression circuit 40B performs JPEG compression on the read image data DI corresponding to the second side of the document P, and generates the compressed image data. The generated compressed image data is stored in the RAM 15.

具体的に、JPEG圧縮回路40A,40Bは、読取画像データDIを構成する画素データ群を、RAM15から順次読み出し、これらを所定の矩形領域で定められるブロック単位でJPEG方式により圧縮する。周知のように、JPEG方式では、MCU(Minimum Coded Unit)単位で読取画像データDIが圧縮される。各ブロックは、例えば、各辺16画素の大きさの矩形領域である。換言すれば、各ブロックは、主走査方向に16画素及び副走査方向に16ラインの大きさの矩形領域である。   Specifically, the JPEG compression circuits 40A and 40B sequentially read out the pixel data group constituting the read image data DI from the RAM 15, and compress them by the JPEG method in units of blocks determined by a predetermined rectangular area. As is well known, in the JPEG method, the read image data DI is compressed in units of MCU (Minimum Coded Unit). Each block is, for example, a rectangular area having a size of 16 pixels on each side. In other words, each block is a rectangular area having a size of 16 pixels in the main scanning direction and 16 lines in the sub-scanning direction.

以下では、各ブロックのことを画素ブロックとも表現する。また、読取画像データDIが有する画素データ群を二次元座標系上に配置し、この二次元座標系上の画素データ群を、画素ブロック単位で分割して定められる各画素ブロック内の画素データの集合をブロックデータとも表現する。二次元座標系は、副走査方向に沿う縦軸、及び、主走査方向に沿う横軸を有する座標系である。本明細書では、この二次元座標系の定義に従って、読取画像データDIの副走査方向を上下方向とみなし、用語「上下」を用いる。   Hereinafter, each block is also expressed as a pixel block. In addition, the pixel data group included in the read image data DI is arranged on a two-dimensional coordinate system, and the pixel data group on the two-dimensional coordinate system is divided into pixel blocks, and the pixel data in each pixel block is determined. A set is also expressed as block data. The two-dimensional coordinate system is a coordinate system having a vertical axis along the sub-scanning direction and a horizontal axis along the main scanning direction. In this specification, according to the definition of the two-dimensional coordinate system, the sub-scanning direction of the read image data DI is regarded as the vertical direction, and the term “upper and lower” is used.

即ち、JPEG圧縮回路40A,40Bは、読取画像データDIを、ブロックデータ毎に圧縮して、圧縮されたブロックデータである圧縮ブロックデータの一群を備える上記圧縮画像データを生成する。各画素ブロックに対応する圧縮ブロックデータを備える圧縮画像データは、RAM15に記憶される。   That is, the JPEG compression circuits 40A and 40B compress the read image data DI for each block data, and generate the compressed image data including a group of compressed block data that is compressed block data. The compressed image data including the compressed block data corresponding to each pixel block is stored in the RAM 15.

ここで、第二面(うら面)の読取画像データDIを取り扱うJPEG圧縮回路40Bの機能について詳述する。JPEG圧縮回路40Bは、読取画像データDIが表す原稿Pの読取画像を上下反転した画像に変換するようにして圧縮画像データを生成する機能を有する。   Here, the function of the JPEG compression circuit 40B that handles the read image data DI on the second side (back side) will be described in detail. The JPEG compression circuit 40B has a function of generating compressed image data by converting the read image of the document P represented by the read image data DI into an inverted image.

この機能は、例えば、長辺綴じ用の原稿P0の読取画像データDIから短辺綴じ用の原稿P1を印刷するための圧縮画像データを生成するために用いられる。この機能は、原稿Pの向きと原稿Pの搬送方向が反対であることに起因して、読取デバイス20において原稿Pが下端から読み取られる場合にも用いられ得る。   This function is used, for example, to generate compressed image data for printing the original P1 for short side binding from the read image data DI of the original P0 for long side binding. This function can also be used when the document P is read from the lower end by the reading device 20 due to the opposite direction of the document P and the conveyance direction of the document P.

長辺綴じ用の原稿P0と、短辺綴じ用の原稿P1との違いは、図2に示す通りである。図2に示される原稿P0,P1は、おもて面に文字「F」が記載され、うら面に文字「B」が記載された原稿Pの例である。図2左領域に示すように、長辺綴じ用の原稿P0では、原稿P0のおもて面でも原稿P0のうら面でも、文字「F」「B」は、上下、及び、左右のどちらにも反転していない通常の向きで配置される。図2においてハッチングされた領域は、綴じ代を表す。   The difference between the long side binding original P0 and the short side binding original P1 is as shown in FIG. The originals P0 and P1 shown in FIG. 2 are examples of the original P in which the letter “F” is written on the front side and the letter “B” is written on the back side. As shown in the left area of FIG. 2, in the long side-bound document P0, the characters “F” and “B” are placed either on the top or bottom and on the left or right side of the front side of the document P0 or the back side of the document P0. Also, it is arranged in a normal orientation that is not reversed. The hatched area in FIG. 2 represents a binding margin.

一方、短辺綴じ用の原稿P1では、図2右領域に示すように、原稿P1のうら面において文字「B」が180度回転した状態(換言すれば、上下及び左右に反転した状態)で配置される。図2右領域には、原稿P1のおもて面及びうら面に対して上下を一つに定めたときのおもて面及びうら面の文字配置を示す。この反転は、ユーザがおもて面の上端で綴じられた原稿P1をめくってうら面を見るとき、うら面の見かけ上の下端が、おもて面の上端に対応することに起因する。   On the other hand, in the original P1 for short edge binding, as shown in the right area of FIG. 2, the character “B” is rotated 180 degrees on the back side of the original P1 (in other words, the state is reversed up and down and left and right). Be placed. The right area of FIG. 2 shows the character arrangement of the front and back surfaces when the top and bottom surfaces of the original P1 are set to one top and bottom. This inversion is due to the fact that when the user turns the document P1 bound at the upper end of the front surface and looks at the back surface, the apparent lower end of the back surface corresponds to the upper end of the front surface.

このように、長辺綴じ用の原稿P0の読取画像データDIから、短辺綴じ用の原稿P1を印刷するためには、うら面の読取画像データDIに対して少なくとも読取画像を上下反転させる画像処理を施す必要がある。このため、JPEG圧縮回路40Bには、原稿Pの読取画像を上下反転して圧縮画像データを生成する機能が設けられる。読取画像を左右反転させる処理は、例えば、読取画像を上下反転させた後、その反転後の画像の左右を入れ替えるようにして圧縮画像データを伸長することにより実現される。   In this way, in order to print the original P1 for short side binding from the read image data DI of the long side binding original P0, at least an image that vertically inverts the read image with respect to the read image data DI on the back side. It is necessary to perform processing. For this reason, the JPEG compression circuit 40B is provided with a function for generating a compressed image data by inverting the read image of the document P upside down. The process of reversing the read image horizontally is realized, for example, by vertically reversing the read image and then expanding the compressed image data so that the left and right sides of the reversed image are switched.

JPEG圧縮回路40Bは、図3の領域(A)に一例を示す原稿Pの読取画像データDIに基づき、読取画像を上下反転した画像に変換するように圧縮画像データを生成する場合、次の手順で読取画像データDIを圧縮する。図3の領域(A)には、白領域及びハッチング領域を用いて、簡単な幾何学画像を、原稿Pが表す画像として例示する。   When the JPEG compression circuit 40B generates the compressed image data so as to convert the read image into an upside down image based on the read image data DI of the document P shown as an example in the area (A) of FIG. Compress the read image data DI. In the area (A) of FIG. 3, a simple geometric image is illustrated as an image represented by the document P using a white area and a hatched area.

JPEG圧縮回路40Bは、原稿Pに対する読取動作が開始されると、読取画像データDIを構成する画素データ群が、1バンドに対応する量、RAM15に蓄積される度に、1バンド分の画素ブロックの夫々に対応するブロックデータを圧縮ブロックデータに変換する。この際、JPEG圧縮回路40Bは、画素ブロック内の各画素の位置を副走査方向に反転させるように、ブロックデータを加工して圧縮することにより、画素ブロックが表す画像を上下反転させた画像を表す圧縮ブロックデータを生成する。   When the reading operation for the document P is started, the JPEG compression circuit 40B, when the pixel data group constituting the read image data DI is accumulated in the RAM 15 in an amount corresponding to one band, the pixel block for one band. Are converted into compressed block data. At this time, the JPEG compression circuit 40B processes the block data so as to invert the position of each pixel in the pixel block in the sub-scanning direction, and compresses the image represented by the pixel block upside down. Generate compressed block data to represent.

1バンドは、主走査方向に沿う一行分の画素ブロックの組に対応する。画素ブロックの縦サイズが16画素(ライン)である場合、1バンド分の画素データ群は、読取画像データDIを構成する画素データ群の内、連続する16ライン分の画素データ群に対応する。図3の領域(B)では、16ライン×4=64ライン分のライン画像データを有する原稿Pの読取画像データDIにおいて、バンド間の境界を破線で示す。   One band corresponds to a set of pixel blocks for one row along the main scanning direction. When the vertical size of the pixel block is 16 pixels (lines), the pixel data group for one band corresponds to the pixel data group for continuous 16 lines in the pixel data group constituting the read image data DI. In the area (B) of FIG. 3, the boundary between bands is indicated by a broken line in the read image data DI of the original P having line image data of 16 lines × 4 = 64 lines.

図3の領域(B)では、図3の領域(A)における副走査方向に沿う矢印の基点から先端に向けて読取デバイス20により原稿Pの読取動作がライン毎に実行されるケースにおいて、1バンド分の画素データ群の領域を、圧縮処理される順に符号Z1,Z2,Z3,Z4を付して表す。符号Z1,Z2,Z3,Z4に含まれる数字は、圧縮処理される順序を表す。   In the area (B) of FIG. 3, in the case where the reading operation of the document P is executed line by line by the reading device 20 from the base point of the arrow along the sub-scanning direction in the area (A) of FIG. The region of the pixel data group for the band is represented with reference numerals Z1, Z2, Z3, and Z4 in the order of compression processing. The numbers included in the symbols Z1, Z2, Z3, and Z4 represent the order of compression processing.

1バンド分の画素データ群は、画素ブロック単位で、上下反転されながら圧縮されることにより、1バンド分の圧縮ブロックデータ群に変換される。図3の領域(C)には、読取画像が画素ブロック毎に上下反転された状態での各バンドが表す画像を示す。   The pixel data group for one band is converted into a compressed block data group for one band by compressing the pixel data in units of pixel blocks while being inverted upside down. In the area (C) of FIG. 3, an image represented by each band in a state where the read image is vertically inverted for each pixel block is shown.

JPEG圧縮回路40Bは、このように加工された圧縮ブロックデータ群を有する圧縮画像データに関して、図3の領域(D)に示すように、バンドの配列順序を反転させるようにバンド単位で圧縮ブロックデータ群を並び替える。JPEG圧縮回路40Bは、この並び替えによって、読取画像データDIに対応する圧縮画像データとして、読取画像を副走査方向に反転した画像を表す圧縮画像データを生成する。   For the compressed image data having the compressed block data group processed in this way, the JPEG compression circuit 40B compresses the compressed block data in units of bands so as to reverse the band arrangement order as shown in the area (D) of FIG. Rearrange the groups. By this rearrangement, the JPEG compression circuit 40B generates compressed image data representing an image obtained by inverting the read image in the sub-scanning direction as compressed image data corresponding to the read image data DI.

付言すると、JPEG圧縮回路40Bは、原稿全体の読取が完了していない状態で、未完成の読取画像データDIを、順次、画素ブロック単位で、画素位置を上下反転させた圧縮ブロックデータに変換し、全読取完了後、バンド単位で圧縮ブロックデータを並び替えることにより、効率的に原稿Pの読取画像を上下反転した圧縮画像データを生成する。   In other words, the JPEG compression circuit 40B converts the incomplete read image data DI into compressed block data in which the pixel position is vertically inverted in units of pixel blocks in a state where the reading of the entire document is not completed. After all the reading is completed, the compressed block data is rearranged in band units, thereby efficiently generating compressed image data obtained by vertically inverting the read image of the original P.

以上には、図3を用いて、読取画像データDIのライン数Gが、画素ブロックのライン数Hの整数倍である例における圧縮画像データの生成手順を説明した。しかしながら、読取画像データDIのライン数Gは、原稿Pの用紙サイズや余白領域の大きさ等の影響を受けて一律に定まらない。このため、読取画像データDIのライン数Gが画素ブロックのライン数Hの整数倍ではないケースが生じ得る。   The procedure for generating compressed image data in the example in which the number of lines G of the read image data DI is an integer multiple of the number of lines H of the pixel block has been described above with reference to FIG. However, the number of lines G of the read image data DI is not uniformly determined due to the influence of the paper size of the original P, the size of the margin area, and the like. For this reason, there may occur a case where the number of lines G of the read image data DI is not an integral multiple of the number of lines H of the pixel block.

このとき、JPEG圧縮回路40Bは、読取画像データDIに対して余白画像を表すダミーデータを付加して、ライン数を調整したダミー付画像データを生成する。ここで言うダミー付画像データは、読取画像データDIに対してダミーデータが付されたものである。読取画像データDIには、ダミー付画像データのライン数Qが画素ブロックのライン数H(例えば16ライン)の整数倍となる最低限のライン数のダミーデータが付加される。   At this time, the JPEG compression circuit 40B adds dummy data representing a blank image to the read image data DI, and generates dummy image data with the number of lines adjusted. The dummy image data referred to here is data obtained by adding dummy data to the read image data DI. To the read image data DI, dummy data having a minimum number of lines in which the number Q of lines of image data with dummy is an integral multiple of the number of lines H of the pixel block (for example, 16 lines) is added.

JPEG圧縮回路40Bは、図4に示すように、読取画像を上下反転した圧縮画像データである反転圧縮画像データDOを生成するに際して、読取画像データDIの先頭ラインより前に付すダミーデータの数が異なる複数のダミー付画像データD11,D12,D13,D14を生成する。図4に示す格子状のハッチング領域は、ダミーデータの領域に対応する。ダミーデータは、読取画像データDIの末尾ラインより後にも必要に応じて付加される。先頭ラインよりも前に付されたダミーデータのライン数Lと、先頭ラインから末尾ラインまでの総ライン数Gとの合計が、画素ブロックのライン数Hの整数倍ではない場合、ダミーデータは、ダミー付画像データのライン数Qが画素ブロックのライン数Hの整数倍となるように、読取画像データDIの末尾ラインより後にも付加される。   As shown in FIG. 4, when the JPEG compression circuit 40B generates inverted compressed image data DO, which is compressed image data obtained by inverting the read image, the number of dummy data added before the first line of the read image data DI is A plurality of different dummy image data D11, D12, D13, and D14 are generated. The lattice-shaped hatching area shown in FIG. 4 corresponds to the dummy data area. The dummy data is added as necessary after the last line of the read image data DI. If the sum of the number of lines L of dummy data attached before the first line and the total number of lines G from the first line to the last line is not an integral multiple of the number of lines H of the pixel block, the dummy data is It is added after the last line of the read image data DI so that the number Q of lines of the dummy image data is an integral multiple of the number of lines H of the pixel block.

尚、ダミー付画像データD11は、先頭ラインより前に付されるダミーデータのライン数Lがゼロであるダミー付画像データである。このダミー付画像データD11の例としては、読取画像データDIのライン数Gが画素ブロックのライン数Hの整数倍であることで、読取画像データDIの末尾ラインより後にもダミーデータが付されない例が含まれる。本明細書では、読取画像データDIのライン数Gが画素ブロックのライン数Hの整数倍であることで、結果的にダミーデータが付されない読取画像データについても、形式的にダミー付画像データと表現する。   The dummy image data D11 is dummy image data in which the number of lines L of dummy data attached before the first line is zero. As an example of the dummy image data D11, the number G of lines of the read image data DI is an integral multiple of the number of lines H of the pixel block, so that no dummy data is added after the end line of the read image data DI. Is included. In the present specification, since the number of lines G of the read image data DI is an integer multiple of the number of lines H of the pixel block, the read image data to which dummy data is not added as a result is also formalized as dummy image data. Express.

JPEG圧縮回路40Bは、これらダミー付画像データD11,D12,D13,D14にそれぞれに対応する圧縮画像データD21,D22,D23,D24を生成する。JPEG圧縮回路40Bは、その後、ダミー付画像データD11,D12,D13,D14に対応する圧縮画像データD21,D22,D23,D24の内の一つを加工対象に選択する。そして、加工対象の圧縮画像データにおいて、配列順序を反転させるようにバンド単位で圧縮ブロックデータ群を並び替えることにより、読取画像データDIが表す画像を、読取画像を副走査方向に反転した画像に変換した反転圧縮画像データDOを生成する。   The JPEG compression circuit 40B generates compressed image data D21, D22, D23, D24 corresponding to the dummy image data D11, D12, D13, D14, respectively. Thereafter, the JPEG compression circuit 40B selects one of the compressed image data D21, D22, D23, and D24 corresponding to the dummy image data D11, D12, D13, and D14 as a processing target. Then, in the compressed image data to be processed, the compressed block data group is rearranged in units of bands so as to reverse the arrangement order, thereby converting the image represented by the read image data DI into an image obtained by inverting the read image in the sub-scanning direction. The converted inverted compressed image data DO is generated.

具体的に、JPEG圧縮回路40Bは、読取画像データDIの末尾ラインより後に付されたダミーデータのライン数が最小(ゼロを含む)の圧縮画像データD23を加工対象に選択する。これにより、JPEG圧縮回路40Bは、読取画像の反転画像が、圧縮画像データが表す画像枠内において下方に偏って現れないように、反転圧縮画像データDOを生成する。   Specifically, the JPEG compression circuit 40B selects the compressed image data D23 having the smallest number (including zero) of dummy data attached after the last line of the read image data DI as a processing target. Thereby, the JPEG compression circuit 40B generates the inverted compressed image data DO so that the inverted image of the read image does not appear biased downward in the image frame represented by the compressed image data.

続いて、JPEG圧縮回路40Bの詳細構成を説明する。図5に示すように、JPEG圧縮回路40Bは、複数の圧縮ユニット41A,41B,41C,41Dと、選択ユニット45と、加工ユニット47とを備える。図5では、JPEG圧縮回路40Bのブロック内にRAM15が描かれているが、このことは、圧縮ユニット41A,41B,41C,41Dから出力される圧縮画像データD21,D22,D23,D24が一旦RAM15に記憶されることを意味する。   Next, the detailed configuration of the JPEG compression circuit 40B will be described. As shown in FIG. 5, the JPEG compression circuit 40B includes a plurality of compression units 41A, 41B, 41C, and 41D, a selection unit 45, and a processing unit 47. In FIG. 5, the RAM 15 is drawn in the block of the JPEG compression circuit 40B. This is because the compressed image data D21, D22, D23, and D24 output from the compression units 41A, 41B, 41C, and 41D are temporarily stored in the RAM 15. It means that it is memorized.

圧縮ユニット41A,41B,41C,41Dは、それぞれ、RAM15が記憶する読取画像データDIを構成する画素データ群を逐次読み出して、読取画像データDIの先頭ラインより前に付すダミーデータのライン数Lが異なるダミー付画像データD11,D12,D13,D14を生成し、このダミー付画像データD11,D12,D13,D14に対応する圧縮画像データD21,D22,D23,D24をRAM15に出力する。   Each of the compression units 41A, 41B, 41C, and 41D sequentially reads the pixel data group constituting the read image data DI stored in the RAM 15, and the number L of dummy data lines that precede the first line of the read image data DI is determined. Different dummy image data D11, D12, D13, and D14 are generated, and compressed image data D21, D22, D23, and D24 corresponding to the dummy image data D11, D12, D13, and D14 are output to the RAM 15.

画素ブロックのライン数Hが16ラインであり、読取画像を上下反転した反転圧縮画像データDOを生成する必要があるとき、圧縮ユニット41A,41B,41C,41Dは、CPU11から設定される動作パラメータに従って、次のように動作する。   When the number of lines H of the pixel block is 16, and when it is necessary to generate inverted compressed image data DO obtained by inverting the read image, the compression units 41A, 41B, 41C, and 41D follow the operation parameters set by the CPU 11. It works as follows.

圧縮ユニット41Aは、読取画像データDIの先頭ラインより前にダミーデータを付すことなく、読取画像データDIの末尾ラインより後に必要に応じてダミーデータを付して、画素ブロックのライン数Hの整数倍のライン数Qを有するダミー付画像データD11を生成する。   The compression unit 41A adds dummy data as necessary after the end line of the read image data DI without attaching dummy data before the start line of the read image data DI, and is an integer of the number H of pixel block lines. Dummy image data D11 having twice the number of lines Q is generated.

圧縮ユニット41Aは、このダミー付画像データD11を、生成しながら、逐次画素ブロック単位で圧縮して、圧縮画像データD21をRAM15に出力する。ここで、圧縮ユニット41Aから出力される圧縮画像データD21は、図4において例示されるように、画素ブロック内の各画素の位置が副走査方向において反転した圧縮画像データである。   The compression unit 41A sequentially compresses the dummy image data D11 in units of pixel blocks while generating it, and outputs the compressed image data D21 to the RAM 15. Here, the compressed image data D21 output from the compression unit 41A is compressed image data in which the position of each pixel in the pixel block is inverted in the sub-scanning direction as illustrated in FIG.

圧縮ユニット41Bは、読取画像データDIの先頭ラインより前に4ライン分のダミーデータを付し、読取画像データDIの末尾ラインより後に必要に応じてダミーデータを付して、画素ブロックのライン数Hの整数倍のライン数Qを有するダミー付画像データD12を生成する。圧縮ユニット41Bは、このダミー付画像データD12を、生成しながら、逐次画素ブロック単位で圧縮して、圧縮画像データD22をRAM15に出力する。ここで、圧縮ユニット41Bから出力される圧縮画像データD22は、圧縮ユニット41Aと同様、画素ブロック内の各画素の位置が副走査方向において反転した圧縮画像データである。   The compression unit 41B adds four lines of dummy data before the first line of the read image data DI, and adds dummy data as necessary after the last line of the read image data DI. Dummy image data D12 having a line number Q that is an integral multiple of H is generated. The compression unit 41B sequentially compresses the dummy image data D12 in units of pixel blocks while generating it, and outputs the compressed image data D22 to the RAM 15. Here, the compressed image data D22 output from the compression unit 41B is compressed image data in which the position of each pixel in the pixel block is inverted in the sub-scanning direction, as in the compression unit 41A.

圧縮ユニット41Cは、読取画像データDIの先頭ラインより前に付すダミーデータのライン数Lが8である点を除いて、圧縮ユニット41Bと同様に動作する。即ち、圧縮ユニット41Cは、読取画像データDIの先頭ラインより前に8ライン分のダミーデータを付して、画素ブロックのライン数Lの整数倍のライン数Qを有するダミー付画像データD13を生成し、対応する圧縮画像データD23をRAM15に出力する。   The compression unit 41C operates in the same manner as the compression unit 41B, except that the number L of dummy data lines attached before the first line of the read image data DI is eight. That is, the compression unit 41C adds dummy data for 8 lines before the first line of the read image data DI, and generates dummy image data D13 having a line number Q that is an integral multiple of the number L of pixel block lines. The corresponding compressed image data D23 is output to the RAM 15.

圧縮ユニット41Dは、読取画像データDIの先頭ラインより前に付すダミーデータのライン数Lが12である点を除いて、圧縮ユニット41B,41Cと同様に動作する。即ち、圧縮ユニット41Dは、読取画像データDIの先頭ラインより前に12ライン分のダミーデータを付して、画素ブロックのライン数Hの整数倍のライン数Qを有するダミー付画像データD14を生成し、対応する圧縮画像データD24をRAM15に出力する。   The compression unit 41D operates in the same manner as the compression units 41B and 41C except that the number L of dummy data lines attached before the first line of the read image data DI is 12. That is, the compression unit 41D adds dummy data for 12 lines before the first line of the read image data DI, and generates dummy image data D14 having a line number Q that is an integral multiple of the number H of pixel block lines. The corresponding compressed image data D24 is output to the RAM 15.

図6には、圧縮ユニット41の詳細構成を示す。圧縮ユニット41は、圧縮ユニット41A,41B,41C,41Dの内の任意の一つに対応する。圧縮ユニット41A,41B,41C,41Dは、CPU11から設定される動作パラメータに従って、CPU11から設定されたライン数L分のダミーデータを読取画像データDIの先頭ラインより前に付すように構成されたものであり、互いに共通する構成を有する。   FIG. 6 shows a detailed configuration of the compression unit 41. The compression unit 41 corresponds to any one of the compression units 41A, 41B, 41C, and 41D. The compression units 41A, 41B, 41C, and 41D are configured to add dummy data for the number L of lines set by the CPU 11 before the first line of the read image data DI according to the operation parameters set by the CPU 11. And have a configuration common to each other.

図6に示すように、圧縮ユニット41は、データ入力部51と、DCT変換部53と、量子化部55と、ジグザグシーケンス部56と、符号化部57と、データ出力部59とを備える。   As shown in FIG. 6, the compression unit 41 includes a data input unit 51, a DCT conversion unit 53, a quantization unit 55, a zigzag sequence unit 56, an encoding unit 57, and a data output unit 59.

データ入力部51は、読取画像データDIを構成する画素データ群を順次RAM15から読み出して、ダミーデータを追加する処理及び画素ブロック内の各画素の位置を副走査方向において反転させる処理を実行した後、その処理後の画素データ群を順次DCT変換部53に入力する構成にされる。   The data input unit 51 sequentially reads out the pixel data group constituting the read image data DI from the RAM 15 and executes a process of adding dummy data and a process of inverting the position of each pixel in the pixel block in the sub-scanning direction. The pixel data group after the processing is sequentially input to the DCT conversion unit 53.

即ち、データ入力部51は、読取画像データDIを構成する画素データ群を順次、ダミー付画像データD1を構成する画素データ群であって、画素ブロック内の各画素の位置を副走査方向において反転した画素データ群に変換してDCT変換部53に入力する。ここで言うダミー付画像データD1は、上述したダミー付画像データD11,D12,D13,D14の一つに対応する。   That is, the data input unit 51 sequentially converts the pixel data group constituting the read image data DI into the pixel data group constituting the dummy image data D1, and inverts the position of each pixel in the pixel block in the sub-scanning direction. The converted pixel data group is input to the DCT conversion unit 53. The dummy image data D1 referred to here corresponds to one of the above-described dummy image data D11, D12, D13, and D14.

図6の破線で示される矩形領域内には、データ入力部51の詳細構成を示す。図示されるように、データ入力部51は、主入力部511と、ダミー追加部513と、セレクタ515と、入力制御部517とを備える。   A detailed configuration of the data input unit 51 is shown in a rectangular area indicated by a broken line in FIG. As illustrated, the data input unit 51 includes a main input unit 511, a dummy addition unit 513, a selector 515, and an input control unit 517.

主入力部511は、入力制御部517からの制御信号に従って、入力制御部517から指定されたアドレスに対応する画素データをRAM15から読み込んでセレクタ515に入力する。ダミー追加部513は、ダミーデータをセレクタ515に入力する。   The main input unit 511 reads pixel data corresponding to the address designated by the input control unit 517 from the RAM 15 and inputs it to the selector 515 in accordance with a control signal from the input control unit 517. The dummy adding unit 513 inputs dummy data to the selector 515.

セレクタ515は、主入力部511から入力される画素データ、及び、ダミー追加部513から入力されるダミーデータのいずれか一方を、入力制御部517からの選択信号に従って選択的にDCT変換部53に入力する。   The selector 515 selectively selects one of the pixel data input from the main input unit 511 and the dummy data input from the dummy addition unit 513 according to the selection signal from the input control unit 517 to the DCT conversion unit 53. input.

入力制御部517は、上記選択信号をセレクタ515に入力し、上記制御信号を主入力部511に入力することにより、CPU11から設定されたライン数L分のダミーデータが読取画像データDIの先頭ラインより前に付加され、且つ、画素ブロック内の画素位置が副走査方向に反転するように、セレクタ515の選択動作及び主入力部511による読込動作を制御する。   The input control unit 517 inputs the selection signal to the selector 515 and inputs the control signal to the main input unit 511, whereby dummy data corresponding to the number L of lines set by the CPU 11 becomes the first line of the read image data DI. The selection operation of the selector 515 and the reading operation by the main input unit 511 are controlled so that the pixel position in the pixel block is added before and the pixel position in the pixel block is inverted in the sub-scanning direction.

この制御によりセレクタ515からは、読取画像データDIにダミーデータが追加されたダミー付画像データD1を構成する画素データ群が、画素ブロック内の各画素の位置が副走査方向において反転した状態で、順にDCT変換部53に入力される。   With this control, the selector 515 causes the pixel data group constituting the dummy image data D1 in which dummy data is added to the read image data DI, in a state where the position of each pixel in the pixel block is inverted in the sub-scanning direction. The data are sequentially input to the DCT conversion unit 53.

画素ブロック内の各画素の位置を副走査方向において反転させる加工は、入力制御部517に制御されて、主入力部511が、図7Aに示す矢印に従って、読取画像データDI内の画素データ群を読み出すことにより実現される。図7Aでは、ダミー付画像データD1において一つの画素ブロックを構成する読取画像データDI内の領域を破線で区切って表す。また、ダミーデータが挿入される領域を、格子状のハッチング領域で表す。即ち、上記加工は、一つの画素ブロックを構成する画素データ群をRAM15から読み出す過程で、画素ブロック内の画素データ群を、ライン毎に、副走査方向において逆方向から読み出し、これにより、画素データ群の配列を副走査方向において反転させることにより実現される。   The process of inverting the position of each pixel in the pixel block in the sub-scanning direction is controlled by the input control unit 517, and the main input unit 511 converts the pixel data group in the read image data DI according to the arrow shown in FIG. 7A. This is realized by reading. In FIG. 7A, the area in the read image data DI constituting one pixel block in the dummy image data D1 is represented by a broken line. An area where dummy data is inserted is represented by a grid-like hatching area. That is, in the process of reading out the pixel data group constituting one pixel block from the RAM 15, the pixel data group in the pixel block is read out from the reverse direction in the sub-scanning direction for each line. This is realized by inverting the group arrangement in the sub-scanning direction.

このような加工を経て、DCT変換部53には、図7Bに示す矢印に沿って、ダミー付画像データD1を構成する画素データ群が、画素ブロック内の各画素の位置が副走査方向において反転した状態で、順にDCT変換部53に入力される。図7Bに示す格子状のハッチング領域内のデータは、ダミーデータである。   Through such processing, the DCT conversion unit 53 has the pixel data group constituting the image data D1 with the dummy inverted in the sub-scanning direction in the sub-scanning direction along the arrow shown in FIG. 7B. In this state, the signals are sequentially input to the DCT conversion unit 53. The data in the lattice-shaped hatching area shown in FIG. 7B is dummy data.

詳述すれば、DCT変換部53には、主走査方向に沿って、画素ブロック(1,1)、画素ブロック(1,2)、画素ブロック(1,3)の順に、対応する画素データ群がDCT変換部53に入力される。ここで、画素ブロック(m,n)は、第m行第n列の画素ブロックを示す。変数m,nは、1以上の自然数である。そして、同一行の最終列の画素ブロック(1,N)の画素データ群がDCT変換部53に入力されると、続いて、次行先頭列の画素ブロック(2,1)から順に、同一行の画素ブロック(2,n)の画素データ群が順にDCT変換部53に入力される。   More specifically, the DCT conversion unit 53 includes corresponding pixel data groups in the order of the pixel block (1, 1), the pixel block (1, 2), and the pixel block (1, 3) in the main scanning direction. Is input to the DCT converter 53. Here, the pixel block (m, n) indicates a pixel block in the m-th row and the n-th column. The variables m and n are natural numbers of 1 or more. Then, when the pixel data group of the pixel block (1, N) in the last column in the same row is input to the DCT conversion unit 53, the pixel block (2, 1) in the first row in the next row is sequentially followed by the same row. The pixel data groups of the pixel block (2, n) are sequentially input to the DCT conversion unit 53.

DCT変換部53は、このようにしてデータ入力部51から入力される画素データ群を、画素ブロック単位で離散コサイン変換(DCT)した後、量子化部55に入力する。即ち、DCT変換部53は、ダミー付画像データを構成する画素ブロック毎のブロックデータであって、画素ブロック内の各画素の位置が副走査方向において反転されたブロックデータを順次、離散コサイン変換して、量子化部55に入力する。DCT変換部53は、各ブロックデータの離散コサイン変換が終了する度に、更新信号を入力制御部517に入力することにより、データ入力部51からの画素データ群の入力タイミングを制御する。   The DCT transform unit 53 performs the discrete cosine transform (DCT) on the pixel data group input from the data input unit 51 in this way in units of pixel blocks, and then inputs them to the quantization unit 55. That is, the DCT conversion unit 53 sequentially performs discrete cosine transform on block data for each pixel block constituting the image data with dummy, and the position of each pixel in the pixel block is inverted in the sub-scanning direction. And input to the quantization unit 55. The DCT transform unit 53 controls the input timing of the pixel data group from the data input unit 51 by inputting an update signal to the input control unit 517 every time the discrete cosine transform of each block data is completed.

量子化部55は、離散コサイン変換されたブロックデータの夫々を、量子化テーブルを用いて量子化し、この量子化されたブロックデータである量子化ブロックデータを、ジグザグシーケンス部56に入力する。   The quantization unit 55 quantizes each block data subjected to discrete cosine transform using a quantization table, and inputs the quantized block data, which is the quantized block data, to the zigzag sequence unit 56.

ジグザグシーケンス部56は、量子化部55から入力される量子化ブロックデータ毎に、この量子化ブロックデータを、一次元のデータ列に変換して符号化部57に入力する。符号化部57は、ジグザグシーケンス部56からの入力データをエントロピー符号化する。そして、この符号化データをデータ出力部59に入力する。画素ブロック単位の符号化データは、上述した圧縮ブロックデータに対応する。   For each quantized block data input from the quantizing unit 55, the zigzag sequence unit 56 converts this quantized block data into a one-dimensional data string and inputs the converted data to the encoding unit 57. The encoding unit 57 entropy encodes the input data from the zigzag sequence unit 56. The encoded data is input to the data output unit 59. The encoded data for each pixel block corresponds to the compressed block data described above.

データ出力部59は、符号化部57から入力される符号化データに対して、ヘッダ、エンドマーカ(EOI)及びリスタートマーカ(FFD0〜FFD7)等の付属データを付すことにより、JPEG方式の圧縮画像データD2を、RAM15に出力する。ここで言う圧縮画像データD2は、上述した圧縮画像データD21,D22,D23,D24の一つに対応する。   The data output unit 59 attaches attached data such as a header, an end marker (EOI), and restart markers (FFD0 to FFD7) to the encoded data input from the encoding unit 57, thereby compressing the JPEG method. The image data D2 is output to the RAM 15. The compressed image data D2 referred to here corresponds to one of the compressed image data D21, D22, D23, and D24 described above.

図6に示すように、圧縮画像データD2は、付属データとして、その先頭にヘッダを備え、その終端にエンドマーカを有する。この圧縮画像データD2は更に、バンド単位で圧縮ブロックデータの組に対してリスタートマーカを有した構成にされる。図6に示すバンドデータは、1バンド分の圧縮ブロックデータの組に対応する。第iバンドデータは、ダミー付画像データD1の先頭からi行目の圧縮ブロックデータの組に対応する。変数iは、1以上の自然数である。   As shown in FIG. 6, the compressed image data D2 has a header at its head as ancillary data and an end marker at its end. The compressed image data D2 is further configured to have a restart marker for a set of compressed block data in band units. The band data shown in FIG. 6 corresponds to a set of compressed block data for one band. The i-th band data corresponds to a set of compressed block data in the i-th row from the top of the dummy image data D1. The variable i is a natural number of 1 or more.

周知のようにリスタートマーカには、0番から7番までの範囲で識別番号が割り当てられる。第iバンドデータの後端には、識別番号が(i−1)であるリスタートマーカが付される。i>8であるとき、第iバンドデータの後端には、識別番号が(i−1)%8であるリスタートマーカが付される。ここで用いた記号%は、剰余演算子であり、(i−1)%8は、値(i−1)を8で除算したときの余りを示す。   As is well known, the restart marker is assigned an identification number in the range from 0 to 7. A restart marker having an identification number (i-1) is attached to the rear end of the i-th band data. When i> 8, a restart marker whose identification number is (i−1)% 8 is attached to the rear end of the i-th band data. The symbol% used here is a remainder operator, and (i-1)% 8 indicates the remainder when the value (i-1) is divided by 8.

ここで、圧縮ユニット41によって実現される処理の流れを概念的に、図8を用いて説明する。読取画像データDIに対応する圧縮画像データD2を生成するに際して、圧縮ユニット41は、データ出力部59を介してヘッダを出力する(S110)。更に、データ入力部51を介して処理対象の画素ブロックを構成する画素データ群をRAM15から読み出し、必要に応じてダミーデータを加えて、ダミー付画像データD1における処理対象の画素ブロックのブロックデータであって、画素ブロック内の画素位置を副走査方向に反転したブロックデータを生成する(S120)。このブロックデータを、DCT変換部53、量子化部55、ジグザグシーケンス部56及び符号化部57を介して圧縮(符号化)し、圧縮ブロックデータに変換する。この圧縮ブロックデータを、ヘッダに続くデータとして出力する(S130)。   Here, the flow of processing realized by the compression unit 41 will be conceptually described with reference to FIG. When generating the compressed image data D2 corresponding to the read image data DI, the compression unit 41 outputs a header via the data output unit 59 (S110). Further, the pixel data group constituting the pixel block to be processed is read from the RAM 15 via the data input unit 51, dummy data is added as necessary, and the block data of the pixel block to be processed in the dummy image data D1 is used. Then, block data is generated by inverting the pixel position in the pixel block in the sub-scanning direction (S120). The block data is compressed (encoded) through the DCT conversion unit 53, the quantization unit 55, the zigzag sequence unit 56, and the encoding unit 57, and converted into compressed block data. This compressed block data is output as data following the header (S130).

圧縮ユニット41は、これらS120,S130に係る処理を1バンド分の画素ブロックの夫々に対して実行する。圧縮ユニット41は、これらの処理を1バンド分の画素ブロックの夫々に対して実行した場合であって(S140でYes)、全画素ブロックに対する実行が未完了である場合(S150でNo)、1バンド分の圧縮ブロックデータ群に続けてリスタートマーカを出力する(S160)。   The compression unit 41 executes the processing according to S120 and S130 for each pixel block for one band. The compression unit 41 executes these processes for each of the pixel blocks for one band (Yes in S140), and if the execution for all the pixel blocks is incomplete (No in S150), 1 A restart marker is output following the compressed block data group for the band (S160).

圧縮ユニット41は、上述した処理(S120,S130,S140,S150,S160)を、全画素ブロックに対して実行するまで、繰返し実行する。そして、全画素ブロックに対する実行が完了すると(S150でYes)、最終バンドの圧縮ブロックデータ群に続けてエンドマーカを出力して(S170)、読取画像データDIに対応する圧縮画像データD2をRAM15上に生成する。   The compression unit 41 repeatedly executes the above-described processing (S120, S130, S140, S150, S160) until it is executed for all pixel blocks. When the execution for all the pixel blocks is completed (Yes in S150), an end marker is output following the compressed block data group of the last band (S170), and the compressed image data D2 corresponding to the read image data DI is stored in the RAM 15. To generate.

上述した圧縮ユニット41A,41B,41C,41Dの動作により、RAM15には、ダミーデータのライン数Lが異なる複数の圧縮画像データD21,D22,D23,D24が記憶される。   By the operation of the compression units 41A, 41B, 41C, and 41D described above, the RAM 15 stores a plurality of compressed image data D21, D22, D23, and D24 with different numbers of lines L of dummy data.

選択ユニット45(図5参照)は、これらの圧縮画像データD21,D22,D23,D24の一つを、加工対象に選択し、選択した加工対象の圧縮画像データを加工ユニット47に入力する。具体的に、選択ユニット45は、原稿Pの先頭ラインから末尾ラインまでの読取動作の完了により特定される読取画像データDIの総ライン数Gに基づいて加工対象を選択する。   The selection unit 45 (see FIG. 5) selects one of the compressed image data D21, D22, D23, and D24 as a processing target, and inputs the selected compressed image data to be processed to the processing unit 47. Specifically, the selection unit 45 selects a processing target based on the total number of lines G of the read image data DI specified by the completion of the reading operation from the first line to the last line of the document P.

詳述すれば、選択ユニット45は、総ライン数Gを画素ブロックのライン数H=16で除算した場合の剰余R=G%Hを基準に、加工対象を選択する。具体的に、選択ユニット45は、RAM15に記憶される圧縮画像データD21,D22,D23,D24の内、読取画像データDIの先頭ラインよりも前に追加されたダミーデータのライン数Lと剰余Rとの加算値L+Rが、画素ブロックのライン数H以下で最大の圧縮画像データD2を、加工対象に選択する。但し、剰余R=0であるときには、ライン数L=0である圧縮画像データD21を加工対象に選択する。このようにして、選択ユニット45は、読取画像データDIの末尾ラインより後に付されたダミーデータのライン数が最小の圧縮画像データD2を加工対象に選択する。   More specifically, the selection unit 45 selects a processing target based on the remainder R = G% H when the total number of lines G is divided by the number of lines H of the pixel block = 16. Specifically, the selection unit 45 includes the line number L and the remainder R of the dummy data added before the first line of the read image data DI among the compressed image data D21, D22, D23, and D24 stored in the RAM 15. The compressed image data D2 having the maximum addition value L + R equal to or less than the number of lines H of the pixel block is selected as a processing target. However, when the remainder R = 0, the compressed image data D21 having the number of lines L = 0 is selected as a processing target. In this way, the selection unit 45 selects the compressed image data D2 having the smallest number of dummy data lines attached after the last line of the read image data DI as a processing target.

また、加工ユニット47は、加工対象に選択された圧縮画像データD2に基づいて、図9Aに示す処理を実行することにより、読取画像を副走査方向に反転した画像を表す反転圧縮画像データDOを生成する。   Further, the processing unit 47 executes the processing shown in FIG. 9A based on the compressed image data D2 selected as the processing target, thereby obtaining inverted compressed image data DO representing an image obtained by inverting the read image in the sub-scanning direction. Generate.

加工ユニット47は、反転圧縮画像データDOのヘッダとして、加工対象の圧縮画像データD2が有するヘッダのコピーデータをRAM15上に書き込む(S210)。その後、図9Bに示すように、加工対象の圧縮画像データD2内を末尾から逆方向に順に参照する(S220)。   The processing unit 47 writes the copy data of the header of the compressed image data D2 to be processed on the RAM 15 as the header of the inverted compressed image data DO (S210). Thereafter, as shown in FIG. 9B, the compressed image data D2 to be processed is referred to in order from the end in the reverse direction (S220).

この参照動作中に、リスタートマーカを検出すると(S230でYes)、加工ユニット47は、当該参照動作を中断する。そして、検出されたリスタートマーカから正方向(参照方向とは反対方向)に遡って最初に現れるマーカ(エンドマーカ)までの間に位置するデータを、1バンド分の圧縮ブロックデータの組、即ちバンドデータとみなして、このバンドデータのコピーデータを、反転圧縮画像データDOのヘッダに続けて書き込む(S250)。更にリスタートマーカ(FFD0)を追加し(S260)、S220に移行する。   If a restart marker is detected during this reference operation (Yes in S230), the processing unit 47 interrupts the reference operation. Then, the data located between the detected restart marker and the marker (end marker) that appears first in the forward direction (opposite to the reference direction) is a set of compressed block data for one band, that is, Assuming that the data is band data, the copy data of the band data is written in succession to the header of the inverted compressed image data DO (S250). Further, a restart marker (FFD0) is added (S260), and the process proceeds to S220.

S220では、参照動作を中断地点から再開する。そして、リスタートマーカを検出すると(S230でYes)、加工ユニット47は、このリスタートマーカから正方向に遡って最初に現れるマーカ(リスタートマーカ)までの間に位置するデータを、バンドデータとみなして、このバンドデータのコピーデータを、生成途中の反転圧縮画像データDOに追加する(S250)。更にリスタートマーカ(FFD1)を書き込み(S260)、S220に移行する。   In S220, the reference operation is resumed from the interruption point. When the restart marker is detected (Yes in S230), the processing unit 47 converts the data located between the restart marker and the first marker (restart marker) appearing in the positive direction as band data. Accordingly, the copy data of the band data is added to the inverted compressed image data DO being generated (S250). Further, a restart marker (FFD1) is written (S260), and the process proceeds to S220.

このようにして、加工ユニット47は、加工対象の圧縮画像データD2内を逆方向に参照し、リスタートマーカを検出する度に、このリスタートマーカを基準に特定されるバンドデータのコピーデータを、生成途中の反転圧縮画像データDOに追加する(S250)。更に、再付番したリスタートマーカを書き込む(S260)。   In this way, the processing unit 47 refers to the inside of the compressed image data D2 to be processed in the reverse direction, and each time the restart marker is detected, the copy data of the band data specified based on the restart marker is obtained. Then, it is added to the reverse compression image data DO being generated (S250). Furthermore, the renumbered restart marker is written (S260).

加工ユニット47は、その後、リスタートマーカではなくヘッダを検出すると(S240でYes)、ヘッダから正方向に遡って最初に現れるリスタートマーカまでの間に位置するバンドデータのコピーデータを、生成途中の反転圧縮画像データDOに追加する(S270)。更に、エンドマーカを付して(S280)、RAM15上に反転圧縮画像データDOを完成させる。   After that, when the processing unit 47 detects the header instead of the restart marker (Yes in S240), the copy data of the band data located between the header and the restart marker that appears first in the forward direction is being generated. Is added to the inverted compressed image data DO (S270). Further, an end marker is added (S280), and the inverted compressed image data DO is completed on the RAM 15.

このようにして図9Aに示す処理を実行することにより、加工ユニット47は、加工対象の圧縮画像データD2が有する圧縮ブロックデータ群をバンド単位で並び替え、更にはリスタートマーカを付け直すようにして、図9Bの下段に示すように構成される反転圧縮画像データDOを生成する。   By executing the processing shown in FIG. 9A in this way, the processing unit 47 rearranges the compressed block data group included in the compressed image data D2 to be processed in units of bands, and further attaches a restart marker. Thus, the inverted compressed image data DO configured as shown in the lower part of FIG. 9B is generated.

上述したように、本実施例の画像読取装置1によれば、読取デバイス20が原稿Pの両面を主走査方向に沿うライン毎に読み取る読取動作を、副走査方向に複数回繰返し実行することにより、原稿Pの片面毎に、読取画像データDIを生成する。具体的には、読取デバイス20は、読取動作毎に、1ライン分の画素データ群を備えるライン画像データを生成して、これを順次RAM15に書き込む。   As described above, according to the image reading apparatus 1 of the present embodiment, the reading device 20 repeatedly performs a reading operation of reading both surfaces of the document P for each line along the main scanning direction in the sub scanning direction. The read image data DI is generated for each side of the document P. Specifically, the reading device 20 generates line image data including a pixel data group for one line for each reading operation, and sequentially writes the line image data in the RAM 15.

JPEG圧縮回路40A,40Bは、読取デバイス20から最終ラインまでのライン画像データがRAM15に提供される前に、RAM15に1バンド分の画素データ群が蓄積される度、1バンド分の画素ブロックの夫々に対する圧縮処理を開始する。   The JPEG compression circuits 40A and 40B each store a pixel data group for one band each time a pixel data group for one band is accumulated in the RAM 15 before the line image data from the reading device 20 to the last line is provided to the RAM 15. The compression process for each is started.

更に特徴的なことに、圧縮ユニット41は、画素ブロックに対応する圧縮ブロックデータを生成する際、RAM15が記憶する画素ブロック内の画素データ群を、副走査方向において逆方向に読み出す。これにより、圧縮ユニット41は、画素ブロック内の画素データ群を、画素ブロック内の各画素の位置を副走査方向に反転させるように加工して圧縮し、画素ブロック内の読取画像が上下反転した圧縮ブロックデータを生成する。このようにして、圧縮ユニット41は、画素ブロック内の読取画像が上下反転した圧縮ブロックデータを画素ブロック毎に有する圧縮画像データD2を生成する。   Further characteristically, when generating the compressed block data corresponding to the pixel block, the compression unit 41 reads the pixel data group in the pixel block stored in the RAM 15 in the reverse direction in the sub-scanning direction. Thereby, the compression unit 41 processes and compresses the pixel data group in the pixel block so as to invert the position of each pixel in the pixel block in the sub-scanning direction, and the read image in the pixel block is inverted upside down. Generate compressed block data. In this way, the compression unit 41 generates compressed image data D2 having compressed block data for each pixel block in which the read image in the pixel block is inverted upside down.

加工ユニット47は、この圧縮ユニット41により生成された圧縮画像データD2が有する圧縮ブロックデータを、バンド単位で並び替えることにより、圧縮画像データD2が表す画像を、読取画像の上下反転画像に変換するように圧縮画像データD2を加工する。   The processing unit 47 converts the image represented by the compressed image data D2 into a vertically inverted image of the read image by rearranging the compressed block data included in the compressed image data D2 generated by the compression unit 41 in units of bands. The compressed image data D2 is processed as described above.

このように本実施例によれば、最終ライン(末尾ライン)までの読取動作が終了する前に、1バンド分の画素データ群がRAM15に蓄積される度、その画素データ群を画素ブロック単位で加工及び圧縮する。このため、効率的に反転圧縮画像データDOを生成することが可能である。   As described above, according to this embodiment, each time a pixel data group for one band is accumulated in the RAM 15 before the reading operation up to the final line (end line) is completed, the pixel data group is stored in units of pixel blocks. Process and compress. For this reason, it is possible to generate the inverted compressed image data DO efficiently.

例えば、読取画像データDIが完成してから、反転圧縮画像データDOを生成する場合には、圧縮されていない大きなデータサイズの読取画像データDIをRAM15に記憶する必要がある。これに対し、本実施例によれば、効率的にRAM15を利用することができ、反転圧縮画像データDOの生成作業に必要なデータ記憶領域のサイズを抑えることができる。   For example, when the inverted compressed image data DO is generated after the read image data DI is completed, the read image data DI having a large data size that is not compressed needs to be stored in the RAM 15. On the other hand, according to the present embodiment, the RAM 15 can be used efficiently, and the size of the data storage area necessary for generating the inverted compressed image data DO can be suppressed.

また、本実施例によれば、読取画像データDIが完成してから圧縮を開始する場合よりも、迅速に反転圧縮画像データDOを完成させることができるといった利点がある。従って、本実施例によれば、反転圧縮画像データDOを迅速にユーザに提供したり、反転圧縮画像データDOに基づく印刷物を迅速にユーザに提供したりすることができる。即ち、本実施例によれば、効率的に短辺綴じに適合した反転圧縮画像データDOを生成及び出力することができる。   Further, according to the present embodiment, there is an advantage that the inverted compressed image data DO can be completed more quickly than the case where the compression is started after the read image data DI is completed. Therefore, according to the present embodiment, the inverted compressed image data DO can be quickly provided to the user, and the printed matter based on the inverted compressed image data DO can be quickly provided to the user. That is, according to the present embodiment, it is possible to efficiently generate and output the inverted compressed image data DO suitable for short-edge binding.

この他、本実施例によれば、バンド単位で圧縮ブロックデータの組を並び替えるために、バンド単位の圧縮ブロックデータの組(バンドデータ)毎にリスタートマーカ(FFD0〜FFD7)を付した。そして、加工ユニット47では、このリスタートマーカに基づいて、バンド単位の圧縮ブロックデータの組を特定して、バンド単位で圧縮ブロックデータを並び替え、更にはリスタートマーカを付け直すようにして、圧縮画像データD2を加工するようにした。従って、本実施例によれば、圧縮画像データD2から反転圧縮画像データDOへの変換を適切且つ効率的に行うことができる。   In addition, according to the present embodiment, in order to rearrange the set of compressed block data in band units, restart markers (FFD0 to FFD7) are attached to each set of compressed block data (band data) in band units. Then, the processing unit 47 identifies a set of compressed block data in band units based on the restart marker, rearranges the compressed block data in band units, and re-adds the restart marker. The compressed image data D2 is processed. Therefore, according to the present embodiment, conversion from the compressed image data D2 to the inverted compressed image data DO can be performed appropriately and efficiently.

また、JPEG方式では、画素ブロック単位で読取画像データDIを圧縮するために読取画像データDIのライン数が画素ブロックの整数倍である必要がある。従来では、このようなライン数の調整を、読取画像データDIの末尾ラインより後に余白画像を表すダミーデータを追加して行っていた。   In the JPEG system, the number of lines of the read image data DI needs to be an integral multiple of the pixel block in order to compress the read image data DI in units of pixel blocks. Conventionally, such adjustment of the number of lines has been performed by adding dummy data representing a blank image after the last line of the read image data DI.

しかしながら、ダミーデータを読取画像データDIの末尾ラインより後のみに追加すると、反転圧縮画像データDOに基づいて、画像印刷を用紙に対して行った場合、ダミーデータに基づく余白画像が用紙の先頭側に表れ、真の読取画像が用紙の下端側に偏って表れる。この偏りは、ユーザに不満を及ぼす可能性がある。   However, if dummy data is added only after the end line of the read image data DI, when image printing is performed on a sheet based on the inverted compressed image data DO, a blank image based on the dummy data is displayed on the leading side of the sheet. Appear, and the true read image appears biased toward the lower end of the paper. This bias can be frustrating to the user.

そこで、本実施例では、読取画像データDIの先頭ラインより前にダミーデータを付すようにした。従って、本実施例によれば、反転圧縮画像データDOに基づいて、読取画像の反転画像を用紙に印刷する際に、その反転画像が用紙後端に偏って印刷されてしまうのを抑えることができる。   Therefore, in this embodiment, dummy data is added before the first line of the read image data DI. Therefore, according to the present embodiment, when the reverse image of the read image is printed on the paper based on the reverse compression image data DO, it is possible to suppress the reverse image from being printed biased toward the trailing edge of the paper. it can.

特に本実施例では、JPEG圧縮回路40Bに、複数の圧縮ユニット41A,41B,41C,41Dを設けた。そして、圧縮ユニット41A,41B,41C,41Dの夫々では、読取画像データDIの先頭ラインより前及び末尾ラインより後の少なくとも一方にダミーデータを追加することにより、画素ブロックのライン数Hに対して整数倍のライン数Qを有するダミー付画像データD11,D12,D13,D14を生成するが、圧縮ユニット41A,41B,41C,41D間では、先頭ラインより前に追加するダミーデータのライン数Lを互いに変えるようにした。   In particular, in this embodiment, the JPEG compression circuit 40B is provided with a plurality of compression units 41A, 41B, 41C, and 41D. Then, in each of the compression units 41A, 41B, 41C, and 41D, dummy data is added to at least one of the read image data DI before the first line and after the last line, so that the number of lines H of the pixel block is increased. Dummy image data D11, D12, D13, and D14 having a line number Q that is an integral multiple is generated. Between the compression units 41A, 41B, 41C, and 41D, the number L of dummy data added before the first line is set. I tried to change each other.

そして、これらダミー付画像データD11,D12,D13,D14に対応する圧縮画像データD21,D22,D23,D24の中から、末尾ライン側のダミーデータのライン数が最小の圧縮画像データを加工対象に選択し、反転圧縮画像データDOを生成するようにした。従って、本実施例によれば、読取画像データDIのライン数Gを事前に特定できないケースにおいても、反転画像が用紙後端に偏って印刷されてしまうのを抑えることのできる反転圧縮画像データDOを生成することができる。   Then, among the compressed image data D21, D22, D23, and D24 corresponding to the dummy image data D11, D12, D13, and D14, compressed image data having the smallest number of dummy data lines on the end line side is processed. The inverted compressed image data DO is generated by selection. Therefore, according to the present embodiment, even when the number G of lines of the read image data DI cannot be specified in advance, the reverse compressed image data DO that can suppress the reverse image from being printed biased toward the rear end of the paper. Can be generated.

ここで、上述した画像読取装置1について補足説明する。JPEG圧縮回路40Bは、読取画像を上下反転させる処理を実行せずに、原稿Pの第二面(うら面)の読取画像データDIを、圧縮画像データに変換可能な構成にされてもよい。反転圧縮画像データDOの生成が必要になるケースは、短辺綴じ用の原稿P1を印刷するケースなどの一部のケースに限られる。従って、JPEG圧縮回路40Bは、CPU11からの指示に従って、反転圧縮画像データDOを生成する動作モード、及び、読取画像を上下反転せずに読取画像データDIを圧縮画像データに変換する動作モードのいずれかによって動作するように構成されてもよい。   Here, a supplementary description will be given of the image reading apparatus 1 described above. The JPEG compression circuit 40B may be configured to convert the read image data DI of the second side (back side) of the document P into compressed image data without executing the process of inverting the read image upside down. The case where the inverted compressed image data DO needs to be generated is limited to some cases such as the case of printing the original P1 for short side binding. Accordingly, the JPEG compression circuit 40B is in either an operation mode for generating the inverted compressed image data DO or an operation mode for converting the read image data DI into the compressed image data without inverting the read image in accordance with an instruction from the CPU 11. It may be configured to operate depending on the situation.

また、JPEG圧縮回路40Aは、既知のJPEG圧縮回路と同様に構成されればよい。即ち、JPEG圧縮回路40Aは、読取画像データDIを画素ブロック単位で、画素ブロック内の各画素の位置を副走査方向に反転する加工をせずに圧縮することにより、原稿Pの読取画像を表す圧縮画像データとして、画素ブロック毎の圧縮ブロックデータを備える圧縮画像データをRAM15上に生成するように構成されればよい。   The JPEG compression circuit 40A may be configured similarly to a known JPEG compression circuit. In other words, the JPEG compression circuit 40A represents the read image of the document P by compressing the read image data DI in units of pixel blocks without performing the process of inverting the position of each pixel in the pixel block in the sub-scanning direction. What is necessary is just to be comprised so that the compressed image data provided with the compressed block data for every pixel block may be produced | generated on RAM15 as compressed image data.

読取画像データDIのライン数Gが画素ブロックのライン数Hの整数倍でない場合には、ダミーデータを読取画像データDIの末尾ラインに付して、ライン数を調整したダミー付画像データを圧縮するように、JPEG圧縮回路40Aは、構成されればよい。即ち、JPEG圧縮回路40Aは、圧縮ユニット41と同様のハードウェア構成を有する圧縮ユニットであって、RAM15から正方向に画素データ群を読み出す圧縮ユニットとして構成され得る。   If the number of lines G of the read image data DI is not an integral multiple of the number of lines H of the pixel block, dummy data is attached to the end line of the read image data DI, and the dummy image data with the adjusted number of lines is compressed. As described above, the JPEG compression circuit 40A may be configured. That is, the JPEG compression circuit 40A is a compression unit having the same hardware configuration as the compression unit 41, and can be configured as a compression unit that reads a pixel data group from the RAM 15 in the forward direction.

このように、JPEG圧縮回路40Aとしての機能は、JPEG圧縮回路40Bの一部構成を利用して実現可能であるため、JPEG圧縮回路40A,40Bは一つにまとめられてもよい。この他、圧縮ユニット41A,41B,41C,41Dは、重複する回路を共通化した一つの圧縮ユニットとして構成されてもよい。また、選択ユニット45及び加工ユニット47としての機能は、ソフトウェアにより実現されてもよい。選択ユニット45及び加工ユニット47としての機能は、JPEG圧縮回路40Bではなく、CPU11がプログラムを実行することにより、実現され得る。   As described above, since the function as the JPEG compression circuit 40A can be realized by using a partial configuration of the JPEG compression circuit 40B, the JPEG compression circuits 40A and 40B may be combined into one. In addition, the compression units 41A, 41B, 41C, and 41D may be configured as one compression unit in which overlapping circuits are shared. Further, the functions as the selection unit 45 and the processing unit 47 may be realized by software. The functions as the selection unit 45 and the processing unit 47 can be realized by the CPU 11 executing the program instead of the JPEG compression circuit 40B.

この他、画像読取装置1は、図10及び図11に示すタイムチャートに従って動作するように構成されてもよい。図10及び図11によれば、第四圧縮ユニットとしての圧縮ユニット41Dは、読取画像データDIの先頭ラインより前に12ライン分のダミーデータを追加することから、第1バンドデータを構成する画素データ群として、読取画像データDIを構成する先頭ラインから4ライン分の画素データ群がRAM15に蓄積された時点で、1バンド分の圧縮処理を実行する。この圧縮処理では、第1バンドデータを構成する画素ブロック毎の圧縮ブロックデータを生成してRAM15に書き込む。   In addition, the image reading apparatus 1 may be configured to operate according to the time charts shown in FIGS. 10 and 11. According to FIGS. 10 and 11, the compression unit 41D as the fourth compression unit adds 12 lines of dummy data before the first line of the read image data DI, so that the pixels constituting the first band data As a data group, when a pixel data group for four lines from the first line constituting the read image data DI is accumulated in the RAM 15, compression processing for one band is executed. In this compression processing, compressed block data for each pixel block constituting the first band data is generated and written to the RAM 15.

その後、圧縮ユニット41Dは、読取画像データDIを構成する第(16×J+5)ラインから第(16×J+20)ラインまでの画素データ群がRAM15に蓄積される度に(Jは0以上の整数)、第(J+2)バンドを構成する画素ブロック毎の圧縮ブロックデータを生成することにより、圧縮画像データD24を生成する。   Thereafter, each time the pixel data group from the (16 × J + 5) th line to the (16 × J + 20) th line constituting the read image data DI is accumulated in the RAM 15 (J is an integer of 0 or more). The compressed image data D24 is generated by generating compressed block data for each pixel block constituting the (J + 2) th band.

一方、第三圧縮ユニットとしての圧縮ユニット41Cは、読取画像データDIの先頭ラインより前に8ライン分のダミーデータを追加することから、第1バンドデータを構成する画素データ群として、読取画像データDIを構成する先頭ラインから8ライン分の画素データ群がRAM15に蓄積された時点で、1バンド分の圧縮処理を実行する。その後、圧縮ユニット41Cは、読取画像データDIを構成する第(16×J+9)ラインから第(16×J+24)ラインまでの画素データ群がRAM15に蓄積される度に、第(J+2)バンドデータを構成する画素ブロック毎の圧縮ブロックデータを生成することにより、圧縮画像データD23を生成する。   On the other hand, since the compression unit 41C as the third compression unit adds dummy data for eight lines before the first line of the read image data DI, the read image data is used as a pixel data group constituting the first band data. When the pixel data group for 8 lines from the first line constituting the DI is accumulated in the RAM 15, compression processing for 1 band is executed. Thereafter, the compression unit 41C stores the (J + 2) -th band data every time the pixel data group from the (16 × J + 9) -th line to the (16 × J + 24-th) line constituting the read image data DI is accumulated in the RAM 15. The compressed image data D23 is generated by generating compressed block data for each pixel block constituting the block.

第二圧縮ユニットとしての圧縮ユニット41Bは、読取画像データDIの先頭ラインより前に4ライン分のダミーデータを追加することから、第1バンドデータを構成する画素データ群として、読取画像データDIを構成する先頭ラインから12ライン分の画素データ群がRAM15に蓄積された時点で、1バンド分の圧縮処理を実行する。その後、圧縮ユニット41Bは、読取画像データDIを構成する第(16×J+13)ラインから第(16×J+28)ラインまでの画素データ群がRAM15に蓄積される度に、第(J+2)バンドデータを構成する画素ブロック毎の圧縮ブロックデータを生成することにより、圧縮画像データD22を生成する。   Since the compression unit 41B as the second compression unit adds dummy data for four lines before the first line of the read image data DI, the read image data DI is used as a pixel data group constituting the first band data. When the pixel data group for 12 lines from the first line constituting the data is accumulated in the RAM 15, compression processing for one band is executed. Thereafter, each time the pixel data group from the (16 × J + 13) th line to the (16 × J + 28) th line constituting the read image data DI is accumulated in the RAM 15, the compression unit 41B stores the (J + 2) th band data. The compressed image data D22 is generated by generating compressed block data for each pixel block constituting the block.

第一圧縮ユニットとしての圧縮ユニット41Aは、読取画像データDIの先頭ラインより前にダミーデータを追加しないことから、第1バンドデータを構成する画素データ群として、読取画像データDIを構成する先頭ラインから16ライン分の画素データ群がRAM15に蓄積された時点で、1バンド分の圧縮処理を実行する。その後、圧縮ユニット41Aは、読取画像データDIを構成する第(16×J+17)ラインから第(16×J+32)ラインまでの画素データ群がRAM15に蓄積される度に、第(J+2)バンドデータを構成する画素ブロック毎の圧縮ブロックデータを生成することにより、圧縮画像データD21を生成する。   Since the compression unit 41A as the first compression unit does not add dummy data before the first line of the read image data DI, the first line constituting the read image data DI as a pixel data group constituting the first band data. When the pixel data group for 16 lines is accumulated in the RAM 15, the compression processing for one band is executed. Thereafter, the compression unit 41A stores the (J + 2) -th band data every time the pixel data group from the (16 × J + 17) th line to the (16 × J + 32) -th line constituting the read image data DI is accumulated in the RAM 15. The compressed image data D21 is generated by generating compressed block data for each pixel block constituting the block.

そして、JPEG圧縮回路40Bは、圧縮ユニット41Aによる先頭ラインから第16ラインまでの画素データ群についての圧縮ブロックデータ化が終了すると、不要になった先頭ライン(第1ライン)から第4ラインまでの画素データ群が書き込まれているRAM15内の領域を上書き可能な領域に開放するための処理を実行する。その後、JPEG圧縮回路40Bは、圧縮ユニット41A,41B,41C,41Dの全てで圧縮ブロックデータ化の完了した画素データ群が書き込まれているRAM15内の領域を、順次、上書き可能な領域に開放するための処理を実行する。   Then, when the compression unit 41A completes the compression block data conversion for the pixel data group from the first line to the sixteenth line, the JPEG compression circuit 40B completes the unnecessary first line (first line) to the fourth line. Processing for releasing the area in the RAM 15 in which the pixel data group is written into an overwritable area is executed. Thereafter, the JPEG compression circuit 40B sequentially releases the area in the RAM 15 in which the pixel data group that has been converted into the compressed block data in all of the compression units 41A, 41B, 41C, and 41D is written into an overwritable area. Execute the process for

具体的に、JPEG圧縮回路40Bは、上書き可能な領域を通知する通知信号を、読取デバイス20から提供される画素データ群をRAM15に書き込む読取補正回路35に対して入力することにより、上記開放するための処理を実行することができる。   Specifically, the JPEG compression circuit 40B releases the above by inputting a notification signal for notifying the overwritable area to the reading correction circuit 35 that writes the pixel data group provided from the reading device 20 to the RAM 15. Can be executed.

このように構成された画像読取装置1によれば、少ない記憶容量のメモリ(RAM15)を用いて効率的に読取画像データDIを反転圧縮画像データDOに変換することができ、大変有意義である。   According to the image reading apparatus 1 configured as described above, the read image data DI can be efficiently converted into the inverted compressed image data DO using the memory (RAM 15) having a small storage capacity, which is very significant.

最後に用語間の対応関係について説明する。JPEG圧縮回路40A及びJPEG圧縮回路40Bが備える圧縮ユニット41A,41B,41C,41Dは、本発明の圧縮装置が備える圧縮ユニットの一例に対応し、選択ユニット45及び加工ユニット47は、本発明の圧縮装置が備える加工ユニットの一例に対応する。ダミー追加部513、セレクタ515及び入力制御部517によって実現される機能は、追加ユニットによって実現される機能の一例に対応する。   Finally, the correspondence between terms will be described. The compression units 41A, 41B, 41C, and 41D included in the JPEG compression circuit 40A and the JPEG compression circuit 40B correspond to an example of the compression unit included in the compression apparatus of the present invention, and the selection unit 45 and the processing unit 47 correspond to the compression unit of the present invention. This corresponds to an example of a processing unit provided in the apparatus. The function realized by the dummy adding unit 513, the selector 515, and the input control unit 517 corresponds to an example of the function realized by the additional unit.

1…画像読取装置、11…CPU、13…ROM、15…RAM、20…読取デバイス、21A,21B…イメージセンサ、31…読取制御回路、33…A/D変換器、35…読取補正回路、37…画像処理回路、40A,40B…JPEG圧縮回路、41,41A,41B,41C,41D…圧縮ユニット、45…選択ユニット、47…加工ユニット、51…データ入力部、53…DCT変換部、55…量子化部、56…ジグザグシーケンス部、57…符号化部、59…データ出力部、511…主入力部、513…ダミー追加部、515…セレクタ、517…入力制御部、D1,D11,D12,D13,D14…ダミー付画像データ、D2,D21,D22,D23,D24…圧縮画像データ、DI…読取画像データ、DO…反転圧縮画像データ、P,P0,P1…原稿。 DESCRIPTION OF SYMBOLS 1 ... Image reading apparatus, 11 ... CPU, 13 ... ROM, 15 ... RAM, 20 ... Reading device, 21A, 21B ... Image sensor, 31 ... Reading control circuit, 33 ... A / D converter, 35 ... Reading correction circuit, 37 ... Image processing circuit, 40A, 40B ... JPEG compression circuit, 41, 41A, 41B, 41C, 41D ... Compression unit, 45 ... Selection unit, 47 ... Processing unit, 51 ... Data input unit, 53 ... DCT conversion unit, 55 Quantizer, 56 ... Zigzag sequence unit, 57 ... Coding unit, 59 ... Data output unit, 511 ... Main input unit, 513 ... Dummy addition unit, 515 ... Selector, 517 ... Input control unit, D1, D11, D12 , D13, D14 ... Image data with dummy, D2, D21, D22, D23, D24 ... Compressed image data, DI ... Read image data, DO ... Inverted compressed image Data, P, P0, P1 ... manuscript.

Claims (8)

原稿を主走査方向に沿うライン毎に読み取る読取動作を副走査方向に複数回実行することにより生成される前記原稿の読取画像を表す画像データを、圧縮することによって、前記画像データに対応する圧縮画像データを生成する圧縮ユニットと、
前記圧縮ユニットにより生成された前記圧縮画像データを加工する加工ユニットと、
を備え、
前記圧縮ユニットは、前記主走査方向に所定画素数及び前記副走査方向に所定ライン数の領域として定められる画素ブロック毎に、前記画像データにおける前記画素ブロック内のデータであるブロックデータを、前記画素ブロック内の各画素の位置を前記副走査方向に反転させるように加工して圧縮することにより、圧縮ブロックデータを生成し、前記圧縮画像データとして、前記読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成し、
前記加工ユニットは、前記主走査方向に沿う前記画素ブロックの組に対応する前記圧縮ブロックデータの組であるバンド単位で、前記圧縮画像データが有する前記圧縮ブロックデータを並び替えることにより、前記圧縮画像データが表す画像を、前記読取画像を前記副走査方向に反転した画像に変換するように、前記圧縮画像データを加工すること
を特徴とする圧縮装置。
Compression corresponding to the image data by compressing image data representing a read image of the document generated by executing a reading operation for reading the document line by line in the main scanning direction a plurality of times in the sub-scanning direction. A compression unit for generating image data;
A processing unit for processing the compressed image data generated by the compression unit;
With
For each pixel block defined as an area having a predetermined number of pixels in the main scanning direction and a predetermined number of lines in the sub-scanning direction, the compression unit converts block data that is data in the pixel block in the image data into the pixels A compressed block data is generated by processing and compressing the position of each pixel in the block so as to be inverted in the sub-scanning direction, and a plurality of compressed blocks corresponding to the entire area of the read image is generated as the compressed image data. Generating compressed image data having data;
The processing unit rearranges the compressed block data included in the compressed image data in a band unit that is a set of the compressed block data corresponding to the set of the pixel blocks along the main scanning direction. A compression apparatus that processes the compressed image data so as to convert an image represented by data into an image obtained by inverting the read image in the sub-scanning direction.
前記圧縮ユニットは、前記圧縮画像データとして、前記バンド単位で前記圧縮ブロックデータの組に対してマーカを付した圧縮画像データを生成し、
前記加工ユニットは、前記圧縮画像データ内の前記マーカに基づいて、前記バンド単位の前記圧縮ブロックデータの組を特定すること
を特徴とする請求項1記載の圧縮装置。
The compression unit generates, as the compressed image data, compressed image data with a marker attached to the set of compressed block data in units of bands,
The compression device according to claim 1, wherein the processing unit specifies the set of the compressed block data in the band unit based on the marker in the compressed image data.
前記圧縮ユニットは、前記圧縮画像データとして、前記バンド単位で前記圧縮ブロックデータの組に対してリスタートマーカを付したJPEG方式の圧縮画像データを生成し、
前記加工ユニットは、前記圧縮画像データ内の前記リスタートマーカに基づいて、前記バンド単位の前記圧縮ブロックデータの組を特定し、
前記加工ユニットは、前記バンド単位で前記圧縮ブロックデータを並び替え、更には前記リスタートマーカを付け直すようにして、前記圧縮画像データを加工すること
を特徴とする請求項1記載の圧縮装置。
The compression unit generates, as the compressed image data, JPEG compressed image data with a restart marker attached to the set of compressed block data in the band unit,
The processing unit identifies the set of compressed block data in band units based on the restart marker in the compressed image data,
The compression apparatus according to claim 1, wherein the processing unit processes the compressed image data by rearranging the compressed block data in units of bands and further adding the restart marker.
前記圧縮ユニットには、前記画像データを構成する先頭ラインから末尾ラインまでのライン単位のデータであるライン画像データの夫々が順次提供され、
前記圧縮ユニットは、前記末尾ラインまでの前記ライン画像データが提供される前に、前記圧縮を開始すること
を特徴とする請求項1〜請求項3のいずれか一項記載の圧縮装置。
Each of the line image data that is data in line units from the first line to the last line constituting the image data is sequentially provided to the compression unit,
The compression apparatus according to any one of claims 1 to 3, wherein the compression unit starts the compression before the line image data up to the end line is provided.
前記画像データの前記先頭ラインよりも前に所定ライン数分のダミーデータを追加する追加ユニット
を備え、
前記圧縮ユニットは、前記追加ユニットにより前記ダミーデータが追加された画像データであるダミー付画像データにおける前記画素ブロック毎に、前記画素ブロック内の各画素の位置を前記副走査方向に反転するように加工した前記圧縮ブロックデータを生成して、前記圧縮画像データを生成すること
を特徴とする請求項4記載の圧縮装置。
An additional unit for adding dummy data for a predetermined number of lines before the head line of the image data,
The compression unit reverses the position of each pixel in the pixel block in the sub-scanning direction for each pixel block in the image data with dummy, which is image data to which the dummy data is added by the additional unit. The compression apparatus according to claim 4, wherein the compressed image data is generated by generating the processed compressed block data.
前記画像データの前記先頭ラインより前及び前記末尾ラインより後の少なくとも一方にダミーデータを追加することにより前記画素ブロックのライン数に対して整数倍のライン数を有するダミー付画像データを生成する追加ユニット
を備え、
前記追加ユニットは、前記ダミー付画像データとして、前記先頭ラインよりも前に付される前記ダミーデータのライン数が異なる複数のダミー付画像データを生成し、
前記圧縮ユニットは、前記複数のダミー付画像データの夫々に関して、前記ダミー付画像データにおける前記画素ブロック毎に前記画素ブロック内の各画素の位置を前記副走査方向に反転するように加工した前記圧縮ブロックデータを生成して、前記ダミー付画像データの全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成することにより、複数の圧縮画像データを生成し、
前記加工ユニットは、前記複数の圧縮画像データの内の一つを加工対象に選択し、前記選択した圧縮画像データが有する前記圧縮ブロックデータを、前記バンド単位で、先頭ライン側と末尾ライン側とが反転するように並び替えることにより、前記圧縮画像データが表す画像を、前記読取画像を前記副走査方向に反転した画像に変換するように、前記圧縮画像データを加工すること
を特徴とする請求項4記載の圧縮装置。
Addition of generating dummy image data having a number of lines that is an integral multiple of the number of lines of the pixel block by adding dummy data to at least one of the image data before the first line and after the last line With a unit
The additional unit generates, as the dummy image data, a plurality of dummy image data having different numbers of lines of the dummy data attached before the first line,
The compression unit is configured to process each of the plurality of dummy image data so that the position of each pixel in the pixel block is inverted in the sub-scanning direction for each pixel block in the dummy image data. Generating block data, generating a plurality of compressed image data by generating a compressed image data having a plurality of compressed block data corresponding to the entire area of the dummy image data,
The processing unit selects one of the plurality of compressed image data as a processing target, and the compressed block data included in the selected compressed image data includes a first line side and a last line side in the band unit. The compressed image data is processed so that an image represented by the compressed image data is converted into an image obtained by inverting the read image in the sub-scanning direction by rearranging the images so as to be reversed. Item 5. The compression device according to Item 4.
前記加工ユニットは、前記複数の圧縮画像データの内、前記末尾ラインより後に付される前記ダミーデータのライン数が最小の圧縮画像データを、前記加工対象に選択すること
を特徴とする請求項6記載の圧縮装置。
The processing unit selects, as the processing target, compressed image data having a minimum number of lines of the dummy data attached after the end line among the plurality of compressed image data. The compression device described.
前記圧縮ユニットには、前記原稿の両面を前記ライン毎に読み取る読取動作を複数回実行することにより生成される前記原稿の片面毎の前記片面の読取画像を表す画像データが提供され、
前記圧縮ユニットは、
前記両面の内、第一の片面の読取画像を表す前記画像データについては、前記画素ブロック内の各画素の位置を前記副走査方向に反転する加工をせずに、前記画素ブロック毎の前記圧縮ブロックデータを生成して、前記読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成し、
前記両面の内、第二の片面の読取画像を表す前記画像データについては、前記画素ブロック毎に、前記画素ブロック内の各画素の位置を前記副走査方向に反転する加工をした前記圧縮ブロックデータを生成して、前記読取画像の全域に対応する複数の圧縮ブロックデータを有する圧縮画像データを生成し、
前記加工ユニットは、
前記第一及び前記第二の片面に対応する前記圧縮画像データの内、前記第二の片面に対応する前記圧縮画像データが有する前記圧縮ブロックデータを前記バンド単位で並び替えることにより、前記第二の片面に対応する前記圧縮画像データが表す画像を、前記第二の片面の読取画像を前記副走査方向に反転した画像に変換するように、前記圧縮画像データを加工すること
を特徴とする請求項1〜請求項7のいずれか一項記載の圧縮装置。
The compression unit is provided with image data representing the read image on one side of each side of the document generated by executing a reading operation for reading both sides of the document for each line a plurality of times.
The compression unit is
For the image data representing the read image of the first single side of the two sides, the compression for each pixel block is performed without performing a process of inverting the position of each pixel in the pixel block in the sub-scanning direction. Generate block data, generate compressed image data having a plurality of compressed block data corresponding to the entire area of the read image,
For the image data representing the read image of the second single side of the two sides, the compressed block data obtained by processing the pixel block in the pixel block to be inverted in the sub-scanning direction for each pixel block. To generate compressed image data having a plurality of compressed block data corresponding to the entire area of the read image,
The processing unit is
By rearranging the compressed block data included in the compressed image data corresponding to the second single side among the compressed image data corresponding to the first and second single sides, the second unit The compressed image data is processed so that an image represented by the compressed image data corresponding to one side of the image is converted into an image obtained by inverting the read image on the second single side in the sub-scanning direction. The compression apparatus as described in any one of Claims 1-7.
JP2014229832A 2014-11-12 2014-11-12 Compression device Active JP6354532B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014229832A JP6354532B2 (en) 2014-11-12 2014-11-12 Compression device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014229832A JP6354532B2 (en) 2014-11-12 2014-11-12 Compression device

Publications (2)

Publication Number Publication Date
JP2016096379A true JP2016096379A (en) 2016-05-26
JP6354532B2 JP6354532B2 (en) 2018-07-11

Family

ID=56071395

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014229832A Active JP6354532B2 (en) 2014-11-12 2014-11-12 Compression device

Country Status (1)

Country Link
JP (1) JP6354532B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09107447A (en) * 1995-10-09 1997-04-22 Minolta Co Ltd Digital copying machine
JP2002103700A (en) * 2000-09-28 2002-04-09 Matsushita Electric Ind Co Ltd Image processor
JP2003209639A (en) * 2002-01-15 2003-07-25 Sharp Corp Color facsimile device
JP2006033568A (en) * 2004-07-20 2006-02-02 Canon Inc Image input/output device, image processing method, storage medium with computer-readable program stored therein, and program
JP2007324973A (en) * 2006-06-01 2007-12-13 Fuji Xerox Co Ltd Unit and method for processing image, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09107447A (en) * 1995-10-09 1997-04-22 Minolta Co Ltd Digital copying machine
JP2002103700A (en) * 2000-09-28 2002-04-09 Matsushita Electric Ind Co Ltd Image processor
JP2003209639A (en) * 2002-01-15 2003-07-25 Sharp Corp Color facsimile device
JP2006033568A (en) * 2004-07-20 2006-02-02 Canon Inc Image input/output device, image processing method, storage medium with computer-readable program stored therein, and program
JP2007324973A (en) * 2006-06-01 2007-12-13 Fuji Xerox Co Ltd Unit and method for processing image, and program

Also Published As

Publication number Publication date
JP6354532B2 (en) 2018-07-11

Similar Documents

Publication Publication Date Title
JP2006129471A (en) Image processing method and image processing apparatus
JP6354532B2 (en) Compression device
JP6569949B2 (en) Apparatus and method for data decoding
JP2011040970A (en) Data processing apparatus and data processing method
JP2017139510A (en) Image processing apparatus
JP5147641B2 (en) Document reader
US8275220B2 (en) Image processing apparatus, image processing method, and storage medium storing computer program for image area separation processing
US8259343B2 (en) Image processing device and image processing method
JP2018058295A (en) Image processing apparatus, image processing method and program
JP2012110036A (en) Printer
US8582168B2 (en) Image processing apparatus and processing method thereof
JP6536180B2 (en) Copier
US11314995B2 (en) Image processing apparatus, image processing method, and storage medium
JP4771095B2 (en) Image compression device
JP2010088007A (en) Image forming apparatus
JP4148456B2 (en) Image decoding apparatus, image decoding method, program, and recording medium
JP3867857B2 (en) Color image processing device
JP4262145B2 (en) Image processing apparatus and control method thereof
JP3982693B2 (en) Secondary discrete cosine transform processing device, secondary discrete cosine transform processing method, image encoding processing device, and image encoding processing method
JP2004080387A (en) Image processing apparatus and image processing method
JP2012054802A (en) Information processor, information processing method, and program
JP2013121100A (en) Image processing device and image processing method
JP2008027198A (en) Image processing apparatus and method
JP2006295301A (en) Image forming apparatus
JP2000236447A (en) Image processing unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170323

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180206

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180328

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180515

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180528

R150 Certificate of patent or registration of utility model

Ref document number: 6354532

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150