JP2012094050A - Image processing method, and image processing device - Google Patents

Image processing method, and image processing device Download PDF

Info

Publication number
JP2012094050A
JP2012094050A JP2010242251A JP2010242251A JP2012094050A JP 2012094050 A JP2012094050 A JP 2012094050A JP 2010242251 A JP2010242251 A JP 2010242251A JP 2010242251 A JP2010242251 A JP 2010242251A JP 2012094050 A JP2012094050 A JP 2012094050A
Authority
JP
Japan
Prior art keywords
image
value
binarized
image processing
color difference
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
JP2010242251A
Other languages
Japanese (ja)
Inventor
Hiroyuki Abe
啓之 阿部
Fumihiko Futaba
文彦 二葉
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.)
Nikon Corp
Original Assignee
Nikon 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 Nikon Corp filed Critical Nikon Corp
Priority to JP2010242251A priority Critical patent/JP2012094050A/en
Publication of JP2012094050A publication Critical patent/JP2012094050A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image processing method for extracting an object in an image.SOLUTION: A camera 100 includes: dividing means for dividing an image into plural sections in a color difference space, which is represented in two dimension, based on color difference value; binary image creating means for binarizing an image for each of the plural sections divided by the dividing means, and creating binary images; and object extracting means for extracting an object in an image based on the binary images created by the binary image creating means.

Description

本発明は、画像処理方法、および画像処理装置に関する。   The present invention relates to an image processing method and an image processing apparatus.

次のような画像処理装置が知られている。この画像処理装置は、画像データを色差空間座標で表現される画像データに変換した後、変換後の画像データに基づいて特定色を検出する(例えば、特許文献1)。   The following image processing apparatus is known. This image processing apparatus converts image data into image data expressed in color difference space coordinates, and then detects a specific color based on the converted image data (for example, Patent Document 1).

特許第3716466号公報Japanese Patent No. 3716466

しかしながら、従来の画像処理装置のように、画像データを色差空間座標で表される画像データに変換して変換後の画像データに基づいて特定色を検出した場合には、中間色の弁別性が良くない。このため、従来の方法によって特定した特定色に基づいて、画像内の被写体を抽出しようとすると、被写体の抽出精度が低下するおそれがあった。   However, when a specific color is detected based on the converted image data after converting the image data into image data represented by color difference space coordinates as in the conventional image processing apparatus, the discrimination of the intermediate color is good. Absent. For this reason, if an attempt is made to extract a subject in an image based on a specific color specified by a conventional method, the subject extraction accuracy may be reduced.

本発明による画像処理方法は、2次元で表した色差空間上で、色差の値に基づいて画像を複数に区分する区分手順と、区分手順で区分した複数の区分ごとに画像を2値化して2値化画像を生成する2値化画像生成手順と、2値化画像生成手順で生成した2値化画像に基づいて、画像内から被写体を抽出する被写体抽出手順とを有することを特徴とする。
本発明による画像処理装置は、2次元で表した色差空間上で、色差の値に基づいて画像を複数に区分する区分手段と、区分手段によって区分された複数の区分ごとに画像を2値化して2値化画像を生成する2値化画像生成手段と、2値化画像生成手段によって生成された2値化画像に基づいて、画像内から被写体を抽出する被写体抽出手段とを備えることを特徴とする。
In the image processing method according to the present invention, in a color difference space expressed in two dimensions, a division procedure for dividing an image into a plurality based on a color difference value, and binarizing the image for each of the plurality of divisions divided in the division procedure A binarized image generating procedure for generating a binarized image; and a subject extracting procedure for extracting a subject from the image based on the binarized image generated by the binarized image generating procedure. .
An image processing apparatus according to the present invention binarizes an image for each of a plurality of sections divided by the classifying means and a classifying means for classifying the image into a plurality of colors based on the color difference value in a two-dimensional color difference space. A binarized image generating unit that generates a binarized image, and a subject extracting unit that extracts a subject from the image based on the binarized image generated by the binarized image generating unit. And

本発明によれば、中間色の弁別性を向上させて、被写体の抽出精度を向上させることができる。   According to the present invention, it is possible to improve the discrimination accuracy of intermediate colors and improve the accuracy of subject extraction.

カメラの一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of a camera. CIELAB色度図の具体例を示す図である。It is a figure which shows the specific example of a CIELAB chromaticity diagram. CIELAB色度図に基づいて作成された2値化区分画像の具体例を示す図である。It is a figure which shows the specific example of the binarization division image produced based on the CIELAB chromaticity diagram. 被写体特定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a subject specific process. 色差空間8つの区分に分割した場合の具体例を示す図である。It is a figure which shows the specific example at the time of dividing | segmenting into the color difference space 8 division. CIELAB色度図を対象画像として8区分に2値化して8枚の2値化画像を作成した例を示す図である。It is a figure which shows the example which produced the binarized image of 8 sheets by binarizing into 8 divisions by making a CIELAB chromaticity diagram into object image. 色差空間16個の区分に分割した場合の具体例を示す図である。It is a figure which shows the specific example at the time of dividing | segmenting into 16 divisions of color difference space.

図1は、本実施の形態におけるカメラの一実施の形態の構成を示すブロック図である。カメラ100は、操作部材101と、レンズ102と、撮像素子103と、制御装置104と、メモリカードスロット105と、モニタ106とを備えている。操作部材101は、使用者によって操作される種々の入力部材、例えば電源ボタン、レリーズボタン、ズームボタン、十字キー、決定ボタン、再生ボタン、削除ボタンなどを含んでいる。   FIG. 1 is a block diagram illustrating a configuration of an embodiment of a camera according to the present embodiment. The camera 100 includes an operation member 101, a lens 102, an image sensor 103, a control device 104, a memory card slot 105, and a monitor 106. The operation member 101 includes various input members operated by the user, such as a power button, a release button, a zoom button, a cross key, an enter button, a play button, and a delete button.

レンズ102は、複数の光学レンズから構成されるが、図1では代表して1枚のレンズで表している。撮像素子103は、例えばCCDやCMOSなどのイメージセンサーであり、レンズ102により結像した被写体像を撮像する。そして、撮像によって得られた画像信号を制御装置104へ出力する。   The lens 102 is composed of a plurality of optical lenses, but is representatively represented by one lens in FIG. The image sensor 103 is an image sensor such as a CCD or a CMOS, for example, and captures a subject image formed by the lens 102. Then, an image signal obtained by imaging is output to the control device 104.

制御装置104は、撮像素子103から入力された画像信号に基づいて所定の画像形式、例えばJPEG形式の画像データ(以下、「本画像データ」と呼ぶ)を生成する。また、制御装置104は、生成した画像データに基づいて、表示用画像データ、例えばサムネイル画像データを生成する。制御装置104は、生成した本画像データとサムネイル画像データとを含み、さらにヘッダ情報を付加した画像ファイルを生成してメモリカードスロット105へ出力する。本実施の形態では、本画像データとサムネイル画像データとは、いずれもRGB表色系で表された画像データであるものとする。   The control device 104 generates image data in a predetermined image format, for example, JPEG format (hereinafter referred to as “main image data”) based on the image signal input from the image sensor 103. Further, the control device 104 generates display image data, for example, thumbnail image data, based on the generated image data. The control device 104 generates an image file that includes the generated main image data and thumbnail image data, and further includes header information, and outputs the image file to the memory card slot 105. In the present embodiment, it is assumed that both the main image data and the thumbnail image data are image data expressed in the RGB color system.

メモリカードスロット105は、記憶媒体としてのメモリカードを挿入するためのスロットであり、制御装置104から出力された画像ファイルをメモリカードに書き込んで記録する。また、メモリカードスロット105は、制御装置104からの指示に基づいて、メモリカード内に記憶されている画像ファイルを読み込む。   The memory card slot 105 is a slot for inserting a memory card as a storage medium, and the image file output from the control device 104 is written and recorded on the memory card. The memory card slot 105 reads an image file stored in the memory card based on an instruction from the control device 104.

モニタ106は、カメラ100の背面に搭載された液晶モニタ(背面モニタ)であり、当該モニタ106には、メモリカードに記憶されている画像やカメラ100を設定するための設定メニューなどが表示される。また、制御装置104は、使用者によってカメラ100のモードが撮影モードに設定されると、撮像素子103から時系列で取得した画像の表示用画像データをモニタ106に出力する。これによってモニタ106にはスルー画が表示される。   The monitor 106 is a liquid crystal monitor (rear monitor) mounted on the back surface of the camera 100, and the monitor 106 displays an image stored in a memory card, a setting menu for setting the camera 100, and the like. . Further, when the user sets the mode of the camera 100 to the shooting mode, the control device 104 outputs image data for display of images acquired from the image sensor 103 in time series to the monitor 106. As a result, a through image is displayed on the monitor 106.

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、カメラ100を制御する。なお、制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは、揮発性のメモリであって、CPUがプログラム実行時にプログラムを展開するためのワークメモリとして使用されたり、データを一時的に記録するためのバッファメモリとして使用される。また、フラッシュメモリは、不揮発性のメモリであって、制御装置104が実行するプログラムのデータや、プログラム実行時に読み込まれる種々のパラメータなどが記録されている。   The control device 104 includes a CPU, a memory, and other peripheral circuits, and controls the camera 100. Note that the memory constituting the control device 104 includes SDRAM and flash memory. The SDRAM is a volatile memory, and is used as a work memory for the CPU to develop a program when the program is executed or as a buffer memory for temporarily recording data. The flash memory is a non-volatile memory in which data of a program executed by the control device 104, various parameters read during program execution, and the like are recorded.

本実施の形態では、制御装置104は、撮像素子103によって撮像される画像データに基づいて取得される画像を、画像内の色を用いて複数の領域に分割して、画像内から特定の色の被写体を抽出する。   In the present embodiment, the control device 104 divides an image acquired based on image data captured by the image sensor 103 into a plurality of regions using colors in the image, and selects a specific color from the image. The subject is extracted.

従来、図2に示すCIELAB色度図を色別に複数の領域に分けることによって、画像内を色によって複数の領域に分割する方法が知られている。しかしながら、この方法を用いて画像を複数の領域に分割して被写体を抽出した場合には、中間色の弁別性が低いため、被写体の抽出精度が高くないという問題があった。以下、従来の方法の問題点について、具体的に説明する。   2. Description of the Related Art Conventionally, there is known a method of dividing an image into a plurality of regions by colors by dividing the CIELAB chromaticity diagram shown in FIG. 2 into a plurality of regions for each color. However, when the subject is extracted by dividing the image into a plurality of regions using this method, there is a problem that the subject extraction accuracy is not high because the discrimination of the intermediate colors is low. Hereinafter, the problems of the conventional method will be specifically described.

