JP2014057261A - Image generating apparatus, image generating method, imaging apparatus and imaging method - Google Patents

Image generating apparatus, image generating method, imaging apparatus and imaging method Download PDF

Info

Publication number
JP2014057261A
JP2014057261A JP2012201793A JP2012201793A JP2014057261A JP 2014057261 A JP2014057261 A JP 2014057261A JP 2012201793 A JP2012201793 A JP 2012201793A JP 2012201793 A JP2012201793 A JP 2012201793A JP 2014057261 A JP2014057261 A JP 2014057261A
Authority
JP
Japan
Prior art keywords
pixel
value
image
reliability
moving object
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
JP2012201793A
Other languages
Japanese (ja)
Other versions
JP6063680B2 (en
Inventor
Aya Nakajima
彩 中島
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 JP2012201793A priority Critical patent/JP6063680B2/en
Publication of JP2014057261A publication Critical patent/JP2014057261A/en
Application granted granted Critical
Publication of JP6063680B2 publication Critical patent/JP6063680B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image generating apparatus which can remove a moving body such as a mobile object by correctly selecting even a pixel of a background whose number of taken images is small, and to provide an image generating method, an imaging apparatus and an imaging method.SOLUTION: An image generating apparatus for generating an output image including only a background from which a moving body is removed from a plurality of input images with the same inputted field angle includes: a reference value generating section which generates a reference value for determining information on a moving body removal pixel in response to information on a plurality of peripheral pixels being pixels arranged at a periphery of the target pixels to be processed when pixels arranged in the same positions in the input images are set to be the target pixels and the pixel arranged in the same position as the target pixel is set to be the moving body removal pixel in the output image; and a moving body removal pixel generating section which selects information on the target pixel having high probability of being the background from information on the individual target pixels to be processed on the basis of the reference value and outputs it as information on the moving body removal pixel in the output image.

Description

本発明は、画像生成装置、画像生成方法、撮像装置、および撮像方法に関する。   The present invention relates to an image generation device, an image generation method, an imaging device, and an imaging method.

従来から、複数の画像に含まれる同一の座標に位置する画素の値(以下、「画素値」という)の中で、他の多くの画像の画素値から大きく外れた画素値(以下、「特異値」という)を除去することによって、複数の画像から1枚の画像を生成する動体除去という機能がある。動体除去とは、静止画用カメラ(以下、「カメラ」という)で建物などの被写体を撮影した際に、カメラと被写体の間を横切る通行人や車両などの不要な移動体を除去した所望の画像を生成する機能である。   Conventionally, among pixel values located at the same coordinates included in a plurality of images (hereinafter referred to as “pixel values”), pixel values (hereinafter referred to as “singular”) that are significantly different from the pixel values of many other images. By removing “value”), there is a function of moving object removal that generates one image from a plurality of images. Moving object removal refers to a desired object that removes unnecessary moving objects such as passers-by and vehicles that cross between the camera and the subject when a subject such as a building is photographed with a still image camera (hereinafter referred to as “camera”). This is a function for generating an image.

動体除去では、移動体がカメラの前を横切るような場合には、連続して撮影した複数の画像の同一の位置に移動体が写っている枚数は少なく、多くの画像には背景が写っているという考えに基づいて、連続撮影した複数の画像から、その撮影時間中に動いた被写体を除去した画像を生成する。より具体的には、複数の画像の同一の位置に写っている回数が少ない移動体の画素値を特異値として、同じ位置に写っている回数が多い背景の画素値に置き換えることによって、移動体を除去した背景のみの画像を生成する。   In moving object removal, when a moving object crosses the front of the camera, the number of moving objects that appear in the same position in multiple images taken consecutively is small, and many images have a background. Based on this idea, an image is generated by removing a subject that moved during the shooting time from a plurality of continuously shot images. More specifically, a moving object is obtained by substituting a pixel value of a moving object with a small number of times appearing at the same position in a plurality of images as a singular value and a background pixel value with a large number of images appearing at the same position. An image of only the background from which is removed is generated.

動体除去の方法の1つとして、例えば、特許文献1のような技術が開示されている。特許文献1で開示された技術では、時間的に連続する複数枚の撮影画像の同一位置の画素値についてヒストグラムを作成し、同じ画素値が出現する回数(以下、「度数」という)が最も高い画素値を出力する。そして、撮影画像のそれぞれの位置で度数の高い画素値を最終的な画素値にすることによって、移動体を除去した1枚の画像を生成している。   As one method for removing moving objects, for example, a technique as disclosed in Patent Document 1 is disclosed. In the technique disclosed in Patent Document 1, a histogram is created for pixel values at the same position in a plurality of captured images that are temporally continuous, and the number of times the same pixel value appears (hereinafter referred to as “frequency”) is the highest. Output the pixel value. Then, by making a pixel value having a high frequency at each position of the captured image a final pixel value, one image from which the moving body is removed is generated.

特開平9−149364号公報JP-A-9-149364

しかしながら、実際には背景が写っている画素であっても、写っている画像の枚数が少ない画素は、ヒストグラムの度数は少なくなってしまう。このような場合、特許文献1で開示された技術のように、単純に同一位置の画素値のヒストグラムを作成して背景の画素を選択する方法では、背景の画素を正しく選択することができず、動体除去を正しく行うことができない、という問題になる。   However, even in the case of a pixel in which the background is actually shown, the frequency of the histogram is reduced for a pixel in which the number of images shown is small. In such a case, as in the technique disclosed in Patent Document 1, a method of simply creating a histogram of pixel values at the same position and selecting a background pixel cannot select a background pixel correctly. The problem is that moving objects cannot be removed correctly.

本発明は、上記の課題認識に基づいてなされたものであり、写っている画像の枚数が少ない背景の画素であっても正しく選択することによって、移動体などの動体を除去することができる画像生成装置、画像生成方法、撮像装置、および撮像方法を提供することを目的としている。   The present invention has been made based on the above problem recognition, and an image that can remove moving objects such as a moving object by correctly selecting even background pixels with a small number of captured images. An object is to provide a generation device, an image generation method, an imaging device, and an imaging method.

上記の課題を解決するため、本発明の画像生成装置は、入力された同じ画角の複数の入力画像から、動体を除去した背景のみが含まれる出力画像を生成する画像生成装置であって、現在処理する対象の画素であり、それぞれの前記入力画像において同一の位置に配置されたそれぞれの画素を注目画素とし、前記出力画像において前記注目画素と同一の位置に配置される画素を動体除去画素としたとき、現在処理を行っているそれぞれの前記注目画素の周囲に配置された画素である複数の周囲画素の情報に基づいて、前記動体除去画素の情報を決定するための参照値を生成する参照値生成部と、前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の情報の中から、前記背景である可能性が高い前記注目画素の情報を選択し、該選択した前記注目画素の情報を前記出力画像における前記動体除去画素の情報として出力する動体除去画素生成部と、を備えることを特徴とする。   In order to solve the above problem, an image generation apparatus of the present invention is an image generation apparatus that generates an output image including only a background from which a moving object is removed from a plurality of input images having the same angle of view. A pixel to be processed at present, each pixel arranged at the same position in each input image as a target pixel, and a pixel arranged at the same position as the target pixel in the output image is a moving object removal pixel Then, a reference value for determining information on the moving object removal pixel is generated based on information on a plurality of surrounding pixels which are pixels arranged around each of the target pixels currently being processed. Based on the reference value generation unit and the information on each of the target pixels that are currently processed based on the reference value, the information on the target pixel that is likely to be the background is selected. Characterized in that it comprises a body removed pixel generator for outputting the selected information of the pixel of interest as the information of the moving object removed pixel in the output image.

また、本発明の前記参照値生成部は、それぞれの前記注目画素の画素値を要素とした第1のヒストグラムを生成し、該生成した第1のヒストグラムにおける最大度数の値を信頼度とし、前記最大度数の画素値を最頻値として生成する信頼度生成部と、前記信頼度に基づいて、現在処理を行っている前記注目画素に対応した前記参照値を生成するために用いる前記周囲画素が含まれる範囲である参照範囲を設定する参照範囲設定部と、設定された前記参照範囲内のそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成部が生成した前記信頼度と前記最頻値とに基づいて、前記参照値を算出する参照値算出部と、を備えることを特徴とする。   Further, the reference value generation unit of the present invention generates a first histogram having the pixel value of each pixel of interest as an element, sets the maximum frequency value in the generated first histogram as the reliability, and A reliability generation unit configured to generate a pixel value of the maximum frequency as a mode value, and the surrounding pixels used to generate the reference value corresponding to the target pixel currently being processed based on the reliability A reference range setting unit that sets a reference range that is included, and the reliability generated by the reliability generation unit when each of the surrounding pixels in the set reference range is processed as the pixel of interest. A reference value calculation unit that calculates the reference value based on the mode value.

また、本発明の前記参照範囲設定部は、設定した前記参照範囲内に含まれるそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成部が生成した前記信頼度が、予め定めた信頼度の第1の閾値以上の信頼度である前記周囲画素の数を計数し、該計数した前記周囲画素の数が、予め定めた画素数の閾値以上となるように、該参照範囲を周囲に順次広げていく、ことを特徴とする。   Further, the reference range setting unit of the present invention determines in advance the reliability generated by the reliability generation unit when each of the surrounding pixels included in the set reference range is processed as the target pixel. The number of the surrounding pixels having a reliability equal to or higher than a first threshold value of the reliability is counted, and the reference range is set so that the counted number of the surrounding pixels is equal to or more than a threshold value of a predetermined number of pixels. It is characterized by spreading sequentially around.

また、本発明の前記参照値算出部は、前記参照範囲内に含まれるそれぞれの前記周囲画素を前記注目画素として処理したときの前記信頼度が、予め定めた信頼度の第1の閾値以上の信頼度であるそれぞれの前記周囲画素の前記最頻値を要素とした第2のヒストグラムを生成し、該生成した第2のヒストグラムにおける最大度数の前記最頻値を前記参照値とする、ことを特徴とする。   Further, the reference value calculation unit according to the present invention is configured such that the reliability when each of the surrounding pixels included in the reference range is processed as the target pixel is equal to or more than a first threshold value of a predetermined reliability. Generating a second histogram having the mode value of each of the surrounding pixels as reliability as an element, and setting the mode value of the maximum frequency in the generated second histogram as the reference value; Features.

また、本発明の前記参照値算出部は、現在処理を行っている前記注目画素の位置と、前記参照範囲内に含まれるそれぞれの前記周囲画素の位置とに基づいた距離に応じて、該距離が近いほど大きく、該距離が遠いほど小さくなる重み付け係数を設定し、該設定した重み付け係数を前記第2のヒストグラムの要素であるそれぞれの前記最頻値に掛けて、前記第2のヒストグラムを生成する、ことを特徴とする。   Further, the reference value calculation unit of the present invention is configured so that the distance is based on a distance based on the position of the target pixel currently being processed and the positions of the surrounding pixels included in the reference range. A weighting coefficient that is larger as the distance is closer and smaller as the distance is farther is set, and the set weighting coefficient is multiplied by each mode value that is an element of the second histogram to generate the second histogram. It is characterized by.

また、本発明の前記参照値算出部は、前記参照範囲内に含まれるそれぞれの前記周囲画素の前記最頻値のばらつきに応じて、該ばらつきが小さいほど前記距離に応じた差を小さく、該ばらつきが大きいほど前記距離に応じた差を大きくした前記重み付け係数を設定する、ことを特徴とする。   In addition, the reference value calculation unit of the present invention, according to the variation of the mode value of each of the surrounding pixels included in the reference range, the smaller the variation, the smaller the difference according to the distance, The weighting coefficient is set such that the difference corresponding to the distance increases as the variation increases.

また、本発明の前記動体除去画素生成部は、前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記背景である可能性が高い前記注目画素の画素値を検出する注目画素値検出部と、前記信頼度に基づいて、前記注目画素値検出部が検出した前記注目画素の画素値、または前記参照値生成部が生成した前記最頻値のいずれか一方の値を、前記動体除去画素の画素値として選択する動体除去画素選択部と、を備えることを特徴とする。   In addition, the moving object removal pixel generation unit of the present invention may be configured such that, based on the reference value, the pixel value of the target pixel that is highly likely to be the background is selected from the pixel values of the target pixel currently being processed. A pixel value detection unit that detects a pixel value, and a pixel value of the pixel of interest detected by the pixel value detection unit based on the reliability, or a mode value generated by the reference value generation unit A moving object removal pixel selecting unit that selects one of the values as a pixel value of the moving object removal pixel.

また、本発明の前記注目画素値検出部は、現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記参照値に最も近い画素値を、前記背景である可能性が高い前記注目画素の画素値として検出する、ことを特徴とする。   In addition, the pixel value detection unit of the present invention has a high possibility that the pixel value closest to the reference value is the background among the pixel values of the pixel of interest currently being processed. The pixel value of the target pixel is detected.

また、本発明の前記動体除去画素選択部は、前記信頼度が、予め定めた信頼度の第2の閾値以上である場合は、前記最頻値を前記動体除去画素の画素値として選択し、前記信頼度が、予め定めた信頼度の第2の閾値よりも小さい場合は、前記注目画素値検出部が検出した前記注目画素の画素値を前記動体除去画素の画素値として選択する、ことを特徴とする。   The moving object removal pixel selection unit of the present invention selects the mode value as the pixel value of the moving object removal pixel when the reliability is equal to or higher than a second threshold value of the predetermined reliability. When the reliability is smaller than a second threshold value of a predetermined reliability, the pixel value of the target pixel detected by the target pixel value detection unit is selected as a pixel value of the moving object removal pixel. Features.

また、本発明の前記参照値生成部は、前記入力画像内の各位置に配置された、該入力画像の輝度を表す輝度情報、または該入力画像の色を表す色情報のいずれか一方または両方のデータに基づいて、前記参照値を生成する、ことを特徴とする。   In addition, the reference value generation unit of the present invention is arranged such that one or both of luminance information indicating the luminance of the input image and color information indicating the color of the input image, which are arranged at each position in the input image. The reference value is generated based on the data.

また、本発明の前記参照値生成部は、前記入力画像内の各位置に配置された、該入力画像を取得する際に撮像素子から出力された信号に応じた値のデータに基づいて、前記参照値を生成する、ことを特徴とする。   Further, the reference value generation unit of the present invention is arranged based on data of a value corresponding to a signal output from the image sensor when acquiring the input image, which is arranged at each position in the input image. A reference value is generated.

また、本発明の撮像装置は、被写体を撮影する撮像装置であって、入射した光量に応じた信号を出力する画素が、二次元の行列状に複数配置された撮像素子を具備し、該撮像素子に結像された被写体の光学像を露光したときの信号に基づいた画像を出力する撮像部と、前記撮像部から出力された複数枚の前記画像を記憶する記憶部と、前記記憶部に記憶されたそれぞれの前記画像に含まれる、当該撮像装置で撮影する際のぶれによる撮影位置のズレを検出する位置ズレ検出部と、前記位置ズレ検出部によって検出された撮影位置のズレが補正された前記画像が、入力画像として複数入力され、該入力された複数の前記入力画像から、動体を除去した背景のみが含まれる出力画像を生成する、上記のいずれかの発明の画像生成装置と、を備えることを特徴とする。   The image pickup apparatus of the present invention is an image pickup apparatus that takes an image of a subject, and includes an image pickup element in which a plurality of pixels that output signals according to the amount of incident light are arranged in a two-dimensional matrix, An imaging unit that outputs an image based on a signal when an optical image of a subject formed on the element is exposed, a storage unit that stores a plurality of the images output from the imaging unit, and a storage unit A positional shift detection unit that detects a shift of a shooting position caused by a shake when shooting with the imaging device included in each of the stored images, and a shift of the shooting position detected by the positional shift detection unit are corrected. The image generation apparatus according to any one of the above inventions, wherein a plurality of the images are input as input images, and an output image including only a background from which a moving object is removed is generated from the input plurality of input images. With And wherein the door.

また、本発明の前記画像生成装置は、入力された複数の前記入力画像内の同一の位置に写っている枚数が少ない移動体の部分を、前記動体として除去した前記出力画像を生成する、ことを特徴とする。   Further, the image generation device of the present invention generates the output image by removing a moving body portion having a small number of images appearing at the same position in a plurality of input images as the moving body. It is characterized by.

