JP2009130590A - Printer and its control method - Google Patents

Printer and its control method Download PDF

Info

Publication number
JP2009130590A
JP2009130590A JP2007302944A JP2007302944A JP2009130590A JP 2009130590 A JP2009130590 A JP 2009130590A JP 2007302944 A JP2007302944 A JP 2007302944A JP 2007302944 A JP2007302944 A JP 2007302944A JP 2009130590 A JP2009130590 A JP 2009130590A
Authority
JP
Japan
Prior art keywords
image
red
eye
print
reduced 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.)
Withdrawn
Application number
JP2007302944A
Other languages
Japanese (ja)
Inventor
Masatoshi Matsudaira
平 正 年 松
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 JP2007302944A priority Critical patent/JP2009130590A/en
Publication of JP2009130590A publication Critical patent/JP2009130590A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a printer which saves users' waiting time for printing and reduces the amount of memory used for red-eye position detection processing, and to provide its control method. <P>SOLUTION: The printer includes: a reduction image generation means for reducing the size of an original image to generate a reduction image; a first red-eye position detection means for detecting red-eye positions based on the reduction image; a storage execution means for temporarily storing some parts of printing image data into a printing data storage device to print images based on the original image; a second red-eye position detection means for detecting red-eye positions based on the image data stored in the printing data storage device; and a red-eye correction means for correcting red-eyes based on the red-eye positions detected by the first red-eye position detection means and the second red-eye position detection means. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、プリンタ及びその制御方法に関し、特に、赤目位置検出処理の際のメモリ使用量の削減を図ったプリンタ及びその制御方法に関する。   The present invention relates to a printer and a control method thereof, and more particularly, to a printer and a control method thereof that reduce memory usage during red-eye position detection processing.

プリンタなどの画像処理装置の中には、事前に画像をサンプリングして縮小画像を生成し、このサンプリングした縮小画像に基づいて画像認識処理を行った上で、実際の画像処理を行うことのできる装置がある。例えば、サンプリングした縮小画像に基づいて赤目の位置を検出する赤目位置検出処理を行い、赤目が検出された場合には、その検出された赤目の位置に基づいて赤目補正処理を行った上で印刷を行うプリンタがある(例えば、特開2004−164276号公報参照)。   Some image processing apparatuses such as printers can sample images in advance to generate reduced images, perform image recognition processing based on the sampled reduced images, and then perform actual image processing. There is a device. For example, a red-eye position detection process is performed to detect the position of the red eye based on the sampled reduced image. If a red eye is detected, the red-eye correction process is performed based on the detected red-eye position before printing. There is a printer that performs the above (for example, see JP-A-2004-164276).

一般的に、赤目補正処理のために赤目位置検出処理を行う場合、VGAサイズ(640×480ピクセル)以上の大きさの画像が必要になる。このため、赤目位置検出処理を精度良く行うために、VGAサイズの画像を用意するという手法も考えられる。   In general, when the red-eye position detection process is performed for the red-eye correction process, an image having a size equal to or larger than the VGA size (640 × 480 pixels) is required. For this reason, in order to perform the red-eye position detection process with high accuracy, a method of preparing a VGA size image is also conceivable.

しかし、VGAサイズの画像のRGB画像データを保持するだけで900KB程度のメモリ容量が必要となり、メモリ容量が小さい画像処理装置にとっては、負担が大きい。特に、この赤目位置検出処理を含む赤目補正処理を予め組み込んでおく組み込み型のプリンタなどにおいては、搭載されているメモリサイズが小さく、必ずしも十分なメモリ容量を、この画像認識処理のために確保できない場合も多い。   However, a memory capacity of about 900 KB is required only by holding RGB image data of a VGA size image, and this is a heavy burden for an image processing apparatus having a small memory capacity. In particular, in a built-in printer or the like in which the red-eye correction process including the red-eye position detection process is incorporated in advance, the installed memory size is small, and a sufficient memory capacity cannot be ensured for the image recognition process. There are many cases.

さらに、画像処理装置によっては、GUI(Graphical User Interface)画面に、縮小画像を高速表示するために、CPUの空き時間を利用して、事前に、元画像データから縮小画像を生成するようにしている。そして、この生成した縮小画像をキャッシュメモリに格納しておき、GUI画面に表示する必要が生じた場合には、このキャッシュメモリに格納された縮小画像を読み出して表示する。   Further, in some image processing apparatuses, in order to display a reduced image on a GUI (Graphical User Interface) screen at a high speed, the reduced image is generated from the original image data in advance using the CPU idle time. Yes. When the generated reduced image is stored in the cache memory and needs to be displayed on the GUI screen, the reduced image stored in the cache memory is read and displayed.

このような画像処理装置において、キャッシュされている縮小画像を用いて、画像認識処理を行おうとすると、キャッシュメモリに格納する縮小画像もVGAで生成しなければならない。しかし、例えば20枚の縮小画像をキャッシュメモリに格納しようとすると、縮小画像をキャッシュするために大きなメモリ容量を確保しなければならず、その分、コストアップになってしまうという問題がある。   In such an image processing apparatus, when an image recognition process is performed using a cached reduced image, the reduced image to be stored in the cache memory must also be generated by the VGA. However, for example, if 20 reduced images are to be stored in the cache memory, a large memory capacity must be ensured in order to cache the reduced images, which increases the cost accordingly.

一方、キャッシュメモリに格納されている縮小画像を利用することなく、赤目位置検出処理を含む赤目補正処理の都度、元画像データに基づいて、VGAサイズの画像を生成するのでは、画像生成に余分な時間がかかってしまう。特に、この赤目補正処理は、プリンタで印刷を開始する直前に行うことが多いため、縮小画像を生成するための時間が、そのままユーザの印刷待ち時間になってしまう。このため、ユーザの印刷待ち時間の増大を招き、ユーザにとって、使い勝手が悪くなるという問題が生じる。   On the other hand, generating a VGA size image based on the original image data every time the red-eye correction process including the red-eye position detection process is performed without using the reduced image stored in the cache memory. Takes a long time. In particular, since the red-eye correction process is often performed immediately before printing is started by the printer, the time for generating a reduced image becomes the printing waiting time of the user as it is. For this reason, the user's printing waiting time is increased, and there arises a problem that usability is deteriorated for the user.

一方で、プリンタが印刷を行う場合、印刷時に元画像データに基づいて、フルサイズの画像を取得する。このため、このフルサイズの画像に基づいて、赤目位置検出処理を行う手法も考えられる。しかし、フルサイズの画像で赤目位置検出処理を行う場合、赤目の直径と同等以上の大きさの印刷データバッファを用意しなければならない。このため、元画像に占める割合が大きい赤目まで検出しようとすると、印刷データバッファのサイズもそれだけ大きくなり、やはりメモリ容量の増大を招いてしまう。   On the other hand, when the printer performs printing, a full-size image is acquired based on the original image data at the time of printing. For this reason, a method of performing red-eye position detection processing based on this full-size image is also conceivable. However, when the red-eye position detection process is performed on a full-size image, a print data buffer having a size equal to or larger than the red-eye diameter must be prepared. For this reason, if it is attempted to detect red-eye that accounts for a large proportion of the original image, the size of the print data buffer also increases accordingly, which also increases the memory capacity.

その一方で、VGAサイズより小さいQVGAサイズ(320×240ピクセル)の画像に基づいて赤目位置検出処理を行うだけでは、大きな赤目は検出できても、小さい赤目が検出できず、検出精度の低下が避けられないという問題がある。
特開2004−164276号公報
On the other hand, if only the red-eye position detection process is performed based on an image having a QVGA size (320 × 240 pixels) smaller than the VGA size, a large red-eye can be detected, but a small red-eye cannot be detected, resulting in a decrease in detection accuracy. There is an inevitable problem.
JP 2004-164276 A

そこで本発明は、前記課題に鑑みてなされたものであり、ユーザの印刷待ち時間の増大を回避しつつ、赤目の位置を検出するための赤目位置検出処理の際におけるメモリ使用量の削減を図ったプリンタ及びその制御方法を提供することを目的とする。   Therefore, the present invention has been made in view of the above problems, and aims to reduce the memory usage during the red-eye position detection process for detecting the red-eye position while avoiding an increase in the printing waiting time of the user. An object of the present invention is to provide a printer and a control method thereof.

上記課題を解決するため、本発明に係るプリンタは、
元画像を縮小することにより、縮小画像を生成する、縮小画像生成手段と、
前記縮小画像に基づいて、赤目の位置を検出するための処理を行う、第1赤目位置検出手段と、
元画像に基づいて画像の印刷をするために、印刷用の画像データの一部を一時的に印刷データ記憶装置に格納する、格納実行手段と、
前記印刷データ記憶装置に格納されている画像データに基づいて、赤目の位置を検出するための処理を行う、第2赤目位置検出手段と、
前記第1赤目位置検出手段及び前記第2赤目位置検出手段とで検出された赤目の位置に基づいて赤目補正を行う、赤目補正手段と、
を備えることを特徴とする。
In order to solve the above problems, a printer according to the present invention provides:
Reduced image generation means for generating a reduced image by reducing the original image;
First red-eye position detecting means for performing processing for detecting the position of the red-eye based on the reduced image;
Storage executing means for temporarily storing a part of image data for printing in a print data storage device in order to print an image based on the original image;
Second red-eye position detecting means for performing processing for detecting the position of red-eye based on image data stored in the print data storage device;
Red-eye correction means for performing red-eye correction based on the red-eye position detected by the first red-eye position detection means and the second red-eye position detection means;
It is characterized by providing.

この場合、前記第1赤目位置検出手段で検出する赤目の元画像に占める大きさの割合は、前記第2赤目位置検出手段で検出する赤目の元画像に占める大きさの割合よりも、大きいようにしてもよい。   In this case, the ratio of the size of the red-eye original image detected by the first red-eye position detecting unit is larger than the ratio of the size of the red-eye original image detected by the second red-eye position detecting unit. It may be.

また、前記縮小画像生成手段は、CPUの空き時間を用いて前記縮小画像を予め生成して縮小画像記憶装置に格納しておき、
前記第1赤目位置検出手段は、前記縮小画像記憶装置から、この縮小画像を取得して、赤目の位置を検出するための処理を行うようにしてもよい。
Further, the reduced image generating means generates the reduced image in advance using the CPU free time and stores it in the reduced image storage device,
The first red-eye position detection unit may acquire the reduced image from the reduced image storage device and perform processing for detecting the position of the red eye.

この場合、前記縮小画像記憶装置に格納されている縮小画像を読み出して、表示画面に表示する、縮小画像表示手段を、さらに備えるようにしてもよい。   In this case, a reduced image display unit that reads out the reduced image stored in the reduced image storage device and displays the reduced image on the display screen may be further provided.

また、前記格納実行手段は、元画像のデータから得られたフルサイズの画像データを、印刷用の画像データとして、前記印刷データ記憶装置に格納するようにしてもよい。   The storage execution unit may store full-size image data obtained from the original image data in the print data storage device as image data for printing.

また、前記赤目補正手段で赤目補正をした後に、その画像の印刷を行う、印刷実行手段を、さらに備えるようにしてもよい。   Further, the image processing apparatus may further include a print execution unit that prints the image after the red-eye correction is performed by the red-eye correction unit.

本発明に係るプリンタの制御方法は、
元画像を縮小することにより、縮小画像を生成する工程と、
前記縮小画像に基づいて、赤目の位置を検出するための処理を行う工程と、
元画像に基づいて画像の印刷をするために、印刷用の画像データの一部を一時的に印刷データ記憶装置に格納する工程と、
前記印刷データ記憶装置に格納されている画像データに基づいて、赤目の位置を検出するための処理を行う工程と、
前記縮小画像に基づいて検出された赤目の位置と、前記印刷データ記憶装置に格納されている画像データに基づいて検出された赤目の位置とに基づいて、赤目補正を行う工程と、
を備えることを特徴とする。
The printer control method according to the present invention includes:
Generating a reduced image by reducing the original image; and
Performing a process for detecting the position of the red eye based on the reduced image;
Temporarily printing a part of image data for printing in a print data storage device to print an image based on the original image;
Performing a process for detecting the position of the red eye based on the image data stored in the print data storage device;
Performing red-eye correction based on the red-eye position detected based on the reduced image and the red-eye position detected based on the image data stored in the print data storage device;
It is characterized by providing.

発明を実施するための形態BEST MODE FOR CARRYING OUT THE INVENTION

以下、図面を参照して、本発明の実施形態を説明する。なお、以下に説明する実施形態は、本発明の技術的範囲を限定するものではない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. Note that the embodiments described below do not limit the technical scope of the present invention.

図1は、本実施形態に係る画像処理装置10の内部構成の一例を説明するブロック図である。この図1から分かるように、本実施形態における画像処理装置10は、プリンタにより構成されており、より具体的には、カラーのインクジェットプリンタにより構成されている。但し、画像処理装置10は、プリンタに限定されるものではなく、例えばフォトビューアなどの画像表示装置により、構成することもできる。   FIG. 1 is a block diagram illustrating an example of the internal configuration of the image processing apparatus 10 according to the present embodiment. As can be seen from FIG. 1, the image processing apparatus 10 according to the present embodiment is configured by a printer, and more specifically, is configured by a color inkjet printer. However, the image processing apparatus 10 is not limited to a printer, and may be configured by an image display apparatus such as a photo viewer.

図1に示すように、画像処理装置10は、CPU(Central Processing Unit)20と、ROM(Read Only Memory)22と、カードインターフェース24と、通信インターフェース26と、画面インターフェース28と、装置制御部30とを備えて構成されており、これらは内部バス32を介して、相互に接続されている。   As shown in FIG. 1, the image processing apparatus 10 includes a CPU (Central Processing Unit) 20, a ROM (Read Only Memory) 22, a card interface 24, a communication interface 26, a screen interface 28, and a device control unit 30. These are connected to each other via an internal bus 32.

CPU20には、専用の揮発性記憶装置であるRAM(Random Access Memory)34が接続されている。例えば、このCPU20は、ROM22に格納されている各種のプログラムを読み込んで実行することにより、この画像処理装置10の各種の制御を行う。プログラムを実行する際には、CPU20は、必要に応じて、RAM34に一時的なデータを格納する。   A random access memory (RAM) 34 that is a dedicated volatile storage device is connected to the CPU 20. For example, the CPU 20 performs various controls of the image processing apparatus 10 by reading and executing various programs stored in the ROM 22. When executing the program, the CPU 20 stores temporary data in the RAM 34 as necessary.

ROM22は、不揮発性記憶装置の一例であり、画像処理装置10における各種のプログラムやデータが、不揮発的に格納されている。カードインターフェース24は、画像処理装置10に、PCカードなどのカード型外部デバイス100を挿入して利用するためのインターフェースである。例えば、PCカードの場合、フラッシュメモリカード、ハードディスク、SCSIカード、モデムカードなどの様々な種類がある。   The ROM 22 is an example of a nonvolatile storage device, and various programs and data in the image processing device 10 are stored in a nonvolatile manner. The card interface 24 is an interface for inserting and using a card-type external device 100 such as a PC card in the image processing apparatus 10. For example, in the case of a PC card, there are various types such as a flash memory card, a hard disk, a SCSI card, and a modem card.

通信インターフェース26は、画像処理装置10に、カメラなどの撮像装置や、ノート型やディスクトップ型のパーソナルコンピュータなど、各種の外部デバイス102を接続するためのインターフェースである。画像処理装置10と外部デバイス102との間の接続規格は、USBやRS232Cなどの有線規格を用いてもよいし、IrDAやBluethoothなどの無線規格を用いてもよい。   The communication interface 26 is an interface for connecting various types of external devices 102 such as an imaging device such as a camera or a notebook or desktop personal computer to the image processing apparatus 10. As a connection standard between the image processing apparatus 10 and the external device 102, a wired standard such as USB or RS232C may be used, or a wireless standard such as IrDA or Bluetooth may be used.

画面インターフェース28は、画像処理装置10に設けられている表示画面36のインターフェースである。表示画面36は、例えばLCD(Liquid Crystal Display)により構成されている。本実施形態では、この表示画面36には、例えば、印刷する画像をユーザが任意に選択するための縮小画像が表示される。また、この表示画面36は、タッチパネルで構成されており、ユーザが画像処理装置10に指示を入力するためのユーザインターフェースも兼ねている。   The screen interface 28 is an interface for a display screen 36 provided in the image processing apparatus 10. The display screen 36 is configured by, for example, an LCD (Liquid Crystal Display). In the present embodiment, for example, a reduced image for allowing the user to arbitrarily select an image to be printed is displayed on the display screen 36. The display screen 36 is composed of a touch panel, and also serves as a user interface for a user to input an instruction to the image processing apparatus 10.

装置制御部30は、RAM40と、印刷ヘッド42と、キャリッジ44と、紙送り機構46と、スキャナ48とに接続されており、これら印刷ヘッド42と、キャリッジ44と、紙送り機構46と、スキャナ48についての機械的な制御を行う。RAM40は、装置制御部30専用の揮発性記憶装置であり、装置制御部30が、これら機械的制御を行う上で必要なデータが一時的に格納される。この装置制御部30は、例えば、ASIC(Application Specific IC)により構成されている。   The apparatus control unit 30 is connected to a RAM 40, a print head 42, a carriage 44, a paper feed mechanism 46, and a scanner 48. The print head 42, the carriage 44, the paper feed mechanism 46, and a scanner. Mechanical control of 48 is performed. The RAM 40 is a volatile storage device dedicated to the device control unit 30 and temporarily stores data necessary for the device control unit 30 to perform these mechanical controls. The device control unit 30 is configured by, for example, an ASIC (Application Specific IC).

本実施形態においては、特に、装置制御部30は、印刷ヘッド42とキャリッジ44と紙送り機構46とを用いた印刷の全体的な制御を行う。すなわち、キャリッジ44に搭載された印刷ヘッド42から印刷インクを吐出させつつ、キャリッジ44を走査方向(紙送り方向と交差する方向)に交互に移動させながら紙などの印刷媒体に印刷を行う。紙送り機構46は、紙などの印刷媒体を、キャリッジ44による印刷に合わせて、紙送り方向に順次送り出すことにより、印刷媒体に対する印刷を行わせる。   In the present embodiment, in particular, the apparatus control unit 30 performs overall control of printing using the print head 42, the carriage 44, and the paper feed mechanism 46. That is, printing is performed on a print medium such as paper while ejecting printing ink from the print head 42 mounted on the carriage 44 and alternately moving the carriage 44 in the scanning direction (direction intersecting the paper feeding direction). The paper feed mechanism 46 performs printing on the print medium by sequentially feeding a print medium such as paper in the paper feed direction in accordance with printing by the carriage 44.

また、装置制御部30は、スキャナ48を用いた画像読み込み時の制御も行う。例えば、ユーザがスキャナ48の画像読み取り面にセットした原稿を、ラインイメージセンサを用いて読み込み、RAM44に画像データとして一時的に格納するための一連の処理の制御を行う。   The apparatus control unit 30 also performs control at the time of image reading using the scanner 48. For example, a document set on the image reading surface of the scanner 48 by a user is read using a line image sensor, and a series of processes for temporarily storing them as image data in the RAM 44 is controlled.

次に、図2及び図3に基づいて、本実施形態に係る画像処理装置10が実行する印刷実行処理について説明する。これら図2及び図3は、画像処理装置10が実行する印刷実行処理の一例を説明するためのフローチャートを示す図である。この印刷実行処理は、例えば、ROM22に格納されている印刷実行処理プログラムをCPU20が読み込んで実行することにより、実現される処理である。また、この印刷実行処理は、ユーザが画像処理装置10に、印刷を行う画像やレイアウトなどを指定して、印刷を指示した場合に、起動される処理である。   Next, a print execution process executed by the image processing apparatus 10 according to the present embodiment will be described with reference to FIGS. 2 and 3 are flowcharts for explaining an example of the print execution process executed by the image processing apparatus 10. This print execution process is realized by the CPU 20 reading and executing a print execution process program stored in the ROM 22, for example. The print execution process is started when the user designates an image to be printed, a layout, or the like to the image processing apparatus 10 and instructs printing.

まず、図2に示すように、画像処理装置10は、印刷ライン位置の初期化を行って、変数Nに1をセットする(ステップS10)。つまり、印刷ライン位置を、その印刷媒体のページの先頭に設定する。   First, as shown in FIG. 2, the image processing apparatus 10 initializes the print line position and sets 1 to a variable N (step S10). That is, the print line position is set to the top of the page of the print medium.

次に、画像処理装置10は、印刷ライン位置Nにある画像の画像ファイルを検索して取得する(ステップS12)。例えば、ユーザが印刷を指定した画像が、カード型外部デバイス100に格納されている場合には、画像処理装置10は、カード型外部デバイス100を検索して、ユーザの指定した画像の画像データを取得する。また、既にRAM34に画像データを読み込んでいる場合には、RAM34から印刷ライン位置Nにおける画像ファイルを取得する。なお、印刷ライン位置Nを印刷するのに複数の画像ファイルが必要であれば、必要なすべての画像ファイルを取得する。   Next, the image processing apparatus 10 searches for and acquires an image file of an image at the print line position N (step S12). For example, when an image designated for printing by the user is stored in the card-type external device 100, the image processing apparatus 10 searches the card-type external device 100 to obtain image data of the image designated by the user. get. If image data has already been read into the RAM 34, the image file at the print line position N is acquired from the RAM 34. If a plurality of image files are necessary to print the print line position N, all necessary image files are acquired.

次に、画像処理装置10は、ステップS12で取得した画像ファイルの印刷ライン位置Nにおける画像の解凍処理を行う(ステップS14)。この解凍処理についての詳細は、後述する。   Next, the image processing apparatus 10 performs image decompression processing at the print line position N of the image file acquired in step S12 (step S14). Details of the decompression process will be described later.

次に、画像処理装置10は、ユーザが赤目補正をするように指定しているかどうかを判断する(ステップS16)。ユーザが赤目補正をするように指定している場合(ステップS16:YES)には、画像処理装置10は、小さなサイズの赤目の位置を検出する処理を行う(ステップS17)。すなわち、本実施形態に係る画像処理装置10は、例えば、RAM34に数十ライン分の印刷データバッファを備えている。この印刷データバッファには、印刷する際に、元画像データを解凍したフルサイズの画像データが一時的に格納されるとともに、この画像データに基づいて画像処理装置10は印刷を行っていく。印刷が完了した画像データについては、消去され、或いは、新しい画像データが上書きされて、循環的に印刷データバッファの領域は使用される。本実施形態においては、このフルサイズの画像について数十ライン分のデータを、この印刷データバッファに保持しておき、印刷バッファに保持されている数十ライン分の画像に基づいて、小さいなサイズの赤目の位置を検出することとしている。換言すれば、数十ライン分のフルサイズの画像データに収まるサイズの赤目の位置を、ステップS17では検出する。   Next, the image processing apparatus 10 determines whether or not the user designates red-eye correction (step S16). When the user designates red-eye correction (step S16: YES), the image processing apparatus 10 performs processing for detecting the position of a small-sized red eye (step S17). That is, the image processing apparatus 10 according to the present embodiment includes, for example, a print data buffer for several tens of lines in the RAM 34. In the print data buffer, full-size image data obtained by decompressing the original image data is temporarily stored at the time of printing, and the image processing apparatus 10 performs printing based on the image data. The image data for which printing has been completed is erased or overwritten with new image data, and the print data buffer area is used cyclically. In the present embodiment, tens of lines of data for this full-size image is stored in this print data buffer, and the small size is based on the tens of lines of image stored in the print buffer. The position of the red eye is detected. In other words, in step S17, the position of the red eye having a size that can be accommodated in the full-size image data of several tens of lines is detected.

次に、画像処理装置10は、ステップS14で解凍することにより得られた画像について、赤目補正処理を行う(ステップS18)。すなわち、印刷データバッファに格納されている画像データに基づいて、赤目補正処理を行う。本実施形態では、画像処理装置10は、ステップS17で検出された赤目の位置に基づいて、赤目補正処理を行うとともに、後述する画像ファイル解凍処理のステップS84で検出された大きなサイズの赤目の位置に基づいても、赤目補正処理を行う。赤目補正処理を行った後の画像データは、再び、印刷データバッファに格納される。一方、赤目補正をするように指定されていない場合(ステップS16:NO)には、これらステップS17及びステップS18の処理をスキップする。   Next, the image processing apparatus 10 performs a red-eye correction process on the image obtained by decompressing in step S14 (step S18). That is, red-eye correction processing is performed based on image data stored in the print data buffer. In the present embodiment, the image processing apparatus 10 performs the red-eye correction process based on the position of the red eye detected in step S17, and the position of the large-sized red eye detected in step S84 of the image file decompression process described later. The red-eye correction process is also performed based on the above. The image data after the red-eye correction process is stored again in the print data buffer. On the other hand, when it is not designated to perform red-eye correction (step S16: NO), the processes of step S17 and step S18 are skipped.

次に、画像処理装置10は、ユーザが自動画像補正をするように指定しているかどうかを判断する(ステップS20)。ユーザが自動画像補正をするように指定している場合(ステップS20:YES)には、ステップS14で解凍することにより得られた画像について、自動画像補正を行う(ステップS22)。すなわち、印刷データバッファに格納されている画像データを用いて、画像全体の明度、彩度、輝度などについての統計情報を取得し、この統計情報に基づいて、これら明度、彩度、輝度のバランスを最適化する処理を行う。自動画像補正処理を行った後の画像データは、再び、印刷データバッファに格納される。一方、自動画像補正をするように指定されていない場合(ステップS20:NO)には、このステップS22の処理をスキップする。   Next, the image processing apparatus 10 determines whether or not the user designates automatic image correction (step S20). If the user designates automatic image correction (step S20: YES), automatic image correction is performed on the image obtained by decompressing in step S14 (step S22). That is, using the image data stored in the print data buffer, statistical information about the brightness, saturation, luminance, etc. of the entire image is acquired, and based on this statistical information, the balance of lightness, saturation, luminance is obtained. Process to optimize. The image data after the automatic image correction processing is stored again in the print data buffer. On the other hand, when the automatic image correction is not designated (step S20: NO), the process of step S22 is skipped.

次に、図3に示すように、画像処理装置10は、印刷データバッファに格納されている画像データを取得して、ユーザに指定されたサイズに画像サイズを変換し、この印刷データバッファとは別の領域に形成されている第2の印刷データバッファに格納する(ステップS30)。本実施形態においては、例えば、この第2の印刷データバッファも、RAM34に形成されている。続いて、画像処理装置10は、第2の印刷データバッファから得られた画像を指定されたレイアウトに配置する(ステップS32)。例えば、指定されたレイアウトにおいては、印刷ライン位置Nの走査方向に複数の画像が配置されている場合には、画像処理装置10は、これら複数の画像を指定されたレイアウトで配置する。   Next, as shown in FIG. 3, the image processing apparatus 10 acquires the image data stored in the print data buffer, converts the image size to a size designated by the user, and what is this print data buffer? The data is stored in the second print data buffer formed in another area (step S30). In the present embodiment, for example, the second print data buffer is also formed in the RAM 34. Subsequently, the image processing apparatus 10 arranges the image obtained from the second print data buffer in the designated layout (step S32). For example, in the designated layout, when a plurality of images are arranged in the scanning direction of the print line position N, the image processing apparatus 10 arranges the plurality of images in the designated layout.

次に、画像処理装置10は、ステップS32で得られた画像についてハーフトーン処理を行った上で(ステップS34)、印刷ライン位置Nの印刷を実行する(ステップS36)。すなわち、キャリッジ44を走査方向に移動して、印刷ライン位置Nの印刷を行う。   Next, the image processing apparatus 10 performs halftone processing on the image obtained in step S32 (step S34), and then executes printing at the print line position N (step S36). That is, the carriage 44 is moved in the scanning direction to perform printing at the print line position N.

次に、画像処理装置10は、変数Nに1を加算し(ステップS38)、変数Nが印刷媒体のページ長より長くなったかどうかを判断する(ステップS40)。すなわち、印刷媒体のページの最後まで印刷を行ったかどうかを判断する。変数Nが印刷媒体のページ長以下である場合(ステップS40:NO)には、上述したステップS12からを繰り返す。   Next, the image processing apparatus 10 adds 1 to the variable N (step S38), and determines whether the variable N is longer than the page length of the print medium (step S40). That is, it is determined whether printing has been performed to the end of the page of the print medium. If the variable N is less than or equal to the page length of the print medium (step S40: NO), the above-described steps S12 and after are repeated.

一方、変数Nが印刷媒体のページ長を越えていた場合(ステップS40:YES)、すなわち印刷媒体の最後まで印刷を終えた場合には、画像処理装置10は、この印刷実行処理を終了する。   On the other hand, if the variable N exceeds the page length of the print medium (step S40: YES), that is, if printing has been completed to the end of the print medium, the image processing apparatus 10 ends this print execution process.

次に、図4乃至図6に基づいて、本実施形態に係る画像処理装置10が実行する画像ファイル解凍処理について説明する。これら図4乃至図6は、画像処理装置10が実行する画像ファイル解凍処理の一例を説明するためのフローチャートを示す図である。この画像ファイル解凍処理は、例えば、ROM22に格納されている画像ファイル解凍処理プログラムをCPU20が読み込んで実行することにより、実現される処理である。また、この画像ファイル解凍処理は、上述した図2のステップS14で実行される処理である。   Next, an image file decompression process executed by the image processing apparatus 10 according to the present embodiment will be described with reference to FIGS. 4 to 6 are flowcharts for explaining an example of the image file decompression process executed by the image processing apparatus 10. This image file decompression processing is realized by the CPU 20 reading and executing an image file decompression processing program stored in the ROM 22, for example. The image file decompression process is a process executed in step S14 of FIG. 2 described above.

まず、図4に示すように、画像処理装置10は、印刷ライン位置Nが画像の先頭であるかどうかを判断する(ステップS50)。すなわち、印刷ライン位置Nに、画像の先頭となる部分が含まれているかどうかを判断する。印刷ライン位置Nが画像の先頭である場合(ステップS50:YES)には、ユーザによる印刷の指定が、自動画像補正又は赤目補正の少なくとも一方を行うように指定しているかどうかを判断する(ステップS52)。   First, as shown in FIG. 4, the image processing apparatus 10 determines whether or not the print line position N is the head of the image (step S50). That is, it is determined whether or not the print line position N includes a portion that is the head of the image. If the print line position N is the head of the image (step S50: YES), it is determined whether or not the user has specified printing to perform at least one of automatic image correction and red-eye correction (step S50). S52).

自動画像補正又は赤目補正のうちの少なくとも一方を行う指定になっている場合(ステップS52:YES)には、処理対象になっている画像の縮小画像が、キャッシュメモリに存在するかどうかを判断する(ステップS54)。例えば、本実施形態においては、RAM34にキャッシュメモリが形成されており、画像処理装置10は、このRAM34のキャッシュメモリの領域に、処理対象となっている画像の縮小画像が存在するかどうかを判断する。なお、印刷ライン位置Nに複数の画像が含まれている場合には、その複数の画像のすべての縮小画像が、キャッシュメモリに存在するかどうかを判断する。   If it is specified to perform at least one of automatic image correction and red-eye correction (step S52: YES), it is determined whether a reduced image of the image to be processed exists in the cache memory. (Step S54). For example, in the present embodiment, a cache memory is formed in the RAM 34, and the image processing apparatus 10 determines whether or not a reduced image of the image to be processed exists in the cache memory area of the RAM 34. To do. When a plurality of images are included in the print line position N, it is determined whether all reduced images of the plurality of images exist in the cache memory.

本実施形態においては、画像処理装置10は、CPU20の空き時間を利用して、カード型外部デバイス100に格納されている画像ファイルに基づいて、縮小画像を生成するよう設計されている。例えば、カード型外部デバイス100には、JPG等の形式で、元画像のデータである画像ファイルが格納されている。この画像ファイルに基づいて、例えば、QVGA(320×240ピクセル)のサイズの縮小画像を、順次生成して、キャッシュメモリに格納しておく。そして、表示画面36に縮小画像を表示する処理が発生した場合には、キャッシュメモリに格納されているQVGAサイズの縮小画像のデータを読み出して、そのまま表示に使えるようにしている。   In the present embodiment, the image processing apparatus 10 is designed to generate a reduced image based on an image file stored in the card-type external device 100 using the free time of the CPU 20. For example, the card type external device 100 stores an image file which is data of an original image in a format such as JPG. Based on this image file, for example, reduced images having a size of QVGA (320 × 240 pixels) are sequentially generated and stored in the cache memory. When a process of displaying a reduced image on the display screen 36 occurs, the QVGA size reduced image data stored in the cache memory is read out and used as it is for display.

このようにすることにより、表示画面36に縮小画像を表示する際に生じるユーザの待ち時間の短縮を図っている。特に、表示画面36に複数の縮小画像を並べて表示する場合、必要になった時点で、すべての縮小画像を元画像から生成すると、相応の処理時間がかかってしまう。このため、CPU20の空き時間を利用して、縮小画像を予め生成しておくことにより、縮小画像の一覧を表示し終えるのに要する時間を格段に短くすることができるのである。   In this way, the waiting time of the user that occurs when displaying the reduced image on the display screen 36 is reduced. In particular, when a plurality of reduced images are displayed side by side on the display screen 36, if all the reduced images are generated from the original image when necessary, it takes a considerable processing time. For this reason, the time required to finish displaying the list of reduced images can be significantly shortened by generating the reduced images in advance by using the free time of the CPU 20.

また、本実施形態では、CPU20が元画像から縮小画像を生成する際には、例えば、Bi−Linear法や、Bi−Cubic法による補間アルゴリズムを用いる。Bi−Linear法や、Bi−Cubic法は、縮小した画像を再度、同じ補間アルゴリズムを用いて拡大すると、縮小時に畳み込まれた画像情報が、再度取り出せる圧縮手法の一例である。無論、縮小時に失われた情報までもが、再現できる訳ではない。   In the present embodiment, when the CPU 20 generates a reduced image from the original image, for example, an interpolation algorithm based on the Bi-Linear method or the Bi-Cubic method is used. The Bi-Linear method and the Bi-Cubic method are examples of compression methods in which, when a reduced image is enlarged again using the same interpolation algorithm, image information convolved at the time of reduction can be extracted again. Of course, even information lost at the time of reduction cannot be reproduced.

ステップS54において、処理対象になっている画像の縮小画像が、キャッシュメモリに存在しないと判断した場合(ステップS54:NO)には、画像処理装置10は、処理対象の画像ファイルの解凍を行う(ステップS56)。例えば、ステップS12で取得した画像ファイルがJPG形式であった場合には、JPG形式の画像ファイルの解凍を行う。   If it is determined in step S54 that the reduced image of the image to be processed does not exist in the cache memory (step S54: NO), the image processing apparatus 10 decompresses the image file to be processed (step S54). Step S56). For example, if the image file acquired in step S12 is in the JPG format, the image file in the JPG format is decompressed.

次に、画像処理装置10は、ステップS56で得られた画像の縮小を行う(ステップS58)。すなわち、本実施形態では、ステップS56で得られた元画像を、QVGAサイズに縮小する。元画像を縮小する際には、例えば、上述したBi−Linear法や、Bi−Cubic法などの補間アルゴリズムを用いる。なお、1/2、1/4、1/8などの所定の圧縮率である場合には、ステップS56でJPG形式の画像を解凍する際に、圧縮された状態で解凍することも可能である。この場合、ステップS58は省略可能である。   Next, the image processing apparatus 10 reduces the image obtained in step S56 (step S58). That is, in the present embodiment, the original image obtained in step S56 is reduced to the QVGA size. When the original image is reduced, for example, an interpolation algorithm such as the above-described Bi-Linear method or Bi-Cubic method is used. If the compression rate is a predetermined compression rate such as 1/2, 1/4, or 1/8, it is possible to decompress the image in the compressed state when decompressing the image in the JPG format in step S56. . In this case, step S58 can be omitted.

次に、画像処理装置10は、生成したQVGAサイズの縮小画像を、キャッシュメモリに格納する(ステップS60)。すなわち、ステップS58で生成された縮小画像を、RAM34のキャッシュメモリの領域に格納する。   Next, the image processing apparatus 10 stores the generated QVGA size reduced image in the cache memory (step S60). That is, the reduced image generated in step S58 is stored in the cache memory area of the RAM 34.

次に、画像処理装置10は、処理対象となっているすべての画像の画像ファイルの解凍が終了したかどうかを判断する(ステップS62)。処理対象となっている画像の画像ファイルが複数の場合には、画像処理装置10は、処理対象となっているすべての画像の縮小画像が、キャッシュメモリに格納されているかどうかを判断する。   Next, the image processing apparatus 10 determines whether or not the decompression of the image files of all the images to be processed has been completed (step S62). When there are a plurality of image files of images to be processed, the image processing apparatus 10 determines whether or not reduced images of all the images to be processed are stored in the cache memory.

処理対象となっているすべての画像の画像ファイルの解凍が終了していないと判断した場合(ステップS62:NO)には、上述したステップS56に戻り、次の画像ファイルの解凍を続ける。   If it is determined that the decompression of the image files of all the images to be processed has not been completed (step S62: NO), the process returns to step S56 described above and the decompression of the next image file is continued.

一方、処理対象となっているすべての画像の画像ファイルの解凍が終了したと判断した場合(ステップS62:YES)、及び、処理対象のすべての画像の縮小画像がキャッシュメモリに格納されていると判断した場合(ステップS54:YES)には、画像処理装置10は、ユーザが自動画像補正を指定しているかどうかを判断する(ステップS64)。   On the other hand, when it is determined that the decompression of the image files of all the images to be processed has been completed (step S62: YES), and when the reduced images of all the images to be processed are stored in the cache memory. If it is determined (step S54: YES), the image processing apparatus 10 determines whether the user has designated automatic image correction (step S64).

ユーザが自動画像補正を指定している場合(ステップS64:YES)には、画像処理装置10は、キャッシュメモリに格納されているQVGAサイズの縮小画像に基づいて、顔認識処理を行う(ステップS66)。すなわち、人間の顔はある程度の大きさを備えているため、VGAサイズより小さいQVGAサイズの縮小画像を用いても精度良く認識することが可能であり、処理時間も短くすることができる。このため、本実施形態では、顔認識処理は、キャッシュメモリに格納されているQVGAサイズの縮小画像を用いて行うこととしている。   If the user designates automatic image correction (step S64: YES), the image processing apparatus 10 performs face recognition processing based on the QVGA size reduced image stored in the cache memory (step S66). ). In other words, since the human face has a certain size, it can be recognized with high accuracy even if a reduced image having a QVGA size smaller than the VGA size is used, and the processing time can be shortened. Therefore, in the present embodiment, the face recognition process is performed using a QVGA size reduced image stored in the cache memory.

次に、画像処理装置10は、認識された顔の画像の肌色が綺麗に見え、且つ、背景等も綺麗に見えるように色補正するためのパラメータを決定する(ステップS68)。すなわち、画像全体を統計的に計算することにより、明度、彩度、輝度のバランスを最適化するパラメータを決定する。この決定されたパラメータに基づいて、上述したステップS22では、自動画像補正処理を行う。   Next, the image processing apparatus 10 determines parameters for color correction so that the skin color of the recognized face image looks beautiful and the background and the like look beautiful (step S68). That is, a parameter that optimizes the balance of lightness, saturation, and luminance is determined by statistically calculating the entire image. Based on the determined parameters, automatic image correction processing is performed in step S22 described above.

次に、このステップS68の処理の後、又は、上述したステップS64でユーザが自動画像補正を指定していないと判断した場合(ステップS64:NO)には、画像処理装置10は、図5に示すように、ユーザが赤目補正を指定したかどうかを判断する(ステップS80)。   Next, after the process of step S68 or when it is determined in step S64 described above that the user has not designated automatic image correction (step S64: NO), the image processing apparatus 10 performs the process shown in FIG. As shown, it is determined whether the user has designated red-eye correction (step S80).

ユーザが赤目補正を指定したと判断した場合(ステップS80:YES)には、画像処理装置10は、キャッシュメモリに格納されているQVGAサイズの画像を取得して、この取得した画像に基づいて赤目の位置を検出する処理を行う(ステップS84)。すなわち、小さなサイズの画像を用いて、赤目の元画像に占める大きさの割合が、ステップS17で検出しようとしている赤目の元画像に占める大きさの割合よりも、大きい赤目を検出する。このステップS84で赤目が検出された場合には、検出された赤目の位置に基づいて、上述したステップS18で赤目補正処理を行う。すなわち、大きな赤目の位置については、このステップS84で検出し、この検出位置に基づいて、赤目補正処理を行う。   When it is determined that the user has designated red-eye correction (step S80: YES), the image processing apparatus 10 acquires a QVGA size image stored in the cache memory, and based on the acquired image, the red-eye is acquired. The process of detecting the position of is performed (step S84). That is, using a small-sized image, a red eye whose ratio of the size occupied in the original red-eye image is larger than the ratio of the size occupied in the original red-eye image to be detected in step S17 is detected. When red eye is detected in step S84, red eye correction processing is performed in step S18 described above based on the detected red eye position. That is, the position of a large red eye is detected in step S84, and the red eye correction process is performed based on the detected position.

なお、ステップS84で大きな赤目が検出され、且つ、ステップS17でも小さな赤目が検出された場合には、ステップS18では、双方の位置にある赤目について補正処理を行う。また、ステップS84で検出された赤目の位置とステップS17で検出された赤目の位置が同じ場合もあり得る。つまり、ステップS17とステップS84で、同じ赤目を検出することもあり得る。この場合、ステップS18では、双方の位置に基づいて赤目補正をするようにしてもよいし、或いは、どちらか一方の位置に基づいて赤目補正をするようにしてもよい。   If a large red eye is detected in step S84 and a small red eye is detected in step S17, correction processing is performed for red eyes in both positions in step S18. In addition, the position of the red eye detected in step S84 may be the same as the position of the red eye detected in step S17. That is, the same red eye may be detected in step S17 and step S84. In this case, in step S18, red-eye correction may be performed based on both positions, or red-eye correction may be performed based on one of the positions.

このステップS84の処理の後、又は、上述したステップS80で赤目補正が指定されていないと判断した場合(ステップS80:NO)、又は、上述したステップS52で自動画像補正及び赤目補正のいずれも指定されていないと判断した場合(ステップS52:NO)には、画像処理装置10は、処理対象の画像が回転(ローテート)を必要とする画像であるかどうかを判断する(ステップS86)。すなわち、画像によっては、例えば、時計回り方向又は反時計回り方向に90度回転して、印刷する必要があるので、そのような指定がなされているかどうかを判断する。   After the process of step S84, or when it is determined that red-eye correction is not specified in step S80 described above (step S80: NO), or in the above-described step S52, both automatic image correction and red-eye correction are specified. If it is determined that the image has not been processed (step S52: NO), the image processing apparatus 10 determines whether the image to be processed is an image that requires rotation (rotation) (step S86). That is, depending on the image, for example, it is necessary to print by rotating 90 degrees clockwise or counterclockwise, so it is determined whether or not such designation is made.

処理対象の画像が回転を必要とする画像である場合(ステップS86:YES)には、画像処理装置10は、ローテート情報マップを作成する(ステップS88)。次に、画像処理装置10は、画像内で解凍処理が済んだ位置を特定するためのファイルポインタをリセットする(ステップS90)。   If the image to be processed is an image that requires rotation (step S86: YES), the image processing apparatus 10 creates a rotate information map (step S88). Next, the image processing apparatus 10 resets the file pointer for specifying the position where the decompression process has been completed in the image (step S90).

このステップS90の後、又は、上述したステップS86で画像の回転がないと判断した場合(ステップS86:NO)、又は、上述したステップS50で印刷ライン位置Nに画像の先頭が含まれていないと判断した場合(ステップS50:NO)には、画像処理装置10は、印刷データバッファに、印刷ライン位置Nの画像データがあるかどうかを判断する(ステップS92)。すなわち、解凍を終えた印刷ライン位置Nのフルサイズの画像データが、印刷データバッファにあるかどうかを判断する。なお、本実施形態においては、上述したように印刷データバッファは、RAM34に形成されており、その大きさは、例えばフルサイズの画像の数十ライン分である。また、印刷ライン位置Nに複数の画像がある場合には、これらすべての画像の画像データが、印刷データバッファにあるかどうかを判断する。   After step S90, or when it is determined in step S86 described above that there is no image rotation (step S86: NO), or if the print line position N does not include the beginning of the image in step S50 described above. If it is determined (step S50: NO), the image processing apparatus 10 determines whether there is image data at the print line position N in the print data buffer (step S92). That is, it is determined whether the full-size image data at the print line position N that has been decompressed is in the print data buffer. In this embodiment, as described above, the print data buffer is formed in the RAM 34, and its size is, for example, several tens of lines of a full-size image. If there are a plurality of images at the print line position N, it is determined whether the image data of all these images is in the print data buffer.

印刷データバッファに印刷ライン位置Nの画像データがないと判断した場合(ステップS92:NO)には、画像処理装置10は、ハフマンテーブル、量子化テーブルを用いて、印刷ライン位置Nの画像データについて、ハフマン解凍を行い(ステップS94)、逆量子化を行う(ステップS96)。そして、画像処理装置10は、さらに、逆DCT(Discrete Cosine Transform)変換を行い(ステップS98)、YCCの色空間で定義されている画像データを、RGBの色空間の定義に変換する(ステップS100)。そして、画像処理装置10は、得られた画像データを、RAM34に形成されている印刷データバッフに格納する(ステップS102)。このステップS102で格納する画像データが、フルサイズの画像データであり、上述したステップS17で、元画像に占める相対的な割合が小さい赤目を検出するために用いられる。   If it is determined that there is no image data at the print line position N in the print data buffer (step S92: NO), the image processing apparatus 10 uses the Huffman table and the quantization table for the image data at the print line position N. Huffman decompression is performed (step S94), and inverse quantization is performed (step S96). Then, the image processing apparatus 10 further performs inverse DCT (Discrete Cosine Transform) conversion (step S98), and converts the image data defined in the YCC color space into the definition of the RGB color space (step S100). ). Then, the image processing apparatus 10 stores the obtained image data in a print data buffer formed in the RAM 34 (step S102). The image data stored in step S102 is full-size image data, and is used to detect red eyes with a relatively small proportion of the original image in step S17 described above.

次に、画像処理装置10は、図6に示すように、処理対象の画像が回転(ローテート)を必要とする画像であるかどうかを判断する(ステップS110)。処理対象の画像が回転を必要とする画像である場合(ステップS110:YES)には、画像処理装置10は、ローテート情報マップを更新する(ステップS112)。一方、処理対象の画像が回転を必要とする画像でない場合(ステップS110:NO)には、このステップS112の処理はスキップする。   Next, as shown in FIG. 6, the image processing apparatus 10 determines whether or not the image to be processed is an image that requires rotation (rotation) (step S110). If the image to be processed is an image that requires rotation (step S110: YES), the image processing apparatus 10 updates the rotate information map (step S112). On the other hand, if the image to be processed is not an image that requires rotation (step S110: NO), the process of step S112 is skipped.

次に、画像処理装置10は、画像内で解凍処理が済んだ位置を特定するためのファイルポインタを更新し、セーブしておく(ステップS114)。   Next, the image processing apparatus 10 updates and saves the file pointer for specifying the position where the decompression process has been completed in the image (step S114).

このステップS114の後、又は、上述したステップS92で印刷データバッファに印刷ライン位置Nの画像データが存在すると判断した場合(ステップS92:YES)には、画像処理装置10は、印刷データバッファから印刷ライン位置Nの画像データを取得する(ステップS116)。   After step S114, or when it is determined in step S92 described above that image data at the print line position N exists in the print data buffer (step S92: YES), the image processing apparatus 10 prints from the print data buffer. Image data at the line position N is acquired (step S116).

次に、画像処理装置10は、印刷ライン位置Nが、処理対象の画像の最後の位置であるかどうかを判断する(ステップS118)。すなわち、印刷ライン位置Nに処理対象の画像の最後の位置が含まれているかどうかを判断する。印刷ライン位置Nが処理対象の画像の最後の位置である場合(ステップS118:YES)には、この解凍処理をしていた画像ファイルをクローズし、解凍処理を行うために取得していたハフマンテーブル及び量子化テーブルを解放する(ステップS120)。一方、印刷ライン位置Nが処理対象の画像の最後の位置ではない場合(ステップS118:NO)には、画像処理装置10は、このステップS120をスキップする。   Next, the image processing apparatus 10 determines whether the print line position N is the last position of the image to be processed (step S118). That is, it is determined whether or not the print line position N includes the last position of the image to be processed. When the print line position N is the last position of the image to be processed (step S118: YES), the Huffman table acquired for performing the decompression process is closed by closing the image file that has undergone the decompression process. Then, the quantization table is released (step S120). On the other hand, when the print line position N is not the last position of the image to be processed (step S118: NO), the image processing apparatus 10 skips step S120.

これにより、本実施形態に係る画像ファイル解凍処理が終了する。すなわち、印刷実行処理のステップS14が終了する。   Thereby, the image file decompression process according to the present embodiment is completed. That is, step S14 of the print execution process ends.

以上のように、本実施形態に係る画像処理装置10によれば、QVGAサイズの画像に基づいて、元画像に対して大きな割合を占める大サイズの赤目の位置を検出するための第1の赤目位置検出処理を行い、印刷時のフルサイズの画像に基づいて、元画像に対して小さな割合しか占めない小サイズの赤目の位置を検出するための第2の赤目位置検出処理を行うこととした。このように赤目の位置検出を二段階で行うことにより、赤目の位置検出の精度を向上させることができる。   As described above, according to the image processing apparatus 10 according to the present embodiment, the first red eye for detecting the position of the large-sized red eye that occupies a large proportion of the original image based on the QVGA-sized image. The position detection process is performed, and the second red-eye position detection process is performed to detect the position of a small-sized red eye that occupies only a small percentage of the original image based on the full-size image at the time of printing. . Thus, the accuracy of red-eye position detection can be improved by performing red-eye position detection in two stages.

また、小さなサイズの赤目を検出するための処理は、印刷時に生成されるフルサイズの画像データに基づいて行うこととしたため、小さなサイズの赤目を検出するために元画像のデータを別途解凍する必要はない。このため、画像処理装置10の処理負荷の増大を回避できるとともに、ユーザの印刷待ち時間が長くなってしまうという問題も避けることができる。   In addition, since the processing for detecting small-sized red eyes is performed based on the full-size image data generated during printing, it is necessary to decompress the original image data separately in order to detect small-sized red eyes. There is no. For this reason, an increase in the processing load of the image processing apparatus 10 can be avoided, and the problem that the user's print waiting time becomes long can be avoided.

さらに、印刷時に生成されるフルサイズの画像を格納するための印刷データバッファも、数十ライン分程度確保すれば、小さな赤目を検出するという目的を達成できる。これは、フルサイズの画像を用いる際には小さな赤目を検出することを目的としており、大きな赤目についてはQVGAサイズの画像を用いて既に検出されていることを前提としているためである。このため、メモリ容量の浪費を抑制することができる。   Furthermore, if a print data buffer for storing a full-size image generated at the time of printing is secured for several tens of lines, the object of detecting small red eyes can be achieved. This is because when a full-size image is used, the purpose is to detect a small red eye, and it is assumed that a large red eye has already been detected using a QVGA size image. For this reason, waste of memory capacity can be suppressed.

