JP2006279741A - Method, apparatus and program for image compression, and image reading apparatus - Google Patents

Method, apparatus and program for image compression, and image reading apparatus Download PDF

Info

Publication number
JP2006279741A
JP2006279741A JP2005098337A JP2005098337A JP2006279741A JP 2006279741 A JP2006279741 A JP 2006279741A JP 2005098337 A JP2005098337 A JP 2005098337A JP 2005098337 A JP2005098337 A JP 2005098337A JP 2006279741 A JP2006279741 A JP 2006279741A
Authority
JP
Japan
Prior art keywords
group
color
replacement
processing target
digital image
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
JP2005098337A
Other languages
Japanese (ja)
Other versions
JP4609155B2 (en
Inventor
Yukinobu Momozono
幸信 桃薗
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2005098337A priority Critical patent/JP4609155B2/en
Publication of JP2006279741A publication Critical patent/JP2006279741A/en
Application granted granted Critical
Publication of JP4609155B2 publication Critical patent/JP4609155B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method, apparatus and program for image compression and image reading apparatus with which a digital image is compressed with high compressibility so as not to damage readability of character. <P>SOLUTION: The image compression method includes: a setting stage of setting a processing target region on a digital image; a grouping stage of grouping pixels constituting the processing target region for each pixel with little color difference; a selecting stage of selecting a replacement target group based on feature amounts of the groups; a location information generating stage of indicating a location of each of the pixels belonging to the replacement target group; a replacing stage of replacing the color of each of pixels belonging to the replacement target group with the color of surrounding pixels; a digital image compressing stage of generating image compression data by compressing the digital image after the color of each of the pixels is replaced; and an output stage of outputting color data representing the representative color of the replacement target group, the location information and the image compression data in an associated manner. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、画像圧縮方法、画像圧縮装置、画像圧縮プログラム及び画像読み取り装置に関する。   The present invention relates to an image compression method, an image compression apparatus, an image compression program, and an image reading apparatus.

原稿を読み取ってディジタル画像を生成し、生成したディジタル画像を圧縮して着脱自在のメモリカードに保存する画像読み取り装置が知られている(例えば、特許文献1参照。)。しかしながら、メモリカードはパーソナルコンピュータが備えるハードディスクなどに比べて一般に記憶容量が小さく、一方、ディジタル画像は圧縮してもまだデータ量が大きいので、ディジタル画像をメモリカードに保存するとメモリカードが直ぐに一杯になってしまう。   There is known an image reading apparatus that reads a document to generate a digital image, compresses the generated digital image, and stores the compressed digital image on a removable memory card (see, for example, Patent Document 1). However, a memory card generally has a smaller storage capacity than a hard disk or the like provided in a personal computer. On the other hand, even if a digital image is compressed, the amount of data is still large. turn into.

また、例えば文書を他人に配布する場合、紙の文書を画像読み取り装置で読み取ってディジタル画像を生成し、生成したディジタル画像を電子メールに添付して送付することがある。しかしながら前述したようにディジタル画像は圧縮してもまだデータ量が大きいので、電子メールに添付して送信すると送信に時間がかかったり送信エラーになって送信できなかったりする場合がある。   For example, when distributing a document to another person, a paper document may be read by an image reading device to generate a digital image, and the generated digital image may be attached to an e-mail and sent. However, as described above, even if a digital image is compressed, the amount of data is still large. Therefore, if it is attached to an e-mail and transmitted, it may take a long time to transmit or may not be transmitted due to a transmission error.

このようにディジタル画像のデータ量が大きいと様々な問題が生じるため、ディジタル画像をより小さく圧縮できる方法が望まれている。JPEG圧縮は圧縮率が可変であるため、より高圧縮率で圧縮することでデータ量をより小さくすることができる。しかしながら、JPEG圧縮は不可逆圧縮であり、不可逆圧縮では圧縮率を高くするほど多くのデータが切り捨てられるので、圧縮率を高くするほど画質が低下する。例えば文書を読み取って生成したディジタル画像の場合は、圧縮率を高くすると再生の際に文字が滲んで読み難くなってしまう。このため文書を読み取って生成したディジタル画像の場合は安易に圧縮率を高くできないという問題がある。   Since a large amount of digital image data causes various problems as described above, a method capable of compressing the digital image smaller is desired. Since the compression rate of JPEG compression is variable, the amount of data can be reduced by compressing at a higher compression rate. However, JPEG compression is irreversible compression, and in irreversible compression, a larger amount of data is discarded as the compression rate is increased. Therefore, the image quality is lowered as the compression rate is increased. For example, in the case of a digital image generated by reading a document, if the compression ratio is increased, characters are blurred during reproduction and it becomes difficult to read. For this reason, a digital image generated by reading a document has a problem that the compression rate cannot be easily increased.

特開2000−13577号公報JP 2000-13577 A

本発明は、上記問題に鑑みて創作されたものであって、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮する画像圧縮方法、画像圧縮装置、画像圧縮プログラム及び画像読み取り装置を提供することを目的とする。   The present invention has been made in view of the above problems, and is an image compression method, an image compression apparatus, an image compression program, and an image reading apparatus for compressing a digital image at a high compression rate without impairing the readability of characters. The purpose is to provide.

(1)上記目的を達成するため、本発明に係る画像圧縮方法は、ディジタル画像上に処理対象領域を設定する設定段階と、前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化段階と、各前記グループの特徴量に基づいて置換対象グループを選択する選択段階と、前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成段階と、前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換段階と、前記置換段階で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮段階と、前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力段階と、を含む。
処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化した場合、文字を表す画素が属するグループはその特徴量が特定の傾向を持っていることが多い。従って、特徴量を用いれば文字を表す画素が属するグループを高い確率で特定することができる。文字を表す画素が属するグループを置換対象グループとし、ディジタル画像において置換対象グループに属する画素の色を周囲の画素の色で置換すると、ディジタル画像から文字を除去することができる。ディジタル画像から文字を除去するとディジタル画像の圧縮率は文字の読み易さに影響を与えなくなるので、ディジタル画像を高圧縮率で圧縮することができる。一方、文字を表す画素の位置を示す位置情報は各画素の濃度を持つ必要がないので小さなデータ量でよい。従ってディジタル画像全体のデータ量を小さくできる。再生の際にはディジタル画像において位置情報が示す画素の色を色データが表す代表色に置換することにより、文字は滲むことなく再生される。よって本発明によると、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮できる。
(1) In order to achieve the above object, an image compression method according to the present invention includes a setting step of setting a processing target area on a digital image and a group of pixels constituting the processing target area for each pixel having a small color difference. A grouping step for selecting, a selection step for selecting a replacement target group based on a feature amount of each group, a position information generation step for generating position information indicating the position of each pixel belonging to the replacement target group, A replacement step of replacing the color of each pixel belonging to the replacement target group with a color of a surrounding pixel not belonging to the replacement target group; and the digital image after the replacement of the color of each pixel in the replacement step is compressed A digital image compression stage for generating compressed image data, color data representing a representative color of the replacement target group, the position information, and the compressed image data. Comprising an output step for attaching output, a.
When the pixels constituting the processing target region are grouped for each pixel having a small color difference, the group to which the pixel representing the character belongs often has a specific tendency in the feature amount. Therefore, if a feature amount is used, a group to which a pixel representing a character belongs can be specified with a high probability. When a group to which a pixel representing a character belongs is set as a replacement target group and the color of a pixel belonging to the replacement target group in the digital image is replaced with the color of a surrounding pixel, the character can be removed from the digital image. When characters are removed from the digital image, the digital image compression rate does not affect the readability of the characters, so the digital image can be compressed at a high compression rate. On the other hand, the position information indicating the position of the pixel representing the character does not need to have the density of each pixel, so a small amount of data is sufficient. Therefore, the data amount of the entire digital image can be reduced. At the time of reproduction, characters are reproduced without blurring by replacing the color of the pixel indicated by the position information in the digital image with the representative color represented by the color data. Therefore, according to the present invention, a digital image can be compressed at a high compression rate without impairing the readability of characters.

(2)前記設定段階は、前記ディジタル画像を複数のブロックに分割し、各前記ブロックを周波数成分に変換する変換段階と、各前記ブロックの高周波成分に基づいて前記処理対象領域を設定する領域設定段階と、を含んでもよい。
文字を含まない領域が処理対象領域に設定されると処理に無駄が生じる。文字を含む領域は周波数成分に変換すると高周波成分が大きな値となるので、各ブロックの高周波成分に基づいて処理対象領域を設定すると、文字を含まない領域が処理対象領域に設定されることによる無駄を低減できる。
(2) The setting step includes a conversion step of dividing the digital image into a plurality of blocks and converting each of the blocks into frequency components, and region setting for setting the processing target region based on the high-frequency components of the blocks. Stages.
If an area that does not include characters is set as a processing target area, processing is wasted. When a region containing characters is converted to a frequency component, the high frequency component becomes a large value. Therefore, if the processing target region is set based on the high frequency component of each block, the region not including the character is wasted as being set as the processing target region. Can be reduced.

(3)前記領域設定段階は、前記ディジタル画像全体を前記処理対象領域として設定する段階と、前記処理対象領域について前記ブロックからなる行毎に高周波成分が所定値以上である前記ブロックの数を集計し、高周波成分が所定値以上である前記ブロックの数が第一の閾値未満の行で前記処理対象領域を分割する段階と、前記処理対象領域について前記ブロックからなる列毎に高周波成分が所定値以上である前記ブロックの数を集計し、高周波成分が所定値以上である前記ブロックの数が第二の閾値未満の列で前記処理対象領域を分割する段階とを含み、行で前記処理対象領域を分割する前記段階と列で前記処理対象領域を分割する前記段階とを繰り返すことにより前記ディジタル画像上に複数の矩形の前記処理対象領域を設定してもよい。
複数の処理対象領域を設定すると、特徴量が特定の傾向をより顕著に持つようになるので、文字を表す画素が属するグループをより確実に選択することができる。
(3) The region setting step includes the step of setting the entire digital image as the processing target region, and the number of blocks having a high frequency component equal to or greater than a predetermined value for each row including the blocks in the processing target region. And dividing the processing target area by a row in which the number of blocks having a high frequency component equal to or greater than a predetermined value is less than a first threshold, and the high frequency component having a predetermined value for each column of the blocks in the processing target area And dividing the processing target area by a column in which the number of blocks having a high frequency component equal to or greater than a predetermined value is less than a second threshold, and the processing target area in a row A plurality of rectangular processing target regions may be set on the digital image by repeating the step of dividing the processing target region and the step of dividing the processing target region in a row. .
When a plurality of processing target areas are set, the feature amount has a specific tendency more prominently, so that a group to which pixels representing characters belong can be selected more reliably.

(4)前記グループ化段階において、前記処理対象領域を構成する画素をk−means法によってグループ化してもよい。
k−means法によってグループ化すると、画素をより適切にグループ化できる。
(4) In the grouping step, the pixels constituting the processing target region may be grouped by a k-means method.
When grouped by the k-means method, pixels can be grouped more appropriately.

(5)前記特徴量は前記グループに属する画素の数であり、前記選択段階において、画素の数が二番目に多い前記グループを前記置換対象グループとして選択してもよい。
文書を読み取って生成したディジタル画像では、一般に背景を表す画素の数が最も多く、文字を表す画素の数は二番目に多い。従って画素の数が二番目に多いグループを選択することにより、文字を表す画素が属するグループを選択できる。
(5) The feature amount may be the number of pixels belonging to the group, and the group having the second largest number of pixels may be selected as the replacement target group in the selection step.
In a digital image generated by reading a document, the number of pixels representing the background is generally the largest, and the number of pixels representing the character is the second largest. Therefore, by selecting a group having the second largest number of pixels, a group to which pixels representing characters belong can be selected.

(6)他の前記グループに属する画素に周囲を囲まれて同一の前記グループに属する他の画素と隔離されている画素群を小グループというとき、前記特徴量は前記グループに属する前記小グループの数であり、前記選択段階において、前記小グループの数が最も多い前記グループを前記置換対象グループとして選択してもよい。
一般に文字はいくつかの互いに離間した直線や曲線で構成されている。すなわち文字はいくつかの小グループで構成されている。従って小グループの数が最も多いグループを選択することにより、文字を表す画素が属するグループを選択できる。
(6) When a pixel group which is surrounded by pixels belonging to another group and is isolated from other pixels belonging to the same group is referred to as a small group, the feature amount is a value of the small group belonging to the group. In the selection step, the group having the largest number of small groups may be selected as the replacement target group.
In general, a character is composed of a number of straight lines and curves spaced apart from each other. That is, a character is composed of several small groups. Therefore, by selecting the group having the largest number of small groups, the group to which the pixel representing the character belongs can be selected.

(7)前記選択段階において、複数の前記グループを前記置換対象グループとして選択してもよい。
文字が2色以上で表されている場合、複数のグループを選択することで、文字を表す画素が属するグループが置換対象グループとして選択されずにディジタル画像に文字が残ってしまうことを低減できる。
(7) In the selection step, a plurality of the groups may be selected as the replacement target group.
When a character is represented by two or more colors, by selecting a plurality of groups, it is possible to reduce the remaining of the character in the digital image without selecting the group to which the pixel representing the character belongs as a replacement target group.

(8)前記位置情報は、前記処理対象領域を構成する画素を前記置換対象グループに属する画素と前記置換対象グループに属さない画素とに二値化した二値画像、及び前記置換対象グループが属する前記処理対象領域の位置を特定するための領域情報であってもよい。   (8) The position information includes a binary image obtained by binarizing pixels constituting the processing target area into pixels belonging to the replacement target group and pixels not belonging to the replacement target group, and the replacement target group It may be region information for specifying the position of the processing target region.

(9)前記出力段階は、前記色データ、前記位置情報、及び前記画像圧縮データを一つのPDFファイルに格納して出力してもよい。
PDFファイルを再生するプログラムは広く普及しているので、圧縮したディジタル画像をPDFファイルに格納すると、多くの装置で再生できる。
(9) In the output step, the color data, the position information, and the compressed image data may be stored and output in one PDF file.
Since a program for reproducing a PDF file is widely used, if a compressed digital image is stored in a PDF file, it can be reproduced by many apparatuses.

(10)上記目的を達成するため、本発明に係る画像圧縮装置は、ディジタル画像上に処理対象領域を設定する設定手段と、前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化手段と、各前記グループの特徴量に基づいて置換対象グループを選択する選択手段と、前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成手段と、前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換手段と、前記置換手段で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮手段と、前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力手段と、を備える。
本発明によると、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮できる。
(10) In order to achieve the above object, an image compression apparatus according to the present invention groups setting means for setting a processing target area on a digital image and pixels constituting the processing target area for each pixel having a small color difference. Grouping means for selecting, selecting means for selecting a replacement target group based on the feature amount of each group, position information generating means for generating position information indicating the position of each pixel belonging to the replacement target group, A replacement unit that replaces the color of each pixel belonging to the replacement target group with a color of a surrounding pixel that does not belong to the replacement target group; and the digital image after the color of each pixel is replaced by the replacement unit. Digital image compression means for generating compressed image data, color data representing a representative color of the replacement target group, the position information, and the compressed image data And an output means for outputting put communication, the.
According to the present invention, a digital image can be compressed at a high compression rate without impairing the readability of characters.

(11)上記目的を達成するため、本発明に係る画像読み取り装置は、原稿を読み取ってディジタル画像を生成する読み取り手段と、請求項10に記載の画像圧縮装置と、を備える。
本発明によると、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮できる。
(11) In order to achieve the above object, an image reading apparatus according to the present invention comprises reading means for reading a document and generating a digital image, and an image compression apparatus according to claim 10.
According to the present invention, a digital image can be compressed at a high compression rate without impairing the readability of characters.

(12)上記目的を達成するため、本発明に係る画像圧縮プログラムは、ディジタル画像上に処理対象領域を設定する設定手段と、前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化手段と、各前記グループの特徴量に基づいて置換対象グループを選択する選択手段と、前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成手段と、前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換手段と、前記置換手段で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮手段と、前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力手段としてコンピュータを機能させる。
本発明によると、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮できる。
(12) To achieve the above object, an image compression program according to the present invention groups setting means for setting a processing target area on a digital image and pixels constituting the processing target area for each pixel having a small color difference. Grouping means for selecting, selecting means for selecting a replacement target group based on the feature amount of each group, position information generating means for generating position information indicating the position of each pixel belonging to the replacement target group, A replacement unit that replaces the color of each pixel belonging to the replacement target group with a color of a surrounding pixel that does not belong to the replacement target group; and the digital image after the color of each pixel is replaced by the replacement unit. Digital image compression means for generating compressed image data, color data representing a representative color of the replacement target group, the position information, and the image compression data Causing a computer to function as output means for outputting in association with data.
According to the present invention, a digital image can be compressed at a high compression rate without impairing the readability of characters.

尚、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせにより実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハードウェア資源で実現されるものに限定されない。   The functions of the plurality of means provided in the present invention are realized by hardware resources whose functions are specified by the configuration itself, hardware resources whose functions are specified by a program, or a combination thereof. The functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other.

以下、本発明の実施の形態を複数の実施例に基づいて説明する。
(第一実施例)
図2は、本発明の第一実施例に係る画像読み取り装置としてのイメージスキャナ1の内部構造を示す模式図である。イメージスキャナ1はパーソナルコンピュータなどによる制御を必要とせず単独で原稿を読み取り可能な所謂スタンドアロン型のイメージスキャナ1であり、原稿を読み取って生成したディジタル画像を圧縮し、圧縮したディジタル画像をPDF(Portable Document Format)形式でリムーバブルメモリに保存する機能を備えている。
Hereinafter, embodiments of the present invention will be described based on a plurality of examples.
(First Example)
FIG. 2 is a schematic diagram showing the internal structure of the image scanner 1 as the image reading apparatus according to the first embodiment of the present invention. The image scanner 1 is a so-called stand-alone image scanner 1 that does not require control by a personal computer or the like and can independently read a document, compresses a digital image generated by reading the document, and converts the compressed digital image into a PDF (Portable). (Document Format) format is stored in the removable memory.

プラテン10はガラス板などの透明板で形成され、上を向く面(原稿載置面)10aに原稿Mが載置される。原稿Mは印刷文書、写真、書籍などの反射原稿、あるいは35mmストリップフィルム、35mmマウントフィルムなどの透過原稿である。
原稿カバー11は、ヒンジ36によりプラテン10の原稿載置面10aを開放する姿勢と原稿載置面10aを覆う姿勢とに揺動可能にハウジング12に連結されている。
The platen 10 is formed of a transparent plate such as a glass plate, and the document M is placed on a surface (document placement surface) 10a facing upward. The original M is a reflective original such as a printed document, a photograph, a book, or a transparent original such as a 35 mm strip film or a 35 mm mount film.
The document cover 11 is connected to the housing 12 so as to be swingable between a posture in which the document placement surface 10a of the platen 10 is opened by a hinge 36 and a posture in which the document placement surface 10a is covered.

面光源部13は、原稿カバー11に設けられている。面光源部13は、透過原稿用ランプ14、拡散板、反射板等を備える。透過原稿用ランプ14は白色冷陰極蛍光ランプ(CCFL)などの管照明装置であり、その長手方向軸線がキャリッジ15のガイドロッド16の中心軸線と平行に延びるように配置されている。面光源部13は、反射原稿の読み取り時に原稿マット35によって覆われる。透過原稿の読み取り時には原稿マット35が外され、面光源部13が露出する。   The surface light source unit 13 is provided on the document cover 11. The surface light source unit 13 includes a transparent document lamp 14, a diffusion plate, a reflection plate, and the like. The transparent document lamp 14 is a tube illumination device such as a white cold cathode fluorescent lamp (CCFL), and is arranged such that its longitudinal axis extends parallel to the central axis of the guide rod 16 of the carriage 15. The surface light source unit 13 is covered with a document mat 35 when a reflected document is read. When reading a transparent original, the original mat 35 is removed and the surface light source unit 13 is exposed.

キャリッジ15は、ハウジング12に収容されている。キャリッジ15は原稿載置面10aに対し平行なガイドロッド16に摺動自在に嵌合している。キャリッジ15は、反射原稿用ランプ17、ミラー18、レンズ19、およびイメージセンサ20を搭載している。キャリッジ15はキャリッジ搬送用モータ33(図3参照)によって駆動されるプーリに掛けられたベルトに牽引され、原稿載置面10aと平行なX方向に往復移動する。反射原稿用ランプ17はCCFLなどの管照明装置である。ミラー18およびレンズ19は、反射原稿用ランプ17に照明された反射原稿の反射光および透過原稿用ランプ14に照明された透過原稿の透過光をイメージセンサ20の受光面に入射させる。反射原稿用ランプ17、ミラー18、レンズ19、及びイメージセンサ20がキャリッジ15によってX方向に搬送されると、原稿上の主走査線が移動する。   The carriage 15 is accommodated in the housing 12. The carriage 15 is slidably fitted to a guide rod 16 parallel to the document placement surface 10a. The carriage 15 includes a reflective document lamp 17, a mirror 18, a lens 19, and an image sensor 20. The carriage 15 is pulled by a belt hung on a pulley driven by a carriage transport motor 33 (see FIG. 3), and reciprocates in the X direction parallel to the document placement surface 10a. The reflective original lamp 17 is a tube illumination device such as a CCFL. The mirror 18 and the lens 19 cause the reflected light of the reflective original illuminated by the reflective original lamp 17 and the transmitted light of the transparent original illuminated by the transparent original lamp 14 to enter the light receiving surface of the image sensor 20. When the reflective document lamp 17, the mirror 18, the lens 19, and the image sensor 20 are conveyed in the X direction by the carriage 15, the main scanning line on the document moves.

イメージセンサ20は、フォトダイオードなどで構成される図示しないセルが直線的に多数配列された所謂リニアイメージセンサである。イメージセンサ20は多数のセルが管状の反射原稿用ランプ17の中心軸線と平行に並ぶ姿勢でキャリッジ15に搭載されている。イメージセンサ20の各セルには受光量に応じた電荷が光電変換により蓄積される。各画素に蓄積された電荷は、CCD(Charge Coupled Device)によってイメージセンサ20の出力部に転送される。この電荷転送は、CMOS(Complementary Metal Oxide Semiconductor)によって行われてもよい。イメージセンサ20から出力される画像信号は、AFE部26(図3参照)に出力される。   The image sensor 20 is a so-called linear image sensor in which a large number of cells (not shown) composed of photodiodes are linearly arranged. The image sensor 20 is mounted on the carriage 15 so that a large number of cells are arranged in parallel with the central axis of the tubular reflecting original lamp 17. Charges corresponding to the amount of received light are accumulated in each cell of the image sensor 20 by photoelectric conversion. The electric charge accumulated in each pixel is transferred to the output unit of the image sensor 20 by a CCD (Charge Coupled Device). This charge transfer may be performed by a CMOS (Complementary Metal Oxide Semiconductor). The image signal output from the image sensor 20 is output to the AFE unit 26 (see FIG. 3).

図3は、イメージスキャナ1のハードウェアの主要構成を示すブロック図である。
CPU21は、ROM22に記憶されている各種のプログラムを実行してイメージスキャナ1の各部を制御する。また、CPU21はROM22に記憶されている画像圧縮プログラムを実行することにより画像圧縮装置としても機能する。ROM22は各種プログラム、各種データなどを記憶する不揮発性のメモリである。これらの各種プログラムや各種データは、所定のサーバからのネットワークを介したダウンロード、リムーバブルメモリ23などのコンピュータ読み取り可能な記憶媒体からの読み出しなどによってROM22に格納される。RAM24は各種プログラム、各種データなどを一時的に記憶するメモリである。RAMコントローラ25は、CPU21、AFE部26、画像処理部27、外部インタフェースコントローラ28などとRAM24との間のデータ転送を制御する。
FIG. 3 is a block diagram illustrating a main configuration of hardware of the image scanner 1.
The CPU 21 controls various units of the image scanner 1 by executing various programs stored in the ROM 22. The CPU 21 also functions as an image compression device by executing an image compression program stored in the ROM 22. The ROM 22 is a non-volatile memory that stores various programs, various data, and the like. These various programs and various data are stored in the ROM 22 by downloading from a predetermined server via a network, reading from a computer-readable storage medium such as the removable memory 23, and the like. The RAM 24 is a memory that temporarily stores various programs and various data. The RAM controller 25 controls data transfer between the CPU 21, the AFE unit 26, the image processing unit 27, the external interface controller 28, and the like and the RAM 24.

透過原稿用ランプコントローラ29は、インバータ回路、制御回路などから構成され、透過原稿用ランプ14の点灯、消灯を制御する。
反射原稿用ランプコントローラ30は、インバータ回路、制御回路などから構成され、反射原稿用ランプ17の点灯、消灯を制御する。
イメージセンサコントローラ31はイメージセンサ20を駆動するために必要な駆動パルスをイメージセンサ20に出力する駆動回路であり、例えば同期信号発生器、駆動用タイミングジェネレータなどから構成される。
The transparent document lamp controller 29 is composed of an inverter circuit, a control circuit, and the like, and controls turning on and off of the transparent document lamp 14.
The reflection document lamp controller 30 includes an inverter circuit, a control circuit, and the like, and controls turning on and off of the reflection document lamp 17.
The image sensor controller 31 is a drive circuit that outputs drive pulses necessary for driving the image sensor 20 to the image sensor 20, and includes, for example, a synchronization signal generator and a drive timing generator.

キャリッジコントローラ32は、キャリッジ搬送用モータ駆動回路、制御回路などから構成される。キャリッジコントローラ32は、CPU21から送信されるキャリッジ搬送制御信号を受信し、キャリッジ搬送用モータ33の回転方向、回転速度などを制御する。
アナログフロントエンド(AFE)部26は、電気信号のゲインの調整によるレベル調整処理、量子化処理などを行ってディジタル化されたスキャン画像をRAMコントローラ25を介してRAM24に格納する。
The carriage controller 32 includes a carriage transport motor drive circuit, a control circuit, and the like. The carriage controller 32 receives a carriage conveyance control signal transmitted from the CPU 21 and controls the rotation direction, rotation speed, and the like of the carriage conveyance motor 33.
The analog front end (AFE) unit 26 stores the digitized scan image in the RAM 24 via the RAM controller 25 by performing level adjustment processing by adjusting the gain of the electric signal, quantization processing, and the like.

画像処理部27は、RAM24に記憶されているスキャン画像に対し、ガンマ補正、シェーディング補正、YCbCr色空間で表されるディジタル画像を形成する画像形成処理などの画像処理を施すための信号処理をCPU21と協働して行うDSP(Digital Signal Processor)である。
リムーバブルメモリコントローラ34は、カードコネクタに接続される不揮発性記憶媒体としてのリムーバブルメモリ23にRAM24に格納されているデータを転送する出力機構である。
外部インタフェースコントローラ28は、イメージスキャナ1とPC(Personal Computer)などの外部システムとを通信可能に接続する。
The image processing unit 27 performs signal processing for performing image processing such as gamma correction, shading correction, and image forming processing for forming a digital image represented in the YCbCr color space on the scan image stored in the RAM 24. DSP (Digital Signal Processor) performed in cooperation with
The removable memory controller 34 is an output mechanism that transfers data stored in the RAM 24 to a removable memory 23 as a nonvolatile storage medium connected to the card connector.
The external interface controller 28 connects the image scanner 1 and an external system such as a PC (Personal Computer) so that they can communicate with each other.

次に、画像圧縮プログラムについて説明する。
図4は、画像圧縮プログラムの論理的な構成を示すブロック図である。
設定部41は、CPU21を設定手段として機能させるモジュールである。
グループ化部42は、CPU21をグループ化手段として機能させるモジュールである。
選択部43は、CPU21を選択手段として機能させるモジュールである。
位置情報生成部44は、CPU21を位置情報生成手段として機能させるモジュールである。
Next, an image compression program will be described.
FIG. 4 is a block diagram showing a logical configuration of the image compression program.
The setting unit 41 is a module that causes the CPU 21 to function as setting means.
The grouping unit 42 is a module that causes the CPU 21 to function as a grouping unit.
The selection unit 43 is a module that causes the CPU 21 to function as selection means.
The position information generation unit 44 is a module that causes the CPU 21 to function as position information generation means.

置換部45は、CPU21を置換手段として機能させるモジュールである。
画像圧縮部46は、CPU21をディジタル画像圧縮手段として機能させるモジュールである。

出力部47は、CPU21を出力手段として機能させるモジュールである。
The replacement unit 45 is a module that causes the CPU 21 to function as replacement means.
The image compression unit 46 is a module that causes the CPU 21 to function as digital image compression means.

The output unit 47 is a module that causes the CPU 21 to function as output means.

次に、画像圧縮プログラムを実行するCPU21の処理について説明する。
図5及び図6は画像圧縮プログラムを実行するCPU21の処理の流れを示すフローチャートであり、図1は処理の概要を示す模式図である。この処理はイメージスキャナ1が原稿を読み取ってディジタル画像を生成すると開始される。
S105では、CPU21は設定部41を実行し、ディジタル画像を8×8画素のブロックに分割し、ブロック毎にY成分(輝度成分)を離散コサイン変換(DCT変換)することにより、各ブロックを周波数成分に変換する。ブロックはDCT変換により8×8の周波数係数(DCT係数)に変換される。DCT係数において左上は直流成分であり、それ以外は交流成分である。交流成分は左上から右下に向かうほど周波数の高い交流成分(高周波成分)を表している。
Next, processing of the CPU 21 that executes the image compression program will be described.
5 and 6 are flowcharts showing the flow of processing of the CPU 21 that executes the image compression program, and FIG. 1 is a schematic diagram showing the outline of the processing. This process is started when the image scanner 1 reads a document and generates a digital image.
In S105, the CPU 21 executes the setting unit 41, divides the digital image into blocks of 8 × 8 pixels, and performs discrete cosine transform (DCT transform) on the Y component (luminance component) for each block, so that each block has a frequency. Convert to component. The block is converted into an 8 × 8 frequency coefficient (DCT coefficient) by DCT conversion. In the DCT coefficient, the upper left is a direct current component, and the other is an alternating current component. The AC component represents an AC component (high frequency component) having a higher frequency from the upper left toward the lower right.

図7は、メージスキャナが文書を読み取って生成したディジタル画像の一例を示す模式図である。図8は、図7に示すディジタル画像をDCT変換した画像を示す模式図であって、DCT係数の高周波成分が所定値以上であるブロック(以下、「高周波成分を含むブロック」という)のみを黒い四角で示した模式図である。
図5に示すS110では、CPU21は設定部41を実行し、DCT変換したディジタル画像全体を処理対象領域として初期設定する。
FIG. 7 is a schematic diagram illustrating an example of a digital image generated by a document scanner reading a document. FIG. 8 is a schematic diagram showing an image obtained by DCT transforming the digital image shown in FIG. It is the schematic diagram shown by the square.
In S110 illustrated in FIG. 5, the CPU 21 executes the setting unit 41 and initially sets the entire DCT-converted digital image as a processing target area.

S115では、CPU21は設定部41を実行し、設定されている処理対象領域に対して領域分割処理を実行する。領域分割処理では、水平分割処理と垂直分割処理とを繰り返すことにより、ディジタル画像上に複数の矩形の処理対象領域を設定する。
始めに、水平分割処理について説明する。水平分割処理では高周波成分を含むブロックの数が第一の閾値より少ない行を「区切り行」とし、処理対象領域を「区切り行」より上の処理対象領域と下の処理対象領域とに水平に分割する。「区切り行」自体は処理対象領域から除外される。例えば図9に示す例の場合、第一の閾値を3とすると、処理対象領域51の第3行は高周波成分を含むブロックの数が2であるため「区切り行」として特定される。この結果、処理対象領域51は第1行〜第2行からなる処理対象領域52と、第4行〜第6行からなる処理対象領域53とに分割される。ここで第一の閾値は処理対象領域の幅に応じて設定される値である。なお、第一の閾値は例えば行を構成するブロックの総数に占める高周波成分を含むブロックの数の割合であってもよく、割合が第一の閾値未満であれば「区切り行」としてもよい。その場合、割合は処理対象領域の幅によらず一定であってもよい。第一の閾値は適宜選択可能な設計事項であり、処理対象領域が適切に設定されるよう調整すればよい。以下、水平分割処理の詳細について説明する。
In S115, the CPU 21 executes the setting unit 41, and executes area division processing on the set processing target area. In the area division process, a plurality of rectangular process target areas are set on the digital image by repeating the horizontal division process and the vertical division process.
First, the horizontal division process will be described. In the horizontal division process, the line with less high frequency components than the first threshold is defined as a “separation line”, and the processing target area is horizontally aligned with the processing target area above and below the “separation line”. To divide. The “separation line” itself is excluded from the processing target area. For example, in the example shown in FIG. 9, if the first threshold is 3, the third row of the processing target region 51 is identified as a “separation row” because the number of blocks containing high-frequency components is 2. As a result, the processing target area 51 is divided into a processing target area 52 composed of the first to second lines and a processing target area 53 composed of the fourth to sixth lines. Here, the first threshold is a value set according to the width of the processing target area. The first threshold value may be, for example, a ratio of the number of blocks including high-frequency components in the total number of blocks constituting the row, and may be a “separated row” if the ratio is less than the first threshold value. In that case, the ratio may be constant regardless of the width of the processing target area. The first threshold value is a design item that can be selected as appropriate, and may be adjusted so that the processing target region is appropriately set. Details of the horizontal division process will be described below.

図10は、水平分割処理の流れを示すフローチャートである。
S205では、CPU21は処理対象領域の幅が所定の幅以上であるか否かを判定する。所定の幅以上であればS210に進む。所定の幅未満のときはS260に進む。
S210では、CPU21は処理対象領域の幅に基づいて重み付け係数と前述した第一の閾値とを設定する。イメージスキャナ1では読み取りの際にゴミの影響によって本来は高周波成分を含むべきでないブロックが高周波成分を含んでしまうことがあり、それにより区切り行であるべき行が区切り行として特定されないことが起こり得る。このためCPU21は後述するS235において、ゴミの影響によって高周波成分を含んでしまったブロック(ゴミブロック)であるか否かを判定する。重み付け係数はその際に使用されるものである。以下、重み付け係数の一例について説明する。
FIG. 10 is a flowchart showing the flow of horizontal division processing.
In S205, the CPU 21 determines whether or not the width of the processing target area is equal to or larger than a predetermined width. If it is equal to or larger than the predetermined width, the process proceeds to S210. When it is less than the predetermined width, the process proceeds to S260.
In S210, the CPU 21 sets the weighting coefficient and the first threshold described above based on the width of the processing target area. In the image scanner 1, a block that should not contain a high-frequency component may contain a high-frequency component due to the influence of dust at the time of reading, so that a line that should be a delimiter line may not be specified as a delimiter line. . For this reason, the CPU 21 determines whether or not the block (dust block) includes a high-frequency component due to the influence of dust in S235 described later. The weighting coefficient is used at that time. Hereinafter, an example of the weighting coefficient will be described.

図11は、重み付け係数の一例を示す模式図である。図11(A)では中央の注目ブロックとその周囲8ブロックに1が設定されている。CPU21は、高周波成分を含むブロックのブロック値を1、高周波成分を含まないブロックのブロック値を0とし、ブロック毎にブロック値と重み付け係数との積を求め、それらを合計した値(ブロック判定値)が所定の値(ゴミ判定値)未満であれば、当該注目ブロックはゴミブロックであると判定する。周囲に高周波成分を含むブロックが存在しないところに一つだけ高周波成分を含むブロックが存在する場合、当該注目ブロックはゴミブロックである可能性が高い。図11(A)に示す重み付け係数によれば、例え注目ブロックが高周波成分を含むブロックであっても、周囲に高周波成分を含むブロックが存在しなければゴミブロックと見なされる。図11(B)では注目ブロックとその上下左右の4ブロックに1が設定されている。また、図11(C)では注目ブロックにのみ1が設定されている。図11(C)に示す重み付け係数では、注目ブロックがゴミブロックであるか否かの判定に周囲のブロックが加味されない。すなわち図11(C)に示す重み付け係数の場合はブロック判定値を計算する必要はなく、注目ブロックが高周波成分を含んでいれば高周波成分を含むブロックと判定され、高周波成分を含んでいなければ高周波成分を含まないブロックと判定される。例えば注目領域の幅が広ければ一つや二つのゴミがあっても区切り行の特定に大きな影響はないが、注目領域の幅が狭ければ一つのゴミが区切り行の特定に大きく影響してくる。従って例えば注目領域の幅が広いときは図11(C)の重み付け係数を用いることによりブロック判定値を計算する処理を省略でき、注目領域の幅が狭いときは図11(A)の重み付け係数を用いることにより区切り行をより正確に特定できる。その中間のときは図11(C)の重み付け係数を用いればよい。   FIG. 11 is a schematic diagram illustrating an example of a weighting coefficient. In FIG. 11A, 1 is set in the central block of interest and the surrounding 8 blocks. The CPU 21 sets the block value of the block including the high frequency component to 1, the block value of the block not including the high frequency component to 0, obtains the product of the block value and the weighting coefficient for each block, and sums them (block determination value) ) Is less than a predetermined value (dust determination value), the target block is determined to be a dust block. When there is a block containing only one high-frequency component where there is no block containing high-frequency components in the surrounding area, there is a high possibility that the block of interest is a dust block. According to the weighting coefficient shown in FIG. 11A, even if the block of interest includes a high frequency component, it is regarded as a dust block if there is no block including a high frequency component around it. In FIG. 11B, 1 is set for the block of interest and the four blocks on the top, bottom, left, and right. In FIG. 11C, 1 is set only for the block of interest. In the weighting coefficient shown in FIG. 11C, surrounding blocks are not taken into consideration in determining whether the block of interest is a dust block. That is, in the case of the weighting coefficient shown in FIG. 11C, it is not necessary to calculate a block determination value. If the target block includes a high-frequency component, it is determined as a block including a high-frequency component, and if it does not include a high-frequency component. It is determined that the block does not contain a high frequency component. For example, if the area of interest is wide, there will be no significant influence on the separation line even if there is one or two garbage, but if the area of interest is narrow, one garbage will greatly affect the identification of the separation line. . Therefore, for example, when the width of the attention area is wide, the process of calculating the block determination value can be omitted by using the weighting coefficient of FIG. 11C, and when the width of the attention area is narrow, the weighting coefficient of FIG. By using it, it is possible to specify the separator line more accurately. In the middle, the weighting coefficient shown in FIG. 11C may be used.