また、本発明の画像生成方法は、入力された同じ画角の複数の入力画像から、動体を除去した背景のみが含まれる出力画像を生成する画像生成方法であって、現在処理する対象の画素であり、それぞれの前記入力画像において同一の位置に配置されたそれぞれの画素を注目画素とし、前記出力画像において前記注目画素と同一の位置に配置される画素を動体除去画素としたとき、現在処理を行っているそれぞれの前記注目画素の周囲に配置された画素である複数の周囲画素の情報に基づいて、前記動体除去画素の情報を決定するための参照値を生成する参照値生成ステップと、前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の情報の中から、前記背景である可能性が高い前記注目画素の情報を選択し、該選択した前記注目画素の情報を前記出力画像における前記動体除去画素の情報として出力する動体除去画素生成ステップと、を含むことを特徴とする。   The image generation method of the present invention is an image generation method for generating an output image including only a background from which a moving object is removed from a plurality of input images having the same angle of view, and is a pixel to be currently processed. And when each pixel arranged at the same position in each input image is a target pixel and a pixel arranged at the same position as the target pixel in the output image is a moving object removal pixel, A reference value generating step for generating a reference value for determining information of the moving object removal pixel based on information of a plurality of surrounding pixels which are pixels arranged around each of the target pixels performing Based on the reference value, information on the target pixel that is highly likely to be the background is selected from among the information on the target pixel currently being processed, and the selected A moving body removing pixel generating step for outputting information eye pixel as information of the moving object removed pixel in the output image, characterized in that it comprises a.

また、本発明の前記参照値生成ステップは、それぞれの前記注目画素の画素値を要素とした第1のヒストグラムを生成し、該生成した第1のヒストグラムにおける最大度数の値を信頼度とし、前記最大度数の画素値を最頻値として生成する信頼度生成ステップと、前記信頼度に基づいて、現在処理を行っている前記注目画素に対応した前記参照値を生成するために用いる前記周囲画素が含まれる範囲である参照範囲を設定する参照範囲設定ステップと、設定された前記参照範囲内のそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成ステップによって生成した前記信頼度と前記最頻値とに基づいて、前記参照値を算出する参照値算出ステップと、を含むことを特徴とする。   In the reference value generation step of the present invention, a first histogram having a pixel value of each pixel of interest as an element is generated, a maximum frequency value in the generated first histogram is set as a reliability, A reliability generation step of generating a pixel value of the maximum frequency as a mode value, and the surrounding pixels used to generate the reference value corresponding to the pixel of interest currently being processed based on the reliability A reference range setting step for setting a reference range that is an included range, and the reliability generated by the reliability generation step when each of the surrounding pixels in the set reference range is processed as the target pixel; A reference value calculating step of calculating the reference value based on the mode value.

また、本発明の前記動体除去画素生成ステップは、前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記背景である可能性が高い前記注目画素の画素値を検出する注目画素値検出ステップと、前記信頼度に基づいて、前記注目画素値検出ステップによって検出した前記注目画素の画素値、または前記参照値生成ステップによって生成した前記最頻値のいずれか一方の値を、前記動体除去画素の画素値として選択する動体除去画素選択ステップと、を含むことを特徴とする。   In the moving object removal pixel generation step of the present invention, based on the reference value, the pixel value of the target pixel that is likely to be the background is selected from the pixel values of the target pixel that are currently processed. A target pixel value detecting step for detecting a pixel value, and a pixel value of the target pixel detected by the target pixel value detecting step or a mode value generated by the reference value generating step based on the reliability. A moving object removal pixel selecting step of selecting one of the values as a pixel value of the moving object removal pixel.

また、本発明の撮像方法は、被写体を撮影する撮像装置による撮像方法であって、入射した光量に応じた信号を出力する画素が、二次元の行列状に複数配置された撮像素子を具備した撮像部に、該撮像素子に結像された被写体の光学像を露光したときの信号に基づいた画像を出力させる撮像ステップと、記憶部に、前記撮像部から出力された複数枚の前記画像を記憶させる記憶ステップと、位置ズレ検出部に、前記記憶部に記憶されたそれぞれの前記画像に含まれる、当該撮像装置で撮影する際のぶれによる撮影位置のズレを検出させる位置ズレ検出ステップと、上記のいずれかの発明の画像生成装置に、前記位置ズレ検出部によって検出された撮影位置のズレが補正された前記画像を、入力画像として複数入力し、該入力された複数の前記入力画像から、動体を除去した背景のみが含まれる出力画像を生成させる画像生成ステップと、を含むことを特徴とする。   Further, the imaging method of the present invention is an imaging method by an imaging device that photographs a subject, and includes an imaging device in which a plurality of pixels that output signals according to the amount of incident light are arranged in a two-dimensional matrix. An imaging step for causing the imaging unit to output an image based on a signal when the optical image of the subject imaged on the imaging element is exposed; and a plurality of the images output from the imaging unit to the storage unit A storage step for storing, and a position shift detection unit for detecting a shift of a shooting position caused by a shake when shooting with the imaging device included in each of the images stored in the storage unit, In the image generation apparatus according to any one of the above inventions, a plurality of the images, in which the photographing position deviation detected by the positional deviation detection unit is corrected, are input as input images, and the plurality of the inputted plurality of the images From the force image, characterized in that it comprises an image generating step of generating an output image including only the background removal of the moving object, the.

本発明によれば、写っている画像の枚数が少ない背景の画素であっても正しく選択することによって、移動体などの動体を除去することができるという効果が得られる。   According to the present invention, it is possible to remove a moving object such as a moving object by correctly selecting even background pixels with a small number of captured images.

本発明の実施形態における画像生成装置を適用した撮像装置の概略構成を示したブロック図である。1 is a block diagram illustrating a schematic configuration of an imaging apparatus to which an image generation apparatus according to an embodiment of the present invention is applied. 本実施形態の画像生成装置の概略構成を示したブロック図である。It is the block diagram which showed schematic structure of the image generation apparatus of this embodiment. 本実施形態の画像生成装置における動体除去処理の手順を示したフローチャートである。It is the flowchart which showed the procedure of the moving body removal process in the image generation apparatus of this embodiment. 本実施形態の画像生成装置による動体除去処理において信頼度と最頻値とを生成する処理の一例を説明する図である。It is a figure explaining an example of the process which produces | generates a reliability and a mode value in the moving body removal process by the image generation apparatus of this embodiment. 本実施形態の画像生成装置による動体除去処理において参照範囲を設定する処理の一例を説明する図である。It is a figure explaining an example of the process which sets a reference range in the moving body removal process by the image generation apparatus of this embodiment. 本実施形態の画像生成装置による動体除去処理において用いる係数の一例を説明する図である。It is a figure explaining an example of the coefficient used in the moving body removal process by the image generation apparatus of this embodiment. 本実施形態の画像生成装置による動体除去処理において参照値を決定する処理の一例を説明する図である。It is a figure explaining an example of the process which determines a reference value in the moving body removal process by the image generation apparatus of this embodiment.

以下、本発明の実施形態について、図面を参照して説明する。本実施形態においては、例えば、デジタルスチルカメラなどの撮像装置に、本実施形態の画像生成装置を適用した場合の一例について説明する。図1は、本実施形態における画像生成装置を適用した撮像装置の概略構成を示したブロック図である。図1に示した撮像装置10は、制御部11と、撮像部12と、記憶部13と、位置ズレ検出部14と、画像処理部15と、表示部16と、記録部17と、動体除去部20と、を備えている。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the present embodiment, an example in which the image generation apparatus of the present embodiment is applied to an imaging apparatus such as a digital still camera will be described. FIG. 1 is a block diagram illustrating a schematic configuration of an imaging apparatus to which the image generation apparatus according to the present embodiment is applied. The imaging device 10 illustrated in FIG. 1 includes a control unit 11, an imaging unit 12, a storage unit 13, a position shift detection unit 14, an image processing unit 15, a display unit 16, a recording unit 17, and moving object removal. Part 20.

制御部11は、撮像装置10内の各構成要素をそれぞれ制御することによって、撮像装置10全体の制御を行う。撮像部12は、レンズや撮像素子などから構成され、制御部11からの制御に応じて、レンズを介して撮像素子に結像された被写体の光学像を露光する。そして、撮像部12は、撮像素子が露光した光量に応じて画像信号に変換した画像データを、記憶部13に出力する。   The control unit 11 controls the entire imaging device 10 by controlling each component in the imaging device 10. The imaging unit 12 includes a lens, an imaging device, and the like, and exposes an optical image of a subject formed on the imaging device via the lens in accordance with control from the control unit 11. Then, the imaging unit 12 outputs image data converted into an image signal according to the amount of light exposed by the imaging element to the storage unit 13.

記憶部13は、制御部11からの制御に応じて、撮像部12から入力された画像データを一時的に記憶する、例えば、DRAM(Dynamic Random Access Memory)などのメモリである。記憶部13は、動体除去部20が動体を除去する処理に使用する枚数分の画像データを記憶する。記憶部13に記憶されたそれぞれの画像データは、制御部11からの制御に応じて、動体除去部20に出力される。また、記憶部13に記憶された画像データは、制御部11からの制御に応じて位置ズレ検出部14に出力され、位置ズレ検出部14から入力された位置ズレ情報が記憶される。   The storage unit 13 is a memory such as a DRAM (Dynamic Random Access Memory) that temporarily stores image data input from the imaging unit 12 in accordance with control from the control unit 11. The storage unit 13 stores image data for the number of sheets used by the moving body removing unit 20 for the process of removing the moving body. Each image data stored in the storage unit 13 is output to the moving body removing unit 20 in accordance with control from the control unit 11. Further, the image data stored in the storage unit 13 is output to the position shift detection unit 14 according to the control from the control unit 11, and the position shift information input from the position shift detection unit 14 is stored.

位置ズレ検出部14は、制御部11からの制御に応じて、記憶部13に記憶された全ての画像データに対して、画角の位置が合うようにするためのズレ量を計算する。そして、位置ズレ検出部14は、計算したズレ量を、位置ズレ情報として記憶部13に出力する。制御部11は、記憶部13に記憶された画像データを動体除去部20が読み出す際、記憶部13に記憶された位置ズレ情報に基づいて、画像データにおけるそれぞれの画素の位置が、被写体の光学像の同じ場所を露光したときの位置になるように、記憶部13からの画像データの読み出しを制御する。これにより、動体除去部20に入力される全ての画像データ内で同一の位置に配置されているそれぞれの画素の画素値は、被写体の光学像の同じ場所を露光したときの値になる。   In accordance with control from the control unit 11, the position shift detection unit 14 calculates a shift amount for matching the angle of view with respect to all the image data stored in the storage unit 13. Then, the positional deviation detection unit 14 outputs the calculated deviation amount to the storage unit 13 as positional deviation information. When the moving body removing unit 20 reads out the image data stored in the storage unit 13, the control unit 11 determines the position of each pixel in the image data based on the positional shift information stored in the storage unit 13. The reading of the image data from the storage unit 13 is controlled so as to be the position when the same place of the image is exposed. Thereby, the pixel value of each pixel arranged at the same position in all the image data input to the moving body removing unit 20 becomes a value when the same place of the optical image of the subject is exposed.

動体除去部20は、制御部11からの制御に応じて記憶部13から入力された位置ズレを検出した全ての画像データに対して動体除去処理を行って、画像データ内に含まれる動体を除去した画像データを生成する、本実施形態の画像生成装置である。動体除去部20は、動体除去処理によって、例えば、建物などの固定の被写体(以下、「固定物」という)の前を横切る通行人や車両などの不要な移動体の画素値を動体として除去した画像データを生成する。   The moving object removing unit 20 performs moving object removal processing on all image data in which the positional deviation input from the storage unit 13 is detected in accordance with the control from the control unit 11, and removes the moving object included in the image data. It is the image generation device of this embodiment which produces | generates the image data which carried out. The moving object removing unit 20 removes, as a moving object, pixel values of unnecessary moving objects such as passers-by and vehicles that cross the front of a fixed subject such as a building (hereinafter referred to as “fixed object”), for example, by moving object removal processing. Generate image data.

動体除去部20によって生成される動体除去後の画像データは、背景のみが写された画像データと同等の画像データである。以下の説明においては、動体除去部20によって生成される動体除去後の出力画像の画像データを、「動体除去画像」という。動体除去部20は、生成した動体除去画像を、画像処理部15に出力する。なお、動体除去部20における動体除去処理に関する詳細な説明は、後述する。   The image data after moving object generation generated by the moving object removing unit 20 is image data equivalent to image data in which only the background is copied. In the following description, the image data of the output image after moving object removal generated by the moving object removing unit 20 is referred to as “moving object removal image”. The moving object removal unit 20 outputs the generated moving object removal image to the image processing unit 15. A detailed description of the moving body removing process in the moving body removing unit 20 will be described later.

画像処理部15は、制御部11からの制御に応じて、動体除去部20から入力された動体除去画像に対して、予め定められた種々の画像処理(現像)を行った画像データを生成する。そして、画像処理部15は、生成した画像処理後の画像データを、撮像装置10内の対応する構成要素に出力する。例えば、画像処理部15は、画像データを表示するための画像処理を行って生成した表示用の画像データを、表示部16に出力する。また、例えば、画像処理部15は、画像データを記録するための画像フォーマット(例えば、JPEG:Joint Photographic Experts Group)に変換する画像処理を行って生成した記録用の画像データを、記録部17に出力する。   The image processing unit 15 generates image data obtained by performing various predetermined image processing (development) on the moving object removal image input from the moving object removal unit 20 in accordance with control from the control unit 11. . Then, the image processing unit 15 outputs the generated image data after image processing to a corresponding component in the imaging device 10. For example, the image processing unit 15 outputs image data for display generated by performing image processing for displaying image data to the display unit 16. Further, for example, the image processing unit 15 stores image data for recording generated by performing image processing for converting into an image format for recording image data (for example, JPEG: Joint Photographic Experts Group) in the recording unit 17. Output.

表示部16は、画像データを表示する、例えば、LCD(Liquid Crystal Display)などの表示装置を備え、制御部11からの制御に応じて、画像処理部15から入力された表示用の画像データを表示する。記録部17は、制御部11からの制御に応じて、画像処理部15から入力された記録用の画像データを、例えば、メモリカードなどの画像記録媒体に記録する。   The display unit 16 includes a display device such as an LCD (Liquid Crystal Display) that displays image data, and displays image data for display input from the image processing unit 15 in accordance with control from the control unit 11. indicate. The recording unit 17 records the recording image data input from the image processing unit 15 on an image recording medium such as a memory card in accordance with the control from the control unit 11.

次に、撮像装置10に備えた本実施形態の画像生成装置である動体除去部20について説明する。図2は、本実施形態の画像生成装置である動体除去部20の概略構成を示したブロック図である。図2に示したように、動体除去部20は、参照値生成部21と動体除去画素生成部22とを備えている。なお、図2では、撮像装置10内における動体除去部20と、記憶部13および画像処理部15との接続も併せて示している。   Next, the moving body removal unit 20 that is the image generation apparatus of the present embodiment provided in the imaging apparatus 10 will be described. FIG. 2 is a block diagram showing a schematic configuration of the moving object removing unit 20 which is the image generating apparatus of the present embodiment. As illustrated in FIG. 2, the moving object removal unit 20 includes a reference value generation unit 21 and a moving object removal pixel generation unit 22. In FIG. 2, the connection between the moving body removing unit 20, the storage unit 13, and the image processing unit 15 in the imaging apparatus 10 is also shown.

動体除去部20は、制御部11からの制御に応じて、記憶部13に記憶された位置ズレ情報に基づいて位置ズレを補正するように画像データの読み出し位置を調整して、記憶部13に記憶された複数枚の画像データのそれぞれを、入力画像として読み出す。そして、動体除去部20は、動体除去処理を行って生成した1枚の画像データを、動体除去画像として画像処理部15に出力する。なお、動体除去部20による動体除去処理では、動体除去処理に用いるそれぞれの入力画像において、同一の座標位置に配置されている画素の画素値の中から、動体除去画像のそれぞれの画素の画素値を選択する。このとき、動体除去部20は、現在処理している画素の座標位置の周囲に配置されている画素の画素値を参照して算出した値に基づいて、現在処理している画素の画素値の中から動体除去画像の画素の画素値を選択する場合もある。そして、動体除去部20内の各構成要素は、それぞれの画素に対する動体除去処理を、入力画像の画素数と同じ回数繰り返す。   The moving body removing unit 20 adjusts the reading position of the image data so as to correct the positional deviation based on the positional deviation information stored in the storage unit 13 in accordance with the control from the control unit 11, and stores it in the storage unit 13. Each of the plurality of stored image data is read out as an input image. Then, the moving body removing unit 20 outputs one piece of image data generated by performing the moving body removing process to the image processing unit 15 as a moving body removed image. In the moving object removing process by the moving object removing unit 20, in each input image used for the moving object removing process, the pixel value of each pixel of the moving object removed image is selected from the pixel values of the pixels arranged at the same coordinate position. Select. At this time, the moving object removing unit 20 determines the pixel value of the pixel currently being processed based on the value calculated by referring to the pixel value of the pixel arranged around the coordinate position of the pixel currently being processed. The pixel value of the pixel of the moving object removal image may be selected from among them. Then, each component in the moving object removing unit 20 repeats the moving object removing process for each pixel the same number of times as the number of pixels of the input image.

以下の説明においては、それぞれの入力画像において同一の座標位置に配置された、現在動体除去処理を行っている対象の画素を、「注目画素」といい、動体除去処理を行って生成した動体除去画像において注目画素と同一の座標位置に配置されている画素を、「動体除去画素」という。また、現在処理している注目画素の座標位置の周囲に配置されている画素を、「周囲画素」といい、周囲画素の画素値を参照して算出した値を、「参照値」という。   In the following description, the target pixel that is currently subjected to moving object removal processing that is arranged at the same coordinate position in each input image is referred to as a “target pixel”, and the moving object removal that is generated by performing the moving object removal processing. A pixel arranged at the same coordinate position as the target pixel in the image is referred to as a “moving object removal pixel”. In addition, a pixel arranged around the coordinate position of the pixel of interest currently being processed is referred to as a “peripheral pixel”, and a value calculated by referring to the pixel value of the peripheral pixel is referred to as a “reference value”.

なお、注目画素の画素値は、撮像部12内の撮像素子が露光した光量に応じた画像信号に基づいた値(例えば、RAWデータの値)である。この注目画素の画素値は、上述した画像信号に基づいた値を画像処理することによって得られる、画像の輝度を表す輝度情報の値や、画像の色を表す色情報の値であってもよい。以下の説明においては、画像信号に基づいた値、あるいは輝度情報の値と色情報の値のいずれか一方または両方の値を区別せず、単に「画素値」として説明する。   Note that the pixel value of the target pixel is a value (for example, a value of RAW data) based on an image signal corresponding to the amount of light exposed by the imaging element in the imaging unit 12. The pixel value of the target pixel may be a value of luminance information representing the luminance of the image or a value of color information representing the color of the image obtained by performing image processing on the value based on the above-described image signal. . In the following description, a value based on an image signal, or one or both of a luminance information value and a color information value will not be distinguished, and will be described simply as a “pixel value”.

参照値生成部21は、記憶部13から入力された複数の入力画像において同一の座標位置に配置されている各注目画素の画素値のヒストグラムを生成する。そして、参照値生成部21は、生成した注目画素の画素値のヒストグラムにおける最大度数の値を「信頼度」とし、最大度数の画素値を「最頻値」として動体除去画素生成部22に出力する。また、参照値生成部21は、現在処理している注目画素の周囲に配置されている周囲画素の信頼度と最頻値とに基づいて、動体除去画素を決定するための参照情報である参照値を算出し、算出した参照値を動体除去画素生成部22に出力する。参照値生成部21は、信頼度生成部211と、参照範囲設定部212と、参照値算出部213と、を備えている。   The reference value generation unit 21 generates a histogram of pixel values of each target pixel arranged at the same coordinate position in a plurality of input images input from the storage unit 13. Then, the reference value generation unit 21 outputs the maximum frequency value in the histogram of the pixel value of the generated target pixel as “reliability” and outputs the maximum frequency pixel value as the “mode” to the moving object removal pixel generation unit 22. To do. Further, the reference value generation unit 21 is reference information that is reference information for determining a moving object removal pixel based on the reliability and the mode value of surrounding pixels arranged around the pixel of interest currently processed. A value is calculated, and the calculated reference value is output to the moving object removal pixel generation unit 22. The reference value generation unit 21 includes a reliability generation unit 211, a reference range setting unit 212, and a reference value calculation unit 213.

信頼度生成部211は、記憶部13から入力された複数の入力画像の各注目画素の画素値に基づいて、注目画素の画素値のヒストグラム(以下、「ヒストグラムHist1」という)を生成する。例えば、入力画像のある注目画素に対応したヒストグラムHist1を生成する場合、信頼度生成部211は、1枚目〜N枚目の入力画像において同一の座標位置に配置されているそれぞれの注目画素の画素値が同じ値である個数(度数)を、それぞれの画素値毎にカウントすることによってヒストグラムHist1を生成する。そして、信頼度生成部211は、生成したヒストグラムHist1から得られる注目画素の信頼度と最頻値とを、動体除去画素生成部22に出力する。また、信頼度生成部211は、ヒストグラムHist1から得られた信頼度を参照範囲設定部212に、信頼度と最頻値とを参照値算出部213に、それぞれ出力する。   The reliability generation unit 211 generates a histogram of the pixel value of the target pixel (hereinafter referred to as “histogram Hist1”) based on the pixel value of each target pixel of the plurality of input images input from the storage unit 13. For example, when generating a histogram Hist1 corresponding to a pixel of interest in the input image, the reliability generation unit 211 of each pixel of interest arranged at the same coordinate position in the first to Nth input images. The histogram Hist1 is generated by counting the number of pixels having the same pixel value (frequency) for each pixel value. Then, the reliability generation unit 211 outputs the reliability and the mode value of the target pixel obtained from the generated histogram Hist1 to the moving object removal pixel generation unit 22. Further, the reliability generation unit 211 outputs the reliability obtained from the histogram Hist1 to the reference range setting unit 212, and outputs the reliability and the mode value to the reference value calculation unit 213.

なお、信頼度生成部211が信頼度および最頻値を生成する方法は、上述した一例のように、ヒストグラムHist1を生成して信頼度および最頻値を得る方法に限定されるものではなく、他の方法によって、記憶部13から入力された複数の入力画像の各注目画素の信頼度および最頻値を生成する構成にすることもできる。   Note that the method of generating the reliability and the mode value by the reliability generation unit 211 is not limited to the method of generating the histogram Hist1 and obtaining the reliability and the mode value as in the example described above. Another method may be used to generate the reliability and mode value of each pixel of interest of a plurality of input images input from the storage unit 13.

参照範囲設定部212は、信頼度生成部211から入力された信頼度に基づいて、参照値を算出するために使用する、現在処理している注目画素の周囲に配置されている周囲画素の範囲(以下、「参照範囲」という)を決定する。なお、参照範囲は、注目画素の座標位置を中心とした矩形の領域である。参照範囲設定部212が参照範囲を決定する際には、注目画素の座標位置から、周囲に1画素分ずつ順次範囲を広げていく。そして、参照範囲設定部212は、参照範囲内の周囲画素のそれぞれを注目画素としたときに信頼度生成部211が生成したヒストグラムHist1から得られる信頼度を用いて、適切な参照範囲を決定する。   The reference range setting unit 212 is a range of surrounding pixels arranged around the target pixel that is currently being processed, which is used to calculate a reference value based on the reliability input from the reliability generation unit 211. (Hereinafter referred to as “reference range”). The reference range is a rectangular area centered on the coordinate position of the target pixel. When the reference range setting unit 212 determines the reference range, the range is sequentially expanded by one pixel around the coordinate position of the target pixel. Then, the reference range setting unit 212 determines an appropriate reference range using the reliability obtained from the histogram Hist1 generated by the reliability generation unit 211 when each of the surrounding pixels in the reference range is the target pixel. .

より具体的には、参照範囲設定部212は、注目画素の周囲(上下左右)に1画素分ずつの矩形領域(注目画素を含む9画素の領域)を、最初の参照範囲として設定する。そして、参照範囲設定部212は、参照範囲に含まれるそれぞれの周囲画素の信頼度と、予め定めた信頼度の第1の閾値(以下、「信頼度閾値thrT1」という)とを比較し、信頼度閾値thrT1以上の信頼度を持つ周囲画素の数を計数する。続いて、参照範囲設定部212は、信頼度閾値thrT1以上の信頼度を持つ周囲画素の数と、予め定めた画素数の閾値(以下、「画素数閾値thrC」という)とを比較し、信頼度閾値thrT1以上の信頼度を持つ周囲画素の数が画素数閾値thrC以上である場合には、現在の参照範囲を、参照値を算出するために使用する範囲に決定する。一方、信頼度閾値thrT1以上の信頼度を持つ周囲画素の数が画素数閾値thrCよりも少ない場合には、現在の参照範囲の周囲(上下左右)に1画素分ずつ広げた矩形領域(注目画素を含む25画素の領域)を、次の参照範囲として設定し、同様に参照値を算出するために使用する範囲に決定するか否かを判定する。このような参照範囲の設定と判定とを繰り返し、信頼度閾値thrT1以上の信頼度を持つ周囲画素の数が画素数閾値thrC以上になるまで、参照範囲を周囲に1画素分ずつ順次広げていく。   More specifically, the reference range setting unit 212 sets a rectangular area (9 pixel area including the target pixel) for each pixel around the target pixel (up, down, left, and right) as the first reference range. Then, the reference range setting unit 212 compares the reliability of each of the surrounding pixels included in the reference range with a first threshold value of the predetermined reliability (hereinafter referred to as “reliability threshold value thrT1”). The number of surrounding pixels having a reliability equal to or greater than the degree threshold thrT1 is counted. Subsequently, the reference range setting unit 212 compares the number of surrounding pixels having a reliability equal to or higher than the reliability threshold value thrT1 with a predetermined threshold value for the number of pixels (hereinafter referred to as “pixel number threshold value thrC”). When the number of surrounding pixels having reliability equal to or greater than the threshold value thrT1 is equal to or greater than the pixel number threshold value thrC, the current reference range is determined to be a range used for calculating the reference value. On the other hand, when the number of surrounding pixels having the reliability equal to or higher than the reliability threshold value thrT1 is smaller than the pixel number threshold value thrC, a rectangular area (target pixel) extended by one pixel around the current reference range (up, down, left, and right). Is determined as a range to be used for calculating a reference value. Such setting and determination of the reference range is repeated, and the reference range is sequentially expanded by one pixel around the periphery until the number of surrounding pixels having a reliability equal to or higher than the reliability threshold thrT1 becomes equal to or higher than the pixel number threshold thrC. .

このようにして、注目画素を含む参照範囲を順次広げていき、参照値を算出するために使用する参照範囲を決定すると、参照範囲設定部212は、決定した参照範囲の大きさを表す情報を参照値算出部213に出力する。   In this way, when the reference range including the target pixel is sequentially expanded and the reference range used to calculate the reference value is determined, the reference range setting unit 212 displays information indicating the size of the determined reference range. It outputs to the reference value calculation part 213.

参照値算出部213は、参照範囲設定部212から入力された参照範囲と、信頼度生成部211から入力された信頼度と最頻値とに基づいて、動体除去画素を選択するための参照値を算出する。そして、参照値算出部213は、算出した参照値を動体除去画素生成部22に出力する。   The reference value calculation unit 213 selects a moving object removal pixel based on the reference range input from the reference range setting unit 212 and the reliability and mode value input from the reliability generation unit 211. Is calculated. Then, the reference value calculation unit 213 outputs the calculated reference value to the moving object removal pixel generation unit 22.

参照値算出部213による参照値の算出においては、参照範囲設定部212から入力された参照範囲内の周囲画素の内、信頼度閾値thrT1以上の信頼度を持つ周囲画素の個数(度数)をそれぞれの最頻値毎にカウントすることによって、最頻値のヒストグラム(以下、「ヒストグラムHist2」という)を生成する。このとき、参照値算出部213は、それぞれの周囲画素と注目画素との距離が近い、すなわち、当該周囲画素の座標位置と注目画素の座標位置とが近い最頻値ほど、より大きな度数となるように重みを付けてヒストグラムHist2を生成する。なお、それぞれの最頻値の度数に対する重み付けでは、信頼度閾値thrT1以上の信頼度を持つ周囲画素の最頻値の分散(ばらつき)を算出し、算出した分散値が大きいほどより大きな重み付けとなるように、最頻値の度数に対する重み付け係数の特性に傾斜をつける。そして、参照値算出部213は、生成したヒストグラムHist2における最大度数の最頻値を、参照値として動体除去画素生成部22に出力する。   In the calculation of the reference value by the reference value calculation unit 213, the number (frequency) of the surrounding pixels having the reliability equal to or higher than the reliability threshold thrT1 among the surrounding pixels in the reference range input from the reference range setting unit 212 is set. A histogram of the mode value (hereinafter referred to as “histogram Hist2”) is generated by counting for each mode value. At this time, the reference value calculation unit 213 has a larger frequency as the distance between each surrounding pixel and the target pixel is closer, that is, the mode value where the coordinate position of the surrounding pixel and the coordinate position of the target pixel are closer. Thus, the histogram Hist2 is generated with weights. In the weighting for the frequency of each mode value, the variance (variation) of the mode value of surrounding pixels having the reliability equal to or higher than the reliability threshold value thrT1 is calculated, and the larger the calculated variance value, the higher the weighting. In this manner, the characteristic of the weighting coefficient with respect to the frequency of the mode value is inclined. Then, the reference value calculation unit 213 outputs the mode value of the maximum frequency in the generated histogram Hist2 to the moving object removal pixel generation unit 22 as a reference value.

動体除去画素生成部22は、参照値生成部21から入力された、注目画素の信頼度と、周囲画素から算出した参照値とに基づいて、記憶部13から入力された複数の入力画像において同一の座標位置に配置されている各注目画素の画素値、および参照値生成部21から入力された最頻値の中から1つの値(画素値)を選択する。そして、動体除去画素生成部22は、選択した1つの値(画素値)を、動体除去画像において注目画素と同一の座標位置に配置されている動体除去画素の画素値として、画像処理部15に出力する。動体除去画素生成部22は、注目画素値検出部221と動体除去画素選択部222と、を備えている。   The moving object removal pixel generation unit 22 is the same in a plurality of input images input from the storage unit 13 based on the reliability of the target pixel input from the reference value generation unit 21 and the reference value calculated from the surrounding pixels. One value (pixel value) is selected from the pixel value of each pixel of interest arranged at the coordinate position and the mode value input from the reference value generation unit 21. Then, the moving object removal pixel generating unit 22 uses the selected one value (pixel value) as the pixel value of the moving object removal pixel arranged at the same coordinate position as the target pixel in the moving object removal image. Output. The moving object removal pixel generation unit 22 includes a target pixel value detection unit 221 and a moving object removal pixel selection unit 222.

注目画素値検出部221は、記憶部13から入力された複数の入力画像の各注目画素の内、参照値生成部21から入力された参照値に最も近い値の画素値を持つ注目画素を選択する。例えば、注目画素の画素値を選択する場合、注目画素値検出部221は、1枚目〜N枚目の入力画像の各注目画素の画素値と参照値との差分を入力画像の枚数分(N枚分)算出し、算出したN枚分の差分値が最も小さい注目画素を選択する。そして、注目画素値検出部221は、選択した注目画素の画素値を動体除去画素選択部222に出力する。   The target pixel value detection unit 221 selects a target pixel having a pixel value closest to the reference value input from the reference value generation unit 21 among the target pixels of the plurality of input images input from the storage unit 13. To do. For example, when selecting the pixel value of the target pixel, the target pixel value detection unit 221 calculates the difference between the pixel value of each target pixel and the reference value of the first to Nth input images by the number of input images ( N pixels) is calculated, and the target pixel having the smallest difference value for the calculated N sheets is selected. Then, the target pixel value detection unit 221 outputs the pixel value of the selected target pixel to the moving object removal pixel selection unit 222.

動体除去画素選択部222は、参照値生成部21から入力された信頼度に基づいて、注目画素値検出部221から入力された注目画素の画素値、または参照値生成部21から入力された最頻値のいずれか一方の値(画素値)を、動体除去画素の画素値として画像処理部15に出力する。より具体的には、参照値生成部21から入力された信頼度が、予め定めた信頼度の第2の閾値(以下、「信頼度閾値thrT2」という)以上である場合には、参照値生成部21から入力された最頻値を選択し、参照値生成部21から入力された信頼度が信頼度閾値thrT2よりも小さい場合には、注目画素値検出部221から入力された注目画素の画素値を選択する。そして、動体除去画素選択部222は、選択した値(画素値)を、動体除去部20が動体除去処理した最終的な動体除去画素の画素値として、画像処理部15に出力する。   Based on the reliability input from the reference value generation unit 21, the moving object removal pixel selection unit 222 receives the pixel value of the target pixel input from the target pixel value detection unit 221 or the maximum value input from the reference value generation unit 21. One of the frequent values (pixel value) is output to the image processing unit 15 as the pixel value of the moving object removal pixel. More specifically, when the reliability input from the reference value generation unit 21 is equal to or higher than a predetermined second threshold value of reliability (hereinafter referred to as “reliability threshold value thrT2”), a reference value generation is performed. When the mode value input from the unit 21 is selected and the reliability input from the reference value generation unit 21 is smaller than the reliability threshold thrT2, the pixel of the target pixel input from the target pixel value detection unit 221 Select a value. Then, the moving object removal pixel selection unit 222 outputs the selected value (pixel value) to the image processing unit 15 as the pixel value of the final moving object removal pixel that has been subjected to the moving object removal processing by the moving object removal unit 20.

このように、動体除去部20は、記憶部13から入力された全ての入力画像において、同一の座標位置に配置されているそれぞれの注目画素の画素値、および周囲画素の画素値に基づいて動体除去処理を順次行い、動体除去画像の画素の画素値を画像処理部15に出力する。   As described above, the moving object removing unit 20 moves the moving object based on the pixel values of the respective target pixels arranged at the same coordinate position and the pixel values of the surrounding pixels in all the input images input from the storage unit 13. The removal process is sequentially performed, and the pixel value of the pixel of the moving object removal image is output to the image processing unit 15.

なお、信頼度閾値thrT1、画素数閾値thrC、および信頼度閾値thrT2は、入力画像の枚数に応じて決定する。このとき、信頼度閾値thrT1は、注目画素と異なる周囲の座標位置に配置されている周囲画素に対する閾値であるため、より信頼度を高くするために、注目画素に対する閾値である信頼度閾値thrT2よりも大きな値にすることが考えられる。これにより、ヒストグラムHist2を生成する参照範囲内の周囲画素の信頼度が高くなり、参照値生成部21から入力された信頼度がより高い周囲画素に基づいて、動体除去画像の画素の画素値を選択することができ、より精度よく背景である可能性が高い画素の画素値を選択することができる。また、入力画像の枚数が多い場合には、信頼度閾値thrT1と信頼度閾値thrT2との差を大きくし、より周囲画素に対する信頼度を高めた状態で動体除去処理を行うことが考えられる。   The reliability threshold value thrT1, the pixel number threshold value thrC, and the reliability threshold value thrT2 are determined according to the number of input images. At this time, since the reliability threshold value thrT1 is a threshold value for surrounding pixels arranged at different peripheral coordinate positions from the target pixel, in order to further increase the reliability, the reliability threshold value thrT1 is higher than the reliability threshold value thrT2 that is a threshold value for the target pixel. It is conceivable to increase the value. Thereby, the reliability of the surrounding pixels in the reference range for generating the histogram Hist2 is increased, and the pixel values of the pixels of the moving object removal image are set based on the surrounding pixels having a higher reliability input from the reference value generation unit 21. The pixel value of a pixel that can be selected and is highly likely to be the background can be selected with higher accuracy. In addition, when the number of input images is large, it may be possible to perform the moving body removal process in a state where the difference between the reliability threshold value thrT1 and the reliability threshold value thrT2 is increased and the reliability with respect to surrounding pixels is further increased.

なお、例えば、入力画像の枚数が少ないことにより、注目画素の信頼度が低めの値であり、信頼度閾値thrT1と信頼度閾値thrT2とに差を設けると、信頼度の判定が正しく行えない可能性がある場合には、信頼度閾値thrT1と信頼度閾値thrT2とを、同じ値にすることもできる。この場合には、参照範囲設定部212および参照値算出部213において、信頼度閾値thrT1(=thrT2)よりも大きい信頼度を持つ周囲画素を、参照範囲の決定やヒストグラムHist2の生成における対象の周囲画素とすることによって、信頼度がより高い周囲画素に基づいて動体除去画像の画素の画素値を選択することができる。   Note that, for example, since the number of input images is small, the reliability of the target pixel is a low value, and if a difference is provided between the reliability threshold value thrT1 and the reliability threshold value thrT2, the reliability cannot be correctly determined. If there is a possibility, the reliability threshold value thrT1 and the reliability threshold value thrT2 can be set to the same value. In this case, in the reference range setting unit 212 and the reference value calculation unit 213, the surrounding pixels having the reliability higher than the reliability threshold thrT1 (= thrT2) are set as the surroundings of the target in the determination of the reference range and the generation of the histogram Hist2. By setting it as a pixel, the pixel value of the pixel of the moving object removal image can be selected based on surrounding pixels with higher reliability.

次に、撮像装置10に備えた本実施形態の画像生成装置である動体除去部20における動体除去処理の手順について説明する。動体除去部20による動体除去処理では、参照値生成部21が、各注目画素の信頼度および最頻値を順次生成しながら、参照範囲の設定および参照値の算出を行い、動体除去画素生成部22が、各注目画素の信頼度と参照値とに基づいて、注目画素と同一の座標位置に配置されている動体除去画素の画素値を選択して出力する。以下の説明においては、説明を容易にするため、まず、参照値生成部21内の信頼度生成部211が、全ての注目画素の信頼度および最頻値を生成し、その後、参照値生成部21内の参照範囲設定部212および参照値算出部213が参照範囲の設定および参照値の算出を行って、動体除去画素生成部22が動体除去画素の画素値を選択して出力するものとして説明を行う。なお、このとき、信頼度生成部211は、生成した全ての注目画素の信頼度および最頻値を、一旦、不図示の一時記憶部に記憶し、参照範囲設定部212、参照値算出部213、および動体除去画素生成部22のそれぞれは、不図示の一時記憶部に記憶されている信頼度および最頻値を読み出して、それぞれの処理を実行するものとする。   Next, the procedure of the moving body removal process in the moving body removal unit 20 that is the image generation apparatus of the present embodiment provided in the imaging device 10 will be described. In the moving object removal processing by the moving object removal unit 20, the reference value generation unit 21 sets the reference range and calculates the reference value while sequentially generating the reliability and the mode value of each pixel of interest, and the moving object removal pixel generation unit 22 selects and outputs the pixel value of the moving object removal pixel arranged at the same coordinate position as the target pixel based on the reliability and the reference value of each target pixel. In the following description, for ease of explanation, first, the reliability generation unit 211 in the reference value generation unit 21 generates the reliability and mode value of all the target pixels, and then the reference value generation unit The reference range setting unit 212 and the reference value calculation unit 213 in FIG. 21 set the reference range and calculate the reference value, and the moving object removal pixel generation unit 22 selects and outputs the pixel value of the moving object removal pixel. I do. At this time, the reliability generation unit 211 temporarily stores the reliability and mode value of all generated target pixels in a temporary storage unit (not shown), and the reference range setting unit 212 and the reference value calculation unit 213. Each of the moving object removal pixel generation unit 22 reads the reliability and the mode value stored in a temporary storage unit (not shown), and executes each process.

図3は、本実施形態の画像生成装置である動体除去部20における動体除去処理の手順を示したフローチャートである。また、図4〜図7は、本実施形態の画像生成装置である動体除去部20による動体除去処理におけるそれぞれの処理の一例を説明する図である。図3に示した動体除去処理のフローチャートの説明においては、適宜、図4〜図7に示した動体除去処理におけるそれぞれの処理の一例を参照して、5枚(フレーム)の入力画像から、不要な移動体の画素値を動体として除去した1枚の動体除去画像を生成する場合の例を説明する。   FIG. 3 is a flowchart showing the procedure of the moving object removing process in the moving object removing unit 20 which is the image generating apparatus of the present embodiment. 4 to 7 are diagrams for explaining an example of each process in the moving object removing process by the moving object removing unit 20 which is the image generating apparatus according to the present embodiment. In the description of the flowchart of the moving object removal process illustrated in FIG. 3, it is unnecessary to refer to an example of each process in the moving object removal process illustrated in FIGS. 4 to 7 from five (frame) input images. An example in the case of generating one moving object removal image in which the pixel value of a moving object is removed as a moving object will be described.

動体除去部20は、制御部11からの制御に応じて動体除去処理を開始すると、参照値生成部21は、ステップS1から、1つ目の画素(注目画素)の信頼度および最頻値の生成処理を開始する。1つ目の注目画素の信頼度および最頻値の生成処理が開始されると、ステップS1において、参照値生成部21内の信頼度生成部211は、記憶部13から複数枚(本説明においては、5フレーム)の入力画像において同一の座標位置(x,y)に配置されている1つ目の注目画素の画素値In1(x,y)〜In5(x,y)を取得する。   When the moving object removing unit 20 starts the moving object removing process in accordance with the control from the control unit 11, the reference value generating unit 21 determines the reliability and mode value of the first pixel (target pixel) from step S1. Start the generation process. When the process of generating the reliability and mode value of the first target pixel is started, a plurality of reliability generation units 211 in the reference value generation unit 21 are stored from the storage unit 13 (in this description, in step S1). Acquires the pixel values In1 (x, y) to In5 (x, y) of the first pixel of interest arranged at the same coordinate position (x, y) in the input image of (5 frames).

続いて、ステップS2において、信頼度生成部211は、取得した1つ目の注目画素の5つの画素値In1(x,y)〜In5(x,y)のヒストグラムHist1を生成する。   Subsequently, in step S2, the reliability generation unit 211 generates the histogram Hist1 of the five pixel values In1 (x, y) to In5 (x, y) of the acquired first target pixel.

続いて、ステップS3において、信頼度生成部211は、生成したヒストグラムHist1における度数の最大値である信頼度MaxFreq(x,y)を、不図示の一時記憶部に記憶する。   Subsequently, in step S3, the reliability generation unit 211 stores the reliability MaxFreq (x, y), which is the maximum value of the frequency in the generated histogram Hist1, in a temporary storage unit (not illustrated).

続いて、ステップS4において、信頼度生成部211は、生成したヒストグラムHist1における最大度数の画素値である最頻値MaxFreqValue(x,y)を、不図示の一時記憶部に記憶する。   Subsequently, in step S4, the reliability generation unit 211 stores the mode value MaxFreqValue (x, y), which is the maximum frequency pixel value in the generated histogram Hist1, in a temporary storage unit (not shown).

ここまでの処理が、入力画像の1つ目の注目画素の信頼度および最頻値の生成処理である。以降、信頼度生成部211は、ステップS1〜ステップS4までの入力画像の1つの注目画素の信頼度および最頻値の生成処理を、入力画像の全ての画素に対する信頼度および最頻値の生成処理が完了するまで、繰り返す。その後、ステップS1〜ステップS4までの処理の繰り返しを、入力画像の画素数と同じ回数行うと、すなわち、入力画像の全ての画素に対する信頼度および最頻値の生成処理が完了すると、ステップS5において処理のループを抜け出す。   The process so far is the process of generating the reliability and mode value of the first target pixel of the input image. Thereafter, the reliability generation unit 211 performs the process of generating the reliability and mode value of one target pixel of the input image in steps S1 to S4, and generates the reliability and mode value for all the pixels of the input image. Repeat until processing is complete. After that, when the process from step S1 to step S4 is repeated as many times as the number of pixels of the input image, that is, when the process of generating the reliability and mode value for all the pixels of the input image is completed, in step S5 Exit the processing loop.

ここで、信頼度生成部211によって行われる、ステップS1〜ステップS4までの入力画像の1つの注目画素に対する信頼度および最頻値の生成処理の一例について説明する。図4は、本実施形態の画像生成装置による動体除去処理において信頼度と最頻値とを生成する処理の一例を説明する図である。   Here, an example of the reliability and mode value generation processing for one target pixel of the input image from step S1 to step S4 performed by the reliability generation unit 211 will be described. FIG. 4 is a diagram for explaining an example of a process for generating the reliability and the mode value in the moving object removal process by the image generation apparatus of the present embodiment.

信頼度生成部211は、ステップS1において、図4(a)に示した5フレームの入力画像内で同一の座標位置(x,y)に配置されている注目画素の5つの画素値In1(x,y)〜In5(x,y)を取得したものとする。そして、信頼度生成部211は、ステップS2において、図4(b)に示したように、取得した注目画素の5つの画素値In1(x,y)〜In5(x,y)のヒストグラムHist1を生成する。そして、信頼度生成部211は、図4(c)に示したように、生成したヒストグラムHist1から信頼度MaxFreq(x,y)(図4(c)においては、信頼度MaxFreq(x,y)=3)を不図示の一時記憶部に記憶し(ステップS3)、信頼度MaxFreq(x,y)=3である注目画素の画素値を、最頻値MaxFreqValue(x,y)として不図示の一時記憶部に記憶する(ステップS4)。   In step S1, the reliability generation unit 211 selects five pixel values In1 (x) of the target pixel arranged at the same coordinate position (x, y) in the five-frame input image illustrated in FIG. , Y) to In5 (x, y). Then, in step S2, the reliability generation unit 211 obtains the histogram Hist1 of the acquired five pixel values In1 (x, y) to In5 (x, y) of the target pixel as illustrated in FIG. 4B. Generate. Then, as shown in FIG. 4C, the reliability generation unit 211 calculates the reliability MaxFreq (x, y) from the generated histogram Hist1 (in FIG. 4C, the reliability MaxFreq (x, y)). = 3) is stored in a temporary storage unit (not shown) (step S3), and the pixel value of the pixel of interest with the reliability MaxFreq (x, y) = 3 is set as the mode value MaxFreqValue (x, y) (not shown). Store in the temporary storage unit (step S4).

そして、入力画像の全ての画素に対する信頼度および最頻値の生成処理が完了すると、参照値生成部21内の参照範囲設定部212および参照値算出部213と、動体除去画素生成部22とのそれぞれは、ステップS6から、動体除去画像において1つ目の画素(注目画素)と同一の座標位置(x,y)に配置される1つ目の動体除去画素の画素値の選択処理を開始する。1つ目の動体除去画素の画素値の選択処理が開始されると、ステップS6において、参照範囲設定部212および参照値算出部213と、動体除去画素生成部22とのそれぞれは、不図示の一時記憶部に記憶されている1つ目の注目画素の信頼度MaxFreq(x,y)および最頻値MaxFreqValue(x,y)を読み出す。また、動体除去画素生成部22は、記憶部13から複数枚(本説明においては、5フレーム)の入力画像の1つ目の注目画素の画素値In1(x,y)〜In5(x,y)を再度取得する。   When the generation processing of the reliability and the mode value for all the pixels of the input image is completed, the reference range setting unit 212 and the reference value calculation unit 213 in the reference value generation unit 21 and the moving object removal pixel generation unit 22 Each starts the selection processing of the pixel value of the first moving object removal pixel arranged at the same coordinate position (x, y) as the first pixel (target pixel) in the moving object removal image from step S6. . When the selection process of the pixel value of the first moving object removal pixel is started, in step S6, each of the reference range setting unit 212, the reference value calculation unit 213, and the moving object removal pixel generation unit 22 is not illustrated. The reliability MaxFreq (x, y) and the mode value MaxFreqValue (x, y) of the first target pixel stored in the temporary storage unit are read. In addition, the moving object removal pixel generation unit 22 has pixel values In1 (x, y) to In5 (x, y) of the first target pixel of a plurality of (in this description, five frames) input images from the storage unit 13. ) Get again.

続いて、ステップS7において、動体除去画素生成部22内の動体除去画素選択部222は、1つ目の注目画素の信頼度MaxFreq(x,y)と信頼度閾値thrT2とを比較し、1つ目の注目画素の信頼度MaxFreq(x,y)が、信頼度閾値thrT2(本説明においては、信頼度閾値thrT2=3)以上であるか否かを判定する。   Subsequently, in step S7, the moving object removal pixel selection unit 222 in the moving object removal pixel generation unit 22 compares the reliability MaxFreq (x, y) of the first target pixel with the reliability threshold value thrT2. It is determined whether or not the reliability MaxFreq (x, y) of the pixel of interest of the eye is equal to or higher than the reliability threshold thrT2 (in this description, the reliability threshold thrT2 = 3).

ステップS7による判定の結果、1つ目の注目画素の信頼度MaxFreq(x,y)が、信頼度閾値thrT2以上である場合には、ステップS8において、動体除去画素選択部222は、1つ目の注目画素の最頻値MaxFreqValue(x,y)を、動体除去画像において1つ目の注目画素と同一の座標位置(x,y)に配置される1つ目の動体除去画素の画素値として、画像処理部15に出力する。つまり、1つ目の注目画素の5つの画素値In1(x,y)〜In5(x,y)のみから、背景である可能性が高い画素の画素値(最頻値)を選択することができる場合には、動体除去画素生成部22は、1つ目の注目画素の周囲の画素の信頼度と最頻値とに基づいて算出される参照値を用いずに、最終的な動体除去画素の画素値を選択する。   As a result of the determination in step S7, when the reliability MaxFreq (x, y) of the first pixel of interest is equal to or higher than the reliability threshold thrT2, in step S8, the moving object removal pixel selection unit 222 selects the first Is the pixel value of the first moving object removal pixel arranged at the same coordinate position (x, y) as the first attention pixel in the moving object removal image. To the image processing unit 15. That is, it is possible to select a pixel value (mode) of a pixel that is likely to be the background from only the five pixel values In1 (x, y) to In5 (x, y) of the first target pixel. If possible, the moving object removal pixel generation unit 22 does not use the reference value calculated based on the reliability and the mode value of the pixels around the first pixel of interest, and does not use the final moving object removal pixel. Select a pixel value.

一方、ステップS7による判定の結果、1つ目の注目画素の信頼度MaxFreq(x,y)が、信頼度閾値thrT2よりも小さい場合には、ステップS9以降の、参照値を用いて最終的な動体除去画素の画素値を決定する処理に進む。つまり、1つ目の注目画素の5つの画素値In1(x,y)〜In5(x,y)のみでは、背景である可能性が高い画素の画素値を選択することができない場合には、1つ目の注目画素の周囲に配置されている周囲画素の信頼度と最頻値とに基づいて、最終的な動体除去画素の画素値を選択する。   On the other hand, if the reliability MaxFreq (x, y) of the first pixel of interest is smaller than the reliability threshold thrT2 as a result of the determination in step S7, the final value is obtained using the reference value in step S9 and subsequent steps. It progresses to the process which determines the pixel value of a moving body removal pixel. That is, when only the five pixel values In1 (x, y) to In5 (x, y) of the first pixel of interest cannot select the pixel value of the pixel that is likely to be the background, The final pixel value of the moving object removal pixel is selected based on the reliability and the mode value of the surrounding pixels arranged around the first target pixel.

参照値を用いて最終的な動体除去画素の画素値を決定する処理(以下、「画素値の決定処理」という)では、最初に、参照範囲設定部212による参照範囲の設定処理を行う。参照範囲の設定処理では、ステップS9において、参照範囲設定部212は、現在処理している1つ目の注目画素の周囲の参照範囲として設定する画素数である参照範囲サイズSizeRを初期化する。ここでは、参照範囲サイズSizeR=1に初期化する。これにより、1つ目の注目画素の座標位置(x,y)を中心とした参照範囲は、x方向(水平方向)にx−SizeR〜x+SizeR、y方向(垂直方向)にy−SizeR〜y+SizeRの範囲に設定される。すなわち、1つ目の注目画素の周囲(上下左右)に1画素(参照範囲サイズSizeR=1)分ずつの3画素×3画素の矩形領域の範囲である、注目画素を中心とした9画素の範囲に設定される。なお、以下の説明においては、参照範囲内のそれぞれの周囲画素におけるx方向(水平方向)の座標位置を「i」と表し、y方向(垂直方向)の座標位置を「j」と表すこととする。   In the process of determining the final pixel value of the moving object removal pixel using the reference value (hereinafter referred to as “pixel value determination process”), first, the reference range setting unit 212 performs a reference range setting process. In the reference range setting process, in step S9, the reference range setting unit 212 initializes a reference range size SizeR that is the number of pixels set as a reference range around the first pixel of interest currently being processed. Here, the reference range size SizeR = 1 is initialized. Thus, the reference range centered on the coordinate position (x, y) of the first target pixel is x-SizeR to x + SizeR in the x direction (horizontal direction), and y-SizeR to y + SizeR in the y direction (vertical direction). Is set in the range. That is, 9 pixels centered on the target pixel, which is a 3 pixel × 3 pixel rectangular area of one pixel (reference range size SizeR = 1) around the first target pixel (up / down / left / right). Set to range. In the following description, the coordinate position in the x direction (horizontal direction) of each surrounding pixel in the reference range is represented as “i”, and the coordinate position in the y direction (vertical direction) is represented as “j”. To do.

続いて、ステップS10において、参照範囲設定部212は、不図示の一時記憶部に記憶されている、参照範囲内の9画素分の周囲画素の信頼度MaxFreq(i,j)を読み出す。そして、参照範囲設定部212は、読み出した9つの周囲画素の信頼度MaxFreq(i,j)と、信頼度閾値thrT1とを比較し、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の数を計数(カウント)する。本説明においては、信頼度閾値thrT1を信頼度閾値thrT2よりも大きな値(信頼度閾値thrT1=4)としているため、信頼度MaxFreq(i,j)≧4である周囲画素の数をカウントする。以下の説明においては、参照範囲設定部212がカウントした周囲画素の数を、画素数カウント値CntTとする。   Subsequently, in step S10, the reference range setting unit 212 reads the reliability MaxFreq (i, j) of the surrounding pixels for nine pixels in the reference range, which is stored in a temporary storage unit (not shown). Then, the reference range setting unit 212 compares the reliability MaxFreq (i, j) of the nine read pixels and the reliability threshold value thrT1, and determines the reliability MaxFreq (i, j) equal to or higher than the reliability threshold value thrT1. Count the number of surrounding pixels. In this description, since the reliability threshold value thrT1 is set to a value larger than the reliability threshold value thrT2 (reliability threshold value thrT1 = 4), the number of surrounding pixels with the reliability MaxFreq (i, j) ≧ 4 is counted. In the following description, the number of surrounding pixels counted by the reference range setting unit 212 is referred to as a pixel number count value CntT.

続いて、ステップS11において、参照範囲設定部212は、画素数カウント値CntTと、画素数閾値thrCとを比較し、画素数カウント値CntT、すなわち、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の数が、画素数閾値thrC(本説明においては、画素数閾値thrC=5)以上であるか否かを判定する。   Subsequently, in step S11, the reference range setting unit 212 compares the pixel count value CntT with the pixel count threshold thrC, and the pixel count value CntT, that is, the reliability MaxFreq (i, greater than or equal to the reliability threshold thrT1). It is determined whether or not the number of surrounding pixels having j) is equal to or greater than the pixel number threshold thrC (in this description, the pixel number threshold thrC = 5).

ステップS11による判定の結果、画素数カウント値CntTが、画素数閾値thrCよりも少ない場合には、ステップS12において、参照範囲設定部212は、参照範囲を周囲に1画素分ずつ広げる。すなわち、参照範囲サイズSizeRに「1」を加算して、参照範囲サイズSizeR=2にする。これにより、1つ目の注目画素の座標位置(x,y)を中心とした参照範囲は、1つ目の注目画素の周囲(上下左右)に2画素(参照範囲サイズSizeR=2)分ずつの5画素×5画素の矩形領域の範囲である、注目画素を中心とした25画素の範囲に再度設定される。そして、ステップS10に戻って、参照範囲内の25画素分の周囲画素の信頼度MaxFreq(i,j)の読み出しと、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の数のカウントとを再度行う。   If the result of determination in step S11 is that the pixel count value CntT is smaller than the pixel count threshold thrC, in step S12, the reference range setting unit 212 extends the reference range by one pixel around the periphery. That is, “1” is added to the reference range size SizeR so that the reference range size SizeR = 2. Thus, the reference range centered on the coordinate position (x, y) of the first target pixel is two pixels (reference range size SizeR = 2) around the first target pixel (up, down, left, and right). This is a range of 25 pixels centered on the pixel of interest, which is a range of a rectangular area of 5 pixels × 5 pixels. Then, returning to step S10, the reading of the reliability MaxFreq (i, j) of the surrounding pixels for 25 pixels within the reference range and the surrounding pixels having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1. Count the number again.

一方、ステップS11による判定の結果、画素数カウント値CntTが、画素数閾値thrC以上である場合には、ステップS13において、参照範囲設定部212は、現在の参照範囲サイズSizeRによって設定された矩形領域の範囲を、参照値を算出するために使用する参照範囲に決定する。そして、参照範囲設定部212は、決定した参照範囲の大きさを表す情報(例えば、参照範囲に決定した矩形領域の大きさや、参照範囲サイズSizeR)を、参照値算出部213に出力する。   On the other hand, if the result of determination in step S11 is that the pixel count value CntT is greater than or equal to the pixel count threshold thrC, in step S13, the reference range setting unit 212 sets the rectangular area set by the current reference range size SizeR. Is determined as a reference range used for calculating a reference value. Then, the reference range setting unit 212 outputs information indicating the size of the determined reference range (for example, the size of the rectangular area determined as the reference range and the reference range size SizeR) to the reference value calculation unit 213.

ここまでのステップS9〜ステップS13の処理が、画素値の決定処理において最初に行う、参照範囲設定部212による参照範囲の設定処理である。ここで、参照範囲設定部212によって行われる、ステップS9〜ステップS13までの参照範囲の設定処理の一例について説明する。図5は、本実施形態の画像生成装置による動体除去処理において参照範囲を設定する処理の一例を説明する図である。   The processing from step S9 to step S13 so far is reference range setting processing by the reference range setting unit 212, which is first performed in the pixel value determination processing. Here, an example of reference range setting processing from step S9 to step S13 performed by the reference range setting unit 212 will be described. FIG. 5 is a diagram illustrating an example of processing for setting a reference range in the moving object removal processing by the image generation apparatus according to the present embodiment.

参照範囲設定部212は、ステップS9において、図5(a)に示したように、参照範囲サイズSizeR=1に初期化する。これにより、図5(a)において「★」で示している注目画素を中心とした参照範囲は、注目画素の周囲(上下左右)に1画素分ずつの3画素×3画素の矩形領域の範囲(注目画素を中心とした9画素の範囲)に設定される。ここで、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素が、図5(a)において「網掛け」で示した2つの周囲画素であるものとする。このため、ステップS10において、参照範囲設定部212がカウントした画素数カウント値CntTは、画素数カウント値CntT=2となる。従って、参照範囲設定部212は、ステップS11において、参照範囲を周囲に1画素分ずつ広げる(ステップS11のNo)と判定する。   In step S9, the reference range setting unit 212 initializes the reference range size SizeR = 1 as shown in FIG. Accordingly, the reference range centered on the target pixel indicated by “★” in FIG. 5A is a range of a rectangular area of 3 pixels × 3 pixels, one pixel around the target pixel (up, down, left and right). (9 pixel range centered on the target pixel). Here, it is assumed that the surrounding pixels having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold value thrT1 are the two surrounding pixels indicated by “shaded” in FIG. For this reason, in step S10, the pixel count value CntT counted by the reference range setting unit 212 is the pixel count count CntT = 2. Therefore, the reference range setting unit 212 determines in step S11 that the reference range is expanded by one pixel around the periphery (No in step S11).

そして、参照範囲設定部212は、ステップS12において、図5(b)に示したように、参照範囲サイズSizeR=2にする。これにより、図5(b)において「★」で示している注目画素を中心とした参照範囲は、注目画素の周囲(上下左右)に2画素分ずつの5画素×5画素の矩形領域の範囲(注目画素を中心とした25画素の範囲)に設定される。この参照範囲では、ステップS10において、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ、図5(b)において「網掛け」で示した周囲画素をカウントした画素数カウント値CntTが、画素数カウント値CntT=6となる。この画素数カウント値CntT=6は、ステップS11の条件を満足するため(ステップS11のYes)、参照範囲設定部212は、ステップS13において、現在の参照範囲サイズSizeR=2によって設定された矩形領域の範囲を、参照値を算出するために使用する参照範囲に決定する。   Then, in step S12, the reference range setting unit 212 sets the reference range size SizeR = 2 as shown in FIG. 5B. As a result, the reference range centered on the target pixel indicated by “★” in FIG. 5B is a range of a rectangular area of 5 pixels × 5 pixels of two pixels around the target pixel (up, down, left and right). (Range of 25 pixels centered on the target pixel). In this reference range, in step S10, the pixel count value CntT obtained by counting the surrounding pixels indicated by “shaded” in FIG. 5B having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1 is obtained. The pixel count value CntT = 6. Since this pixel count value CntT = 6 satisfies the condition of step S11 (Yes in step S11), the reference range setting unit 212 in step S13 is a rectangular area set by the current reference range size SizeR = 2. Is determined as a reference range used for calculating a reference value.

そして、参照範囲設定部212による参照範囲の設定処理が完了すると、参照値を用いた最終的な動体除去画素の画素値の決定処理では、次に、参照値算出部213による参照値の算出処理を行う。参照値の算出処理では、ステップS14において、参照値算出部213は、参照範囲内の周囲画素の内、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の最頻値MaxFreqValue(i,j)の分散(ばらつき)を算出する。これにより、参照範囲内で背景である可能性が高いそれぞれの周囲画素の最頻値MaxFreqValue(i,j)同士の差がわかり、画素値の変化が多い背景(例えば、細かい模様の背景)であるか、画素値の変化が少ない背景(例えば、模様の少ない背景)であるかを判定することができる。以下の説明においては、参照範囲設定部212が算出した分散の値を、分散値Variとする。   When the reference range setting process by the reference range setting unit 212 is completed, the reference value calculation process by the reference value calculation unit 213 is then performed in the final pixel value determination process of the moving object removal pixel using the reference value. I do. In the reference value calculation process, in step S14, the reference value calculation unit 213, among the surrounding pixels in the reference range, the mode value MaxFreqValue of the surrounding pixels having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1. The variance (variation) of (i, j) is calculated. As a result, the difference between the mode values MaxFreqValue (i, j) of each surrounding pixel that is highly likely to be the background within the reference range is known, and the background (for example, the background of a fine pattern) with a large change in the pixel value is known. It can be determined whether there is a background with little change in pixel value (for example, a background with little pattern). In the following description, the variance value calculated by the reference range setting unit 212 is referred to as a variance value Vari.

続いて、ステップS15において、参照値算出部213は、ヒストグラムHist2を生成する参照範囲内のそれぞれの周囲画素の座標位置に対して、信頼度MaxFreq(i,j)に応じた重み付け係数K1(i,j)を設定する。このとき、参照値算出部213は、参照範囲内の周囲画素の座標位置(i,j)が中央、すなわち、注目画素の座標位置(x,y)に近いほど重み付け係数K1(i,j)を大きく、中央から遠いほど重み付け係数K1(i,j)を小さくする。また、参照値算出部213は、注目画素の座標位置(x,y)からの距離が同じである周囲画素の座標位置に対しては、参照範囲設定部212が算出した分散値Variが大きいほど重み付け係数K1(i,j)を大きく、分散値Variが小さいほど重み付け係数K1(i,j)を小さくする。すなわち、分散値Variが大きいほど注目画素の座標位置(x,y)からの距離に応じた重み付け係数K1(i,j)の差を大きく、分散値Variが小さいほど注目画素の座標位置(x,y)からの距離に応じた重み付け係数K1(i,j)の差を小さくする。   Subsequently, in step S15, the reference value calculation unit 213 applies the weighting coefficient K1 (i) corresponding to the reliability MaxFreq (i, j) to the coordinate position of each surrounding pixel in the reference range for generating the histogram Hist2. , J). At this time, the reference value calculation unit 213 determines the weighting coefficient K1 (i, j) as the coordinate position (i, j) of the surrounding pixels in the reference range is closer to the center, that is, the coordinate position (x, y) of the target pixel. The weighting coefficient K1 (i, j) is decreased as the distance from the center increases. Further, the reference value calculation unit 213 increases the variance value Vari calculated by the reference range setting unit 212 with respect to the coordinate positions of surrounding pixels having the same distance from the coordinate position (x, y) of the target pixel. The weighting coefficient K1 (i, j) is decreased as the weighting coefficient K1 (i, j) is increased and the variance value Vari is decreased. That is, the larger the variance value Vari, the larger the difference in the weighting coefficient K1 (i, j) corresponding to the distance from the coordinate position (x, y) of the pixel of interest, and the smaller the variance value Vari, the coordinate position (x , Y), the difference in the weighting coefficient K1 (i, j) corresponding to the distance from is reduced.

より具体的には、参照値算出部213は、参照範囲設定部212が算出した分散値Variに基づいて、下式(1)によって重み付け係数K1(i,j)を算出し、算出した重み付け係数K1(i,j)を、参照範囲内のそれぞれの周囲画素の座標位置に対して設定する。   More specifically, the reference value calculation unit 213 calculates the weighting coefficient K1 (i, j) by the following equation (1) based on the variance value Vari calculated by the reference range setting unit 212, and the calculated weighting coefficient K1 (i, j) is set for the coordinate position of each surrounding pixel in the reference range.

Figure 2014057261
Figure 2014057261

上式(1)において、kVariは分散値Variに応じた定数(以下、「定数kVari」という)を表している。また、thrLは分散値Variの下方の閾値(以下、「下方閾値thrL」という)を表し、thrUは分散値Variの上方の閾値(以下、「上方閾値thrU」という)を表している。なお、下方閾値thrLと上方閾値thrUとの関係は、0<下方閾値thrL<上方閾値thrUである。   In the above equation (1), kVari represents a constant (hereinafter referred to as “constant kVari”) corresponding to the variance value Vari. Further, thrL represents a lower threshold value of the variance value Vari (hereinafter referred to as “lower threshold value thrL”), and thrU represents an upper threshold value of the variance value Vari (hereinafter referred to as “upper threshold value thrU”). The relationship between the lower threshold value thrL and the upper threshold value thrU is 0 <lower threshold value thrL <upper threshold value thrU.

上式(1)では、参照範囲内のそれぞれの周囲画素において信頼度MaxFreq(i,j)が信頼度閾値thrT1よりも小さい周囲画素の座標位置に対する重み付け係数K1(i,j)を、重み付け係数K1(i,j)=0としている。これにより、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ参照範囲内のそれぞれの周囲画素の座標位置に対して、重み付け係数K1(i,j)が設定される。また、信頼度MaxFreq(i,j)が信頼度閾値thrT1以上の参照範囲内のそれぞれの周囲画素の座標位置に対しては、上述したような関係の重み付け係数K1(i,j)が設定される。   In the above equation (1), the weighting coefficient K1 (i, j) for the coordinate position of the surrounding pixel whose reliability MaxFreq (i, j) is smaller than the reliability threshold value thrT1 in each surrounding pixel in the reference range is expressed as the weighting coefficient. K1 (i, j) = 0. Thereby, the weighting coefficient K1 (i, j) is set for the coordinate position of each surrounding pixel in the reference range having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1. Further, the weighting coefficient K1 (i, j) having the above-described relationship is set for the coordinate position of each surrounding pixel in the reference range where the reliability MaxFreq (i, j) is equal to or greater than the reliability threshold thrT1. The

ここで、参照値算出部213が設定する、上式(1)で表される重み付け係数K1(i,j)について説明する。図6は、本実施形態の画像生成装置による動体除去処理において用いる係数の一例を説明する図である。図6には、分散値Variおよび注目画素からの距離と、重み付け係数K1との関係を示している。   Here, the weighting coefficient K1 (i, j) represented by the above equation (1) set by the reference value calculation unit 213 will be described. FIG. 6 is a diagram for explaining an example of coefficients used in the moving object removal process by the image generation apparatus of the present embodiment. FIG. 6 shows the relationship between the variance value Vari and the distance from the target pixel, and the weighting coefficient K1.

図6を見てわかるように、上式(1)によって算出される重み付け係数K1は、注目画素からの距離が近い周囲画素の座標位置ほど大きく、注目画素からの距離が遠い周囲画素の座標位置ほど小さくなるように傾斜が付けられた関係になっている。さらに、図6を見てわかるように、重み付け係数K1は、分散値Variが大きいほど傾斜が大きく、分散値Variが小さいほど傾斜を小さくなっている。上式(1)では、下方閾値thrLと上方閾値thrUとによって分散値Variの範囲を分けることにより、図6に示したように、3種類の重み付け係数K1の特性を設定している。すなわち、上式(1)において定数kVariは、重み付け係数K1の特性の傾きの大きさを表している。   As can be seen from FIG. 6, the weighting coefficient K1 calculated by the above equation (1) is larger as the coordinate position of the surrounding pixel closer to the target pixel, and the coordinate position of the surrounding pixel farther from the target pixel. The relationship is inclined so that it becomes smaller. Further, as can be seen from FIG. 6, the weighting coefficient K1 has a larger slope as the variance value Vari is larger, and the slope is smaller as the variance value Vari is smaller. In the above equation (1), the characteristics of the three types of weighting coefficients K1 are set as shown in FIG. 6 by dividing the range of the variance value Vari by the lower threshold value thrL and the upper threshold value thrU. That is, in the above equation (1), the constant kVari represents the magnitude of the slope of the characteristic of the weighting coefficient K1.

このように、参照値算出部213が重み付け係数K1(i,j)を設定することによって、参照範囲内の周囲画素の最頻値MaxFreqValue(i,j)の分散(ばらつき)と、参照範囲内のそれぞれの周囲画素の信頼度MaxFreq(i,j)とを考慮した、参照範囲内のそれぞれの周囲画素における最頻値MaxFreqValue(i,j)のヒストグラムHist2を生成することができる。   As described above, the reference value calculation unit 213 sets the weighting coefficient K1 (i, j), thereby allowing the variance (variation) of the mode value MaxFreqValue (i, j) of the surrounding pixels in the reference range and the reference range. The histogram Hist2 of the mode MaxFreqValue (i, j) in each surrounding pixel in the reference range can be generated in consideration of the reliability MaxFreq (i, j) of each surrounding pixel.

続いて、ステップS16において、参照値算出部213は、重み付け係数K1(i,j)で重み付けした参照範囲内の周囲画素の最頻値MaxFreqValue(i,j)のヒストグラムHist2を生成する。なお、上述したように、参照範囲内のそれぞれの周囲画素において、信頼度MaxFreq(i,j)が信頼度閾値thrT1よりも小さい周囲画素の重み付け係数K1(i,j)は、重み付け係数K1(i,j)=0である。従って、参照値算出部213が生成するヒストグラムHist2は、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の最頻値MaxFreqValue(i,j)を要素としたヒストグラムである。   Subsequently, in step S16, the reference value calculation unit 213 generates a histogram Hist2 of the mode value MaxFreqValue (i, j) of surrounding pixels in the reference range weighted by the weighting coefficient K1 (i, j). As described above, in each surrounding pixel within the reference range, the weighting coefficient K1 (i, j) of the surrounding pixels whose reliability MaxFreq (i, j) is smaller than the reliability threshold thrT1 is the weighting coefficient K1 ( i, j) = 0. Accordingly, the histogram Hist2 generated by the reference value calculation unit 213 is a histogram having, as elements, the mode value MaxFreqValue (i, j) of surrounding pixels having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1.

続いて、ステップS17において、参照値算出部213は、生成したヒストグラムHist2における最大度数が1つであるか否かを判定する。ステップS17による判定の結果、生成したヒストグラムHist2における最大度数が1つではない場合には、ステップS12に戻って、参照範囲設定部212による参照範囲サイズSizeRの再設定、およびステップS10〜ステップS13までの参照範囲の設定処理と、参照値算出部213によるステップS14〜ステップS17までの参照値の算出処理とを再度行う。   Subsequently, in step S17, the reference value calculation unit 213 determines whether or not the maximum frequency in the generated histogram Hist2 is one. As a result of the determination in step S17, if the maximum frequency in the generated histogram Hist2 is not one, the process returns to step S12, the reference range size SizeR is reset by the reference range setting unit 212, and steps S10 to S13. The reference range setting process and the reference value calculation process from step S14 to step S17 by the reference value calculation unit 213 are performed again.

一方、ステップS17による判定の結果、生成したヒストグラムHist2における最大度数が1つである場合には、ステップS18において、参照値算出部213は、生成したヒストグラムHist2における最大度数の最頻値MaxFreqValue(i,j)を、参照値として動体除去画素生成部22に出力する。   On the other hand, if the result of determination in step S17 is that the maximum frequency in the generated histogram Hist2 is 1, in step S18, the reference value calculation unit 213 determines the maximum frequency MaxFreqValue (i) in the generated histogram Hist2. , J) is output to the moving object removal pixel generation unit 22 as a reference value.

ここまでのステップS14〜ステップS18の処理が、画素値の決定処理において次に行う、参照値算出部213による参照値の算出処理である。ここで、参照値算出部213によって行われる、ステップS16〜ステップS18までの参照値の算出処理の一例について説明する。図7は、本実施形態の画像生成装置による動体除去処理において参照値を決定する処理の一例を説明する図である。図7には、図5(b)に示した参照範囲内の周囲画素の内、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の最頻値MaxFreqValue(i,j)のヒストグラムHist2を生成し、生成したヒストグラムHist2における最大度数の最頻値MaxFreqValue(i,j)を、参照値として決定する処理を示している。本説明においては、図7(a)に示した参照範囲内に、信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ6つの周囲画素(周囲画素A〜周囲画素F)が含まれ、周囲画素A〜周囲画素Cが同じ最頻値であり、周囲画素D〜周囲画素Fが同じ最頻値であるものとする。   The processing from step S14 to step S18 so far is reference value calculation processing by the reference value calculation unit 213 to be performed next in the pixel value determination processing. Here, an example of reference value calculation processing from step S16 to step S18 performed by the reference value calculation unit 213 will be described. FIG. 7 is a diagram illustrating an example of processing for determining a reference value in moving object removal processing by the image generation apparatus of the present embodiment. FIG. 7 shows the mode value MaxFreqValue (i, j) of surrounding pixels having a reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1 among the surrounding pixels in the reference range shown in FIG. 5B. The histogram Hist2 is generated, and the maximum frequency mode MaxFreqValue (i, j) in the generated histogram Hist2 is determined as a reference value. In this description, six surrounding pixels (surrounding pixel A to surrounding pixel F) having a reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1 are included in the reference range shown in FIG. The surrounding pixels A to C have the same mode value, and the surrounding pixels D to F have the same mode value.

参照値算出部213は、ステップS16において、図7(a)に示した参照範囲内のそれぞれの周囲画素A〜周囲画素Fの最頻値MaxFreqValue(i,j)を要素としたヒストグラムHist2を生成する。このとき、参照値算出部213は、周囲画素A〜周囲画素Fの最頻値MaxFreqValue(i,j)の度数を、ステップS15において設定した重み付け係数K1(i,j)で重み付けしてヒストグラムHist2を生成することにより、図7(b)に示したヒストグラムHist2を生成する。なお、図7(a)においては、「★」で示している注目画素に近い周囲画素Aおよび周囲画素Bの重み付け係数K1(i,j)の方が、注目画素から遠い周囲画素C〜周囲画素Fの重み付け係数K1(i,j)よりも大きい。   In step S16, the reference value calculation unit 213 generates a histogram Hist2 having the elements MaxFreqValue (i, j) of the surrounding pixels A to F in the reference range shown in FIG. To do. At this time, the reference value calculation unit 213 weights the frequency of the mode value MaxFreqValue (i, j) of the surrounding pixels A to F with the weighting coefficient K1 (i, j) set in step S15, and the histogram Hist2 Is generated, the histogram Hist2 shown in FIG. 7B is generated. In FIG. 7A, the weighting coefficients K1 (i, j) of the surrounding pixel A and the surrounding pixel B that are closer to the target pixel indicated by “★” are the peripheral pixels C to It is larger than the weighting coefficient K1 (i, j) of the pixel F.

そして、参照値算出部213は、ステップS17において、生成したヒストグラムHist2における最大度数が1つであるか否かを判定する。なお、ステップS16において参照値算出部213が生成したヒストグラムHist2は、図7(b)に示したように、同じ最頻値である周囲画素が3つずつ(周囲画素A〜周囲画素Cおよび周囲画素D〜周囲画素F)であるが、重み付け係数K1(i,j)でそれぞれの周囲画素の度数に重み付けをしているため、最大度数は1つとなっている。   In step S17, the reference value calculation unit 213 determines whether the maximum frequency in the generated histogram Hist2 is one. In addition, as shown in FIG. 7B, the histogram Hist2 generated by the reference value calculation unit 213 in step S16 includes three surrounding pixels having the same mode value (peripheral pixels A to C and surrounding pixels). The pixel D to the surrounding pixels F) are weighted by the weighting coefficient K1 (i, j), and the maximum frequency is one.

このため、参照値算出部213は、ステップS18において、生成したヒストグラムHist2における最大度数の最頻値、すなわち、図7(c)に示した周囲画素A〜周囲画素Cの最頻値MaxFreqValue(i,j)を、参照値として動体除去画素生成部22に出力する。   Therefore, in step S18, the reference value calculation unit 213 determines the mode value of the maximum frequency in the generated histogram Hist2, that is, the mode value MaxFreqValue (i) of the surrounding pixels A to C shown in FIG. , J) is output to the moving object removal pixel generation unit 22 as a reference value.

このように、参照範囲内のそれぞれの周囲画素の座標位置に対して重み付け係数K1(i,j)を設定することによって、参照範囲内に複数種類の背景の周囲画素が入っていた場合でも、注目画素の座標位置において背景である可能性が高い画素値により近い値を参照値とすることができる。さらに、例えば、背景の模様が細かく変化していることによって、注目画素の周囲に配置されている周囲画素の画素値がばらついている場合でも、注目画素の座標位置に近い周囲画素から参照値を決定することができるため、本来の背景の画素値と大きく異なる画素値を参照値としてしまうことを防ぐことができる。   Thus, by setting the weighting coefficient K1 (i, j) for the coordinate position of each surrounding pixel in the reference range, even when there are multiple types of background surrounding pixels in the reference range, A value closer to a pixel value that is highly likely to be the background at the coordinate position of the target pixel can be used as the reference value. Furthermore, for example, even if the pixel values of surrounding pixels arranged around the pixel of interest vary due to a fine change in the background pattern, the reference value is obtained from the surrounding pixels close to the coordinate position of the pixel of interest. Since it can be determined, it is possible to prevent a pixel value greatly different from the original background pixel value from being used as a reference value.

なお、本説明においては、注目画素の周囲に配置されている周囲画素の画素値のばらつきを表す指標として、参照値算出部213が、参照範囲内の周囲画素の最頻値MaxFreqValue(i,j)の分散(ばらつき)を算出する場合について説明した。しかし、周囲画素の画素値のばらつきを判定する方法は、分散に限定されるものではない。例えば、参照範囲内の周囲画素において信頼度閾値thrT1以上の信頼度MaxFreq(i,j)を持つ周囲画素の最頻値MaxFreqValue(i,j)のヒストグラムを生成し、生成したヒストグラムにおいて度数が1以上である最頻値の個数から画素値のばらつきを判定する構成であってもよい。   In this description, the reference value calculation unit 213 uses the mode value MaxFreqValue (i, j) of the surrounding pixels in the reference range as an index representing the variation in the pixel values of the surrounding pixels arranged around the target pixel. The case where the variance (variation) of) is calculated has been described. However, the method for determining the variation in the pixel values of the surrounding pixels is not limited to dispersion. For example, a histogram of the mode MaxFreqValue (i, j) of the surrounding pixels having the reliability MaxFreq (i, j) equal to or higher than the reliability threshold thrT1 in the surrounding pixels in the reference range is generated, and the frequency is 1 in the generated histogram. The configuration may be such that the variation in pixel values is determined from the number of mode values as described above.

そして、参照値を用いた最終的な動体除去画素の画素値の決定処理が完了すると、動体除去画素の画素値の選択処理では、続いて、動体除去画素生成部22が、最終的な動体除去画素の画素値を選択して、画像処理部15に出力する。   When the pixel value determination process for the final moving object removal pixel using the reference value is completed, the moving object removal pixel generation unit 22 subsequently performs the final moving object removal process in the pixel value selection process for the moving object removal pixel. The pixel value of the pixel is selected and output to the image processing unit 15.

より具体的には、ステップS19において、動体除去画素生成部22内の注目画素値検出部221は、記憶部13から取得した複数枚(本説明においては、5フレーム)の入力画像の1つ目の注目画素の画素値In1(x,y)〜In5(x,y)の内、参照値生成部21内の参照値算出部213から入力された参照値に最も近い値の画素値を持つ注目画素を選択し、選択した注目画素の画素値を動体除去画素選択部222に出力する。そして、動体除去画素選択部222は、注目画素値検出部221から入力された注目画素の画素値を、動体除去画像において1つ目の注目画素と同一の座標位置(x,y)に配置される1つ目の動体除去画素の画素値として、画像処理部15に出力する。   More specifically, in step S <b> 19, the target pixel value detection unit 221 in the moving object removal pixel generation unit 22 is the first of a plurality of (5 frames in this description) input images acquired from the storage unit 13. Among the pixel values In1 (x, y) to In5 (x, y) of the target pixel of the target pixel, the target pixel value having the closest pixel value to the reference value input from the reference value calculation unit 213 in the reference value generation unit 21 The pixel is selected, and the pixel value of the selected target pixel is output to the moving object removal pixel selection unit 222. Then, the moving object removal pixel selection unit 222 arranges the pixel value of the attention pixel input from the attention pixel value detection unit 221 at the same coordinate position (x, y) as the first attention pixel in the moving object removal image. The pixel value of the first moving object removal pixel is output to the image processing unit 15.

このように、ステップS7による判定の結果、1つ目の注目画素の信頼度MaxFreq(x,y)が、信頼度閾値thrT2よりも小さい場合、つまり、1つ目の注目画素の5つの画素値In1(x,y)〜In5(x,y)のみでは、背景である可能性が高い画素の画素値を選択することができない場合には、参照値生成部21から入力された参照値に最も近い値の画素値を持つ注目画素の画素値を、最終的な動体除去画素の画素値として出力する。   As described above, when the reliability MaxFreq (x, y) of the first target pixel is smaller than the reliability threshold thrT2 as a result of the determination in step S7, that is, the five pixel values of the first target pixel. If the pixel value of a pixel that is highly likely to be a background cannot be selected with only In1 (x, y) to In5 (x, y), the reference value input from the reference value generation unit 21 is the largest. The pixel value of the target pixel having a close pixel value is output as the final pixel value of the moving object removal pixel.

ここまでの処理が、動体除去画像において1つ目の注目画素と同一の座標位置(x,y)に配置される1つ目の動体除去画素の画素値の選択処理である。以降、参照値生成部21内の参照範囲設定部212および参照値算出部213と、動体除去画素生成部22とのそれぞれは、ステップS7における注目画素の信頼度MaxFreq(x,y)と信頼度閾値thrT2との比較と、ステップS8またはステップS9〜ステップS19における比較結果に応じた最終的な動体除去画素の画素値の選択とを、全ての注目画素に対する処理が完了するまで、繰り返す。その後、ステップS7〜ステップS19までの処理の繰り返しを、注目画素の画素数と同じ回数行うと、すなわち、入力画像の全ての画素に対応した動体除去画素の画素値の選択処理が完了すると、ステップS20において処理のループを抜け出し、動体除去部20による動体除去処理を完了する。   The processing so far is the selection processing of the pixel value of the first moving object removal pixel arranged at the same coordinate position (x, y) as the first target pixel in the moving object removal image. Thereafter, the reference range setting unit 212, the reference value calculation unit 213, and the moving object removal pixel generation unit 22 in the reference value generation unit 21, respectively, the reliability MaxFreq (x, y) and the reliability of the target pixel in step S7. The comparison with the threshold value thrT2 and the selection of the final pixel value of the moving object removal pixel in accordance with the comparison results in step S8 or step S9 to step S19 are repeated until the processing for all the target pixels is completed. After that, when the process from step S7 to step S19 is repeated as many times as the number of pixels of the target pixel, that is, when the pixel value selection processing of moving object removal pixels corresponding to all the pixels of the input image is completed, step In S20, the process loop is exited, and the moving object removing process by the moving object removing unit 20 is completed.

このようにして、動体除去部20は、複数枚(フレーム)の入力画像の各画素に対して動体除去処理を行って、1枚の動体除去画像の各画素の画素値を、それぞれ画像処理部15に出力する。これにより、撮像装置10は、不要な移動体の画素値を動体として除去した1枚の動体除去画像を生成し、表示部16を介して表示装置に表示、または記録部17を介して画像記録媒体に記録することができる。   In this way, the moving object removing unit 20 performs the moving object removing process on each pixel of a plurality of (frame) input images, and sets the pixel value of each pixel of one moving object removed image to the image processing unit. 15 is output. As a result, the imaging apparatus 10 generates a single moving object removal image in which unnecessary moving object pixel values are removed as a moving object, and displays the image on the display device via the display unit 16 or image recording via the recording unit 17. Can be recorded on a medium.

なお、動体除去部20に入力されるそれぞれの入力画像は、1回の撮影毎に、撮像条件や画像処理パラメータなどを変えてしまうと、同じ被写体を撮影した場合であっても、入力画像毎に画素値が大きく異なってしまう。このような場合には、動体除去部20による動体除去処理において、背景となる画素の画素値を正しく選択できなくなってしまう。そのため、動体除去画像を得るための撮影においては、合焦位置や露出などの撮像条件、階調変換やホワイトバンランスなどの画像処理パラメータは、全ての入力画像で同一であることが望ましい。   Each input image input to the moving body removing unit 20 is different for each input image even if the same subject is captured if the imaging conditions, image processing parameters, and the like are changed for each capturing. The pixel values are greatly different from each other. In such a case, the pixel value of the background pixel cannot be correctly selected in the moving object removal process by the moving object removal unit 20. For this reason, in shooting for obtaining a moving object-removed image, it is desirable that the imaging conditions such as the in-focus position and exposure, and the image processing parameters such as gradation conversion and white balance are the same for all input images.

上記に述べたように、本発明を実施するための形態によれば、複数枚の入力画像において同一の座標位置に配置されている画素(本実施形態における「注目画素」)の画素値に基づいて生成した信頼度に基づいて、動体除去画像において注目画素と同一の座標位置に配置されている動体除去画素の画素値を選択する。このとき、本発明を実施するための形態では、信頼度が高い場合には、注目画素の最頻値を動体除去画素の画素値として選択し、信頼度が低い場合には、注目画素の周囲に配置された画素(本実施形態における「周囲画素」)の画素値から算出した参照値に基づいて、いずれか1枚の入力画像の注目画素の画素値を動体除去画素の画素値として選択する。これにより、本発明を実施するための形態では、入力画像に写っている同じ被写体を背景として選択する際に、注目画素の情報のみでは正しく背景の画素値を特定しにくい場合でも、注目画素の周囲に配置された周囲画素の情報を用いることによって正しく背景の画素値を選択できる確率を向上させ、動体除去処理を行って生成した動体除去画像の画素値として出力することができる。このことにより、本発明を実施するための形態では、入力画像の同一の位置に写っている移動体を除去し、入力画像の同一の位置に写っている建物などの固定の被写体や背景のみを抽出した所望の画像(動体除去画像)を生成することができる。   As described above, according to the embodiment for carrying out the present invention, based on the pixel value of the pixel (“target pixel” in the present embodiment) arranged at the same coordinate position in a plurality of input images. Based on the reliability generated in this way, the pixel value of the moving object removal pixel arranged at the same coordinate position as the target pixel in the moving object removal image is selected. At this time, in the embodiment for carrying out the present invention, when the reliability is high, the mode value of the target pixel is selected as the pixel value of the moving object removal pixel, and when the reliability is low, the surroundings of the target pixel are selected. The pixel value of the target pixel of any one input image is selected as the pixel value of the moving object removal pixel based on the reference value calculated from the pixel value of the pixel arranged in the pixel (“surrounding pixel” in the present embodiment) . Thus, in the embodiment for carrying out the present invention, when selecting the same subject appearing in the input image as the background, even if it is difficult to correctly specify the pixel value of the background only by the information of the target pixel, By using information on surrounding pixels arranged around, the probability that a background pixel value can be correctly selected can be improved and output as a pixel value of a moving object removal image generated by performing moving object removal processing. As a result, in the embodiment for carrying out the present invention, the moving object shown in the same position of the input image is removed, and only a fixed subject or background such as a building shown in the same position of the input image is removed. An extracted desired image (moving object removal image) can be generated.

また、本発明を実施するための形態によれば、注目画素の周囲に配置されている周囲画素の内、注目画素の座標位置の近くに配置されている周囲画素の優先度を上げて、参照値を算出する。これにより、本発明を実施するための形態では、例えば、背景の模様が細かく変化していることによって、注目画素の周囲に配置されている周囲画素の画素値がばらついている場合でも、注目画素の座標位置の近くに配置されている周囲画素から、注目画素における背景の画素値を選択するための適切な参照値を算出することができる。このことにより、本発明を実施するための形態では、例えば、多くの不要な移動体がカメラの前を横切ったことにより、動体除去画像として抽出したい建物などの固定の被写体や背景が、入力画像に写っている回数が少ない領域においても、より精度よく固定の被写体や背景を抽出した動体除去画像を生成することができる。   Further, according to the embodiment for carrying out the present invention, among the surrounding pixels arranged around the pixel of interest, the priority of the surrounding pixels arranged near the coordinate position of the pixel of interest is increased for reference. Calculate the value. Thereby, in the form for carrying out the present invention, for example, even when the pixel value of the surrounding pixels arranged around the pixel of interest varies due to a fine change in the background pattern, the pixel of interest An appropriate reference value for selecting the background pixel value of the target pixel can be calculated from the surrounding pixels arranged near the coordinate position. As a result, in the form for carrying out the present invention, for example, a fixed subject or background such as a building to be extracted as a moving object removal image is obtained when an input image is obtained because many unnecessary moving objects cross the front of the camera. Even in an area where the number of times the image is shown in the image is small, it is possible to generate a moving object removal image in which a fixed subject or background is extracted with higher accuracy.

また、本発明を実施するための形態によれば、常に周囲画素の画素値から算出した参照値に基づいて動体除去画素の画素値として選択するのではないため、動体除去処理の処理速度の低下を少なくすることができる。   Further, according to the embodiment for carrying out the present invention, since the pixel value of the moving object removal pixel is not always selected based on the reference value calculated from the pixel values of the surrounding pixels, the processing speed of the moving object removal process is reduced. Can be reduced.

なお、本実施形態においては、信頼度生成部211が、注目画素の画素値のヒストグラム(ヒストグラムHist1)を生成することによって、注目画素の信頼度と最頻値とを得る場合について説明した。しかし、注目画素の信頼度と最頻値とを得る方法は、本実施形態に限定されるものではなく、他の方法によって注目画素の信頼度と最頻値とを得る構成であってもよい。   In the present embodiment, the case where the reliability generation unit 211 obtains the reliability and the mode value of the target pixel by generating the histogram of the pixel value of the target pixel (histogram Hist1) has been described. However, the method of obtaining the reliability and mode value of the target pixel is not limited to the present embodiment, and the configuration may be such that the reliability and mode value of the target pixel are obtained by other methods. .

また、本実施形態においては、撮像装置10に備えた撮像部12によって撮影された画像データ(撮影画像)を入力画像として、動体除去処理を行う画像生成装置について説明したが、本実施形態の画像生成装置が動体除去処理を行う入力画像は、本発明を実施するための形態に限定されるものではない。例えば、画像記録媒体に記録されている同一の被写体を撮影した複数の画像データを記録部17を介して読み出し、読み出した画像データを入力画像として動体除去処理を行うこともできる。   In the present embodiment, an image generation apparatus that performs moving object removal processing using image data (captured image) captured by the imaging unit 12 included in the imaging apparatus 10 as an input image has been described. The input image on which the generation device performs the moving object removal process is not limited to the form for carrying out the present invention. For example, a plurality of image data obtained by photographing the same subject recorded on the image recording medium can be read out via the recording unit 17, and the moving object removal process can be performed using the read image data as an input image.

以上、本発明の実施形態について、図面を参照して説明してきたが、具体的な構成はこの実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲においての種々の変更も含まれる。   The embodiment of the present invention has been described above with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes various modifications within the scope of the present invention. It is.

10・・・撮像装置
11・・・制御部
12・・・撮像部
13・・・記憶部
14・・・位置ズレ検出部
15・・・画像処理部
16・・・表示部
17・・・記録部
20・・・動体除去部(画像生成装置)
21・・・参照値生成部
211・・・信頼度生成部
212・・・参照範囲設定部
213・・・参照値算出部
22・・・動体除去画素生成部
221・・・注目画素値検出部
222・・・動体除去画素選択部
DESCRIPTION OF SYMBOLS 10 ... Imaging device 11 ... Control part 12 ... Imaging part 13 ... Memory | storage part 14 ... Position shift detection part 15 ... Image processing part 16 ... Display part 17 ... Recording Unit 20 ... Moving object removal unit (image generation device)
21 ... Reference value generation unit 211 ... Reliability generation unit 212 ... Reference range setting unit 213 ... Reference value calculation unit 22 ... Moving object removal pixel generation unit 221 ... Target pixel value detection unit 222 ... Moving object removal pixel selection unit

Claims (17)

入力された同じ画角の複数の入力画像から、動体を除去した背景のみが含まれる出力画像を生成する画像生成装置であって、
現在処理する対象の画素であり、それぞれの前記入力画像において同一の位置に配置されたそれぞれの画素を注目画素とし、前記出力画像において前記注目画素と同一の位置に配置される画素を動体除去画素としたとき、
現在処理を行っているそれぞれの前記注目画素の周囲に配置された画素である複数の周囲画素の情報に基づいて、前記動体除去画素の情報を決定するための参照値を生成する参照値生成部と、
前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の情報の中から、前記背景である可能性が高い前記注目画素の情報を選択し、該選択した前記注目画素の情報を前記出力画像における前記動体除去画素の情報として出力する動体除去画素生成部と、
を備えることを特徴とする画像生成装置。
An image generation device that generates an output image including only a background from which a moving object is removed from a plurality of input images having the same angle of view,
A pixel to be processed at present, each pixel arranged at the same position in each input image as a target pixel, and a pixel arranged at the same position as the target pixel in the output image is a moving object removal pixel When
A reference value generation unit that generates a reference value for determining information of the moving object removal pixel based on information of a plurality of surrounding pixels that are pixels arranged around each of the target pixels currently being processed. When,
Based on the reference value, information on the target pixel that is highly likely to be the background is selected from information on each target pixel currently being processed, and information on the selected target pixel is obtained. A moving object removal pixel generation unit that outputs the moving object removal pixel information in the output image;
An image generation apparatus comprising:
前記参照値生成部は、
それぞれの前記注目画素の画素値を要素とした第1のヒストグラムを生成し、該生成した第1のヒストグラムにおける最大度数の値を信頼度とし、前記最大度数の画素値を最頻値として生成する信頼度生成部と、
前記信頼度に基づいて、現在処理を行っている前記注目画素に対応した前記参照値を生成するために用いる前記周囲画素が含まれる範囲である参照範囲を設定する参照範囲設定部と、
設定された前記参照範囲内のそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成部が生成した前記信頼度と前記最頻値とに基づいて、前記参照値を算出する参照値算出部と、
を備えることを特徴とする請求項1に記載の画像生成装置。
The reference value generation unit
A first histogram having the pixel value of each pixel of interest as an element is generated, the maximum frequency value in the generated first histogram is set as a reliability, and the pixel value of the maximum frequency is generated as a mode value. A reliability generation unit;
A reference range setting unit that sets a reference range that is a range including the surrounding pixels used to generate the reference value corresponding to the pixel of interest currently being processed based on the reliability;
Reference for calculating the reference value based on the reliability and the mode value generated by the reliability generation unit when each of the surrounding pixels in the set reference range is processed as the target pixel A value calculator,
The image generating apparatus according to claim 1, further comprising:
前記参照範囲設定部は、
設定した前記参照範囲内に含まれるそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成部が生成した前記信頼度が、予め定めた信頼度の第1の閾値以上の信頼度である前記周囲画素の数を計数し、該計数した前記周囲画素の数が、予め定めた画素数の閾値以上となるように、該参照範囲を周囲に順次広げていく、
ことを特徴とする請求項2に記載の画像生成装置。
The reference range setting unit includes:
The reliability generated by the reliability generation unit when each of the surrounding pixels included in the set reference range is processed as the pixel of interest is a reliability equal to or higher than a first threshold value of a predetermined reliability. The number of the surrounding pixels is counted, and the reference range is sequentially expanded to the surroundings so that the counted number of the surrounding pixels is equal to or greater than a predetermined threshold number of pixels.
The image generating apparatus according to claim 2.
前記参照値算出部は、
前記参照範囲内に含まれるそれぞれの前記周囲画素を前記注目画素として処理したときの前記信頼度が、予め定めた信頼度の第1の閾値以上の信頼度であるそれぞれの前記周囲画素の前記最頻値を要素とした第2のヒストグラムを生成し、該生成した第2のヒストグラムにおける最大度数の前記最頻値を前記参照値とする、
ことを特徴とする請求項2または請求項3に記載の画像生成装置。
The reference value calculation unit
The reliability when each of the surrounding pixels included in the reference range is processed as the pixel of interest is a reliability equal to or higher than a first threshold value of a predetermined reliability. A second histogram having a frequency value as an element is generated, and the mode value of the maximum frequency in the generated second histogram is set as the reference value;
The image generation apparatus according to claim 2, wherein the image generation apparatus is an image generation apparatus.
前記参照値算出部は、
現在処理を行っている前記注目画素の位置と、前記参照範囲内に含まれるそれぞれの前記周囲画素の位置とに基づいた距離に応じて、該距離が近いほど大きく、該距離が遠いほど小さくなる重み付け係数を設定し、該設定した重み付け係数を前記第2のヒストグラムの要素であるそれぞれの前記最頻値に掛けて、前記第2のヒストグラムを生成する、
ことを特徴とする請求項4に記載の画像生成装置。
The reference value calculation unit
According to the distance based on the position of the target pixel currently being processed and the positions of the surrounding pixels included in the reference range, the distance is larger and the distance is smaller. A weighting factor is set, and the set weighting factor is multiplied by each mode value that is an element of the second histogram to generate the second histogram.
The image generation apparatus according to claim 4.
前記参照値算出部は、
前記参照範囲内に含まれるそれぞれの前記周囲画素の前記最頻値のばらつきに応じて、該ばらつきが小さいほど前記距離に応じた差を小さく、該ばらつきが大きいほど前記距離に応じた差を大きくした前記重み付け係数を設定する、
ことを特徴とする請求項5に記載の画像生成装置。
The reference value calculation unit
According to the variation of the mode value of each of the surrounding pixels included in the reference range, the smaller the variation, the smaller the difference according to the distance, and the larger the variation, the larger the difference according to the distance. Set the weighting factor
The image generating apparatus according to claim 5.
前記動体除去画素生成部は、
前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記背景である可能性が高い前記注目画素の画素値を検出する注目画素値検出部と、
前記信頼度に基づいて、前記注目画素値検出部が検出した前記注目画素の画素値、または前記参照値生成部が生成した前記最頻値のいずれか一方の値を、前記動体除去画素の画素値として選択する動体除去画素選択部と、
を備えることを特徴とする請求項2から請求項6のいずれか1の項に記載の画像生成装置。
The moving object removal pixel generation unit includes:
Based on the reference value, a pixel value detection unit that detects a pixel value of the pixel of interest that is highly likely to be the background from among pixel values of the pixel of interest currently being processed,
Based on the reliability, the pixel value of the target pixel value detected by the target pixel value detection unit or the mode value generated by the reference value generation unit is used as the pixel of the moving object removal pixel. A moving object removal pixel selection unit to select as a value;
The image generating apparatus according to claim 2, further comprising:
前記注目画素値検出部は、
現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記参照値に最も近い画素値を、前記背景である可能性が高い前記注目画素の画素値として検出する、
ことを特徴とする請求項7に記載の画像生成装置。
The target pixel value detection unit
A pixel value closest to the reference value is detected as a pixel value of the pixel of interest that is likely to be the background from among the pixel values of the pixel of interest currently being processed;
The image generating apparatus according to claim 7.
前記動体除去画素選択部は、
前記信頼度が、予め定めた信頼度の第2の閾値以上である場合は、前記最頻値を前記動体除去画素の画素値として選択し、
前記信頼度が、予め定めた信頼度の第2の閾値よりも小さい場合は、前記注目画素値検出部が検出した前記注目画素の画素値を前記動体除去画素の画素値として選択する、
ことを特徴とする請求項7または請求項8に記載の画像生成装置。
The moving object removal pixel selection unit includes:
When the reliability is equal to or higher than a second threshold value of a predetermined reliability, the mode value is selected as a pixel value of the moving object removal pixel,
When the reliability is smaller than a second threshold value of the predetermined reliability, the pixel value of the target pixel detected by the target pixel value detection unit is selected as the pixel value of the moving object removal pixel.
The image generation apparatus according to claim 7, wherein the image generation apparatus is an image generation apparatus.
前記参照値生成部は、
前記入力画像内の各位置に配置された、該入力画像の輝度を表す輝度情報、または該入力画像の色を表す色情報のいずれか一方または両方のデータに基づいて、前記参照値を生成する、
ことを特徴とする請求項1から請求項9のいずれか1の項に記載の画像生成装置。
The reference value generation unit
The reference value is generated based on either or both of luminance information representing the luminance of the input image and color information representing the color of the input image arranged at each position in the input image. ,
The image generation apparatus according to any one of claims 1 to 9, wherein the image generation apparatus is an image generation apparatus.
前記参照値生成部は、
前記入力画像内の各位置に配置された、該入力画像を取得する際に撮像素子から出力された信号に応じた値のデータに基づいて、前記参照値を生成する、
ことを特徴とする請求項1から請求項9のいずれか1の項に記載の画像生成装置。
The reference value generation unit
The reference value is generated on the basis of data of a value corresponding to a signal output from the image sensor when acquiring the input image, which is arranged at each position in the input image.
The image generation apparatus according to any one of claims 1 to 9, wherein the image generation apparatus is an image generation apparatus.
被写体を撮影する撮像装置であって、
入射した光量に応じた信号を出力する画素が、二次元の行列状に複数配置された撮像素子を具備し、該撮像素子に結像された被写体の光学像を露光したときの信号に基づいた画像を出力する撮像部と、
前記撮像部から出力された複数枚の前記画像を記憶する記憶部と、
前記記憶部に記憶されたそれぞれの前記画像に含まれる、当該撮像装置で撮影する際のぶれによる撮影位置のズレを検出する位置ズレ検出部と、
前記位置ズレ検出部によって検出された撮影位置のズレが補正された前記画像が、入力画像として複数入力され、該入力された複数の前記入力画像から、動体を除去した背景のみが含まれる出力画像を生成する、請求項1から請求項11のいずれか1の項に記載の画像生成装置と、
を備えることを特徴とする撮像装置。
An imaging device for photographing a subject,
A pixel that outputs a signal corresponding to the amount of incident light has a plurality of image sensors arranged in a two-dimensional matrix, and is based on a signal when an optical image of a subject formed on the image sensor is exposed. An imaging unit for outputting an image;
A storage unit for storing the plurality of images output from the imaging unit;
A position shift detection unit that detects a shift of a shooting position caused by a shake at the time of shooting with the imaging device included in each of the images stored in the storage unit;
A plurality of the images in which the deviation of the photographing position detected by the positional deviation detection unit is corrected are input as input images, and an output image including only the background from which the moving object is removed from the plurality of input images that are input. The image generation device according to any one of claims 1 to 11, wherein
An imaging apparatus comprising:
前記画像生成装置は、
入力された複数の前記入力画像内の同一の位置に写っている枚数が少ない移動体の部分を、前記動体として除去した前記出力画像を生成する、
ことを特徴とする請求項12に記載の撮像装置。
The image generation device includes:
Generating the output image by removing a moving body part having a small number of images appearing at the same position in a plurality of input images as the moving body;
The imaging apparatus according to claim 12.
入力された同じ画角の複数の入力画像から、動体を除去した背景のみが含まれる出力画像を生成する画像生成方法であって、
現在処理する対象の画素であり、それぞれの前記入力画像において同一の位置に配置されたそれぞれの画素を注目画素とし、前記出力画像において前記注目画素と同一の位置に配置される画素を動体除去画素としたとき、
現在処理を行っているそれぞれの前記注目画素の周囲に配置された画素である複数の周囲画素の情報に基づいて、前記動体除去画素の情報を決定するための参照値を生成する参照値生成ステップと、
前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の情報の中から、前記背景である可能性が高い前記注目画素の情報を選択し、該選択した前記注目画素の情報を前記出力画像における前記動体除去画素の情報として出力する動体除去画素生成ステップと、
を含むことを特徴とする画像生成方法。
An image generation method for generating an output image including only a background from which a moving object is removed from a plurality of input images having the same angle of view,
A pixel to be processed at present, each pixel arranged at the same position in each input image as a target pixel, and a pixel arranged at the same position as the target pixel in the output image is a moving object removal pixel When
A reference value generation step for generating a reference value for determining information of the moving object removal pixel based on information of a plurality of surrounding pixels which are pixels arranged around each of the target pixels currently being processed. When,
Based on the reference value, information on the target pixel that is highly likely to be the background is selected from information on each target pixel currently being processed, and information on the selected target pixel is obtained. A moving object removal pixel generating step to output as information of the moving object removal pixel in the output image;
An image generation method comprising:
前記参照値生成ステップは、
それぞれの前記注目画素の画素値を要素とした第1のヒストグラムを生成し、該生成した第1のヒストグラムにおける最大度数の値を信頼度とし、前記最大度数の画素値を最頻値として生成する信頼度生成ステップと、
前記信頼度に基づいて、現在処理を行っている前記注目画素に対応した前記参照値を生成するために用いる前記周囲画素が含まれる範囲である参照範囲を設定する参照範囲設定ステップと、
設定された前記参照範囲内のそれぞれの前記周囲画素を前記注目画素として処理したときに前記信頼度生成ステップによって生成した前記信頼度と前記最頻値とに基づいて、前記参照値を算出する参照値算出ステップと、
を含むことを特徴とする請求項14に記載の画像生成方法。
The reference value generation step includes:
A first histogram having the pixel value of each pixel of interest as an element is generated, the maximum frequency value in the generated first histogram is set as a reliability, and the pixel value of the maximum frequency is generated as a mode value. A confidence generation step;
A reference range setting step for setting a reference range that is a range including the surrounding pixels used to generate the reference value corresponding to the pixel of interest currently being processed based on the reliability;
A reference for calculating the reference value based on the reliability and the mode value generated by the reliability generation step when each of the surrounding pixels in the set reference range is processed as the target pixel. A value calculation step;
The image generation method according to claim 14, further comprising:
前記動体除去画素生成ステップは、
前記参照値に基づいて、現在処理を行っているそれぞれの前記注目画素の画素値の中から、前記背景である可能性が高い前記注目画素の画素値を検出する注目画素値検出ステップと、
前記信頼度に基づいて、前記注目画素値検出ステップによって検出した前記注目画素の画素値、または前記参照値生成ステップによって生成した前記最頻値のいずれか一方の値を、前記動体除去画素の画素値として選択する動体除去画素選択ステップと、
を含むことを特徴とする請求項15に記載の画像生成方法。
The moving object removal pixel generation step includes:
Based on the reference value, a pixel value detection step of detecting a pixel value of the pixel of interest that is highly likely to be the background from among pixel values of the pixel of interest currently being processed;
Based on the reliability, the pixel value of the target pixel detected by the target pixel value detection step or the mode value generated by the reference value generation step is used as the pixel of the moving object removal pixel. A moving object removal pixel selection step to select as a value;
The image generation method according to claim 15, further comprising:
被写体を撮影する撮像装置による撮像方法であって、
入射した光量に応じた信号を出力する画素が、二次元の行列状に複数配置された撮像素子を具備した撮像部に、該撮像素子に結像された被写体の光学像を露光したときの信号に基づいた画像を出力させる撮像ステップと、
記憶部に、前記撮像部から出力された複数枚の前記画像を記憶させる記憶ステップと、
位置ズレ検出部に、前記記憶部に記憶されたそれぞれの前記画像に含まれる、当該撮像装置で撮影する際のぶれによる撮影位置のズレを検出させる位置ズレ検出ステップと、
請求項1から請求項11のいずれか1の項に記載の画像生成装置に、前記位置ズレ検出部によって検出された撮影位置のズレが補正された前記画像を、入力画像として複数入力し、該入力された複数の前記入力画像から、動体を除去した背景のみが含まれる出力画像を生成させる画像生成ステップと、
を含むことを特徴とする撮像方法。
An imaging method by an imaging device for photographing a subject,
A signal when a pixel that outputs a signal corresponding to the amount of incident light is exposed to an optical image of a subject formed on the image sensor on an image sensor having a plurality of image sensors arranged in a two-dimensional matrix. An imaging step for outputting an image based on
A storage step of storing a plurality of the images output from the imaging unit in a storage unit;
A position shift detection step of causing a position shift detection unit to detect a shift of a shooting position caused by a shake at the time of shooting with the imaging device included in each of the images stored in the storage unit;
The image generation apparatus according to any one of claims 1 to 11, wherein a plurality of the images, in which the deviation of the photographing position detected by the position deviation detection unit is corrected, are input as input images, An image generation step of generating an output image including only a background from which a moving object has been removed from the plurality of input images input;
An imaging method comprising:
JP2012201793A 2012-09-13 2012-09-13 Image generation apparatus, image generation method, imaging apparatus, and imaging method Expired - Fee Related JP6063680B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012201793A JP6063680B2 (en) 2012-09-13 2012-09-13 Image generation apparatus, image generation method, imaging apparatus, and imaging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012201793A JP6063680B2 (en) 2012-09-13 2012-09-13 Image generation apparatus, image generation method, imaging apparatus, and imaging method

Publications (2)

Publication Number Publication Date
JP2014057261A true JP2014057261A (en) 2014-03-27
JP6063680B2 JP6063680B2 (en) 2017-01-18

Family

ID=50614198

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012201793A Expired - Fee Related JP6063680B2 (en) 2012-09-13 2012-09-13 Image generation apparatus, image generation method, imaging apparatus, and imaging method

Country Status (1)

Country Link
JP (1) JP6063680B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566724A (en) * 2017-09-13 2018-01-09 维沃移动通信有限公司 A kind of panoramic picture image pickup method and mobile terminal
CN110264394A (en) * 2018-03-12 2019-09-20 纬创资通股份有限公司 Image background removes system and method, image background more changing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63194477A (en) * 1987-02-07 1988-08-11 Nippon Telegr & Teleph Corp <Ntt> Background picture extracting method
JP2003230045A (en) * 2002-02-01 2003-08-15 Sony Corp Signal processing method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63194477A (en) * 1987-02-07 1988-08-11 Nippon Telegr & Teleph Corp <Ntt> Background picture extracting method
JP2003230045A (en) * 2002-02-01 2003-08-15 Sony Corp Signal processing method and apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566724A (en) * 2017-09-13 2018-01-09 维沃移动通信有限公司 A kind of panoramic picture image pickup method and mobile terminal
CN107566724B (en) * 2017-09-13 2020-07-07 维沃移动通信有限公司 Panoramic image shooting method and mobile terminal
CN110264394A (en) * 2018-03-12 2019-09-20 纬创资通股份有限公司 Image background removes system and method, image background more changing device
CN110264394B (en) * 2018-03-12 2022-10-21 纬创资通股份有限公司 Image background removing system and method, and image background replacing device

Also Published As

Publication number Publication date
JP6063680B2 (en) 2017-01-18

Similar Documents

Publication Publication Date Title
CN107087107B (en) Image processing apparatus and method based on dual camera
US9251589B2 (en) Depth measurement apparatus, image pickup apparatus, and depth measurement program
KR101803712B1 (en) Image processing apparatus, control method, program, and recording medium
US8184196B2 (en) System and method to generate depth data using edge detection
KR101489048B1 (en) Imaging apparatus, image processing method, and recording medium for recording program thereon
US10115178B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
EP3480784B1 (en) Image processing method, and device
JP2010045613A (en) Image identifying method and imaging device
US8355056B2 (en) Image processing device, imaging device, and image processing program
US9811909B2 (en) Image processing apparatus, distance measuring apparatus, imaging apparatus, and image processing method
JP2016140030A (en) Image processing apparatus, imaging device, and image processing program
US9020269B2 (en) Image processing device, image processing method, and recording medium
JP2010114752A (en) Device and method of imaging and program
CN102006485A (en) Image processing apparatus and image processing method
JP2010279054A (en) Image pickup device, image processing device, image pickup method, and image processing method
JP4953770B2 (en) Imaging device
US20130293741A1 (en) Image processing apparatus, image capturing apparatus, and storage medium storing image processing program
JP6063680B2 (en) Image generation apparatus, image generation method, imaging apparatus, and imaging method
JP2023033355A (en) Image processing device and control method therefor
JP6556033B2 (en) Image processing apparatus, image processing method, and program
JP6776532B2 (en) Image processing equipment, imaging equipment, electronic devices and image processing programs
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP2014067142A (en) Image processing apparatus, image processing method, imaging apparatus, and imaging method
JP4460711B2 (en) Imaging device
JP2009088933A (en) Image recording apparatus, image correcting apparatus and image pickup apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150716

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160512

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160705

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160726

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20160727

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161219

R151 Written notification of patent or utility model registration

Ref document number: 6063680

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees