[go: up one dir, main page]

JP6350362B2 - Computer program and image processing apparatus - Google Patents

Computer program and image processing apparatus Download PDF

Info

Publication number
JP6350362B2
JP6350362B2 JP2015071026A JP2015071026A JP6350362B2 JP 6350362 B2 JP6350362 B2 JP 6350362B2 JP 2015071026 A JP2015071026 A JP 2015071026A JP 2015071026 A JP2015071026 A JP 2015071026A JP 6350362 B2 JP6350362 B2 JP 6350362B2
Authority
JP
Japan
Prior art keywords
image
image data
computer program
edge
contour
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.)
Active
Application number
JP2015071026A
Other languages
Japanese (ja)
Other versions
JP2016192646A (en
Inventor
圭佑 藤田
圭佑 藤田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2015071026A priority Critical patent/JP6350362B2/en
Publication of JP2016192646A publication Critical patent/JP2016192646A/en
Application granted granted Critical
Publication of JP6350362B2 publication Critical patent/JP6350362B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Description

本明細書は、原稿を光学的に読み取ることによって生成される画像データに対して補正処理を実行する画像処理に関する。   The present specification relates to image processing for executing correction processing on image data generated by optically reading a document.

特許文献1には、スキャナを用いて原稿を読み取って得られた画像データに対して下地を除去する処理を行う技術が開示されている。この技術では、原稿種別およびユーザからの指示に基づいて、下地を除去するか否かを判断し、下地を除去すると判定された場合には、下地を除去する処理が実行される。   Japanese Patent Application Laid-Open No. 2004-228561 discloses a technique for performing a process of removing a background on image data obtained by reading a document using a scanner. In this technique, it is determined whether or not the background is to be removed based on the document type and the instruction from the user. If it is determined that the background is to be removed, processing for removing the background is executed.

特開2008−205652号公報JP 2008-205652 A

しかしながら、上記技術では、画像データに対して、下地を除去する処理が実行された場合に、下地とは異なる文字などのオブジェクト内の画素の値が変更される可能性があった。この場合には、例えば、下地を除去する処理によって、意図しないオブジェクトが画像から除去されてしまう不具合が発生し得る。このような課題は、下地を除去する処理に限らず、画像内の画素の値を変更する補正処理に共通する課題であった。   However, in the above technique, when the process of removing the background is executed on the image data, there is a possibility that the value of the pixel in the object such as a character different from the background is changed. In this case, for example, there may be a problem that an unintended object is removed from the image by the process of removing the background. Such a problem is not limited to the process of removing the background, but is a problem common to the correction process of changing the value of the pixel in the image.

本明細書は、原稿を光学的に読み取ることによって生成される画像データに対して、画素の値を変更する補正処理を行う際に、意図しないオブジェクト内の画素の値が変更されることに起因する不具合を低減できる技術を開示する。   This specification is based on the fact that an unintended pixel value in an object is changed when a correction process for changing the pixel value is performed on image data generated by optically reading a document. Disclosed is a technology that can reduce the malfunctions.

本明細書に開示された技術は、以下の適用例として実現することが可能である。   The technology disclosed in this specification can be implemented as the following application examples.

[適用例1]特定範囲内の階調値を有する複数個の画素を含む第1のオブジェクトと、前記第1のオブジェクトとは異なる第2のオブジェクトであって前記特定範囲外の階調値を有する複数個の画素を含む前記第2のオブジェクトと、を含む元画像を表す元画像データであって、原稿を光学的に読み取ることによって生成される、前記元画像データを取得する取得機能と、前記元画像データに対して特定の補正処理を実行することによって、前記第2のオブジェクトを含む補正済画像を表す補正済画像データを生成する補正機能であって、前記特定の補正処理は、前記特定範囲内の階調値を有する画素の値を、特定の階調値に変更する処理である、前記補正機能と、前記元画像データを用いて、前記元画像内の前記第1のオブジェクトの輪郭を抽出する抽出機能と、前記補正済画像データを用いて、出力画像を表す出力画像データを生成する生成機能であって、前記出力画像は、前記第1のオブジェクトの輪郭を示す輪郭画像と、前記補正済画像内の前記第2のオブジェクトと、を含む、前記生成機能と、前記出力画像データを出力する出力機能と、をコンピュータに実現させるコンピュータプログラム。 [Application Example 1] A first object including a plurality of pixels having gradation values within a specific range, and a second object different from the first object and having gradation values outside the specific range. An original image data representing an original image including the second object including a plurality of pixels, and an acquisition function for acquiring the original image data generated by optically reading a document; A correction function for generating corrected image data representing a corrected image including the second object by executing a specific correction process on the original image data, wherein the specific correction process includes: Using the correction function and the original image data, which is a process of changing the value of a pixel having a gradation value within a specific range to a specific gradation value, the first object in the original image Contour An extraction function for extracting, and a generation function for generating output image data representing an output image using the corrected image data, wherein the output image includes a contour image indicating a contour of the first object; A computer program that causes a computer to realize the generation function including the second object in the corrected image and an output function for outputting the output image data.

上記構成によれば、特定範囲内の階調値を有する画素を含む第1のオブジェクトの輪郭を示す輪郭画像と、補正済画像と、が合成された出力画像を表す出力画像データが出力される。この結果、特定の補正処理によって色が変更される第1のオブジェクトと、補正済画像に含まれる第2のオブジェクトと、をユーザが区別して認識できる出力画像を、ユーザに提供することができる。この結果、特定の補正処理によって意図しないオブジェクト内の画素の値が変更されることに起因する不具合を低減できる。   According to the above configuration, output image data representing an output image obtained by combining the contour image indicating the contour of the first object including the pixel having the gradation value within the specific range and the corrected image is output. . As a result, it is possible to provide the user with an output image that allows the user to distinguish and recognize the first object whose color is changed by the specific correction process and the second object included in the corrected image. As a result, it is possible to reduce inconvenience caused by a change in the value of a pixel in an unintended object by a specific correction process.

なお、本明細書に開示された技術は、種々の形態で実現可能であり、例えば、コンピュータプログラムを記録した記録媒体、画像処理装置、画像読取装置の制御装置、画像処理方法、等の形態で実現することができる。   The technique disclosed in the present specification can be realized in various forms, for example, in the form of a recording medium on which a computer program is recorded, an image processing apparatus, an image reading apparatus control apparatus, an image processing method, and the like. Can be realized.

実施例における画像処理装置としての計算機200と複合機100の構成を示すブロック図である。1 is a block diagram illustrating configurations of a computer 200 and a multifunction peripheral 100 as image processing apparatuses in an embodiment. 第1実施例のスキャン処理のフローチャートである。It is a flowchart of the scanning process of 1st Example. 第1実施例のスキャン処理のフローチャートである。It is a flowchart of the scanning process of 1st Example. 第1実施例の指示入力画面WI1の一例を示す図である。It is a figure which shows an example of the instruction | indication input screen WI1 of 1st Example. 本実施例で用いられる画像の一例を示す図である。It is a figure which shows an example of the image used by a present Example. 本実施例で用いられる画像の一例を示す図である。It is a figure which shows an example of the image used by a present Example. R成分のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of R component. UI画面WI2の一例を示す図である。It is a figure which shows an example of UI screen WI2. 第2実施例の色補正処理のフローチャートである。It is a flowchart of the color correction process of 2nd Example. 第2実施例の指示入力画面WI3の一例を示す図である。It is a figure which shows an example of the instruction input screen WI3 of 2nd Example.

A.第1実施例:
A−1:画像処理装置の構成
次に、実施の形態を実施例に基づき説明する。図1は、実施例における画像処理装置としての計算機200と、複合機100の構成を示すブロック図である。
A. First embodiment:
A-1: Configuration of Image Processing Device Next, an embodiment will be described based on examples. FIG. 1 is a block diagram illustrating a configuration of a computer 200 and an MFP 100 as image processing apparatuses in the embodiment.

計算機200は、例えば、パーソナルコンピュータであり、計算機200のコントローラとしてのCPU210と、ハードディスクドライブなどの不揮発性記憶装置220と、RAMなどの揮発性記憶装置230と、マウスやキーボードなどの操作部260と、液晶ディスプレイなどの表示部270と、通信部280と、を備えている。計算機200は、通信部280を介して、複合機100などの外部装置と通信可能に接続される。   The computer 200 is, for example, a personal computer, and includes a CPU 210 as a controller of the computer 200, a nonvolatile storage device 220 such as a hard disk drive, a volatile storage device 230 such as a RAM, and an operation unit 260 such as a mouse and a keyboard. , A display unit 270 such as a liquid crystal display, and a communication unit 280. The computer 200 is communicably connected to an external device such as the multifunction peripheral 100 via the communication unit 280.

揮発性記憶装置230は、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域231を提供する。不揮発性記憶装置220には、コンピュータプログラムCPが格納されている。コンピュータプログラムCPは、本実施例では、複合機100に搭載されたスキャナを制御するためのスキャナドライバプログラムであり、サーバからダウンロードされる形態で提供される。これに代えて、コンピュータプログラムCPは、DVD−ROMなどに格納される形態で提供されてもよい。CPU210は、コンピュータプログラムCPを実行することにより、後述するスキャン処理を実行する。   The volatile storage device 230 provides a buffer area 231 that temporarily stores various intermediate data generated when the CPU 210 performs processing. The nonvolatile storage device 220 stores a computer program CP. In this embodiment, the computer program CP is a scanner driver program for controlling the scanner installed in the multifunction peripheral 100, and is provided in a form downloaded from a server. Instead, the computer program CP may be provided in a form stored on a DVD-ROM or the like. The CPU 210 executes a scan process to be described later by executing the computer program CP.

複合機100は、イメージセンサを用いて原稿を光学的に読み取ることによってスキャンデータを生成するスキャナ部120と、所定の方式(例えば、インクジェット、レーザー)によって画像を印刷するプリンタ部130と、スキャナ部120やプリンタ部130を制御するCPUとメモリとを含む制御部110と、を備えている。   The multi-function device 100 includes a scanner unit 120 that generates scan data by optically reading a document using an image sensor, a printer unit 130 that prints an image using a predetermined method (for example, inkjet or laser), and a scanner unit. 120 and a control unit 110 including a CPU and a memory for controlling the printer unit 130.

A−2:スキャン処理
図2、図3は、第1実施例のスキャン処理のフローチャートである。このスキャン処理は、例えば、複合機200において、コンピュータプログラムCPが実行されて、スキャンドライバが起動されているときに、ユーザの開始指示に基づいて開始される。
A-2: Scan Process FIGS. 2 and 3 are flowcharts of the scan process of the first embodiment. This scan process is started based on a user start instruction when the computer program CP is executed and the scan driver is activated in the multi-function device 200, for example.

S10では、CPU210は、スキャン処理に関する指示を入力するための指示入力画面WI1を表示部270に表示する。図4は、指示入力画面WI1の一例を示す図である。図4の指示入力画面WI4は、チェックボックスCBと、3個のボタンBT1〜BT3を含んでいる。チェックボックスCBは、生成すべきスキャンデータに対して背景除去処理を実行か否かを示す指示を入力するための入力要素である。詳細設定ボタンBT3が押下されると、解像度、保存ファイル形式、圧縮方式の指定などのスキャン処理に関する詳細指示を入力するための画面(図示省略)が表示される。CPU210は、指示入力画面WI1を介して、背景除去処理の実行指示を含むスキャン処理に関する指示を取得する。   In S <b> 10, the CPU 210 displays an instruction input screen WI <b> 1 for inputting an instruction regarding scan processing on the display unit 270. FIG. 4 is a diagram illustrating an example of the instruction input screen WI1. The instruction input screen WI4 in FIG. 4 includes a check box CB and three buttons BT1 to BT3. The check box CB is an input element for inputting an instruction indicating whether or not to perform background removal processing on scan data to be generated. When the detailed setting button BT3 is pressed, a screen (not shown) for inputting detailed instructions regarding scanning processing such as the designation of resolution, storage file format, and compression method is displayed. The CPU 210 acquires an instruction related to the scan process including an instruction to execute the background removal process via the instruction input screen WI1.

ユーザは、例えば、複合機100のスキャナ部120に原稿を載置して、指示入力画面WI1の開始ボタンBT1を押下する。CPU210は、開始ボタンBT1が押下されると、S15に処理を進め、キャンセルボタンBT2が押下されると、処理を中断する。   For example, the user places a document on the scanner unit 120 of the multifunction peripheral 100 and presses the start button BT1 on the instruction input screen WI1. When the start button BT1 is pressed, the CPU 210 proceeds to S15, and when the cancel button BT2 is pressed, the process is interrupted.

S15では、CPU210は、複合機100にスキャン命令を送信することによって、複合機100を用いて原稿を示すスキャンデータを生成し、生成されたスキャンデータを複合機から取得する。取得されたスキャンデータは、バッファ領域231に格納される。S15にて取得されるスキャンデータによって表される画像を、元画像とも呼ぶ。スキャンデータは、画像内の複数個の画素のそれぞれの色を示す値を含む。本実施例のスキャンデータは、RGB値で画素ごとの色を示すRGB画像データである。RGB値の各色成分の階調値は、例えば、0〜255のいずれかの値を取る256階調の値である。   In S <b> 15, the CPU 210 generates scan data indicating a document using the multifunction device 100 by transmitting a scan command to the multifunction device 100, and acquires the generated scan data from the multifunction device. The acquired scan data is stored in the buffer area 231. The image represented by the scan data acquired in S15 is also referred to as an original image. The scan data includes a value indicating each color of a plurality of pixels in the image. The scan data of the present embodiment is RGB image data that indicates a color for each pixel with an RGB value. The gradation value of each color component of the RGB value is, for example, a value of 256 gradations that takes any value from 0 to 255.

図5、図6は、本実施例で用いられる画像の一例を示す図である。図5(A)の元画像SIは、スキャンデータによって表される画像の一例である。この元画像SIは、背景BGと、描画G1と、文字T1、T2と、ベタ領域B1、B2と、を含んでいる。背景BGは、白に近い色を有しているが、白色とは異なる色を有する部分UEを含んでいる。部分UEは、例えば、原稿の質感や、スキャナ部120のイメージセンサや光源の特性などに起因して発生する。描画G1は、円グラフを示す画像であり、背景BGの色とは異なるが背景BGに比較的近い色(例えば、薄いグレー)を有する部分PGと、背景BGの色とは比較的大きく異なる色を有する部分(PG以外の部分)と、を含む。ベタ領域B1、B2は、単色の領域であり、背景BGの色とは異なるが背景BGに比較的近い色(例えば、薄いグレー)を有している。文字T1は、白色を有しており、ベタ領域B1内に配置されている。文字T2は、背景BGの色とは比較的大きく異なる色(例えば、赤や黒)を有している。なお、背景BGに比較的近い色は、後述する背景色範囲RA内の色であり、背景BGの色とは比較的大きく異なる色は、背景色範囲RA外の色である。   5 and 6 are diagrams illustrating examples of images used in the present embodiment. The original image SI in FIG. 5A is an example of an image represented by scan data. The original image SI includes a background BG, a drawing G1, characters T1 and T2, and solid areas B1 and B2. The background BG includes a portion UE having a color close to white but having a color different from white. The part UE is generated due to, for example, the texture of the document, the characteristics of the image sensor or the light source of the scanner unit 120, and the like. The drawing G1 is an image showing a pie chart, and the color of the portion PG having a color (for example, light gray) which is different from the color of the background BG but relatively close to the background BG and the color of the background BG is relatively different. And a portion (a portion other than PG). The solid areas B1 and B2 are monochromatic areas and have a color (for example, light gray) that is different from the background BG but is relatively close to the background BG. The character T1 has a white color and is arranged in the solid region B1. The character T2 has a color (for example, red or black) that is relatively different from the color of the background BG. A color that is relatively close to the background BG is a color within the background color range RA, which will be described later, and a color that is relatively different from the color of the background BG is a color outside the background color range RA.

S20では、ユーザによって背景除去処理の実行指示が入力されたか否かを判断する。具体的には、指示入力画面WI1において、開始ボタンBT1が押下された時点で、チェックボックスCBにチェックが入力されている場合には、背景除去処理の実行指示が入力されたと判断され、チェックが入力されていない場合には、背景除去処理の実行指示が入力されていないと判断される。   In S20, it is determined whether or not an instruction to execute background removal processing is input by the user. Specifically, when the check button CB is checked when the start button BT1 is pressed on the instruction input screen WI1, it is determined that the background removal process execution instruction is input, and the check is performed. If it has not been input, it is determined that no background removal processing execution instruction has been input.

背景除去処理の実行指示が入力されていない場合には(S20:NO)、S25にて、CPU210は、スキャンデータを出力して、スキャン処理を終了する。例えば、スキャンデータは、不揮発性記憶装置220に出力されて、不揮発性記憶装置220に格納される。   When the execution instruction for the background removal process is not input (S20: NO), in S25, the CPU 210 outputs scan data and ends the scan process. For example, the scan data is output to the nonvolatile storage device 220 and stored in the nonvolatile storage device 220.

背景除去処理の実行指示が入力された場合には(S20:YES)、S30にて、CPU210は、スキャンデータに対して背景除去処理を実行して、補正済画像データを生成する。生成される補正済画像データは、スキャンデータとは別に、バッファ領域231に格納される。   When an instruction to execute background removal processing is input (S20: YES), in S30, CPU 210 performs background removal processing on the scan data to generate corrected image data. The generated corrected image data is stored in the buffer area 231 separately from the scan data.

背景除去処理について説明する。CPU210は、スキャンデータのヒストグラムを生成する。色成分のヒストグラムは、元画像データの各画素を、その画素の色成分の階調値に応じて、複数個のクラスに分類することによって得られるデータである。本実施例では、256階調の階調値のそれぞれを、1個のクラスとして、RGB値の3個の色成分についてそれぞれヒストグラムが生成される。図7は、R成分のヒストグラムの一例を示す図である。図7の横軸は、R成分の階調値を示し、縦軸は、各階調値を有する画素数を示す。   The background removal process will be described. The CPU 210 generates a histogram of scan data. The color component histogram is data obtained by classifying each pixel of the original image data into a plurality of classes according to the gradation value of the color component of the pixel. In the present embodiment, a histogram is generated for each of the three color components of the RGB values, with each of the 256 gradation values as one class. FIG. 7 is a diagram illustrating an example of an R component histogram. The horizontal axis in FIG. 7 indicates the gradation value of the R component, and the vertical axis indicates the number of pixels having each gradation value.

CPU210は、ヒストグラムを用いて、背景BGの色を示す背景色値を決定する。通常は、背景BGは、文字T1や描画G1などのオブジェクトと比較して、均一であり、かつ、広い領域であるので、背景BGに対応するピークが、各色成分のヒストグラムにおいて最も高いピークとなる。このために、本実施例では、各色成分のヒストグラムの最も高いピーク、すなわち、RGBの各色成分の最頻値Rm、Gm、Bmによって示される色値(Rm、Gm、Bm)が、背景色値として決定される。図7には、R成分の最頻値Rmが図示されている。   CPU210 determines the background color value which shows the color of background BG using a histogram. Normally, the background BG is more uniform and wider than the objects such as the characters T1 and the drawing G1, so the peak corresponding to the background BG is the highest peak in the histogram of each color component. . For this reason, in this embodiment, the highest peak of the histogram of each color component, that is, the color values (Rm, Gm, Bm) indicated by the mode values Rm, Gm, Bm of the RGB color components are the background color values. As determined. FIG. 7 shows the mode value Rm of the R component.

CPU210は、元画像SI内の複数個の画素のうち、背景色値に基づく背景色範囲RA内のRGB値を有する画素のRGB値を、白色を示すRGB値に変更する。そして、CPU210は、元画像SI内の複数個の画素のうち、背景色範囲RA外のRGB値を有する画素のRGB値を変更することなく、元の値に維持する。これによって、補正済画像を表す補正済画像データが生成される。ここで、背景色範囲RAは、(Rm−ΔV)≦R≦(Rm+ΔV)、かつ、(Gm−ΔV)≦G≦(Gm+ΔV)、かつ、(Bm−ΔV)≦B≦(Bm+ΔV)を満たす範囲である。白色値は、例えば、(255、255、255)のRGB値である。図7には、背景色範囲RAのうち、R成分についての範囲RArが図示されている。ΔVは、各色成分の階調値が取り得る範囲が0〜255である場合に、例えば、10〜20程度の値である。なお、変形例では、例えば、(Rm−ΔV1)≦R≦(Rm+ΔV2)の様に、背景色値を示すR、G、Bの階調値Rm、Gm、Bmから上限までの幅と下限までの幅とが異なっていてもよい。なお、本実施例では、背景色範囲RA外のRGB値を有する画素の値を変更していないが、これに代えて、背景色範囲RA外のRGB値を、背景色範囲RAに近いほど、白色に近づくように、画素の値を変更しても良い。この場合には、補正済画像において、白色の領域と、白色とは異なる色の領域と、の間に、不自然な境界線が現れることを抑制できる。   The CPU 210 changes the RGB value of the pixel having the RGB value in the background color range RA based on the background color value among the plurality of pixels in the original image SI to an RGB value indicating white. Then, the CPU 210 maintains the original RGB values without changing the RGB values of the pixels having the RGB values outside the background color range RA among the plurality of pixels in the original image SI. As a result, corrected image data representing the corrected image is generated. Here, the background color range RA satisfies (Rm−ΔV) ≦ R ≦ (Rm + ΔV), (Gm−ΔV) ≦ G ≦ (Gm + ΔV), and (Bm−ΔV) ≦ B ≦ (Bm + ΔV). It is a range. The white value is, for example, an RGB value of (255, 255, 255). FIG. 7 illustrates a range RAr for the R component in the background color range RA. ΔV is, for example, a value of about 10 to 20 when the range of gradation values of each color component is 0 to 255. In the modification, for example, (Rm−ΔV1) ≦ R ≦ (Rm + ΔV2), the R, G, and B gradation values Rm, Gm, and Bm indicating the background color value to the upper limit and the lower limit. The width may be different. In this embodiment, the value of the pixel having the RGB value outside the background color range RA is not changed. Instead, the RGB value outside the background color range RA is closer to the background color range RA. You may change the value of a pixel so that it may approach white. In this case, it is possible to suppress the appearance of an unnatural boundary line between the white region and the color region different from white in the corrected image.

図5(B)には、補正済画像AIの一例が示されている。この補正済画像AIの背景BGaは、背景除去処理によって白の単色の領域になっている。すなわち、白とは異なる色を有する部分UEは、背景除去処理によって元画像SIから除去されている。補正済画像AIは、元画像SIの文字T2と、描画G1から部分PGを除いた描画G1aと、を含んでいるが、他のオブジェクトを含んでいない。すなわち、ベタ領域B1、B2、文字T1b、描画G1の部分PGは、背景除去処理によって元画像SIから除去されている。これは、ベタ領域B1、B2、描画G1の部分PGを構成する画素のRGB値が、背景色範囲RAに含まれるために、背景除去処理によって、白色値に変更されたためである。このように、背景除去処理によって、ユーザの意図に反して、オブジェクトが画像から除去される場合がある。   FIG. 5B shows an example of the corrected image AI. The background BGa of the corrected image AI has become a white monochrome region by the background removal process. That is, the portion UE having a color different from white is removed from the original image SI by the background removal process. The corrected image AI includes the character T2 of the original image SI and the drawing G1a obtained by removing the portion PG from the drawing G1, but does not include other objects. That is, the solid regions B1 and B2, the character T1b, and the portion PG of the drawing G1 are removed from the original image SI by the background removal process. This is because the RGB values of the pixels constituting the solid regions B1 and B2 and the portion PG of the drawing G1 are included in the background color range RA, and thus are changed to white values by the background removal process. Thus, the object may be removed from the image against the user's intention by the background removal process.

図2のS35では、CPU210は、元画像データに対して、エッジ画素を抽出するエッジ抽出処理を実行することによって、元画像SI内のエッジ画素を示す第1のエッジ画像データを生成する。第1のエッジ画像データは、元画像SI内の複数個の画素のそれぞれについて、エッジ画素であることを示すONと、エッジ画素でないことを示すOFFと、のいずれかの値を示す二値画像データである。具体的には、CPU210は、元画像データに対して、グレー変換処理を実行して、元画像SIのグレー画像データを生成する。グレー変換処理は、画像内の複数個の画素のRGB値を、公知の式を用いて、輝度を示す256階調の輝度値Yに変換する処理である。CPU210は、元画像SIのグレー画像データの各画素の値に対して、ソーベルオペレータ(Sobel operator)を適用して、各画素のエッジ強度を算出する。そして、CPU210は、エッジ強度が所定の閾値以上である画素をエッジ画素として決定し、エッジ強度が所定の閾値未満である画素を非エッジ画素として決定することによって、第1のエッジ画像データを生成する。   In S35 of FIG. 2, the CPU 210 performs edge extraction processing for extracting edge pixels on the original image data, thereby generating first edge image data indicating edge pixels in the original image SI. The first edge image data is a binary image indicating one of a plurality of pixels in the original image SI, that is, ON indicating that the pixel is an edge pixel and OFF indicating that the pixel is not an edge pixel. It is data. Specifically, the CPU 210 performs gray conversion processing on the original image data to generate gray image data of the original image SI. The gray conversion process is a process of converting RGB values of a plurality of pixels in an image into a 256-gradation luminance value Y indicating luminance using a known formula. The CPU 210 calculates the edge intensity of each pixel by applying a Sobel operator to the value of each pixel of the gray image data of the original image SI. Then, the CPU 210 generates a first edge image data by determining a pixel having an edge strength equal to or higher than a predetermined threshold as an edge pixel and determining a pixel having an edge strength lower than the predetermined threshold as a non-edge pixel. To do.

なお、上述したエッジ抽出処理において、グレー変換処理を行うことによって、エッジ画素の検出精度を向上することができる。変形例としては、CPU210は、グレー変換処理を行うことなく、RGBの各色成分の値に対して、ソーベルオペレータ(Sobel operator)を適用して、RGBの各色成分のエッジ画像データを生成しても良い。そして、CPU210は、RGBの各色成分のエッジ画像データの論理和(OR)をとることによって、第1のエッジ画像データを生成しても良い。また、上述したエッジ抽出処理において、ソーベルオペレータ(Sobel operator)に代えて、プレウィットオペレータ(Prewitt operator)やロバーツクロスオペレータ(Roberts Cross operator)などの他のエッジ検出用オペレータが用いられても良い。   In the edge extraction process described above, the edge pixel detection accuracy can be improved by performing the gray conversion process. As a modification, the CPU 210 generates edge image data of each color component of RGB by applying a Sobel operator to the value of each color component of RGB without performing gray conversion processing. Also good. Then, the CPU 210 may generate the first edge image data by taking a logical sum (OR) of the edge image data of the RGB color components. In the edge extraction process described above, other edge detection operators such as a Prewitt operator and a Roberts Cross operator may be used instead of the Sobel operator. .

図2のS40では、CPU210は、補正済画像データに対して、上述したエッジ抽出処理を実行することによって、補正済画像AI内のエッジ画素を示す第2のエッジ画像データを生成する。第2のエッジ画像データは、補正済画像AI内の複数個の画素のそれぞれについて、エッジ画素であることを示すONと、エッジ画素でないことを示すOFFと、のいずれかの値を示す二値画像データである。   In S <b> 40 of FIG. 2, the CPU 210 generates second edge image data indicating edge pixels in the corrected image AI by performing the above-described edge extraction processing on the corrected image data. The second edge image data is a binary value that indicates one of a plurality of pixels in the corrected image AI, ie, ON indicating that the pixel is an edge pixel and OFF indicating that the pixel is not an edge pixel. Image data.

図5(C)、(D)には、第1のエッジ画像データによって表される第1のエッジ画像EI1と、第2のエッジ画像データによって表される第2のエッジ画像EI2と、の一例が示されている。エッジ画像EI1、EI2内の黒い線は、複数個のエッジ画素によって構成されるエッジを示し、白い領域は、エッジ画素ではない複数個の画素によって構成される領域を示す。第1のエッジ画像EI1は、元画像SI内の描画G1と、文字T1、T2と、ベタ領域B1、B2のそれぞれのエッジG1e、T11e、T12e、T2e、B1e、B2eを含んでいる。エッジG1e、T11e、T12e、T2e、B1e、B2eは、元画像内の対応するオブジェクトの輪郭を示している。第2のエッジ画像EI2は、補正済画像AI内の描画G1a、文字T2のそれぞれのエッジG1ae、T2eを含んでいる。換言すれば、第2のエッジ画像EI2は、背景除去処理によって除去されない描画G1a、文字T2のエッジG1ae、T2eを含んでいるが、背景除去処理によって除去される描画G1の部分PG、文字T1、ベタ領域B1、B2のエッジを含んでいない。   5C and 5D show an example of the first edge image EI1 represented by the first edge image data and the second edge image EI2 represented by the second edge image data. It is shown. Black lines in the edge images EI1 and EI2 indicate edges constituted by a plurality of edge pixels, and white areas indicate areas constituted by a plurality of pixels that are not edge pixels. The first edge image EI1 includes a drawing G1 in the original image SI, characters T1 and T2, and edges G1e, T11e, T12e, T2e, B1e, and B2e of the solid areas B1 and B2. Edges G1e, T11e, T12e, T2e, B1e, and B2e indicate the contours of the corresponding objects in the original image. The second edge image EI2 includes the drawing G1a and the edges G1ae and T2e of the character T2 in the corrected image AI. In other words, the second edge image EI2 includes the drawing G1a that is not removed by the background removal process and the edges G1ae and T2e of the character T2, but the part PG of the drawing G1 that is removed by the background removal process, the character T1, It does not include the edges of the solid areas B1 and B2.

図2のS50では、CPU210は、第1のエッジ画像EI1と第2のエッジ画像EI2との差分を示す差分画像を表す差分画像データを生成する。具体的には、CPU210は、第1のエッジ画像内の複数個のエッジ画素(すなわち、ONの画素)のうち、第2のエッジ画像内のエッジ画素に対応する画素を、エッジ画素のまま維持する。そして、CPU210は、第1のエッジ画像内の複数個のエッジ画素のうち、第2のエッジ画像内の非エッジ画素(すなわち、OFFの画素)に対応する画素を、エッジ画素から非エッジ画素に変更する、すなわち、当該画素の値をONからOFFに変更する。これによって、差分画像データが生成される。   In S50 of FIG. 2, the CPU 210 generates difference image data representing a difference image indicating a difference between the first edge image EI1 and the second edge image EI2. Specifically, the CPU 210 keeps the pixels corresponding to the edge pixels in the second edge image among the plurality of edge pixels (that is, ON pixels) in the first edge image as edge pixels. To do. Then, the CPU 210 changes a pixel corresponding to a non-edge pixel (that is, an OFF pixel) in the second edge image from a plurality of edge pixels in the first edge image from the edge pixel to the non-edge pixel. Change, that is, change the value of the pixel from ON to OFF. Thereby, difference image data is generated.

以上の説明から解るように、元画像SI、補正済画像AI、第1のエッジ画像EI1、第2のエッジ画像EI2、差分画像DIは、互いにサイズが同じ画像、すなわち、縦方向の画素数と横方向の画素数が同じ画像であり、これらの画像の各画素は、1対1で対応している。   As can be seen from the above description, the original image SI, the corrected image AI, the first edge image EI1, the second edge image EI2, and the difference image DI are images having the same size, that is, the number of pixels in the vertical direction. The images have the same number of pixels in the horizontal direction, and the pixels of these images have a one-to-one correspondence.

図6(A)には、差分画像データによって表される差分画像DIの一例が示されている。差分画像DIは、第1のエッジ画像EI1内のエッジG1e、T11e、T12e、T2e、B1e、B2eのうち、描画G1の部分PGのエッジPGeと、文字T1のエッジT1eと、ベタ領域B1、B2のエッジB1e、B2eと、を含んでいる。換言すれば、差分画像DIは、背景除去処理によって除去される描画G1の部分PG、文字T1、ベタ領域B1、B2のエッジPGe、T11e、T12e、B1e、B2eを含んでいるが、背景除去処理によって除去されない描画G1a、文字T2のエッジを含んでいない。このように、差分画像DIは、背景除去処理によって除去されるオブジェクトの輪郭を構成するエッジ画素の位置を示している。   FIG. 6A shows an example of the difference image DI represented by the difference image data. The difference image DI includes the edge PGe of the part PG of the drawing G1, the edge T1e of the character T1, and the solid areas B1, B2 among the edges G1e, T11e, T12e, T2e, B1e, B2e in the first edge image EI1. Edge B1e, B2e. In other words, the difference image DI includes the portion PG of the drawing G1 to be removed by the background removal process, the character T1, and the edges PGe, T11e, T12e, B1e, and B2e of the solid areas B1 and B2, but the background removal process Does not include the edge of the drawing G1a and the character T2 that are not removed by. Thus, the difference image DI shows the position of the edge pixel that forms the contour of the object to be removed by the background removal process.

S55では、CPU210は、S15にて取得された元画像データと、S30にて生成された補正済画像データと、S50にて生成された差分画像データと、を用いて、合成画像データを生成する。具体的には、CPU210は、補正済画像AI内の複数個の画素のうち、差分画像DIのエッジ画素(すなわち、ONの画素)に対応する画素のRGB値を、元画像SI内の対応する画素のRGB値に変更する。また、CPU210は、補正済画像AI内の複数個の画素のうち、差分画像DIの非エッジ画素(すなわち、OFFの画素)に対応する画素のRGB値を、変更しない。これによって、合成画像データが生成される。   In S55, the CPU 210 generates composite image data using the original image data acquired in S15, the corrected image data generated in S30, and the difference image data generated in S50. . Specifically, the CPU 210 corresponds the RGB value of the pixel corresponding to the edge pixel (that is, the ON pixel) of the difference image DI among the plurality of pixels in the corrected image AI in the original image SI. Change to the RGB value of the pixel. Further, the CPU 210 does not change the RGB value of the pixel corresponding to the non-edge pixel (that is, the OFF pixel) of the difference image DI among the plurality of pixels in the corrected image AI. Thereby, composite image data is generated.

なお、変形例としては、差分画像データに対して、差分画像DIに示されるオブジェクトの輪郭を太くする修正処理(例えば、公知の膨張処理)を実行して後に、修正処理後の差分画像データを用いて、合成画像データが生成されても良い。こうすれば、後述の合成画像CIにおいて、輪郭画像をより視認しやすくすることができる。   As a modification, after performing a correction process (for example, a known expansion process) for thickening the contour of the object indicated in the differential image DI on the differential image data, the differential image data after the correction process is processed. Used to generate composite image data. In this way, it is possible to make it easier to visually recognize the contour image in a composite image CI described later.

図6(B)には、合成画像データによって表される合成画像CIの一例が示されている。上述したように、差分画像DIは、背景除去処理によって除去されるオブジェクトの輪郭を構成するエッジ画素の位置を示しているので、合成画像CIは、背景除去処理によって除去されるオブジェクトの輪郭を示す輪郭画像が、補正済画像AIに対して合成された画像である。したがって、合成画像CIは、補正済画像AI内の描画G1a、文字T2と、元画像SI内の描画G1の部分PG、文字T1、ベタ領域B1、B2の輪郭PGd、T11d、T12d、B1d、B2dと、を含む輪郭画像を含んでいる。そして、輪郭PGd、T1d、B1d、B2dを構成する複数個の画素のそれぞれは、補正済画像AI内の対応する画素のRGB値を有している。したがって、輪郭PGd、T11d、T12d、B1d、B2dは、元画像SI内の対応するオブジェクトの色、すなわち、描画G1の部分PG、文字T1、ベタ領域B1、B2の色を有している。   FIG. 6B shows an example of the composite image CI represented by the composite image data. As described above, since the difference image DI indicates the position of the edge pixel constituting the contour of the object to be removed by the background removal process, the composite image CI indicates the contour of the object to be removed by the background removal process. The contour image is an image synthesized with the corrected image AI. Accordingly, the composite image CI includes the drawing G1a and the character T2 in the corrected image AI, and the outline PGd, T11d, T12d, B1d, and B2d of the drawing PG, the character T1, and the solid areas B1 and B2 in the original image SI. And an outline image including Each of the plurality of pixels constituting the contours PGd, T1d, B1d, and B2d has the RGB value of the corresponding pixel in the corrected image AI. Accordingly, the contours PGd, T11d, T12d, B1d, and B2d have the colors of the corresponding objects in the original image SI, that is, the colors of the portion PG of the drawing G1, the character T1, and the solid areas B1 and B2.

図2のS60では、CPU210は、差分画像データに対してラベリング処理を実行する。具体的には、CPU210は、連続する一つながりの複数個のエッジ画素を含む画素群に、1個の識別子を割り当て、互いに離れた複数個のエッジ画素をそれぞれ含む複数個の画素群に、互いに異なる識別子を割り当てる。1個の識別子が割り当てられた画素群は、1個の輪郭として特定される。これによって、図6(A)の差分画像DIにおいて、エッジPGe、B1e、B2e、T11e、T12eが、それぞれ輪郭として特定される。この結果、合成画像CIにおいて、5個の輪郭PGd、T11d、T12d、B1d、B2dが特定される。   In S60 of FIG. 2, the CPU 210 performs a labeling process on the difference image data. Specifically, the CPU 210 assigns one identifier to a group of pixels including a continuous series of edge pixels, and assigns each identifier group to a plurality of pixel groups each including a plurality of edge pixels separated from each other. Assign a different identifier. A pixel group to which one identifier is assigned is specified as one outline. Thereby, in the difference image DI of FIG. 6A, edges PGe, B1e, B2e, T11e, and T12e are specified as contours. As a result, five contours PGd, T11d, T12d, B1d, and B2d are specified in the composite image CI.

S65では、CPU210は、ラスタデータであるラベリング済の差分画像データを、ベクトルデータに変換する。これは、ベクトルデータの方が、一般的に、データ量が少ないからである。バッファ領域231の容量に十分な余裕がある場合などには、本ステップは省略されても良い。   In S65, the CPU 210 converts the labeled differential image data, which is raster data, into vector data. This is because vector data generally has a smaller amount of data. This step may be omitted when the capacity of the buffer area 231 has a sufficient margin.

S70では、CPU210は、合成画像CIを含むUI画面WI2を表示部270に表示する。図8は、UI画面WI2の一例を示す図である。UI画面WI2は、合成画像CIと、合成画像CI内の5個の輪郭PGd、T11d、T12d、B1d、B2dの識別子ID1〜ID5と、5個の輪郭PGd、T11d、T12d、B1d、B2dのそれぞれに対応するプルダウンメニューPM1〜PM5と、ボタンBT4、BT5と、を含んでいる。プルダウンメニューPM1〜PM5のそれぞれは、対応する輪郭ごとに、ユーザが指示を入力するための入力要素である。プルダウンメニューPM1〜PM5のそれぞれで選択できる選択肢は、3個の指示、すなわち、輪郭表示の指示、復元の指示、除去の指示を含んでいる。   In S70, the CPU 210 displays the UI screen WI2 including the composite image CI on the display unit 270. FIG. 8 is a diagram illustrating an example of the UI screen WI2. The UI screen WI2 includes a composite image CI, identifiers ID1 to ID5 of five contours PGd, T11d, T12d, B1d, and B2d in the composite image CI, and five contours PGd, T11d, T12d, B1d, and B2d, respectively. And pull-down menus PM1 to PM5 corresponding to, and buttons BT4 and BT5. Each of the pull-down menus PM1 to PM5 is an input element for the user to input an instruction for each corresponding contour. Options that can be selected from each of the pull-down menus PM1 to PM5 include three instructions, that is, an instruction for contour display, an instruction for restoration, and an instruction for removal.

合成画像CIには、5個の輪郭PGd、T11d、T12d、B1d、B2dを含む輪郭画像が含まれるので、ユーザは、合成画像CIを見ることによって、背景除去処理によって、意図せずに除去されるオブジェクトを認識できる。ユーザは、5個の輪郭PGd、T11d、T12d、B1d、B2dのそれぞれについて、対応するプルダウンメニューPM1〜PM5を操作して、指示を入力することができる。輪郭表示の指示は、輪郭だけを表示させる指示である。除去の指示は、オブジェクトおよび輪郭を除去させる指示である。復元の指示は、オブジェクトを復元させる指示である。   Since the composite image CI includes a contour image including five contours PGd, T11d, T12d, B1d, and B2d, the user unintentionally removes the background image by viewing the composite image CI. Recognizable objects. The user can input an instruction by operating the corresponding pull-down menus PM1 to PM5 for each of the five contours PGd, T11d, T12d, B1d, and B2d. The contour display instruction is an instruction to display only the contour. The removal instruction is an instruction to remove the object and the contour. The restoration instruction is an instruction to restore the object.

UI画面WI2において、印刷ボタンBT4または保存ボタンBT5が押下されると、CPU210は、S75に処理を進める。   When the print button BT4 or the save button BT5 is pressed on the UI screen WI2, the CPU 210 advances the process to S75.

S75では、CPU210は、合成画像CI内の複数個の輪郭PGd、T11d、T12d、B1d、B2dのそれぞれについて、入力された指示を取得する。すなわち、CPU210は、印刷ボタンBT4または保存ボタンBT5が押下された時点で、プルダウンメニューPM1〜PM5にてそれぞれ選択されている指示を取得する。   In S75, the CPU 210 obtains an input instruction for each of the plurality of contours PGd, T11d, T12d, B1d, and B2d in the composite image CI. That is, the CPU 210 acquires the instructions selected in the pull-down menus PM1 to PM5 when the print button BT4 or the save button BT5 is pressed.

S80では、CPU210は、合成画像CI内の複数個の輪郭PGd、T11d、T12d、B1d、B2dの中から、1個の注目する輪郭を選択する。   In S80, the CPU 210 selects one target contour from the plurality of contours PGd, T11d, T12d, B1d, and B2d in the composite image CI.

S85にて、CPU210は、注目する輪郭について入力された指示が、除去の指示、復元の指示、輪郭表示の指示のいずれであるかを判断する。   In S85, CPU 210 determines whether the instruction input for the target contour is a removal instruction, a restoration instruction, or a contour display instruction.

入力された指示が、除去の指示である場合には、S90にて、CPU210は、注目する輪郭を除去する。具体的には、CPU210は、合成画像CIにおいて、注目する輪郭を構成する複数個の画素を、ラベリング済の差分画像DIを示すベクトルデータを用いて特定する。CPU210は、特定された複数個の画素のRGB値を、補正済画像AIの対応する画素のRGB値に変更する。この結果、合成画像CIには、注目する輪郭が合成されていない状態になる。   If the input instruction is a removal instruction, in S90, CPU 210 removes the contour of interest. Specifically, the CPU 210 specifies a plurality of pixels constituting the target contour in the composite image CI using vector data indicating the labeled difference image DI. The CPU 210 changes the RGB values of the plurality of specified pixels to the RGB values of the corresponding pixels of the corrected image AI. As a result, the synthesized image CI is in a state where the target contour is not synthesized.

入力された指示が、復元の指示である場合には、S95にて、CPU210は、注目する輪郭を有する元画像SI内のオブジェクト(注目オブジェクトとも呼ぶ)を、合成画像CI内に復元する。具体的には、CPU210は、合成画像CIにおいて、注目オブジェクトを復元すべき復元領域を特定し、復元領域内の複数個の画素のRGB値を、元画像SI内の対応する画素のRGB値に変更することによって、注目オブジェクトを合成画像CI内に復元する。   If the input instruction is a restoration instruction, in S95, the CPU 210 restores an object in the original image SI (also referred to as a noticed object) having a noticed outline in the composite image CI. Specifically, the CPU 210 specifies a restoration area where the object of interest is to be restored in the composite image CI, and converts the RGB values of a plurality of pixels in the restoration area to the RGB values of the corresponding pixels in the original image SI. By changing the target object, the target object is restored in the composite image CI.

復元領域の特定は、例えば、以下のように行われる。先ず、CPU210は、合成画像CIにおいて、注目する輪郭を構成する複数個の画素を、ラベリング済の差分画像DIを示すベクトルデータを用いて特定する。そして、CPU210は、注目する輪郭の外接矩形に含まれる複数個の画素であって、注目する輪郭を構成しない複数個の画素を非輪郭画素として特定する。そして、CPU210は、連続する一つながりの非輪郭画素によって構成される領域であって、注目する輪郭の外接矩形の4辺と接触しない領域を、復元領域として特定する。ただし、注目する輪郭が、図6(B)の合成画像CIの円弧状の輪郭PGdのように、閉じたループを形成していない場合には、CPU210は、上記方法では、復元領域を特定できない。このために、上記方法で復元領域が特定できない場合には、CPU210は、注目する輪郭は閉じたループを形成していないと判断して、例えば、以下の方法で復元領域を特定する。先ず、CPU210は、注目する輪郭の両側に隣接する隣接領域の色を、元画像SI内の対応する複数個の画素の値を用いて算出する。CPU210は、輪郭の両側の隣接領域のうち、領域の色が、元画像SIの背景色値(Rm、Gm、Bm)に近い領域を背景側の領域と判定し、反対側の領域を復元すべき側の領域と判定する。CPU210は、エッジ画像EI1を用いて、復元すべき側の領域を含み、連続する一つながりの非エッジ画素によって構成される領域を、復元領域として特定する。特定される復元領域は、エッジ画像EI1において、閉じたループを形成する複数個のエッジ画素によって囲まれた領域となる。変形例としては、例えば、復元領域を特定できない場合には、CPU210は、復元領域を自動では特定できないことをUI画面WI2に表示して、ユーザから復元領域を指定する指示を受け取ることによって、復元領域を特定しても良い。例えば、ユーザは、マウスなどのポインティングデバイスを用いて、UI画面WI2内の合成画像CI上で、復元領域を指定する指示を入力ことができる。   The restoration area is identified as follows, for example. First, the CPU 210 specifies a plurality of pixels constituting the target contour in the composite image CI using vector data indicating the labeled difference image DI. Then, the CPU 210 specifies a plurality of pixels included in the circumscribed rectangle of the contour to be noticed and not constituting the noticed contour as non-contour pixels. Then, the CPU 210 specifies a region that is formed by a continuous series of non-contour pixels and that does not contact the four sides of the circumscribed rectangle of the target contour as a restoration region. However, when the contour of interest does not form a closed loop like the arc-shaped contour PGd of the composite image CI in FIG. 6B, the CPU 210 cannot identify the restoration area by the above method. . For this reason, when the restoration area cannot be specified by the above method, the CPU 210 determines that the target contour does not form a closed loop, and specifies the restoration area by the following method, for example. First, the CPU 210 calculates the color of the adjacent region adjacent to both sides of the target contour using the values of a plurality of corresponding pixels in the original image SI. The CPU 210 determines that an area in which the color of the area is close to the background color value (Rm, Gm, Bm) of the original image SI among the adjacent areas on both sides of the contour is the background area, and restores the opposite area. It is determined that the region should be the power side. Using the edge image EI1, the CPU 210 identifies a region including a region to be restored and configured by a continuous series of non-edge pixels as a restoration region. The specified restoration area is an area surrounded by a plurality of edge pixels forming a closed loop in the edge image EI1. As a modification, for example, when the restoration area cannot be specified, the CPU 210 displays on the UI screen WI2 that the restoration area cannot be automatically specified, and receives an instruction to specify the restoration area from the user. An area may be specified. For example, the user can input an instruction to designate a restoration area on the composite image CI in the UI screen WI2 using a pointing device such as a mouse.

入力された指示が、輪郭表示である場合には、CPU210は、S90やS95をスキップして、S100に処理を進める。合成画像CIは、輪郭を既に含んでいるので、この場合には、合成画像CIを変更する必要はないからである。   If the input instruction is contour display, the CPU 210 skips S90 and S95, and proceeds to S100. This is because the composite image CI already includes an outline, and in this case, there is no need to change the composite image CI.

S100では、CPU210は、全ての輪郭をについて処理したか否かを判断する。未処理の輪郭がある場合には(ステップS100:NO)、CPU210は、S80に戻って、未処理の輪郭を新たに注目する輪郭として選択する。全ての輪郭について処理された場合には(ステップS100:YES)、CPU210は、S105に処理を進める。この時点でユーザの指示に基づいて合成画像CI内の輪郭について処理が行われた処理済合成画像ACIを表す処理済合成画像データが生成されている。   In S100, the CPU 210 determines whether all contours have been processed. If there is an unprocessed contour (step S100: NO), the CPU 210 returns to S80 and selects the unprocessed contour as a newly focused contour. When all the contours have been processed (step S100: YES), the CPU 210 advances the process to S105. At this time, processed composite image data representing the processed composite image ACI that has been processed for the contour in the composite image CI based on the user's instruction is generated.

図6の(C)には、処理済合成画像ACIの一例が示されている。この処理済合成画像ACIでは、例えば、合成画像CIの描画の輪郭PGdが、輪郭表示の指示に基づいて、維持されている。処理済合成画像ACIでは、合成画像CIの輪郭T11d、T12d、B1dを有する元画像SI内のオブジェクトT1、B1が、復元の指示に基づいて復元されている。そして、処理済合成画像ACIでは、合成画像CIの輪郭B2dが、消去の指示に基づいて消去されている。このように、ユーザの指示に基づいて、オブジェクトごとに適切な処理が実行されるので、CPU210は、ユーザの意図に沿った処理済合成画像ACIを表す処理済合成画像データを生成することができる。   FIG. 6C shows an example of the processed composite image ACI. In this processed composite image ACI, for example, the contour PGd of the composite image CI drawn is maintained based on the contour display instruction. In the processed composite image ACI, the objects T1 and B1 in the original image SI having the contours T11d, T12d, and B1d of the composite image CI are restored based on the restoration instruction. In the processed composite image ACI, the outline B2d of the composite image CI is erased based on the erase instruction. As described above, since appropriate processing is executed for each object based on the user's instruction, the CPU 210 can generate processed composite image data representing the processed composite image ACI in accordance with the user's intention. .

S105では、CPU210は、図8のUI画面WI2を介して入力された指示に従って、処理済合成画像データを出力する。具体的には、UI画面WI2の印刷ボタンBT4が押下された場合には、CPU210は、処理済合成画像データを用いて印刷データを生成して、印刷データを複合機100に送信する。この結果、複合機100によって用紙に印刷された処理済合成画像ACIが出力される。UI画面WI2の保存ボタンBT5が押下された場合には、CPU210は、処理済合成画像データを、所定のフォーマットの画像ファイル、例えば、JPEG(Joint Photographic Experts Groupの略)フォーマットの画像ファイルに変換して、不揮発性記憶装置220に出力する。この結果、不揮発性記憶装置220に処理済合成画像データが保存される。   In S105, the CPU 210 outputs processed composite image data in accordance with an instruction input via the UI screen WI2 of FIG. Specifically, when the print button BT4 on the UI screen WI2 is pressed, the CPU 210 generates print data using the processed composite image data, and transmits the print data to the multifunction peripheral 100. As a result, the processed composite image ACI printed on the sheet by the multifunction peripheral 100 is output. When the save button BT5 on the UI screen WI2 is pressed, the CPU 210 converts the processed composite image data into an image file having a predetermined format, for example, an image file having a JPEG (Joint Photographic Experts Group) format. To the non-volatile storage device 220. As a result, the processed composite image data is stored in the nonvolatile storage device 220.

以上説明した第1実施例によれば、元画像データを用いて、差分画像DIを表す差分画像データが生成される(図2のS35〜S50)ことによって、背景除去処理によって除去されるオブジェクト(第1のオブジェクトとも呼ぶ)、すなわち、背景色範囲RA内のRGB値を有する複数個の画素を含むオブジェクトの輪郭PGe、T11e、T12e、B1e、B2e(図6(A))が抽出される。そして、補正済画像データを用いて、第1のオブジェクトの輪郭PGd、T11d、T12d、B1d、B2dを示す輪郭画像と、補正済画像AI内のオブジェクト、すなわち、背景除去処理によって除去されないオブジェクト(第2のオブジェクトとも呼ぶ)G1a、T2を示す画像と、を含む合成画像CIを表す合成画像データが生成される(図2の55)。第2のオブジェクトは、背景色範囲RA外のRGB値を有する複数個の画素を含むオブジェクトである、と言うことができる。生成された合成画像データを用いて、UI画面WI2に合成画像CIが含められることによって、合成画像CIが表示部270に出力(すなわち、表示)される(図3のS70)。この結果、背景除去処理によって色が変更されて除去される第1のオブジェクトと、補正済画像AI内の第2のオブジェクトと、をユーザが区別して認識できる出力画像である合成画像CIを、ユーザに提供することができる。   According to the first embodiment described above, the difference image data representing the difference image DI is generated using the original image data (S35 to S50 in FIG. 2), so that the object (which is removed by the background removal process) ( The contours PGe, T11e, T12e, B1e, and B2e (FIG. 6A) of the object including a plurality of pixels having RGB values within the background color range RA are extracted. Then, using the corrected image data, the contour image showing the contours PGd, T11d, T12d, B1d, and B2d of the first object and the object in the corrected image AI, that is, the object (first object that is not removed by the background removal process) Composite image data representing a composite image CI including images indicating G1a and T2 (also referred to as object 2) is generated (55 in FIG. 2). It can be said that the second object is an object including a plurality of pixels having RGB values outside the background color range RA. By using the generated composite image data, the composite image CI is output (that is, displayed) to the display unit 270 by including the composite image CI in the UI screen WI2 (S70 in FIG. 3). As a result, the composite image CI, which is an output image that allows the user to distinguish and recognize the first object whose color is changed and removed by the background removal process, and the second object in the corrected image AI, is Can be provided.

例えば、補正済画像AIをユーザに提供しても、補正済画像AIには、元画像SIから除去された第1のオブジェクトが明示されないので、ユーザは、第1のオブジェクトがあることを認識できない可能性がある。また、仮に、差分画像DIをユーザに提供しても、差分画像DIには、補正済画像AIに残る第2のオブジェクトが明示されないので、ユーザは、第2のオブジェクトを認識できない可能性がある。また、仮に、第1のエッジ画像EI1をユーザに提供しても、エッジ画像EI1では、第1のオブジェクトと第2のオブジェクトとが区別されないので、ユーザは、第1のオブジェクトと第2のオブジェクトとを区別して認識できない。合成画像CIには、第1のオブジェクトと第2のオブジェクトが区別して明示されるので、背景除去処理によって意図しないオブジェクト内の画素の値が変更されることに起因する不具合を低減できる。例えば、輪郭が残ることで、ユーザが許容できる出力画像が、ユーザに提供できる。あるいは、ユーザは、第1のオブジェクトが除去されることを認識できるので、復元の指示を入力して第1のオブジェクトを復元させるなどの対応を取ることができる。   For example, even if the corrected image AI is provided to the user, since the first object removed from the original image SI is not clearly shown in the corrected image AI, the user cannot recognize that there is the first object. there is a possibility. Further, even if the difference image DI is provided to the user, the second object remaining in the corrected image AI is not clearly shown in the difference image DI, and therefore the user may not be able to recognize the second object. . In addition, even if the first edge image EI1 is provided to the user, the first object and the second object are not distinguished in the edge image EI1 because the first object is not distinguished from the second object. Cannot be recognized separately. In the composite image CI, the first object and the second object are clearly distinguished and can be used to reduce problems caused by changing the pixel values in the unintended object by the background removal process. For example, by leaving the outline, an output image acceptable to the user can be provided to the user. Alternatively, since the user can recognize that the first object is removed, the user can take a countermeasure such as inputting a restoration instruction to restore the first object.

より具体的には、S35にて、元画像データを用いて、第1のエッジ画像データが生成され、S40にて、補正済画像データを用いて、第2のエッジ画像データが生成され、S50にて第1のエッジ画像データと第2のエッジ画像データとを用いて、第1のオブジェクトの輪郭が抽出される。この結果、第1のエッジ画像データと第2のエッジ画像データとを用いて、第1のオブジェクトの輪郭を精度良く抽出することができる。   More specifically, in S35, first edge image data is generated using the original image data, and in S40, second edge image data is generated using the corrected image data. The contour of the first object is extracted using the first edge image data and the second edge image data. As a result, the outline of the first object can be extracted with high accuracy using the first edge image data and the second edge image data.

また、S50にて、差分画像DIを表す差分データを生成することによって、第1のエッジ画像EI1内の複数個のエッジ画素のうち、第2のエッジ画像EI2内の対応するエッジ画素が存在しない画素によって構成される領域が、第1のオブジェクトの輪郭として抽出される。この結果、第1のエッジ画像データと第2のエッジ画像データとを用いて、輪郭画像が合成されるべき領域を容易に特定することができる。   In S50, by generating difference data representing the difference image DI, no corresponding edge pixel in the second edge image EI2 exists among the plurality of edge pixels in the first edge image EI1. A region constituted by pixels is extracted as the outline of the first object. As a result, the region where the contour image is to be synthesized can be easily specified using the first edge image data and the second edge image data.

さらに、第1実施例では、合成画像CI内の第1のオブジェクトの輪郭PGd、T11d、T12d、B1d、B2dは、元画像SI内の第1のオブジェクトPG、T1、B1、B2と同じ色を有している。この結果、合成画像CIにおいて、第1のオブジェクトの元画像SIにおける色が表現される。この結果、合成画像CIを見るユーザは、背景除去処理によって変更される前の第1のオブジェクトの色を認識できる。   Further, in the first embodiment, the contours PGd, T11d, T12d, B1d, and B2d of the first object in the composite image CI have the same color as the first objects PG, T1, B1, and B2 in the original image SI. Have. As a result, the color in the original image SI of the first object is expressed in the composite image CI. As a result, the user viewing the composite image CI can recognize the color of the first object before being changed by the background removal process.

さらに、第1実施例では、背景除去処理によって除去されない第2のオブジェクトG1a、T2は、補正済画像AI内の第2のオブジェクトG1a、T2と同じ色を有している。この結果、ユーザは、合成画像CIを見ることによって、補正済画像AI内で表現される第2のオブジェクトG1a、T2を確認できる。   Furthermore, in the first embodiment, the second objects G1a and T2 that are not removed by the background removal process have the same color as the second objects G1a and T2 in the corrected image AI. As a result, the user can confirm the second objects G1a and T2 expressed in the corrected image AI by looking at the composite image CI.

さらに、第1実施例では、CPU210は、合成画像CIを含むUI画面WI2を表示部270に表示して、輪郭画像に関する指示をユーザから取得する(図3のS75)。そして、CPU210は、S75にて除去の指示が取得された場合には、S90にて、指示の対象の輪郭を構成する複数個の画素のそれぞれの値を、補正済画像AI内の対応する画素の値に変更し、S75にて復元の指示が取得された場合には、S95にて、指示の対象の輪郭によって特定されるオブジェクト領域(即ち、上述した復元領域)内の複数個の画素のそれぞれの値を、元画像SI内の対応する画素の値に変更する。この結果、ユーザの指示に応じて、第1のオブジェクトの輪郭の除去や、第1のオブジェクトの復元を適切に実行できる。この結果、ユーザの意図に沿った適切な処理済合成画像ACIを表す処理済合成画像データを出力することができる。   Furthermore, in the first example, the CPU 210 displays the UI screen WI2 including the composite image CI on the display unit 270, and acquires an instruction regarding the contour image from the user (S75 in FIG. 3). Then, when the removal instruction is acquired in S75, the CPU 210 sets each value of the plurality of pixels constituting the contour of the instruction target in S90 to the corresponding pixel in the corrected image AI. When the restoration instruction is acquired in S75, a plurality of pixels in the object area (that is, the restoration area described above) specified by the contour of the instruction target are obtained in S95. Each value is changed to the value of the corresponding pixel in the original image SI. As a result, it is possible to appropriately execute the removal of the outline of the first object and the restoration of the first object in accordance with a user instruction. As a result, processed composite image data representing an appropriate processed composite image ACI in accordance with the user's intention can be output.

さらに、第1実施例では、CPU210は、輪郭表示の指示が取得された場合に、指示の対象の輪郭を構成する複数個の画素の値を変更しないので、ユーザの指示に基づいて、処理済合成画像ACIにおいて、特定のオブジェクトの輪郭を残すこともできる。したがって、ユーザの指示に応じて、さらに適切な処理済合成画像ACIを出力することができる。   Furthermore, in the first embodiment, when an instruction for contour display is acquired, the CPU 210 does not change the values of a plurality of pixels constituting the contour to be instructed. It is also possible to leave the contour of a specific object in the composite image ACI. Therefore, a more appropriate processed composite image ACI can be output in accordance with a user instruction.

なお、合成画像CI内の第1のオブジェクトの輪郭PGdのように、第1のオブジェクトの輪郭は、元画像SI内の第1のオブジェクトPGの一部の輪郭であって、第1のオブジェクトPGの全体の輪郭ではない輪郭を含む。すなわち、第1のオブジェクトの輪郭は、第1のオブジェクトの全体を囲む閉じたループ状の輪郭ではない場合がある。   Note that, like the contour PGd of the first object in the composite image CI, the contour of the first object is a partial contour of the first object PG in the original image SI and is the first object PG. Contain a contour that is not the entire contour. That is, the contour of the first object may not be a closed loop-shaped contour that surrounds the entire first object.

さらに、第1実施例では、CPU210は、元画像SI内の複数個の第1のオブジェクトPG、T1、B1、B2のそれぞれの輪郭PGd、T11d、T12d、B1d、B2dについて、ユーザから指示を取得する(図3のS75)。CPU210は、複数個の輪郭のそれぞれについて、ユーザからの指示に基づいて画素の値を変更する(図3のS85〜S95)。したがって、背景除去処理で除去される複数個の第1のオブジェクトごとに、適切な処理が実行された処理済合成画像データを出力することができる。したがって、よりユーザの意図に沿った処理済合成画像ACIをユーザに提供することができる。   Further, in the first embodiment, the CPU 210 obtains an instruction from the user for each of the outlines PGd, T11d, T12d, B1d, and B2d of the plurality of first objects PG, T1, B1, and B2 in the original image SI. (S75 in FIG. 3). CPU210 changes the value of a pixel about each of several outline based on the instruction | indication from a user (S85-S95 of FIG. 3). Therefore, processed composite image data that has been subjected to appropriate processing can be output for each of the plurality of first objects to be removed by the background removal processing. Therefore, the processed composite image ACI more in line with the user's intention can be provided to the user.

B.第2実施例
図9は、第2実施例の色補正処理のフローチャートである。第2実施例では、図2のスキャン処理に代えて、図9の色補正処理が行われる。この色補正処理は、図2のスキャン処理と同様に、合成画像CIを表す合成画像データの出力(具体的には表示)や、処理済合成画像ACIを表す処理済合成画像データの出力(具体的には、印刷や保存)を行うための処理である。色補正処理は、例えば、計算機200において起動されているスキャナドライバに対して、ユーザが開始指示を入力した場合に実行される。
B. Second Embodiment FIG. 9 is a flowchart of color correction processing according to the second embodiment. In the second embodiment, the color correction process of FIG. 9 is performed instead of the scan process of FIG. This color correction process is similar to the scan process of FIG. 2 in that output (specifically, display) of composite image data representing the composite image CI and output (specifically) processed composite image data representing the processed composite image ACI. Specifically, this is a process for performing printing and storage. The color correction process is executed, for example, when the user inputs a start instruction to the scanner driver activated in the computer 200.

S205では、CPU210は、元画像データを取得して、バッファ領域231に格納する。CPU210は、例えば、スキャナ部250を用いて原稿を読み取り、元画像データとしてのスキャンデータを生成することによって、元画像データを取得する。これに代えて、CPU210は、予め生成されて不揮発性記憶装置220に保存されている複数個のスキャンデータの中から、ユーザの指定に基づいて選択される1個のスキャンデータを不揮発性記憶装置220から元画像データとして読み出すことによって、元画像データを取得しても良い。   In S <b> 205, the CPU 210 acquires the original image data and stores it in the buffer area 231. The CPU 210 acquires original image data by reading a document using the scanner unit 250 and generating scan data as original image data, for example. Instead, the CPU 210 stores one piece of scan data selected based on a user's designation from a plurality of scan data generated in advance and stored in the nonvolatile storage device 220. The original image data may be acquired by reading out the original image data from 220.

S210では、CPU210は、指示入力画面WI3を、表示部270に表示する。図10は、指示入力画面WI3の一例を示す図である。図10の指示入力画面WI3は、元画像データに対して実行すべき特定の補正処理の種類を選択する指示を入力するためのラジオボタンRB1、RB2と、出力すべき画像に対する輪郭表示に関する指示を入力するためのラジオボタンRB3〜RB5と、ボタンBT8〜BT10と、を含んでいる。   In S210, the CPU 210 displays the instruction input screen WI3 on the display unit 270. FIG. 10 is a diagram illustrating an example of the instruction input screen WI3. The instruction input screen WI3 in FIG. 10 includes radio buttons RB1 and RB2 for inputting an instruction to select a specific type of correction processing to be performed on the original image data, and an instruction regarding outline display for the image to be output. Radio buttons RB3 to RB5 for inputting and buttons BT8 to BT10 are included.

ユーザは、ラジオボタンRB1、RB2のいずれかを選択することによって、背景除去処理と、カラードロップ処理と、のいずれか1個の処理を選択する指示を入力することができる。背景除去処理は、第1実施例の背景除去処理と同じ処理である。カラードロップ処理は、ユーザによって指定された指定色を示す色値に基づく指定色範囲RAs内のRGB値を有する画素のRGB値を、白色を示すRGB値に変更する処理である。カラードロップ処理は、画像内のオブジェクトのうち、ユーザが不要であると判断するオブジェクトを除去するための処理である。ボタンBT8が押下されると、CPU210は、指定色の指定を入力するための入力画面(図示省略)を表示部270に表示する。この入力画面を介して、ユーザは、指定色を指定することができる。例えば、この入力画面は、元画像SIを含み、ユーザは、元画像SI内の指定色を有する位置をマウスなどのポインティングデバイスを用いて指定することによって、指定色の指定を入力できる。   The user can input an instruction to select one of the background removal process and the color drop process by selecting one of the radio buttons RB1 and RB2. The background removal process is the same as the background removal process of the first embodiment. The color drop process is a process of changing the RGB value of a pixel having an RGB value within a specified color range RAs based on a color value indicating a specified color specified by the user to an RGB value indicating white. The color drop process is a process for removing an object that the user determines to be unnecessary from among the objects in the image. When the button BT8 is pressed, the CPU 210 displays an input screen (not shown) for inputting designation of the designated color on the display unit 270. The user can specify a specified color via this input screen. For example, the input screen includes the original image SI, and the user can input designation of the designated color by designating a position having the designated color in the original image SI using a pointing device such as a mouse.

ユーザは、ラジオボタンRB3〜RB5のいずれかを選択することによって、輪郭を表示させる表示指示と、輪郭を表示させない非表示指示と、輪郭を表示するか否かを自動で判定させる自動判定指示と、のいずれか1個の指示を入力することができる。   The user selects one of the radio buttons RB3 to RB5 to display a display instruction for displaying the outline, a non-display instruction for not displaying the outline, and an automatic determination instruction for automatically determining whether or not to display the outline. Any one of the instructions can be input.

ユーザは、例えば、ラジオボタンRB1、RB2のいずれか1個を選択し、かつ、ラジオボタンRB3〜RB5のいずれか1個を選択して、指示入力画面WI3の開始ボタンBT9を押下する。CPU210は、開始ボタンBT9が押下されると、S220に処理を進め、キャンセルボタンBT10が押下されると、処理を中断する。   For example, the user selects any one of the radio buttons RB1 and RB2, selects any one of the radio buttons RB3 to RB5, and presses the start button BT9 on the instruction input screen WI3. When the start button BT9 is pressed, the CPU 210 proceeds to S220, and when the cancel button BT10 is pressed, the process is interrupted.

S215では、CPU210は、実行すべき特定の補正処理の種類の選択指示と、輪郭表示に関する指示と、を取得する。すなわち、CPU210は、開始ボタンBT9が押下された時点で、ラジオボタンRB1〜RB5のうち、選択されているラジオボタンに対応する指示を取得する。特定の補正処理の種類の選択指示が、カラードロップ処理を選択する指示である場合には、ユーザによって指定された指定色を示す色値を併せて取得する。   In S215, the CPU 210 acquires a selection instruction for a type of a specific correction process to be executed and an instruction related to contour display. That is, when the start button BT9 is pressed, the CPU 210 acquires an instruction corresponding to the selected radio button among the radio buttons RB1 to RB5. When the selection instruction for the specific correction process type is an instruction to select the color drop process, a color value indicating the designated color designated by the user is also acquired.

S220では、CPU210は、元画像データに対して、ユーザの選択指示に基づく特定の補正処理、本実施例では、背景除去処理とカラードロップ処理とのうちのいずれかの補正処理を実行して、補正済画像データを生成する。特定の補正処理が、背景除去処理である場合には、図2のS30と同様に、背景除去処理が実行される。特定の補正処理が、背景除去処理である場合には、CPU210は、元画像SI内の複数個の画素のうち、指定色範囲RAs内のRGB値を有する画素のRGB値を、白色を示すRGB値に変更する。そして、CPU210は、元画像SI内の複数個の画素のうち、指定色範囲RAs外のRGB値を有する画素のRGB値を変更することなく、元の値に維持する。これによって、補正済画像を表す補正済画像データが生成される。ここで、指定色範囲RAsは、ユーザによって指定された指定色を示す色値(Rs、Gs、Bs)に基づく範囲であり、例えば、(Rs−ΔV)≦R≦(Rs+ΔV)、かつ、(Gs−ΔV)≦G≦(Gs+ΔV)、かつ、(Bm−ΔV)≦B≦(Bm+ΔV)を満たす範囲である。   In S220, the CPU 210 executes a specific correction process based on a user's selection instruction on the original image data, in this embodiment, one of a background removal process and a color drop process, Generate corrected image data. When the specific correction process is the background removal process, the background removal process is executed as in S30 of FIG. When the specific correction process is the background removal process, the CPU 210 converts the RGB value of the pixel having the RGB value in the specified color range RAs among the plurality of pixels in the original image SI to RGB indicating white. Change to a value. Then, the CPU 210 maintains the original RGB values without changing the RGB values of the pixels having the RGB values outside the specified color range RAs among the plurality of pixels in the original image SI. As a result, corrected image data representing the corrected image is generated. Here, the designated color range RAs is a range based on color values (Rs, Gs, Bs) indicating the designated color designated by the user. For example, (Rs−ΔV) ≦ R ≦ (Rs + ΔV) and ( Gs−ΔV) ≦ G ≦ (Gs + ΔV) and (Bm−ΔV) ≦ B ≦ (Bm + ΔV).

S225では、CPU210は、S215で取得された輪郭表示に関する指示が、自動判定指示であるか否かを判断する。輪郭表示に関する指示が、自動判定指示でない場合には(S225:NO)、S230にて、CPU210は、輪郭表示に関する指示が、表示指示であるか否かを判断する。輪郭表示に関する指示が、表示指示である場合には(S230:YES)、CPU210は、S250に処理を進める。輪郭表示に関する指示が、表示指示でない場合、すなわち、非表示処理である場合には(S230:NO)、CPU210は、S245に処理を進める。   In S225, the CPU 210 determines whether or not the instruction regarding the contour display acquired in S215 is an automatic determination instruction. When the instruction regarding the contour display is not the automatic determination instruction (S225: NO), in S230, the CPU 210 determines whether or not the instruction regarding the contour display is a display instruction. When the instruction regarding the outline display is a display instruction (S230: YES), the CPU 210 advances the process to S250. If the instruction regarding the contour display is not a display instruction, that is, if it is a non-display process (S230: NO), the CPU 210 advances the process to S245.

輪郭表示に関する指示が、自動判定指示である場合には(S225:YES)、S235にて、CPU210は、実行された特定の補正処理が、背景除去処理であるかカラードロップ処理であるかを判断する。実行された特定の補正処理が、背景除去処理である場合には、CPU210は、S250に処理を進める。   When the instruction regarding the contour display is an automatic determination instruction (S225: YES), in S235, the CPU 210 determines whether the executed specific correction process is the background removal process or the color drop process. To do. If the executed specific correction process is the background removal process, the CPU 210 advances the process to S250.

実行された特定の補正処理が、カラードロップ処理である場合には、S240にて、CPU210は、元画像SIが写真であるか否かを判断する。元画像SIのオブジェクトが写真であるか否かの判断は、公知の手法で判断され得る。例えば、CPU210は、元画像データの色数Cを算出する。例えば、元画像データの輝度値のヒストグラムが生成され、輝度値のヒストグラムを用いて、256階調の輝度値のうち、所定数以上の画素が有する輝度値の個数が、色数Cとして算出される。CPU210は、算出された色数Cが閾値THc以上である場合に、元画像SIのオブジェクトが写真であると判断し、算出された色数Cが閾値THc未満である場合に、元画像SIのオブジェクトが写真でないと判断する。写真とは異なるオブジェクトは、例えば、文字、コンピュータグラフィックスを含む。   If the executed specific correction process is a color drop process, in S240, the CPU 210 determines whether or not the original image SI is a photograph. Whether or not the object of the original image SI is a photograph can be determined by a known method. For example, the CPU 210 calculates the number of colors C of the original image data. For example, a luminance value histogram of the original image data is generated, and the number of luminance values of a predetermined number or more of the 256 gradation luminance values is calculated as the number of colors C using the luminance value histogram. The The CPU 210 determines that the object of the original image SI is a photograph when the calculated color number C is greater than or equal to the threshold value THc, and when the calculated color number C is less than the threshold value THc, Determine that the object is not a photo. Objects different from photographs include, for example, characters and computer graphics.

元画像SIが写真である場合には(S240:YES)、CPU210は、S245に処理を進める。元画像SIが写真でない場合には(S240:NO)、CPU210は、S250に処理を進める。   When the original image SI is a photograph (S240: YES), the CPU 210 advances the process to S245. If the original image SI is not a photograph (S240: NO), the CPU 210 advances the process to S250.

S245では、CPU210は、S220で生成された補正済画像データ、すなわち、輪郭画像が合成されていない補正済画像を表す補正済画像データを出力(例えば、保存や印刷)する。   In S245, the CPU 210 outputs (for example, saves or prints) the corrected image data generated in S220, that is, corrected image data representing a corrected image in which no contour image is synthesized.

S250では、CPU210は、図2、図3のS35〜S105の処理を実行する。この結果、合成画像データの出力(具体的には、図3のS70の合成画像CIの表示)や、処理済合成画像データの出力(具体的には、図3のS105)が行われる。   In S250, the CPU 210 executes the processes of S35 to S105 in FIGS. As a result, output of composite image data (specifically, display of composite image CI in S70 of FIG. 3) and output of processed composite image data (specifically, S105 of FIG. 3) are performed.

以上説明した第2実施例によれば、元画像SIに対する特定の補正処理の種類が判断され(S235)、特定の補正処理が元画像SIの背景色を除去する処理(すなわち、背景除去処理)である場合には、輪郭画像を含む合成画像CIを表す合成画像データや処理済合成画像ACIを表す処理済合成画像データが出力される(S250)。そして、特定の補正処理が、元画像SI内のオブジェクトを除去する処理(すなわち、カラードロップ処理)である場合には、輪郭画像を含まない補正済画像を表す補正済画像データが出力され得る(S245)。カラードロップ処理は、ユーザが不要であると判断するオブジェクトを除去するための処理である。したがって、カラードロップ処理によって除去されるオブジェクトは、ユーザの意図に反して除去されたオブジェクトではなく、ユーザの意図に沿って除去されたオブジェクトである場合がある。このために、特定の補正処理がカラードロップ処理である場合には、輪郭画像を含む合成画像CIを表す合成画像データではなく、輪郭画像を含まない補正済画像データを出力するほうが好ましい場合がある。このために、本実施例では、CPU210は、特定の補正処理がカラードロップ処理である場合には、元画像SIが写真であることを条件に、補正済画像データを出力している。一方、背景除去処理は、背景の色を除去するための処理であるので、背景除去処理によって除去されるオブジェクトは、ユーザの意図に反して除去されたオブジェクトである可能性が高い。このために、本実施例では、CPU210は、特定の補正処理が背景除去処理である場合には、合成画像データや処理済合成画像データが出力される。この結果、元画像SIの種類に応じて、適切な画像データを出力することができる。   According to the second embodiment described above, the type of specific correction processing for the original image SI is determined (S235), and the specific correction processing removes the background color of the original image SI (ie, background removal processing). If it is, the composite image data representing the composite image CI including the contour image and the processed composite image data representing the processed composite image ACI are output (S250). When the specific correction process is a process for removing an object in the original image SI (that is, a color drop process), corrected image data representing a corrected image that does not include a contour image can be output ( S245). The color drop process is a process for removing an object that the user determines to be unnecessary. Therefore, the object removed by the color drop process may not be an object removed against the user's intention but an object removed according to the user's intention. For this reason, when the specific correction process is a color drop process, it may be preferable to output corrected image data that does not include the contour image, instead of the composite image data that represents the composite image CI that includes the contour image. . For this reason, in this embodiment, when the specific correction process is a color drop process, the CPU 210 outputs corrected image data on the condition that the original image SI is a photograph. On the other hand, since the background removal process is a process for removing the background color, an object removed by the background removal process is highly likely to be an object removed against the user's intention. For this reason, in this embodiment, when the specific correction process is the background removal process, the CPU 210 outputs the composite image data and the processed composite image data. As a result, appropriate image data can be output according to the type of the original image SI.

また、第2実施例では、元画像SIが第1種の画像(具体的には、写真を示す画像)である場合には(S240:YES)、補正済画像データが出力され(S245)、元画像SIが第2種の画像(具体的には、写真とは異なるオブジェクトを示す画像)である場合には(S240:NO)、合成画像データや処理済合成画像データが出力される(S250)。こうすれば、元画像の種類に応じて、適切な画像データを出力できる。より具体的に説明すると、写真を示す画像に対して、カラードロップ処理が実行される場合には、ユーザは、写真内の特定の色のオブジェクトを除去したい場合が多い。この場合に、写真内に輪郭が表示されると、不自然な画像となる場合が多い。したがって、この場合には、輪郭画像を含まない補正済画像データが出力されることが適切であると考えられる。一方、写真とは異なるオブジェクト、例えば、文字や、コンピュータグラフィックを示す画像に対して、カラードロップ処理が実行される場合には、ユーザは、画像内のベタ塗りの領域の色を除去したい場合が多い。この場合に、除去されたベタ塗りの領域の輪郭を表示した方が、画像内のオブジェクトを適切に表せる場合がある。例えば、図5(A)の元画像SIの描画G1については、図6(B)の合成画像CIにおいて、描画G1の輪郭PGdが表示されることが、好ましいと考えられる。したがって、この場合には、第1のオブジェクトの輪郭を含む合成画像データや処理済合成画像データが出力されることが適切であると考えられる。   In the second embodiment, when the original image SI is the first type image (specifically, an image showing a photograph) (S240: YES), corrected image data is output (S245). When the original image SI is the second type of image (specifically, an image showing an object different from the photograph) (S240: NO), composite image data and processed composite image data are output (S250). ). In this way, appropriate image data can be output according to the type of the original image. More specifically, when color drop processing is performed on an image showing a photograph, the user often wants to remove an object of a specific color in the photograph. In this case, when an outline is displayed in a photograph, an unnatural image is often obtained. Therefore, in this case, it is considered appropriate to output corrected image data that does not include a contour image. On the other hand, when color drop processing is performed on an object different from a photograph, for example, an image showing characters or computer graphics, the user may want to remove the color of a solid area in the image. Many. In this case, it may be possible to appropriately represent the object in the image by displaying the outline of the removed solid area. For example, for the drawing G1 of the original image SI in FIG. 5A, it is considered preferable that the contour PGd of the drawing G1 is displayed in the composite image CI in FIG. 6B. Therefore, in this case, it is considered appropriate to output composite image data including the outline of the first object and processed composite image data.

さらに、第2実施例によれば、ユーザが、輪郭の表示を行うか否かの指示を入力することができ(図10)、CPU210は、ユーザから輪郭の表示指示が入力された場合には(S230:YES)、第1のオブジェクトの輪郭を含む合成画像データや処理済合成画像データが出力され(S250)、非表示指示が入力された場合には(S230:NO)、第1のオブジェクトの輪郭を含まない補正済画像データが出力される(S245)。この結果、ユーザの意図に沿った画像を出力することができる。   Furthermore, according to the second embodiment, the user can input an instruction as to whether or not to display a contour (FIG. 10), and the CPU 210 receives a contour display instruction from the user. (S230: YES), the composite image data including the outline of the first object and the processed composite image data are output (S250), and when a non-display instruction is input (S230: NO), the first object The corrected image data that does not include the contour is output (S245). As a result, an image according to the user's intention can be output.

C.変形例:
(1)上記実施例では、第1のエッジ画像データと、第2のエッジ画像データと、を用いて、差分画像データを生成することによって、背景除去処理によって除去される第1のオブジェクトの輪郭が抽出されている(図2のS35〜S50)。これに代えて、他の方法で第1のオブジェクトの輪郭を抽出しても良い。例えば、第1のエッジ画像データのみを用いて、第1のオブジェクトの輪郭が抽出されても良い。第1のエッジ画像データによって表される第1のエッジ画像EI1では、複数個のエッジ画素によって、背景除去処理によって除去される第1のオブジェクトの輪郭と、除去されない第2のオブジェクトの輪郭と、の両方が抽出されている。このために、第1のエッジ画像データが生成された時点で、第2のエッジ画像データを用いなくても、第1のオブジェクトの輪郭と第2のオブジェクトの輪郭とは区別できないものの、第1のオブジェクトの輪郭は、元画像SIから既に抽出されている、と言うことができる。このために、例えば、S55では、CPU210は、補正済画像データと、第1のエッジ画像データと、を用いて、合成画像データを生成しても良い。具体的には、CPU210は、補正済画像AI内の複数個の画素のうち、第1のエッジ画像EI1のエッジ画素に対応する画素のRGB値を、元画像SI内の対応する画素のRGB値に変更し、エッジ画像EI1の非エッジ画素に対応する画素のRGB値を、変更しない。これによって、合成画像データが生成されても良い。この場合には、補正済画像AI内の第2のオブジェクトの輪郭を構成する画素の値も、元画像SIの対応する画素の値に変更されるが、第2のオブジェクトの輪郭を構成する画素の値は、補正済画像AIにおいても元画像SIにおいても同じ値であるので、結果にはほぼ影響がない。このために、本変形例の方法で、合成画像データを生成しても、上記実施例とほぼ同様の合成画像データを生成することができる。
C. Variations:
(1) In the above embodiment, the contour of the first object to be removed by the background removal process by generating the difference image data using the first edge image data and the second edge image data. Are extracted (S35 to S50 in FIG. 2). Instead, the outline of the first object may be extracted by another method. For example, the outline of the first object may be extracted using only the first edge image data. In the first edge image EI1 represented by the first edge image data, the contour of the first object that is removed by the background removal process and the contour of the second object that is not removed by the plurality of edge pixels, Both have been extracted. For this reason, when the first edge image data is generated, the first object contour and the second object contour cannot be distinguished without using the second edge image data. It can be said that the outline of the object has already been extracted from the original image SI. Therefore, for example, in S55, the CPU 210 may generate composite image data using the corrected image data and the first edge image data. Specifically, the CPU 210 calculates the RGB value of the pixel corresponding to the edge pixel of the first edge image EI1 among the plurality of pixels in the corrected image AI, and the RGB value of the corresponding pixel in the original image SI. And the RGB values of the pixels corresponding to the non-edge pixels of the edge image EI1 are not changed. Thereby, the composite image data may be generated. In this case, although the value of the pixel constituting the contour of the second object in the corrected image AI is also changed to the value of the corresponding pixel in the original image SI, the pixel constituting the contour of the second object Is the same value in the corrected image AI and in the original image SI, so the result is hardly affected. For this reason, even if composite image data is generated by the method of this modification, it is possible to generate composite image data that is substantially the same as in the above-described embodiment.

また、元画像データと補正済画像データとの差分を示す画像データを生成し、該画像データに対してエッジ抽出処理を実行することによって、第1のオブジェクトの輪郭を示すエッジ画像データを生成しても良い。この方法によっても、第1のオブジェクトの輪郭を抽出することができる。   Further, by generating image data indicating a difference between the original image data and the corrected image data, and performing edge extraction processing on the image data, edge image data indicating the contour of the first object is generated. May be. Also by this method, the contour of the first object can be extracted.

(2)上記実施例では、合成画像CIに含まれる第1のオブジェクトの輪郭は、元画像SI内の第1のオブジェクトの色を有している。これに代えて、合成画像CIに含まれる第1のオブジェクトの輪郭の色は、背景色(本実施例では白色)と異なる他の色、例えば、黒やグレーであっても良い。CPU210は、元画像SI内の第1のオブジェクトの色が、背景色に極めて近い場合には、例えば、第1のオブジェクトの平均色と背景色との色の差が基準値未満である場合には、合成画像CI内の第1のオブジェクトの輪郭の色を、元画像SI内の第1のオブジェクトの色に拘わらずに、黒やグレーに設定しても良い。こうすれば、合成画像CIにおいて、第1のオブジェクトの輪郭の色が視認し難くなることを抑制できる。第1のオブジェクトの平均色と背景色との色の差には、例えば、2個の色を示す色値のRGB色空間におけるユークリッド距離が用いられる。 (2) In the above embodiment, the outline of the first object included in the composite image CI has the color of the first object in the original image SI. Instead, the color of the outline of the first object included in the composite image CI may be another color different from the background color (white in this embodiment), for example, black or gray. When the color of the first object in the original image SI is very close to the background color, the CPU 210, for example, when the color difference between the average color of the first object and the background color is less than the reference value. The color of the outline of the first object in the composite image CI may be set to black or gray regardless of the color of the first object in the original image SI. In this way, it is possible to prevent the outline color of the first object from becoming difficult to visually recognize in the composite image CI. For the color difference between the average color of the first object and the background color, for example, the Euclidean distance in the RGB color space of color values indicating two colors is used.

(3)上記第1実施例および第2実施例において、図2のS60以降の処理が省略されて、S55で生成された合成画像データが出力(例えば、印刷や保存)されても良い。 (3) In the first and second embodiments, the processing after S60 in FIG. 2 may be omitted, and the composite image data generated in S55 may be output (for example, printed or saved).

(4)上記第2実施例では、元画像SIが写真を示す画像である場合に、第1のオブジェクトの輪郭を含まない補正済画像データが出力され、元画像SIが写真とは異なるオブジェクトを示す画像である場合に、第1のオブジェクトの輪郭を含む補正済画像データが出力される。これに限らず、他の分類方法によって分類される元画像SIの種類に応じて、出力すべき画像データを切り替えても良い。例えば、元画像SIに写真を示す画像を含む場合において、元画像SIが、写真のみを含み、写真とは異なるオブジェクトを含まない画像である場合には、第1のオブジェクトの輪郭を含まない補正済画像データが出力され、元画像SIが、写真と、写真とは異なるオブジェクトと、の両方を含む画像である場合には、第1のオブジェクトの輪郭を含む補正済画像データが出力されても良い。写真のみを含む画像にカラードロップ処理が行われる場合は、上述したように、ユーザが意図的に、写真内の一部のオブジェクトを除去するために、行われる可能性が高い。この場合には、上述したように、除去されたオブジェクトの輪郭を表示する必要性が比較的低い。これに対して、写真と、写真とは異なるオブジェクトと、の両方を含む画像にカラードロップ処理が行われる場合には、写真とは異なるオブジェクトの全部または一部を除去するために、行われる可能性が高い。この場合には、写真内の一部のオブジェクトがユーザの意図に反して除去される可能性があるので、除去されたオブジェクトの輪郭を表示する必要性が比較的高いからである。 (4) In the second embodiment, when the original image SI is an image showing a photograph, corrected image data not including the outline of the first object is output, and an object whose original image SI is different from the photograph is displayed. In the case of the image shown, corrected image data including the outline of the first object is output. However, the present invention is not limited to this, and the image data to be output may be switched according to the type of the original image SI classified by another classification method. For example, in the case where the original image SI includes an image showing a photograph, if the original image SI is an image that includes only a photograph and does not include an object different from the photograph, the correction that does not include the outline of the first object When the completed image data is output and the original image SI is an image including both a photograph and an object different from the photograph, the corrected image data including the outline of the first object is output. good. When the color drop process is performed on an image including only a photograph, there is a high possibility that the user intentionally removes some objects in the photograph as described above. In this case, as described above, the necessity of displaying the contour of the removed object is relatively low. On the other hand, when color drop processing is performed on an image that includes both a photo and an object that is different from the photo, it can be done to remove all or part of the object that is different from the photo. High nature. In this case, since some objects in the photograph may be removed against the user's intention, the necessity of displaying the outline of the removed object is relatively high.

(5)上記各実施例では、元画像データは、スキャナ部250によって生成されるスキャンデータである。これに限らず、光学的に読み取られた画像を表す種々の画像データを採用可能である。例えば、デジタルカメラによる撮影によって、原稿が光学的に読み取られることによって生成される画像データであっても良い。 (5) In each of the above embodiments, the original image data is scan data generated by the scanner unit 250. The present invention is not limited to this, and various image data representing an optically read image can be employed. For example, it may be image data generated by optically reading a document by photographing with a digital camera.

(6)なお、上記各実施例では、CPU210は、背景除去処理において、背景色範囲RA外のRGB値を有する画素の値を変更していないが、これに代えて、背景色範囲RA外のRGB値を、背景色範囲RAに近いほど、白色に近づくように、画素の値を変更しても良い。この場合には、補正済画像において、白色の領域と、白色とは異なる色の領域と、の間に、不自然な境界線が現れることを抑制できる。この場合には、元画像SI内の第2のオブジェクトと、補正済画像AI内の第2のオブジェクトとは、完全に同じではなく、色が少し異なり得る。 (6) In each of the above embodiments, the CPU 210 does not change the value of the pixel having the RGB value outside the background color range RA in the background removal process, but instead, it is outside the background color range RA. The pixel value may be changed so that the RGB value is closer to white as the background color range RA is approached. In this case, it is possible to suppress the appearance of an unnatural boundary line between the white region and the color region different from white in the corrected image. In this case, the second object in the original image SI and the second object in the corrected image AI are not completely the same, and the colors may be slightly different.

(7)上記各実施例において計算機200のCPU210によって実行される図2、図3のスキャン処理および図9の色補正処理は、例えば、複合機100の制御部110によって実行されても良い。この場合には、計算機200は不要であり、複合機100が単体でこれらの処理を実行すればよい。 (7) The scan processing of FIGS. 2 and 3 and the color correction processing of FIG. 9 executed by the CPU 210 of the computer 200 in each of the above embodiments may be executed by the control unit 110 of the MFP 100, for example. In this case, the computer 200 is not necessary, and the multifunction peripheral 100 only needs to execute these processes alone.

(8)また、図2、図3のスキャン処理および図9の色補正処理は、複合機100や計算機200と通信可能に接続されたサーバによって実行されても良い。サーバは、例えば、複合機100の製造者によって管理されていても良い。この場合には、例えば、サーバは、合成画像CIを含むUI画面WI2を示す画面データを、複合機100または計算機200に送信することによって、複合機100または計算機200の表示部にUI画面WI2を表示させる。そして、サーバは、複合機100または計算機200を介して、ユーザからの指示を取得して、処理済合成画像ACIを表す処理済画像データを生成する。生成された示す合成画像データは、サーバから、複合機100または計算機200に出力される。サーバは、1個の計算機でも良く、互いに通信可能な複数個の計算機を含む計算システムであっても良い。 (8) Further, the scan processing of FIGS. 2 and 3 and the color correction processing of FIG. 9 may be executed by a server that is communicably connected to the multifunction device 100 or the computer 200. The server may be managed by the manufacturer of the multifunction device 100, for example. In this case, for example, the server transmits the screen data indicating the UI screen WI2 including the composite image CI to the multifunction device 100 or the computer 200, so that the UI screen WI2 is displayed on the display unit of the multifunction device 100 or the computer 200. Display. Then, the server obtains an instruction from the user via the multifunction peripheral 100 or the computer 200, and generates processed image data representing the processed composite image ACI. The generated composite image data shown is output from the server to the multifunction peripheral 100 or the computer 200. The server may be a single computer or a computer system including a plurality of computers that can communicate with each other.

(9)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。 (9) In each of the above embodiments, a part of the configuration realized by hardware may be replaced with software, and conversely, part or all of the configuration realized by software is replaced with hardware. You may do it.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。   As mentioned above, although this invention was demonstrated based on the Example and the modification, Embodiment mentioned above is for making an understanding of this invention easy, and does not limit this invention. The present invention can be changed and improved without departing from the spirit and scope of the claims, and equivalents thereof are included in the present invention.

100...複合機、110...制御部、120...スキャナ部、130...プリンタ部、200...計算機、210...CPU、220...不揮発性記憶装置、230...揮発性記憶装置、231...バッファ領域、250...スキャナ部、260...操作部、270...表示部、280...通信部   DESCRIPTION OF SYMBOLS 100 ... MFP, 110 ... Control part, 120 ... Scanner part, 130 ... Printer part, 200 ... Computer, 210 ... CPU, 220 ... Nonvolatile storage device, 230 ... volatile storage device, 231 ... buffer area, 250 ... scanner unit, 260 ... operation unit, 270 ... display unit, 280 ... communication unit

Claims (14)

特定範囲内の階調値を有する複数個の画素を含む第1のオブジェクトと、前記第1のオブジェクトとは異なる第2のオブジェクトであって前記特定範囲外の階調値を有する複数個の画素を含む前記第2のオブジェクトと、を含む元画像を表す元画像データであって、原稿を光学的に読み取ることによって生成される、前記元画像データを取得する取得機能と、
前記元画像データに対して特定の補正処理を実行することによって、前記第2のオブジェクトを含む補正済画像を表す補正済画像データを生成する補正機能であって、前記特定の補正処理は、前記特定範囲内の階調値を有する画素の値を、特定の階調値に変更する処理である、前記補正機能と、
前記元画像データを用いて、前記元画像内の前記第1のオブジェクトの輪郭を抽出する抽出機能と、
前記補正済画像データを用いて、出力画像を表す出力画像データを生成する生成機能であって、前記出力画像は、前記第1のオブジェクトの輪郭を示す輪郭画像と、前記補正済画像内の前記第2のオブジェクトと、を含む、前記生成機能と、
前記出力画像データを出力する出力機能と、
をコンピュータに実現させるコンピュータプログラム。
A first object including a plurality of pixels having gradation values within a specific range, and a plurality of pixels that are second objects different from the first object and have gradation values outside the specific range An original image data representing an original image including the second object, and an acquisition function for acquiring the original image data generated by optically reading a document;
A correction function for generating corrected image data representing a corrected image including the second object by executing a specific correction process on the original image data, wherein the specific correction process includes: The correction function, which is a process of changing the value of a pixel having a gradation value within a specific range to a specific gradation value;
An extraction function for extracting an outline of the first object in the original image using the original image data;
A generation function for generating output image data representing an output image using the corrected image data, wherein the output image includes a contour image indicating a contour of the first object, and the corrected image in the corrected image. A second object; and the generation function,
An output function for outputting the output image data;
A computer program that causes a computer to realize
請求項1に記載のコンピュータプログラムであって、さらに、
前記抽出機能は、
前記元画像データに対してエッジ画素を抽出するエッジ抽出処理を実行することによって第1のエッジ画像を表す第1のエッジ画像データを生成し、
前記第1のエッジ画像データを用いて、前記第1のオブジェクトの輪郭を抽出する、コンピュータプログラム。
The computer program according to claim 1, further comprising:
The extraction function is
Generating first edge image data representing a first edge image by performing an edge extraction process for extracting edge pixels on the original image data;
A computer program for extracting an outline of the first object using the first edge image data.
請求項2に記載のコンピュータプログラム
前記抽出機能は、
前記補正済画像データに対して前記エッジ抽出処理を実行することによって第2のエッジ画像を表す第2のエッジ画像データを生成し、
前記第1のエッジ画像データと前記第2のエッジ画像データとを用いて、前記第1のオブジェクトの輪郭を抽出する、コンピュータプログラム。
The computer program according to claim 2, wherein the extraction function is:
Generating second edge image data representing a second edge image by performing the edge extraction process on the corrected image data;
A computer program for extracting an outline of the first object by using the first edge image data and the second edge image data.
請求項3に記載のコンピュータプログラムであって、
前記抽出機能は、前記第1のエッジ画像内の複数個のエッジ画素のうち、前記第2のエッジ画像内の対応するエッジ画素が存在しない画素によって構成される領域を、前記第1のオブジェクトの輪郭として抽出する、コンピュータプログラム。
A computer program according to claim 3,
The extraction function is configured to determine, from the plurality of edge pixels in the first edge image, an area constituted by pixels having no corresponding edge pixel in the second edge image. A computer program that extracts contours.
請求項1から請求項4のいずれかに記載のコンピュータプログラムであって、
前記出力画像内の前記第1のオブジェクトの輪郭は、前記元画像内の前記第1のオブジェクトの輪郭と同じ色を有する、コンピュータプログラム。
A computer program according to any one of claims 1 to 4,
A computer program, wherein an outline of the first object in the output image has the same color as an outline of the first object in the original image.
請求項1から請求項5のいずれかに記載のコンピュータプログラムであって、
前記出力画像内の前記第2のオブジェクトは、前記補正済画像内の前記第2のオブジェクトと同じ色を有する、コンピュータプログラム。
A computer program according to any one of claims 1 to 5,
The computer program, wherein the second object in the output image has the same color as the second object in the corrected image.
請求項1から請求項6のいずれか一項に記載のコンピュータプログラムであって、さらに、
前記元画像の種類を判断する第1の判断機能をコンピュータに実現させ、
前記出力機能は、前記元画像が第1種の画像である場合には、前記出力画像データを出力し、前記元画像が第2種の画像である場合には、前記補正済画像データを出力する、コンピュータプログラム。
A computer program according to any one of claims 1 to 6, further comprising:
Causing the computer to implement a first determination function for determining the type of the original image;
The output function outputs the output image data when the original image is a first type image, and outputs the corrected image data when the original image is a second type image. A computer program.
請求項7に記載のコンピュータプログラムであって、
前記第1種の画像は、写真とは異なるオブジェクトを示す画像であり、
前記第2種の画像は、写真を示す画像である、コンピュータプログラム。
A computer program according to claim 7,
The first type image is an image showing an object different from a photograph,
The computer program in which the second type of image is an image showing a photograph.
請求項1から請求項8のいずれか一項に記載のコンピュータプログラムであって、さらに、
前記元画像に対する前記特定の補正処理の種類を判断する第2の判断機能をコンピュータに実現させ、
前記出力機能は、前記特定の補正処理が前記元画像の背景色を除去するための処理である場合には、前記出力画像データを出力し、前記特定の補正処理が前記元画像内の前記第1のオブジェクトを除去するための処理である場合には、前記補正済画像データを出力する、コンピュータプログラム。
A computer program according to any one of claims 1 to 8, further comprising:
Causing the computer to realize a second determination function for determining the type of the specific correction processing for the original image;
The output function outputs the output image data when the specific correction process is a process for removing a background color of the original image, and the specific correction process performs the first correction process in the original image. A computer program for outputting the corrected image data in the case of processing for removing one object.
請求項1から請求項9のいずれか一項に記載のコンピュータプログラムであって、
前記第1のオブジェクトの輪郭は、前記第1のオブジェクトの一部の輪郭であって、前記第1のオブジェクトの全体の輪郭ではない、前記一部の輪郭を含む、コンピュータプログラム。
A computer program according to any one of claims 1 to 9,
The computer program, wherein the outline of the first object includes the outline of a part of the first object and not the outline of the whole of the first object.
請求項1から請求項10のいずれか一項に記載のコンピュータプログラムであって、さらに、
前記出力画像を表示部に表示して、前記輪郭画像に関する指示をユーザから取得する指示取得機能と、
第1の指示が取得された場合には、前記出力画像の前記輪郭画像の特定の輪郭を構成する複数個の画素のそれぞれの値を、前記補正済画像内の対応する画素の値に変更し、第2の指示が取得された場合には、前記特定の輪郭によって特定されるオブジェクト領域内の複数個の画素のそれぞれの値を、前記元画像内の対応する画素の値に変更する、変更機能と、
をコンピュータに実現させるコンピュータプログラム。
A computer program according to any one of claims 1 to 10, further comprising:
An instruction acquisition function for displaying the output image on a display unit and acquiring an instruction regarding the contour image from a user;
When the first instruction is acquired, the value of each of the plurality of pixels constituting the specific contour of the contour image of the output image is changed to the value of the corresponding pixel in the corrected image. When the second instruction is acquired, the change is made to change the value of each of the plurality of pixels in the object region specified by the specific contour to the value of the corresponding pixel in the original image. Function and
A computer program that causes a computer to realize
請求項11に記載のコンピュータプログラムであって、
前記変更機能は、第3の指示が取得された場合に、前記出力画像内の前記特定の輪郭を構成する複数個の画素の値を変更しない、コンピュータプログラム。
A computer program according to claim 11,
The change function is a computer program that does not change the values of a plurality of pixels constituting the specific contour in the output image when a third instruction is acquired.
請求項11または請求項12に記載のコンピュータプログラムであって、
前記出力画像の前記輪郭画像は、前記元画像内の複数個の前記第1のオブジェクトのそれぞれの輪郭を含み、
前記指示取得機能は、複数個の輪郭のそれぞれについて、ユーザから指示を取得し、
前記変更機能は、複数個の輪郭のそれぞれについて、ユーザからの指示に基づいて画素の値を変更する、コンピュータプログラム。
A computer program according to claim 11 or claim 12,
The contour image of the output image includes a contour of each of the plurality of first objects in the original image,
The instruction acquisition function acquires an instruction from a user for each of a plurality of contours,
The said change function is a computer program which changes the value of a pixel based on the instruction | indication from a user about each of several outline.
特定範囲内の階調値を有する複数個の画素を含む第1のオブジェクトと、前記第1のオブジェクトとは異なる第2のオブジェクトであって前記特定範囲外の階調値を有する複数個の画素を含む前記第2のオブジェクトと、を含む元画像を表す元画像データであって、原稿を光学的に読み取ることによって生成される、前記元画像データを取得する取得部と、
前記元画像データに対して特定の補正処理を実行することによって、前記第2のオブジェクトを含む補正済画像を表す補正済画像データを生成する補正部であって、前記特定の補正処理は、前記特定範囲内の階調値を有する画素の値を、特定の階調値に変更する処理である、前記補正部と、
前記元画像データを用いて、前記元画像内の前記第1のオブジェクトの輪郭を抽出する抽出部と、
前記補正済画像データを用いて、出力画像を表す出力画像データを生成する生成部であって、前記出力画像は、前記第1のオブジェクトの輪郭を示す輪郭画像と、前記補正済画像内の前記第2のオブジェクトと、を含む、前記生成部と、
前記出力画像データを出力する出力部と、
を備える、画像処理装置。
A first object including a plurality of pixels having gradation values within a specific range, and a plurality of pixels that are second objects different from the first object and have gradation values outside the specific range An original image data representing an original image including the second object, and an acquisition unit that acquires the original image data generated by optically reading a document;
A correction unit that generates corrected image data representing a corrected image including the second object by executing a specific correction process on the original image data, and the specific correction process includes: The correction unit, which is a process of changing the value of a pixel having a gradation value within a specific range to a specific gradation value;
An extraction unit that extracts an outline of the first object in the original image using the original image data;
A generation unit that generates output image data representing an output image using the corrected image data, wherein the output image includes a contour image indicating a contour of the first object, and the corrected image in the corrected image. A second object; and
An output unit for outputting the output image data;
An image processing apparatus comprising:
JP2015071026A 2015-03-31 2015-03-31 Computer program and image processing apparatus Active JP6350362B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015071026A JP6350362B2 (en) 2015-03-31 2015-03-31 Computer program and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015071026A JP6350362B2 (en) 2015-03-31 2015-03-31 Computer program and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2016192646A JP2016192646A (en) 2016-11-10
JP6350362B2 true JP6350362B2 (en) 2018-07-04

Family

ID=57246781

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015071026A Active JP6350362B2 (en) 2015-03-31 2015-03-31 Computer program and image processing apparatus

Country Status (1)

Country Link
JP (1) JP6350362B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7531374B2 (en) 2020-11-27 2024-08-09 シャープ株式会社 Image processing device, control method and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3880483B2 (en) * 2002-08-15 2007-02-14 株式会社リコー Image processing apparatus, image reading apparatus, and image forming apparatus
JP2006081012A (en) * 2004-09-10 2006-03-23 Ricoh Co Ltd Image processing apparatus, image forming apparatus, image processing method, and program causing computer to execute the method
JP2008048057A (en) * 2006-08-11 2008-02-28 Fuji Xerox Co Ltd Image reader, image processor and program

Also Published As

Publication number Publication date
JP2016192646A (en) 2016-11-10

Similar Documents

Publication Publication Date Title
JP6781406B2 (en) Image processing equipment and computer programs
JP6098298B2 (en) Image processing apparatus and computer program
JP6747224B2 (en) Image processing device and computer program
JP6769045B2 (en) Image processing equipment and computer programs
JP4743180B2 (en) Image display control device, photographing device, image display method and program thereof
US11706371B2 (en) Apparatus and method for performing enhancement processing on color information
JP6248755B2 (en) Image processing apparatus and computer program
JP6341085B2 (en) Image processing apparatus and computer program
JP2002262299A (en) False color removal device, false color removal program, false color removal method, and digital camera
US9277074B2 (en) Image processing apparatus, method, and medium determining whether image data of a page to be processed is blank and contains a foreground object and transmitting the foreground object obtained by removing a background object
JP6350362B2 (en) Computer program and image processing apparatus
US9894244B2 (en) Image processing system and image processing method that perform correction of shifting bitmap data in a sub-scanning direction to cancel bending of and electro-photographic laser scanning line
JP4197008B2 (en) Image processing method, program, and image processing apparatus
US8000555B2 (en) Defective image detection method and storage medium storing program
JP6882043B2 (en) Image processing equipment, programs and image processing methods
JP6794901B2 (en) Image processing equipment and computer programs
CN101155264B (en) Image display control device, photographing device, image display method
JP4197006B2 (en) Defect image detection method, program, and image processing apparatus
US12014702B2 (en) Image processing apparatus, image processing method, and storage medium
JP5949399B2 (en) Image processing apparatus and program
JP2018148378A (en) Image processing device and computer program
JP5652067B2 (en) Image processing apparatus, image processing method, and program
JP6418055B2 (en) Image processing apparatus and computer program
JP6781398B2 (en) Image processing equipment and computer programs
JP6834701B2 (en) Image processing equipment and computer programs

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180426

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180521

R150 Certificate of patent or registration of utility model

Ref document number: 6350362

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150