図10に示すS215では、CPU21は処理対象領域の第1行を注目行に設定する。ここでいう行とは画素を単位とする行ではなくブロックを単位とする行のことであり、ブロックが直線状に並んでいる行のことである。
S220では、CPU21は高周波成分を含むブロックの数をカウントするカウンタNに0をセットする。
S225では、CPU21は注目行のブロックを一つ選択し、注目ブロックに設定する。本実施例ではブロックは左端から順に選択していくものとする。
S230では、CPU21は注目ブロックが高周波成分を含んでいるか否かを判定する。具体的には例えば図12において網掛けした6個の交流成分55の値を所定の重み付け係数で重み付けして合計した値が所定の値(高周波判定値)以上であれば、当該ブロックは高周波成分を含むブロックであると判定する。6個の交流成分55は特許請求の範囲に記載の高周波成分に相当する。なお、右下の交流成分を基準にどの範囲までの交流成分を高周波成分と定義するかは適宜選択可能な設計事項であり、例えば処理対象領域が最も適切に設定されると判断される範囲を実験により求めてもよいし、例えば高周波成分は右下の交流成分とその上の交流成分、および左の交流成分の計3個であってもよいし、右下の交流成分のみを高周波成分としてもよい。いずれにしろ少なくとも右下の交流成分は高周波成分である。また、重み付け係数、高周波判定値なども適宜選択可能な設計事項であり、処理対象領域が適切に設定されるよう調整すればよい。高周波成分を含んでいればS235に進み、含んでいなければS245に進む。
In S215 shown in FIG. 10, the CPU 21 sets the first row of the processing target area as the attention row. A row here is not a row in units of pixels but a row in units of blocks, and is a row in which blocks are arranged in a straight line.
In S220, the CPU 21 sets 0 to a counter N that counts the number of blocks containing high frequency components.
In S225, the CPU 21 selects one block of the target row and sets it as the target block. In this embodiment, the blocks are selected in order from the left end.
In S230, the CPU 21 determines whether or not the block of interest includes a high frequency component. Specifically, for example, if a value obtained by weighting the values of the six alternating current components 55 shaded in FIG. 12 with a predetermined weighting coefficient is equal to or greater than a predetermined value (high frequency determination value), the block is a high frequency component. It is determined that the block includes. The six AC components 55 correspond to the high frequency components described in the claims. Note that it is a design matter that can be appropriately selected to define the AC component up to which range is defined as a high frequency component based on the AC component in the lower right. For example, the range in which the processing target region is determined to be most appropriately set It may be obtained by experiment. For example, the high frequency component may be a total of three components, the lower right AC component and the AC component on the upper right, and the left AC component, or only the lower right AC component as the high frequency component. Also good. In any case, at least the lower right AC component is a high frequency component. Further, the weighting coefficient, the high-frequency determination value, and the like are design items that can be appropriately selected, and may be adjusted so that the processing target region is appropriately set. If the high frequency component is included, the process proceeds to S235, and if not, the process proceeds to S245.

S235では、CPU21は注目ブロックがゴミブロックであるか否かを判定する。具体的にはS210で設定した重み付け係数に基づいてブロック判定値を算出し、ブロック判定値がゴミ判定値以上であるか否かを判定する。ゴミ判定値以上であればゴミブロックではないと判定しS240に進む。ゴミ判定値未満であればゴミブロックと判定しS245に進む。   In S235, the CPU 21 determines whether or not the target block is a dust block. Specifically, the block determination value is calculated based on the weighting coefficient set in S210, and it is determined whether or not the block determination value is greater than or equal to the dust determination value. If it is greater than or equal to the dust determination value, it is determined that the block is not a dust block, and the process proceeds to S240. If it is less than the dust determination value, it is determined as a dust block and the process proceeds to S245.

S240では、CPU21はカウンタNに1を加算する。
S245では、CPU21は注目ブロックの右側にブロックが存在するか否かを判定する。存在していればS225に戻り、存在していなければS250に進む。
S250では、CPU21は注目行が区切り行であるか否かを判定する。具体的には、注目行に含まれる高周波成分を含むブロックの数(カウンタN)が第一の閾値未満であるか否かを判定する。第一の閾値未満であれば注目行は区切り行であると判定し、S255に進む。閾値以上であればS265に進む。
In S240, the CPU 21 adds 1 to the counter N.
In S245, the CPU 21 determines whether there is a block on the right side of the block of interest. If it exists, the process returns to S225, and if it does not exist, the process proceeds to S250.
In S250, the CPU 21 determines whether or not the target line is a separator line. Specifically, it is determined whether or not the number (counter N) of blocks including high frequency components included in the target row is less than the first threshold value. If it is less than the first threshold, it is determined that the target line is a delimiter line, and the process proceeds to S255. If it is equal to or greater than the threshold, the process proceeds to S265.

S255では、CPU21は注目行の一つ上の行までを一つの処理対象領域として設定する。ただし、上に行そのものがなかったり、一つ上の行が区切り行であったりした場合は処理対象領域は設定されない。
S260では、CPU21はS255で設定した処理対象領域に対して垂直分割処理を実行する。
S265では、CPU21は注目行が最終行であるか否かを判定する。最終行でなければS215に戻る。最終行であれば水平分割処理を終了する。
In S255, the CPU 21 sets up to one line above the target line as one processing target area. However, if there is no line above or if the line above is a separator line, the processing target area is not set.
In S260, the CPU 21 executes vertical division processing on the processing target area set in S255.
In S265, the CPU 21 determines whether or not the target line is the last line. If it is not the last line, the process returns to S215. If it is the last line, the horizontal division process is terminated.

次に、垂直分割処理について説明する。
図13は、垂直分割処理の流れを示すフローチャートである。垂直分割処理は、行が列、水平が垂直、幅が高さ、第一の閾値が第二の閾値になる以外は水平分割処理と実質的に同一である。垂直分割処理では、S360において水平分割処理を再帰呼び出しする。垂直分割処理から再帰呼び出しされた水平分割処理は、S260において垂直分割処理を再帰呼び出しする。このようにCPU21は処理対象領域の幅が所定の幅未満、あるいは所定の高さ未満になるまで水平分割処理と垂直分割処理とを互いに再帰的に呼び出すことによりディジタル画像上に複数の矩形の処理対象領域を設定する。
Next, the vertical division process will be described.
FIG. 13 is a flowchart showing the flow of the vertical division process. The vertical division process is substantially the same as the horizontal division process except that the rows are columns, the horizontals are vertical, the widths are high, and the first threshold is the second threshold. In the vertical division process, the horizontal division process is recursively called in S360. The horizontal division process recursively called from the vertical division process recursively calls the vertical division process in S260. Thus, the CPU 21 recursively calls the horizontal division process and the vertical division process until the width of the processing target area is less than the predetermined width or less than the predetermined height, thereby processing a plurality of rectangles on the digital image. Set the target area.

図14は、上述した領域分割処理の結果を示す模式図である。上述した領域分割処理の結果、図8に示すディジタル画像は図14に示すように複数の処理対象領域56に分割される。図14において平行斜線が付されている複数の矩形領域はそれぞれが一つの処理対象領域に相当する。上述した領域分割処理によると、高周波成分が含まれないブロックからなる領域は平行斜線が付されていない矩形領域となる。文字が含まれない領域は高周波成分を含むブロックが存在しないはずなので、平行斜線が付されていない矩形領域となる。文字が含まれない領域はそのまま高圧縮率で圧縮しても問題ない。にもかかわらず文字が含まれない領域が処理対象領域に設定されると処理に無駄が生じる。上述した領域分割処理によると、文字が含まれない領域は処理対象領域から除外されるので、無駄な処理を低減できる。なお、ここではDCT変換後のディジタル画像の処理対象領域を示しているが、処理対象領域は実際にはDCT変換されていない元のディジタル画像上に設定されるものである。以降の説明において「処理対象領域」とは、DCT変換されていない元のディジタル画像上に設定された処理対象領域のことをいう。   FIG. 14 is a schematic diagram showing the result of the above-described area division processing. As a result of the region division processing described above, the digital image shown in FIG. 8 is divided into a plurality of processing target regions 56 as shown in FIG. In FIG. 14, each of a plurality of rectangular areas with parallel diagonal lines corresponds to one processing target area. According to the region dividing process described above, a region composed of blocks that do not include a high-frequency component is a rectangular region that is not attached with parallel diagonal lines. Since the area that does not include characters should not have a block that includes high-frequency components, it is a rectangular area that is not marked with parallel diagonal lines. There is no problem even if the area containing no characters is compressed as it is at a high compression rate. Nevertheless, if an area that does not include characters is set as the processing target area, processing is wasted. According to the area dividing process described above, an area that does not include characters is excluded from the process target area, so that useless processes can be reduced. Although the processing target area of the digital image after DCT conversion is shown here, the processing target area is set on the original digital image that is not actually DCT converted. In the following description, the “processing target area” refers to a processing target area set on the original digital image that has not been DCT transformed.

図5に示すS120では、CPU21は処理対象領域を一つ選択する。
S125では、CPU21はグループ化部42を実行し、選択した処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化処理を実行する。以下、グループ化処理の詳細について説明する。
図15は、グループ化処理の流れを示すフローチャートである。グループ化部42は具体的には例えば公知のk−means法によってグループ化する。k−means法は複数の要素を適切にグループ化するための手法である。
In S120 illustrated in FIG. 5, the CPU 21 selects one processing target area.
In S125, the CPU 21 executes the grouping unit 42 and executes a grouping process for grouping the pixels constituting the selected processing target area for each pixel having a small color difference. Details of the grouping process will be described below.
FIG. 15 is a flowchart showing the flow of grouping processing. Specifically, the grouping unit 42 performs grouping by, for example, a known k-means method. The k-means method is a method for appropriately grouping a plurality of elements.

S405では、CPU21は当該処理対象領域の色空間を機種に依存しない色空間に変換する。具体的には例えばLab色空間に変換する。なお、XYZ色空間に変換してもよい。
S410では、CPU21はLab色空間を均等なN3個の空間に分割する。ここではN=3の場合を例に説明する。N=3の場合、Lab色空間は図16に示すように27個の均等な空間に分割される。なお、図16では各成分を−128〜127の階調値で表す場合を示している。
In S405, the CPU 21 converts the color space of the processing target area into a color space independent of the model. Specifically, for example, conversion to the Lab color space is performed. In addition, you may convert into XYZ color space.
In S410, the CPU 21 divides the Lab color space into equal N 3 spaces. Here, a case where N = 3 will be described as an example. When N = 3, the Lab color space is divided into 27 equal spaces as shown in FIG. FIG. 16 shows a case where each component is represented by a gradation value of −128 to 127.

S415では、CPU21は27個の空間の頂点の位置で特定される色を仮の代表色とする。N=3のとき頂点の数は(N+1)3個(=64個)である。隣り合う頂点間の距離は全て一定であるため、頂点の位置で特定される色を仮の代表色とすることにより、仮の代表色をLab色空間全体に偏りなく設定することができる。
S420では、CPU21は処理対象領域の各画素について64個の仮の代表色との色差をそれぞれ求め、各画素をそれぞれ色差が最も小さい代表色と同じグループに配属する。色差は、色差をΔE、ある画素の色を(L1、a1、b1)、ある代表色を(L2、a2、b2)とするとき、以下の数1によって求められる。
In S415, the CPU 21 sets the color specified by the positions of the vertices of 27 spaces as a temporary representative color. When N = 3, the number of vertices is (N + 1) 3 (= 64). Since the distances between adjacent vertices are all constant, the tentative representative color can be set in the entire Lab color space without bias by setting the color specified at the vertex position as the tentative representative color.
In S420, the CPU 21 obtains a color difference from the 64 temporary representative colors for each pixel in the processing target area, and assigns each pixel to the same group as the representative color having the smallest color difference. The color difference is obtained by the following formula 1, where ΔE is the color difference, (L 1 , a 1 , b 1 ) is the color of a certain pixel, and (L 2 , a 2 , b 2 ) is a representative color.

Figure 2006279741
Figure 2006279741

この結果、64個の仮のグループが形成される。
S425では、CPU21は各グループについて重心を求め、求めた重心を各グループの新しい仮の代表色とする。ここで重心とは、(グループに属する画素のL成分の平均値、グループに属する画素のa成分の平均値、グループに属する画素のb成分の平均値)で表される色のことをいう。
As a result, 64 temporary groups are formed.
In S425, the CPU 21 obtains the center of gravity for each group, and uses the obtained center of gravity as a new temporary representative color of each group. Here, the center of gravity means a color represented by (average value of L components of pixels belonging to a group, average value of a components of pixels belonging to a group, average value of b components of pixels belonging to a group).

S430では、CPU21は各グループについて新旧の代表色の色差を求める。
S435では、CPU21は新旧の代表色の色差が所定の閾値以上であるか否かをグループ毎に判定する。一つ以上のグループで新旧の代表色の色差が所定の閾値以上であれば、S420に戻って処理を繰り返す。上述した処理を繰り返すとやがて重心が収束し、いずれのグループも新旧の代表色の色差が所定の閾値未満となる。色差が所定の閾値未満であれば仮の代表色を正式な代表色としてS440に進む。
In S430, the CPU 21 obtains the color difference between the old and new representative colors for each group.
In S435, the CPU 21 determines for each group whether the color difference between the old and new representative colors is equal to or greater than a predetermined threshold. If the color difference between the new and old representative colors is greater than or equal to a predetermined threshold in one or more groups, the process returns to S420 and is repeated. When the above-described processing is repeated, the center of gravity eventually converges, and the color difference between the new and old representative colors is less than a predetermined threshold value in any group. If the color difference is less than the predetermined threshold value, the process proceeds to S440 with the temporary representative color as the official representative color.

S440では、CPU21は処理対象領域が文字列を表す文章領域であるか否かを判定する。文章領域の場合、図17(A)に示すように背景を表す画素が属するグループと文字を表す画素が属するグループとの2つのグループに画素が集中するはずである。従って、画素がいずれか2つのグループに集中していれば、その処理対象領域は文章領域である可能性が高いといえる。逆に、図17(B)に示すように画素が多くのグループに散らばっていれば、その処理対象領域はイラストや写真を表す画像領域である可能性が高いといえる。CPU21は、具体的には例えば全体の80%以上が2つのグループに集中していれば2つのグループに集中していると判定してS445に進み、80%未満であればグループ化処理を終了する。なお、80%を判定基準とするか否かは適宜選択可能な設計事項である。また、ここではいずれか2つのグループに集中していれば文章領域であると判定する場合を例に説明したが、文字が2色以上で印刷されていることも多いので、例えば3〜4のグループに集中していれば文章領域であると判定してもよい。
S445では、CPU21は当該処理対象領域に文章領域であることを示すフラグを付してグループ化処理を終了する。
In S440, the CPU 21 determines whether or not the processing target area is a text area representing a character string. In the case of a text area, as shown in FIG. 17A, the pixels should be concentrated in two groups, a group to which pixels representing the background belong and a group to which pixels representing the character belong. Therefore, if the pixels are concentrated in any two groups, it can be said that there is a high possibility that the processing target area is a text area. Conversely, if the pixels are scattered in many groups as shown in FIG. 17B, it can be said that there is a high possibility that the processing target area is an image area representing an illustration or a photograph. Specifically, for example, if 80% or more of the whole is concentrated in two groups, the CPU 21 determines that it is concentrated in two groups and proceeds to S445. If it is less than 80%, the CPU 21 ends the grouping process. To do. Note that whether or not 80% is used as a criterion is a design item that can be selected as appropriate. In addition, here, the case where it is determined that it is a text area if concentrated in any two groups has been described as an example. However, since characters are often printed in two or more colors, for example 3-4 If it is concentrated in a group, it may be determined that it is a text area.
In S445, the CPU 21 adds a flag indicating that the processing target area is a text area, and ends the grouping process.

図5に示すS130では、CPU21は当該処理対象領域が文章領域であるか否かをフラグに基づいて判定する。文章領域の場合はS135に進み、文章領域でない場合はS155に進む。
S135では、CPU21は選択部43を実行し、処理対象領域内の各グループの特徴量に基づいて当該処理対象領域における置換対象グループを選択する選択処理を実行する。ここでは特徴量として各グループに属する画素の数を例に説明する。選択部43は、画素数が二番目に多いグループを置換対象グループとして選択する。画素数が二番目に多いグループを選択する理由は、二番目に多いグループに属する画素は文字そのものを表す画素である傾向が強いからである。例えば図7の破線57で示す処理対象領域において最も多い色は文字の背景を表す灰色である。次に多い色は文字そのものを表す白色である。このように一般の文書では画素の数が一番多いのは背景であり、二番目に多いのは文字である。ただしこれは常に成り立つわけではなく、背景あるいは文字が2色以上で印刷されている場合は文字そのものを表す画素の数は一番目であったり三番目であったりすることもある。このように順位は文書によって異なるので一概にはいえないが、平均すれば二番目である確率は他のいずれの順位である確率よりも高いといえる。なお、前述したように文字が2色以上で印刷されている場合もあるので、2番目に多いグループに加え、例えば3番目に多いグループ、4番目に多いグループも置換対象グループとして選択するようにしてもよい。文字が2色以上で表されている場合、複数のグループを選択することで、文字を表す画素が属するグループが置換対象グループとして選択されずにディジタル画像に文字が残ってしまうことを低減できる。
In S130 shown in FIG. 5, the CPU 21 determines whether or not the processing target area is a text area based on the flag. If it is a text area, the process proceeds to S135, and if it is not a text area, the process proceeds to S155.
In S135, the CPU 21 executes the selection unit 43 and executes a selection process for selecting a replacement target group in the processing target area based on the feature amount of each group in the processing target area. Here, the number of pixels belonging to each group will be described as an example of the feature amount. The selection unit 43 selects a group having the second largest number of pixels as a replacement target group. The reason for selecting the group having the second largest number of pixels is that the pixels belonging to the second largest group tend to be pixels representing the characters themselves. For example, the most common color in the processing target area indicated by the broken line 57 in FIG. 7 is gray indicating the background of the character. The next most common color is white, which represents the character itself. In this way, in a general document, the background has the largest number of pixels, and the text has the second largest number. However, this does not always hold, and if the background or character is printed in more than one color, the number of pixels representing the character itself may be first or third. In this way, since the ranking differs depending on the document, it cannot be said unequivocally, but on average, the probability of being the second is higher than the probability of being any other ranking. As described above, since characters may be printed in two or more colors, in addition to the second most common group, for example, the third most common group and the fourth most common group are selected as the replacement target group. May be. When a character is represented by two or more colors, by selecting a plurality of groups, it is possible to reduce the remaining of the character in the digital image without selecting the group to which the pixel representing the character belongs as a replacement target group.

第一実施例ではディジタル画像を複数の処理対象領域に分割しているが、複数の処理対象領域に分割すると、特徴量が特定の傾向をより顕著に持つようになるという利点がある。例えば黒い色の文字と赤い色の文字とがあり、黒い色の文字が含まれる領域と赤い文字が含まれる領域とはそれぞれ異なる処理対象領域として設定され、文字を表す画素が属するグループはいずれの処理対象領域でも二番目に多いグループになるとする。ところがそれらの領域が一つの処理対象領域として設定されると、一方は二番目に多いグループになったとしても、他方は三番目に多いグループになってしまうことになり、二番目に多いグループのみを置換対象グループとして選択すると、他方のグループに属する画素がディジタル画像上に残ってしまうことになる。処理対象領域を複数に分割すれば、いずれの処理対象領域においても文字が表す画素が属するグループは二番目に多くなり、文字を表す画素が属するグループは二番目に多いという傾向が顕著に表れ、文字をより確実に除去することができる。   In the first embodiment, the digital image is divided into a plurality of processing target areas. However, if the digital image is divided into a plurality of processing target areas, there is an advantage that the feature amount has a specific tendency more prominently. For example, there are black characters and red characters, and the areas containing the black characters and the areas containing the red characters are set as different processing target areas. It is assumed that the processing target area is the second most common group. However, if those areas are set as one processing target area, even if one becomes the second largest group, the other will become the third largest group, only the second largest group. Is selected as a replacement target group, pixels belonging to the other group remain on the digital image. If the processing target area is divided into a plurality of groups, the group to which the pixel represented by the character belongs in any processing target area is the second most frequent, and the group to which the pixel representing the character belongs is the second most significant, Characters can be removed more reliably.

S140では、CPU21は位置情報生成部44を実行し、置換対象グループに属する各画素の位置を示す位置情報を生成する。CPU21は、具体的には例えば処理対象領域を構成する画素を置換対象グループに属する画素と置換対象グループに属さない画素とに2値化したビットマップを生成する。以下、ビットマップについて説明する。   In S140, the CPU 21 executes the position information generation unit 44 to generate position information indicating the position of each pixel belonging to the replacement target group. Specifically, the CPU 21 generates, for example, a bitmap in which pixels constituting the processing target area are binarized into pixels belonging to the replacement target group and pixels not belonging to the replacement target group. Hereinafter, the bitmap will be described.

図18(A)はある処理対象領域の模式図であり、図18(B)はビットマップの模式図である。図18(A)では置換対象グループに属する画素のみを黒枠で示している。処理対象領域がn×m画素で構成されているのに対し、ビットマップはn×mビットで構成されている。ビットマップの各ビットは処理対象領域の各画素に対応しており、置換対象グループに属する画素に対応するビットは1、置換対象グループに属さない画素に対応するビットは0が設定されている。図18(B)では1が設定されているビットのみを黒枠で示している。画素数が2番目に多いグループに加え、例えば3番目に多いグループ、4番目に多いグループも置換対象グループとして選択した場合は、ビットマップはグループ毎に生成する。なお、位置情報はビットマップでなく置換対象グループに属する各画素の座標を示す情報であってもよい。   FIG. 18A is a schematic diagram of a certain processing target area, and FIG. 18B is a schematic diagram of a bitmap. In FIG. 18A, only the pixels belonging to the replacement target group are indicated by black frames. The processing target area is composed of n × m pixels, whereas the bitmap is composed of n × m bits. Each bit of the bitmap corresponds to each pixel in the processing target area, and a bit corresponding to a pixel belonging to the replacement target group is set to 1, and a bit corresponding to a pixel not belonging to the replacement target group is set to 0. In FIG. 18B, only the bits for which 1 is set are indicated by a black frame. In addition to the group with the second largest number of pixels, for example, when the third largest group and the fourth largest group are selected as the replacement target group, a bitmap is generated for each group. Note that the position information may be information indicating the coordinates of each pixel belonging to the replacement target group instead of the bitmap.

図5に示すS145では、CPU21は生成したビットマップをG4、JBIG、Run Lengthなどの1ビットに適した圧縮方法で圧縮し、ビットマップ圧縮データを生成する。
S150では、CPU21は置換部45を実行し、ディジタル画像において置換対象グループに属する画素の色を置換対象グループに属さない周囲の画素の色で置換する置換処理を実行する。以下、置換処理の詳細について説明する。
In S145 shown in FIG. 5, the CPU 21 compresses the generated bitmap by a compression method suitable for 1 bit such as G4, JBIG, Run Length, and generates bitmap compressed data.
In S150, the CPU 21 executes the replacement unit 45, and executes a replacement process for replacing the color of the pixel belonging to the replacement target group with the color of the surrounding pixels not belonging to the replacement target group in the digital image. Details of the replacement process will be described below.

図19は置換処理を説明するための模式図である。なお、図19は全ての処理対象領域について置換処理を実行した後のディジタル画像を表している。例えば図7の破線57で示す処理対象領域において「ス」という文字を構成する画素は置換対象グループに属する画素であるとする。この場合、「ス」という文字は周囲を灰色の画素に囲まれているので、置換部45は「ス」という文字を表している画素の色を灰色で置換する。他の文字についても同様である。この結果、図19に示すように処理対象領域から文字が除去される。ただし、上述した例は隣接する画素の色が1色のみの場合の例であり、背景が多色の場合は複数の色に周囲を囲まれることになる。この場合は周囲のいずれか一色のみで置換してもよいし、画素毎に周囲の直近の画素を特定して置換してもよい。   FIG. 19 is a schematic diagram for explaining the replacement process. FIG. 19 shows a digital image after the replacement process is executed for all the processing target areas. For example, it is assumed that the pixels constituting the character “su” in the processing target area indicated by the broken line 57 in FIG. In this case, since the character “su” is surrounded by gray pixels, the replacement unit 45 replaces the color of the pixel representing the character “su” with gray. The same applies to other characters. As a result, characters are removed from the processing target area as shown in FIG. However, the above-described example is an example in which the color of the adjacent pixel is only one color, and when the background is multicolored, the periphery is surrounded by a plurality of colors. In this case, only one of the surrounding colors may be replaced, or the nearest neighboring pixels may be specified and replaced for each pixel.

図5に示すS155では、CPU21は次の処理対象領域が存在するか否かを判定する。存在していればS120に戻り、存在していなければS160に進む。
図6に示すS160では、CPU21は画像圧縮部46を実行し、色が置換された後のディジタル画像を高圧縮率で圧縮し、画像圧縮データを生成する。具体的には例えばCPU21は高圧縮率で圧縮するパラメータを用いてディジタル画像をJPEG圧縮する。前述したようにディジタル画像からは文字が除去されているので、高圧縮率で圧縮しても文字が読み難くなるという問題は生じない。
In S155 shown in FIG. 5, the CPU 21 determines whether or not the next processing target area exists. If it exists, the process returns to S120, and if it does not exist, the process proceeds to S160.
In S160 shown in FIG. 6, the CPU 21 executes the image compression unit 46, compresses the digital image after the color replacement with a high compression rate, and generates compressed image data. Specifically, for example, the CPU 21 JPEG compresses the digital image using a parameter for compressing at a high compression rate. As described above, since characters are removed from the digital image, there is no problem that the characters are difficult to read even when compressed at a high compression rate.

S165では、CPU21は出力部47を実行し、図1に示すように各処理対象領域について置換対象グループの代表色を表す色データ、ビットマップを圧縮して生成されたビットマップ圧縮データ、及び置換対象グループが属する処理対象領域の位置を特定するための領域情報をPDF形式のファイル(PDFファイル)に格納するとともに、ディジタル画像を圧縮して生成した画像圧縮データを当該PDFファイルに格納し、リムーバブルメモリコントローラ34を制御してリムーバブルメモリ23に記録する。PDFファイルを再生するプログラムは広く普及しているので、圧縮したディジタル画像をPDFファイルに格納すると、多くの装置で再生できる。ここで領域情報とは、具体的には例えば処理対象領域を示す座標である。置換対象グループとして複数のグループを選択した処理対象領域については、色データとビットマップ圧縮データとを置換対象グループ毎に互いに関連付けて格納する。なお、本実施例ではグループ化処理の際の代表色をPDFファイルに格納する際の代表色としているが、PDFファイルに格納する際の代表色は必ずしもグループ化処理の際の代表色でなくてもよい。例えばPDFファイルに格納する際は、グループからランダムに選択した画素の色を当該グループの代表色としてもよい。
再生の際には、領域情報に基づいてビットマップとディジタル画像上の領域とを対応付け、ビットマップで特定される画素についてその画素の色を色データで特定される色に置換することにより、文字は滲むことなく再生される。
In S165, the CPU 21 executes the output unit 47, and color data representing the representative color of the replacement target group for each processing target area, bitmap compressed data generated by compressing the bitmap, and replacement as shown in FIG. The area information for specifying the position of the process target area to which the target group belongs is stored in a PDF file (PDF file), and the compressed image data generated by compressing the digital image is stored in the PDF file. The memory controller 34 is controlled and recorded in the removable memory 23. Since a program for reproducing a PDF file is widely used, if a compressed digital image is stored in a PDF file, it can be reproduced by many apparatuses. Here, the region information is specifically coordinates indicating a processing target region, for example. For a processing target area in which a plurality of groups are selected as replacement target groups, color data and bitmap compressed data are stored in association with each other for each replacement target group. In this embodiment, the representative color for the grouping process is the representative color for storing in the PDF file, but the representative color for storing in the PDF file is not necessarily the representative color for the grouping process. Also good. For example, when storing in a PDF file, the color of a pixel randomly selected from a group may be used as the representative color of the group.
At the time of reproduction, by associating the bitmap with the region on the digital image based on the region information, by replacing the color of the pixel specified by the bitmap with the color specified by the color data, The characters are played without bleeding.

以上説明した本発明の第一実施例に係るイメージスキャナ1によると、各グループの特徴量に基づいて置換対象グループを選択する。処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化した場合、文字を表す画素が属するグループは画素数が二番目に多いという傾向がある。従って、特徴量を用いれば文字を表す画素が属するグループを高い確率で特定することができる。文字を表す画素が属するグループを置換対象グループとし、ディジタル画像において置換対象グループに属する画素の色を周囲の画素の色で置換すると、ディジタル画像から文字を除去することができる。ディジタル画像から文字を除去するとディジタル画像の圧縮率は文字の読み易さに影響を与えなくなるので、ディジタル画像を高圧縮率で圧縮することができる。一方、ビットマップは各画素の濃度を持つ必要がないので小さなデータ量でよい。従ってPDFファイルのデータ量を小さくできる。よってイメージスキャナ1によると、ディジタル画像を文字の読み易さを損なうことなく高圧縮率で圧縮できる。   According to the image scanner 1 according to the first embodiment of the present invention described above, the replacement target group is selected based on the feature amount of each group. When the pixels constituting the processing target area are grouped for each pixel having a small color difference, the group to which the pixel representing the character belongs has the second largest number of pixels. Therefore, if a feature amount is used, a group to which a pixel representing a character belongs can be specified with a high probability. If a group to which a pixel representing a character belongs is set as a replacement target group and the color of a pixel belonging to the replacement target group in the digital image is replaced with the color of a surrounding pixel, the character can be removed from the digital image. When characters are removed from the digital image, the digital image compression rate does not affect the readability of the characters, so the digital image can be compressed at a high compression rate. On the other hand, since the bitmap need not have the density of each pixel, a small amount of data is sufficient. Therefore, the data amount of the PDF file can be reduced. Therefore, according to the image scanner 1, a digital image can be compressed at a high compression rate without impairing the readability of characters.

(第二実施例)
第二実施例の特徴量は、グループに属する小グループの数である。以下、小グループについて図7の破線57で示す処理対象領域を例に説明する。
小グループとは、他のグループに属する画素に周囲を囲まれて同一のグループに属する他の画素と隔離されている画素群のことをいう。例えば破線57で示す処理対象領域において背景を表す画素は全て同一のグループに配属され、文字を表す画素は全て背景を表す画素とは別の同一のグループに配属される。破線57で示す処理対象領域では背景を表す画素のうち隔離されている画素はないので、全体が一つの小グループに相当する。
(Second embodiment)
The feature amount of the second embodiment is the number of small groups belonging to the group. Hereinafter, the processing target area indicated by the broken line 57 in FIG. 7 will be described as an example for the small group.
A small group refers to a pixel group surrounded by pixels belonging to another group and isolated from other pixels belonging to the same group. For example, in the processing target area indicated by the broken line 57, all the pixels representing the background are assigned to the same group, and all the pixels representing the characters are assigned to the same group different from the pixels representing the background. In the processing target area indicated by the broken line 57, there is no isolated pixel among the pixels representing the background, and therefore the whole corresponds to one small group.

一方、例えば「ジ」の文字は、全部で5つの小グループに分かれている。従って文字を表す画素が属するグループには背景を表す画素が属するグループに比べて多くの小グループが属している。このようにカタカナやひらがなが多い処理対象領域では文字を表す画素が属するグループの小グループの数は文字以外を表す画素が属するグループの小グループの数より多いといえる。従って、小グループの数に着目することにより、文字を表す画素が属するグループを高い確率で特定することができる。ただしこれは常に成り立つわけではなく、例えば漢字が多かったり市松模様の背景であったりすると、文字を表す画素が属するグループの方が小グループの数が少なくなることもあり得る。このように小グループの数は文章によって異なるので一概にはいえないが、特にカタカナやひらがなが多く含まれる文章の場合は一番目である確率は他のいずれの順位である確率よりも高いといえる。   On the other hand, for example, the letter “di” is divided into five small groups in total. Therefore, many small groups belong to a group to which pixels representing characters belong, compared to a group to which pixels representing a background belong. In this way, in the processing target region with many katakana and hiragana, it can be said that the number of small groups of the group to which the pixel representing the character belongs is larger than the number of small groups of the group to which the pixel representing other than the character belongs. Therefore, by focusing on the number of small groups, the group to which the pixel representing the character belongs can be specified with high probability. However, this does not always hold. For example, if there are many kanji characters or a checkered background, the number of small groups may be smaller in the group to which the pixel representing the character belongs. In this way, the number of small groups differs depending on the sentence, so it can not be said unconditionally, but in the case of sentences that contain a lot of katakana and hiragana, the probability of being the first is higher than the probability of any other rank .

第二実施例はその他の点において第一実施例と実質的に同一である。
なお、上述した複数の実施例では画像圧縮装置としてイメージスキャナを例に説明したが、パーソナルコンピュータに本発明を適用してもよい。また、ディジタルカメラやカメラ付き携帯電話などに本発明を適用してもよい。
The second embodiment is substantially the same as the first embodiment in other points.
In the above-described embodiments, the image scanner has been described as an example of the image compression apparatus. However, the present invention may be applied to a personal computer. Further, the present invention may be applied to a digital camera, a camera-equipped mobile phone, and the like.

本発明の第一実施例に係る画像圧縮方法の概要を示す模式図。1 is a schematic diagram showing an outline of an image compression method according to a first embodiment of the present invention. 本発明の第一実施例に係る画像読み取り装置の模式図。1 is a schematic diagram of an image reading apparatus according to a first embodiment of the present invention. 本発明の第一実施例に係る画像読み取り装置のブロック図。1 is a block diagram of an image reading apparatus according to a first embodiment of the present invention. 本発明の第一実施例に係る画像圧縮プログラムのブロック図。1 is a block diagram of an image compression program according to a first embodiment of the present invention. 本発明の第一実施例に係るフローチャート。The flowchart which concerns on the 1st Example of this invention. 本発明の第一実施例に係るフローチャート。The flowchart which concerns on the 1st Example of this invention. 本発明の第一実施例に係るディジタル画像の模式図。1 is a schematic diagram of a digital image according to a first embodiment of the present invention. 本発明の第一実施例に係るディジタル画像を変換した模式図。FIG. 3 is a schematic diagram obtained by converting a digital image according to the first embodiment of the present invention. 本発明の第一実施例に係る領域分割の模式図。The schematic diagram of the area | region division which concerns on 1st Example of this invention. 本発明の第一実施例に係るフローチャート。The flowchart which concerns on the 1st Example of this invention. (A)、(B)及び(C)は本発明の第一実施例に係る重み付け係数の模式図。(A), (B) and (C) are schematic diagrams of weighting factors according to the first embodiment of the present invention. 本発明の第一実施例に係る周波数係数の模式図。The schematic diagram of the frequency coefficient which concerns on the 1st Example of this invention. 本発明の第一実施例に係るフローチャート。The flowchart which concerns on the 1st Example of this invention. 本発明の第一実施例に係る領域分割の結果の模式図。The schematic diagram of the result of the area | region division which concerns on 1st Example of this invention. 本発明の第一実施例に係るフローチャート。The flowchart which concerns on the 1st Example of this invention. 本発明の第一実施例に係る色空間を均等に分割した模式図。FIG. 3 is a schematic diagram in which the color space according to the first embodiment of the present invention is divided equally. 本発明の第一実施例に係る特徴量のグラフ。The graph of the feature-value which concerns on the 1st Example of this invention. (A)は本発明の第一実施例に係る処理対象領域の模式図、(B)は二値画像の模式図。(A) is a schematic diagram of the process target area | region which concerns on 1st Example of this invention, (B) is a schematic diagram of a binary image. 本発明の第一実施例に係る置換を説明するための模式図。The schematic diagram for demonstrating the substitution which concerns on the 1st Example of this invention.

符号の説明Explanation of symbols

1 イメージスキャナ(画像読み取り装置)、21 CPU(画像圧縮装置、設定手段、グループ化手段、選択手段、位置情報生成手段、置換手段、ディジタル画像圧縮手段、出力手段) 1 Image scanner (image reading apparatus), 21 CPU (image compression apparatus, setting means, grouping means, selection means, position information generation means, replacement means, digital image compression means, output means)

Claims (12)

ディジタル画像上に処理対象領域を設定する設定段階と、
前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化段階と、
各前記グループの特徴量に基づいて置換対象グループを選択する選択段階と、
前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成段階と、
前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換段階と、
前記置換段階で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮段階と、
前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力段階と、
を含むことを特徴とする画像圧縮方法。
A setting stage for setting the processing target area on the digital image;
A grouping step of grouping pixels constituting the processing target area for each pixel having a small color difference;
A selection step of selecting a replacement target group based on the feature amount of each of the groups;
A position information generation step of generating position information indicating the position of each pixel belonging to the replacement target group;
A replacement step of replacing the color of each pixel belonging to the replacement target group with the color of surrounding pixels not belonging to the replacement target group;
A digital image compression step of compressing the digital image after the color of each pixel is replaced in the replacement step to generate compressed image data;
An output step of associating and outputting color data representing a representative color of the replacement target group, the position information, and the compressed image data;
An image compression method comprising:
前記設定段階は、
前記ディジタル画像を複数のブロックに分割し、各前記ブロックを周波数成分に変換する変換段階と、
各前記ブロックの高周波成分に基づいて前記処理対象領域を設定する領域設定段階と、
を含むことを特徴とする請求項1に記載の画像圧縮方法。
The setting step includes:
Converting the digital image into a plurality of blocks, and converting each of the blocks into frequency components;
A region setting step for setting the processing target region based on the high-frequency component of each block;
The image compression method according to claim 1, further comprising:
前記領域設定段階は、
前記ディジタル画像全体を前記処理対象領域として設定する段階と、
前記処理対象領域について前記ブロックからなる行毎に高周波成分が所定値以上である前記ブロックの数を集計し、高周波成分が所定値以上である前記ブロックの数が第一の閾値未満の行で前記処理対象領域を分割する段階と、
前記処理対象領域について前記ブロックからなる列毎に高周波成分が所定値以上である前記ブロックの数を集計し、高周波成分が所定値以上である前記ブロックの数が第二の閾値未満の列で前記処理対象領域を分割する段階とを含み、
行で前記処理対象領域を分割する前記段階と列で前記処理対象領域を分割する前記段階とを繰り返すことにより前記ディジタル画像上に複数の矩形の前記処理対象領域を設定することを特徴とする請求項2に記載の画像圧縮方法。
The region setting step includes:
Setting the entire digital image as the region to be processed;
The number of blocks having a high frequency component equal to or higher than a predetermined value is counted for each row including the blocks in the processing target area, and the number of blocks having a high frequency component equal to or higher than a predetermined value is less than a first threshold. Dividing the processing target area;
The number of blocks having a high frequency component equal to or greater than a predetermined value is counted for each column including the blocks for the processing target region, and the number of blocks having a high frequency component equal to or greater than a predetermined value is a column less than a second threshold value. Dividing the region to be processed,
A plurality of rectangular processing target areas are set on the digital image by repeating the step of dividing the processing target area by rows and the step of dividing the processing target area by columns. Item 3. The image compression method according to Item 2.
前記グループ化段階において、前記処理対象領域を構成する画素をk−means法によってグループ化することを特徴とする請求項1、2又は3に記載の画像圧縮方法。   The image compression method according to claim 1, 2, or 3, wherein in the grouping step, pixels constituting the processing target region are grouped by a k-means method. 前記特徴量は前記グループに属する画素の数であり、
前記選択段階において、画素の数が二番目に多い前記グループを前記置換対象グループとして選択することを特徴とする請求項1〜4のいずれか一項に記載の画像圧縮方法。
The feature amount is the number of pixels belonging to the group,
5. The image compression method according to claim 1, wherein in the selection step, the group having the second largest number of pixels is selected as the replacement target group.
他の前記グループに属する画素に周囲を囲まれて同一の前記グループに属する他の画素と隔離されている画素群を小グループというとき、前記特徴量は前記グループに属する前記小グループの数であり、
前記選択段階において、前記小グループの数が最も多い前記グループを前記置換対象グループとして選択することを特徴とする請求項1〜4のいずれか一項に記載の画像圧縮方法。
When a pixel group surrounded by pixels belonging to another group and isolated from other pixels belonging to the same group is called a small group, the feature amount is the number of the small groups belonging to the group. ,
5. The image compression method according to claim 1, wherein, in the selection step, the group having the largest number of the small groups is selected as the replacement target group.
前記選択段階において、複数の前記グループを前記置換対象グループとして選択することを特徴とする請求項1〜6のいずれか一項に記載の画像圧縮方法。   The image compression method according to claim 1, wherein in the selection step, a plurality of the groups are selected as the replacement target group. 前記位置情報は、前記処理対象領域を構成する画素を前記置換対象グループに属する画素と前記置換対象グループに属さない画素とに二値化した二値画像、及び前記置換対象グループが属する前記処理対象領域の位置を特定するための領域情報であることを特徴とする請求項1〜7のいずれか一項に記載の画像圧縮方法。   The position information includes a binary image obtained by binarizing pixels constituting the processing target area into pixels belonging to the replacement target group and pixels not belonging to the replacement target group, and the processing target to which the replacement target group belongs. The image compression method according to claim 1, wherein the image compression method is region information for specifying a region position. 前記出力段階は、前記色データ、前記位置情報、及び前記画像圧縮データを一つのPDFファイルに格納して出力することを特徴とする請求項1〜8のいずれか一項に記載の画像圧縮方法。   9. The image compression method according to claim 1, wherein in the output step, the color data, the position information, and the compressed image data are stored in a single PDF file and output. 10. . ディジタル画像上に処理対象領域を設定する設定手段と、
前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化手段と、
各前記グループの特徴量に基づいて置換対象グループを選択する選択手段と、
前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成手段と、
前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換手段と、
前記置換手段で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮手段と、
前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力手段と、
を備えることを特徴とする画像圧縮装置。
Setting means for setting a processing target area on the digital image;
Grouping means for grouping pixels constituting the processing target area for each pixel having a small color difference;
Selecting means for selecting a replacement target group based on the feature amount of each of the groups;
Position information generating means for generating position information indicating the position of each pixel belonging to the replacement target group;
Replacement means for replacing the color of each pixel belonging to the replacement target group with the color of surrounding pixels not belonging to the replacement target group;
Digital image compression means for compressing the digital image after the color of each pixel is replaced by the replacement means to generate compressed image data;
Output means for associating and outputting color data representing a representative color of the replacement target group, the position information, and the compressed image data;
An image compression apparatus comprising:
原稿を読み取ってディジタル画像を生成する読み取り手段と、
請求項10に記載の画像圧縮装置と、
を備えることを特徴とする画像読み取り装置。
Reading means for reading a document and generating a digital image;
An image compression apparatus according to claim 10;
An image reading apparatus comprising:
ディジタル画像上に処理対象領域を設定する設定手段と、
前記処理対象領域を構成する画素を互いに色差が小さい画素毎にグループ化するグループ化手段と、
各前記グループの特徴量に基づいて置換対象グループを選択する選択手段と、
前記置換対象グループに属する各画素の位置を示す位置情報を生成する位置情報生成手段と、
前記置換対象グループに属する各画素の色を前記置換対象グループに属さない周囲の画素の色で置換する置換手段と、
前記置換手段で前記各画素の色が置換された後の前記ディジタル画像を圧縮して画像圧縮データを生成するディジタル画像圧縮手段と、
前記置換対象グループの代表色を表す色データ、前記位置情報、及び前記画像圧縮データを関連付けて出力する出力手段としてコンピュータを機能させることを特徴とする画像圧縮プログラム。
Setting means for setting a processing target area on the digital image;
Grouping means for grouping pixels constituting the processing target area for each pixel having a small color difference;
Selecting means for selecting a replacement target group based on the feature amount of each of the groups;
Position information generating means for generating position information indicating the position of each pixel belonging to the replacement target group;
Replacement means for replacing the color of each pixel belonging to the replacement target group with the color of surrounding pixels not belonging to the replacement target group;
Digital image compression means for compressing the digital image after the color of each pixel is replaced by the replacement means to generate compressed image data;
An image compression program that causes a computer to function as output means that outputs color data representing a representative color of the replacement target group, the position information, and the compressed image data.
JP2005098337A 2005-03-30 2005-03-30 Image compression method, image compression apparatus, image compression program, and image reading apparatus Expired - Fee Related JP4609155B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005098337A JP4609155B2 (en) 2005-03-30 2005-03-30 Image compression method, image compression apparatus, image compression program, and image reading apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005098337A JP4609155B2 (en) 2005-03-30 2005-03-30 Image compression method, image compression apparatus, image compression program, and image reading apparatus

Publications (2)

Publication Number Publication Date
JP2006279741A true JP2006279741A (en) 2006-10-12
JP4609155B2 JP4609155B2 (en) 2011-01-12

Family

ID=37213970

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005098337A Expired - Fee Related JP4609155B2 (en) 2005-03-30 2005-03-30 Image compression method, image compression apparatus, image compression program, and image reading apparatus

Country Status (1)

Country Link
JP (1) JP4609155B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008103774A3 (en) * 2007-02-21 2008-10-16 Microsoft Corp Signaling and use of chroma sample positioning information
US7548245B2 (en) 2004-03-10 2009-06-16 Microsoft Corporation Image formats for video capture, processing and display
US8023755B2 (en) * 2008-05-15 2011-09-20 International Business Machines Corporation Generating subimages of an image to use to represent the image
US8880571B2 (en) 2006-05-05 2014-11-04 Microsoft Corporation High dynamic range data format conversions for digital media

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05284360A (en) * 1992-03-31 1993-10-29 Canon Inc Picture compression method and picture compressor
JPH11308463A (en) * 1998-04-17 1999-11-05 Sanyo Electric Co Ltd Image processor and image processing method
JP2004229261A (en) * 2002-11-27 2004-08-12 Canon Inc Image-compressing method, image-compressing device, program, and recording media
JP2004260327A (en) * 2003-02-24 2004-09-16 Canon Inc Image compression apparatus
JP2005012768A (en) * 2003-05-26 2005-01-13 Ricoh Co Ltd Image processing apparatus, program for image processing and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05284360A (en) * 1992-03-31 1993-10-29 Canon Inc Picture compression method and picture compressor
JPH11308463A (en) * 1998-04-17 1999-11-05 Sanyo Electric Co Ltd Image processor and image processing method
JP2004229261A (en) * 2002-11-27 2004-08-12 Canon Inc Image-compressing method, image-compressing device, program, and recording media
JP2004260327A (en) * 2003-02-24 2004-09-16 Canon Inc Image compression apparatus
JP2005012768A (en) * 2003-05-26 2005-01-13 Ricoh Co Ltd Image processing apparatus, program for image processing and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7548245B2 (en) 2004-03-10 2009-06-16 Microsoft Corporation Image formats for video capture, processing and display
US7639265B2 (en) 2004-03-10 2009-12-29 Microsoft Corporation Image formats for video capture, processing and display
US7649539B2 (en) 2004-03-10 2010-01-19 Microsoft Corporation Image formats for video capture, processing and display
US8880571B2 (en) 2006-05-05 2014-11-04 Microsoft Corporation High dynamic range data format conversions for digital media
WO2008103774A3 (en) * 2007-02-21 2008-10-16 Microsoft Corp Signaling and use of chroma sample positioning information
US8054886B2 (en) 2007-02-21 2011-11-08 Microsoft Corporation Signaling and use of chroma sample positioning information
CN101617540B (en) * 2007-02-21 2012-09-05 微软公司 Method for encoding and decoding digital image data using chroma position information
US8023755B2 (en) * 2008-05-15 2011-09-20 International Business Machines Corporation Generating subimages of an image to use to represent the image

Also Published As

Publication number Publication date
JP4609155B2 (en) 2011-01-12

Similar Documents

Publication Publication Date Title
JP3686439B2 (en) Digital image photo area detection system and method
US9129210B2 (en) Systems and methods of processing scanned data
US7894683B2 (en) Reformatting binary image data to generate smaller compressed image data size
EP0522702B1 (en) Spot color extraction
US6999619B2 (en) Processing for accurate reproduction of symbols and other high-frequency areas in a color image
US8116513B2 (en) Image processing method, image processing apparatus, document reading apparatus, image forming apparatus, and recording medium
JP2005020227A (en) Picture compression device
JP2002290725A (en) Image improving system and method for determining optimum setup for image reproduction
US20080049238A1 (en) Method and system for automatic window classification in a digital reprographic system
JP2008042325A (en) Method, device, and computer program for processing input data related to generation of electronic file
EP1289266A3 (en) Image processing method image processing apparatus and storage medium
JP3335830B2 (en) Image processing device
JP4609155B2 (en) Image compression method, image compression apparatus, image compression program, and image reading apparatus
CN1622589A (en) Image processing method and image processing apparatus
CN1711558A (en) Similar image extraction device, similar image extraction method, and similar image extraction program
JPH08172532A (en) Image reader and read method
CN106488074B (en) Image processing apparatus and electronic document generation method
JP2010154243A (en) Image processing method, image processor, and program
JP4500865B2 (en) Image processing apparatus, image processing method, program, and storage medium
US7418138B2 (en) Image processor for and method of performing tonal transformation on image data
US20200099821A1 (en) Image processing apparatus, image processing method, and storage medium
CN101272433A (en) Image processing apparatus, image processing method, and computer program product
US11283963B2 (en) Image processing apparatus and image processing method and storage medium
CN1251139C (en) Multiple-pattern image processing method and system thereof
JP4203636B2 (en) Image processing method and image input apparatus

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20060824

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061222

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20061226

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070404

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080229

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100524

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100817

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100824

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100927

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

Free format text: PAYMENT UNTIL: 20131022

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees