JP2005301524A - Image processing program, method and apparatus - Google Patents

Image processing program, method and apparatus Download PDF

Info

Publication number
JP2005301524A
JP2005301524A JP2004114716A JP2004114716A JP2005301524A JP 2005301524 A JP2005301524 A JP 2005301524A JP 2004114716 A JP2004114716 A JP 2004114716A JP 2004114716 A JP2004114716 A JP 2004114716A JP 2005301524 A JP2005301524 A JP 2005301524A
Authority
JP
Japan
Prior art keywords
image
dust
pixel
brightness
pixels
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.)
Granted
Application number
JP2004114716A
Other languages
Japanese (ja)
Other versions
JP4464731B2 (en
Inventor
Toshiaki Wada
利昭 和田
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.)
Olympus Corp
Original Assignee
Olympus 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 Olympus Corp filed Critical Olympus Corp
Priority to JP2004114716A priority Critical patent/JP4464731B2/en
Publication of JP2005301524A publication Critical patent/JP2005301524A/en
Application granted granted Critical
Publication of JP4464731B2 publication Critical patent/JP4464731B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing program or the like that allows fully restoring an image picked up with an imaging device by specifying the dust part of the image. <P>SOLUTION: The image processing program includes an image selection step (S2) for selecting, from images taken in the same photographic mode by the same imaging device as that which took an image to be processed, one or more images as reference images in the order from the image picked up on the closest date to the date on which the image to be processed is picked up; a dust specifying step (S3) for adding the brightness of the image to be processed and that of the reference image together for each matching pair of pixels and specifying a group of pixels whose added brightness is not more than a predetermined value as the dust part of the image; a restoration step (S4) for setting a plurality of areas in such a way as to include the dust part of the image specified in the image to be processed and for restoring the dust part of the image using pixel values in an area where the distribution of pixel values for the part of the image other than the dust part is smallest; and a confirmation step (S5) for confirming processing results in reference to the unprocessed image. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、画像に含まれる埃の画像部分を除去するための画像処理プログラム、画像処理方法、画像処理装置に関する。   The present invention relates to an image processing program, an image processing method, and an image processing device for removing an image portion of dust contained in an image.

デジタルカメラ等の撮像装置は、一般的に、撮像光学系と、該撮像光学系により結像された被写体像を光電変換する撮像素子(イメージセンサ)と、を備えて構成されている。このような撮像装置では、撮像光学系を構成するレンズ群の内の最も被写体側に位置するレンズに、埃やゴミなど(以下ではこれらをまとめて「埃」と称する。)が付着することがある。   An imaging apparatus such as a digital camera generally includes an imaging optical system and an imaging element (image sensor) that photoelectrically converts a subject image formed by the imaging optical system. In such an imaging apparatus, dust or dirt (hereinafter collectively referred to as “dust”) may adhere to the lens located closest to the subject in the lens group constituting the imaging optical system. is there.

また、特に、レンズを交換可能ないわゆる一眼レフレックスカメラタイプの撮像装置では、最も撮像素子側に位置するレンズや、撮像素子の撮像面上にも埃が付着することがある。   In particular, in a so-called single-lens reflex camera type imaging device in which a lens can be exchanged, dust may adhere to the lens located closest to the imaging element or the imaging surface of the imaging element.

このような埃は、撮像される画像の品質を損なうものであるが、レンズ上の埃は撮像面ではぼけてしまうのに対して、撮像素子の撮像面上に付着した埃は明確な黒点などとして画像に現れてしまうために目立ち易いという特徴がある。従って、撮影者は、事前にブロアー等でこうした埃をできるだけ取り除くようにしているが、手作業で完全に取り除くことは困難である。   Such dust impairs the quality of the captured image, but the dust on the lens is blurred on the imaging surface, whereas the dust adhering to the imaging surface of the image sensor is a clear black spot, etc. As it appears in the image, it is easily noticeable. Accordingly, the photographer tries to remove such dust with a blower as much as possible in advance, but it is difficult to remove it completely by hand.

このような埃の内の、撮像面上に付着した埃に対しては、例えば超音波振動等を用いて物理的に取り除くようにする技術が実用化されているが、カメラのコストアップは避けられない。   For such dust that has adhered to the imaging surface, technology for physically removing it using, for example, ultrasonic vibration has been put into practical use, but avoiding an increase in the cost of the camera. I can't.

一方、埃を物理的に取り除くのではなく、埃が付着した状態で撮像された画像から、該埃部分の画像を画像処理によって補正する技術も提案されている。   On the other hand, a technique has been proposed in which dust is not physically removed but an image of the dust portion is corrected by image processing from an image captured with dust attached.

例えば、特開2002−209147号公報には、撮像レンズと撮像手段とを備えたデジタルカメラであって、ゴミ検出モードのときに撮像手段から出力された画像データに基づいて画像上のゴミの位置を検出するゴミ位置検出手段と、このゴミ位置検出手段により検出されたゴミ位置を記憶する記憶手段と、この記憶手段に記憶されたゴミ位置に基づいて撮像モードのときに上記撮像手段から出力される画像データを補正する補正手段と、を備えたデジタルカメラが記載されている。そして、該公報に記載された補正手段は、具体的には、ゴミと判定された位置の像がその周りの色と同じになるように、色補正を行うものとなっている。さらに、該公報には、白一色の基準被写体を撮像して得た基準被写体像データから、ゴミの位置を検出することが記載されている。   For example, Japanese Patent Application Laid-Open No. 2002-209147 discloses a digital camera including an imaging lens and an imaging unit, and the position of dust on the image based on image data output from the imaging unit in the dust detection mode. Dust position detection means for detecting the dust position, storage means for storing the dust position detected by the dust position detection means, and output from the imaging means in the imaging mode based on the dust position stored in the storage means. A digital camera having correction means for correcting image data is described. Specifically, the correction means described in the publication performs color correction so that the image at the position determined as dust is the same as the surrounding color. Furthermore, this publication describes that the position of dust is detected from reference subject image data obtained by imaging a reference subject of a single white color.

一方、埃による影響を補正するためのものではないが、類似した技術として、画像上に点状(あるいは線状など)のデータ欠落部分が生じる欠陥画素を補正するための技術が提案されている。   On the other hand, although not for correcting the influence of dust, as a similar technique, a technique for correcting a defective pixel in which a dot-like (or line-like) data missing portion is generated on an image has been proposed. .

例えば、特開2002−165092号公報には、デジタル画像を構成する画素を走査することにより修正の必要な欠損画素を検出する欠損画素検出手段と、上記検出した欠損画素の周囲から修正の必要のない正常画素を検出する正常画素検出手段と、上記検出した正常画素と上記欠損画素に対称な方向にある他の上記正常画素との輝度レベル差を検出する輝度レベル差検出手段と、上記検出した輝度レベル差が最も小さい2つの正常画素の内部補間で上記欠損画素を補正する補正手段と、を備えた画像処理装置が記載されている。さらに、該公報には、欠陥画素がエッジ部分に存在する場合に、補間元の正常画素として、該エッジ方向とほぼ平行な方向の正常画素を用いることが記載されている。
特開2002−209147号公報 特開2002−165092号公報
For example, Japanese Patent Laid-Open No. 2002-165092 discloses a defective pixel detection unit that detects a defective pixel that needs to be corrected by scanning pixels that form a digital image, and a correction that is necessary from around the detected defective pixel. Normal pixel detecting means for detecting non-normal pixels, luminance level difference detecting means for detecting a luminance level difference between the detected normal pixels and other normal pixels in a direction symmetrical to the defective pixel, and the detected An image processing apparatus including correction means for correcting the defective pixel by internal interpolation of two normal pixels having the smallest luminance level difference is described. Furthermore, this publication describes that when a defective pixel exists in an edge portion, a normal pixel in a direction substantially parallel to the edge direction is used as a normal pixel for interpolation.
JP 2002-209147 A JP 2002-165092 A

しかしながら、上記特開2002−209147号公報に記載の技術は、ゴミが付着している可能性があるときに、デジタルカメラをゴミ検出モードに設定してゴミ位置を検出するものであるために、ゴミ検出モードでゴミ位置を検出することのないまま撮影モードで撮影した画像は補正をすることができない。従って、撮影された後で、例えばパーソナルコンピュータ等において該画像を観察したときに、埃による黒点等が観察されても、ゴミ検出モードで検出されたデータ(白一色の基準被写体を撮像して得た基準被写体像データ)がなければ、該技術によって補正を行うことができない。そして、ゴミ位置の画像の補間についても、単に周囲の画素データを用いて行うものであるために、例えばゴミがエッジ部分にある場合などには、画像を良好に補正することができない。   However, since the technique described in Japanese Patent Application Laid-Open No. 2002-209147 is configured to detect the position of the dust by setting the digital camera to the dust detection mode when there is a possibility that dust is attached, An image shot in the shooting mode without detecting the dust position in the dust detection mode cannot be corrected. Therefore, after the image is taken, for example, when the image is observed on a personal computer or the like, even if black spots due to dust are observed, the data detected in the dust detection mode is If there is no reference subject image data), correction by this technique cannot be performed. Since the dust position image is also simply interpolated using surrounding pixel data, the image cannot be corrected satisfactorily when dust is present at the edge portion, for example.

また、上記特開2002−165092号公報に記載されたものは、欠陥画素を補正するために、該欠陥画素を挟む位置にある2つの正常画素を用いて補間を行うものとなっている。欠陥画素は、1画素単位、あるいはライン方向に沿った数画素単位、等で発生することが多く、このような欠陥画素を補正するためには、欠落画素を挟む2つの正常画素のデータを用いることは比較的有効であると考えられる。しかし、埃による画像データの欠落は、複数画素に渡る例えば面状の領域となってしまうこともあり、このような場合には、2つの正常画素のみを用いる補間では、必ずしも最適な補間結果になるとは限らない。さらに、該公報には、赤外光を照射することにより、撮影されて現像された後のネガフィルの傷やゴミを検出する技術が記載されているが、該技術では、埃が原因となってフィルム上に形成された黒点等を検出することはできず、従って、該黒点等を画像から取り除くこともできない。   In addition, what is described in the above-mentioned Japanese Patent Application Laid-Open No. 2002-165092 performs interpolation using two normal pixels located between the defective pixels in order to correct the defective pixels. Defect pixels often occur in units of one pixel or in units of several pixels along the line direction, and in order to correct such a defective pixel, data of two normal pixels sandwiching the missing pixel is used. This is considered relatively effective. However, the loss of image data due to dust may result in, for example, a planar area extending over a plurality of pixels. In such a case, interpolation using only two normal pixels does not necessarily result in an optimal interpolation result. Not necessarily. Furthermore, this publication describes a technique for detecting flaws and dust in a negative film after being photographed and developed by irradiating infrared light. However, in this technique, dust is the cause. Black spots and the like formed on the film cannot be detected, and therefore the black spots and the like cannot be removed from the image.

本発明は上記事情に鑑みてなされたものであり、撮像装置により撮影された画像から、埃の画像部分を特定して良好に修復することができる画像処理プログラム、画像処理方法、画像処理装置を提供することを目的としている。   The present invention has been made in view of the above circumstances, and provides an image processing program, an image processing method, and an image processing apparatus capable of identifying and satisfactorily restoring dust image portions from an image taken by an imaging apparatus. It is intended to provide.

上記の目的を達成するために、第1の発明による画像処理プログラムは、コンピュータにより、撮像装置により撮影された画像から、該画像に含まれ得る埃の画像部分を画像処理により除去させるための画像処理プログラムであって、処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から撮影日時が該処理対象画像に近い順に1以上の画像を参照画像として選択する画像選択ステップと、上記処理対象画像と上記参照画像との両方において略同一位置に存在する埃の画像部分を特定する埃特定ステップと、上記埃特定ステップにより特定された処理対象画像における埃の画像部分を該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復ステップと、をコンピュータに実行させるためのプログラムである。   In order to achieve the above object, an image processing program according to a first invention is an image for causing a computer to remove an image portion of dust that can be included in the image from an image captured by an imaging device. A processing program that selects one or more images as reference images in order of shooting date and time from the one or more images captured by the same imaging device as the imaging device that captured the processing target image. An image selecting step; a dust specifying step for specifying an image portion of dust existing at substantially the same position in both the processing target image and the reference image; and a dust image in the processing target image specified by the dust specifying step Causing the computer to execute a repairing step of repairing the portion using image information in the vicinity of the dust image portion in the processing target image. It is because of the program.

なお、「日時」は、年、月、日、時、分、秒などの時間的概念を広範に含んでいる。   The “date and time” includes a wide range of time concepts such as year, month, day, hour, minute, and second.

そして、「埃」は、埃、塵、ゴミなどを広範に含み、これらを代表して単に「埃」と記載したものである。   “Dust” includes a wide range of dust, dust, dust, and the like, and is simply described as “dust” as a representative.

また、第2の発明による画像処理プログラムは、上記第1の発明による画像処理プログラムにおいて、上記撮像装置が、イメージセンサを有して構成されたものであり、上記埃は、このイメージセンサの撮像面に付着しているものであることを特徴とする。   An image processing program according to a second invention is the image processing program according to the first invention, wherein the imaging device includes an image sensor, and the dust is captured by the image sensor. It is characterized by being attached to the surface.

さらに、第3の発明による画像処理プログラムは、上記第1または第2の発明による画像処理プログラムにおいて、上記撮像装置が、イメージセンサを有して構成されたものであり、上記略同一位置は、このイメージセンサの撮像面における略同一位置であることを特徴とする。   Furthermore, an image processing program according to a third invention is the image processing program according to the first or second invention, wherein the imaging device includes an image sensor, and the substantially same position is The image sensor is characterized by being at substantially the same position on the imaging surface.

第4の発明による画像処理プログラムは、上記第1の発明による画像処理プログラムにおいて、上記画像選択ステップが、上記処理対象画像と同一の画素構成の画像の中から、上記参照画像を選択するステップであることを特徴とする。   An image processing program according to a fourth invention is the image processing program according to the first invention, wherein the image selection step selects the reference image from images having the same pixel configuration as the processing target image. It is characterized by being.

第5の発明による画像処理プログラムは、上記第1の発明による画像処理プログラムにおいて、上記埃特定ステップが、上記処理対象画像の画素毎の明度と上記参照画像の画素毎の明度とを算出する明度算出ステップと、上記明度算出ステップにより算出された上記処理対象画像の画素毎の明度と上記参照画像の画素毎の明度とを同一画素位置毎に加算する明度加算ステップと、上記明度加算ステップにより加算された明度の加算値が所定値よりも小さい画素を抽出する画素抽出ステップと、上記画素抽出ステップにより抽出された上記処理対象画像における画素を隣接する画素同士を同一のグループに含めるようにグループ化するグループ化ステップと、を含み、コンピュータに、上記グループ化ステップによりグループ化された画素群を埃の画像部分を構成する埃画素群として特定させることを特徴とする。   An image processing program according to a fifth invention is the image processing program according to the first invention, wherein the dust specifying step calculates a lightness for each pixel of the processing target image and a lightness for each pixel of the reference image. Adding by the brightness addition step, the brightness addition step for adding the brightness for each pixel of the processing target image calculated by the brightness calculation step and the brightness for each pixel of the reference image for each pixel position, and the brightness addition step A pixel extraction step for extracting pixels whose brightness addition value is smaller than a predetermined value, and grouping the pixels in the processing target image extracted by the pixel extraction step so that adjacent pixels are included in the same group A group of pixels grouped by the grouping step in a computer. It characterized thereby identified as dust pixel groups constituting the image portion of the.

第6の発明による画像処理プログラムは、上記第5の発明による画像処理プログラムにおいて、上記埃特定ステップが、上記明度算出ステップにより算出された画素毎の明度を画像に含まれる全画素について平均することにより画像平均明度を算出する処理を上記画像選択ステップにより選択された全ての参照画像について行う平均明度算出ステップと、上記平均明度算出ステップにより算出された画像平均明度が所定値以下となる参照画像を上記明度加算ステップによる加算対象から除外する画像除外ステップと、をさらに含むことを特徴とする。   The image processing program according to a sixth aspect is the image processing program according to the fifth aspect, wherein the dust specifying step averages the lightness of each pixel calculated in the lightness calculation step for all the pixels included in the image. The average brightness calculation step for performing the process of calculating the average image brightness for all the reference images selected in the image selection step, and a reference image in which the average image brightness calculated in the average brightness calculation step is a predetermined value or less. An image excluding step of excluding from the addition target in the brightness adding step.

第7の発明による画像処理プログラムは、上記第1の発明による画像処理プログラムにおいて、上記埃特定ステップが、上記処理対象画像の画素毎の明度と上記参照画像の画素毎の明度とを算出する明度算出ステップと、上記明度算出ステップにより算出された明度が所定値よりも小さい画素を抽出する画素抽出ステップと、上記画素抽出ステップにより抽出された画素を隣接する画素同士を同一のグループに含めるようにグループ化するグループ化ステップと、上記グループ化ステップによりグループ化された画素群の内で上記処理対象画像における画素群と上記参照画像における画素群とが該処理対象画像と全ての該参照画像とについて重なり合っている画素群の組み合わせを生成する組み合わせ生成ステップと、上記組み合わせ生成ステップにより生成された画素群の組み合わせの各々について画素群に含まれる画素の数が組み合わせに属する画素群の全てについて等しくなるように画像毎の明度を調整する明度調整ステップと、上記明度調整ステップにより画素数が等しくなった画素群について組み合わせに属する画素群の全てが重なり合っている部分の画素数の1つの画素群の画素数に対する比率を算出する比率算出ステップと、上記比率算出ステップにより算出された比率が所定値以上であるときに組み合わせに属する画素群が埃の画像部分を構成する埃画素群であると判定する判定ステップと、を含むことを特徴とする。   An image processing program according to a seventh invention is the image processing program according to the first invention, wherein the dust specifying step calculates a lightness for each pixel of the processing target image and a lightness for each pixel of the reference image. A calculation step, a pixel extraction step for extracting pixels whose brightness calculated by the brightness calculation step is smaller than a predetermined value, and pixels adjacent to the pixels extracted by the pixel extraction step are included in the same group. A grouping step for grouping, and a pixel group in the processing target image and a pixel group in the reference image among the pixel groups grouped by the grouping step are the processing target image and all the reference images A combination generation step for generating a combination of overlapping pixel groups, and the combination generation step A brightness adjustment step for adjusting the brightness for each image so that the number of pixels included in the pixel group is the same for all of the pixel groups belonging to the combination for each of the combinations of pixel groups generated by the step, and the brightness adjustment step The ratio calculation step for calculating the ratio of the number of pixels in the part where all of the pixel groups belonging to the combination overlap for the pixel group having the same number of pixels to the number of pixels in one pixel group, and the ratio calculation step. A determination step of determining that a pixel group belonging to the combination is a dust pixel group constituting a dust image portion when the ratio is equal to or greater than a predetermined value.

第8の発明による画像処理プログラムは、上記第7の発明による画像処理プログラムにおいて、上記埃特定ステップが、上記明度調整ステップにより画素数が等しくなった画素群の重心位置を組み合わせに属する画素群の全てについて算出する重心位置算出ステップをさらに含み、上記判定ステップは、上記比率算出ステップにより算出された比率が所定値以上であってかつ上記重心位置算出ステップにより算出された重心位置の内の最も離れた重心位置同士の差が所定値以下であるときに組み合わせに属する画素群が埃の画像部分を構成する埃画素群であると判定するステップであることを特徴とする。   An image processing program according to an eighth aspect of the present invention is the image processing program according to the seventh aspect, wherein the dust specifying step is performed for the pixel group belonging to the combination of the barycentric positions of the pixel groups having the same number of pixels by the brightness adjustment step. A centroid position calculating step for calculating all of the centroid positions is further included. When the difference between the centroid positions is equal to or less than a predetermined value, the pixel group belonging to the combination is a step of determining that the pixel group constituting the dust image portion is a dust pixel group.

第9の発明による画像処理プログラムは、上記第1の発明による画像処理プログラムにおいて、上記埃特定ステップと上記修復ステップとの少なくとも一方の処理情報を記憶する処理情報記憶ステップをさらに含み、上記埃特定ステップは、上記画像選択ステップにより選択された参照画像に関して上記処理情報記憶ステップにより記憶された処理情報が存在する場合には、上記処理情報を読み出す処理情報読出ステップと、上記処理対象画像の画素毎の明度を算出する明度算出ステップと、上記明度算出ステップにより算出された明度が所定値よりも小さい画素を抽出する画素抽出ステップと、上記画素抽出ステップにより抽出された画素を隣接する画素同士を同一のグループに含めるようにグループ化して埃候補画素群とするグループ化ステップと、上記処理情報読出ステップにより読み出された処理情報に含まれる埃画素群と上記埃候補画素群とが重なり合った組み合わせを生成する組み合わせ生成ステップと、上記組み合わせ生成ステップにより生成された組み合わせの各々について上記埃候補画素群に含まれる画素の数と上記埃画素群に含まれる画素の数とが等しくなるように処理対象画像の明度を調整する明度調整ステップと、上記明度調整ステップにより画素数が等しくなった埃候補画素群について埃画素群と重なり合った部分の画素数の埃画素群の画素数に対する比率を算出する比率算出ステップと、上記比率算出ステップにより算出された比率が所定値以上であるときに上記埃候補画素群が埃の画像部分を構成する埃画素群であると判定する判定ステップと、を含むことを特徴とする。   An image processing program according to a ninth invention further includes a processing information storage step for storing processing information of at least one of the dust specifying step and the repairing step in the image processing program according to the first invention, wherein the dust specifying When there is processing information stored by the processing information storage step with respect to the reference image selected by the image selection step, a processing information reading step for reading the processing information, and for each pixel of the processing target image The brightness calculation step for calculating the brightness of the pixel, the pixel extraction step for extracting a pixel whose brightness calculated by the brightness calculation step is smaller than a predetermined value, and the pixels adjacent to the pixels extracted by the pixel extraction step are the same. Grouping to include in a group of pixels to form a dust candidate pixel group A combination generation step for generating a combination in which the dust pixel group and the dust candidate pixel group included in the processing information read by the processing information reading step overlap each other, and the combination generated by the combination generation step. A brightness adjustment step for adjusting the brightness of the processing target image so that the number of pixels included in the dust candidate pixel group is equal to the number of pixels included in the dust pixel group, and the number of pixels by the brightness adjustment step. A ratio calculation step of calculating a ratio of the number of pixels overlapping the dust pixel group to the number of pixels of the dust pixel group with respect to the dust candidate pixel group having equality, and the ratio calculated by the ratio calculation step is a predetermined value or more A determination step of determining that the dust candidate pixel group is a dust pixel group constituting a dust image portion at a certain time; And wherein the Mukoto.

第10の発明による画像処理プログラムは、上記第9の発明による画像処理プログラムにおいて、上記埃特定ステップが、上記明度調整ステップにより画素数が等しくなった埃画素群の重心位置と埃候補画素群の重心位置とをそれぞれ算出する重心位置算出ステップをさらに含み、上記判定ステップは、上記比率算出ステップにより算出された比率が所定値以上であってかつ上記重心位置算出ステップにより算出された埃画素群の重心位置と埃候補画素群の重心位置との差が所定値以下であるときに該埃候補画素群が埃の画像部分を構成する埃画素群であると判定するステップであることを特徴とする。   An image processing program according to a tenth aspect of the invention is the image processing program according to the ninth aspect, wherein the dust specifying step includes the positions of the gravity center of the dust pixel group and the dust candidate pixel group in which the number of pixels is equalized by the brightness adjustment step A center-of-gravity position calculating step for calculating each of the center-of-gravity positions; and The step of determining that the dust candidate pixel group is a dust pixel group constituting a dust image portion when the difference between the gravity center position and the gravity center position of the dust candidate pixel group is equal to or less than a predetermined value. .

第11の発明による画像処理プログラムは、上記第1から第10の発明による画像処理プログラムにおいて、上記修復ステップが、上記埃特定ステップにより特定された埃の画像部分を含むように複数の領域を設定する領域設定ステップと、上記領域設定ステップにより設定された各領域について埃の画像部分を含まない部分の画素値の平均値およびばらつきを算出する平均ばらつき算出ステップと、上記平均ばらつき算出ステップにより算出されたばらつきが最も小さい領域を選択する領域選択ステップと、埃の画像部分の画素値を上記領域選択ステップにより選択された領域の埃の画像部分以外の部分の画素値により置き換える置換ステップと、を含むことを特徴とする。   An image processing program according to an eleventh aspect of the invention is the image processing program according to any of the first to tenth aspects of the invention, wherein the repair step sets a plurality of regions so as to include the dust image portion specified by the dust specifying step. A region setting step to calculate, an average variation calculating step for calculating an average value and variation of a pixel value of a portion not including a dust image portion for each region set by the region setting step, and the average variation calculating step. A region selection step for selecting a region having the smallest variation, and a replacement step for replacing the pixel value of the dust image portion with the pixel value of the portion other than the dust image portion of the region selected by the region selection step. It is characterized by that.

第12の発明による画像処理プログラムは、上記第11の発明による画像処理プログラムにおいて、上記平均ばらつき算出ステップにより算出するばらつきが、明度のばらつきであることを特徴とする。   An image processing program according to a twelfth invention is characterized in that, in the image processing program according to the eleventh invention, the variation calculated by the average variation calculating step is a variation in brightness.

第13の発明による画像処理プログラムは、上記第11または第12の発明による画像処理プログラムにおいて、上記ばらつきが、分散であることを特徴とする。   An image processing program according to a thirteenth invention is the image processing program according to the eleventh or twelfth invention, wherein the variation is dispersion.

第14の発明による画像処理プログラムは、上記第11から第13の発明による画像処理プログラムにおいて、上記修復ステップが、上記領域設定ステップにより設定された各領域を埃の画像部分を1つの部分領域に含むように複数の部分領域に分割する部分領域設定ステップをさらに含み、上記平均ばらつき算出ステップは上記領域設定ステップにより設定された各領域について上記部分領域設定ステップにより分割された部分領域の内の埃の画像部分を含まない各部分領域の画素値の平均値およびばらつきを算出するステップであり、上記領域設定ステップにより設定された各領域毎に上記平均ばらつき算出ステップにより算出された各部分領域の画素値のばらつきを加算することによりばらつき和を算出するばらつき和算出ステップをさらに含み、上記領域選択ステップは上記ばらつき和算出ステップにより算出されたばらつき和が最も小さい領域を選択するステップであり、上記領域選択ステップにより選択された領域の埃の画像部分を含まない部分領域の画素値の平均値とばらつきとの少なくとも一方に基づいて埃の画像部分を含む部分領域の画素値の推定値を算出する推定値算出ステップをさらに含み、上記置換ステップは埃の画像部分の画素値を上記領域選択ステップにより選択された領域の埃の画像部分を含む部分領域に隣接する部分領域の画素値により置き換えるステップであり、上記置換ステップにより置き換えた埃の画像部分の画素値に置き換えた後の埃の画像部分の画素値の平均値と上記推定値算出ステップにより算出された画素値の平均値との差を加算する画素値加算ステップをさらに含むことを特徴とする。   An image processing program according to a fourteenth aspect of the invention is the image processing program according to any of the eleventh to thirteenth aspects of the invention, wherein the restoration step converts each area set by the area setting step into a partial image area of dust. The method further includes a partial region setting step of dividing into a plurality of partial regions so that the average variation calculation step includes dust in the partial regions divided by the partial region setting step for each region set by the region setting step. A pixel value of each partial region calculated by the average variation calculation step for each region set by the region setting step. The variation sum calculation step of calculating the variation sum by adding the variation of values And the region selecting step is a step of selecting a region having the smallest variation sum calculated by the variation sum calculating step, and a partial region not including the dust image portion of the region selected by the region selecting step. An estimated value calculating step of calculating an estimated value of the pixel value of the partial area including the dust image portion based on at least one of the average value and the variation of the pixel value of the pixel value, wherein the replacing step includes a pixel of the dust image portion The value is replaced with the pixel value of the partial region adjacent to the partial region including the dust image portion of the region selected by the region selection step, and is replaced with the pixel value of the dust image portion replaced by the replacement step. Add the difference between the average pixel value of the image part of the dust after and the average pixel value calculated in the estimated value calculation step. And further comprising a pixel value addition step that.

