JP2005159626A - Image focus discrimination, image classification, and image correction - Google Patents

Image focus discrimination, image classification, and image correction Download PDF

Info

Publication number
JP2005159626A
JP2005159626A JP2003393882A JP2003393882A JP2005159626A JP 2005159626 A JP2005159626 A JP 2005159626A JP 2003393882 A JP2003393882 A JP 2003393882A JP 2003393882 A JP2003393882 A JP 2003393882A JP 2005159626 A JP2005159626 A JP 2005159626A
Authority
JP
Japan
Prior art keywords
image
focus
portrait
photographic
photographic image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003393882A
Other languages
Japanese (ja)
Inventor
Yasushi Hiraoka
靖 平岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003393882A priority Critical patent/JP2005159626A/en
Publication of JP2005159626A publication Critical patent/JP2005159626A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology of enhancing the accuracy for focus discrimination when a photo picture is a portrait. <P>SOLUTION: A CPU 11 executes a computer program Pr to allow a portrait discrimination section 30 to discriminate whether or not a photo picture denoted by one image data Dp read from a hard disk drive 14 is a portrait image. When the discrimination indicates that the photo picture is the portrait image, a first processing section 32 applies focus discrimination processing for the portrait to the photo picture. On the other hand, when the portrait discrimination section 30 discriminates that the photo picture is a picture other than the portrait, a second processing section 34 applies focus discrimination processing for non-portrait to the photo picture. The first processing section 32 discriminates how much the focus of the photo picture is matched on the basis of "a skin color possessed by the photo picture and the intensities of luminances edges with respect to edge parts of the photo picture". <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、写真画像のピントがどれほど合っているかを判定する技術と、その技術を用いた画像分類と画像修整の技術に関するものである。   The present invention relates to a technique for determining how much a photographic image is in focus, and an image classification and image correction technique using the technique.

近年、電子スチールカメラ、いわゆるデジタルカメラが開発され、一般に普及している。デジタルカメラで撮影した写真画像は、コンピュータを用いれば、その画像処理ソフトウェアによって容易に加工・編集することができる。これら加工の処理の一つとして、特許文献1に示すように、写真画像の「明るさ」や「シャープネス」等の画質を自動的に修整する処理がある。「シャープネス」を修整する際には、エッジの部分の輝度差を検出することで、その写真画像のピントがどれほど合っているかの判定を行なっている。   In recent years, electronic still cameras, so-called digital cameras, have been developed and are in widespread use. Photo images taken with a digital camera can be easily processed and edited by the image processing software using a computer. As one of these processing processes, there is a process of automatically modifying the image quality such as “brightness” and “sharpness” of a photographic image, as disclosed in Patent Document 1. When correcting “sharpness”, the brightness difference of the edge portion is detected to determine how much the photograph image is in focus.

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

しかしながら、前記従来の技術では、写真画像がポートレートの画像である場合に、ピントがどれほど合っているかを誤って判定することが多かった。ピントがどれほど合っているかの判定は、エッジの部分の画像全体に対する面積比で行なうことが一般的であるために、ポートレートのような人物の狭い部分にピントが合っている写真画像では、面積比が小さいとして、「ピントが合っていない」と誤判定されるためである。   However, in the conventional technique, when the photographic image is a portrait image, it is often erroneously determined how much the image is in focus. Since it is common to determine how much the image is in focus based on the area ratio of the edge part to the entire image, in a photographic image that is in focus on a narrow part of a person such as a portrait, the area is This is because if the ratio is small, it is erroneously determined that “the subject is out of focus”.

本発明の解決しようとする課題は、写真画像がポートレートである場合のピントの判定の精度を向上させることである。   The problem to be solved by the present invention is to improve the accuracy of focus determination when a photographic image is a portrait.

前述した課題の少なくとも一部を解決するための手段として、以下に示す構成をとった。   As means for solving at least a part of the problems described above, the following configuration is adopted.

本発明の画像ピント判定装置は、
写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定装置であって、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備えることを特徴としている。
The image focus determination device of the present invention is
An image focus determination device that performs a focus determination process for determining how much a photograph image is in focus,
Portrait determination means for determining whether the photographic image is a portrait image;
And a first processing unit that applies a first process as the focus determination process prepared in advance exclusively for a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. It is characterized by.

前記構成の画像ピント判定装置によれば、写真画像がポートレートの画像である場合、ポートレート専用のピント判定処理を写真画像に対して施すことができることから、写真画像がポートレートである場合のピント判定の精度を向上させることができる。   According to the image focus determination device having the above-described configuration, when the photographic image is a portrait image, the focus determination process dedicated to the portrait can be performed on the photographic image. The accuracy of focus determination can be improved.

前記画像ピント判定装置において、前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段を備える構成とすることができる。   In the image focus determination device, when the portrait determination unit determines that the image is not a portrait, a second process as the focus determination process prepared in advance for a non-portrait is applied to the photographic image. It can be set as the structure provided with the 2nd processing means to give.

この構成によれば、ポートレートの写真画像とポートレート以外の写真画像とに異なるピント判定処理を施すことで、それぞれの写真画像に適したピント判定を行なうことができる。したがって、写真画像のピント判定の精度を向上することができる。   According to this configuration, it is possible to perform focus determination suitable for each photographic image by performing different focus determination processing on the photographic image of the portrait and the photographic image other than the portrait. Therefore, it is possible to improve the accuracy of photographic image focus determination.

前記第1処理手段は、前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する第1の画素選択手段と、前記第1の画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第1のピント合焦率演算手段とを備える構成とすることができる。   The first processing means is a first pixel that selects a pixel belonging to an edge portion having a skin color and having a luminance difference equal to or greater than a predetermined value from adjacent pixels from among the pixels constituting the photographic image. A first focus for calculating a focus rate indicating how much the photographic image is in focus based on the luminance difference for each pixel selected by the selection means and the first pixel selection means; It can be set as a structure provided with a focal rate calculating means.

前記構成によれば、肌色でエッジ部分に属する各画素の輝度差から、ポートレートのピントがどれほど合っているかを判定することができる。エッジ部分に属する各画素の輝度差から、ピントがどれほど合っているかを判定するだけでは、ポートレートで、主要被写体である「人物」にピントが合わず、背景の方にピントが合っているような写真画像では、「ピントが合っていない」と正確に判定することができなかったが、これに対して、前記構成によれば、肌色かの判定を加えることで、こうした誤判定を防止することができる。   According to the above configuration, it is possible to determine how well the portrait is focused from the luminance difference of each pixel belonging to the edge portion in flesh color. Just by determining how much the focus is based on the brightness difference of each pixel belonging to the edge part, the portrait does not focus on the “person” that is the main subject, but seems to be focused on the background. However, according to the above configuration, it is possible to prevent such misjudgment by adding a skin color determination. be able to.

前記第2処理手段は、前記写真画像を構成する各画素の中から、隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する第2の画素選択手段と、前記写真画素を構成する各画素の総数に対する前記第2の画素選択手段により選択された各画素の合計数の割合を求めて、該割合に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第2のピント合焦率演算手段とを備える構成とすることができる。   The second processing means is a second pixel selection means for selecting a pixel belonging to an edge portion having a luminance difference of a predetermined value or more between adjacent pixels from among the pixels constituting the photographic image; The ratio of the total number of each pixel selected by the second pixel selection unit to the total number of each pixel constituting the photographic pixel is obtained, and based on the ratio, how much the photographic image is in focus is determined. It can be set as the structure provided with the 2nd focus rate calculation means which calculates the focus focus rate shown.

前記構成によれば、非ポートレートの写真画像にあっては、写真画像全体に対するエッジ部分の面積比から、写真画像のピントがどれほど合っているかを判定することができる。ポートレートでない写真画像、例えば風景写真は、一般的にパンフォーカス(画面全体にピントを合わせる)で撮影され、また、森林など細かい描写になる被写体を写すことが多いことから、ピントが合っている領域、エッジが立っている領域ともに広い面積となることが多い。このために、ポートレートでない写真画像においては、エッジ部分の面積比をみることで、ピントが合っているかを正確に判定することができる。   According to the above configuration, in the case of a non-portrait photographic image, it is possible to determine how much the photographic image is in focus from the area ratio of the edge portion to the entire photographic image. Non-portrait photographic images, such as landscape photographs, are usually taken with pan focus (focus on the entire screen), and are often in focus because they often capture subjects that have fine details such as forests. In many cases, both the area and the area where the edge stands are wide. For this reason, in a photographic image that is not a portrait, it is possible to accurately determine whether the image is in focus by looking at the area ratio of the edge portion.

第1処理手段を、前述したように、第1の画像選択手段と第1のピント合焦率演算手段とを備え、かつ、第2処理手段を、前述したように、第2の画像選択手段と第2のピント合焦率演算手段とを備えるようにした構成の画像ピント判定装置において、第1の画像選択手段における所定値より第2の画像選択手段における所定値の方が大きい構成とすることができる。   As described above, the first processing unit includes the first image selection unit and the first focus ratio calculation unit, and the second processing unit includes the second image selection unit as described above. In the image focus determination apparatus configured to include the second focus in-focus ratio calculating unit, the predetermined value in the second image selecting unit is larger than the predetermined value in the first image selecting unit. be able to.

前記構成によれば、ポートレートの写真画像のエッジ部分を確実に選択することができる。ポートレートの場合、被写界深度が浅い写真が多いが、被写界深度が浅いということは、肌色部分全体にピントが合っているとは限らないし、ピントが合っていると見えている部分も、被写界深度の深い非ポートレートの写真画像に比べると、エッジの立ち方が甘い可能性がある。これに対して、前記構成によれば、ポートレートの場合の方がエッジの判定の閾値が小さいことから、ポートレートの写真画像のエッジ部分を確実に選択することが可能となる。   According to the above configuration, the edge portion of the portrait photographic image can be reliably selected. In the case of portraits, there are many photographs with a shallow depth of field, but a shallow depth of field means that the entire skin-colored part is not always in focus, and the part that is visible when in focus However, there is a possibility that the edge is not as good as a non-portrait photographic image with a deep depth of field. On the other hand, according to the above-described configuration, the edge determination threshold is smaller in the portrait case, so that the edge portion of the portrait photographic image can be reliably selected.

前記ポートレート判定手段は、前記写真画像の肌色部分の前記写真画像全体に対する面積比を算出する面積比算出手段と、前記面積比算出手段により算出された面積比に基づいて、前記写真画像がポートレートの画像であるか否かを判定する判定手段とを備える構成とすることができる。   The portrait determination means includes an area ratio calculation means for calculating an area ratio of the skin color portion of the photographic image to the entire photographic image, and the photographic image is a portrait based on the area ratio calculated by the area ratio calculation means. A determination unit that determines whether the image is a rate image can be provided.

ポートレートの写真画像は、人物を中心として撮影されたものであるから、人物の肌部分が写真画像全体に対して大きい面積比となっている。このために、上記構成のように、写真画像の肌色部分の写真画像全体に対する面積比を求めることで、写真画像がポートレートであるか否かを容易に判定することができる。   Since portrait photographic images are taken around a person, the skin area of the person has a large area ratio with respect to the entire photographic image. For this reason, it is possible to easily determine whether or not the photographic image is a portrait by obtaining the area ratio of the skin color portion of the photographic image to the entire photographic image as in the above configuration.

本発明の画像分類装置は、
前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定手段と、
前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する分類手段と
を備え、さらに、
前記画像ピント判定手段は、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備えることを特徴としている。
The image classification device of the present invention is
Image focus determination means for performing a focus determination process for determining how much the focus is in each photographic image;
Classification means for classifying the plurality of photographic images based on a determination result of the focus determination process; and
The image focus determination means includes
Portrait determination means for determining whether the photographic image is a portrait image;
And a first processing unit that applies a first process as the focus determination process prepared in advance exclusively for a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. It is characterized by.

前記構成の画像分類装置によれば、写真画像がポートレートの画像である場合、ポートレート専用のピント判定処理を写真画像に対して施すことができることから、写真画像がポートレートである場合のピント判定の精度を向上させることができる。そうして、この精度の高いピント判定の判定結果に基づいて、写真画像の分類が行なわれることから、分類の精度を向上させることができる。   According to the image classification device having the above-described configuration, when a photographic image is a portrait image, the focus determination process dedicated to the portrait can be performed on the photographic image. The accuracy of determination can be improved. Thus, since the photographic images are classified based on the determination result of the high-accuracy focus determination, the classification accuracy can be improved.

前記画像分類装置において、前記画像ピント判定手段は、前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段を備える構成とすることができる。   In the image classification device, the image focus determination unit is a second process as the focus determination process prepared in advance for a non-portrait when the portrait determination unit determines that the image is not a portrait. Can be configured to include second processing means for applying to the photographic image.

この構成によれば、ポートレートの写真画像とポートレート以外の写真画像とに異なるピント判定処理を施すことで、それぞれの写真画像に適したピント判定を行なうことができる。したがって、写真画像のピント判定の精度を向上して、より分類の精度を向上させることができる。   According to this configuration, it is possible to perform focus determination suitable for each photographic image by performing different focus determination processing on the photographic image of the portrait and the photographic image other than the portrait. Therefore, it is possible to improve the accuracy of classification by improving the accuracy of determining the focus of a photographic image.

前記第1処理手段は、前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する画素選択手段と、前記画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算するピント合焦率演算手段とを備える構成とすることができる。   The first processing means is a pixel selecting means for selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image. A focus focus ratio calculating means for calculating a focus focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the pixel selecting means; can do.

前記構成によれば、肌色でエッジ部分に属する各画素の輝度差から、ポートレートのピントがどれほど合っているかを判定することができる。エッジ部分に属する各画素の輝度差から、ピントがどれほど合っているかを判定するだけでは、ポートレートで、主要被写体である「人物」にピントが合わず、背景の方にピントが合っているような写真画像では、「ピントが合っていない」と正確に判定することができなかったが、これに対して、前記構成によれば、肌色かの判定を加えることで、こうした誤判定を防止することができる。   According to the above configuration, it is possible to determine how well the portrait is focused from the luminance difference of each pixel belonging to the edge portion in flesh color. Just by determining how much the focus is based on the brightness difference of each pixel belonging to the edge part, the portrait does not focus on the “person” that is the main subject, but seems to be focused on the background. However, according to the above configuration, it is possible to prevent such misjudgment by adding a skin color determination. be able to.

本発明の画像修整装置は、
写真画像を修整する画像修整装置であって、
前記写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定手段と、
前記ピント判定処理の判定結果に基づいて、前記写真画像を修整する画像修整手段と
を備え、さらに、
前記画像ピント判定手段は、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備えることを特徴としている。
The image modification device of the present invention is:
An image correction device for correcting a photographic image,
Image focus determination means for performing a focus determination process for determining how much the photographic image is in focus;
Image correction means for correcting the photographic image based on the determination result of the focus determination process, and
The image focus determination means includes
Portrait determination means for determining whether the photographic image is a portrait image;
And a first processing unit that applies a first process as the focus determination process prepared in advance exclusively for a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. It is characterized by.

前記構成の画像修整装置によれば、写真画像がポートレートの画像である場合、ポートレート専用のピント判定処理を写真画像に対して施すことができることから、写真画像がポートレートである場合のピント判定の精度を向上させることができる。そうして、この精度の高いピント判定の判定結果に基づいて、写真画像の修整が行なわれることから、修整の出来ばえを向上させることができる。   According to the image modifying device having the above-described configuration, when the photographic image is a portrait image, the focus determination process dedicated to the portrait can be performed on the photographic image. The accuracy of determination can be improved. Then, since the photographic image is corrected based on the determination result of the high accuracy focus determination, the quality of the correction can be improved.

前記画像修整装置において、前記画像ピント判定手段は、前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段を備える構成とすることができる。   In the image modification device, the image focus determination unit is a second process as the focus determination process prepared in advance for a non-portrait when the portrait determination unit determines that the image is not a portrait. Can be configured to include second processing means for applying to the photographic image.

この構成によれば、ポートレートの写真画像とポートレート以外の写真画像とに異なるピント判定処理を施すことで、それぞれの写真画像に適したピント判定を行なうことができる。したがって、写真画像のピント判定の精度を向上して、より分類の精度を向上させることができる。   According to this configuration, it is possible to perform focus determination suitable for each photographic image by performing different focus determination processing on the photographic image of the portrait and the photographic image other than the portrait. Therefore, it is possible to improve the accuracy of classification by improving the accuracy of determining the focus of a photographic image.

前記第1処理手段は、前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する画素選択手段と、前記画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算するピント合焦率演算手段とを備える構成とすることができる。   The first processing means is a pixel selecting means for selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image. A focus focus ratio calculating means for calculating a focus focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the pixel selecting means; can do.

前記構成によれば、肌色でエッジ部分に属する各画素の輝度差から、ポートレートのピントがどれほど合っているかを判定することができる。エッジ部分に属する各画素の輝度差から、ピントがどれほど合っているかを判定するだけでは、ポートレートで、主要被写体である「人物」にピントが合わず、背景の方にピントが合っているような写真画像では、「ピントが合っていない」と正確に判定することができなかったが、これに対して、上記構成によれば、肌色かの判定を加えることで、こうした誤判定を防止することができる。   According to the above configuration, it is possible to determine how well the portrait is focused from the luminance difference of each pixel belonging to the edge portion in flesh color. Just by determining how much the focus is based on the brightness difference of each pixel belonging to the edge part, the portrait does not focus on the “person” that is the main subject, but seems to be focused on the background. However, according to the above configuration, it is possible to prevent such misjudgment by adding the skin color according to the above configuration. be able to.

本発明の画像ピント判定方法は、
写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定方法であって、
(a)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(b)前記行程(a)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備えることを特徴としている。
The image focus determination method of the present invention includes:
An image focus determination method for performing a focus determination process for determining how much a photograph image is in focus,
(A) a step of determining whether the photographic image is a portrait image;
(B) when it is determined in the step (a) that the image is a portrait, the step of performing a first process as the focus determination process prepared in advance exclusively for the portrait on the photographic image is provided. It is characterized by.

本発明の第1のコンピュータプログラムは、
写真画像のピントがどれほど合っているかを判定するピント判定処理を行なうためのコンピュータプログラムであって、
(a)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(b)前記機能(a)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
をコンピュータに実現させることを特徴としている。
The first computer program of the present invention is:
A computer program for performing a focus determination process for determining how much a photograph image is in focus,
(A) a function of determining whether the photographic image is a portrait image;
(B) When it is determined that the image is a portrait image in the function (a), the computer is provided with a function of applying a first process as the focus determination process prepared in advance exclusively for a portrait to the photographic image. It is characterized by being realized.

本発明の画像ピント判定方法および第1のコンピュータプログラムによっても、本発明の画像ピント判定装置と同様に、写真画像がポートレートである場合のピントの判定の精度を向上させることができるという効果を奏する。   According to the image focus determination method and the first computer program of the present invention, as in the image focus determination apparatus of the present invention, it is possible to improve the accuracy of focus determination when a photographic image is a portrait. Play.

本発明の画像分類方法は、
複数の写真画像を分類する画像分類方法であって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう行程と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する行程と
を備え、さらに、
前記行程(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(a−2)前記行程(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備えることを特徴としている。
The image classification method of the present invention includes:
An image classification method for classifying a plurality of photographic images,
(A) a step of performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) a step of classifying the plurality of photographic images based on a determination result of the focus determination process; and
The step (a)
(A-1) a step of determining whether or not the photographic image is a portrait image;
(A-2) a process of performing, on the photographic image, the first process as the focus determination process prepared in advance for portraits when it is determined in the process (a-1) that the image is a portrait. It is characterized by having and.

本発明の第2のコンピュータプログラムは、
複数の写真画像を分類するためのコンピュータプログラムであって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう機能と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する機能と
をコンピュータに実現させるとともに、
前記機能(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(a−2)前記機能(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
をコンピュータに実現させることを特徴としている。
The second computer program of the present invention is:
A computer program for classifying a plurality of photographic images,
(A) a function for performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) causing the computer to realize a function of classifying the plurality of photographic images based on a determination result of the focus determination process;
The function (a) is:
(A-1) a function of determining whether the photographic image is a portrait image;
(A-2) A function of applying, to the photographic image, a first process as the focus determination process prepared in advance for portrait use when it is determined that the image is a portrait image in the function (a-1). It is characterized in that and are realized on a computer.

本発明の画像分類方法および第2のコンピュータプログラムによっても、本発明の画像分類装置と同様に、写真画像がポートレートである場合のピントの判定の精度を向上させて、写真画像の分類の精度を向上させることができるという効果を奏する。   According to the image classification method and the second computer program of the present invention, as in the image classification apparatus of the present invention, the accuracy of the focus determination when the photographic image is a portrait is improved, and the accuracy of the photographic image classification is improved. The effect that can be improved.

本発明の画素修整方法は、
写真画像を修整する画像修整方法であって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう行程と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する行程と
を備え、さらに、
前記行程(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(a−2)前記行程(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備える画像修整方法。
The pixel correction method of the present invention includes:
An image modification method for modifying a photographic image,
(A) a step of performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) a step of classifying the plurality of photographic images based on a determination result of the focus determination process; and
The step (a)
(A-1) a step of determining whether or not the photographic image is a portrait image;
(A-2) A process of applying, to the photographic image, a first process as the focus determination process prepared in advance for portraits when it is determined in the process (a-1) that the image is a portrait. An image modification method comprising:

本発明の第3のコンピュータプログラムは、
写真画像を修整するためのコンピュータプログラムであって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう機能と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する機能と
をコンピュータに実現させるとともに、
前記機能(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(a−2)前記機能(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
をコンピュータに実現させることを特徴としている。
The third computer program of the present invention is:
A computer program for modifying a photographic image,
(A) a function for performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) causing the computer to realize a function of classifying the plurality of photographic images based on a determination result of the focus determination process;
The function (a) is:
(A-1) a function of determining whether the photographic image is a portrait image;
(A-2) A function of applying, to the photographic image, a first process as the focus determination process prepared in advance for portrait use when it is determined that the image is a portrait image in the function (a-1). It is characterized in that and are realized on a computer.

本発明の画像分類方法および第3のコンピュータプログラムによっても、本発明の画像分類装置と同様に、写真画像がポートレートである場合のピントの判定の精度を向上させて、写真画像の修整の出来ばえを向上させることができるという効果を奏する。   According to the image classification method and the third computer program of the present invention, as in the image classification apparatus of the present invention, the accuracy of determining the focus when the photographic image is a portrait is improved, and the photographic image can be corrected. The effect that can be improved.

この発明の記録媒体は、この発明の第1ないし第3のいずれかのコンピュータプログラムを記録したコンピュータ読み取り可能な記録媒体を特徴としている。この記録媒体は、この発明の各コンピュータプログラムと同様な作用・効果を有している。   The recording medium of the present invention is characterized by a computer-readable recording medium on which any one of the first to third computer programs of the present invention is recorded. This recording medium has the same operation and effect as each computer program of the present invention.

本発明は、以下のような他の態様も含んでいる。その第1の態様は、この発明のコンピュータプログラムを通信経路を介して供給するプログラム供給装置としての態様である。この第1の態様では、コンピュータプログラムをコンピュータネットワーク上のサーバなどに置き、通信経路を介して、必要なプログラムをコンピュータにダウンロードし、これを実行することで、上記の方法や装置を実現することができる。   The present invention includes other aspects as follows. The 1st aspect is an aspect as a program supply apparatus which supplies the computer program of this invention via a communication path. In this first aspect, the above-described method and apparatus are realized by placing a computer program on a server or the like on a computer network, downloading a necessary program to a computer via a communication path, and executing the program. Can do.

本発明を実施するための最良の形態を実施例に基づき説明する。この実施例を、次の順序に従って説明する。
A.装置の構成:
B.コンピュータ処理:
C.作用・効果
D.他の実施形態:
The best mode for carrying out the present invention will be described based on examples. This embodiment will be described in the following order.
A. Device configuration:
B. Computer processing:
C. Action / Effect Other embodiments:

A.装置の構成:
図1は、本発明の一実施例を適用するコンピュータシステムの概略構成を示す説明図である。この実施例のコンピュータシステムは、本発明の画像ピント判定装置を構成するパーソナルコンピュータ10を中心に備え、その周辺装置として、ディスプレイ20とキーボード22とマウス24を備える。さらに、パーソナルコンピュータ10には、デジタルカメラ26とプリンタ28が接続されている。
A. Device configuration:
FIG. 1 is an explanatory diagram showing a schematic configuration of a computer system to which an embodiment of the present invention is applied. The computer system of this embodiment mainly includes a personal computer 10 constituting the image focus determination device of the present invention, and includes a display 20, a keyboard 22, and a mouse 24 as peripheral devices. Furthermore, a digital camera 26 and a printer 28 are connected to the personal computer 10.

パーソナルコンピュータ10は、中央演算処理装置としてのCPU11を中心にバス12により相互に接続されたメモリ13、ハードディスクドライブ14、入力制御部15、表示制御部16等を備える。メモリ13は、各種データ等を記憶するもので、CPU11の作業領域となる。ハードディスクドライブ14は、画像ピント判定装置のソフトウェアとしてのコンピュータプログラムPrを記憶する。また、ハードディスクドライブ14には、デジタルカメラ26によって撮影した写真画像(カラー写真画像)の画像データDpが、多数、格納される。画像データDpは、画像を構成する各画素のR(赤)、G(緑)、B(青)の階調値によって表現されている。   The personal computer 10 includes a memory 13, a hard disk drive 14, an input control unit 15, a display control unit 16, and the like connected to each other by a bus 12 around a CPU 11 as a central processing unit. The memory 13 stores various data and becomes a work area of the CPU 11. The hard disk drive 14 stores a computer program Pr as software for the image focus determination device. The hard disk drive 14 stores a large number of image data Dp of photographic images (color photographic images) taken by the digital camera 26. The image data Dp is represented by gradation values of R (red), G (green), and B (blue) of each pixel constituting the image.

入力制御部15は、キーボード22やマウス24から入力操作を取り込むと共に、デジタルカメラ26から画像データを取り込む制御部である。表示制御部16は、ディスプレイ20への信号出力を制御する制御部である。   The input control unit 15 is a control unit that captures input operations from the keyboard 22 and the mouse 24 and captures image data from the digital camera 26. The display control unit 16 is a control unit that controls signal output to the display 20.

コンピュータプログラムPrは、もともとは、記録媒体としてのCD−ROM(図示せず)に記憶されており、所定のインストールプログラムを起動することで、そのCD−ROMからハードディスクドライブ14にインストールされたものである。このコンピュータプログラムPrをCPU11が実行することにより、本発明の画像ピント判定装置の各種構成要件は実現される。   The computer program Pr is originally stored in a CD-ROM (not shown) as a recording medium, and is installed in the hard disk drive 14 from the CD-ROM by starting a predetermined installation program. is there. When the CPU 11 executes this computer program Pr, various constituent requirements of the image focus determination device of the present invention are realized.

図1では、各種構成要件が、CPU11の内部で実現される機能のブロックによって示されている、すなわち、CPU11は、コンピュータプログラムPrを実行することにより、ハードディスクドライブ14から読み出された一つの画像データDpで示される写真画像がポートレートの画像であるか否かを、ポートレート判定部30により判定して、ポートレートの画像であると判定されたとき、第1処理部32により、前記写真画像に対してポートレート用のピント判定処理を施し、一方、ポートレート判定部30でポートレート以外の画像であると判定されたとき、第2処理部34により、前記写真画像に対して非ポートレート用のピント判定処理を施す。ここで、ピント判定処理とは、写真画像のピントがどれほど合っているかを判定する処理である。   In FIG. 1, various constituent requirements are shown by blocks of functions implemented in the CPU 11, that is, the CPU 11 executes one computer image read from the hard disk drive 14 by executing the computer program Pr. The portrait determination unit 30 determines whether or not the photographic image indicated by the data Dp is a portrait image. When it is determined that the photographic image is a portrait image, the first processing unit 32 determines that the photographic image is a portrait image. The image is subjected to portrait focus determination processing. On the other hand, when the portrait determination unit 30 determines that the image is not a portrait, the second processing unit 34 performs non-portrait on the photographic image. A rate focus determination process is performed. Here, the focus determination process is a process for determining how much the photograph image is in focus.

このコンピュータプログラムPrは、実際は、フォトレタッチ用のアプリケーションプログラムであり、その中の一部のモジュールによって、上述したポートレート判定部30、第1処理部32および第2処理部34の各機能をパーソナルコンピュータ10に実現させる。   This computer program Pr is actually an application program for photo retouching, and the functions of the portrait determination unit 30, the first processing unit 32, and the second processing unit 34 described above are personalized by some of the modules therein. This is realized by the computer 10.

なお、コンピュータプログラムPrは、CD−ROMに替えて、フレキシブルディスク、光磁気ディスク、ICカード等の他の携帯型記録媒体(可搬型記録媒体)に格納された構成として、これらから提供されたものとすることができる。また、このコンピュータプログラムPrは、外部のネットワークに接続される特定のサーバから、ネットワークを介して提供されたものとすることもできる。上記ネットワークとしては、インターネットであってもよく、特定のホームページからダウンロードして得たコンピュータプログラムであってもよい。あるいは、電子メールの添付ファイルの形態で供給されたコンピュータプログラムであってもよい。   The computer program Pr is provided as a configuration stored in another portable recording medium (portable recording medium) such as a flexible disk, a magneto-optical disk, and an IC card in place of the CD-ROM. It can be. Further, the computer program Pr can be provided via a network from a specific server connected to an external network. The network may be the Internet or a computer program obtained by downloading from a specific homepage. Alternatively, it may be a computer program supplied in the form of an email attachment.

B.コンピュータ処理:
コンピュータプログラムPrは、前述したようにフォトレタッチ用のアプリケーションプログラムであることから、前述したポートレート判定部30、第1処理部32、第2処理部34以外にも様々な機能を有する。コンピュータプログラムPrが備えるこれらの機能は、大まかには、3つに分けられる。第1の機能は、ハードディスクドライブ14に格納された複数の画像データDpから、画像修整の対象となる画像データTDpを入力する機能である。この第1の機能には、ポートレート判定部30、第1処理部32、第2処理部34が含まれる。どのように含まれるかは後述する。第2の機能は、第1の機能で入力した画像データTDpに対して画像処理を実行して画像修整を施す機能である。この第2の機能には、画像データTDpの画質を自動的に修整する画像自動修整の機能も含まれる。第3の機能は、画像修整が施された画像データTDpをハードディスクドライブ14に保存したり、プリンタ28から印刷出力する機能である。
B. Computer processing:
Since the computer program Pr is an application program for photo retouching as described above, it has various functions in addition to the portrait determination unit 30, the first processing unit 32, and the second processing unit 34 described above. These functions provided in the computer program Pr are roughly divided into three. The first function is a function for inputting image data TDp to be subjected to image modification from a plurality of image data Dp stored in the hard disk drive 14. The first function includes a portrait determination unit 30, a first processing unit 32, and a second processing unit 34. How it is included will be described later. The second function is a function for executing image processing on the image data TDp input by the first function and performing image modification. This second function includes an automatic image correction function for automatically correcting the image quality of the image data TDp. The third function is a function of saving the image data TDp subjected to the image modification in the hard disk drive 14 or printing out from the printer 28.

この実施例では、上記第1の機能および第2の機能について説明し、第3の機能については、この発明とは関係しないことから説明を省略する。まず、第1の機能について説明する。図2は、この第1の機能を実現するための画像入力ルーチンを示すフローチャートである。このフローチャートは、処理の概要を示すゼネラルフローチャートである。   In this embodiment, the first function and the second function will be described, and the third function will not be described because it is not related to the present invention. First, the first function will be described. FIG. 2 is a flowchart showing an image input routine for realizing the first function. This flowchart is a general flowchart showing an outline of processing.

図示するように、処理が開始されると、パーソナルコンピュータ10のCPU11は、まず、複数の画像データDpのサムネールを、ディスプレイ20に一覧表示する処理を実行する(ステップS100)。詳細には、ディスプレイ20に表示された表示エリアであるアプリケーションウィンドウに、その一覧表示を行なう。   As shown in the figure, when the process is started, the CPU 11 of the personal computer 10 first executes a process of displaying a list of thumbnails of a plurality of image data Dp on the display 20 (step S100). Specifically, the list is displayed in an application window which is a display area displayed on the display 20.

図3は、このアプリケーションウィンドウWDを示す説明図である。アプリケーションウィンドウWDは、グラフィカル・ユーザ・インタフェース(GUI)を構成しており、図示するように、アプリケーションウィンドウWDには、ツールバーFL1と、ファイル指定のフィールドFL2と、作業フィールドFL3とが設けられている。ファイル指定のフィールドFL2は、画像データDpの格納場所を、「フォルダ」や「フィルム」を用いて指定するためのフィールドである。この指定は、作業者によるマウス24の入力操作に従うものである。また、ハードディスクドライブ14は勿論のこと、CD−ROM等の他の記録媒体上の格納場所を指定することができ、デジタルカメラ26の記録媒体を直接指定することもできる。   FIG. 3 is an explanatory diagram showing the application window WD. The application window WD constitutes a graphical user interface (GUI). As shown in the figure, the application window WD is provided with a toolbar FL1, a file designation field FL2, and a work field FL3. . The file designation field FL2 is a field for designating the storage location of the image data Dp using “folder” or “film”. This designation follows the input operation of the mouse 24 by the operator. In addition to the hard disk drive 14, the storage location on other recording media such as a CD-ROM can be specified, and the recording medium of the digital camera 26 can also be specified directly.

作業フィールドFL3は、ファイル選択のフィールドFL2で指定されたファイルまたはフォルダに格納されている画像データをサムネールにて一覧表示するとともに、作業者によるマウス24のクリック操作を受けて、その一覧表示された画像データの中から所望のものを選択するためのフィールドである。この作業フィールドFL3内には、図中に示されている候補用エリアA1と、図には示されていない候補外エリアとが選択的に表示可能となっている。   The work field FL3 displays a list of image data stored in the file or folder designated in the file selection field FL2 in thumbnails, and the list is displayed in response to a click operation of the mouse 24 by the operator. This is a field for selecting a desired one from the image data. In the work field FL3, a candidate area A1 shown in the drawing and a non-candidate area not shown in the drawing can be selectively displayed.

候補用エリアA1とは、この画像入力ルーチンによって入力する画像データの候補となる画像データ(以下、候補画像データと呼ぶ)を一覧表示するための領域である。候補外エリアとは、候補用エリアA1に一旦表示され、その後、後述する作業により候補外に変更された画像データ(以下、候補外画像データと呼ぶ)を一覧表示するための領域である。作業者は、「入力候補」のタブTB1をマウス24によりクリック操作することで、図に示すように、作業フィールドFL3に候補用エリアA1を表示させることができる。また、作業者は、「候補外」のタブTB2をマウス24によりクリック操作することで、作業フィールドFL3の表示を候補用エリアA1から候補外エリアに切り替えることができる。   The candidate area A1 is an area for displaying a list of image data (hereinafter referred to as candidate image data) that are candidates for image data input by the image input routine. The non-candidate area is an area for displaying a list of image data (hereinafter referred to as non-candidate image data) that has been temporarily displayed in the candidate area A1 and then changed to a non-candidate by an operation described later. The operator can cause the candidate area A1 to be displayed in the work field FL3 by clicking on the “input candidate” tab TB1 with the mouse 24 as shown in the figure. Further, the operator can switch the display of the work field FL3 from the candidate area A1 to the non-candidate area by clicking on the “non-candidate” tab TB2 with the mouse 24.

候補用エリアA1には、図示するように、候補画像データのサムネールが表示されるが、ステップS100に処理が移行した最初は、ファイル選択のフィールドFL2で指定されたファイルまたはフォルダに格納されている全ての画像データが候補画像データとして、この候補用エリアA1に表示される。   As shown in the figure, thumbnails of candidate image data are displayed in the candidate area A1, but when the processing moves to step S100, it is stored in the file or folder specified in the file selection field FL2. All the image data is displayed as candidate image data in this candidate area A1.

候補用エリアA1の上部には、「候補外へ」のボタンスイッチBT1が設けられている。このボタンスイッチBT1は、候補用エリアA1に表示された候補画像データを、候補外画像データに切り換える(変更する)旨を指示するためのものである。作業者は、候補用エリアA1に表示された複数の候補画像データの中から不要であると判断したもの(1または複数)を、マウス24を用いてクリック操作することで選択指示して、その後、「候補外へ」のボタンスイッチBT1をクリック操作することで、選択指示された1または複数の候補画像データを、候補外画像データに切り換えることができる。作業者は、こうした候補画像データを候補外画像データに切り替える作業を何度も繰り返し実行することにより、入力の候補となる候補画像を絞り込んでいくことができる。   In the upper part of the candidate area A1, a button switch BT1 “out of candidates” is provided. The button switch BT1 is used to instruct to switch (change) the candidate image data displayed in the candidate area A1 to the non-candidate image data. The worker selects and instructs one or more of the candidate image data displayed in the candidate area A1 determined to be unnecessary by clicking with the mouse 24, and thereafter By clicking the “outside candidate” button switch BT1, one or a plurality of candidate image data instructed to be selected can be switched to non-candidate image data. The operator can narrow down candidate images that are candidates for input by repeatedly performing the operation of switching such candidate image data to non-candidate image data many times.

「候補外へ」のボタンスイッチBT1の右隣には、「ソート」のボタンスイッチBT2が設けられている。「ソート」のボタンスイッチBT2は、候補画像データを画質の良い順に並べ替える旨を指示するためのものである。ここで言う画質の良い順というのは、写真画像のピントに着目したもので、ピントの合焦率が高いものから低いものへという順である。   A “sort” button switch BT2 is provided to the right of the “outside candidate” button switch BT1. The “sort” button switch BT2 is used to instruct to sort the candidate image data in the order of good image quality. The order in which the image quality is good here refers to the focus on the photographic image, and the order from the highest focus ratio to the lowest focus ratio.

図2に戻り、ステップS100の実行後、CPU11は、ソート処理を実行する(ステップS200)。このソート処理は、「ソート」のボタンスイッチBT2が、作業者によりクリック操作されたことを受けて、実行開始されるものである。このソート処理では、候補用エリアA1に表示された複数の候補画像データを画質の良い順(ピントの合焦率が高い順)に並べ替える処理を行なうが、その処理の詳細については後述する。   Returning to FIG. 2, after execution of step S100, the CPU 11 executes sort processing (step S200). This sort process is started when the “sort” button switch BT2 is clicked by the operator. In this sorting process, a plurality of candidate image data displayed in the candidate area A1 are sorted in the order of good image quality (in the order of high focus ratio), the details of which will be described later.

その後、CPU11は、作業者によるマウス24の入力操作に従って、候補用エリアA1内のサムネールを選択して、続いて、「候補外へ」のボタンスイッチBT1のクリック操作を受けて、この選択したサムネールについての画像データを候補外画像データに変更する処理を行なう(ステップS300)。   Thereafter, the CPU 11 selects a thumbnail in the candidate area A1 in accordance with the input operation of the mouse 24 by the operator, and subsequently receives the click operation of the “out of candidate” button switch BT1 to receive the selected thumbnail. A process for changing the image data of the image to the non-candidate image data is performed (step S300).

ステップS300の実行後、CPU11は、候補用エリアA1に表示された複数の候補画像データから最終的な一つの画像を選択する処理を行なう(ステップS400)。この処理は、作業者によるマウス24を用いたクリック操作を受けて指示された画像を選択するものである。   After execution of step S300, the CPU 11 performs a process of selecting one final image from the plurality of candidate image data displayed in the candidate area A1 (step S400). This process selects an instructed image in response to a click operation using the mouse 24 by the operator.

その後、CPU11は、ステップS400で選択された一つの画像に対応する画像データをその格納場所からメモリ上に読み出すとともに、ディスプレイ20に表示する処理を行なう(ステップS500)。詳細には、アプリケーションウィンドウWDの作業フィールドFL3を一旦クリアして、その作業フィールドFL3に上記画像データの表示を行なう。その後、この画像入力ルーチンは終了する。こうした構成の画像入力ルーチンによって、ハードディスクドライブ14等の記録媒体に格納された、画像修整の対象となる画像データTDpを入力する作業が完了する。   Thereafter, the CPU 11 reads out the image data corresponding to the one image selected in step S400 from the storage location to the memory and performs a process of displaying it on the display 20 (step S500). Specifically, the work field FL3 of the application window WD is once cleared, and the image data is displayed in the work field FL3. Thereafter, the image input routine ends. According to the image input routine having such a configuration, the operation of inputting the image data TDp stored in the recording medium such as the hard disk drive 14 and subject to image modification is completed.

図4は、ステップS200で実行されるソート処理の詳細を示すフローチャートである。図示するように、このソート処理に移行すると、CPU11は、まず、「ソート」のボタンスイッチBT2がマウス24によりクリックされたか否かを判定する(ステップS210)。ここで、クリックされていないと判定された場合には、「リターン」に抜けて、このソート処理を一旦終了する。   FIG. 4 is a flowchart showing details of the sort process executed in step S200. As shown in the figure, when shifting to the sorting process, the CPU 11 first determines whether or not the “sort” button switch BT2 has been clicked with the mouse 24 (step S210). If it is determined that the button has not been clicked, the process returns to “return” and the sort process is temporarily terminated.

ステップS210で、「ソート」のボタンスイッチBT2がクリックされたと判定された場合には、ステップS220に処理を進めて、まず、CPU11は、候補用エリアA1に表示されている画像データDpを一つ取り込む処理を行なう。詳細には、候補用エリアA1に表示されているサムネールに対応する一つの画像データDpを、その画像データDpの格納元から読み出す処理を行なう。   If it is determined in step S210 that the “sort” button switch BT2 has been clicked, the process proceeds to step S220. First, the CPU 11 selects one image data Dp displayed in the candidate area A1. Perform the import process. Specifically, a process of reading one image data Dp corresponding to the thumbnail displayed in the candidate area A1 from the storage source of the image data Dp is performed.

次いで、CPU11は、ステップS220で取り込んだ画像データDpで示される写真画像のピントがどれほど合っているかを判定する画像ピント判定処理を実行する(ステップS230)。この画像ピント判定処理の詳細な内容については後述するが、この処理によって、上記写真画像のピントがどれほど合っているかを示すピント合焦率FSが求められることになる。   Next, the CPU 11 executes an image focus determination process for determining how much the photograph image indicated by the image data Dp captured in step S220 is in focus (step S230). The detailed contents of this image focus determination process will be described later, and by this process, a focus in-focus ratio FS indicating how much the photographic image is in focus is obtained.

その後、CPU11は、ステップS230で求められたピント合焦率FSを、ステップS220で取り込んだ画像データDpのソートキーとして、メモリ13内のソートキーテーブルに記憶する(ステップS240)。続いて、CPU11は、ステップS220で取り込んだ画像データDpが、候補用エリアA1に表示されている画像データDpの中で最終のものか否かを判定する(ステップS250)。ここで、最終のものでないと判定されると、ステップS220に処理を戻して、候補用エリアA1に表示されている複数の画像データの中から次の画像データを取り込んで、この画像データについてステップS220ないしS250の処理を繰り返し実行する。   Thereafter, the CPU 11 stores the focus ratio FS obtained in step S230 in the sort key table in the memory 13 as the sort key of the image data Dp captured in step S220 (step S240). Subsequently, the CPU 11 determines whether or not the image data Dp captured in step S220 is the final image data Dp displayed in the candidate area A1 (step S250). If it is determined that it is not the final one, the process returns to step S220, the next image data is fetched from the plurality of image data displayed in the candidate area A1, and the step is performed for this image data. The processes from S220 to S250 are repeatedly executed.

一方、ステップS250で、最終の画像データであると判定された場合には、ステップS260に処理を進める。ステップS260では、ステップS240でソートキーテーブルに格納されたソートキーを用いて、候補用エリアA1に表示されている画像データの表示を、そのソートキーの順に並べ替える処理を実行する。ソートキーは、ピント合焦率FSの値がそのまま用いられていることから、写真画像のピントがよく合っているほど大きな値となっている。したがって、上記の並べ替えの処理により、候補用エリアA1内の画像データは、ピントがよく合っている順に並べ替えられることになる。   On the other hand, if it is determined in step S250 that the image data is final, the process proceeds to step S260. In step S260, using the sort key stored in the sort key table in step S240, a process of rearranging the display of the image data displayed in the candidate area A1 in the order of the sort key is executed. Since the value of the focus in-focus ratio FS is used as it is, the sort key has a larger value as the photographic image is in focus. Therefore, the image data in the candidate area A1 are rearranged in the order in which they are in focus by the above rearrangement process.

ステップS260の実行後、CPU11は、「リターン」に処理を進めて、このソート処理を一旦終了する。   After executing step S260, the CPU 11 advances the process to “return” and once ends this sort process.

図5は、図4のステップS230で実行される画像ピント判定処理の詳細を示すフローチャートである。図示するように、この画像ピント判定処理のルーチンに処理が移行すると、CPU11は、まず、ポートレート判定処理を実行する(ステップS232)。このポートレート判定処理は、ステップS220で取り込んだ画像データDpで示される写真画像がポートレートの画像であるか否かを判定する処理で、前述したポートレート判定部30の機能を実現するためのものである。   FIG. 5 is a flowchart showing details of the image focus determination process executed in step S230 of FIG. As shown in the figure, when the processing shifts to this image focus determination processing routine, the CPU 11 first executes a portrait determination processing (step S232). This portrait determination process is a process for determining whether or not the photographic image indicated by the image data Dp captured in step S220 is a portrait image, and for realizing the function of the portrait determination unit 30 described above. Is.

図6は、ポートレート判定処理の詳細を示すフローチャートである。図示するように、このポートレート判定処理のルーチンに処理が移行すると、CPU11は、まず、ステップS220で取り込んだ画像データDpのサイズを所定値以下のサイズに縮小する処理を行なう(ステップS600)。この縮小処理は、画像データDpを構成する画素(ピクセル)を単純に間引きする単純間引き処理法、隣接する画素との間で色を平均化してから間引きを行なう色平均化処理法等の周知の種々の処理法で実現することができる。画像データDpのサイズが大きすぎる場合、以後の判定処理に要する処理時間が長くなるだけで、縮小しても判定結果に大きな差が生じないことから、縮小するようにした。上記所定値としては、例えば、縦、横それぞれ1000ピクセルのサイズである。なお、画像サイズが、所定値のサイズに満たない場合には、縮小処理は行なわない。   FIG. 6 is a flowchart showing details of the portrait determination process. As shown in the figure, when the process proceeds to the portrait determination process routine, the CPU 11 first performs a process of reducing the size of the image data Dp captured in step S220 to a size equal to or smaller than a predetermined value (step S600). This reduction processing is a well-known method such as a simple thinning processing method in which pixels (pixels) constituting the image data Dp are simply thinned, and a color averaging processing method in which thinning is performed after averaging colors with adjacent pixels. It can be realized by various processing methods. When the size of the image data Dp is too large, only the processing time required for the subsequent determination process is increased, and even if the image data Dp is reduced, there is no significant difference in the determination result. The predetermined value is, for example, a size of 1000 pixels in the vertical and horizontal directions. If the image size is less than a predetermined value, the reduction process is not performed.

ステップS600で縮小された画像データDpもしくは所定値サイズ以下で縮小のなされていないそのままの画像データDpを、以後、対象画像データDxと呼ぶ。なお、この実施例では、前述したように処理時間の短縮化のために、画像データDpに縮小処理を施したが、縮小処理を施さない構成として、画像データDpをそのまま対象画像データDxとすることもできる。   The image data Dp that has been reduced in step S600 or the image data Dp that has not been reduced to a predetermined size or less is hereinafter referred to as target image data Dx. In this embodiment, as described above, the reduction processing is performed on the image data Dp in order to shorten the processing time. However, as a configuration in which the reduction processing is not performed, the image data Dp is directly used as the target image data Dx. You can also.

ステップS600の実行後、CPU11は、3つの変数TS、TH、Nを値0にクリアする処理を行なう(ステップS610)。変数TSは、対象画像データDxの総ピクセル(画素)数をカウントするための変数であり、変数THは、対象画像データDxの肌色ピクセル数をカウントするための変数である。変数Nは、対象画像データDxの縦方向の位置を示すための変数である。   After execution of step S600, the CPU 11 performs processing for clearing the three variables TS, TH, and N to 0 (step S610). The variable TS is a variable for counting the total number of pixels (pixels) of the target image data Dx, and the variable TH is a variable for counting the number of skin color pixels of the target image data Dx. The variable N is a variable for indicating the vertical position of the target image data Dx.

その後、CPU11は、対象画像データDxの横方向の位置を示すための変数Mを値0にクリアする。続いて、CPU11は、対象画像データDxの変数M、Nで位置が定まる画素(以下、対象画素と呼ぶ)P(M,N)についてのR、G、Bの各階調値(RGB値)を取得して(ステップS630)、そのRBG値をYCbCr値に変換する(ステップS640)。RBG値からYCbCr値への変換は、テレビジョンなどの場合に利用されている次式(1)〜(3)の変換式を用いて行なう。   Thereafter, the CPU 11 clears the variable M for indicating the position of the target image data Dx in the horizontal direction to a value of 0. Subsequently, the CPU 11 determines the R, G, and B gradation values (RGB values) for the pixel P (M, N) whose position is determined by the variables M and N of the target image data Dx (hereinafter referred to as the target pixel). Obtaining (step S630), the RBG value is converted into a YCbCr value (step S640). The conversion from the RBG value to the YCbCr value is performed using the following conversion formulas (1) to (3) used in the case of a television or the like.

Y=0.30R+0.59G+0.11B ...(1)
Cr=R−Y ...(2)
Cb=B−Y ...(3)
Y = 0.30R + 0.59G + 0.11B (1)
Cr = R−Y (2)
Cb = BY (3)

その後、CPU11は、ステップS640で求められた色差Cb、Crを用いて、対象画素P(M,N)が人物の肌色であるか否かを判定する(ステップS650)。この判定は、色差Cb、Crが、以下の関係式(4)を満たすか否かから行なう。   Thereafter, the CPU 11 determines whether or not the target pixel P (M, N) is a person's flesh color using the color differences Cb and Cr obtained in step S640 (step S650). This determination is made based on whether or not the color differences Cb and Cr satisfy the following relational expression (4).

−2.40625(Cr−8)≦Cb≦−0.77419(Cr−8) ...(4) -2.4625 (Cr-8) ≦ Cb ≦ −0.77419 (Cr-8) (4)

関係式(4)は、日本人女性のポートレートを多数集め、肌部分の統計をとった結果、得られた関係式である。対象画素P(M,N)が関係式(4)を満たすと判定されたとき、対象画素P(M,N)は肌色であると判定される。なお、関係式(4)は、上記の数値に限る必要もなく、人種とか対象とする肌色により多少の変化はある。   Relational expression (4) is a relational expression obtained as a result of collecting a large number of portraits of Japanese women and taking statistics on the skin part. When it is determined that the target pixel P (M, N) satisfies the relational expression (4), the target pixel P (M, N) is determined to be a skin color. The relational expression (4) is not necessarily limited to the above numerical values, and there are some changes depending on the race and the skin color to be targeted.

ステップS650で、対象画素P(M,N)が肌色であると判定されると、CPU11は、肌色ピクセル数を示す変数THを値1だけインクリメントする(ステップS660)。その後、CPU11は、総ピクセル数を示す変数TSを値1だけインクリメントする(ステップS670)。なお、ステップS650で、対象画素P(M,N)が肌色でないと判定されると、ステップS660を飛ばして、ステップS670で、総ピクセル数を示す変数TSだけインクリメントする。   If it is determined in step S650 that the target pixel P (M, N) is a flesh color, the CPU 11 increments the variable TH indicating the number of flesh color pixels by a value 1 (step S660). Thereafter, the CPU 11 increments the variable TS indicating the total number of pixels by the value 1 (step S670). If it is determined in step S650 that the target pixel P (M, N) is not a skin color, step S660 is skipped, and in step S670, the variable TS indicating the total number of pixels is incremented.

変数TH、TSをインクリメントしていくことで肌色ピクセル数と総ピクセル数を集計する集計処理を、対象画像データDxの全体に対して行なうには、図7に示すように、処理を施す対象画素P(M,N)を左端から右端へ横方向に走査して、次いで縦方向に1段下げて、左端から右端へ横方向に走査して、続いて、縦方向に1段下げるということを繰り返すことで、対象画像データDxを構成する全てのピクセルを対象画素P(M,N)として、ステップS630ないしS670の処理を施す必要がある。そこで、CPU11は、対象画像データDxの横方向の位置を示すための変数Mを値1だけインクリメントして(ステップS680)、その変数Mが、対象画像データDxの右端位置を示す定数Mmaxを越えたか否かを判定する(ステップS690)。ここで、越えていないと判定された場合には、ステップS630に処理を戻して、右横方向に1つだけずらした対象画素P(M,N)に対する処理を実行する。   In order to perform the totaling process for totalizing the number of skin color pixels and the total number of pixels by incrementing the variables TH and TS on the entire target image data Dx, as shown in FIG. P (M, N) is scanned laterally from the left end to the right end, then lowered by one step in the vertical direction, scanned laterally from the left end to the right end, and then lowered by one step in the vertical direction. By repeating, it is necessary to perform the processing of steps S630 to S670 with all the pixels constituting the target image data Dx as the target pixel P (M, N). Therefore, the CPU 11 increments the variable M for indicating the horizontal position of the target image data Dx by a value 1 (step S680), and the variable M exceeds the constant Mmax indicating the right end position of the target image data Dx. It is determined whether or not (step S690). Here, if it is determined that the value does not exceed, the process returns to step S630 to execute the process for the target pixel P (M, N) shifted by one in the right lateral direction.

一方、ステップS690で、変数Mが定数Mmaxを越えたと判定されたときには、対象画像データDxの縦方向の位置を示すための変数Nを値1だけインクリメントして(ステップS692)、その変数Nが、対象画像データDxの下端位置を示す定数Nmaxを越えたか否かを判定する(ステップS694)。ここで、越えていないと判定された場合には、ステップS620に処理を戻して、縦下方向に1つだけずらした(横方向は左端に移行した)対象画素P(M,N)に対する処理を実行する。   On the other hand, when it is determined in step S690 that the variable M has exceeded the constant Mmax, the variable N for indicating the vertical position of the target image data Dx is incremented by 1 (step S692). Then, it is determined whether or not a constant Nmax indicating the lower end position of the target image data Dx has been exceeded (step S694). If it is determined that the value does not exceed, the process returns to step S620 to process the target pixel P (M, N) shifted by one in the vertical downward direction (the horizontal direction has shifted to the left end). Execute.

ステップS694で、変数Nが定数Nmaxを越えたと判定されたときには、対象画像データDxを構成する全てのピクセルに対して前記集計処理が終了したとして、CPU11は、ステップS696に処理を進める。ステップS696では、ステップS660で算出された肌色ピクセル数を示す変数THを、総ピクセル数を示す変数TSで除算することにより、総ピクセル数に対する肌色ピクセル数の割合を求めて、その割合(=TH/TS)が値0.1以上であるか否かを判定する(ステップS696)。   When it is determined in step S694 that the variable N has exceeded the constant Nmax, the CPU 11 advances the process to step S696, assuming that the aggregation process has been completed for all pixels constituting the target image data Dx. In step S696, the variable TH indicating the number of flesh color pixels calculated in step S660 is divided by the variable TS indicating the total number of pixels to obtain the ratio of the number of flesh color pixels to the total number of pixels, and the ratio (= TH It is determined whether or not (TS) is greater than or equal to 0.1 (step S696).

ステップS696で肯定判定されたとき、すなわち、画像内の肌色の領域の面積比が1割以上であると判定された場合には、画像データDpで示される画像はポートレートであるとして、ポートレート判定フラグFに値1をセットする(ステップS698)。一方、ステップS696で否定判定されたとき、すなわち、画像内の肌色の領域の面積比が1割未満であると判定された場合には、画像データDpで示される画像はポートレート以外の風景写真等の画像であるとして、ポートレート判定フラグFに値0をセットする(ステップS699)。ステップS698またはS699の実行後、「リターン」に抜けてこのポートレート判定処理を一旦終了する。   When an affirmative determination is made in step S696, that is, when it is determined that the area ratio of the skin color region in the image is 10% or more, the image indicated by the image data Dp is assumed to be a portrait, and the portrait A value 1 is set to the determination flag F (step S698). On the other hand, when a negative determination is made in step S696, that is, when the area ratio of the skin color region in the image is determined to be less than 10%, the image indicated by the image data Dp is a landscape photograph other than a portrait. For example, the value 0 is set in the portrait determination flag F (step S699). After executing step S698 or S699, the process returns to “RETURN” to end the portrait determination process.

以上のようにして、画像データDpがポートレートであるか否かが判定されるが、この判定の手法のように、必ずしも、肌色領域の面積比からポートレートを判定する必要もなく、例えば、肌色領域のエッジの形状から判定する等、他の方法によってポートレートであるか否かを判定する構成としてもよい。また、上記肌色領域の面積比の判定値は、前述した1割に限る必要もなく、これに換えて、0.9割、1.2割等、種々の値とすることができる。   As described above, it is determined whether or not the image data Dp is a portrait. However, unlike this determination method, it is not always necessary to determine the portrait from the area ratio of the skin color region. It is good also as a structure which determines whether it is a portrait by other methods, such as determining from the shape of the edge of a skin color area | region. Further, the determination value of the area ratio of the skin color region need not be limited to 10% described above, and can be set to various values such as 0.9% and 1.2% instead.

図5に戻って、ステップS232のポートレート判定処理を抜けると、次いで、CPU11は、ポートレート判定処理の判定結果を示すポートレート判定フラグFが値1であるか否かを判定する(ステップS234)。すなわち、画像データDpで示される画像がポートレートの画像であるか否かを判定する。ここで、ポートレート判定フラグFが値1でない、すなわち、ポートレート以外の画像であると判定されると、非ポートレート用ピント合焦率算出処理を実行し(ステップS236)、一方、ポートレート判定フラグFが値1である、すなわち、ポートレートの画像であると判定されると、ポートレート用ピント合焦率算出処理を実行する(ステップS238)。ステップS236またはS238の実行後、「リターン」に抜けてこの画像ピント判定処理を一旦終了する。   Returning to FIG. 5, after exiting the portrait determination process of step S232, the CPU 11 then determines whether or not the portrait determination flag F indicating the determination result of the portrait determination process is 1 (step S234). ). That is, it is determined whether or not the image indicated by the image data Dp is a portrait image. Here, if it is determined that the portrait determination flag F is not a value 1, that is, an image other than the portrait, a non-portrait focus in-focus ratio calculation process is executed (step S236). If it is determined that the determination flag F is 1, that is, a portrait image, portrait focus ratio calculation processing is executed (step S238). After executing step S236 or S238, the process returns to “RETURN” to end the image focus determination process once.

ピント合焦率算出処理は、写真画像のピントがどの程度合っているかを示すパラメータであるピント合焦率FSを算出する処理である。ピントがどの程度合っているかを判定するには、次の2通りが考えられる。第1の判定方法は、「エッジ部分の面積比」によってピントがどの程度合っているかを判定する方法である。写真画像内のエッジ部分を検出して、写真画像の総面積に対するエッジ部分の面積の割合(面積比)を演算して、その面積比が所定値以上である場合には、その写真画像はピントが合っているとした。面積比が大きいほど、ピントがよく合っているとして、ピントがどの程度合っているかを判定する。   The focus ratio calculation process is a process of calculating a focus ratio FS that is a parameter indicating how much the photographic image is focused. The following two ways can be considered to determine the degree of focus. The first determination method is a method for determining how much the focus is achieved based on the “area ratio of the edge portion”. The edge portion in the photographic image is detected, the ratio (area ratio) of the edge portion to the total area of the photographic image is calculated, and if the area ratio is greater than or equal to a predetermined value, the photographic image is in focus. It is said that is suitable. As the area ratio is larger, it is determined that the focus is good, and the degree of focus is determined.

第2の判定方法は、「エッジ部分のエッジの強さ」によってピントがどの程度合っているかを判定する方法である。写真画像内のエッジ部分を検出して、そのエッジ部分の中でエッジの強さがどのような分布にあるかを検出して、その分布からピントが合っているかを判定する。エッジの強さが、より強い方に多く分布しているほど、ピントがよく合っているとして、ピントがどの程度合っているかを判定する。   The second determination method is a method for determining how much the focus is achieved based on the “edge strength of the edge portion”. An edge portion in the photographic image is detected, and the distribution of the strength of the edge in the edge portion is detected, and it is determined from the distribution whether the focus is in focus. The more the edge strength is distributed in the stronger direction, the better the focus is, and the degree of focus is determined.

図8および図9は、ステップS236で実行される非ポートレート用ピント合焦率算出処理の詳細を示すフローチャートである。この非ポートレート用ピント合焦率算出処理は、前述した第1の判定方法によりピント合焦率FSを算出するもので、前述した第2処理部34の機能を実現するためのものである。   8 and 9 are flowcharts showing details of the non-portrait focus in-focus ratio calculation process executed in step S236. This non-portrait focus focus rate calculation process calculates the focus focus rate FS by the first determination method described above, and is for realizing the function of the second processing unit 34 described above.

図示するように、この非ポートレート用ピント合焦率算出処理は、図6に示すポートレート判定処理と似通った部分が多い。図8、図9におけるステップS700、S720、S730、S770〜S794は、図6におけるステップS600、S620、S630、S670〜S694とそれぞれ同一である。   As shown in the figure, this non-portrait focus focus ratio calculation process has many parts similar to the portrait determination process shown in FIG. Steps S700, S720, S730, and S770 to S794 in FIGS. 8 and 9 are the same as steps S600, S620, S630, and S670 to S694 in FIG.

図8に示すように、CPU11は、ステップS710では、3つの変数TS、TE、Nを値0にクリアする処理を行なう。変数TS、Nは、ポートレート判定処理で用いたものと同一である。変数TEは、対象画像データDxで示される画像内のエッジ部分のピクセル数をカウントするための変数である。   As shown in FIG. 8, in step S710, the CPU 11 performs a process of clearing the three variables TS, TE, and N to the value 0. The variables TS and N are the same as those used in the portrait determination process. The variable TE is a variable for counting the number of pixels at the edge portion in the image indicated by the target image data Dx.

ステップS740では、ステップS730で取得したRGB値から対象画素P(M,N)の輝度Yを算出する処理を行なう。この算出処理は、前述した式(1)に従うものである。   In step S740, a process of calculating the luminance Y of the target pixel P (M, N) from the RGB values acquired in step S730 is performed. This calculation process follows the above-described equation (1).

ステップS740の実行後、その対象画素P(M,N)の周辺の4つの画素について、それぞれ、ステップS730とステップS740と同様に、RGB値を取得して、そのRGB値から輝度Y1〜Y4を算出する(ステップS742)。ここで、周辺の4つの画素とは、上下左右の4方向に隣接する4近傍の画素である。   After execution of step S740, RGB values are acquired for the four pixels around the target pixel P (M, N), respectively, as in steps S730 and S740, and luminances Y1 to Y4 are obtained from the RGB values. Calculate (step S742). Here, the peripheral four pixels are pixels in the vicinity of four adjacent in four directions, up, down, left, and right.

続いて、CPU11は、ステップS740で求めた対象画素P(M,N)の輝度Yに対する4近傍の各画素の輝度Y1〜Y4の偏差の絶対値dY1〜dY4を、次式(5)〜(8)を用いて算出する処理を行なう(ステップS744)。   Subsequently, the CPU 11 obtains absolute values dY1 to dY4 of deviations of the luminances Y1 to Y4 of the four neighboring pixels with respect to the luminance Y of the target pixel P (M, N) obtained in step S740 by the following equations (5) to (5): 8) is performed (step S744).

dY1=|Y1−Y| ...(5)
dY2=|Y2−Y| ...(6)
dY3=|Y3−Y| ...(7)
dY4=|Y4−Y| ...(8)
dY1 = | Y1-Y | (5)
dY2 = | Y2-Y | (6)
dY3 = | Y3-Y | (7)
dY4 = | Y4-Y | (8)

その後、CPU11は、ステップS744で算出された絶対値(以下、輝度差と呼ぶ)dY1〜dY4の最大値dYmaxを演算する(ステップS746)。ステップS742ないしS746の処理の結果、対象画素P(M,N)の周辺4近傍の画素の中で、対象画素P(M,N)に対して最も輝度差が大きい部分の輝度差が得られることになる。なお、周辺4近傍の画素に換えて、対象画素P(M,N)の周辺8近傍の画素の中で、対象画素P(M,N)に対して最も輝度差が大きい部分の輝度差を求める構成としてもよい。   Thereafter, the CPU 11 calculates the maximum value dYmax of the absolute values (hereinafter referred to as luminance differences) dY1 to dY4 calculated in step S744 (step S746). As a result of the processing in steps S742 to S746, the luminance difference of the portion having the largest luminance difference with respect to the target pixel P (M, N) is obtained among the pixels near the target pixel P (M, N). It will be. It should be noted that, in place of the pixels in the vicinity of the peripheral 4, the luminance difference of the portion having the largest luminance difference with respect to the target pixel P (M, N) among the pixels in the vicinity of the peripheral 8 of the target pixel P (M, N) It is good also as a structure to require.

ステップS746の実行後、ステップS746で求めた最大値dYmaxが所定値E0以上であるか否かを判定する(ステップS750)。所定値E0は、エッジ部分と判断するための輝度差であり、予め定められた値である。ここで、最大値dYが所定値E0以上であると判断された場合には、対象画素P(M,N)はエッジ部分であるとして、CPU11は、ステップS760に処理を進めて、エッジ部分のピクセル数を示す変数TEを値1だけインクリメントする。一方、ステップS750で、対象画素P(M,N)がエッジ部分でないと判定された場合には、ステップS760の処理は実行しない。   After execution of step S746, it is determined whether or not the maximum value dYmax obtained in step S746 is equal to or greater than a predetermined value E0 (step S750). The predetermined value E0 is a luminance difference for determining an edge portion, and is a predetermined value. Here, when it is determined that the maximum value dY is equal to or greater than the predetermined value E0, the target pixel P (M, N) is assumed to be an edge portion, and the CPU 11 advances the processing to step S760 to determine the edge portion. A variable TE indicating the number of pixels is incremented by a value of 1. On the other hand, if it is determined in step S750 that the target pixel P (M, N) is not an edge portion, the process of step S760 is not executed.

図9のステップS794で肯定判別されると、対象画像データDxを構成する全ての画素に対して、エッジ部分のピクセル数を示す変数TEと総ピクセル数を示す変数TSをカウントする集計が終了したとして、CPU11は、ステップS796に処理を進める。ステップS796では、ステップS760で算出されたエッジ部分のピクセル数を示す変数TEを、ステップS770で算出された総ピクセル数を示す変数TSで除算することにより、総ピクセル数に対するエッジ部分のピクセル数の割合を求めて、その割合(=TE/TS)に係数R1を乗算することにより、ピント合焦率FSを求める。係数R1は、ピクセル数の割合をピント合焦率FSに変換するための数値調整用の係数であり、予め定められた値である。ステップS796の実行後、「リターン」に抜けてこの非ポートレート用ピント合焦率算出処理を一旦終了する。   When an affirmative determination is made in step S794 in FIG. 9, the counting for counting the variable TE indicating the number of pixels of the edge portion and the variable TS indicating the total number of pixels is completed for all the pixels constituting the target image data Dx. As a result, the CPU 11 advances the process to step S796. In step S796, by dividing the variable TE indicating the number of pixels of the edge portion calculated in step S760 by the variable TS indicating the total number of pixels calculated in step S770, the number of pixels of the edge portion relative to the total number of pixels is calculated. The ratio is calculated, and the ratio (= TE / TS) is multiplied by the coefficient R1 to determine the focus ratio FS. The coefficient R1 is a numerical adjustment coefficient for converting the ratio of the number of pixels into the focus ratio FS, and is a predetermined value. After the execution of step S796, the process returns to “return” to end the non-portrait focus focus ratio calculation process once.

こうした構成の非ポートレート用ピント合焦率算出処理は、前述した第1の判定方法に該当し、「エッジ部分の面積比」によってピントがどの程度合っているかを判定している。   The non-portrait focus focus ratio calculation process having such a configuration corresponds to the first determination method described above, and determines how much the focus is achieved based on the “area ratio of the edge portion”.

ポートレートでない写真画像は、「エッジ部分の面積比」からピントがどの程度合っているかを判定するのが好ましい。ポートレートでない写真画像、例えば風景写真は、一般的にパンフォーカスで撮影され、また、森林など細かい描写になる被写体を写すことが多いことから、ピントが合っている領域、エッジが立っている領域ともに広い面積となることが多い。このために、ポートレートでない写真画像においては、エッジ部分の面積比をみることで、ピントが合っているかを正確に判定することができる。   For a photographic image that is not a portrait, it is preferable to determine the degree of focus from the “area ratio of the edge portion”. Non-portrait photographic images, such as landscape photographs, are generally shot with pan focus, and often include subjects that are finely depicted, such as forests. Both are often large areas. For this reason, in a photographic image that is not a portrait, it is possible to accurately determine whether the image is in focus by looking at the area ratio of the edge portion.

一方、ポートレートの写真画像においては、一般的に人物(特に顔)を大きく、背景をぼかして撮影される。顔は細かい描写の部分が少なく、また近接撮影がなされる。このため、ピントが合っている領域、エッジが立っている領域ともに非常に狭い面積となることが多い。したがって、ポートレートの写真画像においては、エッジ部分の面積比をみる構成とすると、ピントが合っている画像であっても「ピントが合っていない」と誤って判定することになる。この実施例では、「エッジ部分の面積比」によってピント判定を行なうステップS236の処理を、非ポートレートの写真画像に限定することで、上記のようなポートレートにおける誤判定を回避している。   On the other hand, portrait photographic images are generally taken with a large person (especially a face) and a blurred background. The face has few details and close-up photography. For this reason, both the in-focus area and the edge-standing area often have very narrow areas. Accordingly, in a portrait photographic image, if the area ratio of the edge portion is viewed, even if the image is in focus, it is erroneously determined that the image is out of focus. In this embodiment, the above-described erroneous determination in the portrait is avoided by limiting the processing in step S236 for performing the focus determination based on the “area ratio of the edge portion” to the non-portrait photographic image.

図10および図11は、ステップS238で実行されるポートレート用ピント合焦率算出処理の詳細を示すフローチャートである。このポートレート用ピント合焦率算出処理は、前述した第2の判定方法を改良した方法によりピント合焦率FSを算出するものであり、前述した第1処理部32の機能を実現するためのものである。   FIG. 10 and FIG. 11 are flowcharts showing details of the portrait focus rate calculation process executed in step S238. This portrait focus ratio calculation process calculates the focus ratio FS by an improvement of the second determination method described above, and is for realizing the function of the first processing unit 32 described above. Is.

図示するように、このポートレート用ピント合焦率算出処理は、図8、図9に示す非ポートレート用ピント合焦率算出処理と似通った部分が多い。図10、図11におけるステップS800、S820〜S850、S860、S880〜S894は、図8、図9におけるステップS700、S720〜S750、S760、S780〜S794とそれぞれ同一である。   As shown in the figure, this portrait focus focus ratio calculation process has many parts that are similar to the non-portrait focus focus ratio calculation process shown in FIGS. Steps S800, S820 to S850, S860, and S880 to S894 in FIGS. 10 and 11 are the same as steps S700, S720 to S750, S760, and S780 to S794 in FIGS.

図10に示すように、CPU11は、ステップS810では、3つの変数TE、IE、Nを値0にクリアする処理を行なう。変数TE、Nは、非ポートレート用ピント合焦率算出処理で用いたものと同一である。変数IEは、エッジ部分のエッジの強さの合計をカウントするための変数である。   As shown in FIG. 10, in step S810, the CPU 11 performs a process of clearing the three variables TE, IE, and N to 0. The variables TE and N are the same as those used in the non-portrait focus focus ratio calculation process. The variable IE is a variable for counting the total edge strength of the edge portion.

ステップS850で最大値dYが所定値E0以上であると判断された場合には、対象画素P(M,N)はエッジ部分であるとして、CPU11は、ステップS852に処理を進める。ステップS852では、CPU11は、対象画素P(M,N)が人物の肌色であるか否かを判定する。この判定処理は、ポートレート判定処理のステップS650と同一の処理である。   If it is determined in step S850 that the maximum value dY is equal to or greater than the predetermined value E0, the CPU 11 proceeds to step S852, assuming that the target pixel P (M, N) is an edge portion. In step S852, the CPU 11 determines whether or not the target pixel P (M, N) is a human skin color. This determination process is the same process as step S650 of the portrait determination process.

なお、この実施例では、ステップS750とステップS850を同一の処理としていたが、これに換えて、最大値dYmaxと比較を行なう所定値E0を、ステップS750での値よりもステップS850での値を小さくする構成とすることができる。すなわち、ステップS750では、最大値dYmaxが所定値E01以上であるか否かを判定する処理を行ない、ステップS850では、最大値dYmaxが、上記所定値E01より小さい値である所定値E02以上であるか否かを判定する処理を行なう構成とする。   In this embodiment, step S750 and step S850 are the same processing, but instead of this, the predetermined value E0 to be compared with the maximum value dYmax is set to a value in step S850 rather than the value in step S750. It can be set as the structure made small. That is, in step S750, a process for determining whether or not the maximum value dYmax is equal to or greater than the predetermined value E01 is performed. In step S850, the maximum value dYmax is equal to or greater than the predetermined value E02 that is smaller than the predetermined value E01. It is assumed that the process for determining whether or not is performed.

ポートレートの場合、被写界深度が浅い写真が多いが、被写界深度が浅いということは、肌色部分全体にピントが合っているとは限らないし、ピントが合っていると見えている部分も、被写界深度の深い非ポートレートの写真画像に比べると、エッジの立ち方が甘い可能性がある。したがって、この変形例によれば、ポートレートの写真画像のエッジ部分を確実に選択することができる。   In the case of portraits, there are many photographs with a shallow depth of field, but a shallow depth of field means that the entire skin-colored part is not always in focus, and the part that is visible when in focus However, there is a possibility that the edge is not as good as a non-portrait photographic image with a deep depth of field. Therefore, according to this modification, the edge portion of the portrait photographic image can be reliably selected.

ステップS850およびS852で、対象画素P(M,N)はエッジ部分でかつ肌色であると判断された場合には、CPU11は、ステップS860で、エッジ部分のピクセル数を示す変数TEを値1だけインクリメントするとともに、エッジの強さの合計を演算する(ステップS870)。エッジの強さの合計を示す変数IEは、ステップS846で求められた輝度差の最大値dYmaxを積算することにより求められる。   If it is determined in steps S850 and S852 that the target pixel P (M, N) is an edge portion and a skin color, the CPU 11 sets a variable TE indicating the number of pixels in the edge portion to a value 1 in step S860. In addition to the increment, the total edge strength is calculated (step S870). The variable IE indicating the total edge strength is obtained by integrating the maximum value dYmax of the luminance difference obtained in step S846.

なお、ステップS850で、対象画素P(M,N)がエッジ部分でないと判定された場合、または、ステップS852で、対象画素P(M,N)が肌色でないと判定された場合には、ステップS860およびS870の処理は実行しない。   If it is determined in step S850 that the target pixel P (M, N) is not an edge portion, or if it is determined in step S852 that the target pixel P (M, N) is not skin-colored, The processes of S860 and S870 are not executed.

図11のステップS894で肯定判別されると、対象画像データDxを構成する全ての画素に対して、エッジ部分のピクセル数を示す変数TEとエッジの強さの合計を示す変数IEを求める集計が終了したとして、CPU11は、ステップS896に処理を進める。ステップS896では、ステップS870で算出されたエッジ部分のエッジの強さの合計を示す変数IEを、ステップS860で算出されたエッジ部分のピクセル数を示す変数TEで除算することにより、肌色でエッジ部分の画素におけるエッジの強さの平均値を求めて、その割合(=IE/TE)に係数R2を乗算することにより、ピント合焦率FSを求める。係数R2は、画素のエッジの強さの平均値をピント合焦率FSに変換するための数値調整用の係数であり、予め定められた値である。この係数R2と、前述した非ポートレート用ピント合焦率算出処理で用いた係数R1とを適切な値とすることで、ポートレートと非ポートレートとが対等にピント合焦の比較ができるようになされている。   If an affirmative determination is made in step S894 in FIG. 11, for all the pixels constituting the target image data Dx, the summation for obtaining the variable TE indicating the number of pixels of the edge portion and the variable IE indicating the sum of the edge strengths is performed. Assuming that the processing has ended, the CPU 11 advances the processing to step S896. In step S896, the variable IE indicating the total edge strength of the edge portion calculated in step S870 is divided by the variable TE indicating the number of pixels of the edge portion calculated in step S860. The focus intensity ratio FS is obtained by obtaining the average value of the edge strengths of the pixels and multiplying the ratio (= IE / TE) by the coefficient R2. The coefficient R2 is a numerical adjustment coefficient for converting the average value of the edge strength of the pixel into the focus ratio FS, and is a predetermined value. By setting the coefficient R2 and the coefficient R1 used in the above-described non-portrait focus in-focus ratio calculation processing to appropriate values, it is possible to compare the in-focus between the portrait and the non-portrait equally. Has been made.

ステップS896の実行後、「リターン」に抜けてこのポートレート用ピント合焦率算出処理を一旦終了する。なお、このポートレート用ピント合焦率算出処理では、エッジ部分のピクセル数を示す変数TEとエッジの強さの合計を示す変数IEとから、エッジの強さの平均値を求めて、この平均値からピント合焦率FSを求めていたが、他の手法にて「エッジ部分のエッジの強さ」を求めて、その値からピント合焦率FSを求めるように構成してもよい。他の手法としては、エッジ部分の中でエッジの強さの分布を表わすヒストグラムを作成して、そのヒストグラムから「エッジ部分のエッジの強さ」を求める構成等がある。   After the execution of step S896, the process returns to “RETURN” to end the portrait focus rate calculation process once. In the focus focus ratio calculation process for portrait, an average value of edge strength is obtained from a variable TE indicating the number of pixels in the edge portion and a variable IE indicating the sum of the edge strengths. Although the focus in-focus rate FS is obtained from the value, the “focus intensity of the edge portion” may be obtained by another method, and the in-focus rate FS may be obtained from the value. As another method, there is a configuration in which a histogram representing an edge strength distribution in an edge portion is created, and “edge strength of the edge portion” is obtained from the histogram.

こうした構成のポートレート用ピント合焦率算出処理は、前述した第2の判定方法を改良した方法に従うものである。第2の判定方法では、「エッジ部分のエッジの強さ」によってピントがどの程度合っているかを判定していたが、これに換えて、このポートレート用ピント合焦率算出処理では、「肌色でかつエッジの部分についてのエッジの強さ」によってピントがどの程度合っているかを判定している。   The portrait focus rate calculation process having such a configuration follows a method obtained by improving the second determination method described above. In the second determination method, the degree of focus is determined based on the “edge strength of the edge portion”. Instead of this, in the focus focus ratio calculation process for portrait, “skin color” In addition, the degree of focus is determined by “the strength of the edge of the edge portion”.

「エッジ部分のエッジの強さ」によって判定する第2の方法では、面積比は考慮することなく、ピントを合わせた部分のそのピントの合っている強さで判定を行なうが、「そこが本当にピントを合わせたかった場所なのか」が判断されていない。これに対して、このポートレート用ピント合焦率算出処理では、「肌色でかつエッジの部分についてのエッジの強さ」によってピント判定していることから、人物の顔の部分に対して、ピントがどの程度合っているかを判定することができる。しかも、「肌色でかつエッジの部分についてのエッジの強さ」によってピントの判定を行なうステップS238の処理を、ポートレートの写真画像に限定することで、ポートレートにおいてピントを合わせたい場所、すなわち人物の顔の部分でのピントが合っているかの判定を行なうことができるようにしている。したがって、ポートレートであっても、主要被写体である「人物」にピントが合わず、ぼかすべき背景の方にピントが合っているような写真画像でも、「ピントが合っていない」と正確に判定することができる。   In the second method of judging by “edge strength of the edge portion”, the area ratio is not considered and the judgment is made by the strength of the focused portion of the focused portion. Is it the place that you wanted to focus on? On the other hand, in the focus focus ratio calculation process for portrait, since the focus is determined based on “the strength of the edge of the skin color and the edge portion”, the focus portion of the person's face is focused. It is possible to determine how much is matched. In addition, by limiting the process of step S238, which performs the focus determination based on the “skin color and edge strength of the edge portion”, to the portrait photographic image, the person who wants to focus on the portrait, that is, the person It is possible to determine whether or not the face portion of the subject is in focus. Therefore, even if it is a portrait, even if it is a photographic image that does not focus on the person who is the main subject and is focused on the background to be blurred, it is accurately determined that the subject is not in focus. can do.

前述したように、非ポートレート用ピント合焦率算出処理もしくはポートレート用ピント合焦率算出処理にて算出されたピント合焦率FSは、画像データDpのソートキーとして記憶され、このソートキーでもって分類がなされる。   As described above, the focus in-focus ratio FS calculated by the non-portrait focus in-focus ratio calculation process or the portrait in-focus ratio calculation process is stored as the sort key of the image data Dp. Classification is made.

次に、フォトレタッチ用のアプリケーションプログラムの第2の機能について説明する。第2の機能は、前述したように、第1の機能で入力した画像データTDpに対して、画像処理を実行して画像修整を施す機能であるが、この実施例では、ソート処理で求められたピント合焦率FSを修整パラメータとして、この修整パラメータの程度に基づいた画像処理を行なう。すなわち、ピント合焦率FSが小さいほど、「シャープネス」の度合いを高める等のピントぼけを補正する画像処理を強い強度でもって作用させる。   Next, the second function of the application program for photo retouch will be described. As described above, the second function is a function of performing image processing on the image data TDp input by the first function and performing image modification. In this embodiment, the second function is obtained by sorting processing. Using the focus ratio FS as a modification parameter, image processing based on the degree of the modification parameter is performed. In other words, the smaller the in-focus ratio FS is, the higher the intensity of image processing for correcting out-of-focus, such as increasing the degree of “sharpness”.

C.作用・効果
以上のように構成された本実施例によれば、写真画像がポートレートの画像である場合に、ポートレート専用のピント判定処理を写真画像に対して施すことができる。このために、写真画像がポートレートである場合のピント判定の精度を向上させることができる。また、本実施例では、ポートレートの写真画像とポートレート以外の写真画像とに異なるピント判定処理を施すことで、それぞれの写真画像に適したピント判定を行なうことができる。したがって、写真画像のピントの判定の精度をより向上することができる。
C. According to the present embodiment configured as described above, when a photographic image is a portrait image, it is possible to perform a focus determination process exclusively for portrait on the photographic image. For this reason, it is possible to improve the accuracy of focus determination when a photographic image is a portrait. Further, in this embodiment, by performing different focus determination processing on a photographic image of a portrait and a photographic image other than the portrait, it is possible to perform a focus determination suitable for each photographic image. Therefore, it is possible to further improve the accuracy of determining the focus of a photographic image.

特に、本実施例では、写真画像がポートレートの画像である場合に、「肌色でかつエッジの部分についてのエッジの強さ」によってピント判定していることから、前述したように、人物にピントが合わず背景の方にピントが合っているような写真画像でも、「ピントが合っていない」と正確に判定することができる。   In particular, in the present embodiment, when the photographic image is a portrait image, the focus determination is performed based on “the strength of the edge of the skin color and the edge portion”. Even a photographic image where the background is out of focus and the background is in focus can be accurately determined as “out of focus”.

本実施例では、写真画像のピントがどれほど合っているかを正確に示すピント合焦率FSをソートキーにして分類を行なっていることから、写真画像をピントがよく合っている順に正確に並べ替えることができる。   In this embodiment, since the classification is performed using the focus focus ratio FS that accurately indicates how much the photographic image is in focus as a sort key, the photographic images are accurately rearranged in the order in which they are in focus. Can do.

また、本実施例では、ピント合焦率FSを画像修整の修整パラメータとしていることから、ピントぼけを正しく修整することができ、修整の出来ばえを向上させることができる。   In the present embodiment, since the focus in-focus ratio FS is used as a correction parameter for image correction, it is possible to correct the defocus correctly and improve the quality of the correction.

D.他の実施形態:
本発明は上記の実施例や実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲において種々なる態様にて実施することが可能であり、例えば次のような変形も可能である。
D. Other embodiments:
The present invention is not limited to the above-described examples and embodiments, and can be implemented in various modes without departing from the gist of the present invention. For example, the following modifications are possible.

(1)前記実施例では、ピント判定の対象となる複数の画像データは、候補用エリアA1に表示されたものであるが、必ずしもこの構成である必要もなく、他の表示エリアに表示されたものでもよい。また、表示エリア内に表示された写真画像である必要もなく、記録媒体の所定の領域に記憶された写真画像の画像データであればピント判定の対象とすることもできる。 (1) In the above-described embodiment, the plurality of pieces of image data targeted for focus determination are displayed in the candidate area A1, but need not necessarily have this configuration, and are displayed in other display areas. It may be a thing. Further, it is not necessary to be a photographic image displayed in the display area, and any photographic image data stored in a predetermined area of the recording medium can be set as a focus determination target.

(2)前記実施例では、ピント判定の対象となる複数の画像データは、アプリケーションウィンドウWDのファイル指定のフィールドFL2で指定された「フォルダ」や「フィルム」内の画像データである。このために、デジタルカメラ26で撮影した写真画像の画像データに限られず、他の格納場所で格納された写真画像の画像データもソート対象とすることもできる。また、必ずしもカラー写真画像に限る必要もなく、白黒の多階調の写真画像であってもよい。 (2) In the above-described embodiment, the plurality of pieces of image data targeted for focus determination are image data in the “folder” or “film” designated in the file designation field FL2 of the application window WD. For this reason, it is not limited to the image data of the photographic image taken by the digital camera 26, and the image data of the photographic image stored in another storage location can also be the sort target. Further, the image is not necessarily limited to a color photographic image, and may be a monochrome multi-tone photographic image.

(3)前記実施例では、画像修整のパラメータは、前記ピント合焦率FS単独で構成していたが、これに換えて、ピント合焦率FSに加えて他の画質の特徴を示すパラメータを含ませる構成としてもよい。上記他のパラメータとしては、「コントラスト」、「明るさ」、「カラーバランス」、「彩度」、「シャープネス」の各パラメータがある。 (3) In the above-described embodiment, the image modification parameter is configured by the focus focus rate FS alone. Instead, in addition to the focus focus rate FS, parameters indicating other image quality characteristics are used. It is good also as a structure to include. The other parameters include “contrast”, “brightness”, “color balance”, “saturation”, and “sharpness” parameters.

(4)前記実施例では、ポートレート用ピント合焦率演算処理では、「肌色でかつエッジの部分についてのエッジの強さ」によってピントがどの程度合っているかを判定し、非ポートレート用ピント合焦率演算処理では、「エッジ部分の面積比」によってピントがどの程度合っているかを判定していたが、これに換えて、両処理ともに、同一の処理、すなわち「エッジ部分の面積比」によってピントがどの程度合っているかを判定するものとして、そのエッジ部分の判定を行なう際の輝度についての閾値を、ポートレート用ピント合焦率演算処理側の方が非ポートレート用ピント合焦率演算処理側より小さい値とする構成としてもよい。すなわち、図10に示したポートレート用ピント合焦率演算処理を、図8に示した非ポートレート用ピント合焦率演算処理とほぼ同じ構成として、相違する点はステップS750の判定における所定値E0を、ポートレート用ピント合焦率演算処理側の方が非ポートレート用ピント合焦率演算処理側より小さい値とする。この構成によれば、エッジを判定する閾値を変えるだけで、ポートレートと非ポートレートとの固有の判定を行なうことができ、写真画像のピント判定の精度を高めることができる。 (4) In the above-described embodiment, in the focus focus ratio calculation process for portrait, the degree of focus is determined by “the strength of the edge of the skin color and the edge portion”, and the focus for non-portrait is determined. In the focus rate calculation process, the degree of focus was determined by the “area ratio of the edge part”. Instead, both processes are the same process, that is, “the area ratio of the edge part”. The threshold for brightness when determining the edge of the image is determined by the focus focus ratio calculation processing side for the non-portrait focus ratio. It is good also as a structure set as a value smaller than the arithmetic processing side. That is, the portrait focus ratio calculation process shown in FIG. 10 is substantially the same as the non-portrait focus ratio calculation process shown in FIG. 8, and the difference is the predetermined value in the determination in step S750. E0 is set to a value smaller on the portrait focus ratio calculation processing side than on the non-portrait focus ratio calculation processing side. According to this configuration, it is possible to make a unique determination between a portrait and a non-portrait simply by changing the threshold value for determining an edge, and it is possible to improve the accuracy of photographic image focus determination.

本発明の一実施例を適用するコンピュータシステムの概略構成を示す説明図である。It is explanatory drawing which shows schematic structure of the computer system to which one Example of this invention is applied. 画像入力ルーチンを示すフローチャートである。It is a flowchart which shows an image input routine. アプリケーションウィンドウWDを示す説明図である。It is explanatory drawing which shows the application window WD. ソート処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a sort process. 画像ピント判定処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of an image focus determination process. ポートレート判定処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a portrait determination process. 対象画素を移動させていく様子を示す説明図である。It is explanatory drawing which shows a mode that the object pixel is moved. 非ポートレート用ピント合焦率算出処理の前半部分の詳細を示すフローチャートである。It is a flowchart which shows the detail of the first half part of the focus focusing ratio calculation process for non-portraits. 非ポートレート用ピント合焦率算出処理の後半部分の詳細を示すフローチャートである。It is a flowchart which shows the detail of the second half part of the focus focusing ratio calculation process for non-portraits. ポートレート用ピント合焦率算出処理の前半部分の詳細を示すフローチャートである。It is a flowchart which shows the detail of the first half part of the focus focus ratio calculation process for portraits. ポートレート用ピント合焦率算出処理の後半部分の詳細を示すフローチャートである。It is a flowchart which shows the detail of the second half part of the focus focus ratio calculation process for portraits.

符号の説明Explanation of symbols

10...パーソナルコンピュータ
12...バス
13...メモリ
14...ハードディスクドライブ
15...入力制御部
16...表示制御部
18...マウス
20...ディスプレイ
22...キーボード
24...マウス
26...デジタルカメラ
28...プリンタ
30...ポートレート判定部
32...第1処理部
34...第2処理部
A1...候補用エリア
BT1...「候補外へ」のボタンスイッチ
BT2...「ソート」のボタンスイッチ
DB...ダイアログボックス
WD...アプリケーションウィンドウ
F...ポートレート判定フラグ
Dp...画像データ
10 ... Personal computer 12 ... Bus 13 ... Memory 14 ... Hard disk drive 15 ... Input control unit 16 ... Display control unit 18 ... Mouse 20 ... Display 22 ... Keyboard 24 ... Mouse 26 ... Digital camera 28 ... Printer 30 ... Portrait determination unit 32 ... First processing unit 34 ... Second processing unit A1 ... Candidate area BT1. .. Button switch for "outside candidate" BT2 ... Button switch for "Sort" DB ... Dialog box WD ... Application window F ... Portrait determination flag Dp ... Image data

Claims (27)

写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定装置であって、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備える画像ピント判定装置。
An image focus determination device that performs a focus determination process for determining how much a photograph image is in focus,
Portrait determination means for determining whether the photographic image is a portrait image;
An image comprising: a first processing unit configured to apply a first process as the focus determination process prepared in advance dedicated to a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. Focus determination device.
請求項1に記載の画像ピント判定装置であって、
前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段
を備える画像ピント判定装置。
The image focus determination device according to claim 1,
A second processing unit configured to apply, to the photographic image, a second process as the focus determination process prepared in advance for a non-portrait when the portrait determination unit determines that the image is other than a portrait; Image focus determination device.
請求項1または2に記載の画像ピント判定装置であって、
前記第1処理手段は、
前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する第1の画素選択手段と、
前記第1の画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第1のピント合焦率演算手段と
を備える画像ピント判定装置。
The image focus determination device according to claim 1 or 2,
The first processing means includes
A first pixel selecting means for selecting a pixel belonging to an edge portion having a luminance difference of a predetermined value or more between adjacent pixels and a skin color from each pixel constituting the photographic image;
First focus ratio calculation means for calculating a focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the first pixel selection means. An image focus determination device comprising:
請求項2または3に記載の画像ピント判定装置であって、
前記第2処理手段は、
前記写真画像を構成する各画素の中から、隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する第2の画素選択手段と、
前記写真画素を構成する各画素の総数に対する前記第2の画素選択手段により選択された各画素の合計数の割合を求めて、該割合に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第2のピント合焦率演算手段と
を備える画像ピント判定装置。
The image focus determination device according to claim 2 or 3,
The second processing means includes
A second pixel selecting means for selecting a pixel belonging to an edge portion having a luminance difference of a predetermined value or more between adjacent pixels from among the pixels constituting the photographic image;
The ratio of the total number of each pixel selected by the second pixel selection unit to the total number of pixels constituting the photographic pixel is obtained, and based on the ratio, how much the photographic image is in focus is determined. An image focus determination apparatus comprising: a second focus focus ratio calculation unit that calculates a focus focus ratio shown.
請求項1または2に記載の画像ピント判定装置であって、
前記第1処理手段は、
前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で第1の所定値以上の輝度差があるエッジ部分に属する画素を選択する第1の画素選択手段と、
前記第1の画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第1のピント合焦率演算手段と
を備え、
前記第2処理手段は、
前記写真画像を構成する各画素の中から、隣接する画素との間で前記第1の所定値より大きな第2の所定値以上の輝度差があるエッジ部分に属する画素を選択する第2の画素選択手段と、
前記写真画素を構成する各画素の総数に対する前記第2の画素選択手段により選択された各画素の合計数の割合を求めて、該割合に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する第2のピント合焦率演算手段と
を備える画像ピント判定装置。
The image focus determination device according to claim 1 or 2,
The first processing means includes
A first pixel selection means for selecting a pixel belonging to an edge portion having a skin color and having a luminance difference equal to or greater than a first predetermined value from adjacent pixels among the pixels constituting the photographic image;
First focus ratio calculation means for calculating a focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the first pixel selection means. And
The second processing means includes
A second pixel that selects a pixel belonging to an edge portion having a luminance difference greater than or equal to a second predetermined value that is greater than the first predetermined value from neighboring pixels that constitute the photographic image; A selection means;
The ratio of the total number of each pixel selected by the second pixel selection unit to the total number of each pixel constituting the photographic pixel is obtained, and based on the ratio, how much the photographic image is in focus is determined. An image focus determination apparatus comprising: a second focus focus ratio calculation unit that calculates a focus focus ratio shown.
請求項1ないし5のいずれかに記載の画像ピント判定装置であって、
前記ポートレート判定手段は、
前記写真画像の肌色部分の前記写真画像全体に対する面積比を算出する面積比算出手段と、
前記面積比算出手段により算出された面積比に基づいて、前記写真画像がポートレートの画像であるか否かを判定する判定手段と
を備える画像ピント判定装置。
The image focus determination device according to any one of claims 1 to 5,
The portrait determination means includes
An area ratio calculating means for calculating an area ratio of the skin color portion of the photographic image to the entire photographic image;
An image focus determination device comprising: determination means for determining whether the photographic image is a portrait image based on the area ratio calculated by the area ratio calculation means.
複数の写真画像を分類する画像分類装置であって、
前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定手段と、
前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する分類手段と
を備え、さらに、
前記画像ピント判定手段は、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備える画像分類装置。
An image classification device for classifying a plurality of photographic images,
Image focus determination means for performing a focus determination process for determining how much the focus is in each photographic image;
Classification means for classifying the plurality of photographic images based on a determination result of the focus determination process; and
The image focus determination means includes
Portrait determination means for determining whether the photographic image is a portrait image;
An image comprising: a first processing unit configured to apply a first process as the focus determination process prepared in advance dedicated to a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. Classification device.
請求項7に記載の画像分類装置であって、
前記画像ピント判定手段は、
前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段
を備える画像分類装置。
The image classification device according to claim 7,
The image focus determination means includes
A second processing unit configured to apply, to the photographic image, a second process as the focus determination process prepared in advance for a non-portrait when the portrait determination unit determines that the image is other than a portrait; Image classification device.
請求項7または8に記載の画像分類装置であって、
前記第1処理手段は、
前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する画素選択手段と、
前記画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算するピント合焦率演算手段と
を備える画像分類装置。
The image classification device according to claim 7 or 8, wherein
The first processing means includes
A pixel selection means for selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
An image classification apparatus comprising: a focus ratio calculation unit that calculates a focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the pixel selection unit .
写真画像を修整する画像修整装置であって、
前記写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定手段と、
前記ピント判定処理の判定結果に基づいて、前記写真画像を修整する画像修整手段と
を備え、さらに、
前記画像ピント判定手段は、
前記写真画像がポートレートの画像であるか否かを判定するポートレート判定手段と、
前記ポートレート判定手段でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す第1処理手段と
を備える画像修整装置。
An image correction device for correcting a photographic image,
Image focus determination means for performing a focus determination process for determining how much the photographic image is in focus;
Image correction means for correcting the photographic image based on the determination result of the focus determination process, and
The image focus determination means includes
Portrait determination means for determining whether the photographic image is a portrait image;
An image comprising: a first processing unit configured to apply a first process as the focus determination process prepared in advance dedicated to a portrait to the photographic image when the portrait determination unit determines that the image is a portrait image. Modification device.
請求項10に記載の画像修整装置であって、
前記画像ピント判定手段は、
前記ポートレート判定手段でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す第2処理手段
を備える画像修整装置。
The image modification device according to claim 10,
The image focus determination means includes
A second processing unit configured to apply, to the photographic image, a second process as the focus determination process prepared in advance for a non-portrait when the portrait determination unit determines that the image is other than a portrait; Image modification device.
請求項10または11に記載の画像修整装置であって、
前記第1処理手段は、
前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する画素選択手段と、
前記画素選択手段により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算するピント合焦率演算手段と
を備える画像修整装置。
The image correction device according to claim 10 or 11,
The first processing means includes
A pixel selection means for selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
An image correction apparatus comprising: a focus ratio calculation unit that calculates a focus ratio indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the pixel selection unit. .
写真画像のピントがどれほど合っているかを判定するピント判定処理を行なう画像ピント判定方法であって、
(a)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(b)前記行程(a)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備える画像ピント判定方法。
An image focus determination method for performing a focus determination process for determining how much a photograph image is in focus,
(A) a step of determining whether the photographic image is a portrait image;
(B) an image comprising: a step of performing, on the photographic image, a first process as the focus determination process prepared in advance for a portrait when it is determined in the process (a) that the image is a portrait. Focus determination method.
請求項13に記載の画像ピント判定方法であって、
(c)前記行程(a)でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す行程
を備える画像ピント判定方法。
The image focus determination method according to claim 13,
(C) when it is determined in step (a) that the image is other than a portrait, a step of performing, on the photographic image, a second process as the focus determination process prepared in advance for a non-portrait. Image focus determination method.
請求項13または14に記載の画像ピント判定方法であって、
前記行程(b)は、
(b−1)前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する行程と、
(b−2)前記行程(b−1)により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する行程と
を備える画像ピント判定方法。
The image focus determination method according to claim 13 or 14,
The step (b) is:
(B-1) a step of selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
(B-2) a step of calculating a focus rate indicating how much the photographic image is focused based on the luminance difference for each pixel selected in the step (b-1). Image focus determination method.
複数の写真画像を分類する画像分類方法であって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう行程と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する行程と
を備え、さらに、
前記行程(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(a−2)前記行程(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備える画像分類方法。
An image classification method for classifying a plurality of photographic images,
(A) a step of performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) a step of classifying the plurality of photographic images based on a determination result of the focus determination process; and
The step (a)
(A-1) a step of determining whether or not the photographic image is a portrait image;
(A-2) A process of applying, to the photographic image, a first process as the focus determination process prepared in advance for portraits when it is determined in the process (a-1) that the image is a portrait. An image classification method comprising:
写真画像を修整する画像修整方法であって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう行程と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する行程と
を備え、さらに、
前記行程(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する行程と、
(a−2)前記行程(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す行程と
を備える画像修整方法。
An image modification method for modifying a photographic image,
(A) a step of performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) a step of classifying the plurality of photographic images based on a determination result of the focus determination process; and
The step (a)
(A-1) a step of determining whether or not the photographic image is a portrait image;
(A-2) A process of applying, to the photographic image, a first process as the focus determination process prepared in advance for portraits when it is determined in the process (a-1) that the image is a portrait. An image modification method comprising:
写真画像のピントがどれほど合っているかを判定するピント判定処理を行なうためのコンピュータプログラムであって、
(a)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(b)前記機能(a)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
をコンピュータに実現させるためのコンピュータプログラム。
A computer program for performing a focus determination process for determining how much a photograph image is in focus,
(A) a function of determining whether the photographic image is a portrait image;
(B) When it is determined that the image is a portrait image in the function (a), the computer is provided with a function of applying a first process as the focus determination process prepared in advance exclusively for a portrait to the photographic image. Computer program for realizing.
請求項18に記載のコンピュータプログラムであって、
(c)前記機能(a)でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す機能
をコンピュータに実現させるためのコンピュータプログラム。
A computer program according to claim 18, comprising:
(C) When it is determined in the function (a) that the image is other than a portrait, a function of applying a second process as the focus determination process prepared in advance for a non-portrait to the photographic image A computer program for realizing this.
請求項18または19に記載のコンピュータプログラムであって、
前記機能(b)は、
(b−1)前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する機能と、
(b−2)前記機能(b−1)により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する機能と
を備えるコンピュータプログラム。
A computer program according to claim 18 or 19, comprising:
The function (b) is
(B-1) a function of selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
(B-2) a function of calculating a focus rate indicating how much the photographic image is focused based on the luminance difference for each pixel selected by the function (b-1). Computer program.
複数の写真画像を分類するためのコンピュータプログラムであって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう機能と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する機能と
をコンピュータに実現させるとともに、
前記機能(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(a−2)前記機能(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
を備えるコンピュータプログラム。
A computer program for classifying a plurality of photographic images,
(A) a function for performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) causing the computer to realize a function of classifying the plurality of photographic images based on a determination result of the focus determination process;
The function (a) is:
(A-1) a function of determining whether the photographic image is a portrait image;
(A-2) A function of applying, to the photographic image, a first process as the focus determination process prepared in advance for portrait use when it is determined that the image is a portrait image in the function (a-1). A computer program comprising:
請求項21に記載のコンピュータプログラムであって、
(a−3)前記機能(a−1)でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す機能
をコンピュータに実現させるためのコンピュータプログラム。
A computer program according to claim 21, comprising:
(A-3) When it is determined by the function (a-1) that the image is other than a portrait, a second process as the focus determination process prepared in advance for a non-portrait is applied to the photographic image. A computer program that allows a computer to implement the functions to be performed.
請求項21または22に記載のコンピュータプログラムであって、
前記機能(a−2)は、
(a−2−1)前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する機能と、
(a−2−2)前記機能(a−2−1)により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する機能と
を備えるコンピュータプログラム。
A computer program according to claim 21 or 22,
The function (a-2) is
(A-2-1) a function of selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
(A-2-2) Based on the luminance difference for each pixel selected by the function (a-2-1), a focus in-focus ratio indicating how much the photographic image is in focus is calculated. A computer program with functions.
写真画像を修整するためのコンピュータプログラムであって、
(a)前記写真画像毎に、ピントがどれほど合っているかを判定するピント判定処理を行なう機能と、
(b)前記ピント判定処理の判定結果に基づいて、前記複数の写真画像を分類する機能と
をコンピュータに実現させるとともに、
前記機能(a)は、
(a−1)前記写真画像がポートレートの画像であるか否かを判定する機能と、
(a−2)前記機能(a−1)でポートレートの画像であると判定されたとき、ポートレート専用に予め用意された前記ピント判定処理としての第1処理を、前記写真画像に施す機能と
を備えるコンピュータプログラム。
A computer program for modifying a photographic image,
(A) a function for performing a focus determination process for determining how much the focus is obtained for each photographic image;
(B) causing the computer to realize a function of classifying the plurality of photographic images based on a determination result of the focus determination process;
The function (a) is:
(A-1) a function of determining whether the photographic image is a portrait image;
(A-2) A function of applying, to the photographic image, a first process as the focus determination process prepared in advance for portrait use when it is determined that the image is a portrait image in the function (a-1). A computer program comprising:
請求項24に記載のコンピュータプログラムであって、
(a−3)前記機能(a−1)でポートレート以外の画像であると判定されたとき、非ポートレート用に予め用意された前記ピント判定処理としての第2処理を、前記写真画像に施す機能
をコンピュータに実現させるためのコンピュータプログラム。
A computer program according to claim 24,
(A-3) When it is determined by the function (a-1) that the image is other than a portrait, a second process as the focus determination process prepared in advance for a non-portrait is applied to the photographic image. A computer program that allows a computer to implement the functions to be performed.
請求項24または25に記載のコンピュータプログラムであって、
前記機能(a−2)は、
(a−2−1)前記写真画像を構成する各画素の中から、肌色で、かつ隣接する画素との間で所定値以上の輝度差があるエッジ部分に属する画素を選択する機能と、
(a−2−2)前記機能(a−2−1)により選択された各画素についての前記輝度差に基づいて、前記写真画像のピントがどれほど合っているかを示すピント合焦率を演算する機能と
を備えるコンピュータプログラム。
A computer program according to claim 24 or 25, comprising:
The function (a-2) is
(A-2-1) a function of selecting a pixel belonging to an edge portion having a skin color and having a luminance difference of a predetermined value or more from adjacent pixels from among the pixels constituting the photographic image;
(A-2-2) Based on the luminance difference for each pixel selected by the function (a-2-1), a focus in-focus ratio indicating how much the photographic image is in focus is calculated. A computer program with functions.
請求項18ないし26のいずれかに記載のコンピュータプログラムを記録したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which the computer program according to any one of claims 18 to 26 is recorded.
JP2003393882A 2003-11-25 2003-11-25 Image focus discrimination, image classification, and image correction Pending JP2005159626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003393882A JP2005159626A (en) 2003-11-25 2003-11-25 Image focus discrimination, image classification, and image correction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003393882A JP2005159626A (en) 2003-11-25 2003-11-25 Image focus discrimination, image classification, and image correction

Publications (1)

Publication Number Publication Date
JP2005159626A true JP2005159626A (en) 2005-06-16

Family

ID=34720118

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003393882A Pending JP2005159626A (en) 2003-11-25 2003-11-25 Image focus discrimination, image classification, and image correction

Country Status (1)

Country Link
JP (1) JP2005159626A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7462358B2 (en) 2022-03-07 2024-04-05 エムティーオメガ カンパニー,リミテッド Black box camera focusing inspection method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7462358B2 (en) 2022-03-07 2024-04-05 エムティーオメガ カンパニー,リミテッド Black box camera focusing inspection method and device

Similar Documents

Publication Publication Date Title
JP4529888B2 (en) Image processing apparatus, image processing method, and image processing program
JP4281311B2 (en) Image processing using subject information
US20060158704A1 (en) Image correction apparatus, method and program
JP4978378B2 (en) Image processing device
US20090027732A1 (en) Image processing apparatus, image processing method, and computer program
JP2005310123A (en) Apparatus for selecting image of specific scene, program therefor and recording medium with the program recorded thereon
JP2006338329A (en) Face orientation detection method, device and program and recording medium with the program recorded thereon
US7433079B2 (en) Image processing apparatus and method
JP2010074405A (en) Image processing apparatus and method
JP2005122721A (en) Image processing method, device, and program
JP4349380B2 (en) IMAGING DEVICE, METHOD FOR OBTAINING IMAGE
JP2007184888A (en) Imaging apparatus, image processor, image processing method, and image processing program
JP2007207055A (en) Image processor, program, information storage medium and image processing method
JP4859938B2 (en) Image processing using subject information
JP5509621B2 (en) Image processing apparatus, camera, and program
JP2007258923A (en) Image processing apparatus, image processing method, image processing program
JP2000013596A (en) Device and method for processing image and recording medium with image processing program recorded there
JP4006590B2 (en) Image processing apparatus, scene determination apparatus, image processing method, scene determination method, and program
JP4135365B2 (en) Image processing apparatus and method, recording medium, and program
JP2005159626A (en) Image focus discrimination, image classification, and image correction
JP4779883B2 (en) Electronic camera
JP2007243542A (en) Imaging apparatus, image processing apparatus, image processing method, and image processing program
JP3643042B2 (en) Image processing apparatus, image processing method, and recording medium
JP2007094787A (en) Portrait image correction device, portrait image correction method and portrait image correction program
JP2010004300A (en) Image processing method, image processing apparatus, image processing program, and printer