従来の方法では、RGB表色系で表された対象画像の画像データをYCbCr形式の画像に変換し、Y成分の画像(Yプレーン画像)、Cr成分の画像(Crプレーン画像)、および、Cb成分の画像(Cbプレーン画像)をそれぞれ生成する。具体的には、RGB表色系で表されている対象画像を次式(1)〜(3)を用いてYCbCr色空間における輝度成分(Y成分)からなる輝度画像であるYプレーン画像と、色差成分(Cb成分、Cr成分)とからなる色差画像であるCbプレーン画像、およびCrプレーン画像とに変換する。また、Yプレーン画像の白画素と黒画素を反転させたY補数プレーン画像を生成する。
Y = 0.299R+0.587G+0.114B ・・・(1)
Cb=−0.169R−0.332G+0.500B ・・・(2)
Cr= 0.500R−0.419G−0.081B ・・・(3)
In the conventional method, the image data of the target image expressed in the RGB color system is converted into an image in the YCbCr format, and a Y component image (Y plane image), a Cr component image (Cr plane image), and Cb Component images (Cb plane images) are respectively generated. Specifically, the target image represented in the RGB color system is represented by a Y plane image that is a luminance image composed of luminance components (Y component) in the YCbCr color space using the following equations (1) to (3): Conversion into a Cb plane image and a Cr plane image, which are color difference images composed of color difference components (Cb component, Cr component). Also, a Y complement plane image is generated by inverting the white pixels and black pixels of the Y plane image.
Y = 0.299R + 0.587G + 0.114B (1)
Cb = −0.169R−0.332G + 0.500B (2)
Cr = 0.500R−0.419G−0.081B (3)

そして、生成したYプレーン画像、Cbプレーン画像、およびCrプレーン画像、Y補数プレーン画像のそれぞれについて、画像内の全画素の濃度値を調べ、各濃度値の平均値Mと各濃度の標準偏差σとを算出する。さらに、Yプレーン画像、Cbプレーン画像、Crプレーン画像、およびY補数プレーン画像の各画素を各々の平均値M+標準偏差σ、平均値M、平均値M−標準偏差σでそれぞれ2値化し、16枚の2値化区分画像を作成する。   Then, for each of the generated Y plane image, Cb plane image, Cr plane image, and Y complement plane image, the density value of all pixels in the image is examined, and the average value M of each density value and the standard deviation σ of each density And calculate. Further, each pixel of the Y plane image, the Cb plane image, the Cr plane image, and the Y complement plane image is binarized with an average value M + standard deviation σ, an average value M, and an average value M−standard deviation σ, respectively. Two binarized segment images are created.

これにより、図2に示したCIELAB色度図に基づいて、図3(a)〜図3(p)に示すような16枚の2値化区分画像が生成される。この図3に示す2値化区分画像によると、縦一列で示されている各プレーン画像ごとの2値化区分画像においては、4枚の画像間での白画素領域の重なりは少ないが、16枚全体でみると、16枚の画像間では多くの範囲で白画素領域の重なりが生じており、色の弁別性が良くない。   Thereby, 16 binarized segment images as shown in FIGS. 3A to 3P are generated based on the CIELAB chromaticity diagram shown in FIG. According to the binarized segment image shown in FIG. 3, in the binarized segment image for each plane image shown in a vertical row, there is little overlap of white pixel areas between the four images. When viewed as a whole, white pixel regions overlap in a large range between the 16 images, and the color discrimination is not good.

例えば、図3(e)〜図3(h)に示すCbプレーン画像についての4枚の2値化区分画像と、図3(i)〜図3(l)に示すCrプレーン画像についての4枚の2値化区分画像との2列に着目すると、図3(f)、(g)、(j)、(k)の4枚の2値化区分画像では、中間色に相当する円の中心部分で白画素領域の重なりが生じており、中間色の弁別性が悪くなっている。   For example, four binarized segment images for the Cb plane images shown in FIGS. 3 (e) to 3 (h) and four for the Cr plane images shown in FIGS. 3 (i) to 3 (l). Focusing on the two columns of the binarized segment images, the four binarized segment images shown in FIGS. 3 (f), (g), (j), and (k) have a central portion of a circle corresponding to an intermediate color. In this case, the white pixel areas are overlapped, and the distinguishability of intermediate colors is deteriorated.

一方、図3(e)、(h)の2枚の2値化区分画像では、白画素領域は、青系の色に相当する円の上側と黄系に相当する円の下側とに分かれており重なりは生じていない。しかしながら、この2枚の2値化区分画像によれば、青系の色と黄系の色については弁別ができているが、赤系の色と緑系の色については弁別ができていない。また、図3(i)、(l)の2枚の2値化区分画像では、白画素領域は、赤系の色に相当する円の右側と緑系に相当する円の左側とに分かれており重なりは生じていない。しかしながら、この2枚の2値化区分画像によれば、赤系の色と緑系の色については弁別ができているが、青系の色と黄系の色については弁別ができていない。さらに、図3(e)、(h)、(i)、(l)の4枚の2値化区分画像を用いれば、青系の色、黄系の色、赤系の色、緑系の色のそれぞれについて弁別できるが、円の中心部分の中間色の弁別ができない。   On the other hand, in the two binarized segmented images shown in FIGS. 3E and 3H, the white pixel region is divided into an upper side of a circle corresponding to a blue color and a lower side of a circle corresponding to a yellow color. There is no overlap. However, according to the two binarized segmented images, the blue color and the yellow color can be discriminated, but the red color and the green color cannot be discriminated. 3 (i) and (l), the white pixel region is divided into a right side of a circle corresponding to a red color and a left side of a circle corresponding to a green color. There is no overlap. However, according to the two binarized segmented images, the red color and the green color can be discriminated, but the blue color and the yellow color cannot be discriminated. Further, if the four binarized segment images of FIGS. 3E, 3H, 3I, and 1L are used, the blue color, the yellow color, the red color, and the green color are displayed. Each color can be discriminated, but the middle color at the center of the circle cannot be discriminated.

このように、Yプレーン画像、Cbプレーン画像、Crプレーン画像、およびY補数プレーン画像のそれぞれについて、16枚の2値化区分画像を用いる従来の方法では、青系の色、黄系の色、赤系の色、緑系の色以外の中間色の弁別性が悪く、この方法によって、色を用いて画像を分類した場合には、被写体の特定精度が低下するおそれがあった。   As described above, in each of the Y plane image, the Cb plane image, the Cr plane image, and the Y complement plane image, in the conventional method using 16 binarized segment images, the blue color, the yellow color, The discrimination between intermediate colors other than red and green colors is poor, and when images are classified using colors by this method, there is a possibility that the accuracy of identifying a subject may be reduced.

そこで、本実施の形態では、制御装置104は、図4に示す処理を実行することにより、中間色の弁別性を向上させて画像の領域分割を行い、精度高く被写体を特定することを可能にする。なお、図4は、本実施の形態における被写体特定処理の流れを示すフローチャートであり、図4に示す処理は、撮像素子103からのスルー画の入力が開始されると起動するプログラムとして、制御装置104により実行される。   Therefore, in the present embodiment, the control device 104 executes the processing shown in FIG. 4 to improve the discrimination of intermediate colors and to divide the image area, thereby enabling to specify the subject with high accuracy. . FIG. 4 is a flowchart showing the flow of the subject specifying process in the present embodiment. The process shown in FIG. 4 is performed as a program that starts when a through image input from the image sensor 103 is started. 104.

ステップS10において、制御装置104は、入力されるスルー画を対象画像とし、RGB表色系で表された対象画像の画像データを式(1)〜(3)を用いてYCbCr形式の画像データに変換する。これによって、上述したY成分の画像(Yプレーン画像)、Cr成分の画像(Crプレーン画像)、および、Cb成分の画像(Cbプレーン画像)が生成される。その後、ステップS20へ進む。   In step S10, the control device 104 sets the input through image as the target image, and converts the image data of the target image expressed in the RGB color system into image data in the YCbCr format using the equations (1) to (3). Convert. As a result, the above-described Y component image (Y plane image), Cr component image (Cr plane image), and Cb component image (Cb plane image) are generated. Then, it progresses to step S20.

ステップS20では、制御装置104は、YCbCr形式に変換した画像データを用いて、対象画像を色差空間上で8区分に2値化する。本実施の形態では、制御装置104は、図5に示すように、縦軸をCb値、横軸にCr値として2次元で表した色差空間(Cb−Cr空間)を等角度間隔で8つの区分5a〜5hに分割する。そして、制御装置104は、対象画像と同じ大きさの区分画像を区分5a〜5hのそれぞれに対応させて8枚用意し、それら8枚の区分画像の全ての画素値を0としておく。   In step S20, the control device 104 binarizes the target image into 8 sections on the color difference space using the image data converted into the YCbCr format. In the present embodiment, as shown in FIG. 5, the control device 104 has eight color difference spaces (Cb-Cr spaces) expressed in two dimensions with the vertical axis representing the Cb value and the horizontal axis representing the Cr value. Divide into sections 5a to 5h. Then, the control device 104 prepares eight segment images having the same size as the target image in association with each of the segments 5a to 5h, and sets all the pixel values of the eight segment images to zero.

制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値を用いて、次式(4)〜(11)を用いて対象画像を区分5a〜5hの8区分に2値化する。すなわち、制御装置104は、対象画像のCb値とCr値との大小関係、Cb値の符号、およびCr値の符号に基づいて、対象画像を区分5a〜5hの各区分ごとに2値化する。
Cb≧0 かつ Cr≧0 かつ |Cr|≧|Cb| =区分5a・・・(4)
Cb≧0 かつ Cr≧0 かつ |Cr|<|Cb| =区分5b・・・(5)
Cb≧0 かつ Cr<0 かつ |Cr|≦|Cb| =区分5c・・・(6)
Cb≧0 かつ Cr<0 かつ |Cr|>|Cb| =区分5d・・・(7)
Cb<0 かつ Cr<0 かつ |Cr|>|Cb| =区分5e・・・(8)
Cb<0 かつ Cr<0 かつ |Cr|≦|Cb| =区分5f・・・(9)
Cb<0 かつ Cr≧0 かつ |Cr|<|Cb| =区分5g・・・(10)
Cb<0 かつ Cr≧0 かつ |Cr|≧|Cb| =区分5h・・・(11)
The control device 104 binarizes the target image into eight sections 5a to 5h using the following formulas (4) to (11) using pixel values of corresponding pixels of the Cb plane image and the Cr plane image. To do. That is, the control device 104 binarizes the target image for each of the sections 5a to 5h based on the magnitude relationship between the Cb value and the Cr value of the target image, the sign of the Cb value, and the sign of the Cr value. .
Cb ≧ 0 and Cr ≧ 0 and | Cr | ≧ | Cb | = section 5a (4)
Cb ≧ 0 and Cr ≧ 0 and | Cr | <| Cb | = section 5b (5)
Cb ≧ 0 and Cr <0 and | Cr | ≦ | Cb | = section 5c (6)
Cb ≧ 0 and Cr <0 and | Cr |> | Cb | = section 5d (7)
Cb <0 and Cr <0 and | Cr |> | Cb | = section 5e (8)
Cb <0 and Cr <0 and | Cr | ≦ | Cb | = section 5f (9)
Cb <0 and Cr ≧ 0 and | Cr | <| Cb | = section 5g (10)
Cb <0 and Cr ≧ 0 and | Cr | ≧ | Cb | = section 5h (11)

具体的には、制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(4)を満たす場合には、区分5aの区分画像の対応する画素の画素値を1に変更する。また、制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(5)を満たす場合には、区分5bの区分画像の対応する画素の画素値を1に変更する。同様に、制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(6)を満たす場合には、区分5cの区分画像の対応する画素の画素値を1に変更し、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(7)を満たす場合には、区分5dの区分画像の対応する画素の画素値を1に変更する。   Specifically, when the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (4), the control device 104 sets the pixel value of the corresponding pixel of the section image of the section 5a to 1 Change to Further, when the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (5), the control device 104 changes the pixel value of the corresponding pixel of the segment image of the segment 5b to 1. . Similarly, when the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (6), the control device 104 changes the pixel value of the corresponding pixel of the segment image of the segment 5c to 1. If the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (7), the pixel value of the corresponding pixel of the segment image of the segment 5d is changed to 1.

また、制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(8)を満たす場合には、区分5eの区分画像の対応する画素の画素値を1に変更し、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(9)を満たす場合には、区分5fの区分画像の対応する画素の画素値を1に変更する。また、制御装置104は、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(10)を満たす場合には、区分5gの区分画像の対応する画素の画素値を1に変更し、Cbプレーン画像とCrプレーン画像との対応する画素の画素値が式(11)を満たす場合には、区分5hの区分画像の対応する画素の画素値を1に変更する。   In addition, when the pixel value of the corresponding pixel of the Cb plane image and the Cr plane image satisfies Expression (8), the control device 104 changes the pixel value of the corresponding pixel of the segment image of the segment 5e to 1. When the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (9), the pixel value of the corresponding pixel of the segment image of the segment 5f is changed to 1. In addition, when the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (10), the control device 104 changes the pixel value of the corresponding pixel of the segment image of the segment 5g to 1. When the pixel values of the corresponding pixels of the Cb plane image and the Cr plane image satisfy Expression (11), the pixel value of the corresponding pixel of the segment image of the segment 5h is changed to 1.

制御装置104は、Cbプレーン画像とCrプレーン画像との対応する全ての画素について、上記式(4)〜(11)を用いた判定を行うことにより、8枚の区分画像に基づいて、8枚の2値化画像を生成する。これにより、対象画像を区分5a〜5hの8区分に2値化することができる。図6は、図2に示したCIELAB色度図を対象画像として、式(4)〜(11)を用いて8区分に2値化して、8枚の2値化画像6a〜6hを作成した例を示している。この図6に示す8枚の2値化画像においては、全ての2値化画像間で白画素が重なることはなく、かつ全ての画像について各画素の論理和をとると全ての画素が1となる。   The control device 104 performs determination using the above formulas (4) to (11) for all corresponding pixels of the Cb plane image and the Cr plane image, so that eight images are obtained based on the eight divided images. The binarized image is generated. Thereby, the target image can be binarized into 8 sections of sections 5a to 5h. FIG. 6 uses the CIELAB chromaticity diagram shown in FIG. 2 as a target image and binarizes it into 8 sections using equations (4) to (11), thereby creating eight binarized images 6a to 6h. An example is shown. In the eight binarized images shown in FIG. 6, white pixels do not overlap between all the binarized images, and all the pixels are 1 when the logical sum of the pixels is taken for all the images. Become.

図6に示すように、本実施の形態における方法で作成した8枚の2値化画像6a〜6hでは、青系、黄系、赤系、緑系の全ての色が弁別できており、さらに円の中心部においても白画素の重なりがないため、中間色も弁別することができている。   As shown in FIG. 6, in the eight binarized images 6a to 6h created by the method in the present embodiment, all colors of blue, yellow, red, and green can be distinguished. Since there is no overlap of white pixels even at the center of the circle, intermediate colors can also be distinguished.

その後、ステップS30へ進み、制御装置104は、上述した処理により作成した8枚の2値化画像6a〜6hに基づいて、対象画像内から被写体を抽出する。上述したように、8枚の2値化画像6a〜6hによって中間色も含めて全ての色の弁別することができれば、対象画像内に存在する特定の色を有する被写体を精度高く抽出することができる。   Thereafter, the process proceeds to step S30, and the control device 104 extracts a subject from the target image based on the eight binarized images 6a to 6h created by the above-described processing. As described above, if all the colors including the intermediate colors can be discriminated by the eight binarized images 6a to 6h, it is possible to accurately extract a subject having a specific color existing in the target image. .

例えば、被写体の色が赤色である場合には、2値化画像6hにより被写体を抽出することができる。すなわち、2値化画像6h内における白画素領域の位置により、対象画像内における赤色の被写体の位置を特定することができ、さらに白画素領域の大きさや形状に基づいて、赤色の被写体の大きさや形状を特定することができる。また、被写体の色が緑色である場合には、2値化画像6d、6e、6fにより被写体を特定することができる。すなわち、2値化画像6d、6e、6fの各白画素領域を組み合わせ、組み合わせ後の白画素領域の位置、大きさ、形状に基づいて、対象画像内における緑色の被写体の位置、大きさ、形状を特定することができる。制御装置104は、このように特定した被写体の位置、大きさ、形状に基づいて、対象画像内から特定の色の被写体を抽出することができる。   For example, when the color of the subject is red, the subject can be extracted from the binarized image 6h. That is, the position of the red subject in the target image can be specified by the position of the white pixel region in the binarized image 6h, and the size of the red subject can be determined based on the size and shape of the white pixel region. The shape can be specified. When the subject is green, the subject can be specified by the binarized images 6d, 6e, and 6f. That is, the white pixel regions of the binarized images 6d, 6e, and 6f are combined, and the position, size, and shape of the green subject in the target image are based on the position, size, and shape of the combined white pixel region. Can be specified. The control device 104 can extract a subject having a specific color from the target image based on the position, size, and shape of the subject thus identified.

なお、特定対象の被写体の色は、使用者によってあらかじめ指定されていてもよいし、制御装置104があらかじめ使用者に対して被写体を撮影するように促し、その結果撮影された画像に基づいて被写体の色を特定するようにしてもよい。   Note that the color of the subject to be specified may be specified in advance by the user, or the control device 104 prompts the user to photograph the subject in advance, and the subject is based on the photographed image as a result. The color may be specified.

その後、ステップS40へ進み、制御装置104は、スルー画の入力が終了したか否かを判断する。ステップS40で否定判断した場合には、ステップS10へ戻り、次のフレームを対象として上述した処理を実行する。これにより、時系列で入力されるスルー画の各フレームで被写体を抽出して、フレーム間で被写体を追尾することが可能となる。これに対して、ステップS40で肯定判断した場合には、処理を終了する。   Thereafter, the process proceeds to step S40, and the control device 104 determines whether or not the input of the through image has been completed. If a negative determination is made in step S40, the process returns to step S10, and the above-described processing is executed for the next frame. As a result, it is possible to extract a subject in each frame of a through image input in time series and track the subject between frames. On the other hand, when an affirmative determination is made in step S40, the process ends.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)制御装置104は、縦軸をCb値、横軸にCr値として2次元で表した色差空間上で、色差の値に基づいて対象画像を8つの区分5a〜5hに区分し、各区分ごとに対象画像を2値化して2値化画像を生成する。そして、制御装置104は、生成した2値化画像に基づいて、対象画像内から被写体を抽出するようにした。これによって、中間色の弁別性を向上させて、対象画像内から特定の色の被写体を精度高く抽出することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The control device 104 divides the target image into eight sections 5a to 5h based on the color difference values in a two-dimensional color difference space with the vertical axis representing the Cb value and the horizontal axis representing the Cr value. A target image is binarized for each section to generate a binarized image. Then, the control device 104 extracts a subject from the target image based on the generated binarized image. Accordingly, it is possible to improve the discrimination of intermediate colors and extract a subject of a specific color from the target image with high accuracy.

(2)制御装置104は、Cb値とCr値との大小関係、Cb値の符号、およびCr値の符号に基づいて、対象画像を各区分ごとに2値化するようにした。これによって、全ての2値化画像間で白画素が重ならないように2値化画像を生成することができるため、2値化画像によって、青系、黄系、赤系、緑系の全ての色が弁別でき、さらに中間色の弁別性も向上させることができる。 (2) The control device 104 binarizes the target image for each section based on the magnitude relationship between the Cb value and the Cr value, the sign of the Cb value, and the sign of the Cr value. As a result, a binarized image can be generated so that white pixels do not overlap between all the binarized images, so that all of the blue, yellow, red, and green colors can be generated by the binarized image. The color can be discriminated, and the discrimination of intermediate colors can also be improved.

―変形例―
なお、上述した実施の形態のカメラは、以下のように変形することもできる。
(1)上述した実施の形態では、制御装置104は、YCbCr形式に変換した画像データを用いて、式(4)〜(11)により、対象画像を色差空間上で8区分に2値化する例について説明した。しかしながら、対象画像を色差空間上で8以外の区分数に区分して2値化するようにしてもよい。例えば、制御装置104は、図7に示すように、色差空間(Cb−Cr空間)を等角度間隔で16個の区分7a〜7pに分割し、次式(12)〜(27)により、対象画像を色差空間上で16区分に2値化するようにしてもよい。
-Modification-
The camera according to the above-described embodiment can be modified as follows.
(1) In the above-described embodiment, the control device 104 binarizes the target image into 8 sections on the color difference space using the image data converted into the YCbCr format according to the equations (4) to (11). An example was described. However, the target image may be binarized by dividing it into a number other than 8 in the color difference space. For example, as shown in FIG. 7, the control device 104 divides the color difference space (Cb-Cr space) into 16 sections 7a to 7p at equiangular intervals, and the following equations (12) to (27) The image may be binarized into 16 sections on the color difference space.

Cb>0 かつ Cr≧0 かつ Cb≦0.5Cr =区分7a ・・・(12)
Cb>0 かつ Cr≧0 かつ Cr≧Cb>0.5Cr =区分7b ・・・(13)
Cb>0 かつ Cr≧0 かつ 2Cr≧Cb>Cr =区分7c ・・・(14)
Cb>0 かつ Cr≧0 かつ Cb>2Cr =区分7d ・・・(15)
Cb≧0 かつ Cr<0 かつ Cb ≧−2Cr =区分7e ・・・(16)
Cb≧0 かつ Cr<0 かつ −Cr≦Cb<−2Cr =区分7f ・・・(17)
Cb≧0 かつ Cr<0 かつ −0.5Cr≦Cb<−Cr =区分7g ・・・(18)
Cb≧0 かつ Cr<0 かつ Cb<−0.5Cr =区分7h ・・・(19)
Cb<0 かつ Cr<0 かつ Cb≧0.5Cr =区分7i ・・・(20)
Cb<0 かつ Cr<0 かつ Cr≦Cb<0.5Cr =区分7j ・・・(21)
Cb<0 かつ Cr<0 かつ 2Cr≦Cb<Cr =区分7k ・・・(22)
Cb<0 かつ Cr<0 かつ Cb<2Cr =区分7l ・・・(23)
Cb≦0 かつ Cr≧0 かつ Cb<−2Cr =区分7m ・・・(24)
Cb≦0 かつ Cr≧0 かつ −2Cr≦Cb<−Cr =区分7n ・・・(25)
Cb≦0 かつ Cr≧0 かつ −Cr≦Cb<−0.5Cr =区分7o ・・・(26)
Cb≦0 かつ Cr≧0 かつ Cb≧−0.5Cr =区分7p・・・(27)
Cb> 0 and Cr ≧ 0 and Cb ≦ 0.5Cr = section 7a (12)
Cb> 0 and Cr ≧ 0 and Cr ≧ Cb> 0.5Cr = section 7b (13)
Cb> 0 and Cr ≧ 0 and 2Cr ≧ Cb> Cr = section 7c (14)
Cb> 0 and Cr ≧ 0 and Cb> 2Cr = section 7d (15)
Cb ≧ 0 and Cr <0 and Cb ≧ −2Cr = section 7e (16)
Cb ≧ 0 and Cr <0 and −Cr ≦ Cb <−2Cr = section 7f (17)
Cb ≧ 0 and Cr <0 and −0.5Cr ≦ Cb <−Cr = section 7g (18)
Cb ≧ 0 and Cr <0 and Cb <−0.5Cr = section 7h (19)
Cb <0 and Cr <0 and Cb ≧ 0.5Cr = section 7i (20)
Cb <0 and Cr <0 and Cr ≦ Cb <0.5Cr = section 7j (21)
Cb <0 and Cr <0 and 2Cr ≦ Cb <Cr = section 7k (22)
Cb <0 and Cr <0 and Cb <2Cr = section 7l (23)
Cb ≦ 0 and Cr ≧ 0 and Cb <−2Cr = section 7m (24)
Cb ≦ 0 and Cr ≧ 0 and −2Cr ≦ Cb <−Cr = section 7n (25)
Cb ≦ 0 and Cr ≧ 0 and −Cr ≦ Cb <−0.5Cr = section 7o (26)
Cb ≦ 0 and Cr ≧ 0 and Cb ≧ −0.5Cr = section 7p (27)

(2)上述した実施の形態では、制御装置104は、スルー画を対象として図4に示す処理を実行し、スルー画の各フレームにおいて被写体を抽出する例について説明した。しかしながら、1枚の静止画を対象として図4のステップS10〜ステップS30の処理を実行して被写体を抽出してもよい。あるいは、複数フレームにより構成される動画データの各フレームを対象として図4の処理を実行して、動画を構成する各フレームで被写体を抽出し、複数フレーム間で被写体を追尾してもよい。 (2) In the above-described embodiment, the example in which the control device 104 executes the process illustrated in FIG. 4 for a through image and extracts a subject in each frame of the through image has been described. However, the subject may be extracted by executing steps S10 to S30 in FIG. 4 for one still image. Alternatively, the processing of FIG. 4 may be executed for each frame of moving image data composed of a plurality of frames, and a subject may be extracted from each frame constituting the moving image, and the subject may be tracked between the plurality of frames.

(3)上述した実施の形態では、本発明をカメラに適用する場合について説明した。しかしながら、本発明は、画像を撮影することができる他の装置、例えばカメラ付き携帯端末等に適用することも可能である。 (3) In the above-described embodiment, the case where the present invention is applied to a camera has been described. However, the present invention can also be applied to other devices that can take an image, such as a portable terminal with a camera.

なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。また、上述の実施の形態と複数の変形例を組み合わせた構成としてもよい。   Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired. Moreover, it is good also as a structure which combined the above-mentioned embodiment and a some modification.

100 カメラ、101 操作部材、102 レンズ、103 撮像素子、104 制御装置、105 メモリカードスロット、106 モニタ 100 Camera, 101 Operation member, 102 Lens, 103 Image sensor, 104 Control device, 105 Memory card slot, 106 Monitor

Claims (6)

2次元で表した色差空間上で、色差の値に基づいて画像を複数に区分する区分手順と、
前記区分手順で区分した複数の区分ごとに前記画像を2値化して2値化画像を生成する2値化画像生成手順と、
前記2値化画像生成手順で生成した2値化画像に基づいて、前記画像内から被写体を抽出する被写体抽出手順とを有することを特徴とする画像処理方法。
A division procedure for dividing an image into a plurality of images based on a color difference value on a two-dimensional color difference space;
A binarized image generating procedure for binarizing the image for each of a plurality of sections divided by the sectioning procedure to generate a binarized image;
An image processing method comprising: a subject extraction procedure for extracting a subject from the image based on the binarized image generated by the binarized image generation procedure.
請求項1に記載の画像処理方法において、
前記色差空間は、縦軸をCb値、横軸にCr値として2次元で表した色差空間であることを特徴とする画像処理方法。
The image processing method according to claim 1,
2. The image processing method according to claim 1, wherein the color difference space is a color difference space expressed two-dimensionally with a vertical axis representing a Cb value and a horizontal axis representing a Cr value.
請求項2に記載の画像処理方法において、
前記2値化画像生成手順は、Cb値とCr値との大小関係、Cb値の符号、およびCr値の符号に基づいて、前記複数の区分ごとに前記画像を2値化することを特徴とする画像処理方法。
The image processing method according to claim 2,
The binarized image generation procedure binarizes the image for each of the plurality of sections based on the magnitude relationship between the Cb value and the Cr value, the sign of the Cb value, and the sign of the Cr value. Image processing method.
2次元で表した色差空間上で、色差の値に基づいて画像を複数に区分する区分手段と、
前記区分手段によって区分された複数の区分ごとに前記画像を2値化して2値化画像を生成する2値化画像生成手段と、
前記2値化画像生成手段によって生成された2値化画像に基づいて、前記画像内から被写体を抽出する被写体抽出手段とを備えることを特徴とする画像処理装置。
Classification means for dividing an image into a plurality of images based on a color difference value on a two-dimensional color difference space;
Binarized image generating means for binarizing the image for each of a plurality of sections divided by the dividing means to generate a binarized image;
An image processing apparatus comprising: a subject extracting unit that extracts a subject from the image based on the binarized image generated by the binarized image generating unit.
請求項4に記載の画像処理装置において、
前記色差空間は、縦軸をCb値、横軸にCr値として2次元で表した色差空間であることを特徴とする画像処理装置。
The image processing apparatus according to claim 4.
2. The image processing apparatus according to claim 1, wherein the color difference space is a color difference space expressed in two dimensions with a vertical axis representing a Cb value and a horizontal axis representing a Cr value.
請求項5に記載の画像処理装置において、
前記2値化画像生成手段は、Cb値とCr値との大小関係、Cb値の符号、およびCr値の符号に基づいて、前記複数の区分ごとに前記画像を2値化することを特徴とする画像処理装置。
The image processing apparatus according to claim 5.
The binarized image generating means binarizes the image for each of the plurality of sections based on the magnitude relationship between the Cb value and the Cr value, the sign of the Cb value, and the sign of the Cr value. An image processing apparatus.
JP2010242251A 2010-10-28 2010-10-28 Image processing method, and image processing device Pending JP2012094050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010242251A JP2012094050A (en) 2010-10-28 2010-10-28 Image processing method, and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010242251A JP2012094050A (en) 2010-10-28 2010-10-28 Image processing method, and image processing device

Publications (1)

Publication Number Publication Date
JP2012094050A true JP2012094050A (en) 2012-05-17

Family

ID=46387284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010242251A Pending JP2012094050A (en) 2010-10-28 2010-10-28 Image processing method, and image processing device

Country Status (1)

Country Link
JP (1) JP2012094050A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09114985A (en) * 1995-10-20 1997-05-02 Sony Corp Picture processor
JP2008242576A (en) * 2007-03-26 2008-10-09 Murata Mach Ltd Image processing apparatus and method for detecting a background color

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09114985A (en) * 1995-10-20 1997-05-02 Sony Corp Picture processor
JP2008242576A (en) * 2007-03-26 2008-10-09 Murata Mach Ltd Image processing apparatus and method for detecting a background color

Similar Documents

Publication Publication Date Title
JP5246078B2 (en) Object location program and camera
JP4924606B2 (en) Subject extraction method, subject tracking method, image composition method, subject extraction computer program, subject tracking computer program, image composition computer program, subject extraction device, subject tracking device, and image composition device
JP5601407B2 (en) Image classification program, image classification apparatus, and electronic camera
TW201215166A (en) Image capture using luminance and chrominance sensors
JP2010045613A (en) Image identifying method and imaging device
JP5779089B2 (en) Edge detection apparatus, edge detection program, and edge detection method
CN104683634A (en) Determining Apparatus, Mobile Terminal Apparatus, And Recording Medium
JP2011135400A (en) Image processing apparatus and method, and program
CN101827215A (en) From photographic images, extract the filming apparatus in subject zone
JP2011044064A (en) Image processing device and image processing program
CN109151244A (en) Information processing unit, its control method and storage medium
KR20180127913A (en) Image processing apparatus, image processing method, and storage medium
JP5083080B2 (en) Image matching device and camera
JP5691617B2 (en) Subject identification device and subject tracking device
JP2011191860A (en) Imaging apparatus, imaging processing method, and program
JP5573520B2 (en) Image generation apparatus, imaging apparatus, and image generation program
WO2012014946A1 (en) Image processing device and image processing program
JP2005275447A (en) Image processing device, image processing method and program
JP2012039210A (en) Object specification program and camera
JP5381498B2 (en) Image processing apparatus, image processing program, and image processing method
WO2013114884A1 (en) Program for identifying position of subject, device for identifying position of subject, and camera
JP2010200270A (en) Image processing device, camera, and program
JP2012094050A (en) Image processing method, and image processing device
JP5240305B2 (en) Subject identification program and camera
JP5131399B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130809

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140320

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140408

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140902