第15の発明による画像処理プログラムは、上記第1から第14の発明による画像処理プログラムにおいて、上記修復ステップによる修復を行う前の画像と該修復ステップによる修復を行った後の画像とを比較し得るように表示する確認画像表示ステップと、上記修復ステップによる修復を取り消す選択が行われたときに処理対象画像を修復を行う前の画像に戻す修復取り消しステップと、をさらに含むことを特徴とする。   An image processing program according to a fifteenth aspect of the present invention is the image processing program according to any of the first to fourteenth aspects of the present invention, which compares an image before the restoration by the restoration step with an image after the restoration by the restoration step. A confirmation image display step for displaying the image to be obtained, and a restoration cancellation step for returning the image to be processed to the image before the restoration when the restoration for the restoration by the restoration step is selected. .

第16の発明による画像処理プログラムは、上記第1から第15の発明による画像処理プログラムにおいて、上記処理対象画像を、同一の撮像装置により撮影された画像の中で順次変更することにより、複数の画像についての処理を順次行うことを特徴とする。   An image processing program according to a sixteenth aspect of the present invention is the image processing program according to any one of the first to fifteenth aspects, wherein the processing target image is changed in sequence among images captured by the same imaging device, so that a plurality of images are processed. It is characterized by sequentially performing processing on images.



第17の発明による画像処理方法は、撮像装置により撮影された画像から該画像に含まれ得る埃の画像部分を画像処理により除去するための画像処理方法であって、処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から撮影日時が該処理対象画像に近い順に1以上の画像を参照画像として選択する画像選択ステップと、上記処理対象画像と上記参照画像との両方において略同一位置に存在する埃の画像部分を特定する埃特定ステップと、上記埃特定ステップにより特定された処理対象画像における埃の画像部分を該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復ステップと、を含むことを特徴とする。


An image processing method according to a seventeenth aspect of the present invention is an image processing method for removing, by image processing, an image portion of dust that can be included in an image taken by an imaging device, and taking an image of a processing target image An image selection step of selecting one or more images as reference images in order of photographing date and time from the one or more images photographed by the same imaging device as the device, the processing target image and the reference image And a dust specifying step for specifying an image portion of dust existing at substantially the same position, and a dust image portion in the processing target image specified by the dust specifying step as a part of the dust image portion in the processing target image. And a repairing step of repairing using image information in the vicinity.

第18の発明による画像処理装置は、撮像装置により撮影された画像から、該画像に含まれ得る埃の画像部分を画像処理により除去するための画像処理装置であって、処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から撮影日時が該処理対象画像に近い順に1以上の画像を参照画像として選択する画像選択手段と、上記処理対象画像と上記参照画像との両方において略同一位置に存在する埃の画像部分を特定する埃特定手段と、上記埃特定手段により特定された処理対象画像における埃の画像部分を該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復手段と、を具備したものである。   An image processing apparatus according to an eighteenth aspect of the present invention is an image processing apparatus for removing, from an image captured by an imaging apparatus, an image portion of dust that can be included in the image, by capturing an image to be processed. An image selection means for selecting one or more images as reference images in order of the shooting date and time from the one or more images captured by the same imaging device as the imaging device; the processing target image; and the reference A dust specifying means for specifying an image portion of dust existing at substantially the same position in both of the images, and an image portion of the dust in the processing target image specified by the dust specifying means as the dust image portion in the processing target image And repairing means for repairing using image information in the vicinity of.

本発明の画像処理プログラム、画像処理方法、画像処理装置によれば、撮像装置により撮影された画像から、埃の画像部分を特定して良好に修復することができる。   According to the image processing program, the image processing method, and the image processing apparatus of the present invention, it is possible to identify and properly repair the dust image portion from the image captured by the imaging apparatus.

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

図1から図7は本発明の実施例1を示したものであり、図1は画像処理装置の要部の構成を示すブロック図である。   FIGS. 1 to 7 show Embodiment 1 of the present invention, and FIG. 1 is a block diagram showing a configuration of a main part of the image processing apparatus.

この画像処理装置は、例えばパーソナルコンピュータ等の一般的な情報処理装置とほぼ同様に構成されており、該情報処理装置において画像処理プログラムを実行することにより、画像処理装置として機能し、あるいは、画像処理方法が実施されているということができる。   This image processing apparatus is configured in substantially the same manner as a general information processing apparatus such as a personal computer, for example, and functions as an image processing apparatus by executing an image processing program in the information processing apparatus. It can be said that the processing method is implemented.

すなわち、この画像処理装置は、図1に示すように、処理部1と、プログラムメモリ2と、画像メモリ3と、操作部4と、表示部5と、バス7と、を有して構成されている。   That is, as shown in FIG. 1, the image processing apparatus includes a processing unit 1, a program memory 2, an image memory 3, an operation unit 4, a display unit 5, and a bus 7. ing.

上記操作部4は、この画像処理装置に係る操作入力を行うための操作手段であり、例えば、マウスやキーボード等の入力デバイスを介して、表示部5に表示された操作ボタン等を操作することにより、操作部として機能するように構成されている。この操作部4からの操作に応じて、埃による画像の欠落部分を補正したり、補正後の画像を表示したりすることができるようになっている。   The operation unit 4 is an operation means for performing an operation input related to the image processing apparatus. For example, an operation button or the like displayed on the display unit 5 is operated via an input device such as a mouse or a keyboard. Therefore, it is configured to function as an operation unit. In accordance with the operation from the operation unit 4, it is possible to correct a missing part of the image due to dust or to display a corrected image.

上記画像メモリ3は、図示しない撮像装置により撮影された後に通信回線やメモリカード等を介して伝送された画像データを、記憶するための画像記憶手段である。また、この画像メモリ3は、後述するような埃部分の除去を行った後の画像データも記憶し得るようになっている。   The image memory 3 is an image storage means for storing image data transmitted through a communication line or a memory card after being photographed by an imaging device (not shown). Further, the image memory 3 can also store image data after the dust portion is removed as described later.

上記表示部5は、上記画像メモリ3に記憶されている画像を表示したり、該画像における埃部分の処理を行うための操作ボタン等を表示したりするための表示手段であり、それ以外にも、この画像処理装置に係る各種の情報等を表示することができるようになっている。   The display unit 5 is a display means for displaying an image stored in the image memory 3 or displaying an operation button or the like for processing a dust portion in the image. In addition, various information related to the image processing apparatus can be displayed.

上記プログラムメモリ2は、画像処理プログラムを記憶するとともに、該画像処理プログラムを実行しているときの各種データ等も記憶し得るプログラム記憶手段である。   The program memory 2 is a program storage unit that stores an image processing program and can also store various data when the image processing program is executed.

上記処理部1は、上記プログラムメモリ2に記憶されている画像処理プログラムを実行することにより、上記操作部4からの操作入力等に応じて、上記画像メモリ3に記憶されている画像データから埃部分の検出や補正を行ったり、該処理前後の画像を上記表示部5に表示させたりする処理手段であり、この画像処理装置内の各回路を制御する制御手段も兼ねたものとなっている。この処理部1は、さらに、画像選択手段、埃特定手段、修復手段、を兼ねている。   The processing unit 1 executes the image processing program stored in the program memory 2 to detect dust from the image data stored in the image memory 3 in response to an operation input from the operation unit 4. This is a processing means for detecting and correcting a part, and displaying the images before and after the processing on the display unit 5, and also serves as a control means for controlling each circuit in the image processing apparatus. . The processing unit 1 further serves as an image selection unit, a dust identification unit, and a restoration unit.

上記バス7は、上記処理部1、プログラムメモリ2、画像メモリ3、操作部4、表示部5、を互いに双方向に通信可能に接続するものである。   The bus 7 connects the processing unit 1, the program memory 2, the image memory 3, the operation unit 4, and the display unit 5 so that they can communicate with each other bidirectionally.

次に、図2は、埃除去処理の概要を示すフローチャートである。   Next, FIG. 2 is a flowchart showing an outline of dust removal processing.

この処理を開始すると、まず、処理対象画像を撮影したカメラと、該処理対象画像を撮影したときの撮影モードおよび撮影日時と、を特定する(ステップS1)。ここで、撮影モードとは、例えば、画像の画素構成(つまり、縦方向の画素数および横方向の画素数)等の、撮影画像上の埃の形状が変化してしまう要因となり得るカメラの撮影パラメータの各設定のことを指している。また、「撮影日時」とは、画像が撮影された、年、月、日、時、分、秒等の時間的概念を広く含むものである。   When this process is started, first, the camera that has captured the processing target image and the shooting mode and the shooting date and time when the processing target image was captured are specified (step S1). Here, the shooting mode refers to, for example, camera shooting that may cause the shape of dust on the captured image to change, such as the pixel configuration of the image (that is, the number of pixels in the vertical direction and the number of pixels in the horizontal direction). Refers to each parameter setting. The “shooting date / time” widely includes time concepts such as year, month, day, hour, minute, and second when the image is taken.

次に、処理対象画像を撮影したカメラと同一のカメラにより、同一の撮影モードで撮影された画像の中から、撮影日時が近接している画像を参照画像として複数選択する(ステップS2)。具体的には、処理対象画像の撮影日時と最も撮影日時が近い画像から順に、所定の複数枚の画像を選択する処理を行う。   Next, a plurality of images close in shooting date and time are selected as reference images from images shot in the same shooting mode by the same camera that shot the processing target image (step S2). Specifically, a process of selecting a plurality of predetermined images is performed in order from the image having the closest shooting date / time to the shooting date / time of the processing target image.

そして、埃を特定する処理を行い(ステップS3)、自動埃除去処理を行い(ステップS4)、処理結果の確認を行い(ステップS5)、処理結果の画像を保存してから(ステップS6)、この処理を終了する。   Then, a process for identifying dust is performed (step S3), an automatic dust removal process is performed (step S4), a processing result is confirmed (step S5), and an image of the processing result is stored (step S6). This process ends.

次に、図3は、上記図2のステップS3における埃特定処理の例を示すフローチャートである。   Next, FIG. 3 is a flowchart showing an example of the dust specifying process in step S3 of FIG.

この処理を開始すると、選択した複数の画像(すなわち、処理対象画像および参照画像)について、それぞれの画像の画素毎の明るさを示す明度Yを、各画素の画素値であるRGB色度値に基づいて、例えば次の数式1に示すように算出する(ステップS11)。●
[数1]
Y=R+G+B
これにより、画素毎の明度Yが与えられている明度画像データが、選択された画像の枚数だけ算出される。
When this process is started, for a plurality of selected images (that is, the processing target image and the reference image), the brightness Y indicating the brightness of each pixel of each image is changed to the RGB chromaticity value that is the pixel value of each pixel. Based on this, for example, the calculation is performed as shown in the following formula 1 (step S11). ●
[Equation 1]
Y = R + G + B
Thereby, the brightness image data to which the brightness Y for each pixel is given is calculated by the number of selected images.

続いて、選択された複数の画像に各対応して算出された明度画像データを、同一位置の画素毎に加算する(ステップS12)。これにより、画素毎に明度Yが加算された加算明度画像データが1枚算出される。   Subsequently, brightness image data calculated corresponding to each of the selected plurality of images is added for each pixel at the same position (step S12). Thereby, one piece of added brightness image data in which the brightness Y is added for each pixel is calculated.

そして、各画素について、明度Yの加算値が所定値以下となる画素を、埃が付着した画素であるとする(ステップS13)。埃は、同一解像度の画像では同一位置に存在すると推定できるために、ここでは、異なるシーンを撮影した複数の画像の画素データを加算した後でも黒色であり続ける点を、埃による点であると判断するようにしている。   Then, for each pixel, a pixel having an added value of brightness Y that is equal to or smaller than a predetermined value is a pixel to which dust is attached (step S13). Since dust can be estimated to exist at the same position in images of the same resolution, here, the point that remains black even after adding pixel data of a plurality of images obtained by shooting different scenes is a point due to dust. I try to judge.

その後、埃画素をラベリング処理により埃画素群(グループ)に分離する(ステップS14)。1つの埃により、複数画素に渡った画像データの欠落領域が生じることが考えられるために、どの欠落領域が、1つの埃により生じたのかをここでは分類している。また、ラベリング処理は、一般的に知られている方法を用いることができ、上記ステップS13において埃が付着したと推定された画素の内の、互いに隣接する画素に同一のラベルを付し、一連のラベルが付された画素とは孤立した位置にある、埃が付着したと推定された他の画素について、次の番号のラベルを振る、といった処理を行うことにより、埃画素群の分離を行うことができる。   Thereafter, the dust pixels are separated into dust pixel groups (groups) by a labeling process (step S14). Since it is conceivable that a missing area of image data over a plurality of pixels is generated by one dust, it is classified here which missing area is caused by one dust. For the labeling process, a generally known method can be used, and among the pixels estimated to have dust attached in step S13, the pixels adjacent to each other are labeled with the same label, The dust pixel group is separated by performing processing such as waving a label with the next number on another pixel that is in an isolated position from the pixel labeled with, and that is estimated to have dust attached thereto. be able to.

そして、各埃に対応する画素群の位置と大きさとを特定して(ステップS15)、この埃特定の処理を終了する。   Then, the position and size of the pixel group corresponding to each dust is specified (step S15), and this dust specifying process is terminated.

次に、図4は上記図2のステップS4における自動埃除去処理の例を示すフローチャート、図5は埃画素群を含むように設定された複数形状の小領域を示す図である。   Next, FIG. 4 is a flowchart showing an example of automatic dust removal processing in step S4 of FIG. 2, and FIG. 5 is a diagram showing small areas of a plurality of shapes set so as to include dust pixel groups.

図4に示す処理を開始すると、まず、ラベリングされた画素群でなる埃の内の、第1の埃を注目埃とする(ステップS21)。   When the process shown in FIG. 4 is started, first, the first dust in the dust of the labeled pixel group is set as the noticeable dust (step S21).

そして、この注目埃に対して、埃画素群を含む複数形状の小領域を、図5に示すように設定する(ステップS22)。この図5に示す例では、埃画素群TGを含むように、縦方向の長方形をなす第1の領域R1、横方向の長方形をなす第2の領域R2、右斜め方向の長方形なす第3の領域R3、左斜め方向の長方形をなす第4の領域R4がそれぞれ設定されている。   Then, for the target dust, a plurality of small regions including dust pixel groups are set as shown in FIG. 5 (step S22). In the example shown in FIG. 5, a first region R1 that forms a vertical rectangle, a second region R2 that forms a horizontal rectangle, and a third rectangle that forms a right diagonal rectangle so as to include the dust pixel group TG. A region R3 and a fourth region R4 forming a rectangular shape in the diagonally left direction are set.

続いて、第1の領域R1を注目領域として(ステップS23)、この注目領域で埃以外の画素のRGB値の平均値と分散値とを算出する(ステップS24)。   Subsequently, the first region R1 is set as a region of interest (step S23), and an average value and a variance value of RGB values of pixels other than dust in the region of interest are calculated (step S24).

そして、全ての領域についてRGB値の平均値と分散値とを算出したか否かを判断し(ステップS25)、まだである場合には、次の領域を注目領域として(ステップS26)、上記ステップS24へ行って該次の領域について上述したような処理を行う。   Then, it is determined whether or not the average value and the variance value of the RGB values have been calculated for all the regions (step S25). If not, the next region is set as the attention region (step S26), and the above steps are performed. The process proceeds to S24 and the above-described process is performed for the next area.

また、上記ステップS25において、全ての領域についての算出が終了したと判断された場合には、注目埃を含む各領域R1〜R4の中で、分散値が最小となる領域を選択する(ステップS27)。   If it is determined in step S25 that the calculation has been completed for all the regions, the region having the smallest variance value is selected from the regions R1 to R4 including the target dust (step S27). ).

その後、選択した領域の埃画素群以外の画素のRGB値の平均値により、埃画素群のRGB値を置き換える(ステップS28)。   Thereafter, the RGB value of the dust pixel group is replaced with the average value of the RGB values of the pixels other than the dust pixel group in the selected region (step S28).

そして、全ての埃について処理が終了したか否かを判断し(ステップS29)、まだである場合には、次の埃を注目埃として(ステップS30)、上記ステップS22へ行って上述したような処理を繰り返して行う。   Then, it is determined whether or not the processing has been completed for all dust (step S29). If not, the next dust is set as the noticeable dust (step S30), and the process proceeds to step S22 as described above. Repeat the process.

こうして、ステップS29において、全ての埃について処理を行ったと判断された場合には、この処理を終了する。   Thus, if it is determined in step S29 that all dust has been processed, this processing ends.

次に、図6は上記図2のステップS5における処理結果の確認処理の例を示すフローチャート、図7は画像処理プログラムにより表示部に表示された確認画面の様子を示す図である。   Next, FIG. 6 is a flowchart showing an example of processing result confirmation processing in step S5 of FIG. 2, and FIG. 7 is a diagram showing a confirmation screen displayed on the display unit by the image processing program.

処理の流れを説明する前に、まず、表示部5における確認画面11の構成について、図7を参照して説明する。   Before describing the flow of processing, first, the configuration of the confirmation screen 11 in the display unit 5 will be described with reference to FIG.

この確認画面11は、例えばグラフィックユーザインターフェースを備えたマルチウィンドウタイプのオペレーティングシステム上で、1つのウィンドウとして表示される画面を示したものである。   The confirmation screen 11 shows a screen displayed as one window on a multi-window type operating system having a graphic user interface, for example.

該確認画面11は、例えば左側に処理対象となる原画像の埃部分の拡大画像12を表示するとともに、右側に埃除去の処理を行った後の拡大画像13を表示するようになっている。さらに、該確認画面11の例えば左下には、処理対象画像において、埃領域と見なされた画素のグループが全部で幾つあり、その中の幾つの埃領域についての処理が現在までに終了しているかを示す確認済み埃領域数表示14が表示されている。この確認済み埃領域数表示14の右側となる確認画面1内には、さらに、拡大画像13として表示された埃除去処理の結果を取り消すための取り消しボタン15と、次の埃領域を処理対処とするための次へボタン16と、この埃除去処理の確認を終了するための終了ボタン17と、が操作可能に表示されている。   The confirmation screen 11 displays, for example, an enlarged image 12 of the dust portion of the original image to be processed on the left side, and an enlarged image 13 after dust removal processing is performed on the right side. Further, for example, in the lower left of the confirmation screen 11, there are a total number of pixel groups regarded as dust regions in the processing target image, and how many dust regions in the group have been processed so far. A confirmed dust area number display 14 is displayed. In the confirmation screen 1 on the right side of the confirmed dust area number display 14, a cancel button 15 for canceling the result of the dust removal process displayed as the enlarged image 13 and the next dust area are processed. Next button 16 for performing and end button 17 for ending the confirmation of the dust removal processing are displayed to be operable.

続いて、図6に示す処理について説明する。この処理を開始すると、まず、図7に示すような確認画面11を表示する(ステップS31)。   Next, the process shown in FIG. 6 will be described. When this process is started, first, a confirmation screen 11 as shown in FIG. 7 is displayed (step S31).

そして、原画像の第1の埃部分の拡大画像12と、処理後の拡大画像13と、を生成して表示する(ステップS32)。   Then, the enlarged image 12 of the first dust portion of the original image and the enlarged image 13 after processing are generated and displayed (step S32).

その後、上記操作部4を介して、操作入力が行われるのを待機する。ここで、次へボタン16が押されたことを検出した場合には(ステップS33)、全ての埃部分について確認したか否かを判断し(ステップS34)、まだ全ての埃部分についての確認が行われていない場合には、原画像の次の埃部分の拡大画像12と、処理後の拡大画像13と、を生成して表示してから(ステップS35)、操作入力が行われるのを待機する上記状態へ戻る。   Thereafter, it waits for an operation input to be made via the operation unit 4. If it is detected that the next button 16 has been pressed (step S33), it is determined whether or not all dust parts have been confirmed (step S34), and all dust parts have been confirmed. If not, the enlarged image 12 of the next dust portion of the original image and the enlarged image 13 after processing are generated and displayed (step S35), and the operation input is waited for. Return to the above state.

また、取り消しボタン15が押されたことを検出した場合には(ステップS36)、注目埃部分を対応する原画像の部分で置き換えて、つまり処理前の状態に戻す(ステップS37)。その後は、上記ステップS34へ行って、上述したような処理を行う。   If it is detected that the cancel button 15 has been pressed (step S36), the target dust portion is replaced with the corresponding original image portion, that is, the state before processing is restored (step S37). After that, the process goes to step S34 to perform the process as described above.

そして、終了ボタン17が押されたことを検出した場合(ステップS38)、または、上記ステップS34において全ての埃部分について確認したと判断された場合には、この処理を終了する。   Then, when it is detected that the end button 17 has been pressed (step S38), or when it is determined that all dust portions have been confirmed in step S34, this processing is ended.

なお、上述では、画素の画素値としてRGB値を例に挙げているが、必ずしもこれに限るものではない。さらに、複数の領域の中から、画素値のばらつきが最も小さい領域を検出する際に、ばらつきを示す指標として分散値を用いているが、これに限るものではなく、その他の統計量を用いることも可能である。ただし、このときには、ばらつきを良好に表現するような統計量であって、かつ演算処理を高速に行うことができるような統計量を用いると良い。   In the above description, the RGB value is taken as an example of the pixel value of the pixel, but it is not necessarily limited to this. Furthermore, the variance value is used as an index indicating the variation when detecting the region having the smallest variation in pixel values from a plurality of regions, but this is not a limitation, and other statistics are used. Is also possible. However, at this time, it is preferable to use a statistic that can express the variation satisfactorily and that can perform arithmetic processing at high speed.

このような実施例1によれば、撮影後の画像に基づいて、埃に起因する画像の欠落部分を検出して、良好に補正することができる。   According to the first embodiment, it is possible to detect a missing part of an image due to dust and correct it on the basis of an image after photographing.

このとき、同一のカメラにより同一の撮影モードで撮影された画像の中から、撮影日時の近い複数の画像を用いて、これらの画像に共通していると考えられる埃部分を取り除くようにしているために、カメラで白色の被写体等を撮影して埃検出を行う等の必要がなくなる。これにより、撮影時の操作が簡単になるとともに、埃検出のための基準画像を撮影する必要がなく、また、埃検出機能を備えた撮像装置において埃検出の操作を行うのを忘れた画像であっても、後で、埃部分を取り除くことが可能となる。   At this time, a plurality of images close to the shooting date and time are used to remove dust portions that are considered to be common to these images from images shot with the same camera in the same shooting mode. Therefore, it is not necessary to detect dust by photographing a white subject or the like with a camera. This simplifies the operation at the time of shooting, eliminates the need for shooting a reference image for dust detection, and is an image forgetting to perform the dust detection operation in an imaging device having a dust detection function. Even if it exists, it becomes possible to remove a dust part later.

そして、複数の画像について、同一位置の画素毎に画素値を加算することにより埃を検出するようにしているために、より高い精度で埃を検出することが可能となる。   Since dust is detected by adding pixel values for each pixel at the same position in a plurality of images, it is possible to detect dust with higher accuracy.

また、画像における埃部分を含むように複数の異なる領域を設定し、これらの領域の中から最もばらつきが小さい領域を見つけて、該領域のデータを用いて補正を行うようにしているために、該埃部分のデータを置き換えるのに最も確からしいと考えられるデータを用いることができ、補正の精度や信頼性を向上することができる。このとき、複数の異なる領域を、該埃部分を含む異なる方向にとることにより、エッジ等が存在したとしても、その影響を最も受け難い方向を選択することが可能となる。   In addition, since a plurality of different areas are set so as to include a dust portion in the image, an area with the smallest variation is found from these areas, and correction is performed using the data of the area. Data considered most likely to replace the dust portion data can be used, and the correction accuracy and reliability can be improved. At this time, by taking a plurality of different areas in different directions including the dust portion, it is possible to select a direction that is least susceptible to the influence even if there is an edge or the like.

さらに、自動埃除去の処理結果の画像を、処理前の画像と並べて表示するようにしたために、容易に比較して確認し、誤って埃として処理した部分を処理前の状態に戻すことができる。   Furthermore, since the image of the automatic dust removal processing result is displayed side by side with the pre-processing image, it can be easily compared and confirmed, and the part that has been mistakenly processed as dust can be returned to the state before the processing. .

図8から図12は本発明の実施例2を示したものであり、図8は埃除去処理の概要を示すフローチャートである。   8 to 12 show Embodiment 2 of the present invention, and FIG. 8 is a flowchart showing an outline of dust removal processing.

この実施例2において、上述の実施例1と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the second embodiment, the same parts as those of the first embodiment are denoted by the same reference numerals and the description thereof is omitted, and only different points will be mainly described.

上記図2に示した埃除去処理は、1つの処理対象画像を処理するために他の画像を利用するものであったが、この図8に示す埃除去処理は、同一の埃が付着している可能性のある複数の画像をまとめて自動的に処理するものとなっている。   The dust removal process shown in FIG. 2 uses another image to process one processing target image. However, the dust removal process shown in FIG. A plurality of images that may be present are automatically processed together.

この処理を開始すると、まず、同一のカメラにより、同一の撮影モードで撮影された画像の中から、撮影日時に近い複数の画像を処理対象画像として選択する(ステップS41)。   When this process is started, first, a plurality of images close to the shooting date and time are selected as images to be processed from images shot by the same camera in the same shooting mode (step S41).

そして、選択した各画像について、埃を特定する処理を行う(ステップS42)。   Then, a process for identifying dust is performed for each selected image (step S42).

その後、第1の画像を処理対象画像に設定して(ステップS43)、自動埃除去処理を行い(ステップS44)、処理結果を確認して(ステップS45)、処理結果の画像を保存する(ステップS46)。   Thereafter, the first image is set as a processing target image (step S43), automatic dust removal processing is performed (step S44), the processing result is confirmed (step S45), and the processing result image is stored (step S44). S46).

続いて、上記ステップS41で選択した全ての画像について処理を行ったか否かを判断し(ステップS47)、まだ未処理の画像がある場合には、次の画像を処理対象画像として(ステップS48)、上記ステップS44へ戻って上述したような処理を繰り返して行う。   Subsequently, it is determined whether or not all the images selected in step S41 have been processed (step S47). If there is an unprocessed image, the next image is set as a processing target image (step S48). The process returns to step S44 and the above-described processing is repeated.

一方、上記ステップS47において、全ての画像について処理を行ったと判断される場合には、この処理を終了する。   On the other hand, if it is determined in step S47 that all the images have been processed, this processing ends.

図9は、上記図8のステップS42における埃特定の処理の一例を示すフローチャートである。   FIG. 9 is a flowchart showing an example of dust identification processing in step S42 of FIG.

この処理を開始すると、選択した複数の画像について、それぞれの画像の画素毎の明るさを示す明度Yを、各画素のRGB色度値に基づいて、例えば上記数式1に示すように算出する(ステップS51)。   When this processing is started, for a plurality of selected images, brightness Y indicating the brightness of each pixel of each image is calculated based on the RGB chromaticity value of each pixel, for example, as shown in Equation 1 above ( Step S51).

次に、その結果を用いて画像毎の明度Yの平均値(画像平均明度)を算出する(ステップS52)。これにより、1枚の画像毎に平均の明度Yが算出されることになる。   Next, the average value of the brightness Y for each image (image average brightness) is calculated using the result (step S52). As a result, the average brightness Y is calculated for each image.

そして、算出された明度Yの平均値が、所定値以下となる画像を除外する(ステップS53)。   Then, an image in which the calculated average value of brightness Y is equal to or less than a predetermined value is excluded (step S53).

このステップS53の処理を行った後に残った複数の画像について、明度Yを、同一位置の画素毎に加算する(ステップS54)。これにより、画素毎に明度Yが加算された加算明度画像データが1枚算出される。   For a plurality of images remaining after the processing of step S53, the brightness Y is added for each pixel at the same position (step S54). Thereby, one piece of added brightness image data in which the brightness Y is added for each pixel is calculated.

その後、この加算明度画像データの各画素について、明度Yの加算値が所定値以下となる画素を、埃が付着した画素であるとする(ステップS55)。   After that, for each pixel of the added brightness image data, a pixel in which the added value of brightness Y is equal to or less than a predetermined value is a pixel to which dust has adhered (step S55).

さらに、埃画素をラベリング処理により埃画素群(グループ)に分離し(ステップS56)、各埃に対応する画素群の位置と大きさとを特定して(ステップS57)、この埃特定の処理を終了する。   Further, the dust pixels are separated into dust pixel groups (groups) by a labeling process (step S56), the position and size of the pixel group corresponding to each dust are specified (step S57), and the dust specifying process is terminated. To do.

図10は、上記図8のステップS42における埃特定の処理の他の例を示すフローチャートである。   FIG. 10 is a flowchart showing another example of the dust specifying process in step S42 of FIG.

この処理を開始すると、まず、同一のカメラにより、同一の撮影モードで撮影された画像から、続けて撮影された2枚の画像について、各画素のRGB値から明度Yを上記数式1に示したように算出する(ステップS61)。ここで、続けて撮影された2枚の画像とは、連写された画像という意味ではなく、第1の画像が撮影された時間と第2の画像が撮影された時間との間の時間に撮影された画像がない、という意味である。   When this process is started, first, the brightness Y from the RGB value of each pixel is shown in Equation 1 above for two images taken successively from the same camera in the same shooting mode. (Step S61). Here, the two images photographed in succession do not mean a continuously photographed image, but a time between the time when the first image was photographed and the time when the second image was photographed. It means that there is no photographed image.

次に、各画像について、画素の明度Yが所定の閾値以下の画素を抽出し(ステップS62)、各画素について、抽出した画素をラベリング処理により埃候補の画素群としてグループ化する(ステップS63)。   Next, for each image, pixels whose pixel brightness Y is equal to or less than a predetermined threshold are extracted (step S62), and for each pixel, the extracted pixels are grouped as a dust candidate pixel group by a labeling process (step S63). .

そして、各画像について、それぞれの埃候補画素群の重心位置を算出する(ステップS64)。   Then, the gravity center position of each dust candidate pixel group is calculated for each image (step S64).

次に、図8のステップS41において選択された画像の中で、最も古い時期に撮影された画像を第1の画像とし、この第1の画像の次に撮影された画像を第2の画像とする(ステップS65)。   Next, among the images selected in step S41 in FIG. 8, the image captured at the oldest time is set as the first image, and the image captured next to the first image is defined as the second image. (Step S65).

その後、第1の画像の埃候補画素群が、第2の画像の埃候補画素群と重なり合う組み合わせを抽出する(ステップS66)。すなわち、第1の画像と第2の画像とで埃候補がほぼ同じ位置にあるものを抽出したことになる。   Thereafter, a combination in which the dust candidate pixel group of the first image overlaps with the dust candidate pixel group of the second image is extracted (step S66). That is, the first image and the second image in which the dust candidates are at substantially the same position are extracted.

続いて、ステップS66で抽出した各組み合わせについて、第1の画像の埃候補画素群の重心位置と、第2の画像の埃候補画素群の重心位置と、の差が第1の所定の値以下で、画素数が多い埃候補画素群の面積に対する、それら画素群の重なり合う面積の割合が第2の所定の値以上であるものを埃として特定する(ステップS67)。   Subsequently, for each combination extracted in step S66, the difference between the centroid position of the dust candidate pixel group of the first image and the centroid position of the dust candidate pixel group of the second image is equal to or less than a first predetermined value. Thus, the dust having a ratio of the overlapping area of the pixel groups with respect to the area of the dust candidate pixel group having a large number of pixels is specified as dust (step S67).

なお、埃の種類や撮影条件の差によっては、同一の埃であってもその埃の周辺部分の明るさが変化することがある。そのために、埃候補画素群の画素数に大きな差がある場合には、埃候補画素群の画素数の多い画像の明度を上げ、または画素数の少ない画像の明度を下げる処理を加えて、これらの画素数の差がなくなるようにした後に、上記ステップS67を実行するようにしても良い。   Depending on the type of dust and the photographing conditions, the brightness of the peripheral portion of the dust may change even with the same dust. For this reason, when there is a large difference in the number of pixels in the dust candidate pixel group, the brightness of an image with a large number of pixels in the dust candidate pixel group is increased, or processing for decreasing the brightness of an image with a small number of pixels is added. After eliminating the difference in the number of pixels, step S67 may be executed.

次に、第2の画像が図8のステップS41において選択された画像の中で最後に撮影されたものであるか否かを判定し(ステップS68)、最後に撮影されたものでない場合には、第2の画像を新たに第1の画像とするとともに、この画像の次に撮影された画像を新たに第2の画像として(ステップS69)、上記ステップS66に戻って上述したような処理を繰り返して行う。   Next, it is determined whether or not the second image has been taken last in the image selected in step S41 in FIG. 8 (step S68). The second image is newly set as the first image, and the next image is taken as the second image (step S69), and the process as described above is performed by returning to step S66. Repeat.

一方、上記ステップS68において、最後に撮影された画像であると判定された場合には、上記ステップS41において選択された全ての画像の埃を特定したとして、この処理を終了する。   On the other hand, if it is determined in step S68 that the image has been taken last, it is determined that all the images selected in step S41 have been identified, and the process ends.

次に、図11は、上記図8のステップS44における自動埃除去処理の例を示すフローチャート、図12は埃画素群を含むように設定された複数の長方形領域を示す図である。   Next, FIG. 11 is a flowchart showing an example of automatic dust removal processing in step S44 of FIG. 8, and FIG. 12 is a diagram showing a plurality of rectangular areas set to include dust pixel groups.

図11に示す処理を開始すると、まず、ステップS42において特定された埃の内の、第1の埃を注目埃とする(ステップS71)。   When the process shown in FIG. 11 is started, first, the first dust among the dusts identified in step S42 is set as attention dust (step S71).

そして、この注目埃に対して、角度が異なる複数の長方形領域RAを、図12に示すように設定する(ステップS72)。この長方形領域RAは、複数の部分領域PAに分割されており、分割した部分領域PAの1つに上記注目埃の画像部分を含むように設定される。この図12に示す例では、長方形領域RAは略正方形状をなす5つの部分領域PAを直線上に配列して構成されている。そして、一端側にある部分領域PAに埃画素群TGを含むように、下方向、右斜め下方向、右方向、の3方向を向く3つの長方形領域がそれぞれ設定されている。   Then, a plurality of rectangular areas RA having different angles are set as shown in FIG. 12 with respect to this noticeable dust (step S72). The rectangular area RA is divided into a plurality of partial areas PA, and is set so as to include the image portion of the noted dust in one of the divided partial areas PA. In the example shown in FIG. 12, the rectangular area RA is configured by arranging five partial areas PA having a substantially square shape on a straight line. Then, three rectangular areas facing in the three directions of the downward direction, the diagonally downward right direction, and the right direction are set so as to include the dust pixel group TG in the partial area PA on the one end side.

続いて、複数の長方形領域RAの内の第1番目の長方形領域RAを注目領域として設定し(ステップS73)、この注目領域における埃を含まない複数の部分領域について、RGB値に関する平均値と分散値とを、R,G,Bの各々について算出する(ステップS74)。   Subsequently, the first rectangular area RA among the plurality of rectangular areas RA is set as the attention area (step S73), and the average value and variance regarding the RGB values are set for the plurality of partial areas not including dust in the attention area. A value is calculated for each of R, G, and B (step S74).

そして、このステップS74における算出を、全ての長方形領域RAについて行ったか否かを判断し(ステップS75)、まだである場合には、次の長方形領域RAを注目領域として(ステップS76)、上記ステップS74へ行って該次の長方形領域RAについて上述したような処理を行う。   Then, it is determined whether or not the calculation in step S74 has been performed for all the rectangular areas RA (step S75). If not, the next rectangular area RA is set as the attention area (step S76). The process proceeds to S74 and the above-described processing is performed for the next rectangular area RA.

また、上記ステップS75において、全ての長方形領域RAについての算出が終了したと判断された場合には、各長方形領域RAについて、部分領域PA内におけるR,G,B各々の分散値を加算し、さらに、注目埃を含まない部分領域について分散値の和をとる。これにより、分散値の和が、各長方形領域RAに対応して算出される。そして、算出された分散値の和が最小となる長方形領域RAを選択する(ステップS77)。   If it is determined in step S75 that the calculation for all the rectangular areas RA has been completed, the variance values of R, G, and B in the partial area PA are added to each rectangular area RA, and Further, the sum of the variance values is taken for the partial area not including the target dust. Thereby, the sum of the variance values is calculated corresponding to each rectangular area RA. Then, the rectangular area RA that minimizes the sum of the calculated variance values is selected (step S77).

次に、選択した長方形領域RAに関して、部分領域PA毎の、かつRGB値毎の、平均値と分散値とに基づいて、最小2乗法を用いることにより、埃を含む部分領域PAのRGB値の平均値の推定値を、R,G,Bの各々について算出する(ステップS78)。   Next, with respect to the selected rectangular area RA, the least square method is used based on the average value and the variance value for each partial area PA and for each RGB value. An estimated value of the average value is calculated for each of R, G, and B (step S78).

続いて、埃を含まない部分領域PA(例えば、埃を含む部分領域PAに隣接する部分領域PA)の画像により、埃を含む部分領域PAの画像を置き換える(ステップS79)。   Subsequently, the image of the partial area PA including dust is replaced with the image of the partial area PA not including dust (for example, the partial area PA adjacent to the partial area PA including dust) (step S79).

そして、ステップS79で置き換えた埃を含む部分領域PAのR,G,B値の平均値が、ステップS78で算出したR,G,B値の平均値の推定値と等しくなるように、ステップS78で算出したR,G,B値それぞれの平均値の推定値と、ステップS79で置き換えた部分領域PAのR,G,B値それぞれの平均値と、の差を、置き換えた部分領域の各画素のR,G,B値にそれぞれ加える(ステップS80)。   Then, in step S78, the average value of the R, G, B values of the partial area PA including the dust replaced in step S79 is equal to the estimated value of the average value of R, G, B values calculated in step S78. The difference between the estimated value of the average value of each of the R, G, and B values calculated in step S and the average value of each of the R, G, and B values of the partial area PA replaced in step S79 is calculated for each pixel of the replaced partial area. Are added to the R, G, and B values, respectively (step S80).

その後、全ての埃について処理が終了したか否かを判断し(ステップS81)、まだである場合には、次の埃を注目埃として(ステップS82)、上記ステップS72へ行って上述したような処理を繰り返して行う。   Thereafter, it is determined whether or not the processing has been completed for all dust (step S81). If not, the next dust is set as the noticeable dust (step S82), and the process proceeds to step S72 as described above. Repeat the process.

こうして、ステップS82において、全ての埃について処理を行ったと判断された場合には、この処理を終了する。   Thus, if it is determined in step S82 that all dust has been processed, this process is terminated.

なお、上述では、画素数が等しくなった組み合わせの画素群における、夫々の画素群の重心位置と、重なり合っている部分の面積の比と、の両方に基づいて、埃候補画素群が埃に係る画素群であるか否かを判断しているが、何れか一方のみを用いて判断することも可能である。このときには、処理を簡素化して高速化を図ることができる。   In the above description, the dust candidate pixel group is related to dust based on both the barycentric position of each pixel group and the ratio of the areas of the overlapping portions in the pixel group with the same number of pixels. Although it is determined whether or not it is a pixel group, it is also possible to determine using only one of them. At this time, the processing can be simplified and speeded up.

このような実施例2によれば、上述した実施例1とほぼ同様の効果を奏するとともに、同一のカメラにより同一の撮影モードで撮影された複数の画像を、まとめて埃除去することが可能となる。   According to the second embodiment, the same effects as the first embodiment described above can be obtained, and a plurality of images shot in the same shooting mode by the same camera can be collectively removed. Become.

そして、埃を検出する際に、複数の画像の中の、平均明度値が所定値以下の画像を除外するようにしているために、検出精度を向上することができる。   And when detecting dust, since the image whose average brightness value is below a predetermined value is excluded from a plurality of images, the detection accuracy can be improved.

また、埃を検出する際に、複数の画像における埃候補画素群の画素数が等しくなるように明度を調整してから、互いの重心位置のずれや、重なる割合に基づき埃であるか否かを判定する場合には、検出精度をさらに向上することができる。   Further, when detecting dust, the brightness is adjusted so that the number of pixels of the dust candidate pixel group in a plurality of images becomes equal, and then whether or not the dust is based on the deviation of the center of gravity position and the overlapping ratio. Can be further improved.

さらに、埃を除去する際に、角度の異なる複数の長方形領域を設定しているために、エッジ等が存在したとしても、その影響を最も受け難い方向を選択することが可能となる。   Furthermore, since a plurality of rectangular areas having different angles are set when removing dust, even if there is an edge or the like, it is possible to select a direction that is least affected by the influence.

加えて、長方形領域を複数の部分領域に区分して、埃を含む部分領域のRGB値を、埃を含まない部分領域のRGB値の平均値と分散値とに基づいて、最小二乗法により算出するようにしたために、高い精度での算出を行うことができる。このとき、算出された推定値に、隣接する部分領域の平均値との差を加算するようにしたために、より精度を向上することができる。   In addition, the rectangular area is divided into a plurality of partial areas, and the RGB value of the partial area including dust is calculated by the least square method based on the average value and the variance value of the RGB values of the partial area not including dust. Therefore, calculation with high accuracy can be performed. At this time, since the difference from the average value of the adjacent partial areas is added to the calculated estimated value, the accuracy can be further improved.

図13から図16は本発明の実施例3を示したものであり、図13は画像処理装置の要部の構成を示すブロック図である。   FIGS. 13 to 16 show a third embodiment of the present invention, and FIG. 13 is a block diagram showing a configuration of a main part of the image processing apparatus.

この実施例3において、上述の実施例1,2と同様である部分については同一の符号を付して説明を省略し、主として異なる点についてのみ説明する。   In the third embodiment, the same parts as those in the first and second embodiments are denoted by the same reference numerals, description thereof is omitted, and only different points will be mainly described.

この画像処理装置は、上述した実施例1の図1に示した構成に対して、処理履歴メモリ6を加えたものとなっている。   This image processing apparatus is obtained by adding a processing history memory 6 to the configuration shown in FIG.

この処理履歴メモリ6は、過去に処理した画像に関する埃除去処理の履歴を記録するための処理履歴記憶手段であり、上記バス7に接続されていて、上記処理部1、プログラムメモリ2、画像メモリ3、操作部4、表示部5と双方向に接続されている。   The processing history memory 6 is processing history storage means for recording a history of dust removal processing relating to images processed in the past, and is connected to the bus 7 and includes the processing unit 1, program memory 2, and image memory. 3, the operation unit 4 and the display unit 5 are bidirectionally connected.

撮影時期が近い画像には、同一の埃が付着している可能性が高いために、過去に処理した埃の情報(位置および画素情報)を埃除去処理の履歴として処理履歴メモリ6に記憶しておき、新たに埃除去処理を実施するときには、この処理履歴メモリ6に記憶されている埃情報を参照することにより、埃の検出を効率良く行うことができるようにしたものである。   Since there is a high possibility that the same dust is attached to images that are close to the shooting time, dust information (position and pixel information) processed in the past is stored in the processing history memory 6 as a dust removal processing history. In addition, when a new dust removal process is performed, dust can be efficiently detected by referring to the dust information stored in the processing history memory 6.

次に、図14は、埃除去処理の概要を示すフローチャートである。   Next, FIG. 14 is a flowchart showing an outline of dust removal processing.

この処理を開始すると、まず、処理対象画像を撮影したカメラと、撮影モードおよび撮影日時と、を特定する(ステップS91)。   When this process is started, first, the camera that captured the processing target image, the shooting mode, and the shooting date and time are specified (step S91).

次に、処理対象画像を撮影したカメラと同一のカメラにより、同一の撮影モードで撮影された画像の中から、撮影日時が近接している画像に関する埃除去処理情報を処理履歴メモリ6から読み出す(ステップS92)。   Next, from the processing history memory 6, the dust removal processing information relating to the images whose shooting dates and times are close is read out from the images shot in the same shooting mode by the same camera that shot the processing target image ( Step S92).

そして、埃を特定する処理を行い(ステップS93)、自動埃除去処理を行い(ステップS94)、処理結果の確認を行い(ステップS95)、処理結果の画像を保存してから(ステップS96)、この処理を終了する。   Then, processing for identifying dust is performed (step S93), automatic dust removal processing is performed (step S94), processing results are confirmed (step S95), and an image of the processing results is stored (step S96). This process ends.

続いて、図15は、上記図14のステップS93における埃特定処理の例を示すフローチャートである。   Next, FIG. 15 is a flowchart showing an example of the dust specifying process in step S93 of FIG.

この処理を開始すると、処理対象画像について、画素毎の明るさを示す明度Yを、各画素のRGB色度値に基づいて、上記数式1に示したように算出する(ステップS101)。   When this process is started, the brightness Y indicating the brightness of each pixel is calculated for the processing target image based on the RGB chromaticity value of each pixel as shown in Equation 1 (step S101).

続いて、処理対象画像の各画素について、明度Yの算出値が所定値以下となる画素を抽出する(ステップS102)。   Subsequently, for each pixel of the processing target image, a pixel in which the calculated value of brightness Y is a predetermined value or less is extracted (step S102).

そして、抽出した画素にラベリング処理を施すことにより、埃候補の画素群としてグループ化する(ステップS103)。   Then, the extracted pixels are subjected to a labeling process to be grouped as a dust candidate pixel group (step S103).

その後、埃候補画素群を、上記処理履歴メモリ6から読み出した過去に処理した画像の同一位置にある埃画素群と比較して、重なる部分があるか否かを判断する。そして、重なる部分があると判断された埃候補画素群を、対応する埃画素群(処理履歴メモリ6から読み出した埃画素群)とともに抽出する(ステップS104)。   Thereafter, the dust candidate pixel group is compared with the dust pixel group at the same position in the image processed in the past read from the processing history memory 6 to determine whether or not there is an overlapping portion. Then, the dust candidate pixel group determined to have an overlapping portion is extracted together with the corresponding dust pixel group (the dust pixel group read from the processing history memory 6) (step S104).

次に、各組み合わせについて、埃候補画素群の明度を調整して、明度Yが所定の閾値以下の画素の画素数が、埃画素群の画素数と等しくなるようにする(ステップS105)。   Next, for each combination, the brightness of the dust candidate pixel group is adjusted so that the number of pixels whose brightness Y is equal to or less than a predetermined threshold is equal to the number of pixels of the dust pixel group (step S105).

こうして埃候補画素群の画素数と埃画素群の画素数とが等しくなったら、埃候補画素群の重心位置と、埃画素群の重心位置と、を各組み合わせ毎に算出する(ステップS106)。   When the number of pixels of the dust candidate pixel group and the number of pixels of the dust pixel group become equal in this way, the gravity center position of the dust candidate pixel group and the gravity center position of the dust pixel group are calculated for each combination (step S106).

そして、これらの重心位置の差が所定値以下であって、かつ画素群の面積に対する重なり合っている部分の面積の比が所定値以上である場合に、処理対象画像における埃候補画素群を、埃に係る画素群であると判定し(ステップS107)、その後に、この処理を終了する。   When the difference between these barycentric positions is equal to or smaller than a predetermined value and the ratio of the area of the overlapping portion to the area of the pixel group is equal to or larger than the predetermined value, the dust candidate pixel group in the processing target image is (Step S107), and thereafter, this process is terminated.

上記図14の処理に戻って次に実行するステップS94の自動埃除去処理は、上記ステップS4またはステップS44と同一の処理である。   The automatic dust removal process in step S94 to be executed next after returning to the process in FIG. 14 is the same process as in step S4 or step S44.

なお、上記ステップS93の処理だけでは、処理情報が登録されていない埃を特定することができないために、ステップS93の処理の後にステップS3またはステップS42の処理を実行して、ステップS93の処理だけでは特定し得なかった埃を特定する。   Note that dust having no registered process information cannot be identified only by the process of step S93. Therefore, the process of step S3 or step S42 is executed after the process of step S93, and only the process of step S93 is performed. Then, dust that could not be identified is identified.


次に、図16は、上記図14のステップS95における処理結果の確認処理の例を示すフローチャートである。

Next, FIG. 16 is a flowchart showing an example of processing result confirmation processing in step S95 of FIG.

この処理を開始すると、まず、上記図7に示したような確認画面11を表示する(ステップS111)。   When this process is started, first, the confirmation screen 11 as shown in FIG. 7 is displayed (step S111).

そして、第1の埃部分の拡大画像12と、処理後の拡大画像13と、を生成して表示する(ステップS112)。   And the enlarged image 12 of the 1st dust part and the enlarged image 13 after a process are produced | generated and displayed (step S112).

その後、上記操作部4を介して、操作入力が行われるのを待機する。ここで、次へボタン16が押されたことを検出した場合には(ステップS113)、表示している埃画素群の位置および画素情報を、画像に関連付けて処理履歴メモリ6に登録する(ステップS114)。   Thereafter, it waits for an operation input to be made via the operation unit 4. If it is detected that the next button 16 has been pressed (step S113), the position and pixel information of the displayed dust pixel group are registered in the processing history memory 6 in association with the image (step S113). S114).

次に、全ての埃部分について確認したか否かを判断し(ステップS115)、まだ全ての埃部分についての確認が行われていない場合には、次の埃部分の拡大画像と、処理後の拡大画像と、を生成して表示してから(ステップS116)、操作入力が行われるのを待機する上記状態へ戻る。   Next, it is determined whether or not all dust portions have been confirmed (step S115). If confirmation has not been performed for all dust portions, an enlarged image of the next dust portion and a post-processing image are processed. After the enlarged image is generated and displayed (step S116), the process returns to the above-described state where the operation input is awaited.

また、取り消しボタン15が押されたことを検出した場合には(ステップS117)、注目埃部分を対応する原画像の部分で置き換えて、つまり元の状態に戻す(ステップS118)。その後は、上記ステップS115へ行って、上述したような処理を行う。   If it is detected that the cancel button 15 has been pressed (step S117), the target dust portion is replaced with the corresponding original image portion, that is, the original state is restored (step S118). Thereafter, the process proceeds to step S115, and the above-described processing is performed.

そして、終了ボタン17が押されたことを検出した場合には(ステップS119)、全ての埃部分について確認したか否かを判断し(ステップS120)、まだ全ての埃部分についての確認が行われていない場合には、確認していない埃画素群の位置および画素情報を画像に関連付けて処理履歴メモリ6に登録してから(ステップS121)、一方、このステップS120または上記ステップS115において全ての埃部分について確認したと判断された場合には、この処理を終了する。   If it is detected that the end button 17 has been pressed (step S119), it is determined whether or not all dust portions have been confirmed (step S120), and all dust portions have been confirmed. If not, the position and pixel information of the unidentified dust pixel group are registered in the processing history memory 6 in association with the image (step S121). On the other hand, in this step S120 or step S115, all dust is collected. If it is determined that the part has been confirmed, this process is terminated.

このような実施例3によれば、上述した実施例1,2とほぼ同様の効果を奏するとともに、埃除去処理の履歴を記憶しておくようにしたために、埃検出や埃除去の処理をより効率的に行うことが可能となる。   According to the third embodiment, the effects similar to those of the first and second embodiments described above are obtained, and the history of dust removal processing is stored. It becomes possible to carry out efficiently.

また、処理結果を確認する際に、埃部分の確認を全部行うことなく途中で終了した場合には、確認していない埃画素群の画素情報を画像に関連付けて処理履歴メモリに登録するようにしたために、中止したところから後で容易に処理を再開することが可能となる。そして、確認していない埃画素群の画素情報を、他の画像の処理に用いることも可能となる。さらに、次へボタン16が押されて除去が確定した埃についても、必要に応じて原画像の状態に戻すことも可能である。   Also, when confirming the processing result, if the confirmation is completed without performing all the dust portion confirmation, the pixel information of the unconfirmed dust pixel group is associated with the image and registered in the processing history memory. Therefore, it becomes possible to easily restart the process later from the point where it was stopped. The pixel information of the dust pixel group that has not been confirmed can be used for processing other images. Furthermore, it is also possible to return the dust that has been removed by the next button 16 to the original image as necessary.

なお、上述した各実施例においては、主として、デジタルカメラやカメラ付き携帯電話等の撮像装置により撮影された画像に基づいて埃の検出や除去を行う例について説明したが、これに限らず、例えば、銀塩カメラにより撮影されたフィルムを、フィルムスキャナ等により取り込んで得られる画像や、コピー機等におけるスキャナ部分で読み取った画像、あるいはファクシミリ装置におけるスキャナ部分で読み取った画像などについても、上記技術を適用することが可能である。   In each of the above-described embodiments, an example in which dust is detected and removed based on an image photographed by an imaging device such as a digital camera or a mobile phone with a camera has been described. The above technique is also applied to an image obtained by capturing a film photographed by a silver salt camera with a film scanner or the like, an image read by a scanner part in a copying machine, or an image read by a scanner part in a facsimile apparatus. It is possible to apply.

また、上述では、同一の撮像装置において同一の撮影モードで撮影された画像同士を用いて埃の検出等を行うようにしているが、これに限るものでもない。例えば、異なる撮影モードで撮影された異なる画素構成の画像であっても、イメージセンサ出力のどの部分を切り出して得られたか等の情報があれば、対応する画素位置を特定することは可能であるために、共通する部分について埃の検出等を行うことが可能である。   In the above description, dust detection and the like are performed using images captured in the same imaging mode in the same imaging device, but the present invention is not limited to this. For example, even with images of different pixel configurations shot in different shooting modes, if there is information such as which part of the image sensor output was cut out, the corresponding pixel position can be specified. For this reason, it is possible to detect dust and the like for common portions.

そして、上述では、単に撮影日時が近接している画像を参照画像としたが、撮影日時の間隔等を考慮して、参照画像群を選択するようにしても良い。つまり、ある画像群は、短い時間間隔の中で集中的に撮影され、次の画像群は、それから例えば数日たってから撮影された、などの場合に、集中的に撮影された画像群をひとまとめの参照画像群とすることが考えられる。   In the above description, an image whose shooting date and time are close to each other is used as a reference image. However, a reference image group may be selected in consideration of an interval between shooting dates and times. In other words, when a certain image group is photographed intensively within a short time interval, and the next image group is photographed several days later, for example, a group of image groups photographed intensively is collected. The reference image group can be considered.

加えて、撮像装置が一眼レフレックスタイプのデジタルカメラ等である場合には、レンズ交換を行ったときに、撮像素子の撮像面に埃が付着する可能性が高いと考えられるために、レンズ交換の履歴を記録しておいて、同一のレンズが装着され続けている間に撮影された画像群を、ひとまとめの参照画像群とすると良い。   In addition, if the imaging device is a single-lens reflex digital camera, etc., it is highly likely that dust will adhere to the imaging surface of the imaging device when the lens is replaced. A group of images recorded while the same lens continues to be worn may be used as a group of reference images.

なお、本発明は上述した実施例に限定されるものではなく、発明の主旨を逸脱しない範囲内において種々の変形や応用が可能であることは勿論である。   In addition, this invention is not limited to the Example mentioned above, Of course, a various deformation | transformation and application are possible within the range which does not deviate from the main point of invention.

本発明は、画像に含まれる埃の画像部分を除去するための方法、プログラム、装置等に好適に利用することができる。   The present invention can be suitably used for a method, a program, an apparatus, and the like for removing an image portion of dust included in an image.

本発明の実施例1における画像処理装置の要部の構成を示すブロック図。1 is a block diagram illustrating a configuration of a main part of an image processing apparatus according to Embodiment 1 of the present invention. 上記実施例1における埃除去処理の概要を示すフローチャート。The flowchart which shows the outline | summary of the dust removal process in the said Example 1. FIG. 上記図2のステップS3における埃特定処理の例を示すフローチャート。The flowchart which shows the example of the dust specific process in step S3 of the said FIG. 上記図2のステップS4における自動埃除去処理の例を示すフローチャート。The flowchart which shows the example of the automatic dust removal process in step S4 of the said FIG. 上記実施例1において、埃画素群を含むように設定された複数形状の小領域を示す図。In the said Example 1, the figure which shows the small area | region of multiple shapes set so that a dust pixel group may be included. 上記図2のステップS5における処理結果の確認処理の例を示すフローチャート。The flowchart which shows the example of the confirmation process of the process result in step S5 of the said FIG. 上記実施例1において、画像処理プログラムにより表示部に表示された確認画面の様子を示す図。The figure which shows the mode of the confirmation screen displayed on the display part by the image processing program in the said Example 1. FIG. 本発明の実施例2における埃除去処理の概要を示すフローチャート。The flowchart which shows the outline | summary of the dust removal process in Example 2 of this invention. 上記図8のステップS42における埃特定の処理の一例を示すフローチャート。The flowchart which shows an example of the dust specific process in step S42 of the said FIG. 上記図8のステップS42における埃特定の処理の他の例を示すフローチャート。The flowchart which shows the other example of a dust specific process in step S42 of the said FIG. 上記図8のステップS44における自動埃除去処理の例を示すフローチャート。The flowchart which shows the example of the automatic dust removal process in step S44 of the said FIG. 上記実施例2において、埃画素群を含むように設定された複数の長方形領域を示す図。In the said Example 2, the figure which shows the several rectangular area | region set so that a dust pixel group might be included. 本発明の実施例3における画像処理装置の要部の構成を示すブロック図。FIG. 9 is a block diagram illustrating a configuration of a main part of an image processing apparatus according to Embodiment 3 of the present invention. 上記実施例3における埃除去処理の概要を示すフローチャート。10 is a flowchart showing an outline of dust removal processing in the third embodiment. 上記図14のステップS93における埃特定処理の例を示すフローチャート。The flowchart which shows the example of the dust specific process in step S93 of the said FIG. 上記図14のステップS95における処理結果の確認処理の例を示すフローチャート。The flowchart which shows the example of the confirmation process of the process result in step S95 of the said FIG.

符号の説明Explanation of symbols

1…処理部(画像選択手段、埃特定手段、修復手段)
2…プログラムメモリ
3…画像メモリ
4…操作部
5…表示部
6…処理履歴メモリ
7…バス
11…確認画面
12…処理対象となる埃部分の拡大画像
13…埃除去の処理を行った後の拡大画像
14…確認済み埃領域数表示
15…取り消しボタン
16…次へボタン
17…終了ボタン
TG…埃画素群
R1,R2,R3,R4…領域
RA…長方形領域
PA…部分領域
代理人 弁理士 伊 藤 進
1. Processing unit (image selection means, dust identification means, restoration means)
2 ... Program memory 3 ... Image memory 4 ... Operation unit 5 ... Display unit 6 ... Processing history memory 7 ... Bus 11 ... Confirmation screen 12 ... Enlarged image of the dust part to be processed 13 ... Dust removal process Enlarged image 14 ... Confirmed number of dust areas 15 ... Cancel button 16 ... Next button 17 ... End button TG ... Dust pixel group R1, R2, R3, R4 ... Area RA ... Rectangular area PA ... Partial area
Agent Patent Attorney Susumu Ito

Claims (18)

コンピュータにより、撮像装置により撮影された画像から、該画像に含まれ得る埃の画像部分を画像処理により除去させるための画像処理プログラムであって、
処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から、撮影日時が該処理対象画像に近い順に、1以上の画像を参照画像として選択する画像選択ステップと、
上記処理対象画像と、上記参照画像と、の両方において略同一位置に存在する埃の画像部分、を特定する埃特定ステップと、
上記埃特定ステップにより特定された処理対象画像における埃の画像部分を、該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復ステップと、
をコンピュータに実行させるための画像処理プログラム。
An image processing program for removing, by image processing, an image portion of dust that can be included in an image from an image captured by an imaging device by a computer,
An image selection step of selecting one or more images as reference images in order of shooting date and time closest to the processing target image from one or more images captured by the same imaging device as the imaging device that captured the processing target image; ,
A dust specifying step for specifying an image portion of dust existing at substantially the same position in both the processing target image and the reference image;
A repairing step of repairing the dust image portion in the processing target image specified by the dust specifying step using image information in the vicinity of the dust image portion in the processing target image;
An image processing program for causing a computer to execute.
上記撮像装置は、イメージセンサを有して構成されたものであり、
上記埃は、このイメージセンサの撮像面に付着しているものであることを特徴とする請求項1に記載の画像処理プログラム。
The imaging device is configured to include an image sensor,
The image processing program according to claim 1, wherein the dust is attached to an imaging surface of the image sensor.
上記撮像装置は、イメージセンサを有して構成されたものであり、
上記略同一位置は、このイメージセンサの撮像面における略同一位置であることを特徴とする請求項1または請求項2に記載の画像処理プログラム。
The imaging device is configured to include an image sensor,
The image processing program according to claim 1, wherein the substantially same position is substantially the same position on the imaging surface of the image sensor.
上記画像選択ステップは、上記処理対象画像と同一の画素構成の画像の中から、上記参照画像を選択するステップであることを特徴とする請求項1に記載の画像処理プログラム。   The image processing program according to claim 1, wherein the image selection step is a step of selecting the reference image from images having the same pixel configuration as the processing target image. 上記埃特定ステップは、
上記処理対象画像の画素毎の明度と、上記参照画像の画素毎の明度と、を算出する明度算出ステップと、
上記明度算出ステップにより算出された、上記処理対象画像の画素毎の明度と、上記参照画像の画素毎の明度と、を同一画素位置毎に加算する明度加算ステップと、
上記明度加算ステップにより加算された明度の加算値が所定値よりも小さい画素を抽出する画素抽出ステップと、
上記画素抽出ステップにより抽出された上記処理対象画像における画素を、隣接する画素同士を同一のグループに含めるようにグループ化するグループ化ステップと、
を含み、
コンピュータに、上記グループ化ステップによりグループ化された画素群を、埃の画像部分を構成する埃画素群として特定させることを特徴とする請求項1に記載の画像処理プログラム。
The dust identification step
A brightness calculation step for calculating brightness for each pixel of the processing target image and brightness for each pixel of the reference image;
A brightness addition step of adding the brightness for each pixel of the processing target image calculated by the brightness calculation step and the brightness for each pixel of the reference image for each same pixel position;
A pixel extraction step for extracting pixels in which the lightness addition value added in the lightness addition step is smaller than a predetermined value;
A grouping step for grouping pixels in the processing target image extracted by the pixel extraction step so that adjacent pixels are included in the same group;
Including
The image processing program according to claim 1, wherein the computer identifies the pixel group grouped by the grouping step as a dust pixel group constituting a dust image portion.
上記埃特定ステップは、
上記明度算出ステップにより算出された画素毎の明度を、画像に含まれる全画素について平均することにより画像平均明度を算出する処理を、上記画像選択ステップにより選択された全ての参照画像について行う平均明度算出ステップと、
上記平均明度算出ステップにより算出された画像平均明度が所定値以下となる参照画像を、上記明度加算ステップによる加算対象から除外する画像除外ステップと、
をさらに含むことを特徴とする請求項5に記載の画像処理プログラム。
The dust identification step
Average brightness for calculating the image average brightness by averaging the brightness for each pixel calculated in the brightness calculation step for all the pixels included in the image for all reference images selected in the image selection step A calculation step;
An image excluding step of excluding a reference image in which the image average brightness calculated by the average brightness calculating step is a predetermined value or less from an addition target by the brightness adding step;
The image processing program according to claim 5, further comprising:
上記埃特定ステップは、
上記処理対象画像の画素毎の明度と、上記参照画像の画素毎の明度と、を算出する明度算出ステップと、
上記明度算出ステップにより算出された明度が所定値よりも小さい画素を抽出する画素抽出ステップと、
上記画素抽出ステップにより抽出された画素を、隣接する画素同士を同一のグループに含めるようにグループ化するグループ化ステップと、
上記グループ化ステップによりグループ化された画素群の内で、上記処理対象画像における画素群と、上記参照画像における画素群と、が、該処理対象画像と全ての該参照画像とについて重なり合っている画素群の組み合わせを生成する組み合わせ生成ステップと、
上記組み合わせ生成ステップにより生成された画素群の組み合わせの各々について、画素群に含まれる画素の数が組み合わせに属する画素群の全てについて等しくなるように、画像毎の明度を調整する明度調整ステップと、
上記明度調整ステップにより画素数が等しくなった画素群について、組み合わせに属する画素群の全てが重なり合っている部分の画素数の、1つの画素群の画素数に対する比率を算出する比率算出ステップと、
上記比率算出ステップにより算出された比率が所定値以上であるときに、組み合わせに属する画素群が、埃の画像部分を構成する埃画素群であると判定する判定ステップと、
を含むことを特徴とする請求項1に記載の画像処理プログラム。
The dust identification step
A brightness calculation step for calculating brightness for each pixel of the processing target image and brightness for each pixel of the reference image;
A pixel extraction step for extracting pixels whose lightness calculated by the lightness calculation step is smaller than a predetermined value;
A grouping step for grouping the pixels extracted in the pixel extraction step so that adjacent pixels are included in the same group;
Among the pixel groups grouped by the grouping step, pixels in which the pixel group in the processing target image and the pixel group in the reference image overlap each other for the processing target image and all the reference images A combination generation step for generating a group combination;
For each combination of pixel groups generated by the combination generation step, a brightness adjustment step for adjusting the brightness for each image so that the number of pixels included in the pixel group is the same for all of the pixel groups belonging to the combination;
A ratio calculation step of calculating a ratio of the number of pixels of a portion where all of the pixel groups belonging to the combination overlap with respect to the number of pixels of one pixel group, with respect to the pixel group having the same number of pixels by the brightness adjustment step;
A determination step of determining that the pixel group belonging to the combination is a dust pixel group constituting a dust image portion when the ratio calculated in the ratio calculation step is equal to or greater than a predetermined value;
The image processing program according to claim 1, further comprising:
上記埃特定ステップは、
上記明度調整ステップにより画素数が等しくなった画素群の重心位置を、組み合わせに属する画素群の全てについて算出する重心位置算出ステップをさらに含み、
上記判定ステップは、上記比率算出ステップにより算出された比率が所定値以上であって、かつ、上記重心位置算出ステップにより算出された重心位置の内の、最も離れた重心位置同士の差が所定値以下であるときに、組み合わせに属する画素群が、埃の画像部分を構成する埃画素群であると判定するステップであることを特徴とする請求項7に記載の画像処理プログラム。
The dust identification step
A centroid position calculating step of calculating the centroid position of the pixel group having the same number of pixels by the brightness adjustment step for all of the pixel groups belonging to the combination;
In the determination step, the ratio calculated in the ratio calculation step is equal to or greater than a predetermined value, and the difference between the most distant centroid positions among the centroid positions calculated in the centroid position calculation step is a predetermined value. 8. The image processing program according to claim 7, wherein the image processing program is a step of determining that a pixel group belonging to the combination is a dust pixel group constituting a dust image portion when:
上記埃特定ステップと上記修復ステップとの少なくとも一方の処理情報を記憶する処理情報記憶ステップをさらに含み、
上記埃特定ステップは、上記画像選択ステップにより選択された参照画像に関して、上記処理情報記憶ステップにより記憶された処理情報が存在する場合には、
上記処理情報を読み出す処理情報読出ステップと、
上記処理対象画像の画素毎の明度を算出する明度算出ステップと、
上記明度算出ステップにより算出された明度が所定値よりも小さい画素を抽出する画素抽出ステップと、
上記画素抽出ステップにより抽出された画素を、隣接する画素同士を同一のグループに含めるようにグループ化して埃候補画素群とするグループ化ステップと、
上記処理情報読出ステップにより読み出された処理情報に含まれる埃画素群と、上記埃候補画素群と、が重なり合った組み合わせを生成する組み合わせ生成ステップと、
上記組み合わせ生成ステップにより生成された組み合わせの各々について、上記埃候補画素群に含まれる画素の数と、上記埃画素群に含まれる画素の数と、が等しくなるように、処理対象画像の明度を調整する明度調整ステップと、
上記明度調整ステップにより画素数が等しくなった埃候補画素群について、埃画素群と重なり合った部分の画素数の、埃画素群の画素数に対する比率を算出する比率算出ステップと、
上記比率算出ステップにより算出された比率が所定値以上であるときに、上記埃候補画素群が、埃の画像部分を構成する埃画素群であると判定する判定ステップと、
を含むことを特徴とする請求項1に記載の画像処理プログラム。
A processing information storage step for storing processing information of at least one of the dust identification step and the repair step;
In the dust specifying step, when the processing information stored in the processing information storing step is present with respect to the reference image selected in the image selecting step,
A processing information reading step for reading the processing information;
A brightness calculation step of calculating the brightness of each pixel of the processing target image;
A pixel extraction step for extracting pixels whose lightness calculated by the lightness calculation step is smaller than a predetermined value;
Grouping the pixels extracted by the pixel extraction step into a dust candidate pixel group by grouping adjacent pixels into the same group; and
A combination generation step for generating a combination in which the dust pixel group included in the processing information read out by the processing information reading step and the dust candidate pixel group overlap;
For each of the combinations generated by the combination generation step, the brightness of the processing target image is set so that the number of pixels included in the dust candidate pixel group is equal to the number of pixels included in the dust pixel group. A brightness adjustment step to adjust;
A ratio calculating step for calculating a ratio of the number of pixels overlapping the dust pixel group to the number of pixels of the dust pixel group for the dust candidate pixel group having the same number of pixels by the brightness adjustment step;
A determination step of determining that the dust candidate pixel group is a dust pixel group constituting a dust image portion when the ratio calculated in the ratio calculation step is equal to or greater than a predetermined value;
The image processing program according to claim 1, further comprising:
上記埃特定ステップは、
上記明度調整ステップにより画素数が等しくなった埃画素群の重心位置と、埃候補画素群の重心位置と、をそれぞれ算出する重心位置算出ステップをさらに含み、
上記判定ステップは、上記比率算出ステップにより算出された比率が所定値以上であって、かつ、上記重心位置算出ステップにより算出された埃画素群の重心位置と埃候補画素群の重心位置との差が所定値以下であるときに、該埃候補画素群が、埃の画像部分を構成する埃画素群であると判定するステップであることを特徴とする請求項9に記載の画像処理プログラム。
The dust identification step
A centroid position calculating step for calculating the centroid position of the dust pixel group and the centroid position of the dust candidate pixel group in which the number of pixels is equalized by the brightness adjustment step;
In the determination step, the ratio calculated in the ratio calculation step is a predetermined value or more, and the difference between the gravity center position of the dust pixel group and the gravity center position of the dust candidate pixel group calculated in the gravity center position calculation step is determined. 10. The image processing program according to claim 9, wherein when the value is equal to or smaller than a predetermined value, the dust candidate pixel group is a step of determining that the dust pixel group is a dust pixel group constituting a dust image portion.
上記修復ステップは、
上記埃特定ステップにより特定された埃の画像部分を含むように、複数の領域を設定する領域設定ステップと、
上記領域設定ステップにより設定された各領域について、埃の画像部分を含まない部分の画素値の平均値およびばらつきを算出する平均ばらつき算出ステップと、
上記平均ばらつき算出ステップにより算出されたばらつきが最も小さい領域を選択する領域選択ステップと、
埃の画像部分の画素値を、上記領域選択ステップにより選択された領域の埃の画像部分以外の部分の画素値により置き換える置換ステップと、
を含むことを特徴とする請求項1から請求項10の何れか一に記載の画像処理プログラム。
The repair step is
A region setting step for setting a plurality of regions so as to include the dust image portion specified by the dust specifying step;
For each region set by the region setting step, an average variation calculating step for calculating an average value and a variation of a pixel value of a portion not including the dust image portion,
A region selection step for selecting a region having the smallest variation calculated by the average variation calculation step;
A replacement step of replacing the pixel value of the dust image portion with a pixel value of a portion other than the dust image portion of the region selected by the region selection step;
The image processing program according to claim 1, further comprising:
上記平均ばらつき算出ステップにより算出するばらつきは、明度のばらつきであることを特徴とする請求項11に記載の画像処理プログラム。   12. The image processing program according to claim 11, wherein the variation calculated in the average variation calculating step is a variation in brightness. 上記ばらつきは、分散であることを特徴とする請求項11または請求項12に記載の画像処理プログラム。   13. The image processing program according to claim 11, wherein the variation is a variance. 上記修復ステップは、
上記領域設定ステップにより設定された各領域を、埃の画像部分を1つの部分領域に含むように、複数の部分領域に分割する部分領域設定ステップをさらに含み、
上記平均ばらつき算出ステップは、上記領域設定ステップにより設定された各領域について、上記部分領域設定ステップにより分割された部分領域の内の埃の画像部分を含まない各部分領域の画素値の平均値およびばらつきを算出するステップであり、
上記領域設定ステップにより設定された各領域毎に、上記平均ばらつき算出ステップにより算出された各部分領域の画素値のばらつきを加算することによりばらつき和を算出するばらつき和算出ステップをさらに含み、
上記領域選択ステップは、上記ばらつき和算出ステップにより算出されたばらつき和が最も小さい領域を選択するステップであり、
上記領域選択ステップにより選択された領域の埃の画像部分を含まない部分領域の画素値の平均値とばらつきとの少なくとも一方に基づいて、埃の画像部分を含む部分領域の画素値の推定値を算出する推定値算出ステップをさらに含み、
上記置換ステップは、埃の画像部分の画素値を、上記領域選択ステップにより選択された領域の、埃の画像部分を含む部分領域に隣接する部分領域の画素値により置き換えるステップであり、
上記置換ステップにより置き換えた埃の画像部分の画素値に、置き換えた後の埃の画像部分の画素値の平均値と、上記推定値算出ステップにより算出された画素値の平均値と、の差を加算する画素値加算ステップをさらに含むことを特徴とする請求項11から請求項13の何れか一に記載の画像処理プログラム。
The repair step is
A partial region setting step of dividing each region set by the region setting step into a plurality of partial regions so that the dust image portion is included in one partial region;
The average variation calculating step includes, for each region set by the region setting step, an average pixel value of each partial region that does not include the dust image portion of the partial region divided by the partial region setting step, and A step of calculating variation,
For each region set by the region setting step, the method further includes a variation sum calculation step of calculating a variation sum by adding the variation of the pixel value of each partial region calculated by the average variation calculation step,
The region selection step is a step of selecting a region having the smallest variation sum calculated by the variation sum calculation step,
Based on at least one of the average value and the variation of the pixel values of the partial regions not including the dust image portion in the region selected by the region selection step, the estimated value of the pixel value of the partial region including the dust image portion is calculated. An estimated value calculating step for calculating,
The replacement step is a step of replacing the pixel value of the dust image portion with the pixel value of the partial region adjacent to the partial region including the dust image portion of the region selected by the region selection step;
The difference between the average value of the pixel values of the dust image portion after the replacement and the average value of the pixel values calculated by the estimated value calculation step is calculated as the pixel value of the dust image portion replaced by the replacement step. The image processing program according to claim 11, further comprising a pixel value adding step of adding.
上記修復ステップによる修復を行う前の画像と、該修復ステップによる修復を行った後の画像と、を比較し得るように表示する確認画像表示ステップと、
上記修復ステップによる修復を取り消す選択が行われたときに、処理対象画像を修復を行う前の画像に戻す修復取り消しステップと、
をさらに含むことを特徴とする請求項1から請求項14の何れか一に記載の画像処理プログラム。
A confirmation image display step for displaying the image before the repair by the repair step and the image after the repair by the repair step so as to be compared;
A restoration cancellation step for returning the processing target image to the image before the restoration when the selection to cancel the restoration by the restoration step is performed;
The image processing program according to claim 1, further comprising:
上記処理対象画像を、同一の撮像装置により撮影された画像の中で順次変更することにより、複数の画像についての処理を順次行うことを特徴とする請求項1から請求項15の何れか一に記載の画像処理プログラム。   The process for a plurality of images is sequentially performed by sequentially changing the processing target image among images captured by the same imaging device. The image processing program described. 撮像装置により撮影された画像から、該画像に含まれ得る埃の画像部分を画像処理により除去するための画像処理方法であって、
処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から、撮影日時が該処理対象画像に近い順に、1以上の画像を参照画像として選択する画像選択ステップと、
上記処理対象画像と、上記参照画像と、の両方において略同一位置に存在する埃の画像部分、を特定する埃特定ステップと、
上記埃特定ステップにより特定された処理対象画像における埃の画像部分を、該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復ステップと、
を含むことを特徴とする画像処理方法。
An image processing method for removing, by image processing, an image portion of dust that can be included in an image taken by an imaging device,
An image selection step of selecting one or more images as reference images in order of shooting date and time closest to the processing target image from one or more images captured by the same imaging device as the imaging device that captured the processing target image; ,
A dust specifying step for specifying an image portion of dust existing at substantially the same position in both the processing target image and the reference image;
A repairing step of repairing the dust image portion in the processing target image specified by the dust specifying step using image information in the vicinity of the dust image portion in the processing target image;
An image processing method comprising:
撮像装置により撮影された画像から、該画像に含まれ得る埃の画像部分を画像処理により除去するための画像処理装置であって、
処理対象画像を撮影した撮像装置と同一の撮像装置により撮影された1以上の画像の中から、撮影日時が該処理対象画像に近い順に、1以上の画像を参照画像として選択する画像選択手段と、
上記処理対象画像と、上記参照画像と、の両方において略同一位置に存在する埃の画像部分、を特定する埃特定手段と、
上記埃特定手段により特定された処理対象画像における埃の画像部分を、該処理対象画像における該埃の画像部分の近傍の画像情報を用いて修復する修復手段と、
を具備したことを特徴とする画像処理装置。
An image processing device for removing, from an image captured by an imaging device, an image portion of dust that can be included in the image by image processing,
Image selecting means for selecting one or more images as reference images in order of shooting date and time closest to the processing target image from one or more images captured by the same imaging device as the imaging device that captured the processing target image; ,
Dust specifying means for specifying an image portion of dust existing at substantially the same position in both the processing target image and the reference image;
Repairing means for repairing the dust image portion in the processing target image specified by the dust specifying means using image information in the vicinity of the dust image portion in the processing target image;
An image processing apparatus comprising:
JP2004114716A 2004-04-08 2004-04-08 Image processing program, image processing method, and image processing apparatus Expired - Fee Related JP4464731B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004114716A JP4464731B2 (en) 2004-04-08 2004-04-08 Image processing program, image processing method, and image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004114716A JP4464731B2 (en) 2004-04-08 2004-04-08 Image processing program, image processing method, and image processing apparatus

Publications (2)

Publication Number Publication Date
JP2005301524A true JP2005301524A (en) 2005-10-27
JP4464731B2 JP4464731B2 (en) 2010-05-19

Family

ID=35333001

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004114716A Expired - Fee Related JP4464731B2 (en) 2004-04-08 2004-04-08 Image processing program, image processing method, and image processing apparatus

Country Status (1)

Country Link
JP (1) JP4464731B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013546084A (en) * 2010-12-03 2013-12-26 オプトス、ピーエルシー How to identify anomalies in images
CN112215775A (en) * 2020-10-20 2021-01-12 厦门市美亚柏科信息股份有限公司 BMP picture restoration method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013546084A (en) * 2010-12-03 2013-12-26 オプトス、ピーエルシー How to identify anomalies in images
JP2016185337A (en) * 2010-12-03 2016-10-27 オプトス ピーエルシー Method for identifying abnormalities in images
CN112215775A (en) * 2020-10-20 2021-01-12 厦门市美亚柏科信息股份有限公司 BMP picture restoration method and device
CN112215775B (en) * 2020-10-20 2022-09-06 厦门市美亚柏科信息股份有限公司 BMP picture restoration method and device

Also Published As

Publication number Publication date
JP4464731B2 (en) 2010-05-19

Similar Documents

Publication Publication Date Title
KR100815512B1 (en) Image capturing apparatus and control method thereof
US7991241B2 (en) Image processing apparatus, control method therefor, and program
JP4590355B2 (en) Image processing apparatus, image processing method, and program
JP4799462B2 (en) Image processing apparatus, control method thereof, program, storage medium, and imaging apparatus
US20210281748A1 (en) Information processing apparatus
JP4771539B2 (en) Image processing apparatus, control method therefor, and program
JP5246078B2 (en) Object location program and camera
JP2008033442A (en) Image processor, its control method, and program
JP2008033444A (en) Image processor, its control method, image processing method, and program
JP5400504B2 (en) Imaging apparatus, image processing apparatus, control method, and program
WO2012014946A1 (en) Image processing device and image processing program
JP4464731B2 (en) Image processing program, image processing method, and image processing apparatus
JP4960852B2 (en) Image processing apparatus, control method thereof, interchangeable lens single-lens reflex digital camera, and program
JPWO2009038000A1 (en) Unnecessary light identification method, unnecessary light identification device and imaging device
JP2006101025A (en) Photographic apparatus, and image processing method and program thereof
JP2019012424A (en) Image processing device and computer program
JP2008187677A (en) Digital camera
JP4400481B2 (en) Image processing device
JP5526984B2 (en) Image processing apparatus, image processing method, computer program for image processing, and imaging apparatus
JP4661957B2 (en) Image matching device and camera
JP4470172B2 (en) Image processing device
JP2008278347A (en) Image display system
JP2016058764A (en) Imaging apparatus
JP6540392B2 (en) Image processing device
JP2012156884A (en) Control device and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070327

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100112

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100126

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100219

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130226

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4464731

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140226

Year of fee payment: 4

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees