JP2009157449A - Image processing system, image processing method, and program for image processing - Google Patents

Image processing system, image processing method, and program for image processing Download PDF

Info

Publication number
JP2009157449A
JP2009157449A JP2007332030A JP2007332030A JP2009157449A JP 2009157449 A JP2009157449 A JP 2009157449A JP 2007332030 A JP2007332030 A JP 2007332030A JP 2007332030 A JP2007332030 A JP 2007332030A JP 2009157449 A JP2009157449 A JP 2009157449A
Authority
JP
Japan
Prior art keywords
pixel
image
class
color
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007332030A
Other languages
Japanese (ja)
Inventor
Akihiko Iketani
彰彦 池谷
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2007332030A priority Critical patent/JP2009157449A/en
Publication of JP2009157449A publication Critical patent/JP2009157449A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To clear an outline of an enlarged image to improve the quality of an image even when the enlarged image is deteriorated due to a block noise and a color mixture. <P>SOLUTION: A representative color prediction means 802 extracts a block of pixels centered by the pixels of an interpolation image, performs clustering of the colors of the pixels in the bloc to a first class and to a second class, and derives a probability that the color of each pixel in the block belongs to each class, and a representative color of each class. When a distance between two representative colors is longer than a threshold, a color correction means 803 replaces the color of the pixel to the representative color of the first class if a condition that the probability that the color of the pixel belongs to the first class is stronger than the probability that the color belongs to the second class is satisfied, and replaces the color of the pixel to the representative color of the second class if the condition is not satisfied for each pixel in the block extracted by the prediction means 802. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像処理システム、画像処理方法、画像処理用プログラム、画像圧縮装置、画像伸張装置および画像伝送システムに関し、特に拡大された画像の品質を向上させる画像処理システム、画像処理方法、画像処理用プログラムと、その画像処理システムを適用した画像圧縮装置、画像伸張装置および画像伝送システムに関する。   The present invention relates to an image processing system, an image processing method, an image processing program, an image compression device, an image expansion device, and an image transmission system, and more particularly to an image processing system, an image processing method, and an image processing for improving the quality of an enlarged image. And an image compression apparatus, an image expansion apparatus and an image transmission system to which the image processing system is applied.

画像の拡大方法が種々提案されている。特に多く見られる方法は、画像のアップサンプリング後(あるいはアップリンクと同時に)、画像のフィルタ処理を行う方法である。また、増加させる画素の輝度を補間により求めることで画像を拡大する方法として、バイリニア補間やバイキュービック補間が知られている(例えば、非特許文献1参照)。図27は、低解像度画像を倍率縦横各2倍にアップサンプリングした画像の例である。図28は、拡大画像における画素の輝度をバイキュービック補間により補間した画像の例である。   Various methods for enlarging images have been proposed. A particularly common method is a method of performing image filtering after image upsampling (or simultaneously with uplink). Bilinear interpolation and bicubic interpolation are known as methods for enlarging an image by obtaining the luminance of the pixel to be increased by interpolation (see, for example, Non-Patent Document 1). FIG. 27 is an example of an image obtained by up-sampling a low-resolution image at a magnification of 2 times in the vertical and horizontal directions. FIG. 28 is an example of an image obtained by interpolating the luminance of the pixels in the enlarged image by bicubic interpolation.

これらの手法では、拡大後の画像がぼける傾向がある。これは、画像拡大に伴い画像の高周波成分が失われるためである。そのため、失われた高周波成分を補い、本来の輪郭を復元するために、輪郭強調処理を適用するのが一般的である。   These methods tend to blur the enlarged image. This is because high-frequency components of the image are lost as the image is enlarged. Therefore, it is common to apply contour enhancement processing to compensate for the lost high-frequency component and restore the original contour.

輪郭強調のための画像処理装置の一例が、特許文献1に記載されている。図29は、特許文献1に記載された画像処理装置を示すブロック図である。図29に示すように、特許文献1に記載された画像処理装置は、輪郭成分抽出回路901、信号レベル検出回路902、および輪郭検出回路904からなる解析回路920と、パラメータ算出回路903と、輪郭補正回路905とを備えている。   An example of an image processing apparatus for contour enhancement is described in Patent Document 1. FIG. 29 is a block diagram illustrating an image processing apparatus described in Patent Document 1. As shown in FIG. 29, the image processing apparatus described in Patent Document 1 includes an analysis circuit 920 including a contour component extraction circuit 901, a signal level detection circuit 902, and a contour detection circuit 904, a parameter calculation circuit 903, a contour And a correction circuit 905.

解析回路920には、映像信号Siと入力源判別信号Sselが入力される。入力源判別信号Sselは、入力映像信号Siの種別を示す信号であって、例えば入力映像信号SiがHDTV(High Definition Television)方式に基づく映像信号である場合にはHレベル(ハイレベル)となり、NTSC(National Television System Committee)方式に基づく映像信号である場合にはLレベル(ローレベル)となる。   The analysis circuit 920 receives the video signal Si and the input source determination signal Ssel. The input source determination signal Ssel is a signal indicating the type of the input video signal Si. For example, when the input video signal Si is a video signal based on the HDTV (High Definition Television) system, the input source determination signal Ssel is H level (high level). In the case of a video signal based on the NTSC (National Television System Committee) system, it becomes L level (low level).

上記画像処理装置において、輪郭成分抽出回路901は、入力源判別信号Sselに応じて、入力映像信号Siの示す画像における輪郭に相当する成分である輪郭成分(「エッジ成分」または「輪郭信号」とも呼ばれる)Saを入力映像信号Siから抽出する。輪郭成分抽出回路901は、高域通過フィルタで構成され、例えば2次微分フィルタを用いて入力映像信号Siの2次微分成分を抽出して輪郭成分Saとして出力する。   In the image processing apparatus, the contour component extraction circuit 901 is a component corresponding to the contour in the image indicated by the input video signal Si (“edge component” or “contour signal”) in accordance with the input source determination signal Ssel. Sa) is extracted from the input video signal Si. The contour component extraction circuit 901 is composed of a high-pass filter, and extracts, for example, a secondary differential component of the input video signal Si using a secondary differential filter and outputs it as a contour component Sa.

信号レベル検出回路902は、入力映像信号Siの信号レベルLbを検出し、その信号レベルLbを信号値とする信号を出力する。   The signal level detection circuit 902 detects the signal level Lb of the input video signal Si and outputs a signal having the signal level Lb as a signal value.

パラメータ算出回路903は、外部から第1のパラメータαiと第2のパラメータβiと第3のパラメータDiとを受け取り、これらの外部パラメータαi、βi、Diに基づき、輪郭の過強調を抑制するための第1の閾値としての過強調補正閾値α、微細画像の輪郭を強調するための第2の閾値としての微細成分強調閾値β、および、輪郭検出のための第3の閾値としての輪郭検出閾値Dを算出する。   The parameter calculation circuit 903 receives the first parameter αi, the second parameter βi, and the third parameter Di from the outside, and suppresses over-enhancement of the contour based on these external parameters αi, βi, Di. An overemphasis correction threshold value α as a first threshold value, a fine component enhancement threshold value β as a second threshold value for emphasizing the contour of a fine image, and a contour detection threshold value D as a third threshold value for contour detection Is calculated.

輪郭検出回路904は、入力映像信号Siの変化量を演算により求めた値と輪郭検出閾値Dとを比較し、その比較結果に基づき、輪郭の有無を示す輪郭検出信号Scを出力する。   The contour detection circuit 904 compares the value obtained by calculating the change amount of the input video signal Si with the contour detection threshold D, and outputs a contour detection signal Sc indicating the presence or absence of the contour based on the comparison result.

輪郭補正回路905は、輪郭成分抽出回路901から出力される輪郭成分Saと、輪郭検出回路904から出力される輪郭検出信号Scと、パラメータ算出回路903から出力される過強調補正閾値α及び微細成分強調閾値βと、外部からゲイン調整パラメータとして与えられる係数γとを用いて、入力映像信号Siに対し輪郭強調のための信号処理を行い、この信号処理の結果として出力映像信号Soを生成する。   The contour correction circuit 905 includes a contour component Sa output from the contour component extraction circuit 901, a contour detection signal Sc output from the contour detection circuit 904, an overemphasis correction threshold α and a fine component output from the parameter calculation circuit 903. Using the emphasis threshold β and a coefficient γ given as an external gain adjustment parameter, signal processing for contour emphasis is performed on the input video signal Si, and an output video signal So is generated as a result of this signal processing.

また、非特許文献1には、EMアルゴリズム(Expectation Maximizationアルゴリズム)が記載されている。   Non-Patent Document 1 describes an EM algorithm (Expectation Maximization algorithm).

特開2002−290773号公報 (段落0041−0043、図1)JP 2002-290773 A (paragraphs 0041-0043, FIG. 1) 高木幹雄、下田陽久監修、「新編 画像解析ハンドブック」、初版、東京大学出版会、2004年9月10日、p.728−732,p.1362−1367Supervised by Mikio Takagi and Yoshihisa Shimoda, “New Edition Image Analysis Handbook”, first edition, The University of Tokyo Press, September 10, 2004, p. 728-732, p. 1362-1367

拡大画像に輪郭強調を適用しても、目的とする輪郭を復元できないという問題があった。これは、輪郭周辺では、画像圧縮に伴うブロックノイズや、輪郭を境に隣接し合う複数の色の混色などの画質劣化が生じて、輪郭の形状が変化してしまっているためである。図30は、バイキュービック補間による拡大画像に輪郭強調を適用した結果の例を示す画像である。図30に例示するように、輪郭強調処理を行っても、輪郭が十分に明瞭となった画像とはなっていない。   There is a problem that even if contour enhancement is applied to an enlarged image, the target contour cannot be restored. This is because the shape of the contour changes around the contour due to image quality degradation such as block noise accompanying image compression and a mixture of colors adjacent to the contour. FIG. 30 is an image showing an example of a result of applying contour enhancement to an enlarged image by bicubic interpolation. As illustrated in FIG. 30, even when the contour emphasis process is performed, the image does not have a sufficiently clear contour.

本発明は、拡大された画像がブロックノイズや混色により劣化している場合であっても、その拡大画像における輪郭を明瞭化し、画像を高品質化させる画像処理システム、画像処理方法、画像処理用プログラム、およびその画像処理システムを適用した画像圧縮装置、画像伸張装置および画像伝送システムを提供することを目的とする。   The present invention provides an image processing system, an image processing method, and an image processing method for clarifying an outline in an enlarged image and improving the quality of the image even when the enlarged image is deteriorated due to block noise or color mixing. It is an object of the present invention to provide a program and an image compression apparatus, an image expansion apparatus, and an image transmission system to which the image processing system is applied.

本発明の画像処理システムは、拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを備えることを特徴とする。   The image processing system of the present invention selects a pixel in an interpolated image that is an enlarged image including pixels interpolated between pixels of an image before enlargement, and extracts a block of pixels centered on the selected pixel And clustering the colors of the pixels in the block into a first class and a second class, and the probability that the color of each pixel in the block belongs to the first class and the probability of belonging to the second class, Representative color estimation means for deriving the representative colors of the first class and the second class, and when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold, When the condition that the probability that the color of the pixel belongs to the first class is higher than the probability of the second class is satisfied for each individual pixel in the block extracted by the estimation unit, the color of the pixel is 1 class representative If the condition is not satisfied, the color of the pixel is replaced with the representative color of the second class, and when one pixel belongs to a plurality of blocks, the pixel is derived for each block. And color correction means for setting the average of the replaced colors to the color of the pixel.

また、本発明の画像圧縮装置は、入力画像をダウンサンプリングすることにより、前記入力画像よりも解像度の低い低解像度画像を生成するダウンサンプリング手段と、前記低解像度画像を拡大する拡大画像生成手段と、前記入力画像と前記低解像度画像の対応する画素同士の画素値の差である差分データを計算する画像減算手段とを備え、前記拡大画像生成手段が、拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを有することを特徴とする。   The image compression apparatus of the present invention includes a downsampling unit that generates a low resolution image having a lower resolution than the input image by downsampling the input image, and an enlarged image generation unit that expands the low resolution image. Image subtracting means for calculating difference data that is a difference between pixel values of corresponding pixels of the input image and the low-resolution image, and the enlarged image generating means inserts pixels between pixels of the enlargement target image. Interpolating image generating means for generating an interpolated image obtained by enlarging the image to be enlarged by inserting, selecting a pixel in the interpolated image, extracting a block of pixels centered on the selected pixel, Are clustered into a first class and a second class, and the probability that the color of each pixel in the block belongs to the first class and the second class. The representative color estimation means for deriving the probability of belonging to the first class and the representative colors of the first class and the second class, and the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value When the condition that the probability that the color of the pixel belongs to the first class is higher than the probability of the second class is satisfied for each individual pixel in the block extracted by the representative color estimation unit, the pixel If the color is replaced with the representative color of the first class and the condition is not satisfied, the color of the pixel is replaced with the representative color of the second class, and one pixel belongs to a plurality of blocks And color correction means for setting the average color after replacement derived for the pixel for each block to the color of the pixel.

また、本発明の画像伸張装置は、原画像を低解像度化した低解像度画像と、前記原画像と前記低解像度画像の対応する画素同士の画素値の差である差分データとが入力され、前記低解像度画像を伸長する画像伸張装置であって、前記低解像度画像を拡大する拡大画像生成手段と、前記拡大画像生成手段が拡大した画像と前記差分データの対応する画素同士の画素値の和を計算する画像加算手段とを備え、前記拡大画像生成手段が、拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを有することを特徴とする。   The image expansion device of the present invention receives a low-resolution image obtained by reducing the resolution of the original image, and difference data that is a difference between pixel values of corresponding pixels of the original image and the low-resolution image. An image expansion device that expands a low-resolution image, comprising: an enlarged image generating unit that expands the low-resolution image; and a sum of pixel values of pixels corresponding to the image enlarged by the enlarged image generating unit and the difference data Interpolating image generating means for calculating, interpolating image generating means for generating an interpolated image obtained by enlarging the enlarging target image by interpolating pixels between pixels of the enlarging target image; and Select a pixel in the interpolated image, extract a block of pixels centered on the selected pixel, cluster the colors of the pixels in the block into a first class and a second class, Representative color estimation means for deriving the probability that the color of each pixel belongs to the first class, the probability of belonging to the second class, and the representative colors of the first class and the second class; When the distance between the representative colors of the first class and the second class is equal to or greater than the threshold, the probability that the color of the pixel belongs to the first class is the first for each individual pixel in the block extracted by the representative color estimation unit. If the condition of higher than the probability of belonging to the second class is satisfied, the color of the pixel is replaced with the representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. And a color correction unit that uses the average of the replaced colors derived for each pixel for each block when the pixel belongs to a plurality of blocks. It is characterized by that.

また、本発明の画像伝送システムは、画像圧縮装置と画像伸張装置とを備え、前記画像圧縮装置が、入力画像をダウンサンプリングすることにより、前記入力画像よりも解像度の低い低解像度画像を生成し、前記低解像度画像を前記画像伸張装置に送信するダウンサンプリング手段と、前記低解像度画像を拡大する第1の拡大画像生成手段と、前記入力画像と前記低解像度画像の対応する画素同士の画素値の差である差分データを計算し、前記差分データを前記画像伸張装置に送信する画像減算手段とを有し、前記画像伸張装置が、前記画像圧縮装置から受信した低解像度画像を拡大する第2の拡大画像生成手段と、前記第2の拡大画像生成手段が拡大した画像と、前記画像圧縮装置から受信した差分データの対応する画素同士の画素値の和を計算する画像加算手段とを有し、前記第1の拡大画像生成手段および前記第2の拡大画像生成手段が、拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを含むことを特徴とする。   The image transmission system of the present invention further includes an image compression device and an image expansion device, and the image compression device generates a low-resolution image having a lower resolution than the input image by down-sampling the input image. Downsampling means for transmitting the low resolution image to the image expansion device, first enlarged image generating means for enlarging the low resolution image, and pixel values of corresponding pixels of the input image and the low resolution image Second subtracting the low-resolution image received from the image compressing device, the image subtracting means for calculating the difference data as a difference between the image compressing device and transmitting the difference data to the image decompressing device. Of the enlarged image generating means, the image enlarged by the second enlarged image generating means, and the sum of the pixel values of corresponding pixels of the difference data received from the image compression apparatus An image adding means for calculating, and the first enlarged image generating means and the second enlarged image generating means enlarge the enlargement target image by interpolating pixels between pixels of the enlargement target image. An interpolated image generating means for generating the interpolated image, a pixel in the interpolated image is selected, a block of pixels centered on the selected pixel is extracted, and the color of the pixel in the block is set to the first class and the first Clustering into two classes, the probability that the color of each pixel in the block belongs to the first class, the probability of belonging to the second class, the representative colors of the first class and the second class, When the distance between the representative color estimation means for deriving and the representative colors of the first class and the second class is greater than or equal to a threshold value, for each individual pixel in the block extracted by the representative color estimation means, The color is first If the condition that the probability of belonging to the class is higher than the probability of belonging to the second class is satisfied, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel Is replaced with the representative color of the second class, and when one pixel belongs to a plurality of blocks, the average of the replaced colors derived for the pixel for each block is used as the color of the pixel. Color correction means.

また、本発明の画像処理方法は、拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定ステップと、前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定ステップで抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正ステップとを含むことを特徴とする。   The image processing method of the present invention selects a pixel in an interpolated image, which is an enlarged image including pixels interpolated between pixels of the image before enlargement, and a block of pixels centered on the selected pixel. Are extracted, and the colors of pixels in the block are clustered into a first class and a second class, and the probability that each pixel color in the block belongs to the first class and the second class. A representative color estimating step for deriving a probability and representative colors of the first class and the second class, and a distance between the representative colors of the first class and the second class is equal to or greater than a threshold value, When the condition that the probability that the color of the pixel belongs to the first class is higher than the probability of the second class is satisfied for each individual pixel in the block extracted in the representative color estimation step, the color of the pixel is The first If the condition is not satisfied, the pixel color is replaced with the second class representative color, and when one pixel belongs to a plurality of blocks, the pixel is replaced for each block. And a color correction step using an average of the colors after replacement derived for the pixel as the color of the pixel.

また、本発明の画像処理プログラムは、コンピュータに、拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定処理、および前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定処理で抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正処理を実行させることを特徴とする。   Also, the image processing program of the present invention selects a pixel in an interpolated image, which is an enlarged image including pixels interpolated between pixels of the image before enlargement, on the computer, and the selected pixel is the center. A block of pixels is extracted, and the colors of the pixels in the block are clustered into a first class and a second class, and the probability that the color of each pixel in the block belongs to the first class and the second class A representative color estimation process for deriving the probability of belonging to a class and the representative colors of the first class and the second class, and the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value When the condition that the probability that the color of the pixel belongs to the first class is higher than the probability of the second class is satisfied for each individual pixel in the block extracted by the representative color estimation process, the pixel When a color is replaced with a representative color of the first class and the condition is not satisfied, a color of the pixel is replaced with a representative color of the second class, and one pixel belongs to a plurality of blocks, It is characterized in that a color correction process is performed in which the average of the color after replacement derived for the pixel for each block is the color of the pixel.

本発明によれば、拡大された画像がブロックノイズや混色により劣化している場合であっても、その拡大画像における輪郭を明瞭化し、画像を高品質化させることができる。   According to the present invention, even if the enlarged image is deteriorated due to block noise or color mixing, the contour in the enlarged image can be clarified and the quality of the image can be improved.

以下、本発明の実施形態を図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

実施形態1.
図1は、本発明の第1の実施形態の画像処理システムの例を示すブロック図である。第1の実施形態の画像処理システムは、例えば、プログラム制御により動作するコンピュータ100によって実現される。コンピュータ100は、中央処理装置(プロセッサ、データ処理装置でもよい。)を備える計算機である。
Embodiment 1. FIG.
FIG. 1 is a block diagram showing an example of an image processing system according to the first embodiment of the present invention. The image processing system according to the first embodiment is realized by, for example, a computer 100 that operates under program control. The computer 100 is a computer including a central processing unit (a processor or a data processing device may be used).

画像処理システムとなるコンピュータ100は、輝度勾配算出手段102と、輪郭抽出手段103と、輪郭補正手段104とを含む。   A computer 100 serving as an image processing system includes a brightness gradient calculating unit 102, a contour extracting unit 103, and a contour correcting unit 104.

輝度勾配算出手段102には、補間処理(例えば、バイリニア補間やバイキュービック補間)によって拡大された画像(以下、補間画像と記す。)Saが入力される。補間画像Saは、拡大前の画像の画素間に内挿された画素を含む拡大された画像である。輝度勾配算出手段102は、補間画像Saの各画素毎に、輝度勾配の強度(以下、輝度勾配強度)、および輝度勾配の方向(以下、輝度勾配方向)を計算する。なお、ここでは、低解像度画像(拡大前の画像)から拡大後の画像への拡大率が一定である場合を例にして説明する。   An image (hereinafter referred to as an interpolated image) Sa enlarged by interpolation processing (for example, bilinear interpolation or bicubic interpolation) Sa is input to the luminance gradient calculating unit 102. The interpolated image Sa is an enlarged image including pixels interpolated between pixels of the image before enlargement. The luminance gradient calculation means 102 calculates the intensity of the luminance gradient (hereinafter referred to as luminance gradient intensity) and the direction of the luminance gradient (hereinafter referred to as luminance gradient direction) for each pixel of the interpolation image Sa. Here, the case where the enlargement ratio from the low resolution image (image before enlargement) to the image after enlargement is constant will be described as an example.

輝度勾配とは、画素の輝度が、その画素の近傍の画素に対してどれだけ変化しているかを表す値である。例えば、座標が1変化したときの、画素の輝度の変化量である。輝度勾配が大きいほど、輝度の変化量が大きいことになる。輝度勾配は、x軸方向(水平方向)、y軸方向(垂直方向)それぞれについて計算される。図2は、輝度勾配強度および輝度勾配方向を示す説明図である。図2では、画像中の一つの画素71に着目して輝度勾配強度および輝度勾配方向を説明するが、他の各画素についても同様に輝度勾配強度および輝度勾配方向が算出される。一つの画素71における水平方向の輝度の変化量を表す値が、画素71におけるx軸方向の輝度勾配である。図2に示すベクトル72は、大きさが画素71におけるx軸方向の輝度勾配であり、x軸方向を向くベクトルである。以下、このベクトル72をx軸方向輝度勾配ベクトルと記す。また、画素71における垂直方向の輝度の変化量を表す値が、画素71におけるy軸方向の輝度勾配である。図2に示すベクトル73は、大きさが画素71におけるy軸方向の輝度勾配であり、y軸方向を向くベクトルである。以下、このベクトル73をy軸方向輝度勾配ベクトルと記す。画素71における輝度勾配強度とは、x軸方向輝度勾配ベクトル72とy軸方向輝度勾配ベクトル73の合成ベクトル74(図2参照)の大きさである。また、画素71における輝度勾配方向とは、基準となる方向(具体的にはx軸方向)と上記の合成ベクトル74の方向とのなす角度である。図2では、輝度勾配方向を“θ”として表している。輝度勾配算出手段102は、補間画像Saの各画素毎に、輝度勾配強度(合成ベクトル74の大きさ)、および輝度勾配方向(θ)を求める。   The luminance gradient is a value representing how much the luminance of a pixel changes with respect to a pixel near the pixel. For example, it is the amount of change in luminance of the pixel when the coordinate changes by one. The larger the luminance gradient, the larger the amount of change in luminance. The luminance gradient is calculated for each of the x-axis direction (horizontal direction) and the y-axis direction (vertical direction). FIG. 2 is an explanatory diagram showing luminance gradient strength and luminance gradient direction. In FIG. 2, the luminance gradient intensity and the luminance gradient direction will be described by focusing on one pixel 71 in the image, but the luminance gradient intensity and the luminance gradient direction are calculated in the same manner for the other pixels. A value representing the amount of change in luminance in the horizontal direction in one pixel 71 is the luminance gradient in the x-axis direction in the pixel 71. A vector 72 shown in FIG. 2 is a luminance gradient in the x-axis direction in the pixel 71 and is a vector facing the x-axis direction. Hereinafter, the vector 72 is referred to as an x-axis direction luminance gradient vector. A value representing the amount of change in luminance in the vertical direction in the pixel 71 is the luminance gradient in the y-axis direction in the pixel 71. A vector 73 illustrated in FIG. 2 is a luminance gradient in the y-axis direction in the pixel 71 and is a vector facing the y-axis direction. Hereinafter, this vector 73 is referred to as a y-axis direction luminance gradient vector. The luminance gradient strength in the pixel 71 is the magnitude of the combined vector 74 (see FIG. 2) of the x-axis direction luminance gradient vector 72 and the y-axis direction luminance gradient vector 73. In addition, the luminance gradient direction in the pixel 71 is an angle formed by a reference direction (specifically, the x-axis direction) and the direction of the combined vector 74 described above. In FIG. 2, the luminance gradient direction is represented as “θ”. The luminance gradient calculating means 102 calculates the luminance gradient intensity (the magnitude of the combined vector 74) and the luminance gradient direction (θ) for each pixel of the interpolation image Sa.

輪郭抽出手段103は、各画素における輝度勾配強度および輝度勾配方向を用いて、劣化する前の本来の輪郭を表す画素を判定する。例えば、輪郭抽出手段103は、輪郭を表す画素であるか否かの判定となる画素(以下、輪郭判定対象画素)を中心として、輝度勾配方向の隣接画素と、その反対方向の隣接画素の輝度勾配強度を比較する。そして、輪郭抽出手段103は、輪郭判定対象画素の輝度勾配強度が閾値(輪郭抽出閾値)よりも大きく、また上記の2つの隣接画素における輝度勾配強度よりも大きいことを条件に、輪郭判定対象画素は輪郭上の画素(輪郭を表す画素)であると判定する。   The contour extraction unit 103 determines a pixel representing the original contour before deterioration using the luminance gradient strength and luminance gradient direction in each pixel. For example, the contour extracting unit 103 uses the luminance of the adjacent pixels in the luminance gradient direction and the luminance of the adjacent pixels in the opposite direction around the pixel (hereinafter referred to as the contour determination target pixel) for determining whether or not the pixel represents the contour. Compare gradient strength. Then, the contour extraction unit 103 sets the contour determination target pixel on condition that the luminance gradient strength of the contour determination target pixel is larger than a threshold value (contour extraction threshold value) and larger than the luminance gradient strength of the two adjacent pixels. Are determined to be pixels on the contour (pixels representing the contour).

輪郭補正手段104は、輪郭を境に接する2つの領域それぞれを代表する代表色を推定し、これに基づいて輪郭周辺の色を補正する。輪郭補正手段104は、輪郭を表す画素(基準画素と記す。)からその基準画素における輝度勾配方向に一定距離離れた画素(第1の隔離画素と記す。)を特定する。輪郭補正手段104は、第1の隔離画素の色を第1の代表色とし、基準画素と第1の隔離画素とを結ぶ直線上に存在する各画素を、第1の代表色に補正する。また、輪郭を表す画素(基準画素)からその基準画素における輝度勾配方向を180°回転した方向に一定距離離れた画素(第2の隔離画素と記す。)を特定する。輪郭補正手段104は、第2の隔離画素の色を、第2の代表色とし、第1の隔離画素と第2の隔離画素とを結ぶ直線上に存在する各画素のうち、第1の代表色に補正していない画素を、第2の代表色に補正する。輪郭補正手段104は、この処理を、輪郭を表す各画素毎に行う。なお、ここでは、上記の一定距離が、予め定められているものとする。   The contour correcting unit 104 estimates representative colors representing the two regions in contact with the contour, and corrects the color around the contour based on the representative color. The contour correcting unit 104 identifies a pixel (denoted as a first isolated pixel) that is a fixed distance away from a pixel representing the contour (denoted as a reference pixel) in the luminance gradient direction of the reference pixel. The contour correcting unit 104 sets the color of the first isolated pixel as the first representative color, and corrects each pixel existing on the straight line connecting the reference pixel and the first isolated pixel to the first representative color. Also, a pixel (referred to as a second isolated pixel) that is separated from the pixel representing the contour (reference pixel) by a certain distance in the direction in which the luminance gradient direction of the reference pixel is rotated by 180 ° is specified. The contour correcting unit 104 sets the color of the second isolated pixel as the second representative color, and the first representative among the pixels existing on the straight line connecting the first isolated pixel and the second isolated pixel. A pixel that has not been corrected to a color is corrected to a second representative color. The contour correcting unit 104 performs this process for each pixel representing the contour. Here, it is assumed that the predetermined distance is determined in advance.

輪郭補正手段104が輪郭上の画素の近傍の画素の色を補正することにより、目的とする高品質な拡大画像が得られる。   The contour correction unit 104 corrects the color of the pixels in the vicinity of the pixels on the contour, thereby obtaining a target high-quality enlarged image.

輝度勾配算出手段102と、輪郭抽出手段103と、輪郭補正手段104は、例えば、プログラムに従って動作する中央処理装置(CPU)によって実現される。すなわち、中央処理装置が、コンピュータ100が備える記憶装置(図示せず。)から画像処理用プログラムを読み込み、画像処理用プログラムに従って、輝度勾配算出手段102、輪郭抽出手段103および輪郭補正手段104として動作してもよい。また、輝度勾配算出手段102、輪郭抽出手段103および輪郭補正手段104がそれぞれ別個の回路として実現されていてもよい。   The brightness gradient calculating unit 102, the contour extracting unit 103, and the contour correcting unit 104 are realized by, for example, a central processing unit (CPU) that operates according to a program. That is, the central processing unit reads an image processing program from a storage device (not shown) included in the computer 100 and operates as a luminance gradient calculating unit 102, contour extracting unit 103, and contour correcting unit 104 in accordance with the image processing program. May be. Further, the brightness gradient calculating unit 102, the contour extracting unit 103, and the contour correcting unit 104 may be realized as separate circuits.

次に、動作について詳細に説明する。
図3は、第1の実施形態の処理経過の例を示すフローチャートである。画像処理システムには、補間処理により拡大された補間画像Sa(例えば、図28に例示する画像)が入力される。画像処理システムは、補間画像Saにおける輪郭部分の周辺の画素の色(具体的には画素値)を補正して、輪郭が明瞭な高品質の画像を生成する。
Next, the operation will be described in detail.
FIG. 3 is a flowchart illustrating an example of processing progress of the first embodiment. An interpolation image Sa (for example, an image illustrated in FIG. 28) enlarged by the interpolation processing is input to the image processing system. The image processing system corrects the color (specifically, pixel value) of pixels around the contour portion in the interpolation image Sa, and generates a high-quality image with a clear contour.

本実施形態では、輝度勾配算出手段102および輪郭補正手段104に補間画像Saが入力される。補間画像Saが入力されると、輝度勾配算出手段102は、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出し、各画素の輝度勾配強度および輝度勾配方向を輪郭抽出手段103に出力する(ステップS11)。このとき、輝度勾配算出手段102は、各画素の輝度勾配方向を輪郭補正手段104にも出力する。以下、輝度勾配強度をSbと記し、輝度勾配方向をScと記す。また、座標を指定して、輝度勾配強度Sbおよび輝度勾配方向Scを表す場合もある。すなわち、座標(x,y)における輝度勾配強度をSb(x,y)と記し、座標(x,y)における輝度勾配方向ScをSc(x,y)と記す場合がある。   In the present embodiment, the interpolated image Sa is input to the brightness gradient calculating unit 102 and the contour correcting unit 104. When the interpolation image Sa is input, the luminance gradient calculating unit 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel of the interpolated image Sa, and the contour extracting unit 103 calculates the luminance gradient intensity and the luminance gradient direction of each pixel. (Step S11). At this time, the luminance gradient calculating unit 102 also outputs the luminance gradient direction of each pixel to the contour correcting unit 104. Hereinafter, the luminance gradient strength is denoted as Sb, and the luminance gradient direction is denoted as Sc. In addition, the coordinates may be designated to represent the luminance gradient strength Sb and the luminance gradient direction Sc. That is, the luminance gradient intensity at the coordinates (x, y) may be denoted as Sb (x, y), and the luminance gradient direction Sc at the coordinates (x, y) may be denoted as Sc (x, y).

ステップS11において、まず輝度勾配算出手段102は、個々の画素毎に、画素値から輝度値を特定する。画素値は、入力された画像の個々の画素に設定されている値であり、例えば、画素がRGB形式で表されている場合、画素の画素値はR,G,Bそれぞれの濃淡を表す値である。輝度値は、輝度の大きさを表す値である。例えば、画素がRGB形式で表されているとする。この場合、輝度勾配算出手段102は、個々の画素毎に以下に示す式(1)の計算を行い、各画素の輝度値を計算すればよい。   In step S11, first, the luminance gradient calculating unit 102 specifies a luminance value from the pixel value for each individual pixel. The pixel value is a value set for each pixel of the input image. For example, when the pixel is expressed in RGB format, the pixel value of the pixel is a value representing the density of each of R, G, and B. It is. The luminance value is a value that represents the magnitude of the luminance. For example, assume that pixels are represented in RGB format. In this case, the luminance gradient calculating unit 102 may calculate the luminance value of each pixel by calculating the following formula (1) for each pixel.

Y(x,y)=0.299・R(x,y)+0.587・G(x,y)+0.114・B(x,y)
式(1)
Y (x, y) = 0.299.R (x, y) + 0.587.G (x, y) + 0.114.B (x, y)
Formula (1)

式(1)においてY(x,y)は、座標(x,y)の画素の輝度値である。また、R(x,y)、G(x,y)、B(x,y)は、座標(x,y)の画素におけるR,G,Bの画素値である。   In equation (1), Y (x, y) is the luminance value of the pixel at coordinates (x, y). Further, R (x, y), G (x, y), and B (x, y) are R, G, and B pixel values in the pixel at coordinates (x, y).

ステップS11において、輝度勾配算出手段102は、各画素の輝度値から輝度勾配強度および輝度勾配方向を計算する。輝度勾配算出手段102が輝度勾配強度および輝度勾配方向を計算する処理の例を説明する。輝度勾配強度および輝度勾配方向の計算処理として、例えば、エッジ検出オペレータを用いる方法がある。エッジ検出オペレータを用いる方法では、予め定められn行n列に配置された値(係数)と、画像中に含まれるn行n列の画素とを対応させて、対応する係数と画素の輝度値との積を求め、その和を計算することにより、輝度勾配を計算する。この計算に用いる係数をエッジ検出オペレータの係数と呼ぶ。エッジ検出オペレータの例として、Sobelフィルタ、Robinsonのオペレータ、Prewittのオペレータ等が挙げられる。以下、Sobelフィルタの係数を用いて、輝度勾配を計算する場合を例示するが、他のエッジ検出オペレータの係数(Robinsonのオペレータの係数やPrewittのオペレータの係数等)を用いる場合の処理も同様である。   In step S11, the luminance gradient calculation unit 102 calculates the luminance gradient intensity and the luminance gradient direction from the luminance value of each pixel. An example of processing in which the luminance gradient calculating unit 102 calculates the luminance gradient intensity and the luminance gradient direction will be described. As a calculation process of the luminance gradient intensity and the luminance gradient direction, for example, there is a method using an edge detection operator. In the method using the edge detection operator, a predetermined value (coefficient) arranged in n rows and n columns is associated with pixels in the n rows and n columns included in the image, and the corresponding coefficients and luminance values of the pixels are obtained. The luminance gradient is calculated by calculating the product of and. The coefficient used for this calculation is called an edge detection operator coefficient. Examples of edge detection operators include a Sobel filter, a Robinson operator, a Prewitt operator, and the like. In the following, the case of calculating the brightness gradient using the Sobel filter coefficient is exemplified, but the processing in the case of using other edge detection operator coefficients (such as the Robinson operator coefficient and the Prewitt operator coefficient) is also the same. is there.

Sobelフィルタの係数は、3行3列、5行5列、7行7列等のように所定の数を並べたn行n列の数の並びとして予め定められている。ここで、nは奇数である。また、Sobelフィルタの係数として、水平方向の輝度勾配算出のために用いられる係数と、垂直方向の輝度勾配算出のために用いられる係数の2種類が定められる。図4は、Sobelフィルタの係数の例を示す説明図である。以下、Sobelフィルタの係数が、3行3列の数の並びである場合を例にして説明する。図4(a)は、水平方向(x軸方向)の輝度勾配算出に用いるSobelフィルタ(以下、水平方向Sobelフィルタと記す。)の係数を示している。また、図4(b)は、垂直方向(y軸方向)の輝度勾配算出に用いるSobelフィルタ(以下、垂直方向Sobelフィルタと記す。)の係数を示している。   The Sobel filter coefficients are predetermined as an array of n rows and n columns in which a predetermined number is arranged, such as 3 rows, 3 columns, 5 rows, 5 columns, 7 rows, 7 columns, and the like. Here, n is an odd number. In addition, two types of coefficients are used as coefficients for the Sobel filter: coefficients used for calculating the luminance gradient in the horizontal direction and coefficients used for calculating the luminance gradient in the vertical direction. FIG. 4 is an explanatory diagram illustrating an example of coefficients of the Sobel filter. Hereinafter, a case where the coefficients of the Sobel filter are arranged in a number of 3 rows and 3 columns will be described as an example. FIG. 4A shows coefficients of a Sobel filter (hereinafter referred to as a horizontal Sobel filter) used for calculating a luminance gradient in the horizontal direction (x-axis direction). FIG. 4B shows coefficients of a Sobel filter (hereinafter referred to as a vertical Sobel filter) used for calculating a luminance gradient in the vertical direction (y-axis direction).

輝度勾配算出手段102は、補間画像Saの各輝度値に水平方向Sobelフィルタを畳み込み、水平方向の輝度勾配画像(Dhとする。)を生成する。また、輝度勾配算出手段102は、補間画像Saに垂直方向Sobelフィルタを畳み込み、垂直方向の輝度勾配画像(Dvとする。)を生成する。水平方向の輝度勾配画像Dhは、個々の画素に対して、補間画像Saにおける対応画素の水平(x軸)方向の輝度勾配を割り当てた画像である。垂直方向の輝度勾配画像Dvは、個々の画素に対して、補間画像Saにおける対応画素の垂直(y軸)方向の輝度勾配を割り当てた画像である。   The luminance gradient calculating unit 102 convolves a horizontal direction Sobel filter with each luminance value of the interpolated image Sa to generate a horizontal luminance gradient image (denoted as Dh). In addition, the luminance gradient calculating unit 102 convolves the vertical direction Sobel filter with the interpolation image Sa to generate a vertical luminance gradient image (denoted as Dv). The luminance gradient image Dh in the horizontal direction is an image in which the luminance gradient in the horizontal (x-axis) direction of the corresponding pixel in the interpolation image Sa is assigned to each pixel. The luminance gradient image Dv in the vertical direction is an image in which the luminance gradient in the vertical (y-axis) direction of the corresponding pixel in the interpolation image Sa is assigned to each pixel.

また、Sobelフィルタの畳み込みとは、輝度勾配の計算対象とする画素を中心とする、Sobelフィルタの係数と同じ配置の複数の画素を特定し、その各画素それぞれについて、対応するSobelフィルタの係数との積を計算し、その積の和を求める処理である。ここでは、Sobelフィルタの係数が3行3列の数の並びである場合を例にしているので、輝度勾配算出手段102は、輝度勾配の計算対象画素を中心とする3行3列の画素を特定する。図5は、輝度勾配の計算対象画素を中心とするn行n列(3行3列)の各画素の輝度値を示すイメージ図である。輝度勾配算出手段102は、図5に例示する輝度値l〜tの9個の画素を特定すると、その複数の各画素毎に、輝度値と、対応するSobelフィルタの係数との積を計算する。特定したn行n列の画素の中心に位置する計算対象画素は、n行n列のSobelフィルタの係数のうち中心に配置された係数に対応する。また、計算対象画素を基準とする画素の位置が、Sobelフィルタの係数のうち中心に配置された係数を基準とする係数の位置と同じ位置になっている場合、その画素および係数は対応しているものとする。例えば、図5に例示する輝度値qの画素は、図4(a)に示すSobelフィルタの係数“2”に対応する。輝度勾配算出手段102は、対応するSobelフィルタの係数と、画素の輝度値との積を計算し、その和を求める。   Further, the convolution of the Sobel filter is to identify a plurality of pixels having the same arrangement as the Sobel filter coefficient centered on the pixel for which the luminance gradient is to be calculated, and for each pixel, the corresponding Sobel filter coefficient and Is a process of calculating the product of and calculating the sum of the products. In this example, since the Sobel filter coefficients are arranged in a number of 3 rows and 3 columns, the luminance gradient calculation unit 102 calculates pixels of 3 rows and 3 columns centering on the luminance gradient calculation target pixel. Identify. FIG. 5 is an image diagram showing the luminance value of each pixel in n rows and n columns (3 rows and 3 columns) with the luminance gradient calculation target pixel as the center. When the luminance gradient calculating unit 102 specifies nine pixels having the luminance values 1 to t illustrated in FIG. 5, the luminance gradient calculating unit 102 calculates the product of the luminance value and the corresponding Sobel filter coefficient for each of the plurality of pixels. . The calculation target pixel located at the center of the identified pixel of n rows and n columns corresponds to the coefficient arranged at the center among the coefficients of the Sobel filter of n rows and n columns. In addition, when the position of the pixel based on the calculation target pixel is the same position as the coefficient position based on the coefficient arranged at the center among the coefficients of the Sobel filter, the pixel and the coefficient correspond to each other. It shall be. For example, the pixel having the luminance value q illustrated in FIG. 5 corresponds to the coefficient “2” of the Sobel filter illustrated in FIG. The luminance gradient calculation means 102 calculates the product of the coefficient of the corresponding Sobel filter and the luminance value of the pixel, and obtains the sum.

図4(a),(b)に示すように、Sobelフィルタの係数は水平方向、垂直方向の2種類あるので、輝度勾配算出手段102は、水平方向Sobelフィルタ、垂直方向Sobelフィルタそれぞれを用いて上記の計算を行う。水平方向Sobelフィルタの係数の並びに含まれる個々の係数をSobelh(i,j)と表すとする。iは係数の並びにおける列を表し、ここでは−1,0,1の値をとる。また、jは係数の並びにおける行を表し、ここでは−1,0,1の値をとる。補間画像Saにおける座標(x,y)の画素の輝度値をSa(x,y)と表す。このとき、輝度勾配算出手段102は、上記の積および和の計算として、以下に示す式(2)の計算を行うことにより、座標(x,y)の画素における水平方向の輝度勾配(Dh(x,y)とする。)を求めることができる。   As shown in FIGS. 4A and 4B, since there are two types of coefficients of the Sobel filter in the horizontal direction and the vertical direction, the luminance gradient calculating means 102 uses the horizontal direction Sobel filter and the vertical direction Sobel filter, respectively. Perform the above calculation. It is assumed that the individual coefficients included in the horizontal Sobel filter coefficient are represented as Sobelh (i, j). i represents a column in the coefficient sequence, and takes a value of -1, 0, 1 here. Further, j represents a row in the coefficient sequence, and takes values of -1, 0, 1 here. The luminance value of the pixel at the coordinates (x, y) in the interpolated image Sa is represented as Sa (x, y). At this time, the luminance gradient calculating means 102 performs the calculation of the following equation (2) as the above-described product and sum calculation, thereby obtaining the horizontal luminance gradient (Dh ( x, y))).

Figure 2009157449
Figure 2009157449

また、垂直方向Sobelフィルタの係数の並びに含まれる個々の係数をSobelv(i,j)と表すとする。このとき、輝度勾配算出手段102は、上記の積および和の計算として、以下に示す式(3)の計算を行うことにより、座標(x,y)の画素における垂直方向の輝度勾配(Dv(x,y)とする。)を求めることができる。   In addition, it is assumed that individual coefficients included in the vertical Sobel filter coefficients are represented as Sobelv (i, j). At this time, the luminance gradient calculating means 102 performs the following equation (3) as the above-mentioned product and sum calculation, thereby obtaining the vertical luminance gradient (Dv (Dv ()) in the pixel at the coordinate (x, y). x, y))).

Figure 2009157449
Figure 2009157449

輝度勾配算出手段102は、補間画像Sa中の各画素について、水平方向、垂直方向の輝度勾配を求める。さらに、輝度勾配算出手段102は、水平方向、垂直方向の輝度勾配を用いて、各画素毎に、輝度勾配強度および輝度勾配方向を計算する。   The luminance gradient calculating unit 102 calculates the luminance gradient in the horizontal direction and the vertical direction for each pixel in the interpolation image Sa. Further, the luminance gradient calculating unit 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel using the luminance gradient in the horizontal direction and the vertical direction.

座標(x,y)の輝度勾配強度Sb(x,y)は、x軸方向輝度勾配ベクトル72とy軸方向輝度勾配ベクトル73の合成ベクトルの大きさである(図2参照)。輝度勾配算出手段102は、このベクトルの大きさ(輝度勾配強度Sb(x,y))を計算する。輝度勾配算出手段102は、以下に示す式(4)の計算により、輝度勾配強度Sb(x,y)を計算してもよい。   The luminance gradient strength Sb (x, y) at the coordinates (x, y) is the magnitude of the combined vector of the x-axis direction luminance gradient vector 72 and the y-axis direction luminance gradient vector 73 (see FIG. 2). The luminance gradient calculating means 102 calculates the magnitude of this vector (luminance gradient strength Sb (x, y)). The luminance gradient calculating unit 102 may calculate the luminance gradient strength Sb (x, y) by calculating the following equation (4).

Sb(x,y)=abs(Dh(x,y))+abs(Dv(x,y)) 式(4)   Sb (x, y) = abs (Dh (x, y)) + abs (Dv (x, y)) Equation (4)

式(4)は、合成ベクトルの大きさを求める近似式である。また、輝度勾配算出手段102は、式(4)の近似式ではなく、以下に示す式(5)の計算によって輝度勾配強度Sb(x,y)を計算してもよい。   Expression (4) is an approximate expression for obtaining the magnitude of the combined vector. In addition, the luminance gradient calculating unit 102 may calculate the luminance gradient intensity Sb (x, y) by calculation of the following equation (5) instead of the approximate equation of equation (4).

Sb(x,y)=√(Dh(x,y)+Dv(x,y)) 式(5) Sb (x, y) = √ (Dh (x, y) 2 + Dv (x, y) 2 ) (5)

また、輝度勾配算出手段102は、座標(x,y)の輝度勾配方向Sc(x,y)を、以下に示す式(6)の計算により求めればよい。   Moreover, the brightness | luminance gradient calculation means 102 should just obtain | require the brightness | luminance gradient direction Sc (x, y) of a coordinate (x, y) by calculation of the following formula | equation (6).

Sc(x,y)=tan−1(Dv(x,y)/Dh(x,y)) 式(6) Sc (x, y) = tan −1 (Dv (x, y) / Dh (x, y)) Equation (6)

なお、輝度勾配算出手段102は、算出した輝度勾配強度Sb、輝度勾配方向Scを適当なステップで量子化しておいてもよい。すなわち、輝度勾配算出手段102は、計算した輝度勾配強度および輝度勾配方向を、より少ないビット数で表すように変換してもよい。例えば、計算した輝度勾配強度が8ビットで表されている場合、3ビットで表すように変換してもよい。8ビットを3ビットに変換する場合、8ビットで表される輝度勾配強度を16で除算し、小数点以下を四捨五入すればよい。   Note that the luminance gradient calculating unit 102 may quantize the calculated luminance gradient strength Sb and luminance gradient direction Sc in an appropriate step. In other words, the luminance gradient calculating unit 102 may convert the calculated luminance gradient intensity and luminance gradient direction so as to represent them with a smaller number of bits. For example, when the calculated luminance gradient strength is represented by 8 bits, it may be converted so as to be represented by 3 bits. When converting 8 bits into 3 bits, the luminance gradient intensity represented by 8 bits is divided by 16 and rounded off after the decimal point.

次に、輪郭抽出手段103は、輝度勾配算出手段102が算出した各画素の輝度勾配強度Sb、輝度勾配方向Scと、輪郭抽出閾値Pcとを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS12)。ここでは、輪郭抽出閾値Pcは、予め定められているものとする。図6は、輪郭を表す画素の判定処理の例を示す説明図である。図6に示す画素300は、輪郭判定対象画素である。また、図6に示す方向301は、輪郭判定対象画素の輝度勾配方向(Sc(x,y))を示している。図6に示す方向302は、輪郭判定対象画素の輝度勾配方向302をπラジアン(180°)回転させた方向(Sc(x,y)+π)を示している。輪郭抽出手段103は、輪郭判定対象画素300の輝度勾配強度が輪郭抽出閾値Pcよりも大きく、かつ、輪郭判定対象画素の輝度勾配方向301の隣接画素303の輝度勾配強度と、輝度勾配方向301を180°回転させた方向302の隣接画素304の輝度勾配強度のいずれよりも大きい場合、輪郭判定対象画素300は輪郭を表す画素であると判定する。一方、輪郭判定対象画素300の輝度勾配強度が輪郭抽出閾値Pc以下である場合には、輪郭判定対象画素300は輪郭を表す画素でないと判定する。また、輪郭判定対象画素300の輝度勾配強度が輪郭判定対象画素の輝度勾配方向301の隣接画素303の輝度勾配強度と、輝度勾配方向301を180°回転させた方向302の隣接画素304の輝度勾配強度のいずれよりも大きいという条件を満たしていない場合にも、輪郭判定対象画素300は輪郭を表す画素でないと判定する。輪郭抽出手段103は、この判定を個々の画素毎に行う。なお、輪郭上の画素の判定処理方法は上記の方法に限定されず、輪郭抽出手段103は他の方法によって、輪郭上の画素を判定してもよい。   Next, the contour extracting unit 103 represents the contour in the interpolation image Sa using the luminance gradient strength Sb, luminance gradient direction Sc of each pixel calculated by the luminance gradient calculating unit 102, and the contour extraction threshold value Pc. A pixel is determined (step S12). Here, it is assumed that the contour extraction threshold value Pc is predetermined. FIG. 6 is an explanatory diagram illustrating an example of a process for determining a pixel representing an outline. A pixel 300 illustrated in FIG. 6 is a contour determination target pixel. A direction 301 illustrated in FIG. 6 indicates a luminance gradient direction (Sc (x, y)) of the contour determination target pixel. A direction 302 illustrated in FIG. 6 indicates a direction (Sc (x, y) + π) obtained by rotating the luminance gradient direction 302 of the contour determination target pixel by π radians (180 °). The contour extraction unit 103 determines the brightness gradient strength of the neighboring pixels 303 in the brightness gradient direction 301 of the contour determination target pixel and the brightness gradient direction 301 as the brightness gradient strength of the contour determination target pixel 300 is larger than the contour extraction threshold value Pc. When it is larger than any of the luminance gradient intensities of the adjacent pixels 304 in the direction 302 rotated by 180 °, it is determined that the contour determination target pixel 300 is a pixel representing a contour. On the other hand, when the brightness gradient intensity of the contour determination target pixel 300 is equal to or less than the contour extraction threshold value Pc, it is determined that the contour determination target pixel 300 is not a pixel representing a contour. Further, the brightness gradient strength of the contour determination target pixel 300 is the brightness gradient strength of the adjacent pixel 303 in the brightness gradient direction 301 of the contour determination target pixel and the brightness gradient of the adjacent pixel 304 in the direction 302 obtained by rotating the brightness gradient direction 301 by 180 °. Even when the condition of greater than any of the intensities is not satisfied, the contour determination target pixel 300 is determined not to be a pixel representing a contour. The contour extraction unit 103 performs this determination for each pixel. Note that the pixel determination processing method for the contour is not limited to the above-described method, and the contour extraction unit 103 may determine the pixel on the contour by another method.

輪郭抽出手段103は、輪郭を表すと判定した画素に対して0以外の画素値を格納し、それ以外の画素に対して画素値“0”を格納した画像(輪郭画像Sdと記す。)を輪郭補正手段104に出力する。輪郭画像Sdにより、輪郭補正手段104は、輪郭を表すと判定された画素とその他の画素とを区別することができる。また、輪郭抽出手段103は、輪郭を表すと判定した画素の座標値を輪郭補正手段104に出力してもよい。輪郭抽出手段103は、輪郭を表すと判定された画素とその他の画素とを区別できるように、輪郭を表すと判定した画素を輪郭抽出手段103に通知すればよい。   The contour extraction unit 103 stores a pixel value other than 0 for the pixel determined to represent the contour, and stores an image (denoted as a contour image Sd) in which the pixel value “0” is stored for the other pixels. Output to the contour correction means 104. Based on the contour image Sd, the contour correcting unit 104 can distinguish between pixels determined to represent the contour and other pixels. The contour extracting unit 103 may output the coordinate value of the pixel determined to represent the contour to the contour correcting unit 104. The contour extracting unit 103 may notify the contour extracting unit 103 of the pixel determined to represent the contour so that the pixel determined to represent the contour can be distinguished from other pixels.

ステップS12の後、輪郭補正手段104は、輪郭を境に接する2つの領域それぞれを代表する代表色を定め、補間画像Saにおける輪郭周辺の画素値を補正する(ステップS13)。図7は、輪郭周辺の画素の補正処理の例を示す説明図である。図7(a)は補正前の補間画像を表し、図7(b)は補正後の補間画像を表している。図7(a)で斜線で示した画素は、輪郭を表していると判定された画素であり、この画素の連なりが画像の輪郭となっている。ステップS13において、輪郭補正手段104は、輪郭抽出手段103によって輪郭を表すと判定された画素(基準画素)を一つ選択する。図7における画素400は、基準画素を表している。また、図7に示す方向401は、基準画素400の輝度勾配方向(Sc(x,y))を示している。図7に示す403は、基準画素の輝度勾配方向401をπラジアン(180°)回転させた方向(Sc(x,y)+π)を示している。   After step S12, the contour correcting unit 104 determines a representative color that represents each of the two regions in contact with the contour, and corrects pixel values around the contour in the interpolated image Sa (step S13). FIG. 7 is an explanatory diagram illustrating an example of correction processing for pixels around the contour. FIG. 7A shows an interpolated image before correction, and FIG. 7B shows an interpolated image after correction. Pixels indicated by diagonal lines in FIG. 7A are pixels that are determined to represent an outline, and a series of these pixels is the outline of the image. In step S <b> 13, the contour correcting unit 104 selects one pixel (reference pixel) determined to represent the contour by the contour extracting unit 103. A pixel 400 in FIG. 7 represents a reference pixel. A direction 401 illustrated in FIG. 7 indicates a luminance gradient direction (Sc (x, y)) of the reference pixel 400. Reference numeral 403 shown in FIG. 7 indicates a direction (Sc (x, y) + π) obtained by rotating the luminance gradient direction 401 of the reference pixel by π radians (180 °).

輪郭補正手段104は、基準画素400から基準画素400における輝度勾配方向に一定距離離れた第1の隔離画素402を特定する。輪郭補正手段104は、補間画像Sa中の第1の隔離画素402の色を第1の代表色とする。そして、輪郭補正手段104は、基準画素400と第1の隔離画素402とを結ぶ直線上に存在する各画素の色を、第1の代表色と同じ色に補正する。すなわち、基準画素400と第1の隔離画素402とを結ぶ直線上に存在する各画素の画素値を、第1の隔離画素402の画素値に置換する。例えば、補間画像Saの各画素がRGB形式で表されている場合、第1の隔離画素402のR,G,Bそれぞれの値に置換すればよい。また、輪郭補正手段104は、基準画素400の画素値も、第1の隔離画素402の画素値に置換する。   The contour correcting unit 104 identifies the first isolated pixel 402 that is separated from the reference pixel 400 by a certain distance in the luminance gradient direction of the reference pixel 400. The contour correcting unit 104 sets the color of the first isolated pixel 402 in the interpolation image Sa as the first representative color. The contour correcting unit 104 corrects the color of each pixel existing on the straight line connecting the reference pixel 400 and the first isolated pixel 402 to the same color as the first representative color. That is, the pixel value of each pixel existing on the straight line connecting the reference pixel 400 and the first isolation pixel 402 is replaced with the pixel value of the first isolation pixel 402. For example, when each pixel of the interpolated image Sa is represented in RGB format, it may be replaced with the R, G, and B values of the first isolated pixel 402. The contour correction unit 104 also replaces the pixel value of the reference pixel 400 with the pixel value of the first isolated pixel 402.

同様に、輪郭補正手段104は、基準画素400から方向403(図7(a)参照。輝度勾配方向401を180°反転した方向)に一定距離離れた第2の隔離画素404を特定する。輪郭補正手段104は、補間画像Sa中の第2の隔離画素404の色を第2の代表色とする。そして、輪郭補正手段104は、第2の隔離画素404と第1の隔離画素402とを結ぶ直線上に存在する画素のうち、第1の隔離画素402の画素値に置換していない画素の画素値を、第2の隔離画素404の画素値に置換する。   Similarly, the contour correcting unit 104 identifies a second isolated pixel 404 that is a fixed distance away from the reference pixel 400 in a direction 403 (see FIG. 7A, a direction obtained by inverting the luminance gradient direction 401 by 180 °). The contour correcting unit 104 sets the color of the second isolated pixel 404 in the interpolation image Sa as the second representative color. Then, the contour correcting unit 104 is a pixel that is not replaced with the pixel value of the first isolation pixel 402 among the pixels existing on the straight line connecting the second isolation pixel 404 and the first isolation pixel 402. Replace the value with the pixel value of the second isolated pixel 404.

この処理の結果、図7(b)に示すように、基準画素400および画素405は第1の代表色に補正され、画素407は第2の代表色に補正される。ここでは、基準画素400の画素値を第1の隔離画素402の画素値に置換する場合を示したが、基準画素400の画素値を第2の隔離画素404の画素値で置換してもよい。   As a result of this processing, as shown in FIG. 7B, the reference pixel 400 and the pixel 405 are corrected to the first representative color, and the pixel 407 is corrected to the second representative color. Here, the case where the pixel value of the reference pixel 400 is replaced with the pixel value of the first isolated pixel 402 is shown, but the pixel value of the reference pixel 400 may be replaced with the pixel value of the second isolated pixel 404. .

輪郭補正手段104は、輪郭抽出手段103によって輪郭を表すと判定された全ての画素を順次選択して、上記の処理を繰り返し、輪郭の周辺の画素値を補正する。そして、補正後の画像を出力する。輪郭補正手段104による補正処理により生成された拡大画像の例を図8に示す。図8に示すように、輪郭の明瞭な高品質の画像が得られる。   The contour correcting unit 104 sequentially selects all the pixels determined to represent the contour by the contour extracting unit 103, repeats the above processing, and corrects pixel values around the contour. Then, the corrected image is output. An example of an enlarged image generated by the correction processing by the contour correcting unit 104 is shown in FIG. As shown in FIG. 8, a high-quality image with a clear outline is obtained.

次に、本実施形態の効果について説明する。
本実施形態では、輪郭抽出手段103が、画像の輪郭上の画素を特定し、輪郭補正手段104がその画素を間に挟む第1の隔離画素および第2の隔離画素の間の各画素を2つの代表色で区分するように画素を補正する。そのため、輪郭が明瞭な、高品質な拡大画像を生成することができる。また、第1の隔離画素および第2の隔離画素として、基準画素から一定距離離れた画素を特定するので、混色の影響を受けていない色を代表色とすることができ、高品質な拡大画像を生成することができる。
Next, the effect of this embodiment will be described.
In the present embodiment, the contour extracting unit 103 identifies a pixel on the contour of the image, and the contour correcting unit 104 determines two pixels between the first isolated pixel and the second isolated pixel sandwiching the pixel therebetween. The pixels are corrected so as to be divided into two representative colors. Therefore, a high-quality enlarged image with a clear outline can be generated. Further, since the pixels separated from the reference pixel by a certain distance are specified as the first isolated pixel and the second isolated pixel, a color that is not affected by the color mixture can be used as a representative color, and a high-quality enlarged image Can be generated.

次に、第1の実施形態の変形例について説明する。上記の第1の実施形態では、Sobelフィルタの係数がn行n列(例えば3行3列)で固定であり、輪郭抽出閾値Pcは予め定められた定数である場合を例に説明した。また、ステップS13で、第1の隔離画素402および第2の隔離画素404(図7(a)参照)を特定する際に用いる一定距離も、予め定められているものとして説明した。以下に説明する第1の実施形態の変形例では、これらの値を可変とする。図9は、第1の実施形態の変形例を示すブロック図である。既に説明した構成要素と同様の構成要素については、図1と同一の符号を付す。図9に示すように、画像処理システムは、輝度勾配算出手段102、輪郭抽出手段103および輪郭補正手段104に加えて、パラメータ設定手段110を備えていてもよい。なお、図9では、コンピュータ100とは別にパラメータ設定手段110を備える場合を示しているが、コンピュータ100がパラメータ設定手段110を含んでいてもよい。そして、パラメータ設定手段110は、プログラムに従って動作する中央処理装置によって実現されてもよい。すなわち、中央処理装置が、画像処理用プログラムを読み込み、画像処理用プログラムに従って、パラメータ設定手段110、輝度勾配算出手段102、輪郭抽出手段103、輪郭補正手段104として動作してもよい。   Next, a modification of the first embodiment will be described. In the first embodiment, the case where the Sobel filter coefficient is fixed in n rows and n columns (for example, 3 rows and 3 columns) and the contour extraction threshold value Pc is a predetermined constant has been described as an example. In addition, the fixed distance used when specifying the first isolation pixel 402 and the second isolation pixel 404 (see FIG. 7A) in step S13 has been described as being predetermined. In the modification of the first embodiment described below, these values are variable. FIG. 9 is a block diagram illustrating a modification of the first embodiment. Constituent elements similar to those already described are denoted by the same reference numerals as in FIG. As shown in FIG. 9, the image processing system may include a parameter setting unit 110 in addition to the luminance gradient calculation unit 102, the contour extraction unit 103, and the contour correction unit 104. Although FIG. 9 shows a case where the parameter setting unit 110 is provided separately from the computer 100, the computer 100 may include the parameter setting unit 110. The parameter setting unit 110 may be realized by a central processing unit that operates according to a program. That is, the central processing unit may read the image processing program and operate as the parameter setting unit 110, the brightness gradient calculating unit 102, the contour extracting unit 103, and the contour correcting unit 104 in accordance with the image processing program.

この第1の実施形態の変形例では、Sobelフィルタの係数としてn行n列に並べられる係数の個数は可変である。すなわち、n行n列の“n”を可変とし、3行3列、5行5列等のSobelフィルタの係数を選択可能とする。パラメータ設定手段110は、輝度勾配算出手段102がSobelフィルタの係数として何行何列の係数を選択するのかを決定するためのパラメータを算出し、輝度勾配算出手段102に出力する。以下、このパラメータを輝度勾配算出用パラメータと記し、“Pb”と表す。輝度勾配算出手段102は、予め3行3列、5行5列、7行7列等の行数列数に応じたSobelフィルタの係数を予め保持しておき、輝度勾配算出用パラメータPbに応じた行数および列数のSobelフィルタの係数を選択し、ステップS11を行う。   In the modification of the first embodiment, the number of coefficients arranged in n rows and n columns as the Sobel filter coefficients is variable. That is, “n” in n rows and n columns is variable, and Sobel filter coefficients such as 3 rows, 3 columns, and 5 rows and 5 columns can be selected. The parameter setting unit 110 calculates a parameter for determining how many rows and columns of coefficients to select as the Sobel filter coefficient by the luminance gradient calculating unit 102 and outputs the parameter to the luminance gradient calculating unit 102. Hereinafter, this parameter is referred to as a luminance gradient calculation parameter and is represented as “Pb”. The brightness gradient calculation means 102 holds in advance the coefficients of the Sobel filter corresponding to the number of rows such as 3 rows, 3 columns, 5 rows, 5 columns, 7 rows and 7 columns, and the brightness gradient calculation parameter Pb. The Sobel filter coefficients for the number of rows and the number of columns are selected, and step S11 is performed.

また、パラメータ設定手段110は、輪郭抽出閾値Pcを計算し、輪郭抽出手段103に出力する。輪郭抽出手段103は、パラメータ設定手段110が計算した輪郭抽出閾値Pcを用いて、ステップS12を行う。   Further, the parameter setting unit 110 calculates a contour extraction threshold value Pc and outputs it to the contour extraction unit 103. The contour extraction unit 103 performs step S12 using the contour extraction threshold value Pc calculated by the parameter setting unit 110.

また、パラメータ設定手段110は、ステップS13において、基準画素から第1および第2の隔離画素を定めるための距離を計算し、輪郭補正手段104に出力する。この距離を、輪郭補正用パラメータと記し、“Pd”と表す。輪郭補正手段104は、ステップS13において第1および第2の隔離画素を定める際に、輪郭補正用パラメータPdが示す距離だけ基準画素から離れた画素として、第1の隔離画素および第2の隔離画素を定める。   In step S13, the parameter setting unit 110 calculates a distance for determining the first and second isolated pixels from the reference pixel, and outputs the distance to the contour correcting unit 104. This distance is referred to as a contour correction parameter and is represented as “Pd”. When the first and second isolated pixels are determined in step S13, the contour correcting unit 104 sets the first isolated pixel and the second isolated pixel as pixels separated from the reference pixel by the distance indicated by the contour correction parameter Pd. Determine.

ここで、Sobelフィルタの係数の並びの大きさを表す“n(列数および行数を表すn)”、輪郭抽出閾値Pc、輪郭補正用パラメータPdの値の意味について説明する。   Here, the meanings of the values of “n (n indicating the number of columns and rows)”, the contour extraction threshold value Pc, and the contour correction parameter Pd, which represent the size of the Sobel filter coefficients, will be described.

Sobelフィルタの係数はn行n列の数の並びであるが、このnが小さい場合、狭い範囲内での輝度の起伏に対して、大きな輝度勾配を算出する。すなわちnを小さくすると、狭い範囲内で少しの輝度の起伏がある場合でも、その範囲内で輝度が極大となる箇所の画素を、輪郭を表す画素として判定しやすくなる。一方、nが大きい場合、狭い範囲内での輝度の起伏に対して大きな輝度勾配を算出しなくなる。すなわちnを大きくすると、狭い範囲内での少しの輝度の起伏は輪郭として検出しにくくし、広い範囲内で輝度の起伏がある場合に輝度が極大となる箇所の画素を、輪郭を表す画素として判定しやすくなる。nを小さくしすぎると、ノイズが輪郭として検出されやすくなる。   The coefficients of the Sobel filter are arranged in a number of n rows and n columns. When n is small, a large luminance gradient is calculated with respect to the undulation of luminance within a narrow range. In other words, when n is reduced, even when there is a slight luminance undulation within a narrow range, it becomes easy to determine a pixel at a location where the luminance is maximum within that range as a pixel representing an outline. On the other hand, when n is large, a large luminance gradient is not calculated for the undulation of the luminance within a narrow range. That is, when n is increased, a slight luminance undulation within a narrow range is difficult to detect as a contour, and a pixel at a point where the luminance becomes maximum when there is a luminance undulation within a wide range is defined as a pixel representing the contour. It becomes easy to judge. If n is too small, noise is easily detected as a contour.

輪郭抽出閾値Pcは、輪郭として判定されるための輝度勾配強度の下限を表す。輪郭抽出閾値Pcを小さくしすぎると、ノイズにより輝度勾配強度が大きくなった場合であっても、輪郭を表す画素であると誤判定しやすくなる。一方、輪郭抽出閾値Pcを大きくしすぎると、ノイズを輪郭とする誤判定はなくなるが、輪郭を表す画素を、輪郭を表していないと誤判定しやすくなる。   The contour extraction threshold value Pc represents the lower limit of the luminance gradient strength to be determined as the contour. If the contour extraction threshold value Pc is too small, it is easy to erroneously determine that the pixel represents a contour even if the luminance gradient strength is increased due to noise. On the other hand, if the contour extraction threshold value Pc is too large, erroneous determination with noise as a contour is eliminated, but it is easy to erroneously determine that a pixel representing a contour does not represent a contour.

図10は、画素毎の輝度勾配の起伏を示すイメージ図である。図10に示す輝度勾配の極大点に該当する画素が、輪郭を表す画素となる。輝度勾配算出用パラメータPbに応じて定められる“n”は、どの程度の広がりを持つ範囲内で輝度勾配強度の起伏を強調するのかを定める値である。また、輪郭抽出閾値Pcは、どの程度の大きさの輝度勾配強度であれば、輪郭を表す画素と言えるのかを定める値である。   FIG. 10 is an image diagram showing the undulation of the luminance gradient for each pixel. A pixel corresponding to the maximum point of the luminance gradient shown in FIG. 10 is a pixel representing an outline. “N” determined in accordance with the luminance gradient calculation parameter Pb is a value that determines how much the undulation of the luminance gradient intensity is to be emphasized within a wide range. The contour extraction threshold value Pc is a value that determines how large the luminance gradient intensity is to represent a pixel representing the contour.

図11は、画像の拡大前後における輪郭付近での画素値の変化を示すイメージ図である。図11(a)は画像拡大前の輪郭付近の画素値の変化を示し、図11(b)は画像拡大後の輪郭付近の画素値の変化を示している。図11(b)に示すように、画像を拡大することにより、輪郭周辺での画素値の変化は緩やかになる。輪郭補正手段104は、図11(b)に示す状態から、基準画素から輝度勾配方向の一定距離以内の画素を第1の代表色に補正し、反対方向の一定距離以内の画素を第2の代表色に補正する(図11(c)参照)。この結果、図11(c)に示すように、輪郭を境に、第1の代表色と第2の代表色とで区分され、輝度変化が急峻になり、輪郭が明確化する。輪郭補正用パラメータPdは、この基準画素からの距離を表している。   FIG. 11 is an image diagram showing changes in pixel values in the vicinity of the contour before and after image enlargement. FIG. 11A shows changes in pixel values near the contour before image enlargement, and FIG. 11B shows changes in pixel values near the contour after image enlargement. As shown in FIG. 11B, by enlarging the image, the change in the pixel value around the contour becomes moderate. From the state shown in FIG. 11B, the contour correcting unit 104 corrects pixels within a certain distance in the luminance gradient direction from the reference pixel to the first representative color, and converts pixels within a certain distance in the opposite direction to the second pixel. The representative color is corrected (see FIG. 11C). As a result, as shown in FIG. 11C, the first representative color and the second representative color are divided from the contour as a boundary, the luminance change becomes steep, and the contour is clarified. The contour correction parameter Pd represents the distance from the reference pixel.

また、第1の実施形態で説明したように、輝度勾配算出手段102および輪郭補正手段104には補間画像Saが入力される。また、本変形例では、低解像度画像(拡大前の画像)から補間画像Saへの拡大率(Paとする。)がパラメータ設定手段110に入力される。パラメータ設定手段110は、入力された拡大率Paから、輝度勾配算出用パラメータPb、輪郭抽出閾値Pcおよび輪郭補正用パラメータPdを計算する。   Further, as described in the first embodiment, the interpolation image Sa is input to the luminance gradient calculating unit 102 and the contour correcting unit 104. In the present modification, an enlargement ratio (referred to as Pa) from the low resolution image (image before enlargement) to the interpolated image Sa is input to the parameter setting means 110. The parameter setting unit 110 calculates the brightness gradient calculation parameter Pb, the contour extraction threshold value Pc, and the contour correction parameter Pd from the input enlargement factor Pa.

また、低解像度画像から補間画像Saへの拡大率Paが不変である場合、パラメータ設定手段110は、拡大率Paを定数として記憶しておき、その拡大率Paから、輝度勾配算出用パラメータPb、輪郭抽出閾値Pcおよび輪郭補正用パラメータPdを計算してもよい。   When the enlargement factor Pa from the low-resolution image to the interpolated image Sa is unchanged, the parameter setting unit 110 stores the enlargement factor Pa as a constant, and the brightness gradient calculation parameter Pb, The contour extraction threshold value Pc and the contour correction parameter Pd may be calculated.

なお、Paは、低解像度画像(拡大前の画像)の横幅(水平方向の画素数)をWlとし、補間画像Saの横幅をWhとしたときに、Wh/Wlで表される値である。また、補間画像Saの縦幅を低解像度画像の縦幅で除算した値を拡大率Paとしてもよい。   Note that Pa is a value represented by Wh / Wl, where W1 is the horizontal width (number of pixels in the horizontal direction) of the low-resolution image (image before enlargement) and Wh is the horizontal width of the interpolated image Sa. Further, a value obtained by dividing the vertical width of the interpolation image Sa by the vertical width of the low-resolution image may be used as the enlargement ratio Pa.

図12は、第1の実施形態の変形例の処理経過を示すフローチャートである。第1の実施形態で説明した処理と同様の処理については、図3と同一の符号を付す。パラメータ設定手段110は、拡大率Paが入力されると、その拡大率Paを用いて、Pb,Pc,Pdを計算する(ステップS1)。   FIG. 12 is a flowchart illustrating the processing progress of the modification of the first embodiment. The same processes as those described in the first embodiment are denoted by the same reference numerals as those in FIG. When the enlargement factor Pa is input, the parameter setting unit 110 calculates Pb, Pc, and Pd using the enlargement factor Pa (step S1).

ステップS1において、パラメータ設定手段110は、以下に示す式(7)の計算を行い、輝度勾配算出用パラメータPbを算出し、そのPbを輝度勾配算出手段102に出力する。   In step S <b> 1, the parameter setting unit 110 calculates the following equation (7), calculates a luminance gradient calculation parameter Pb, and outputs the Pb to the luminance gradient calculation unit 102.

Pb=α・Pa+β 式(7)   Pb = α · Pa + β Formula (7)

α,βは定数である。また、αは0より大きな値であり、Paが大きくなるほど、Pbも大きな値となる。また、βはPbの下限を表す値である。βをPbの下限値として定めることにより、拡大率Paの値が小さくとも、Pbの値は下限値以上であることが保証される。α,βは、例えば、画像処理システムの管理者等に予め設定される。画像処理システムの管理者等は、拡大率に応じたSobelフィルタの係数が選択されるように、α,βを決定すればよい。   α and β are constants. In addition, α is a value larger than 0, and as Pa increases, Pb also increases. Β is a value representing the lower limit of Pb. By defining β as the lower limit value of Pb, it is guaranteed that the value of Pb is equal to or higher than the lower limit value even if the value of the enlargement factor Pa is small. α and β are set in advance by, for example, an administrator of the image processing system. An administrator of the image processing system may determine α and β so that a Sobel filter coefficient corresponding to the enlargement ratio is selected.

また、パラメータ設定手段110は、ステップS1において、式(8)の計算を行い、輪郭抽出閾値Pcを算出し、そのPcを輪郭抽出手段103に出力する。   Further, the parameter setting unit 110 calculates the expression (8) in step S <b> 1, calculates the contour extraction threshold value Pc, and outputs the Pc to the contour extraction unit 103.

Pc=γ・Pa 式(8)   Pc = γ · Pa Formula (8)

γは定数であり、例えば画像処理システムの管理者等に予め設定される。画像処理システムの管理者等は、拡大率と輪郭抽出閾値Pcとの関係が所望の比例関係になるようにγを定めればよい。   γ is a constant and is set in advance by, for example, an administrator of the image processing system. An administrator of the image processing system may determine γ so that the relationship between the enlargement ratio and the contour extraction threshold value Pc is a desired proportional relationship.

また、パラメータ設定手段110は、ステップS1において、式(9)の計算を行い、輪郭補正用パラメータPdを計算し、そのPdを輪郭補正手段104に出力する。   In step S1, the parameter setting unit 110 calculates Equation (9), calculates a contour correction parameter Pd, and outputs the Pd to the contour correction unit 104.

Pd=δ・Pa 式(9)   Pd = δ · Pa Formula (9)

δは定数であり、例えば画像処理システムの管理者等に予め設定される。画像処理システムの管理者等は、拡大率と輪郭補正用パラメータPdとの関係が所望の比例関係になるようにδを定めればよい。   δ is a constant and is set in advance by an administrator of the image processing system, for example. An administrator of the image processing system may determine δ so that the relationship between the enlargement ratio and the contour correction parameter Pd is a desired proportional relationship.

Pb,Pc,Pdは、例えば拡大率Paを変数とする一次関数として計算される。   Pb, Pc, and Pd are calculated as linear functions with the enlargement factor Pa as a variable, for example.

上記のα,β,γ,δの例として、α=2.0、β=1.0、γ=10.0、δ=1.5等の値が挙げられるが、これらの値に限定されるわけではない。   Examples of the above α, β, γ, δ include values of α = 2.0, β = 1.0, γ = 10.0, δ = 1.5, etc., but are not limited to these values. I don't mean.

なお、Pb,Pc,Pdの一部を予め固定値として定めておき、ステップS1でパラメータ設定手段110は、Pb,Pc,Pdのうち固定値として定められていないパラメータについて計算を行ってもよい。   Note that a part of Pb, Pc, and Pd may be determined in advance as a fixed value, and the parameter setting unit 110 may calculate a parameter that is not determined as a fixed value among Pb, Pc, and Pd in step S1. .

ステップS1でパラメータ設定手段110がPb,Pc,Pdを求めた後、画像処理システムはステップS11〜S13の処理を行う。   After the parameter setting unit 110 obtains Pb, Pc, and Pd in step S1, the image processing system performs steps S11 to S13.

輝度勾配算出手段102は、「Pbがx1以上x2未満ならば、3行3列のSobelフィルタの係数を選択する。」等のルールを予め保持しておき、そのルールに従って、パラメータ設定手段110が計算した輝度勾配算出用パラメータPbに応じたSobelフィルタの係数を選択する。そして、選択したSobelフィルタの係数を用いて、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出し、各画素の輝度勾配強度および輝度勾配方向を輪郭抽出手段103に出力する(ステップS11)。Sobelフィルタの係数を選択する点の他は、既に説明したステップS11と同様である。   The brightness gradient calculating means 102 holds in advance a rule such as “If Pb is greater than or equal to x1 and less than x2, the coefficient of the Sobel filter of 3 rows and 3 columns is selected”, and the parameter setting means 110 follows the rule. A Sobel filter coefficient corresponding to the calculated luminance gradient calculation parameter Pb is selected. Then, using the coefficient of the selected Sobel filter, the luminance gradient strength and the luminance gradient direction are calculated for each pixel of the interpolation image Sa, and the luminance gradient strength and the luminance gradient direction of each pixel are output to the contour extracting means 103 ( Step S11). Other than the selection of the Sobel filter coefficient, it is the same as step S11 already described.

輪郭抽出手段103は、パラメータ設定手段110が計算した輪郭抽出閾値Pcを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS12)。パラメータ設定手段110が輪郭抽出閾値Pcを定める点の他は、既に説明したステップS12と同様である。   The contour extracting unit 103 determines a pixel representing the contour in the interpolation image Sa using the contour extraction threshold value Pc calculated by the parameter setting unit 110 (step S12). Except for the point that the parameter setting means 110 determines the contour extraction threshold value Pc, it is the same as step S12 already described.

輪郭補正手段104は、パラメータ設定手段110が計算した輪郭補正用パラメータPdを、基準画素から第1および第2の隔離画素を定めるための距離として用い、輪郭周辺の画素値を補正する(ステップS13)。パラメータ設定手段110が基準画素から第1および第2の隔離画素を定めるための距離を定める点の他は、既に説明したステップS13と同様である。   The contour correcting unit 104 uses the contour correction parameter Pd calculated by the parameter setting unit 110 as a distance for determining the first and second isolated pixels from the reference pixel, and corrects the pixel value around the contour (step S13). ). The parameter setting unit 110 is the same as step S13 described above except that the parameter setting unit 110 determines the distance for determining the first and second isolated pixels from the reference pixel.

この第1の実施形態の変形例によれば、低解像度画像から補間画像Saへの拡大率が一定ではない場合であっても、拡大率に応じた適切なパラメータで輪郭を明瞭化することができる。   According to the modification of the first embodiment, even when the enlargement ratio from the low resolution image to the interpolated image Sa is not constant, the contour can be clarified with appropriate parameters according to the enlargement ratio. it can.

次に、第1の実施形態の他の変形例について説明する。図13は、第1の実施形態の他の変形例を示すブロック図である。既に説明した構成要素と同様の構成要素については、図1、図9と同一の符号を付す。図13に示すように、画像処理システムは、輝度勾配算出手段102、輪郭抽出手段103、輪郭補正手段104およびパラメータ設定手段110に加えて、補間画像生成手段101を備えていてもよい。図13では、コンピュータ100が補間画像生成手段101を含む場合を示している。補間画像生成手段101は、プログラムに従って動作する中央処理装置によって実現されてもよい。すなわち、中央処理装置が、画像処理用プログラムを読み込み、画像処理用プログラムに従って、補間画像生成手段101、輝度勾配算出手段102、輪郭抽出手段103、輪郭補正手段104、パラメータ設定手段110として動作してもよい。   Next, another modification of the first embodiment will be described. FIG. 13 is a block diagram illustrating another modification of the first embodiment. Constituent elements similar to those already described are denoted by the same reference numerals as those in FIGS. As shown in FIG. 13, the image processing system may include an interpolated image generating unit 101 in addition to the luminance gradient calculating unit 102, the contour extracting unit 103, the contour correcting unit 104, and the parameter setting unit 110. FIG. 13 shows a case where the computer 100 includes the interpolation image generation unit 101. The interpolated image generating means 101 may be realized by a central processing unit that operates according to a program. That is, the central processing unit reads an image processing program and operates as an interpolated image generating unit 101, a luminance gradient calculating unit 102, a contour extracting unit 103, a contour correcting unit 104, and a parameter setting unit 110 in accordance with the image processing program. Also good.

補間画像生成手段101には低解像度画像(Siと記す。)が入力され、補間画像生成手段101は補間によりその低解像度画像Siを拡大して補間画像Saを生成し、補間画像Saを輝度勾配算出手段102および輪郭補正手段104に出力する。すなわち、補間画像生成手段101は、低解像度画像Siの画素間に画素を内挿して、拡大画像である補間画像Saを生成する。補間画像生成手段101は、例えば、バイリニア補間あるいはバイキュービック補間により、低解像度画像Siを拡大する。   A low resolution image (denoted as Si) is input to the interpolated image generating means 101, and the interpolated image generating means 101 enlarges the low resolution image Si by interpolation to generate an interpolated image Sa, and the interpolated image Sa is converted into a luminance gradient. It outputs to the calculation means 102 and the outline correction means 104. That is, the interpolated image generating means 101 generates an interpolated image Sa that is an enlarged image by interpolating pixels between the pixels of the low resolution image Si. The interpolation image generation unit 101 enlarges the low resolution image Si by, for example, bilinear interpolation or bicubic interpolation.

また、パラメータ設定手段110には、生成すべき拡大画像の解像度が入力される。例えば、拡大後の補間画像Saの横幅(水平方向の画素数)が入力されてもよい。また、パラメータ設定手段110には、拡大前の低解像度画像Siの情報(例えば、低解像度画像Siの横幅)も入力される。パラメータ設定手段110は、入力された情報を用いて、拡大率Paを計算し、補間画像生成手段101に出力する。   In addition, the resolution of the enlarged image to be generated is input to the parameter setting unit 110. For example, the width of the enlarged interpolation image Sa (the number of pixels in the horizontal direction) may be input. In addition, information about the low-resolution image Si before enlargement (for example, the width of the low-resolution image Si) is also input to the parameter setting unit 110. The parameter setting unit 110 calculates the enlargement factor Pa using the input information and outputs it to the interpolation image generation unit 101.

パラメータ設定手段110に入力される情報が、拡大後の補間画像Saの横幅(水平方向の画素数)Whと、低解像度画像Siの横幅Wlであるとする。この場合、パラメータ設定手段110は、Pa=Wh/Wlを計算して、拡大率Paを求めればよい。また、パラメータ設定手段110に入力される情報は、補間画像Saの縦幅(垂直方向の画素巣)Vhと低解像度画像Siの縦幅Vlであってもよい。この場合、パラメータ設定手段110は、Pa=Vh/Vlを計算して、拡大率Paを求めればよい。   It is assumed that information input to the parameter setting unit 110 is the lateral width (number of pixels in the horizontal direction) Wh of the enlarged interpolation image Sa and the lateral width Wl of the low-resolution image Si. In this case, the parameter setting unit 110 may calculate Pa = Wh / Wl to obtain the enlargement factor Pa. The information input to the parameter setting unit 110 may be the vertical width (vertical pixel nest) Vh of the interpolated image Sa and the vertical width Vl of the low-resolution image Si. In this case, the parameter setting unit 110 may calculate Pa = Vh / Vl to obtain the enlargement factor Pa.

パラメータ設定手段110は、拡大率Paを計算した後、既に説明したように拡大率PaからPb,Pc,Pdの各パラメータを計算してもよい。   The parameter setting means 110 may calculate each parameter of Pb, Pc, and Pd from the enlargement factor Pa as described above after calculating the enlargement factor Pa.

補間画像生成手段101は、パラメータ設定手段110が計算した拡大率Paで低解像度画像Siを補間して補間画像Saを生成する。補間画像生成手段101は、拡大率Paに応じて、低解像度画像Siにおける隣接する画素間に画素を内挿する。補間画像Saは、内挿された画素を含んでいることで、低解像度画像Siよりも拡大された画像となっている。補間画像生成手段101は、拡大率Paが大きいほど、内挿する画素の数を増加させればよい。   The interpolated image generating means 101 generates an interpolated image Sa by interpolating the low resolution image Si with the enlargement factor Pa calculated by the parameter setting means 110. The interpolated image generating means 101 interpolates pixels between adjacent pixels in the low resolution image Si according to the enlargement factor Pa. The interpolated image Sa is an image enlarged from the low-resolution image Si by including the interpolated pixels. The interpolated image generating unit 101 may increase the number of pixels to be interpolated as the enlargement ratio Pa is larger.

図14は、本変形例の処理経過を示すフローチャートである。第1の実施形態で説明した処理と同様の処理については、図3と同一の符号を付す。パラメータ設定手段110には、例えば、低解像度画像Siの横幅Wlおよびユーザの所望の補間画像Saの横幅Whが入力される。パラメータ設定手段110は、WlおよびWhが入力されると、Wh/Wlを計算することにより、拡大率Paを計算する。ただし、ここで示した拡大率Paの計算方法は一例であり、他の方法で拡大率Paを計算してもよい。パラメータ設定手段110は、計算した拡大率Paを補間画像生成手段101に出力する。また、パラメータ設定手段110は、その拡大率Paを用いて、輝度勾配算出用パラメータPb、輪郭抽出閾値Pcおよび輪郭補正用パラメータPdを計算する(ステップS2)。パラメータ設定手段110は、Pbを輝度勾配算出手段102に出力し、Pcを輪郭抽出手段103に出力し、Pdを輪郭補正手段104に出力する。拡大率Paから、Pb,Pc,Pdを算出する動作は、既に説明したステップS1(図12参照)と同様である。   FIG. 14 is a flowchart showing the processing progress of this modification. The same processes as those described in the first embodiment are denoted by the same reference numerals as those in FIG. For example, the horizontal width Wl of the low-resolution image Si and the horizontal width Wh of the desired interpolation image Sa of the user are input to the parameter setting unit 110. When Wl and Wh are input, parameter setting means 110 calculates enlargement factor Pa by calculating Wh / Wl. However, the calculation method of the enlargement factor Pa shown here is an example, and the enlargement factor Pa may be calculated by other methods. The parameter setting unit 110 outputs the calculated enlargement ratio Pa to the interpolation image generation unit 101. The parameter setting means 110 calculates the brightness gradient calculation parameter Pb, the contour extraction threshold value Pc, and the contour correction parameter Pd using the enlargement factor Pa (step S2). The parameter setting unit 110 outputs Pb to the luminance gradient calculation unit 102, outputs Pc to the contour extraction unit 103, and outputs Pd to the contour correction unit 104. The operation of calculating Pb, Pc, and Pd from the enlargement factor Pa is the same as that in step S1 (see FIG. 12) already described.

補間画像生成手段101には、低解像度画像Si(拡大前の画像)が入力される。ステップS2の後、補間画像生成手段101は、拡大率Paで低解像度画像Siを補間して、ユーザの所望の解像度の補間画像Saを生成する(ステップS10)。補間画像生成手段101は、低解像度画像Siにおける隣接する画素間に拡大率Paに応じた数の画素を内挿することで画像を拡大すればよい。補間画像生成手段101は、例えば、バイリニア補間またはバイキュービック補間を行って画素を補間し、画像を拡大すればよい。   The interpolated image generating means 101 receives the low resolution image Si (image before enlargement). After step S2, the interpolated image generating means 101 interpolates the low resolution image Si with the enlargement factor Pa, and generates an interpolated image Sa having the user's desired resolution (step S10). The interpolation image generation unit 101 may enlarge the image by interpolating a number of pixels corresponding to the enlargement factor Pa between adjacent pixels in the low resolution image Si. The interpolated image generating unit 101 may perform bilinear interpolation or bicubic interpolation to interpolate pixels and enlarge the image, for example.

補間画像生成手段101がバイリニア補間を行う場合の動作について説明する。図15は、バイリニア補間の例を示すイメージ図である。図15に示す縦軸は画素値を表し、他の2軸はそれぞれx軸方向、y軸方向の座標を表している。図15に示す座標(u,v)は、補間される画素の座標である。ただし、(u,v)は低解像度画像Siにおける座標であり、小数で表される。低解像度画像Siに含まれる画素のx座標、y座標は1,2,3,・・・等の整数で表され、その座標間に画素を内挿するので、内挿される画素の座標は小数で表される。図15に示す座標(u,v)は、このような低解像度画像Siにおける座標値である。また、図15に示す各座標(k,l),(k+1,l),(k,l+1),(k+1,l+1)は、低解像度画像Siに存在する画素の座標値であり、それらの画素の画素値は既知である。また、これらの4つの画素は、補間する画素(u,v)を囲む画素であり、kはuの小数点以下を切り捨てた値であり、lはvの小数点以下を切り捨てた値である。補間画像生成手段101は、補間する座標(u,v)における画素値を算出する。   The operation when the interpolated image generating means 101 performs bilinear interpolation will be described. FIG. 15 is an image diagram illustrating an example of bilinear interpolation. The vertical axis shown in FIG. 15 represents pixel values, and the other two axes represent coordinates in the x-axis direction and the y-axis direction, respectively. The coordinates (u, v) shown in FIG. 15 are the coordinates of the pixel to be interpolated. However, (u, v) is a coordinate in the low-resolution image Si and is represented by a decimal. The x-coordinate and y-coordinate of the pixel included in the low-resolution image Si are represented by integers such as 1, 2, 3,..., And the pixel is interpolated between the coordinates. It is represented by The coordinates (u, v) shown in FIG. 15 are coordinate values in such a low resolution image Si. Also, the coordinates (k, l), (k + 1, l), (k, l + 1), and (k + 1, l + 1) shown in FIG. 15 are the coordinate values of the pixels existing in the low-resolution image Si, and these pixels The pixel values of are known. These four pixels are pixels surrounding the pixel (u, v) to be interpolated, k is a value obtained by rounding down the decimal point of u, and l is a value obtained by rounding down the decimal point of v. The interpolated image generation means 101 calculates a pixel value at the coordinates (u, v) to be interpolated.

バイリニア補間で座標(u,v)における画素値を求める場合、y座標が等しい2つの座標(k,l),(k+1,l)における画素値を用いて、座標(u,l)における画素値を線形補間する。同様に、(k,l+1),(k+1,l+1)における画素値を用いて、座標(u,l+1)における画素値を線形補間する。さらに、x座標が等しい2つの座標(u,l),(u,l+1)における画素値を用いて、座標(u,v)における画素値を線型補間する。   When the pixel value at the coordinates (u, v) is obtained by bilinear interpolation, the pixel values at the coordinates (u, l) are obtained by using the pixel values at two coordinates (k, l) and (k + 1, l) having the same y coordinate. Is linearly interpolated. Similarly, the pixel values at the coordinates (u, l + 1) are linearly interpolated using the pixel values at (k, l + 1) and (k + 1, l + 1). Further, the pixel value at the coordinates (u, v) is linearly interpolated using the pixel values at two coordinates (u, l) and (u, l + 1) having the same x coordinate.

この座標(u,v)における画素値Pは、以下に示す式(10)によって求めることができる。   The pixel value P at the coordinates (u, v) can be obtained by the following equation (10).

Figure 2009157449
Figure 2009157449

補間画像生成手段101は、式(10)に示す式を計算して補間する画素における画素値Pを算出すれよばい。なお、式(10)におけるP1,P2,P3,P4は、それぞれ座標(k,l),(k+1,l),(k,l+1),(k+1,l+1)における画素値である。このように画素値Pが定められた座標(u,v)の画素が、内挿される画素である。   The interpolated image generating means 101 may calculate the pixel value P in the pixel to be interpolated by calculating the equation shown in equation (10). Note that P1, P2, P3, and P4 in Expression (10) are pixel values at coordinates (k, l), (k + 1, l), (k, l + 1), and (k + 1, l + 1), respectively. A pixel having coordinates (u, v) at which the pixel value P is determined in this way is a pixel to be interpolated.

補間画像生成手段101がバイキュービック補間を行う場合の動作について説明する。図16は、バイキュービック補間の例を示すイメージ図である。図16に示す縦軸は画素値を表し、他の2軸はそれぞれx軸方向、y軸方向の座標を表している。図16に示す座標(u,v)は、補間される画素の座標である。図15に示す場合と同様に、(u,v)は低解像度画像Siにおける座標であり、小数で表される。バイキュービック補間では、(u,v)を囲む16個の画素(k−1,l−1),(k,l−1),(k+1,l−1),(k+2,l−1),(k−1,l),(k,l),(k+1,l),(k+2,l),(k−1,l+1),(k,l+1),(k+1,l+1),(k+2,l+1),(k−1,l+2),(k,l+2),(k+1,l+2),(k+2,l+2)の画素値から(u,v)における画素値を補間する。kはuの小数点以下を切り捨てた値であり、lはvの小数点以下を切り捨てた値である。   An operation when the interpolated image generating unit 101 performs bicubic interpolation will be described. FIG. 16 is an image diagram illustrating an example of bicubic interpolation. The vertical axis shown in FIG. 16 represents the pixel value, and the other two axes represent the coordinates in the x-axis direction and the y-axis direction, respectively. The coordinates (u, v) shown in FIG. 16 are the coordinates of the pixel to be interpolated. As in the case shown in FIG. 15, (u, v) are coordinates in the low resolution image Si and are represented by decimal numbers. In bicubic interpolation, 16 pixels (k−1, l−1), (k, l−1), (k + 1, l−1), (k + 2, l−1) surrounding (u, v), (K-1, l), (k, l), (k + 1, l), (k + 2, l), (k-1, l + 1), (k, l + 1), (k + 1, l + 1), (k + 2, l + 1) ), (K-1, l + 2), (k, l + 2), (k + 1, l + 2), and (k + 2, l + 2) pixel values at (u, v) are interpolated. k is a value obtained by truncating the decimal part of u, and l is a value obtained by truncating the decimal part of v.

バイキュービック補間で座標(u,v)における画素値を求める場合、y座標が等しい4つの座標(k−1,l−1),(k,l−1),(k+1,l−1),(k+2,l−1)の画素値を用いて、(u,l−1)における画素値を補間する。同様に、y座標が等しい4つの座標を用いて、(u,l),(u,l+1),(u,l+2)における画素値をそれぞれ補間する。さらに、x座標が等しい4つの座標(u,l−1),(u,l),(u,l+1),(u,l+2)における画素値を用いて、座標(u,v)の画素値を補間する。   When obtaining pixel values at coordinates (u, v) by bicubic interpolation, four coordinates (k−1, l−1), (k, l−1), (k + 1, l−1), with the same y coordinate, The pixel value at (u, l−1) is interpolated using the pixel value at (k + 2, l−1). Similarly, pixel values at (u, l), (u, l + 1), and (u, l + 2) are interpolated using four coordinates having the same y coordinate. Further, the pixel value at the coordinates (u, v) is obtained by using the pixel values at four coordinates (u, l−1), (u, l), (u, l + 1), (u, l + 2) having the same x coordinate. Is interpolated.

この座標(u,v)における輝度Pは、以下に示す式(11)によって求めることができる。このように画素値Pが定められた座標(u,v)の画素が、内挿される画素である。   The luminance P at the coordinates (u, v) can be obtained by the following equation (11). A pixel having coordinates (u, v) at which the pixel value P is determined in this way is a pixel to be interpolated.

Figure 2009157449
Figure 2009157449

補間画像生成手段101は、式(11)に示す式を計算して補間する画素における画素値Pを算出すれよばい。式9におけるP1〜P16は、(k−1,l−1),(k,l−1),(k+1,l−1),(k+2,l−1),(k−1,l),(k,l),(k+1,l),(k+2,l),(k−1,l+1),(k,l+1),(k+1,l+1),(k+2,l+1),(k−1,l+2),(k,l+2),(k+1,l+2),(k+2,l+2)における画素値である。   The interpolated image generating means 101 may calculate the pixel value P in the pixel to be interpolated by calculating the equation shown in equation (11). P1 to P16 in Equation 9 are (k-1, l-1), (k, l-1), (k + 1, l-1), (k + 2, l-1), (k-1, l), (K, l), (k + 1, l), (k + 2, l), (k-1, l + 1), (k, l + 1), (k + 1, l + 1), (k + 2, l + 1), (k-1, l + 2) ), (K, l + 2), (k + 1, l + 2), and (k + 2, l + 2).

また、式(11)において、f−1(t),f(t),f(t),f(t)は、それぞれ以下の式で表される。 In the equation (11), f −1 (t), f 0 (t), f 1 (t), and f 2 (t) are represented by the following equations, respectively.

−1(t)=(−t+2t−t)/2 式(12) f −1 (t) = (− t 3 + 2t 2 −t) / 2 Formula (12)

(t)=(3t−5t+2)/2 式(13) f 0 (t) = (3t 3 -5t 2 +2) / 2 Formula (13)

(t)=(−3t+4t+t)/2 式(14) f 1 (t) = (− 3t 3 + 4t 2 + t) / 2 Formula (14)

(t)=(t−t)/2 式(15) f 2 (t) = (t 3 −t 2 ) / 2 Formula (15)

また、式(11)におけるu’は、u’=u−kとして計算される値である。式(11)におけるv’は、v’=v−lとして計算される値である。   Further, u ′ in the equation (11) is a value calculated as u ′ = u−k. In the formula (11), v ′ is a value calculated as v ′ = v−1.

なお、RGB形式で表される画素のように複数種類(例えばR,G,Bの3種類)の画素値が設定されている場合、R,G,B等の画素値の種類毎にそれぞれ別々に画素値を補間すればよい。   In addition, when a plurality of types of pixel values (for example, three types of R, G, and B) are set as in the pixel expressed in the RGB format, each of the pixel values such as R, G, and B is different. It is sufficient to interpolate pixel values.

ここでは、バイリニア補間やバイキュービック補間を例示したが、補間画像生成手段101は他の方法で補間を行って低解像度画像Siを拡大してもよい。   Here, bilinear interpolation and bicubic interpolation are exemplified, but the interpolated image generating means 101 may enlarge the low-resolution image Si by performing interpolation using other methods.

補間画像生成手段101は、低解像度画像Siに対して画素を補間して生成した補間画像Saを輝度勾配算出手段102および輪郭補正手段140に出力する。輝度勾配算出手段102は、パラメータ設定手段110が計算した輝度勾配算出用パラメータPbに応じたSobelフィルタの係数を選択する。輝度勾配算出手段102は、Sobelフィルタの係数を用いて、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出し、各画素の輝度勾配強度および輝度勾配方向を輪郭抽出手段103に出力する(ステップS11)。輪郭抽出手段103は、パラメータ設定手段110が計算した輪郭抽出閾値Pcを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS12)。輪郭補正手段104は、パラメータ設定手段110が計算した輪郭補正用パラメータPdを、基準画素から第1および第2の隔離画素を定めるための距離として用い、輪郭周辺の画素値を補正する(ステップS13)。ステップS11〜S13の動作は、既に説明した変形例におけるステップS11〜S13と同様である。   The interpolated image generating unit 101 outputs an interpolated image Sa generated by interpolating pixels with respect to the low resolution image Si to the luminance gradient calculating unit 102 and the contour correcting unit 140. The luminance gradient calculation unit 102 selects a Sobel filter coefficient corresponding to the luminance gradient calculation parameter Pb calculated by the parameter setting unit 110. The luminance gradient calculating means 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel of the interpolation image Sa using the Sobel filter coefficient, and sends the luminance gradient intensity and the luminance gradient direction of each pixel to the contour extracting means 103. Output (step S11). The contour extracting unit 103 determines a pixel representing the contour in the interpolation image Sa using the contour extraction threshold value Pc calculated by the parameter setting unit 110 (step S12). The contour correcting unit 104 uses the contour correction parameter Pd calculated by the parameter setting unit 110 as a distance for determining the first and second isolated pixels from the reference pixel, and corrects the pixel value around the contour (step S13). ). The operations in steps S11 to S13 are the same as those in steps S11 to S13 in the modification already described.

本変形例によれば、補間画像生成手段101が低解像度画像Siに補間を行い補間画像Saを生成するので、低解像度画像Siを入力すれば、高品質の拡大画像を得ることができる。   According to this modification, the interpolation image generation means 101 interpolates the low resolution image Si to generate the interpolation image Sa. Therefore, if the low resolution image Si is input, a high quality enlarged image can be obtained.

また、補間画像生成手段101を備える構成において、パラメータ設定手段110が設けられていなくてもよい。その場合、輝度勾配算出手段102において輝度勾配算出用パラメータPbを予め設定しておけばよい。あるいは、Sobelフィルタの係数を予め設定しておいてもよい。また、輪郭抽出手段103では輪郭抽出閾値Pcを予め設定しておき、輪郭補正手段104では輪郭補正用パラメータPdを予め設定しておけばよい。   In the configuration including the interpolation image generation unit 101, the parameter setting unit 110 may not be provided. In this case, the luminance gradient calculation parameter Pb may be set in advance in the luminance gradient calculation means 102. Alternatively, the Sobel filter coefficient may be set in advance. The contour extraction unit 103 may set a contour extraction threshold value Pc in advance, and the contour correction unit 104 may set a contour correction parameter Pd in advance.

実施形態2.
図17は、本発明の第2の実施形態の画像処理システムの例を示すブロック図である。第1の実施形態と同様に、本実施形態の画像処理システムは、例えば、プログラム制御により動作するコンピュータ800によって実現される。コンピュータ800は、代表色推定手段802と、色補正手段803とを含む。なお、ここでは、低解像度画像(拡大前の画像)から拡大後の画像への拡大率が一定である場合を例にして説明する。また、画素がRGB形式で表されている場合を例にして説明するが、画素の表現はRGB形式に限定されない。
Embodiment 2. FIG.
FIG. 17 is a block diagram illustrating an example of an image processing system according to the second embodiment of this invention. Similar to the first embodiment, the image processing system of the present embodiment is realized by a computer 800 that operates under program control, for example. The computer 800 includes representative color estimation means 802 and color correction means 803. Here, the case where the enlargement ratio from the low resolution image (image before enlargement) to the image after enlargement is constant will be described as an example. Further, a case where the pixels are expressed in the RGB format will be described as an example, but the representation of the pixels is not limited to the RGB format.

代表色推定手段802には、補間処理(例えば、バイリニア補間やバイキュービック補間)によって拡大された補間画像Saが入力される。代表色推定手段802は、補間画像Saに含まれる個々の画素を選択する。代表色推定手段802は、選択した画素を中心とする一定サイズの画素のブロック(例えば、5行5列のブロック)を抽出し、そのブロック内の画素の色を二つのクラスにクラスタリングする。代表色推定手段802は、その二つのクラスのそれぞれについて、クラスを代表する代表色M1,M2を特定する。また、ブロック内の各画素の色が第1のクラスに属する確率および第2のクラスに属する確率を求める。この確率や代表色は、例えばEMアルゴリズム(Expectation Maximizationアルゴリズム)によって求めればよい。代表色推定手段802は、補間画像Sa内の個々の画素を選択して、各画素毎にブロックの抽出、代表色および上記の確率の導出を行う。   The representative color estimation unit 802 receives an interpolation image Sa enlarged by interpolation processing (for example, bilinear interpolation or bicubic interpolation). The representative color estimation unit 802 selects individual pixels included in the interpolation image Sa. The representative color estimation unit 802 extracts a block of pixels having a fixed size centered on the selected pixel (for example, a block of 5 rows and 5 columns), and clusters the colors of the pixels in the block into two classes. The representative color estimation unit 802 specifies the representative colors M1 and M2 representing the class for each of the two classes. Further, the probability that the color of each pixel in the block belongs to the first class and the probability that the color belongs to the second class is obtained. The probability and the representative color may be obtained by, for example, an EM algorithm (Expectation Maximization algorithm). The representative color estimation unit 802 selects individual pixels in the interpolated image Sa, extracts a block for each pixel, and derives a representative color and the above probability.

図18は、クラスタリングおよび代表色を説明するイメージ図である。選択した画素を中心とする5行5列の範囲をブロックとして抽出するとする。このブロックの左上部分には、赤系の画素が存在し、右下部分には緑系の画素が存在するものとする(図18(a)参照)。赤系の画素の画素値(R,G,B)は、例えば(255,0,0)、(240,0,0)、(250,1,0)等で表され、RGB色空間では互いに近い位置に存在する(図18(b)参照)。同様に、緑系の画素の画素値は、例えば、(0,255,0)、(0,255,3)、(1,240,5)等で表され、RGB空間で互いに近い位置に存在する(図18(b)参照)。代表色推定手段802は、このような画素の色のクラスを代表する代表色を決定し、クラス毎に各画素の色がそのクラスに属する確率を求める。図18では、画素の赤系の色と緑系の色に明確に区分される場合を例示したが、ブロック内の画素が同系統の色であっても、例えばEMアルゴリズムにより代表色や上記の確率を求めることができる。   FIG. 18 is an image diagram for explaining clustering and representative colors. It is assumed that a 5 × 5 range centered on the selected pixel is extracted as a block. It is assumed that a red pixel exists in the upper left portion of the block and a green pixel exists in the lower right portion (see FIG. 18A). The pixel values (R, G, B) of red pixels are represented by, for example, (255, 0, 0), (240, 0, 0), (250, 1, 0), etc. It exists in the near position (refer FIG.18 (b)). Similarly, the pixel values of green pixels are represented by, for example, (0, 255, 0), (0, 255, 3), (1, 240, 5), etc., and exist at positions close to each other in the RGB space. (See FIG. 18B). The representative color estimation means 802 determines a representative color representing such a pixel color class, and obtains the probability that the color of each pixel belongs to that class for each class. FIG. 18 illustrates a case where the pixel is clearly divided into a red color and a green color. However, even if the pixels in the block are of the same color, for example, the representative color or the above-described color may be obtained by an EM algorithm. Probability can be obtained.

色補正手段803は、代表色M1,M2の色空間での距離が閾値以上である場合、代表色推定手段802が抽出したブロック内の画素毎に、第1のクラスに属する確率および第2のクラスに属する確率に応じて、画素の色を代表色M1,M2のいずれかに補正する。色補正手段803は、この処理を代表色推定手段802が抽出したブロック毎に行う。   When the distance in the color space of the representative colors M1 and M2 is equal to or greater than the threshold value, the color correction unit 803 determines the probability of belonging to the first class and the second probability for each pixel in the block extracted by the representative color estimation unit 802. The pixel color is corrected to one of the representative colors M1 and M2 according to the probability of belonging to the class. The color correction unit 803 performs this process for each block extracted by the representative color estimation unit 802.

ブロックは補間画像Saの各画素を中心とする一定サイズの画素の集合であるので、一つの画素が複数のブロックに属することが生じる。この場合、色補正手段803は、各ブロックにおける補正結果の平均をその画素に設定する。   Since a block is a set of pixels having a certain size centered on each pixel of the interpolation image Sa, one pixel may belong to a plurality of blocks. In this case, the color correction unit 803 sets the average of the correction results in each block for that pixel.

代表色推定手段802および色補正手段803は、例えば、プログラムに従って動作する中央処理装置(CPU)によって実現される。すなわち、中央処理装置が、コンピュータ800が備える記憶装置(図示せず。)から画像処理用プログラムを読み込み、画像処理用プログラムに従って、代表色推定手段802および色補正手段803として動作してもよい。また、代表色推定手段802および色補正手段803がそれぞれ別個の回路として実現されていてもよい。   The representative color estimation unit 802 and the color correction unit 803 are realized by a central processing unit (CPU) that operates according to a program, for example. That is, the central processing unit may read an image processing program from a storage device (not shown) included in the computer 800 and operate as the representative color estimation unit 802 and the color correction unit 803 according to the image processing program. Further, the representative color estimation unit 802 and the color correction unit 803 may be realized as separate circuits.

次に、動作について詳細に説明する。
図19は、第2の実施形態の処理経過の例を示すフローチャートである。本実施形態では、代表色推定手段802および色補正手段803に補間画像Saが入力される。補間画像Saが入力されると、代表色推定手段802は、補間画像Sa中の画素を一つ選択し、選択した画素を中心とする一定範囲のブロックを抽出する(ステップS51)。このブロックの範囲は、例えば5行5列等のように予め定められているものとする。
Next, the operation will be described in detail.
FIG. 19 is a flowchart illustrating an example of processing progress of the second embodiment. In this embodiment, the interpolation image Sa is input to the representative color estimation unit 802 and the color correction unit 803. When the interpolated image Sa is input, the representative color estimating unit 802 selects one pixel in the interpolated image Sa and extracts a block in a certain range centered on the selected pixel (step S51). It is assumed that the range of this block is predetermined such as 5 rows and 5 columns.

次に、代表色推定手段802は、抽出したブロック内の各画素の色を2つのクラスC1,C2にクラスタリング(分類)し、各クラスの代表色M1,M2を特定する(ステップS52)。ステップS52において、代表色推定手段802は、抽出したブロック内の各画素について、第1のクラスC1に属する確率および第2のクラスC2に属する確率を求める。以下、EMアルゴリズムを用いる場合を例にして、ステップS52の処理について説明する。   Next, the representative color estimation unit 802 clusters (classifies) the colors of each pixel in the extracted block into two classes C1 and C2, and specifies the representative colors M1 and M2 of each class (step S52). In step S52, the representative color estimation unit 802 obtains a probability belonging to the first class C1 and a probability belonging to the second class C2 for each pixel in the extracted block. Hereinafter, the process of step S52 will be described using the case of using the EM algorithm as an example.

以下の説明において、μは、クラスの中心の色(代表色となる色)のR,G,Bの値を要素とするベクトルであるとする。また、ωは、混合パラメータと呼ばれる重み係数である。σは、クラスタリングされた画素の画素値が色空間においてどれだけ広がっているかを表す値である。また、jは、2つのクラスを識別するための変数であり、例えばj=0は第1のクラスを意味し、j=1は第2のクラスを意味する。このjは、記号の添え字として用いられることもある。代表色推定手段802は、任意に定めたω,μ,σの初期値の組を二組生成する。この2組は、第1のクラスおよび第2のクラスに対応している。代表色推定手段802は、各組それぞれについて、ω,μ,σそれぞれを再計算することを繰り返す。この再計算により、μ(ここでは、R,G,Bの値)を収束させ、代表色を決定する。また、θは、ω,μ,σの組を示す記号である。各記号に(t)を付加して記した場合、そのtは再計算の回数を表しているものとする。また、ステップS51で抽出されたブロック内の各画素の画素値(R,G,B)の値を要素とするベクトルをxと記し、ブロック内のn番目の画素についてのベクトルxについては添え字nを付加してxと記す。 In the following description, it is assumed that μ is a vector whose elements are R, G, and B values of the center color of the class (a representative color). Further, ω is a weighting factor called a mixing parameter. σ is a value representing how much the pixel values of the clustered pixels are spread in the color space. J is a variable for identifying two classes. For example, j = 0 means the first class, and j = 1 means the second class. This j may be used as a subscript of a symbol. The representative color estimation unit 802 generates two sets of arbitrarily defined initial values of ω, μ, and σ. The two sets correspond to the first class and the second class. The representative color estimation unit 802 repeats recalculation of ω, μ, and σ for each group. By this recalculation, μ (here, R, G, B values) is converged and a representative color is determined. Θ is a symbol indicating a set of ω, μ, and σ. When (t) is added to each symbol, the t represents the number of recalculations. In addition, a vector having the pixel value (R, G, B) value of each pixel in the block extracted in step S51 as an element is denoted by x, and the vector x for the nth pixel in the block is a subscript. Add n and write xn .

代表色推定手段802は、任意に定めたω,μ,σの初期値の組を二組生成すると、各組毎に、ブロック内の画素がその組のクラスに属している確率を計算する。この確率をP(j|x,θ(t))と表す。代表色推定手段802は、以下に示す式(16)によりP(j|x,θ(t))を求める。 When the representative color estimation unit 802 generates two sets of arbitrarily defined initial values of ω, μ, and σ, for each set, the representative color estimation unit 802 calculates the probability that the pixel in the block belongs to the class of the set. This probability is expressed as P (j | x n , θ (t) ). The representative color estimation unit 802 obtains P (j | x n , θ (t) ) according to the following equation (16).

Figure 2009157449
Figure 2009157449

代表色推定手段802は、式(16)の計算を行うときに、右辺のP(x|j)を以下の式(17)を計算することによって求める。 The representative color estimation unit 802 calculates P (x n | j) on the right side by calculating the following equation (17) when calculating the equation (16).

Figure 2009157449
Figure 2009157449

代表色推定手段802は、式(16)の計算を行うときに、右辺のp(x)を以下の式(18)を計算することによって求める。 The representative color estimation unit 802 calculates p (x n ) on the right side by calculating the following equation (18) when calculating the equation (16).

Figure 2009157449
は、混合パラメータと呼ばれる重み係数であり、以下の条件を満たす。
Figure 2009157449
w j is a weighting factor called a mixing parameter and satisfies the following condition.

Figure 2009157449
Figure 2009157449

代表色推定手段802は、各jについて(すなわち各クラスについて)、式(16)によりP(j|x,θ(t))を計算すると、各jについてω,μ,σを再計算する。 The representative color estimation means 802 calculates P (j | x n , θ (t) ) for each j (that is, for each class) using equation (16), and calculates ω j , μ j , σ j for each j. Recalculate.

ωは以下に示す式(19)の左辺に相当し、代表色推定手段802は、式(19)の計算によりωを再計算する。 ω j corresponds to the left side of the following equation (19), and the representative color estimation unit 802 recalculates ω j by the calculation of equation (19).

Figure 2009157449
Figure 2009157449

μは以下に示す式(20)の左辺に相当し、代表色推定手段802は、式(20)の計算によりμを再計算する。 μ j corresponds to the left side of the following equation (20), and the representative color estimation unit 802 recalculates μ j by the calculation of equation (20).

Figure 2009157449
Figure 2009157449

σは以下に示す式(21)の左辺に相当し、代表色推定手段802は、式(21)の計算によりσを再計算する。

Figure 2009157449
σ j corresponds to the left side of the following equation (21), and the representative color estimation means 802 recalculates σ j by the calculation of equation (21).
Figure 2009157449

式(19)から式(20)におけるNは、ステップS51で抽出されたブロックに属する画素の総数である。また、Mは、データ(画素値)の次元の数である。本例では、画素値は、R,G,Bの3次元のデータであるので、M=3である。   N in the equations (19) to (20) is the total number of pixels belonging to the block extracted in step S51. M is the number of dimensions of data (pixel value). In this example, since the pixel value is three-dimensional data of R, G, and B, M = 3.

代表色推定手段802は、ω,μ,σを再計算したら、そのω,μ,σ
から式(16)によりP(j|x,θ(t))を再計算し、さらに式(19)〜(21)によりω,μ,σを計算する。
Representative color estimating unit 802, upon re-calculate ω j, μ j, σ j, its ω j, μ j, σ j
To P (j | x n , θ (t) ) according to equation (16), and ω j , μ j , and σ j according to equations (19) to (21).

代表色推定手段802は、計算前後でのμの変化量が閾値以下になったときに、μが収束したと判定し、再計算を停止する。そのときに得られたμが、代表色のR,G,Bの各成分の値となる。また、代表色推定手段802は、収束したときのω,μ,σからさらにP(j|x,θ(t))を計算する。このP(j|x,θ(t))が、画素xの色が、クラスjに属する確率である。 The representative color estimation unit 802 determines that μ j has converged when the amount of change in μ j before and after the calculation is equal to or less than the threshold, and stops recalculation. The μ j obtained at that time is the value of each component of the representative colors R, G, and B. The representative color estimation unit 802 further calculates P (j | x n , θ (t) ) from ω j , μ j , and σ j when converged. This P (j | x n , θ (t) ) is the probability that the color of the pixel x n belongs to the class j.

以上のステップS52の処理により、ブロック内の各画素の第1のクラスに属する確率、第2のクラスに属する確率、および代表色M1,M2が得られる。以下、ブロック内の画素(x,y)の色が第1のクラスに属する確率をP1(x,y)と記し、第2のクラスに属する確率をP2(x,y)と記す。   Through the processing in step S52 described above, the probability that each pixel in the block belongs to the first class, the probability that it belongs to the second class, and the representative colors M1 and M2 are obtained. Hereinafter, the probability that the color of the pixel (x, y) in the block belongs to the first class is referred to as P1 (x, y), and the probability that the color belongs to the second class is referred to as P2 (x, y).

次に、色補正手段803は、代表色M1,M2の距離Dに応じた指標を計算する。2つの色の距離は、色を表す各成分毎に差の二乗を計算し、その計算結果の和の平方根として得られる値である。本例のように色がR,G,Bの各成分で表される場合、R成分の差の二乗、B成分の差の二乗、およびB成分の差の二乗をそれぞれ計算し、その和の平方根が距離となる。すなわち、代表色M1のR,G,B各成分を(R1,G1,B1)とし、代表色M2のR,G,B各成分を(R2,G2,B2)とすると、距離Dは以下に示す式(22)で表される。   Next, the color correction unit 803 calculates an index according to the distance D between the representative colors M1 and M2. The distance between two colors is a value obtained as a square root of the sum of the calculation results of calculating the square of the difference for each component representing the color. When the color is represented by R, G, and B components as in this example, the square of the difference of the R component, the square of the difference of the B component, and the square of the difference of the B component are calculated, respectively. The square root is the distance. That is, assuming that the R, G, B components of the representative color M1 are (R1, G1, B1) and the R, G, B components of the representative color M2 are (R2, G2, B2), the distance D is It is represented by the formula (22) shown.

D=√{(R1−R2)+(G1−G2)+(B1−B2)} 式(22) D = √ {(R1-R2) 2 + (G1-G2) 2 + (B1-B2) 2 } Formula (22)

色補正手段803は、距離D自体を計算してもよく、あるいは、距離Dに応じた指標を計算してもよい。ここでは、距離Dに応じた指標として、(R1−R2)+(G1−G2)+(B1−B2)を計算する。色補正手段803は、距離Dに応じた指標が所定値以上であるか否かにより、代表色同士の距離が閾値以上であるか否かを判定する(ステップS53)。 The color correction unit 803 may calculate the distance D itself, or may calculate an index corresponding to the distance D. Here, (R1−R2) 2 + (G1−G2) 2 + (B1−B2) 2 is calculated as an index corresponding to the distance D. The color correction unit 803 determines whether the distance between the representative colors is equal to or greater than a threshold value based on whether or not the index corresponding to the distance D is equal to or greater than a predetermined value (step S53).

(R1−R2)+(G1−G2)+(B1−B2)の計算結果が所定値以上である場合、色補正手段803は、距離Dが閾値以上であると判定する。この場合(ステップS53のYes)、色補正手段803は、ステップS51で抽出されたブロック内の各画素毎に、第1のクラスに属する確率および第2のクラスに属する確率に応じて、画素の色を補正する(ステップS54)。 When the calculation result of (R1−R2) 2 + (G1−G2) 2 + (B1−B2) 2 is equal to or greater than a predetermined value, the color correction unit 803 determines that the distance D is equal to or greater than the threshold. In this case (Yes in step S53), the color correction unit 803 determines the pixel correction according to the probability belonging to the first class and the probability belonging to the second class for each pixel in the block extracted in step S51. The color is corrected (step S54).

ステップS54において、色補正手段803は、ブロック内の各画素を選択し、その画素の色が第1のクラス(代表色M1のクラス)に属する確率P1(x,y)と、第2のクラス(代表色M2のクラス)に属する確率P2(x,y)とを比較する。P1(x,y)>P2(x,y)であれば、色補正手段803は、選択した画素(x、y)の色を代表色M1に置換する。すなわち、選択した画素の画素値(R,G,Bの値)を、代表色M1のR,G,Bの値に置換する。一方、P1(x,y)>P2(x,y)が成立していなければ、色補正手段803は、選択した画素(x、y)の色を代表色M2に置換する。すなわち、選択した画素の画素値(R,G,Bの値)を、代表色M2のR,G,Bの値に置換する。色補正手段803は、この置換をブロック内の各画素毎に行う。ブロック内の各画素について置換が終了したならば、ステップS55に移行する。   In step S54, the color correction unit 803 selects each pixel in the block, the probability P1 (x, y) that the color of the pixel belongs to the first class (class of the representative color M1), and the second class. The probability P2 (x, y) belonging to (class of representative color M2) is compared. If P1 (x, y)> P2 (x, y), the color correction unit 803 replaces the color of the selected pixel (x, y) with the representative color M1. That is, the pixel values (R, G, and B values) of the selected pixel are replaced with the R, G, and B values of the representative color M1. On the other hand, if P1 (x, y)> P2 (x, y) does not hold, the color correcting unit 803 replaces the color of the selected pixel (x, y) with the representative color M2. That is, the pixel values (R, G, and B values) of the selected pixel are replaced with the R, G, and B values of the representative color M2. The color correction unit 803 performs this replacement for each pixel in the block. When the replacement is completed for each pixel in the block, the process proceeds to step S55.

(R1−R2)+(G1−G2)+(B1−B2)の計算結果が所定値未満である場合、色補正手段803は、距離Dが閾値未満であると判定する。この場合(ステップS53のNo)、ステップS54を行わずにステップS55に移行する。 When the calculation result of (R1−R2) 2 + (G1−G2) 2 + (B1−B2) 2 is less than a predetermined value, the color correction unit 803 determines that the distance D is less than the threshold value. In this case (No in step S53), the process proceeds to step S55 without performing step S54.

ステップS55において、色補正手段803は、補間画像Sa中の各画素を中心とする各ブロックについてステップS51以降の処理を完了しているか否かを判定する。未だステップS51以降の処理が行われていないブロックがあれば、未処理のブロックについてステップS51以降の処理を行う。全ブロックについてステップS51以降の処理が完了していれば、処理を終了する。   In step S55, the color correction unit 803 determines whether or not the processing from step S51 onward is completed for each block centered on each pixel in the interpolation image Sa. If there is a block that has not been processed after step S51, the process after step S51 is performed on the unprocessed block. If the processing after step S51 is completed for all blocks, the processing is terminated.

ただし、一つの画素が複数のブロックに属し、各ブロック毎にその画素の置換後の色(画素値)が導出される場合、色補正手段803は、各ブロック毎にその一つの画素に対して導出された置換後の画素値の平均値を、その画素の画素値とする。   However, when one pixel belongs to a plurality of blocks and a color (pixel value) after replacement of the pixel is derived for each block, the color correction unit 803 applies the one pixel to each block. The average value of the derived pixel values after replacement is set as the pixel value of the pixel.

本実施形態によれば、ブロック内の2つの代表色の距離が閾値以上である場合、そのブロック内の画素を代表色に置換することにより、画素を補正するので、輪郭が明瞭な、高品質な拡大画像を生成することができる。また、代表色M1,M2を特定する際に、クラスタリングによる統計的処理を用いるため、ノイズなどの影響を受けずに、安定して代表色を取得できる。   According to the present embodiment, when the distance between two representative colors in a block is greater than or equal to a threshold, the pixels are corrected by replacing the pixels in the block with the representative colors, so that the outline is clear and the quality is high. An enlarged image can be generated. Further, since the statistical processing by clustering is used when specifying the representative colors M1 and M2, the representative colors can be stably acquired without being affected by noise or the like.

次に、第2の実施形態の変形例について説明する。上記の第2の実施形態では、補間画像Saに属する個々の画素をそれぞれ選択し、その画素を中心とするブロックを抽出して、各ブロック毎にステップS51以降の処理を行う場合を示した。以下に示す変形例では、補間画像Sa中の選択対象画素を輪郭上の画素とし、その輪郭上の各画素を中心とするブロックを抽出してステップS51以降の処理を行う。図20は、第2の実施形態の変形例を示すブロック図である。既に説明した構成要素と同様の構成要素については、図17と同一の符号を付す。図20に示すように、画像処理システムは、代表色推定手段802、色補正手段803に加えて、輝度勾配算出手段102と輪郭抽出手段103とを備えていてもよい。図20では、コンピュータ800が輝度勾配算出手段102と輪郭抽出手段103とを含む場合を示している。輝度勾配算出手段102および輪郭抽出手段103は、プログラムに従って動作する中央処理装置によって実現されてもよい。すなわち、中央処理装置が、画像処理用プログラムを読み込み、画像処理用プログラムに従って、輝度勾配算出手段102、輪郭抽出手段103、代表色推定手段802および色補正手段803として動作してもよい。   Next, a modification of the second embodiment will be described. In the second embodiment described above, the individual pixels belonging to the interpolated image Sa are selected, the block centered on the pixel is extracted, and the processing after step S51 is performed for each block. In the modification shown below, the selection target pixel in the interpolated image Sa is set as a pixel on the contour, and a block centering on each pixel on the contour is extracted, and the processing from step S51 is performed. FIG. 20 is a block diagram illustrating a modification of the second embodiment. Constituent elements similar to those already described are given the same reference numerals as in FIG. As shown in FIG. 20, the image processing system may include a luminance gradient calculation unit 102 and a contour extraction unit 103 in addition to the representative color estimation unit 802 and the color correction unit 803. FIG. 20 shows a case where the computer 800 includes a brightness gradient calculating unit 102 and a contour extracting unit 103. The brightness gradient calculating unit 102 and the contour extracting unit 103 may be realized by a central processing unit that operates according to a program. That is, the central processing unit may read the image processing program and operate as the luminance gradient calculation unit 102, the contour extraction unit 103, the representative color estimation unit 802, and the color correction unit 803 according to the image processing program.

本変形例における輝度勾配算出手段102および輪郭抽出手段103は、第1の実施形態の画像処理システムが備える輝度勾配算出手段102および輪郭抽出手段103と同様の処理を行う。本変形例の輝度勾配算出手段102および輪郭抽出手段103には、第1の実施形態と同一の符号を付して説明する。   The luminance gradient calculation unit 102 and the contour extraction unit 103 in this modification perform the same processing as the luminance gradient calculation unit 102 and the contour extraction unit 103 included in the image processing system of the first embodiment. The brightness gradient calculating unit 102 and the contour extracting unit 103 of this modification will be described with the same reference numerals as those in the first embodiment.

輝度勾配算出手段102には、補間画像Saが入力され、輝度勾配算出手段102は、補間画像Saの各画素毎に、輝度勾配強度および輝度勾配方向を計算する。また、輪郭抽出手段103は、各画素における輝度勾配強度および輝度勾配方向を用いて、劣化する前の本来の輪郭を表す画素を判定する。   The luminance gradient calculation unit 102 receives the interpolation image Sa, and the luminance gradient calculation unit 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel of the interpolation image Sa. In addition, the contour extracting unit 103 determines a pixel representing an original contour before deterioration using the luminance gradient intensity and luminance gradient direction in each pixel.

図21は、第2の実施形態の変形例の処理経過を示すフローチャートである。第2の実施形態で説明した処理と同様の処理については、図19と同一の符号を付す。   FIG. 21 is a flowchart showing the processing progress of a modification of the second embodiment. The same processes as those described in the second embodiment are denoted by the same reference numerals as those in FIG.

輝度勾配算出手段102は、補間画像Saが入力されると、第1の実施形態と同様に、捕願画像Sa中の個々の画素毎に、画素値から輝度値を特定する。例えば、式(1)の計算により、各画素毎に輝度値を計算する。そして、輝度勾配算出手段102は、予め定められたSobelフィルタの係数の畳み込みを行い、補間画像Saの各画素毎に、水平方向の輝度勾配、垂直方向の輝度勾配を計算する。さらに、輝度勾配算出手段102は、各画素毎に、輝度勾配強度Sb(x,y)および輝度勾配方向Sc(x,y)を計算する(ステップS49)。輝度勾配強度Sb(x,y)は、例えば式(4)または式(5)によって計算すればよい。輝度勾配方向Sc(x,y)は、例えば式(6)によって計算すればよい。なお、ここでは、Sobelフィルタの係数を用いる場合を例示しているが、他の他のエッジ検出オペレータの係数(Robinsonのオペレータの係数やPrewittのオペレータの係数等)を用いる場合の処理も同様である。   When the interpolation image Sa is input, the luminance gradient calculating unit 102 specifies the luminance value from the pixel value for each individual pixel in the application image Sa, as in the first embodiment. For example, the luminance value is calculated for each pixel by the calculation of Expression (1). Then, the luminance gradient calculation unit 102 performs convolution of coefficients of a predetermined Sobel filter, and calculates a horizontal luminance gradient and a vertical luminance gradient for each pixel of the interpolation image Sa. Further, the luminance gradient calculating means 102 calculates the luminance gradient intensity Sb (x, y) and the luminance gradient direction Sc (x, y) for each pixel (step S49). The brightness gradient strength Sb (x, y) may be calculated by, for example, the formula (4) or the formula (5). The luminance gradient direction Sc (x, y) may be calculated by, for example, the equation (6). Here, the case where the Sobel filter coefficient is used is illustrated, but the processing in the case of using other edge detection operator coefficients (such as Robinson operator coefficients and Prewitt operator coefficients) is also the same. is there.

ステップS49の後、輪郭抽出手段103は、輝度勾配算出手段102が算出した各画素の輝度勾配強度、輝度勾配方向と、予め定められた輪郭抽出閾値Pcとを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS50)。輪郭抽出手段103は、各画素を輪郭判定対象画素として選択する。そして、輪郭判定対象画素の輝度勾配強度が輪郭抽出閾値Pcよりも大きく、かつ、輪郭判定対象画素の輝度勾配方向の隣接画素の輝度勾配強度と、輝度勾配方向を180°回転させた方向の隣接画素の輝度勾配強度のいずれよりも大きい場合、輪郭判定対象画素が輪郭上の画素であると判定する。輪郭抽出手段103は、輪郭を表す画素と判定した画素を代表色推定手段802に通知する。   After step S49, the contour extracting unit 103 uses the luminance gradient intensity and luminance gradient direction of each pixel calculated by the luminance gradient calculating unit 102 and a predetermined contour extraction threshold value Pc in the interpolation image Sa. Is determined (step S50). The contour extracting unit 103 selects each pixel as a contour determination target pixel. Then, the luminance gradient strength of the contour determination target pixel is larger than the contour extraction threshold value Pc, and the luminance gradient strength of the adjacent pixel in the luminance gradient direction of the contour determination target pixel is adjacent to the direction in which the luminance gradient direction is rotated by 180 °. When it is larger than any of the brightness gradient intensities of the pixel, it is determined that the contour determination target pixel is a pixel on the contour. The contour extracting unit 103 notifies the representative color estimating unit 802 of the pixel determined as the pixel representing the contour.

ステップS49,S50は、第1の実施形態におけるステップS11,S12と同様の処理である。   Steps S49 and S50 are the same processes as steps S11 and S12 in the first embodiment.

ステップS50の後、代表色推定手段802および色補正手段803は、第2の実施形態で説明したステップS51〜ステップS55の処理を行う。ただし、代表色推定手段802は、ステップS51において、輪郭抽出手段103から通知された輪郭を表す画素のみを選択対象とする。また、色補正手段803は、ステップS55において、補間画像Sa中の輪郭を表す各画素について、ステップS51以降の処理を完了しているか否かを判定する。輪郭を表す各画素のうち、ステップS51以降の処理が行われていない画素が残っていればステップS51以降の処理を繰り返す。輪郭を表す各画素についてステップS51以降の処理が完了していれば処理を終了する。その他の点については、第2の実施形態と同様である。   After step S50, the representative color estimation unit 802 and the color correction unit 803 perform the processing of steps S51 to S55 described in the second embodiment. However, the representative color estimation unit 802 selects only pixels representing the contour notified from the contour extraction unit 103 in step S51. In step S55, the color correction unit 803 determines whether or not the processing after step S51 has been completed for each pixel representing the contour in the interpolation image Sa. If there is any pixel that has not been subjected to the processing after step S51 among the pixels representing the contour, the processing after step S51 is repeated. If the processing from step S51 onward is completed for each pixel representing the contour, the processing ends. The other points are the same as in the second embodiment.

この結果、輪郭を表していない画素についてはステップS51以降の処理が省略されるので、処理を簡略して処理時間を短縮することができる。   As a result, since the processing after step S51 is omitted for pixels that do not represent the contour, the processing can be simplified and the processing time can be shortened.

次に、第2の実施形態の他の変形例について説明する。以下に示す変形例では、ステップS51で抽出するブロックの範囲等を可変とする。図22は、第2の実施形態の他の変形例を示すブロック図である。既に説明した構成要素と同一の構成要素については、図20と同一の符号を付す。図22に示すように、画像処理システムは、輝度勾配算出手段102、輪郭抽出手段103、代表色推定手段802および色補正手段803に加えて、パラメータ設定手段810を備えていてもよい。図22では、コンピュータ800とは別にパラメータ設定手段810を備える場合を示しているが、コンピュータ800がパラメータ設定手段810を含んでいてもよい。そして、パラメータ設定手段810は、プログラムに従って動作する中央処理装置によって実現されてもよい。すなわち、中央処理装置が、画像処理用プログラムを読み込み、画像処理用プログラムに従って、輝度勾配算出手段102、輪郭抽出手段103、代表色推定手段802、色補正手段803、パラメータ設定手段810として動作してもよい。   Next, another modification of the second embodiment will be described. In the following modification, the range of blocks extracted in step S51 is variable. FIG. 22 is a block diagram illustrating another modification of the second embodiment. Components that are the same as those already described are given the same reference numerals as in FIG. As shown in FIG. 22, the image processing system may include a parameter setting unit 810 in addition to the luminance gradient calculation unit 102, the contour extraction unit 103, the representative color estimation unit 802, and the color correction unit 803. Although FIG. 22 shows a case where the parameter setting unit 810 is provided separately from the computer 800, the computer 800 may include the parameter setting unit 810. The parameter setting unit 810 may be realized by a central processing unit that operates according to a program. That is, the central processing unit reads the image processing program and operates as the luminance gradient calculation unit 102, the contour extraction unit 103, the representative color estimation unit 802, the color correction unit 803, and the parameter setting unit 810 according to the image processing program. Also good.

パラメータ設定手段810は、ステップS51で抽出する画素のブロックとして何行何列のブロックを抽出するのかを定めるパラメータを算出し、代表色推定手段802および色補正手段803に出力する。以下、このパラメータをブロック決定用パラメータと記し、“Pe”と表す。代表色推定手段802は、ステップS51において、ブロック決定用パラメータPeに応じた大きさのブロックを抽出する。   The parameter setting unit 810 calculates a parameter that determines how many rows and columns are extracted as the pixel block extracted in step S51, and outputs the calculated parameter to the representative color estimation unit 802 and the color correction unit 803. Hereinafter, this parameter is referred to as a block determination parameter and is represented as “Pe”. In step S51, the representative color estimation unit 802 extracts a block having a size corresponding to the block determination parameter Pe.

また、パラメータ設定手段810には、低解像度画像から補間画像Saへの拡大率Paが入力される。パラメータ設定手段810は、入力された拡大率Paをからブロック決定用パラメータPeを計算する。なお、拡大率Paが不変である場合、パラメータ設定手段810は、拡大率Paを定数として記憶しておき、その拡大率Paからブロック決定用パラメータPeを計算してもよい。   The parameter setting means 810 receives an enlargement factor Pa from the low resolution image to the interpolated image Sa. The parameter setting means 810 calculates a block determination parameter Pe from the input enlargement factor Pa. When the enlargement rate Pa is unchanged, the parameter setting unit 810 may store the enlargement rate Pa as a constant and calculate the block determination parameter Pe from the enlargement rate Pa.

パラメータ設定手段810は、以下に示す式(23)の計算を行い、ブロック決定用パラメータPeを計算すればよい。   The parameter setting unit 810 may calculate the block determination parameter Pe by calculating the following equation (23).

Pe=ε・Pa+ζ 式(23)   Pe = ε · Pa + ζ Equation (23)

ε,ζは定数である。また、εは0より大きな値であり、Paが大きくなるほど、Peも大きな値となる。また、ζはPeの下限を表す値である。ζをPeの下限値として定めることにより、拡大率Peの値が小さくともPbの値は下限値以上であることが保証される。ε,ζは、例えば、画像処理システムの管理者等に予め設定される。画像処理システムの管理者等は、拡大率に応じた大きさのブロック数が選択されるように、ε,ζを決定すればよい。Peは、例えば拡大率Paを変数とする一次関数として計算される。ε,ζの例として、ε=2.0、ζ=−1.0等の値が挙げられるが、これらの値に限定されるわけではない。   ε and ζ are constants. Further, ε is a value larger than 0, and Pe increases as Pa increases. Ζ is a value representing the lower limit of Pe. By defining ζ as the lower limit value of Pe, it is ensured that the value of Pb is not less than the lower limit value even if the value of the enlargement factor Pe is small. For example, ε and ζ are set in advance by an administrator of the image processing system. An administrator of the image processing system may determine ε and ζ so that the number of blocks having a size corresponding to the enlargement ratio is selected. Pe is calculated, for example, as a linear function with the enlargement ratio Pa as a variable. Examples of ε and ζ include values such as ε = 2.0 and ζ = −1.0, but are not limited to these values.

また、パラメータ設定手段810は、第1の実施形態の変形例におけるパラメータ設定手段110と同様に、輝度勾配算出用パラメータPbおよび輪郭抽出閾値Pcを計算し、輝度勾配算出用パラメータPbを輝度勾配算出手段102に出力し、輪郭抽出閾値Pcを輪郭抽出手段103に出力する。輝度勾配算出手段102は、その輝度勾配算出用パラメータPbに応じたSobelフィルタの係数を選択し、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出する。また、輪郭抽出手段103は、その輪郭抽出閾値Pcを用いて、補間画像Sa中で輪郭を表している画素を判定する。   Also, the parameter setting unit 810 calculates the luminance gradient calculation parameter Pb and the contour extraction threshold value Pc, and calculates the luminance gradient calculation parameter Pb as the luminance gradient, similarly to the parameter setting unit 110 in the modification of the first embodiment. The contour extraction threshold value Pc is output to the contour extraction means 103. The luminance gradient calculation means 102 selects a Sobel filter coefficient corresponding to the luminance gradient calculation parameter Pb, and calculates the luminance gradient intensity and luminance gradient direction for each pixel of the interpolation image Sa. In addition, the contour extraction unit 103 determines a pixel representing the contour in the interpolation image Sa using the contour extraction threshold value Pc.

図23は、第2の実施形態の他の変形例の処理経過を示すフローチャートである。既に説明した処理と同様の処理については、図19および図21と同一の符号を付す。パラメータ設定手段810は、拡大率Paが入力されると、その拡大率Paを用いて、輝度勾配算出用パラメータPb、輪郭抽出閾値Pcおよびブロック決定用パラメータPeを計算する(ステップS41)。なお、Pb,Pc,Peの一部を予め固定値として定めておき、ステップS41でパラメータ設定手段810は、Pb,Pc,Peのうち固定値として定められていないパラメータについて計算を行ってもよい。   FIG. 23 is a flowchart showing the processing progress of another modification of the second embodiment. The same processes as those already described are denoted by the same reference numerals as those in FIGS. When the enlargement factor Pa is input, the parameter setting unit 810 calculates the brightness gradient calculation parameter Pb, the contour extraction threshold value Pc, and the block determination parameter Pe using the enlargement factor Pa (step S41). Note that a part of Pb, Pc, and Pe may be determined in advance as fixed values, and the parameter setting unit 810 may calculate a parameter that is not determined as a fixed value among Pb, Pc, and Pe in step S41. .

輝度勾配算出手段102は、補間画像Saが入力されると、捕願画像Sa中の個々の画素毎に、画素値から輝度値を特定する。また、「Pbがx1以上x2未満ならば、3行3列のSobelフィルタの係数を選択する。」等のルールを予め保持しておき、そのルールに従って、輝度勾配算出用パラメータPbに応じたSobelフィルタの係数を選択する。輝度勾配算出手段102は、選択したSobelフィルタの係数を用いて、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出する(ステップS49)。Sobelフィルタの係数を選択する点の他は、既に説明したステップS49と同様である。   When the interpolation image Sa is input, the brightness gradient calculating unit 102 specifies a brightness value from the pixel value for each pixel in the application image Sa. In addition, a rule such as “if the Pb is greater than or equal to x1 and less than x2 selects a coefficient of a 3 × 3 Sobel filter” is stored in advance, and the Sobel corresponding to the luminance gradient calculation parameter Pb according to the rule. Select filter coefficients. The luminance gradient calculating means 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel of the interpolation image Sa using the selected Sobel filter coefficient (step S49). Other than the selection of the Sobel filter coefficient, this is the same as step S49 already described.

輪郭抽出手段103は、パラメータ設定手段810が計算した輪郭抽出閾値Pcを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS50)。パラメータ設定手段810が輪郭抽出閾値Pcを定める点の他は、既に説明したステップS50と同様である。   The contour extraction unit 103 determines a pixel representing the contour in the interpolation image Sa using the contour extraction threshold value Pc calculated by the parameter setting unit 810 (step S50). Except for the point that the parameter setting means 810 determines the contour extraction threshold value Pc, it is the same as step S50 already described.

ステップS50後、代表色推定手段802および色補正手段803は、既に説明した台の実施形態の変形例と同様に、ステップS51〜S55の処理を行う。代表色推定手段802は、ステップS51において、輪郭抽出手段103から通知された輪郭を表す画素のみを選択対象とする。また、色補正手段803は、ステップS55において、補間画像Sa中の輪郭を表す各画素について、ステップS51以降の処理を完了しているか否かを判定する。輪郭を表す各画素のうち、ステップS51以降の処理が行われていない画素が残っていればステップS51以降の処理を繰り返す。輪郭を表す各画素についてステップS51以降の処理が完了していれば処理を終了する。   After step S50, the representative color estimation unit 802 and the color correction unit 803 perform the processes of steps S51 to S55, as in the modified example of the base embodiment already described. The representative color estimation unit 802 selects only pixels representing the contour notified from the contour extraction unit 103 in step S51. In step S55, the color correction unit 803 determines whether or not the processing after step S51 has been completed for each pixel representing the contour in the interpolation image Sa. If there is any pixel that has not been subjected to the processing after step S51 among the pixels representing the contour, the processing after step S51 is repeated. If the processing from step S51 onward is completed for each pixel representing the contour, the processing ends.

本変形例においても、輪郭を表していない画素についてはステップS51以降の処理が省略されるので、処理を簡略して処理時間を短縮することができる。また、低解像度画像から補間画像Saへの拡大率が一定ではない場合であっても、拡大率に応じた適切なパラメータで輪郭を明瞭化することができる。   Also in the present modification, the processing after step S51 is omitted for pixels that do not represent an outline, so that the processing can be simplified and the processing time can be shortened. Even when the enlargement ratio from the low resolution image to the interpolated image Sa is not constant, the contour can be clarified with an appropriate parameter corresponding to the enlargement ratio.

次に、第2の実施形態の他の変形例について説明する。図24は、第2の実施形態の他の変形例を示すブロック図である。既に説明した構成要素と同様の構成要素については、図17、図20、図22と同一の符号を付す。図24に示すように、画像処理システムは、輝度勾配算出手段102、輪郭抽出手段103、代表色推定手段802、色補正手段803、パラメータ設定手段810に加えて、補間画像生成手段101を備えていてもよい。補間画像生成手段101は、第1の実施形態の変形例で示した補間画像生成手段101(図13参照)と同様の処理を行う。図24では、コンピュータ800が補間画像生成手段101を含む場合を示している。補間画像生成手段101は、プログラムに従って動作する中央処理装置によって実現されてもよい。すなわち、中央処理装置が、画像処理用プログラムを読み込み、画像処理用プログラムに従って、補間画像生成手段101、輝度勾配算出手段102、輪郭抽出手段103、代表色推定手段802、色補正手段803、パラメータ設定手段810として動作してもよい。   Next, another modification of the second embodiment will be described. FIG. 24 is a block diagram illustrating another modification of the second embodiment. Constituent elements similar to those already described are denoted by the same reference numerals as in FIGS. 17, 20, and 22. As shown in FIG. 24, the image processing system includes an interpolation image generation unit 101 in addition to the luminance gradient calculation unit 102, the contour extraction unit 103, the representative color estimation unit 802, the color correction unit 803, and the parameter setting unit 810. May be. The interpolated image generating unit 101 performs the same processing as the interpolated image generating unit 101 (see FIG. 13) shown in the modification of the first embodiment. FIG. 24 shows a case where the computer 800 includes the interpolated image generating means 101. The interpolated image generating means 101 may be realized by a central processing unit that operates according to a program. That is, the central processing unit reads an image processing program, and in accordance with the image processing program, the interpolated image generation means 101, the luminance gradient calculation means 102, the contour extraction means 103, the representative color estimation means 802, the color correction means 803, the parameter setting It may operate as the means 810.

補間画像生成手段101には低解像度画像Siが入力され、補間画像生成手段101は補間によりその低解像度画像Siを拡大して補間画像Saを生成し、補間画像Saを輝度勾配算出手段102、代表色推定手段802および色補正手段803に出力する。すなわち、補間画像生成手段101は、低解像度画像Siの画素間に画素を内挿して、拡大画像である補間画像Saを生成する。補間画像生成手段101は、例えば、バイリニア補間あるいはバイキュービック補間により、低解像度画像Siを拡大する。   The low-resolution image Si is input to the interpolated image generating means 101, and the interpolated image generating means 101 enlarges the low-resolution image Si by interpolation to generate an interpolated image Sa, and the interpolated image Sa is used as the luminance gradient calculating means 102 and the representative. The data is output to the color estimation unit 802 and the color correction unit 803. That is, the interpolated image generating means 101 generates an interpolated image Sa that is an enlarged image by interpolating pixels between the pixels of the low resolution image Si. The interpolation image generation unit 101 enlarges the low resolution image Si by, for example, bilinear interpolation or bicubic interpolation.

また、パラメータ設定手段810には、生成すべき拡大画像の解像度が入力される。例えば、拡大後の補間画像Saの横幅(水平方向の画素数)が入力されてもよい。また、パラメータ設定手段810には、拡大前の低解像度画像Siの情報(例えば、低解像度画像Siの横幅)も入力される。パラメータ設定手段810は、入力された情報を用いて、拡大率Paを計算し、補間画像生成手段101に出力する。パラメータ設定手段810は、拡大率Paを計算した後、既に説明したように拡大率PaからPb,Pc,Pdの各パラメータを計算してもよい。この動作は、第1の実施形態の変形例で示したパラメータ設定手段110(図13参照)と同様の動作である。   In addition, the resolution of the enlarged image to be generated is input to the parameter setting unit 810. For example, the width of the enlarged interpolation image Sa (the number of pixels in the horizontal direction) may be input. In addition, information about the low-resolution image Si before enlargement (for example, the horizontal width of the low-resolution image Si) is also input to the parameter setting unit 810. The parameter setting unit 810 calculates the enlargement factor Pa using the input information and outputs it to the interpolated image generation unit 101. The parameter setting means 810 may calculate each parameter of Pb, Pc, and Pd from the enlargement factor Pa as described above after calculating the enlargement factor Pa. This operation is the same as that of the parameter setting unit 110 (see FIG. 13) shown in the modification of the first embodiment.

補間画像生成手段101は、パラメータ設定手段810が計算した拡大率Paで低解像度画像Siを補間して補間画像Saを生成する。   The interpolated image generation unit 101 generates an interpolated image Sa by interpolating the low resolution image Si with the enlargement factor Pa calculated by the parameter setting unit 810.

図25は、本変形例の処理経過を示すフローチャートである。既に説明した処理と同様の処理については、図19および図21と同一の符号を付す。パラメータ設定手段810には、例えば、低解像度画像Siの横幅Wlおよびユーザの所望の補間画像Saの横幅Whが入力される。パラメータ設定手段810は、WlおよびWhが入力されると、Wh/Wlを計算することにより、拡大率Paを計算する。ただし、ここで示した拡大率Paの計算方法は一例であり、他の方法で拡大率Paを計算してもよい。パラメータ設定手段810は、計算した拡大率Paを補間画像生成手段101に出力する。また、パラメータ設定手段810は、その拡大率Paを用いて、輝度勾配算出用パラメータPb、輪郭抽出閾値Pcおよびブロック決定用パラメータPeを計算する(ステップS47)。パラメータ設定手段810は、Pbを輝度勾配算出手段102に出力し、Pcを輪郭抽出手段103に出力し、ブロック決定用パラメータPeを代表色推定手段802および色補正手段803に出力する。拡大率Paから、Pb,Pc,Pdを算出する動作は、既に説明した動作と同様である。   FIG. 25 is a flowchart showing the processing progress of this modification. The same processes as those already described are denoted by the same reference numerals as those in FIGS. For example, the horizontal width Wl of the low resolution image Si and the horizontal width Wh of the desired interpolation image Sa of the user are input to the parameter setting means 810. When Wl and Wh are input, the parameter setting unit 810 calculates the enlargement factor Pa by calculating Wh / Wl. However, the calculation method of the enlargement factor Pa shown here is an example, and the enlargement factor Pa may be calculated by other methods. The parameter setting unit 810 outputs the calculated enlargement factor Pa to the interpolation image generation unit 101. Also, the parameter setting means 810 calculates the brightness gradient calculation parameter Pb, the contour extraction threshold value Pc, and the block determination parameter Pe using the enlargement factor Pa (step S47). The parameter setting unit 810 outputs Pb to the luminance gradient calculation unit 102, outputs Pc to the contour extraction unit 103, and outputs the block determination parameter Pe to the representative color estimation unit 802 and the color correction unit 803. The operation for calculating Pb, Pc, Pd from the enlargement factor Pa is the same as the operation already described.

補間画像生成手段101には、低解像度画像Siが入力される。ステップS47の後、補間画像生成手段101は、拡大率Paで低解像度画像Siを補間して、ユーザの所望の解像度の補間画像Saを生成する(ステップS48)。この処理は、第1の実施形態の変形例で説明したステップS10(図14参照)と同様である。   The low resolution image Si is input to the interpolated image generating means 101. After step S47, the interpolated image generating means 101 interpolates the low resolution image Si with the enlargement factor Pa to generate an interpolated image Sa having the user's desired resolution (step S48). This process is the same as step S10 (see FIG. 14) described in the modification of the first embodiment.

補間画像生成手段101は、低解像度画像Siに対して画素を補間して生成した補間画像Saを輝度勾配算出手段102、代表色推定手段802および色補正手段803に出力する。輝度勾配算出手段102は、パラメータ設定手段810が計算した輝度勾配算出用パラメータPbに応じたSobelフィルタの係数を選択する。輝度勾配算出手段102は、Sobelフィルタの係数を用いて、補間画像Saの各画素毎に輝度勾配強度および輝度勾配方向を算出し、各画素の輝度勾配強度および輝度勾配方向を輪郭抽出手段103に出力する(ステップS49)。輪郭抽出手段103は、パラメータ設定手段810が計算した輪郭抽出閾値Pcを用いて、補間画像Sa中で輪郭を表している画素を判定する(ステップS50)。   The interpolated image generating unit 101 outputs an interpolated image Sa generated by interpolating pixels from the low resolution image Si to the luminance gradient calculating unit 102, the representative color estimating unit 802, and the color correcting unit 803. The luminance gradient calculation unit 102 selects a Sobel filter coefficient corresponding to the luminance gradient calculation parameter Pb calculated by the parameter setting unit 810. The luminance gradient calculation means 102 calculates the luminance gradient intensity and the luminance gradient direction for each pixel of the interpolation image Sa using the Sobel filter coefficient, and sends the luminance gradient intensity and the luminance gradient direction of each pixel to the contour extraction means 103. Output (step S49). The contour extraction unit 103 determines a pixel representing the contour in the interpolation image Sa using the contour extraction threshold value Pc calculated by the parameter setting unit 810 (step S50).

ステップS50後、代表色推定手段802および色補正手段803は、既に説明した台の実施形態の変形例と同様に、ステップS51〜S55の処理を行う。代表色推定手段802は、ステップS51において、輪郭抽出手段103から通知された輪郭を表す画素のみを選択対象とする。また、色補正手段803は、ステップS55において、補間画像Sa中の輪郭を表す各画素について、ステップS51以降の処理を完了しているか否かを判定する。輪郭を表す各画素のうち、ステップS51以降の処理が行われていない画素が残っていればステップS51以降の処理を繰り返す。輪郭を表す各画素についてステップS51以降の処理が完了していれば処理を終了する。   After step S50, the representative color estimation unit 802 and the color correction unit 803 perform the processes of steps S51 to S55, as in the modified example of the base embodiment already described. The representative color estimation unit 802 selects only pixels representing the contour notified from the contour extraction unit 103 in step S51. In step S55, the color correction unit 803 determines whether or not the processing after step S51 has been completed for each pixel representing the contour in the interpolation image Sa. If there is any pixel that has not been subjected to the processing after step S51 among the pixels representing the contour, the processing after step S51 is repeated. If the processing from step S51 onward is completed for each pixel representing the contour, the processing ends.

本変形例によれば、補間画像生成手段101が低解像度画像Siに補間を行い補間画像Saを生成するので、低解像度画像Siを入力すれば、高品質の拡大画像を得ることができる。   According to this modification, the interpolation image generation means 101 interpolates the low resolution image Si to generate the interpolation image Sa. Therefore, if the low resolution image Si is input, a high quality enlarged image can be obtained.

また、パラメータ設定手段810を備える構成(例えば、図22、図24に示す構成)において、画像処理システムは、輝度勾配算出手段102および輪郭抽出手段103を備えていなくともよい。この場合、パラメータ設定手段810は、Pb,Pcを計算しなくてもよい。   In the configuration including the parameter setting unit 810 (for example, the configuration illustrated in FIGS. 22 and 24), the image processing system may not include the luminance gradient calculation unit 102 and the contour extraction unit 103. In this case, the parameter setting unit 810 does not have to calculate Pb and Pc.

実施形態3.
図26は、本発明の第3の実施形態を示すブロック図である。本発明の第3の実施形態は、画像を圧縮して送信する画像圧縮装置600と、その画像を受信して伸長する画像伸長装置610とを含む画像伝送システムである。画像圧縮装置600と画像伸長装置610は、伝送路620を介して画像を送受信する。
Embodiment 3. FIG.
FIG. 26 is a block diagram showing a third embodiment of the present invention. The third embodiment of the present invention is an image transmission system including an image compression apparatus 600 that compresses and transmits an image, and an image expansion apparatus 610 that receives and expands the image. The image compression device 600 and the image decompression device 610 transmit and receive images via the transmission path 620.

画像圧縮装置600には、高解像度の入力画像640が入力される。画像圧縮装置600は、入力画像640をダウンサンプリングした低解像度画像605と、そのダウンサンプリング後の画像と入力画像との残差606とを併せて圧縮データ607として、伝送路620に送出する。また、画像伸長装置610は、受信した圧縮データ607に含まれる低解像度画像605を拡大し、圧縮データ607に含まれる残差606と加算して、伸長画像615を生成する。以下、画像圧縮装置600および画像伸長装置610の構成を説明する。   A high-resolution input image 640 is input to the image compression device 600. The image compression apparatus 600 sends the low-resolution image 605 obtained by down-sampling the input image 640 and the residual 606 between the down-sampled image and the input image as compressed data 607 to the transmission path 620. Also, the image decompression device 610 enlarges the low resolution image 605 included in the received compressed data 607 and adds it to the residual 606 included in the compressed data 607 to generate a decompressed image 615. Hereinafter, configurations of the image compression device 600 and the image expansion device 610 will be described.

画像圧縮装置600は、ローパス・ダウンサンプリング手段601と、拡大画像生成手段602と、画像減算手段603とを備える。   The image compression apparatus 600 includes a low-pass downsampling unit 601, an enlarged image generation unit 602, and an image subtraction unit 603.

ローパス・ダウンサンプリング手段601には、入力画像(高解像度画像)604が入力される。なお、入力画像604は、画像減算手段603にも入力される。ローパス・ダウンサンプリング手段601は、入力画像604に対してローパスフィルタを適用し、入力画像604を所定の解像度にダウンサンプリングする。ダウンサンプリングとは、水平方向および垂直方向に並ぶ画素を周期的に取り除き、画像を低解像度化することをいう。ローパス・ダウンサンプリング手段601は、生成した低解像度画像605を伝送路620に送信し、また、拡大画像生成手段603に出力する。   An input image (high resolution image) 604 is input to the low-pass / down-sampling means 601. Note that the input image 604 is also input to the image subtracting means 603. The low-pass / down-sampling means 601 applies a low-pass filter to the input image 604 to down-sample the input image 604 to a predetermined resolution. Downsampling refers to periodically removing pixels arranged in the horizontal direction and the vertical direction to reduce the resolution of an image. The low-pass / down-sampling unit 601 transmits the generated low-resolution image 605 to the transmission path 620 and outputs it to the enlarged image generation unit 603.

拡大画像生成手段602は、ローパス・ダウンサンプリング手段601が生成した低解像度画像605を入力として、その低解像度画像605を入力画像604と同じ解像度の画像に拡大する。また、拡大画像生成手段602は、その拡大画像中の輪郭を明瞭化する画像処理を行い、その結果得られる画像を画像減算手段603に出力する。この処理は、第1の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム、または第2の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システムが実行する処理と同様の処理である。   The enlarged image generating unit 602 receives the low resolution image 605 generated by the low pass / down sampling unit 601 and enlarges the low resolution image 605 to an image having the same resolution as the input image 604. The enlarged image generating unit 602 performs image processing for clarifying the outline in the enlarged image, and outputs the resulting image to the image subtracting unit 603. This processing is executed by the image processing system including the interpolated image generation unit 101 described as a modification of the first embodiment, or the image processing system including the interpolated image generation unit 101 described as a modification of the second embodiment. This is the same processing as that to be performed.

拡大画像生成手段602は、例えば、第1の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム(図13参照)によって実現される。また、パラメータ設定手段110が拡大率Pa、輝度勾配算出用パラメータPb、輪郭抽出閾値Pc、輪郭補正用パラメータPdを設定してもよい。パラメータ設定手段110が拡大率Paを計算するための情報(Wh,Wl)は、例えば、予め定めておけばよい。   The enlarged image generating unit 602 is realized by, for example, an image processing system (see FIG. 13) including the interpolated image generating unit 101 described as a modification of the first embodiment. The parameter setting unit 110 may set the enlargement factor Pa, the luminance gradient calculation parameter Pb, the contour extraction threshold value Pc, and the contour correction parameter Pd. Information (Wh, Wl) for the parameter setting means 110 to calculate the enlargement ratio Pa may be determined in advance, for example.

拡大画像生成手段602は、第2の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム(図24参照)によって実現されてもよい。また、パラメータ設定手段110が拡大率Pa、輝度勾配算出用パラメータPb、輪郭抽出閾値Pc、ブロック決定用パラメータPeを設定してもよい。パラメータ設定手段810が拡大率Paを計算するための情報(Wh,Wl)は、例えば、予め定めておけばよい。   The enlarged image generating unit 602 may be realized by an image processing system (see FIG. 24) including the interpolated image generating unit 101 described as a modification of the second embodiment. Further, the parameter setting means 110 may set the enlargement factor Pa, the luminance gradient calculation parameter Pb, the contour extraction threshold value Pc, and the block determination parameter Pe. Information (Wh, Wl) for the parameter setting means 810 to calculate the enlargement factor Pa may be determined in advance, for example.

また、図13や図24に示すパラメータ設定手段110,810を備えずに、拡大率Pa、輝度勾配算出用パラメータPb、輪郭抽出閾値Pc、輪郭補正用パラメータPd、ブロック決定用パラメータPeが予め定められていてもよい。また、輝度勾配算出用パラメータPbの代わりに、Sobelフィルタの係数が予め定められていてもよい。   Further, without including the parameter setting means 110 and 810 shown in FIGS. 13 and 24, the enlargement ratio Pa, the luminance gradient calculation parameter Pb, the contour extraction threshold value Pc, the contour correction parameter Pd, and the block determination parameter Pe are determined in advance. It may be done. Further, instead of the luminance gradient calculation parameter Pb, a Sobel filter coefficient may be determined in advance.

画像減算手段603は、入力画像604と、拡大画像生成手段602が出力した高解像度画像(入力画像604と同じ解像度の画像)との残差606を計算する。入力画像604における座標(x,y)の画素の画素値をI1(x,y)とする。また、拡大画像生成手段602が生成した高解像度画像における座標(x,y)の画素の画素値をI2(x,y)とする。画像減算手段603は、入力画像604と拡大画像生成手段602が出力した高解像度画像の対応する各画素毎に(すなわち同じ座標の画素毎に)、I2(x,y)−I1(x,y)を計算する。この計算結果が残差606である。残差は、高解像度画像および入力画像604の対応する画素同士の画素値の差を表すデータである。   The image subtracting unit 603 calculates a residual 606 between the input image 604 and the high-resolution image output by the enlarged image generating unit 602 (an image having the same resolution as the input image 604). A pixel value of a pixel at coordinates (x, y) in the input image 604 is assumed to be I1 (x, y). Further, the pixel value of the pixel at the coordinate (x, y) in the high-resolution image generated by the enlarged image generation unit 602 is assumed to be I2 (x, y). The image subtracting unit 603 obtains I2 (x, y) −I1 (x, y) for each corresponding pixel of the high resolution image output from the input image 604 and the enlarged image generating unit 602 (that is, for each pixel having the same coordinate). ). This calculation result is a residual 606. The residual is data representing a difference in pixel value between corresponding pixels of the high resolution image and the input image 604.

また、画像減算手段603は、ローパス・ダウンサンプリング手段601が低解像度画像605を送信するときに、併せてその残差606を送信する。低解像度画像605と残差606をあわせたデータが圧縮データ607である。   Further, the image subtracting means 603 also transmits the residual 606 when the low-pass / down-sampling means 601 transmits the low-resolution image 605. Data obtained by combining the low-resolution image 605 and the residual 606 is compressed data 607.

画像圧縮装置600は上記のような構成であり、ローパス・ダウンサンプリング手段601および画像減算手段603に入力画像604が入力されると、ローパス・ダウンサンプリング手段601はその入力画像604をダウンサンプリングして低解像度画像605を生成する。そして、拡大画像生成手段602は、その低解像度画像605を拡大し、画像減算手段603は、その結果得られた拡大画像と入寮画像との残差606を計算する。そして、ローパス・ダウンサンプリング手段601は、低解像度画像605を画像伸張装置610に送信し、画像減算手段603は、その低解像度画像605と併せて残差606を画像伸張装置610に送信する。   The image compression apparatus 600 is configured as described above. When the input image 604 is input to the low-pass down-sampling unit 601 and the image subtracting unit 603, the low-pass down-sampling unit 601 down-samples the input image 604. A low resolution image 605 is generated. Then, the enlarged image generating unit 602 enlarges the low resolution image 605, and the image subtracting unit 603 calculates a residual 606 between the enlarged image and the dormitory image obtained as a result. The low-pass down-sampling unit 601 transmits the low-resolution image 605 to the image expansion device 610, and the image subtraction unit 603 transmits the residual 606 together with the low-resolution image 605 to the image expansion device 610.

画像伸張装置610は、拡大画像生成手段611と、画像加算手段612とを備える。   The image expansion device 610 includes an enlarged image generation unit 611 and an image addition unit 612.

画像伸長装置610は、受信した圧縮データ607から低解像度画像605と残差614とを取り出す。   The image expansion device 610 extracts the low resolution image 605 and the residual 614 from the received compressed data 607.

拡大画像生成手段611には、受信した圧縮データ607中の低解像度画像605が入力される。拡大画像生成手段611は、低解像度画像605を入力として、その低解像度画像605を入力画像604と同じ解像度の画像に拡大する。また、拡大画像生成手段602は、その拡大画像中の輪郭を明瞭化する画像処理を行い、その結果得られる画像を画像加算手段612に出力する。この処理は、第1の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム、または第2の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システムが実行する処理と同様の処理である。   The enlarged image generating unit 611 receives the low resolution image 605 in the received compressed data 607. The enlarged image generating means 611 receives the low resolution image 605 as an input, and enlarges the low resolution image 605 to an image having the same resolution as the input image 604. Further, the enlarged image generating unit 602 performs image processing for clarifying the outline in the enlarged image, and outputs an image obtained as a result to the image adding unit 612. This processing is executed by the image processing system including the interpolated image generation unit 101 described as a modification of the first embodiment, or the image processing system including the interpolated image generation unit 101 described as a modification of the second embodiment. This is the same processing as that to be performed.

画像伸張装置610が備える拡大画像生成手段611は、画像圧縮装置600が備える拡大画像生成手段602と同様であり、例えば、第1の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム(図13参照)によって実現される。また、例えば、第2の実施形態の変形例として説明した補間画像生成手段101を備える画像処理システム(図24参照)によって実現されてもよい。   An enlarged image generation unit 611 included in the image expansion device 610 is the same as the enlarged image generation unit 602 included in the image compression device 600. For example, an image including the interpolated image generation unit 101 described as a modification of the first embodiment. This is realized by a processing system (see FIG. 13). Further, for example, it may be realized by an image processing system (see FIG. 24) including the interpolated image generation unit 101 described as a modification of the second embodiment.

画像加算手段612には、受信した圧縮データ607中の残差606が入力される。画像加算手段612は、拡大画像生成手段611が出力した拡大画像と、残差606とを加算する。拡大画像における座標(x,y)の画素の画素値をI3(x,y)とする。また、残差606における座標(x,y)の画素の画素値をI4(x,y)とする。画像加算手段612は、拡大画像生成手段611が生成した拡大画像と残差606の対応する画素毎に(すなわち同じ座標の画素毎に)、I3(x,y)+I4(x,y)を計算することで、目的とする高解像度の伸張画像615を生成する。   The residual 606 in the received compressed data 607 is input to the image adding means 612. The image adding unit 612 adds the enlarged image output from the enlarged image generating unit 611 and the residual 606. The pixel value of the pixel at coordinates (x, y) in the enlarged image is I3 (x, y). Further, the pixel value of the pixel at the coordinate (x, y) in the residual 606 is assumed to be I4 (x, y). The image adding unit 612 calculates I3 (x, y) + I4 (x, y) for each pixel corresponding to the enlarged image generated by the enlarged image generating unit 611 and the residual 606 (that is, for each pixel having the same coordinates). As a result, a target high-resolution decompressed image 615 is generated.

画像伸張装置610は上記のような構成であり、拡大画像生成手段611に低解像度画像605が入力されると、拡大画像生成手段611はその低解像度画像605を拡大する。画像加算手段612は、その結果得られた拡大画像と残差606とを加算し、伸長画像615を生成する。   The image expansion device 610 is configured as described above. When the low resolution image 605 is input to the enlarged image generation unit 611, the enlarged image generation unit 611 enlarges the low resolution image 605. The image adding unit 612 adds the enlarged image obtained as a result and the residual 606 to generate an expanded image 615.

なお、画像圧縮装置600は、伝送路620を介して低解像度画像605および残差606を画像伸張装置610に送信する際、その低解像度画像605および残差606(圧縮データ605)を既存のデータ圧縮方法を用いてさらに圧縮してもよい。この場合、 画像伸張装置610は、その既存のデータ圧縮方法に対応するデータ伸長方法でデータを伸長してから、上記の処理を実行すればよい。   Note that when the image compression apparatus 600 transmits the low resolution image 605 and the residual 606 to the image expansion apparatus 610 via the transmission path 620, the low resolution image 605 and the residual 606 (compressed data 605) are converted into existing data. Further compression may be performed using a compression method. In this case, the image decompression device 610 may perform the above-described processing after decompressing data by a data decompression method corresponding to the existing data compression method.

第3の実施形態によれば、画像伸張装置610は、第1の実施形態または第2の実施形態で説明した画像拡大処理を行うことで、受信した低解像度画像605から高品質な拡大画像を生成することができる。従って、画像圧縮装置601は、伝送路620を介して送信する残差のデータ量を削減することができる。   According to the third embodiment, the image expansion device 610 performs an image enlargement process described in the first embodiment or the second embodiment, thereby obtaining a high-quality enlarged image from the received low-resolution image 605. Can be generated. Therefore, the image compression apparatus 601 can reduce the amount of residual data transmitted via the transmission path 620.

以上、説明した実施形態には、代表色推定手段が、EMアルゴリズムにより、ブロック内の各画素の色が第1のクラスに属する確率と第2のクラスに属する確率と、第1のクラスおよび第2のクラスの代表色とを導出する構成が記載されている。   In the embodiment described above, the representative color estimation means uses the EM algorithm to determine the probability that the color of each pixel in the block belongs to the first class, the probability that the pixel belongs to the second class, the first class, and the first class. A configuration for deriving two classes of representative colors is described.

また、代表色推定手段が、補間画像中の各画素を選択し、選択した画素を中心とする画素のブロックを抽出する構成が記載されている。   In addition, a configuration is described in which the representative color estimation unit selects each pixel in the interpolated image and extracts a block of pixels centered on the selected pixel.

また、補間画像の各画素における輝度勾配の強度と輝度勾配の方向を計算する輝度勾配算出手段と、輝度勾配の強度と輝度勾配の方向とを用いて、補間画像内で輪郭を表す画素を判定する輪郭抽出手段とを備え、代表色推定手段が、補間画像中の輪郭を表す各画素を選択し、選択した画素を中心とする画素のブロックを抽出する構成が記載されている。   In addition, the luminance gradient calculating means for calculating the luminance gradient intensity and the luminance gradient direction in each pixel of the interpolation image, and the luminance gradient intensity and the luminance gradient direction are used to determine the pixel representing the contour in the interpolation image. A configuration in which the representative color estimation unit selects each pixel representing the contour in the interpolation image and extracts a block of pixels centered on the selected pixel.

また、輝度勾配算出手段が、輝度勾配の強度および輝度勾配の方向の計算対象画素を中心としてエッジ検出オペレータの係数と同じ配置となる複数の画素を特定し、特定した各画素それぞれについて、対応するエッジ検出オペレータの係数との積を計算し、その和を求めることにより、水平方向および垂直方向の輝度勾配を計算し、大きさが水平方向の輝度勾配であるベクトルと、大きさが垂直方向の輝度勾配であるベクトルとの合成ベクトルの大きさを計算対象画素の輝度勾配の強度とし、垂直方向の輝度勾配を水平方向の輝度勾配で除算した結果のアークタンジェントを輝度勾配の方向とし、輪郭抽出手段が、輪郭を表す画素であるか否かの判定対象画素を選択し、判定対象画素の輝度勾配の強度が輪郭抽出閾値より大きく、判定対象画素の輝度勾配の方向の隣接画素およびその方向を180°回転させた方向の隣接画素それぞれの輝度勾配の強度よりも大きいときに、判定対象画素は輪郭を表す画素であると判定する構成が記載されている。   In addition, the luminance gradient calculating unit specifies a plurality of pixels having the same arrangement as the coefficient of the edge detection operator around the calculation target pixel in the intensity of the luminance gradient and the direction of the luminance gradient, and corresponds to each of the specified pixels. By calculating the product of the coefficients of the edge detection operator and calculating the sum thereof, the luminance gradient in the horizontal direction and the vertical direction is calculated, and the vector whose magnitude is the luminance gradient in the horizontal direction and the magnitude in the vertical direction are calculated. Contour extraction with the magnitude of the combined vector with the brightness gradient vector as the intensity of the intensity gradient of the pixel to be calculated, and the arc tangent obtained by dividing the vertical intensity gradient by the horizontal intensity gradient as the intensity gradient direction The means selects a determination target pixel whether or not it is a pixel representing an outline, and the intensity of the luminance gradient of the determination target pixel is larger than the contour extraction threshold, and the determination target image A configuration is described in which a determination target pixel is a pixel representing an outline when the adjacent pixel in the direction of the luminance gradient is larger than the intensity of the luminance gradient of each adjacent pixel in the direction rotated by 180 °. ing.

また、拡大前の画像から補間画像への拡大率から、抽出するブロックの大きさを定めるためのブロック決定用パラメータを定めるパラメータ設定手段を備え、代表色推定手段が、選択した画素を中心とする画素のブロックとして、パラメータ設定手段が定めたブロック決定用パラメータに応じた大きさのブロックを抽出する構成が記載されている。   Further, the image processing apparatus includes parameter setting means for determining a block determination parameter for determining the size of a block to be extracted based on an enlargement ratio from an image before enlargement to an interpolated image, and the representative color estimation means is centered on the selected pixel. As a pixel block, a configuration is described in which a block having a size corresponding to a block determination parameter determined by a parameter setting unit is extracted.

また、パラメータ設定手段が、パラメータ設定手段に入力される拡大率からブロック決定用パラメータを定める構成が記載されている。   In addition, a configuration is described in which the parameter setting means determines the block determination parameter from the enlargement ratio input to the parameter setting means.

また、パラメータ設定手段が、予め定められた拡大率からブロック決定用パラメータを定める構成が記載されている。   In addition, a configuration is described in which the parameter setting means determines block determination parameters from a predetermined enlargement ratio.

また、拡大前の画像から補間画像への拡大率から、エッジ検出オペレータの係数を選択するための輝度勾配算出用パラメータと、輪郭抽出閾値と、抽出するブロックの大きさを定めるためのブロック決定用パラメータを定めるパラメータ設定手段を備え、輝度勾配算出手段が、予め複数種類のエッジ検出オペレータの係数を保持し、輝度勾配算出用パラメータに応じたエッジ検出オペレータの係数を用いて輝度勾配の強度および輝度勾配の方向を計算し、輪郭抽出手段が、パラメータ設定手段が定めた輪郭抽出閾値を用いて、輪郭を表す画素を特定し、代表色推定手段が、選択した画素を中心とする画素のブロックとして、パラメータ設定手段が定めたブロック決定用パラメータに応じた大きさのブロックを抽出する構成が記載されている。   Also, for determining the brightness gradient calculation parameter for selecting the coefficient of the edge detection operator from the enlargement ratio from the image before enlargement to the interpolated image, the contour extraction threshold, and the block determination for determining the size of the block to be extracted Parameter setting means for determining parameters is provided, and the luminance gradient calculating means holds the coefficients of a plurality of types of edge detection operators in advance, and uses the edge detection operator coefficients corresponding to the luminance gradient calculation parameters to determine the intensity and luminance of the luminance gradient. The direction of the gradient is calculated, the contour extracting unit specifies the pixel representing the contour using the contour extraction threshold determined by the parameter setting unit, and the representative color estimating unit determines the pixel block centered on the selected pixel. A configuration is described in which a block having a size corresponding to a block determining parameter determined by the parameter setting means is extracted.

また、パラメータ設定手段が、パラメータ設定手段に入力される拡大率から、輝度勾配算出用パラメータと、輪郭抽出閾値と、ブロック決定用パラメータとを定める構成が記載されている。   In addition, a configuration is described in which the parameter setting unit determines a luminance gradient calculation parameter, a contour extraction threshold value, and a block determination parameter from an enlargement ratio input to the parameter setting unit.

また、パラメータ設定手段が、予め定められた拡大率から、輝度勾配算出用パラメータと、輪郭抽出閾値と、ブロック決定用パラメータとを定める構成が記載されている。   In addition, a configuration is described in which the parameter setting means determines a luminance gradient calculation parameter, a contour extraction threshold value, and a block determination parameter from a predetermined magnification.

また、拡大対象画像が入力され、拡大対象画像の画素間に画素を内挿することにより、拡大対象画像を拡大した補間画像を生成する補間画像生成手段を備える構成が記載されている。   Further, there is described a configuration including an interpolation image generation unit that receives an enlargement target image and generates an interpolation image obtained by enlarging the enlargement target image by interpolating pixels between pixels of the enlargement target image.

本発明は、低解像度の静止画や動画から拡大された画像中の輪郭を明瞭にする画像処理を行う画像処理システムに好適に適用され、また、高解像度の静止画、動画を圧縮して伝送したり保存したりするシステムにも適用可能である。   The present invention is suitably applied to an image processing system that performs image processing for clarifying a contour in an image enlarged from a low-resolution still image or moving image, and also compresses and transmits a high-resolution still image or moving image. It can also be applied to systems that store and store data.

本発明の第1の実施形態の画像処理システムの例を示すブロック図である。1 is a block diagram illustrating an example of an image processing system according to a first embodiment of the present invention. 輝度勾配強度および輝度勾配方向を示す説明図である。It is explanatory drawing which shows a luminance gradient intensity | strength and a luminance gradient direction. 第1の実施形態の処理経過の例を示すフローチャートである。It is a flowchart which shows the example of the process progress of 1st Embodiment. Sobelフィルタの係数の例を示す説明図である。It is explanatory drawing which shows the example of the coefficient of a Sobel filter. 輝度勾配の計算対象画素を中心とするn行n列(3行3列)の各画素の輝度値を示すイメージ図である。It is an image figure which shows the luminance value of each pixel of n row n column (3 rows 3 columns) centering on the pixel for calculation of a luminance gradient. 輪郭を表す画素の判定処理の例を示す説明図である。It is explanatory drawing which shows the example of the determination process of the pixel showing an outline. 輪郭周辺の画素の補正処理の例を示す説明図である。It is explanatory drawing which shows the example of the correction process of the pixel around an outline. 輪郭補正手段による補正処理結果の例を示す画像である。It is an image which shows the example of the correction process result by an outline correction means. 第1の実施形態の変形例を示すブロック図である。It is a block diagram which shows the modification of 1st Embodiment. 画素毎の輝度勾配の起伏を示すイメージ図である。It is an image figure which shows the undulation of the brightness | luminance gradient for every pixel. 画像の拡大前後における輪郭付近での画素値の変化を示すイメージ図である。It is an image figure which shows the change of the pixel value in the vicinity of the outline before and behind the expansion of an image. 第1の実施形態の変形例の処理経過を示すフローチャートである。It is a flowchart which shows the process progress of the modification of 1st Embodiment. 第1の実施形態の他の変形例を示すブロック図である。It is a block diagram which shows the other modification of 1st Embodiment. 第1の実施形態の他の変形例の処理経過を示すフローチャートである。It is a flowchart which shows process progress of the other modification of 1st Embodiment. バイリニア補間の例を示すイメージ図である。It is an image figure which shows the example of bilinear interpolation. バイキュービック補間の例を示すイメージ図である。It is an image figure which shows the example of bicubic interpolation. 本発明の第2の実施形態の画像処理システムの例を示すブロック図である。It is a block diagram which shows the example of the image processing system of the 2nd Embodiment of this invention. クラスタリングおよび代表色を説明するイメージ図である。It is an image figure explaining clustering and a representative color. 第2の実施形態の処理経過の例を示すフローチャートである。It is a flowchart which shows the example of the process progress of 2nd Embodiment. 第2の実施形態の変形例を示すブロック図である。It is a block diagram which shows the modification of 2nd Embodiment. 第2の実施形態の変形例の処理経過を示すフローチャートである。It is a flowchart which shows the process progress of the modification of 2nd Embodiment. 第2の実施形態の他の変形例を示すブロック図である。It is a block diagram which shows the other modification of 2nd Embodiment. 第2の実施形態の他の変形例の処理経過を示すフローチャートである。It is a flowchart which shows process progress of the other modification of 2nd Embodiment. 第2の実施形態の他の変形例を示すブロック図である。It is a block diagram which shows the other modification of 2nd Embodiment. 第2の実施形態の他の変形例の処理経過を示すフローチャートである。It is a flowchart which shows process progress of the other modification of 2nd Embodiment. 本発明の第3の実施形態を示すブロック図である。It is a block diagram which shows the 3rd Embodiment of this invention. 低解像度画像のアップサンプリング結果の例を示す画像である。It is an image which shows the example of the upsampling result of a low-resolution image. バイキュービック補間の結果の例を示す画像である。It is an image which shows the example of the result of bicubic interpolation. 特許文献1に記載された画像処理装置を示すブロック図である。1 is a block diagram illustrating an image processing apparatus described in Patent Literature 1. FIG. バイキュービック補間による拡大画像に輪郭強調を適用した結果の例を示す画像である。It is an image which shows the example of the result of applying outline emphasis to the expansion picture by bicubic interpolation.

符号の説明Explanation of symbols

101 補間画像生成手段
102 輝度勾配算出手段
103 輪郭抽出手段
104 輪郭補正手段
110 パラメータ設定手段
802 代表色推定手段
803 色補正手段
810 パラメータ設定手段
DESCRIPTION OF SYMBOLS 101 Interpolation image generation means 102 Luminance gradient calculation means 103 Contour extraction means 104 Contour correction means 110 Parameter setting means 802 Representative color estimation means 803 Color correction means 810 Parameter setting means

Claims (21)

拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを備える
ことを特徴とする画像処理システム。
Select a pixel in an interpolated image that is an enlarged image including pixels interpolated between pixels of the image before enlargement, extract a block of pixels centered on the selected pixel, and extract the pixels in the block Clustering colors into a first class and a second class, the probability that the color of each pixel in the block belongs to the first class, the probability that the pixel belongs to the second class, the first class and the Representative color estimation means for deriving a second class of representative colors;
Probability that the color of the pixel belongs to the first class for each individual pixel in the block extracted by the representative color estimation means when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition is higher than the probability of belonging to the second class, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. A color correcting unit that substitutes the average color of the replaced color derived for each block for each block when one pixel belongs to a plurality of blocks. An image processing system comprising:
代表色推定手段は、EMアルゴリズムにより、ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する
請求項1に記載の画像処理システム。
The representative color estimation means uses the EM algorithm to determine the probability that the color of each pixel in the block belongs to the first class, the probability that the color belongs to the second class, the representative of the first class and the second class. The image processing system according to claim 1, wherein a color is derived.
代表色推定手段は、補間画像中の各画素を選択し、選択した画素を中心とする画素のブロックを抽出する
請求項1または請求項2に記載の画像処理システム。
The image processing system according to claim 1, wherein the representative color estimation unit selects each pixel in the interpolated image and extracts a block of pixels centered on the selected pixel.
補間画像の各画素における輝度勾配の強度と輝度勾配の方向を計算する輝度勾配算出手段と、
前記輝度勾配の強度と前記輝度勾配の方向とを用いて、前記補間画像内で輪郭を表す画素を判定する輪郭抽出手段とを備え、
代表色推定手段は、前記補間画像中の輪郭を表す各画素を選択し、選択した画素を中心とする画素のブロックを抽出する
請求項1または請求項2に記載の画像処理システム。
A luminance gradient calculating means for calculating the intensity of the luminance gradient and the direction of the luminance gradient in each pixel of the interpolation image;
Contour extraction means for determining pixels representing the contour in the interpolated image using the intensity of the luminance gradient and the direction of the luminance gradient;
The image processing system according to claim 1, wherein the representative color estimation unit selects each pixel representing an outline in the interpolated image, and extracts a block of pixels centered on the selected pixel.
輝度勾配算出手段は、輝度勾配の強度および輝度勾配の方向の計算対象画素を中心としてエッジ検出オペレータの係数と同じ配置となる複数の画素を特定し、特定した各画素それぞれについて、対応するエッジ検出オペレータの係数との積を計算し、その和を求めることにより、水平方向および垂直方向の輝度勾配を計算し、大きさが前記水平方向の輝度勾配であるベクトルと、大きさが垂直方向の輝度勾配であるベクトルとの合成ベクトルの大きさを前記計算対象画素の輝度勾配の強度とし、前記垂直方向の輝度勾配を前記水平方向の輝度勾配で除算した結果のアークタンジェントを輝度勾配の方向とし、
輪郭抽出手段は、輪郭を表す画素であるか否かの判定対象画素を選択し、前記判定対象画素の輝度勾配の強度が輪郭抽出閾値より大きく、前記判定対象画素の輝度勾配の方向の隣接画素および前記方向を180°回転させた方向の隣接画素それぞれの輝度勾配の強度よりも大きいときに、前記判定対象画素は輪郭を表す画素であると判定する
請求項4に記載の画像処理システム。
The luminance gradient calculation means identifies a plurality of pixels having the same arrangement as the coefficient of the edge detection operator around the pixel to be calculated in the intensity of the luminance gradient and the direction of the luminance gradient, and detects a corresponding edge for each of the identified pixels. By calculating the product of the operator's coefficient and calculating the sum, the luminance gradient in the horizontal and vertical directions is calculated, and the vector whose magnitude is the horizontal luminance gradient and the luminance in the vertical direction are calculated. The magnitude of the combined vector with the vector that is the gradient is the intensity of the luminance gradient of the pixel to be calculated, and the arc tangent as a result of dividing the vertical luminance gradient by the horizontal luminance gradient is the luminance gradient direction,
The contour extraction unit selects a pixel to be determined as to whether or not the pixel represents a contour, the intensity of the luminance gradient of the determination target pixel is greater than a contour extraction threshold, and adjacent pixels in the direction of the luminance gradient of the determination target pixel 5. The image processing system according to claim 4, wherein the determination target pixel is determined to be a pixel representing an outline when the intensity gradient is greater than an intensity of a luminance gradient of each of adjacent pixels in a direction rotated by 180 °.
前記拡大前の画像から前記補間画像への拡大率から、抽出するブロックの大きさを定めるためのブロック決定用パラメータを定めるパラメータ設定手段を備え、
代表色推定手段は、選択した画素を中心とする画素のブロックとして、パラメータ設定手段が定めたブロック決定用パラメータに応じた大きさのブロックを抽出する
請求項1から請求項3のうちのいずれか1項に記載の画像処理システム。
Parameter setting means for determining a parameter for determining a block for determining the size of a block to be extracted from an enlargement ratio from the image before enlargement to the interpolated image,
The representative color estimation unit extracts a block having a size corresponding to the block determination parameter determined by the parameter setting unit as a block of pixels centered on the selected pixel. The image processing system according to item 1.
パラメータ設定手段は、当該パラメータ設定手段に入力される拡大率からブロック決定用パラメータを定める
請求項6に記載の画像処理システム。
The image processing system according to claim 6, wherein the parameter setting unit determines a block determination parameter from an enlargement ratio input to the parameter setting unit.
パラメータ設定手段は、予め定められた拡大率からブロック決定用パラメータを定める
請求項6に記載の画像処理システム。
The image processing system according to claim 6, wherein the parameter setting means determines a block determination parameter from a predetermined enlargement ratio.
前記拡大前の画像から前記補間画像への拡大率から、エッジ検出オペレータの係数を選択するための輝度勾配算出用パラメータと、輪郭抽出閾値と、抽出するブロックの大きさを定めるためのブロック決定用パラメータを定めるパラメータ設定手段を備え、
輝度勾配算出手段は、予め複数種類のエッジ検出オペレータの係数を保持し、前記輝度勾配算出用パラメータに応じたエッジ検出オペレータの係数を用いて輝度勾配の強度および輝度勾配の方向を計算し、
輪郭抽出手段は、パラメータ設定手段が定めた前記輪郭抽出閾値を用いて、輪郭を表す画素を特定し、
代表色推定手段は、選択した画素を中心とする画素のブロックとして、パラメータ設定手段が定めたブロック決定用パラメータに応じた大きさのブロックを抽出する
請求項5に記載の画像処理システム。
For determining the brightness gradient calculation parameter for selecting the coefficient of the edge detection operator, the contour extraction threshold, and the block size for determining the size of the block to be extracted from the enlargement ratio from the image before enlargement to the interpolated image Equipped with parameter setting means for determining parameters,
The brightness gradient calculating means holds coefficients of a plurality of types of edge detection operators in advance, calculates the intensity of the brightness gradient and the direction of the brightness gradient using the edge detection operator coefficients according to the brightness gradient calculation parameters,
The contour extracting means identifies the pixel representing the contour using the contour extraction threshold determined by the parameter setting means,
The image processing system according to claim 5, wherein the representative color estimation unit extracts a block having a size corresponding to a block determination parameter determined by the parameter setting unit, as a block of pixels centered on the selected pixel.
パラメータ設定手段は、当該パラメータ設定手段に入力される拡大率から、輝度勾配算出用パラメータと、輪郭抽出閾値と、ブロック決定用パラメータとを定める
請求項9に記載の画像処理システム。
The image processing system according to claim 9, wherein the parameter setting unit determines a luminance gradient calculation parameter, a contour extraction threshold value, and a block determination parameter from an enlargement ratio input to the parameter setting unit.
パラメータ設定手段は、予め定められた拡大率から、輝度勾配算出用パラメータと、輪郭抽出閾値と、ブロック決定用パラメータとを定める
請求項9に記載の画像処理システム。
The image processing system according to claim 9, wherein the parameter setting means determines a luminance gradient calculation parameter, a contour extraction threshold value, and a block determination parameter from a predetermined magnification.
拡大対象画像が入力され、当該拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段を備える
請求項1から請求項11のうちのいずれか1項に記載の画像処理システム。
An interpolation image generating unit that generates an interpolation image in which the enlargement target image is enlarged by interpolating pixels between pixels of the enlargement target image is input. The image processing system according to any one of the above.
入力画像をダウンサンプリングすることにより、前記入力画像よりも解像度の低い低解像度画像を生成するダウンサンプリング手段と、
前記低解像度画像を拡大する拡大画像生成手段と、
前記入力画像と前記低解像度画像の対応する画素同士の画素値の差である差分データを計算する画像減算手段とを備え、
前記拡大画像生成手段は、
拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、
前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを有する
ことを特徴とする画像圧縮装置。
Downsampling means for generating a low resolution image having a lower resolution than the input image by downsampling the input image;
An enlarged image generating means for enlarging the low resolution image;
Image subtracting means for calculating difference data which is a difference between pixel values of corresponding pixels of the input image and the low-resolution image;
The enlarged image generating means includes
Interpolation image generation means for generating an interpolation image obtained by enlarging the enlargement target image by interpolating pixels between pixels of the enlargement target image;
Selecting a pixel in the interpolated image, extracting a block of pixels centered on the selected pixel, clustering the color of the pixels in the block into a first class and a second class, Representative color estimation means for deriving a probability that a pixel color belongs to the first class, a probability that the color of the pixel belongs to the second class, and a representative color of the first class and the second class;
Probability that the color of the pixel belongs to the first class for each individual pixel in the block extracted by the representative color estimation means when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition is higher than the probability of belonging to the second class, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. A color correcting unit that substitutes the average color of the replaced color derived for each block for each block when one pixel belongs to a plurality of blocks. An image compression apparatus comprising:
代表色推定手段は、EMアルゴリズムにより、ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する
請求項13に記載の画像圧縮装置。
The representative color estimation means uses the EM algorithm to determine the probability that the color of each pixel in the block belongs to the first class, the probability that the color belongs to the second class, the representative of the first class and the second class. The image compression apparatus according to claim 13, wherein a color is derived.
原画像を低解像度化した低解像度画像と、前記原画像と前記低解像度画像の対応する画素同士の画素値の差である差分データとが入力され、前記低解像度画像を伸長する画像伸張装置であって、
前記低解像度画像を拡大する拡大画像生成手段と、
前記拡大画像生成手段が拡大した画像と前記差分データの対応する画素同士の画素値の和を計算する画像加算手段とを備え、
前記拡大画像生成手段は、
拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、
前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを有する
ことを特徴とする画像伸張装置。
An image expansion device that receives a low-resolution image obtained by reducing the resolution of an original image and difference data that is a difference between pixel values of corresponding pixels of the original image and the low-resolution image, and expands the low-resolution image. There,
An enlarged image generating means for enlarging the low resolution image;
The enlarged image generating means includes an enlarged image and an image adding means for calculating a sum of pixel values of corresponding pixels of the difference data,
The enlarged image generating means includes
Interpolation image generation means for generating an interpolation image obtained by enlarging the enlargement target image by interpolating pixels between pixels of the enlargement target image;
Selecting a pixel in the interpolated image, extracting a block of pixels centered on the selected pixel, clustering the color of the pixels in the block into a first class and a second class, Representative color estimation means for deriving a probability that a pixel color belongs to the first class, a probability that the color of the pixel belongs to the second class, and a representative color of the first class and the second class;
Probability that the color of the pixel belongs to the first class for each individual pixel in the block extracted by the representative color estimation means when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition is higher than the probability of belonging to the second class, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. A color correcting unit that substitutes the average color of the replaced color derived for each block for each block when one pixel belongs to a plurality of blocks. An image expansion apparatus characterized by comprising:
代表色推定手段は、EMアルゴリズムにより、ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する
請求項15に記載の画像伸張装置。
The representative color estimation means uses the EM algorithm to determine the probability that the color of each pixel in the block belongs to the first class, the probability that the color belongs to the second class, the representative of the first class and the second class. The image expansion device according to claim 15, wherein a color is derived.
画像圧縮装置と画像伸張装置とを備え、
前記画像圧縮装置は、
入力画像をダウンサンプリングすることにより、前記入力画像よりも解像度の低い低解像度画像を生成し、前記低解像度画像を前記画像伸張装置に送信するダウンサンプリング手段と、
前記低解像度画像を拡大する第1の拡大画像生成手段と、
前記入力画像と前記低解像度画像の対応する画素同士の画素値の差である差分データを計算し、前記差分データを前記画像伸張装置に送信する画像減算手段とを有し、
前記画像伸張装置は、
前記画像圧縮装置から受信した低解像度画像を拡大する第2の拡大画像生成手段と、
前記第2の拡大画像生成手段が拡大した画像と、前記画像圧縮装置から受信した差分データの対応する画素同士の画素値の和を計算する画像加算手段とを有し、
前記第1の拡大画像生成手段および前記第2の拡大画像生成手段は、
拡大対象画像の画素間に画素を内挿することにより、前記拡大対象画像を拡大した補間画像を生成する補間画像生成手段と、
前記補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定手段と、
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定手段が抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正手段とを含む
ことを特徴とする画像伝送システム。
An image compression device and an image expansion device;
The image compression device includes:
Down-sampling means for generating a low-resolution image having a lower resolution than the input image by down-sampling the input image, and transmitting the low-resolution image to the image expansion device;
First enlarged image generating means for enlarging the low resolution image;
Image subtraction means for calculating difference data that is a difference between pixel values of corresponding pixels of the input image and the low-resolution image, and transmitting the difference data to the image expansion device;
The image expansion device includes:
Second enlarged image generating means for enlarging the low resolution image received from the image compression device;
An image enlarged by the second enlarged image generating means, and an image adding means for calculating a sum of pixel values of corresponding pixels of the difference data received from the image compression device;
The first enlarged image generating means and the second enlarged image generating means are:
Interpolation image generation means for generating an interpolation image obtained by enlarging the enlargement target image by interpolating pixels between pixels of the enlargement target image;
Selecting a pixel in the interpolated image, extracting a block of pixels centered on the selected pixel, clustering the color of the pixels in the block into a first class and a second class, Representative color estimation means for deriving a probability that a pixel color belongs to the first class, a probability that the color of the pixel belongs to the second class, and a representative color of the first class and the second class;
Probability that the color of the pixel belongs to the first class for each individual pixel in the block extracted by the representative color estimation means when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition is higher than the probability of belonging to the second class, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. A color correcting unit that substitutes the average color of the replaced color derived for each block for each block when one pixel belongs to a plurality of blocks. An image transmission system comprising:
拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定ステップと、
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定ステップで抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正ステップとを含む
ことを特徴とする画像処理方法。
Select a pixel in an interpolated image that is an enlarged image including pixels interpolated between pixels of the image before enlargement, extract a block of pixels centered on the selected pixel, and extract the pixels in the block Clustering colors into a first class and a second class, the probability that the color of each pixel in the block belongs to the first class, the probability that the pixel belongs to the second class, the first class and the A representative color estimation step for deriving a second class of representative colors;
Probability that the color of the pixel belongs to the first class for each individual pixel in the block extracted in the representative color estimation step when the distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition is higher than the probability of belonging to the second class, the color of the pixel is replaced with a representative color of the first class, and if the condition is not satisfied, the color of the pixel is changed to the second class. A color correction step in which, when one pixel belongs to a plurality of blocks, the average color of the replaced color derived for each block is used as the color of the pixel. An image processing method characterized by comprising:
代表色推定ステップで、EMアルゴリズムにより、ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する
請求項18に記載の画像処理方法。
In the representative color estimation step, the probability that the color of each pixel in the block belongs to the first class, the probability that the color of each pixel in the block belongs to the second class, the representative of the first class and the second class, by the EM algorithm The image processing method according to claim 18, wherein a color is derived.
コンピュータに、
拡大前の画像の画素間に内挿された画素を含む拡大された画像である補間画像中の画素を選択し、選択した画素を中心とする画素のブロックを抽出し、前記ブロック内の画素の色を第1のクラスおよび第2のクラスにクラスタリングし、前記ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出する代表色推定処理、および
前記第1のクラスおよび第2のクラスの代表色の距離が閾値以上であるときに、代表色推定処理で抽出したブロック内の個々の画素毎に当該画素の色が第1のクラスに属する確率が第2のクラスに属する確率よりも高いという条件が満たされる場合、前記画素の色を前記第1のクラスの代表色に置換し、前記条件が満たされない場合、前記画素の色を前記第2のクラスの代表色に置換し、一つの画素が複数のブロックに属する場合に、各ブロック毎に前記画素に対して導出された置換後の色の平均を前記画素の色とする色補正処理
を実行させるための画像処理プログラム。
On the computer,
Select a pixel in an interpolated image that is an enlarged image including pixels interpolated between pixels of the image before enlargement, extract a block of pixels centered on the selected pixel, and extract the pixels in the block Clustering colors into a first class and a second class, the probability that the color of each pixel in the block belongs to the first class, the probability that the pixel belongs to the second class, the first class and the A representative color estimation process for deriving a representative color of the second class; and a distance in the block extracted by the representative color estimation process when a distance between the representative colors of the first class and the second class is greater than or equal to a threshold value If the condition that the probability that the color of the pixel belongs to the first class is higher than the probability that the pixel belongs to the second class is satisfied for each pixel, the color of the pixel is replaced with the representative color of the first class And the above conditions are met If not, the color of the pixel is replaced with the representative color of the second class, and when one pixel belongs to a plurality of blocks, the color of the replaced color derived for the pixel for each block An image processing program for executing color correction processing using an average as the color of the pixel.
前記コンピュータに、
代表色推定処理で、EMアルゴリズムにより、ブロック内の各画素の色が前記第1のクラスに属する確率と前記第2のクラスに属する確率と、前記第1のクラスおよび前記第2のクラスの代表色とを導出させる
請求項20に記載の画像処理プログラム。
In the computer,
In the representative color estimation process, the probability that the color of each pixel in the block belongs to the first class, the probability that the color of each pixel in the block belongs to the second class, the representative of the first class and the second class, by the EM algorithm. The image processing program according to claim 20, wherein a color is derived.
JP2007332030A 2007-12-25 2007-12-25 Image processing system, image processing method, and program for image processing Pending JP2009157449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007332030A JP2009157449A (en) 2007-12-25 2007-12-25 Image processing system, image processing method, and program for image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007332030A JP2009157449A (en) 2007-12-25 2007-12-25 Image processing system, image processing method, and program for image processing

Publications (1)

Publication Number Publication Date
JP2009157449A true JP2009157449A (en) 2009-07-16

Family

ID=40961446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007332030A Pending JP2009157449A (en) 2007-12-25 2007-12-25 Image processing system, image processing method, and program for image processing

Country Status (1)

Country Link
JP (1) JP2009157449A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014069052A1 (en) * 2012-10-31 2014-05-08 Eizo株式会社 Magnification factor estimation device and method for same
JP2016038654A (en) * 2014-08-06 2016-03-22 セイコーエプソン株式会社 Image processing apparatus, contour extraction method, and program
US9524538B2 (en) 2014-09-19 2016-12-20 Fujitsu Ten Limited Image processing apparatus
CN111192285A (en) * 2018-07-25 2020-05-22 腾讯医疗健康(深圳)有限公司 Image segmentation method, image segmentation device, storage medium and computer equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014069052A1 (en) * 2012-10-31 2014-05-08 Eizo株式会社 Magnification factor estimation device and method for same
JP2014089659A (en) * 2012-10-31 2014-05-15 Eizo Corp Magnification estimation device and method thereof
US9652689B2 (en) 2012-10-31 2017-05-16 Eizo Corporation Magnification factor estimation device and method for same
JP2016038654A (en) * 2014-08-06 2016-03-22 セイコーエプソン株式会社 Image processing apparatus, contour extraction method, and program
US9524538B2 (en) 2014-09-19 2016-12-20 Fujitsu Ten Limited Image processing apparatus
CN111192285A (en) * 2018-07-25 2020-05-22 腾讯医疗健康(深圳)有限公司 Image segmentation method, image segmentation device, storage medium and computer equipment
CN111192285B (en) * 2018-07-25 2022-11-04 腾讯医疗健康(深圳)有限公司 Image segmentation method, image segmentation device, storage medium and computer equipment

Similar Documents

Publication Publication Date Title
JP5229235B2 (en) Image processing apparatus, image processing method, image expansion apparatus, image compression apparatus, image transmission system, and image processing program
US9679357B2 (en) Image processing device, and an image processing method
US8363985B2 (en) Image generation method and apparatus, program therefor, and storage medium which stores the program
JP6164564B1 (en) Image processing apparatus, image processing method, recording medium, program, and imaging apparatus
JP2017092872A (en) Image processing apparatus and image processing method
JP2007213125A (en) Image processor and processing method, recording medium, and program
JP5295431B2 (en) Image processing device
JP6046927B2 (en) Image processing apparatus and control method thereof
US8948502B2 (en) Image processing method, and image processor
JP2009157449A (en) Image processing system, image processing method, and program for image processing
WO2015198368A1 (en) Image processing device and image processing method
JP4868249B2 (en) Video signal processing device
JPWO2017203941A1 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM
JP5042251B2 (en) Image processing apparatus and image processing method
US9589324B1 (en) Overshoot protection of upscaled images
US8675998B2 (en) Method and apparatus for high frequency component smoothing, and image display apparatus
KR102470242B1 (en) Image processing device, image processing method and program
JPWO2015198368A1 (en) Image processing apparatus and image processing method
KR101711589B1 (en) Method and Apparatus of Dictionary Design on Super-Resolution, and Generating Super-Resolution Image based on the Dictionary
US9008463B2 (en) Image expansion apparatus for performing interpolation processing on input image data, and image expansion method thereof
JP2005293265A (en) Image processing device, and method
WO2020000333A1 (en) Image processing method and apparatus
JPWO2015083502A1 (en) Image processing apparatus, method, and program
JP2015106318A (en) Image processor and image processing method
JP5762006B2 (en) Image processing apparatus and image processing method