具体的に、大きなサイズの赤目の位置検出にQVGAサイズの画像を用いる場合における、小さなサイズの赤目の位置検出に必要な印刷データバッファの大きさを計算してみる。印刷媒体のサイズがA4のときの画像データは、約3000×4000ピクセルであり、QVGAサイズの画像に換算すると、およそ13×13個分、配列される。QVGAサイズの画像で検出される最小の赤目の大きさが2×2ピクセルであると仮定すると、(13×2)×(13×2)=26×26ピクセル以下の赤目が、QVGAサイズの画像では未検出であると推定できる。したがって、縦26ライン分の印刷バッファメモリを確保すれば、QVGAサイズの赤目位置検出で取りこぼした小さいサイズの赤目を、ステップS17で検出することができるようになる。   Specifically, when a QVGA size image is used for detecting the position of a large red eye, the size of the print data buffer necessary for detecting the position of the small red eye is calculated. The image data when the size of the print medium is A4 is about 3000 × 4000 pixels. When converted into a QVGA size image, approximately 13 × 13 are arranged. Assuming that the minimum red-eye size detected in a QVGA size image is 2 × 2 pixels, a red eye of (13 × 2) × (13 × 2) = 26 × 26 pixels or less is a QVGA size image. Then, it can be estimated that it has not been detected. Therefore, if the print buffer memory for 26 lines in the vertical direction is secured, it is possible to detect the small-sized red eye missed in the red eye position detection of the QVGA size in step S17.

この場合の印刷バッファメモリの容量は、3000ピクセル×26ライン×3となり、これは、およそ229KBとなる。この容量は、VGAサイズの画像を保持するために必要な容量である約900KBより、大幅に少ない。   In this case, the capacity of the print buffer memory is 3000 pixels × 26 lines × 3, which is approximately 229 KB. This capacity is significantly less than about 900 KB, which is the capacity required to hold VGA size images.

また、大きな赤目を検出するために用いるQVGAサイズの画像は、CPU20の空き時間を利用して、キャッシュメモリに既に格納されている可能性があり、キャッシュメモリにQVGAサイズの画像が格納されている場合には、新たにQVGAサイズの縮小画像を生成する必要はなく、大きな赤目検出に要する処理時間の増大を回避することができる。   Further, the QVGA size image used for detecting the large red eye may be already stored in the cache memory using the free time of the CPU 20, and the QVGA size image is stored in the cache memory. In this case, it is not necessary to newly generate a reduced image of QVGA size, and an increase in processing time required for large red-eye detection can be avoided.

また、キャッシュメモリにQVGAサイズの画像が格納されていない場合には、元画像に基づいて、QVGAサイズの画像を生成することになるが、このQVGAサイズの画像は、自動画像補正処理をする際にも必要となる画像であるため、大きなサイズの赤目を検出するためだけに、QVGAサイズの画像生成するという事態が生じるのを極力避けることができる。   In addition, when the QVGA size image is not stored in the cache memory, a QVGA size image is generated based on the original image. This QVGA size image is subjected to automatic image correction processing. Therefore, it is possible to avoid as much as possible the occurrence of a QVGA size image only for detecting a large-sized red eye.

なお、本発明は上記実施形態に限定されず種々に変形可能である。例えば、上述した実施形態では、キャッシュメモリに格納される画像のサイズが320×240ピクセルのQVGAである場合を例に説明したが、この画像のサイズは、これに限定されるものではない。   In addition, this invention is not limited to the said embodiment, It can deform | transform variously. For example, in the above-described embodiment, the case where the size of an image stored in the cache memory is 320 × 240 pixels is described as an example, but the size of the image is not limited to this.

また、上述した実施形態では、画像を縮小する補間アルゴリズムとして、Bi−Linear法、Bi−Cubic法を用いた例を説明したが、他の補間アルゴリズムを用いて画像を縮小することもできる。例えば、単純間引きによる手法で、元画像から縮小画像を生成するようにしてもよい。ここで、単純間引きとは、例えば、元画像を構成するピクセルをふるいにかけて、10ピクセル毎に抽出するような縮小手法である。   In the above-described embodiment, the example using the Bi-Linear method and the Bi-Cubic method has been described as the interpolation algorithm for reducing the image. However, the image can be reduced using another interpolation algorithm. For example, a reduced image may be generated from the original image by a simple thinning method. Here, the simple thinning is a reduction method in which, for example, the pixels constituting the original image are screened and extracted every 10 pixels.

さらに、上述した実施形態では、大きな赤目の位置を検出する処理と、小さな赤目の位置を検出する処理の双方を行うようにしたが、小さな赤目の位置を検出する処理は選択的な処理としてもよい。例えば、印刷モードが通常モードである場合には、小さな赤目の位置を検出する処理は実行せず、印刷モードが高精細モードである場合には、小さな赤目の位置を検出する処理も実行するようにしてもよい。   Further, in the above-described embodiment, both the processing for detecting the position of the large red eye and the processing for detecting the position of the small red eye are performed. However, the processing for detecting the position of the small red eye may be performed as a selective processing. Good. For example, when the print mode is the normal mode, the process for detecting the position of the small red eye is not executed, and when the print mode is the high-definition mode, the process for detecting the position of the small red eye is also executed. It may be.

さらに、上述の実施形態で説明した印刷実行処理及び画像ファイル解凍処理については、これら各処理を実行するためのプログラムをフレキシブルディスク、CD−ROM(Compact Disc-Read Only Memory)、ROM、メモリカード等の記録媒体に記録して、記録媒体の形で頒布することが可能である。この場合、この記録媒体に記録されたプログラムを画像処理装置10に読み込ませ、実行させることにより、上述した実施形態を実現することができる。   Further, for the print execution process and the image file decompression process described in the above-described embodiment, a program for executing these processes is a flexible disk, a CD-ROM (Compact Disc-Read Only Memory), a ROM, a memory card, etc. It is possible to record on the recording medium and distribute in the form of the recording medium. In this case, the above-described embodiment can be realized by causing the image processing apparatus 10 to read and execute the program recorded on the recording medium.

また、画像処理装置10は、オペレーティングシステムや別のアプリケーションプログラム等の他のプログラムを備える場合がある。この場合、画像処理装置10の備える他のプログラムを活用するために、その画像処理装置10が備えるプログラムの中から、上述した実施形態と同等の処理を実現するプログラムを呼び出すような命令を含むプログラムを、記録媒体に記録するようにしてもよい。   The image processing apparatus 10 may include other programs such as an operating system or another application program. In this case, in order to utilize another program included in the image processing apparatus 10, a program including an instruction for calling a program that realizes processing equivalent to the above-described embodiment from among the programs included in the image processing apparatus 10 May be recorded on a recording medium.

さらに、このようなプログラムは、記録媒体の形ではなく、ネットワークを通じて搬送波として頒布することも可能である。ネットワーク上を搬送波の形で伝送されたプログラムは、画像処理装置10に取り込まれて、このプログラムを実行することにより上述した実施形態を実現することができる。   Furthermore, such a program can be distributed not as a recording medium but as a carrier wave through a network. The program transmitted in the form of a carrier wave on the network is taken into the image processing apparatus 10, and the above-described embodiment can be realized by executing this program.

また、記録媒体にプログラムを記録する際や、ネットワーク上を搬送波として伝送される際に、プログラムの暗号化や圧縮化がなされている場合がある。この場合には、これら記録媒体や搬送波からプログラムを読み込んだ画像処理装置10は、そのプログラムの復号や伸張を行った上で、実行する必要がある。   Also, when a program is recorded on a recording medium or transmitted as a carrier wave on a network, the program may be encrypted or compressed. In this case, the image processing apparatus 10 that has read the program from the recording medium or the carrier wave needs to execute the program after decoding or decompressing the program.

また、上述した実施形態では、印刷実行処理及び画像ファイル解凍処理をソフトウェアにより実現する場合を例に説明したが、これらの各処理をASIC(Application Specific IC)などのハードウェアにより実現するようにしてもよい。さらには、これらの各処理を、ソフトウェアとハードウェアとが協働して実現するようにしてもよい。   In the above-described embodiment, the case where the print execution process and the image file decompression process are realized by software has been described as an example. However, each of these processes is realized by hardware such as an ASIC (Application Specific IC). Also good. Furthermore, each of these processes may be realized by cooperation of software and hardware.

本実施形態に係る画像処理装置の内部構成の一例を説明するブロック図。FIG. 2 is a block diagram illustrating an example of an internal configuration of the image processing apparatus according to the present embodiment. 本実施形態に係る画像処理装置で実行される印刷実行処理の一例を説明するフローチャートを示す図(その1)。FIG. 6 is a first flowchart illustrating a flowchart for explaining an example of a print execution process executed by the image processing apparatus according to the present embodiment; 本実施形態に係る画像処理装置で実行される印刷実行処理の一例を説明するフローチャートを示す図(その2)。FIG. 8 is a second flowchart illustrating a flowchart for explaining an example of a print execution process executed by the image processing apparatus according to the present embodiment; 本実施形態に係る画像処理装置で実行される画像ファイル解凍処理の一例を説明するフローチャートを示す図(その1)。FIG. 6 is a flowchart (part 1) illustrating an example of an image file decompression process executed by the image processing apparatus according to the present embodiment. 本実施形態に係る画像処理装置で実行される画像ファイル解凍処理の一例を説明するフローチャートを示す図(その2)。FIG. 9 is a second flowchart illustrating a flowchart for explaining an example of an image file decompression process executed by the image processing apparatus according to the present embodiment; 本実施形態に係る画像処理装置で実行される画像ファイル解凍処理の一例を説明するフローチャートを示す図(その3)。FIG. 9 is a third flowchart illustrating a flowchart for explaining an example of an image file decompression process performed by the image processing apparatus according to the present embodiment;

符号の説明Explanation of symbols

10 画像処理装置
20 CPU
22 ROM
24 カードインターフェース
26 通信インターフェース
28 画面インターフェース
30 装置制御部
32 内部バス
34 RAM
40 RAM
42 印刷ヘッド
44 キャリッジ
46 紙送り機構
48 スキャナ
100 カード型外部デバイス
102 外部デバイス
10 Image processing device 20 CPU
22 ROM
24 Card interface 26 Communication interface 28 Screen interface 30 Device control unit 32 Internal bus 34 RAM
40 RAM
42 Print head 44 Carriage 46 Paper feed mechanism 48 Scanner 100 Card type external device 102 External device

Claims (7)

元画像を縮小することにより、縮小画像を生成する、縮小画像生成手段と、
前記縮小画像に基づいて、赤目の位置を検出するための処理を行う、第1赤目位置検出手段と、
元画像に基づいて画像の印刷をするために、印刷用の画像データの一部を一時的に印刷データ記憶装置に格納する、格納実行手段と、
前記印刷データ記憶装置に格納されている画像データに基づいて、赤目の位置を検出するための処理を行う、第2赤目位置検出手段と、
前記第1赤目位置検出手段及び前記第2赤目位置検出手段とで検出された赤目の位置に基づいて赤目補正を行う、赤目補正手段と、
を備えることを特徴とするプリンタ。
Reduced image generation means for generating a reduced image by reducing the original image;
First red-eye position detecting means for performing processing for detecting the position of the red-eye based on the reduced image;
Storage executing means for temporarily storing a part of image data for printing in a print data storage device in order to print an image based on the original image;
Second red-eye position detecting means for performing processing for detecting the position of red-eye based on image data stored in the print data storage device;
Red-eye correction means for performing red-eye correction based on the red-eye position detected by the first red-eye position detection means and the second red-eye position detection means;
A printer comprising:
前記第1赤目位置検出手段で検出する赤目の元画像に占める大きさの割合は、前記第2赤目位置検出手段で検出する赤目の元画像に占める大きさの割合よりも、大きい、ことを特徴とする請求項1に記載のプリンタ。   The ratio of the size of the red-eye original image detected by the first red-eye position detecting unit is larger than the ratio of the size of the red-eye original image detected by the second red-eye position detecting unit. The printer according to claim 1. 前記縮小画像生成手段は、CPUの空き時間を用いて前記縮小画像を予め生成して縮小画像記憶装置に格納しておき、
前記第1赤目位置検出手段は、前記縮小画像記憶装置から、この縮小画像を取得して、赤目の位置を検出するための処理を行う、
ことを特徴とする請求項1又は請求項2に記載のプリンタ。
The reduced image generation means generates the reduced image in advance using the CPU idle time and stores it in the reduced image storage device,
The first red-eye position detecting unit acquires the reduced image from the reduced image storage device and performs a process for detecting the position of the red eye.
The printer according to claim 1, wherein the printer is a printer.
前記縮小画像記憶装置に格納されている縮小画像を読み出して、表示画面に表示する、縮小画像表示手段を、さらに備えることを特徴とする請求項3に記載のプリンタ。   4. The printer according to claim 3, further comprising reduced image display means for reading a reduced image stored in the reduced image storage device and displaying the reduced image on a display screen. 前記格納実行手段は、元画像のデータから得られたフルサイズの画像データを、印刷用の画像データとして、前記印刷データ記憶装置に格納する、請求項1乃至請求項4のいずれかに記載のプリンタ。   5. The storage execution unit according to claim 1, wherein full-size image data obtained from original image data is stored in the print data storage device as image data for printing. Printer. 前記赤目補正手段で赤目補正をした後に、その画像の印刷を行う、印刷実行手段を、さらに備えることを特徴とする請求項1乃至請求項5のいずれかに記載のプリンタ。   6. The printer according to claim 1, further comprising: a print execution unit that prints the image after correcting the red eye by the red eye correction unit. 元画像を縮小することにより、縮小画像を生成する工程と、
前記縮小画像に基づいて、赤目の位置を検出するための処理を行う工程と、
元画像に基づいて画像の印刷をするために、印刷用の画像データの一部を一時的に印刷データ記憶装置に格納する工程と、
前記印刷データ記憶装置に格納されている画像データに基づいて、赤目の位置を検出するための処理を行う工程と、
前記縮小画像に基づいて検出された赤目の位置と、前記印刷データ記憶装置に格納されている画像データに基づいて検出された赤目の位置とに基づいて、赤目補正を行う工程と、
を備えることを特徴とするプリンタの制御方法。
Generating a reduced image by reducing the original image; and
Performing a process for detecting the position of the red eye based on the reduced image;
Temporarily printing a part of image data for printing in a print data storage device to print an image based on the original image;
Performing a process for detecting the position of the red eye based on the image data stored in the print data storage device;
Performing red-eye correction based on the red-eye position detected based on the reduced image and the red-eye position detected based on the image data stored in the print data storage device;
A printer control method comprising:
JP2007302944A 2007-11-22 2007-11-22 Printer and its control method Withdrawn JP2009130590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007302944A JP2009130590A (en) 2007-11-22 2007-11-22 Printer and its control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007302944A JP2009130590A (en) 2007-11-22 2007-11-22 Printer and its control method

Publications (1)

Publication Number Publication Date
JP2009130590A true JP2009130590A (en) 2009-06-11

Family

ID=40821085

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007302944A Withdrawn JP2009130590A (en) 2007-11-22 2007-11-22 Printer and its control method

Country Status (1)

Country Link
JP (1) JP2009130590A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012533922A (en) * 2009-07-17 2012-12-27 サムスン エレクトロニクス カンパニー リミテッド Video processing method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012533922A (en) * 2009-07-17 2012-12-27 サムスン エレクトロニクス カンパニー リミテッド Video processing method and apparatus
US8934025B2 (en) 2009-07-17 2015-01-13 Samsung Electronics Co., Ltd. Method and apparatus for processing image

Similar Documents

Publication Publication Date Title
JP5213687B2 (en) Image processing apparatus and control method thereof
US20120033236A1 (en) Controlling device
JP4532917B2 (en) Printing system, imaging apparatus, and control method of imaging apparatus
US9176935B2 (en) Image forming apparatus capable of displaying print preview on screen
JP4968888B2 (en) Printing system, imaging apparatus, control method therefor, program, and storage medium
JP4112187B2 (en) Image processing method, apparatus, and program
WO2000015442A1 (en) Printer, image processing device, image processing method, and recording medium
JP2006325186A (en) Image processing apparatus
US8125680B2 (en) Image processing apparatus and control method thereof
JP4136825B2 (en) Image processing apparatus, image processing method, computer-readable storage medium storing program, and program
JP2009130590A (en) Printer and its control method
JP2007201935A (en) Control method of image processing apparatus, and image processing apparatus
US11301975B2 (en) Apparatus, control method, and storage medium
US8125682B2 (en) Image processing apparatus and method of controlling the same
JP5441676B2 (en) Image processing apparatus and processing method thereof
JP2009128990A (en) Image processor and its control method
US20040257611A1 (en) Print order receipt unit
JP2007215001A (en) Unit, system, and method for processing image
US11314995B2 (en) Image processing apparatus, image processing method, and storage medium
JP2008213406A (en) Printing processor, printing processing method, and its program
JP6008770B2 (en) Image forming apparatus
JP5200890B2 (en) Image processing apparatus and control method thereof
JP2004112303A (en) Image processing method, image processor, and image processing system
JP2009060486A (en) Image processor and printer having the same, and method of processing image
JP4821576B2 (en) Information processing apparatus and information processing method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20110201