JP2019106215A - Data processor, imaging device, and data processing method - Google Patents

Data processor, imaging device, and data processing method Download PDF

Info

Publication number
JP2019106215A
JP2019106215A JP2019053674A JP2019053674A JP2019106215A JP 2019106215 A JP2019106215 A JP 2019106215A JP 2019053674 A JP2019053674 A JP 2019053674A JP 2019053674 A JP2019053674 A JP 2019053674A JP 2019106215 A JP2019106215 A JP 2019106215A
Authority
JP
Japan
Prior art keywords
reliability
pixel
image data
value
data
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
JP2019053674A
Other languages
Japanese (ja)
Other versions
JP6808770B2 (en
Inventor
伸 田中
Shin Tanaka
伸 田中
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2019053674A priority Critical patent/JP6808770B2/en
Publication of JP2019106215A publication Critical patent/JP2019106215A/en
Application granted granted Critical
Publication of JP6808770B2 publication Critical patent/JP6808770B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

To correctly acquire the reliability of information having an error.SOLUTION: A data processor for calculating reliability data representing reliability to pixel value of at least a portion of pixels of second image data from first image data and the second image data includes a similarity acquisition part for acquiring similarity between the pixel value of a first pixel of the first image data corresponding to a target pixel of the reliability data and the pixel value of each of a plurality of second pixels in a prescribed peripheral area of the first pixel, and a reliability acquisition part for acquiring a reliability being the pixel value of the target pixel of the reliability data from the similarity about each of the plurality of second pixels, the pixel value of a third pixel of the second image data corresponding to the first pixel, and the pixel value of each of plurality of fourth pixels located in the prescribed peripheral area of the third pixel to correspond to each of the plurality of second pixels.SELECTED DRAWING: Figure 3

Description

本発明は、データ処理装置、撮像装置、およびデータ処理方法に関する。   The present invention relates to a data processing device, an imaging device, and a data processing method.

撮影画像から距離情報や動き情報の分布を表す距離画像や動き画像を取得または算出する手法が提案されている。ここで撮影画像から取得される距離情報や動き情報はエラーを含んでいる場合が多い。例えば、2画像間の対応関係をテンプレートマッチング技術によって取得することによって、距離情報や動き情報を求める場合、画像中のオブジェクトの境界で大きなエラーが発生する場合がある。このようなエラーは、一つのテンプレート内に距離や動きが異なるオブジェクトを含んでいる場合に発生する。得られる距離情報や動き情報は、それぞれのオブジェクトの距離や動きの中間的な値を持つ間違った情報となることが多い。エラーを有する領域の大きさはテンプレートのサイズに依存する。もちろんテンプレートマッチング技術以外の手法によって距離情報や動き情報を求める場合でも、オブジェクト境界において似たようなエラーが発生しうる。   There has been proposed a method for acquiring or calculating a distance image or motion image representing the distribution of distance information or motion information from a captured image. Here, the distance information and motion information acquired from the photographed image often include an error. For example, when distance information or motion information is obtained by acquiring the correspondence between two images by the template matching technique, a large error may occur at the boundary of objects in the image. Such an error occurs when one template contains objects with different distances or movements. The obtained distance information and motion information are often false information having an intermediate value of the distance and motion of each object. The size of the area having an error depends on the size of the template. Of course, even when distance information or motion information is obtained by a method other than template matching technology, similar errors may occur at object boundaries.

エラーを含む距離画像や動き画像の各画素の情報を補正する手法として、次のようなものがある。   There are the following methods for correcting the information of each pixel of the distance image and the motion image including an error.

特許文献1では、各画素の距離情報の信頼度を算出して、その信頼度を利用して距離情報を補正している。距離情報の信頼度は、より具体的には、撮影画像における輝度値の大きさ、輝度変化の大きさ、周波数特性、または動き情報に基づいて算出される。そのため、テクスチャがない箇所や動きが大きな箇所の信頼度を小さくすることができる。しかしながら、オブジェクト境界の各オブジェクトにテクスチャがあり動きが小さい場合には、オブジェクト境界においても信頼度が大きく算出されてしまう。すなわち、特許文献1の手法では、オブジェクト境界を考慮せずに信頼度を算出している。   In Patent Document 1, the reliability of distance information of each pixel is calculated, and the distance information is corrected using the reliability. More specifically, the reliability of the distance information is calculated based on the magnitude of the luminance value, the magnitude of the luminance change, the frequency characteristic, or the motion information in the captured image. Therefore, it is possible to reduce the reliability of a place having no texture or a place having a large movement. However, in the case where each object at the object boundary has texture and movement is small, the reliability is also calculated largely at the object boundary. That is, in the method of Patent Document 1, the reliability is calculated without considering the object boundary.

特許文献2では、次のように距離情報の補正が行われる。まず、撮影画像の画素値または距離画像のデプス値に基づいてクラスタリングを行って、画素を複数のクラスに分類する。各クラスの画素値統計量(平均値等)と補正対象画素およびその周辺の画素値とを用いて、補正対象画素のクラスを判定する。そして、補正対象画素のデプス値をクラスの代表デプス値(クラス内のデプス値の平均値等)に置き換える。このような処理によって、画素値の空間的連続性を考慮した補正が行える。しかし、クラス内のデプス値にエラーが含まれる場合には、クラスの代表デプス値が正しいデプス値からずれてしまい、十分な補正ができない。   In Patent Document 2, correction of distance information is performed as follows. First, clustering is performed based on the pixel value of a captured image or the depth value of a distance image to classify pixels into a plurality of classes. The class of the correction target pixel is determined using the pixel value statistics (average value and the like) of each class and the correction target pixel and the pixel values in the vicinity thereof. Then, the depth value of the correction target pixel is replaced with the representative depth value of the class (such as the average value of the depth values in the class). Such processing can perform correction in consideration of spatial continuity of pixel values. However, when the depth value in the class includes an error, the representative depth value of the class deviates from the correct depth value, and sufficient correction can not be performed.

非特許文献1では、距離情報および撮影画像の輝度情報並びにそれらから導出される信頼度情報を用いて、重み付きクロスバイラテラルフィルタにより、距離画像を補正している。すなわち、補正対象画素の距離値や輝度値との差が大きい周辺画素は、信頼できないとして補正処理に用いられない。しかしながら、このようにして算出される信頼度は、距離情報そのものの信頼度ではなく、画素間の相対的な信頼度に過ぎない。またこの手法では、エラーを含む補正対象画素は、周辺のエラーを含まない画素との距離差が大きくなるため、周辺のエラーを含まない正しい距離情報が補正処理に用いられないことになってしまう。   In Non-Patent Document 1, a distance image is corrected by a weighted cross bilateral filter using distance information, luminance information of a captured image, and reliability information derived therefrom. That is, peripheral pixels having a large difference between the distance value of the correction target pixel and the luminance value are not used for the correction processing as being unreliable. However, the reliability calculated in this manner is not the reliability of the distance information itself, but only the relative reliability between pixels. Further, in this method, since the correction target pixel including an error has a large distance difference from the peripheral non-error pixel, the correct distance information not including the peripheral error is not used for the correction process. .

特開2013−239119号公報JP, 2013-239119, A 特開2012−078942号公報JP, 2012-078942, A

松尾琢也、外2名、「重み付きクロスバイラテラルフィルタによる奥行き推定精度の向上」、映像情報メディア学会誌 Vol.66,No.11,pp.J434〜J443(2012)Yuya Matsuo and 2 others, "Improving the accuracy of depth estimation with weighted cross bilateral filters," Journal of the Institute of Image Information and Television Engineers Vol. 66, no. 11, pp. J434-J443 (2012)

以上のように、いずれの先行技術においても、オブジェクト境界においてエラーを含む情報を精度良く補正することができない。これは、それぞれの画素がどの程度信頼できるか(どの程度エラーを含むか)を正しく評価できていないためである。補正を適切に行うためには、オブジェクトの境界に起因するエラーを含む情報がどの程度信頼できるかを表す情報そのものの信頼度を取得する必要がある。   As described above, in any prior art, it is not possible to accurately correct information including an error at an object boundary. This is because the degree of reliability of each pixel (how much error is included) can not be evaluated correctly. In order to properly perform the correction, it is necessary to obtain the reliability of the information itself indicating how reliable the information including the error caused by the boundary of the object is.

本発明の目的は、オブジェクトの境界に起因するエラーを持った画素を低い信頼度にし、その他の正しい画素を高い信頼度とする信頼度情報を生成するデータ処理装置を提供することである。   An object of the present invention is to provide a data processing apparatus that generates reliability information that makes pixels with errors due to object boundaries less reliable and makes other correct pixels more reliable.

本発明の第一の態様は、第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出するデータ処理装置であって、
前記信頼度データの着目画素に対応する前記第一の画像データの第一の画素の画素値と、前記第一の画素の所定の周辺領域内の複数の第二の画素それぞれの画素値と、の類似度を取得する類似度取得部と、
前記複数の第二の画素それぞれについての前記類似度と、前記第一の画素に対応する前記第二の画像データの第三の画素の画素値と、前記第三の画素の前記所定の周辺領域内のに位置し前記複数の第二の画素それぞれに対応する複数の第四の画素それぞれの画素値と、から前記信頼度データの着目画素の画素値である信頼度を取得する信頼度取得部と、
を備えることを特徴とする。
According to a first aspect of the present invention, there is provided data calculating reliability data representing reliability of pixel values of at least a part of pixels of the second image data from the first image data and the second image data. A processing device,
A pixel value of a first pixel of the first image data corresponding to a target pixel of the reliability data, and a pixel value of each of a plurality of second pixels in a predetermined peripheral region of the first pixel; A similarity acquisition unit for acquiring the similarity of
The degree of similarity for each of the plurality of second pixels, the pixel value of a third pixel of the second image data corresponding to the first pixel, and the predetermined peripheral region of the third pixel A reliability acquisition unit for acquiring a reliability, which is a pixel value of a pixel of interest of the reliability data, from the pixel values of the plurality of fourth pixels corresponding to the plurality of second pixels and located inside the When,
And the like.

本発明の第二の態様は、第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出するデータ処理装置であって、
前記第一の画像データと前記第二の画像データに基づいて前記第二の画像データを補正し、補正後の第二の画像データを生成する補正部と、
補正後の第二の画像データと補正前の第二の画像データとを比較して、信頼度を取得する信頼度取得部と、
を備えることを特徴とする。
According to a second aspect of the present invention, there is provided data calculating reliability data representing the reliability of the pixel value of at least a part of pixels of the second image data from the first image data and the second image data. A processing device,
A correction unit that corrects the second image data based on the first image data and the second image data, and generates a second image data after correction;
A reliability acquisition unit that acquires a reliability by comparing the second image data after correction and the second image data before correction;
And the like.

本発明の第三の態様は、第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出する、データ処理装置が行うデータ処理方法であって、
前記信頼度データの着目画素に対応する前記第一の画像データの第一の画素の画素値と、前記第一の画素の所定の周辺領域内の複数の第二の画素それぞれの画素値と、の類似度を取得する類似度ステップと、
前記複数の第二の画素それぞれについての前記類似度と、前記第一の画素に対応する前記第二の画像データの第三の画素の画素値と、前記第三の画素の前記所定の周辺領域内のに位置し前記複数の第二の画素それぞれに対応する複数の第四の画素それぞれの画素値と
、から前記信頼度データの着目画素の画素値である信頼度を取得する信頼度取得ステップと、
を含むことを特徴とする。
A third aspect of the present invention calculates reliability data representing reliability of pixel values of at least a part of pixels of the second image data from the first image data and the second image data. A data processing method performed by the data processing device,
A pixel value of a first pixel of the first image data corresponding to a target pixel of the reliability data, and a pixel value of each of a plurality of second pixels in a predetermined peripheral region of the first pixel; Similarity step to obtain the similarity of
The degree of similarity for each of the plurality of second pixels, the pixel value of a third pixel of the second image data corresponding to the first pixel, and the predetermined peripheral region of the third pixel A reliability acquisition step of acquiring the reliability, which is the pixel value of the pixel of interest of the reliability data, from the pixel values of each of the plurality of fourth pixels corresponding to the plurality of second pixels located within When,
It is characterized by including.

本発明の第四の態様は、第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出する、データ処理装置が行うデータ処理方法であって、
前記第一の画像データと前記第二の画像データに基づいて前記第二の画像データを補正し、補正後の第二の画像データを生成する補正ステップと、
補正後の第二の画像データと補正前の第二の画像データとを比較して、信頼度を取得する信頼度ステップと、
を含むことを特徴とする。
A fourth aspect of the present invention calculates reliability data representing the reliability of the pixel value of at least a part of pixels of the second image data from the first image data and the second image data. A data processing method performed by the data processing device,
Correcting the second image data based on the first image data and the second image data, and generating a second image data after the correction;
A reliability step of acquiring reliability by comparing the second image data after correction and the second image data before correction;
It is characterized by including.

本発明によれば、エラー持った情報の信頼度を正しく設定することが可能となる。   According to the present invention, it is possible to correctly set the reliability of information having an error.

実施形態1に係るデータ処理装置を含む撮像装置の一例を示すブロック図。1 is a block diagram showing an example of an imaging device including a data processing device according to Embodiment 1. FIG. 実施形態1に係る撮像処理方法およびデータ処理方法のフローチャート。3 is a flowchart of an imaging processing method and a data processing method according to the first embodiment. 実施形態1における信頼度算出および画像補正を説明する図。FIG. 6 is a diagram for explaining reliability calculation and image correction in the first embodiment. 実施形態1における距離画像データに含まれるエラーを説明する図。FIG. 6 is a diagram for explaining an error included in distance image data according to the first embodiment. 実施形態1における信頼度算出を説明する図。FIG. 7 is a diagram for explaining calculation of reliability in the first embodiment. 実施形態1において繰り返し処理を行う場合の信頼度算出を説明する図。FIG. 7 is a view for explaining calculation of reliability in the case where repetitive processing is performed in the first embodiment. 実施形態1の変形例に係る信頼度算出および画像補正を説明する図。FIG. 8 is a view for explaining reliability calculation and image correction according to a modification of the first embodiment. 実施形態2におけるデータ処理装置の一例を示すブロック図。FIG. 7 is a block diagram showing an example of a data processing apparatus according to a second embodiment. 実施形態3における距離画像データに含まれるエラーを説明する図。FIG. 14 is a view for explaining an error included in distance image data in the third embodiment. 実施形態3における信頼度算出を説明する図。FIG. 14 is a view for explaining calculation of reliability in the third embodiment.

本発明の実施形態を、図面を用いて詳細に説明するが、本発明は各実施形態の構成に限らない。また、各実施形態を適宜組み合わせてもよい。   Embodiments of the present invention will be described in detail with reference to the drawings, but the present invention is not limited to the configurations of the respective embodiments. Also, the embodiments may be combined as appropriate.

(実施形態1)
図1は、本発明の実施形態1に係る撮像装置の構成を模式的に示している。撮像装置1は、撮像光学系10、撮像素子11、制御部12、データ処理装置13、記憶部14、入力部15、表示部16を有している。図2Aは、撮影処理から撮影画像の出力・記録処理までを表すフローチャートである。図2Aのフローチャートも参照しつつ、撮像装置1の各構成について説明する。
(Embodiment 1)
FIG. 1 schematically shows the configuration of an imaging device according to Embodiment 1 of the present invention. The imaging apparatus 1 includes an imaging optical system 10, an imaging element 11, a control unit 12, a data processing device 13, a storage unit 14, an input unit 15, and a display unit 16. FIG. 2A is a flow chart showing processing from shooting processing to output / recording processing of a shot image. Each configuration of the imaging device 1 will be described with reference to the flowchart of FIG. 2A.

撮像光学系10は、複数のレンズから構成され、入射する光を撮像素子11の像面上に結像させる。撮像素子11は、CCDやCMOSなどのイメージセンサを有する。イメージセンサは、カラーフィルタを有してもよいし、カラーフィルタを有しなくてもよいし、また、三板式であってもよい。撮像装置1は、撮像素子11の各画素の信号を取得することによって撮影処理S20を行う。   The imaging optical system 10 includes a plurality of lenses, and focuses incident light on the image plane of the imaging element 11. The imaging device 11 includes an image sensor such as a CCD or a CMOS. The image sensor may have a color filter, may not have a color filter, and may be a three-plate type. The imaging device 1 performs imaging processing S <b> 20 by acquiring a signal of each pixel of the imaging element 11.

データ処理装置13は、信号処理部130、メモリ131、距離マップ生成部132、信頼度データ算出部133、距離マップ補正部134を有している。信号処理部130は、画像処理S21を行う機能部である。画像処理S21には、撮像素子11から出力されるアナログ信号のAD変換、ノイズ除去、デモザイキング、輝度信号変換、収差補正、ホワイトバランス調整、色補正などの各種信号処理などが含まれる。信号処理部130から
出力されるデジタル画像データはメモリ131に蓄積され、表示部16への表示、記憶部14への記録(保存)、距離情報の算出、距離画像データの生成)などに使用される。
The data processing device 13 includes a signal processing unit 130, a memory 131, a distance map generation unit 132, a reliability data calculation unit 133, and a distance map correction unit 134. The signal processing unit 130 is a functional unit that performs the image processing S21. The image processing S21 includes various signal processing such as AD conversion, noise removal, demosaicing, luminance signal conversion, aberration correction, white balance adjustment, color correction and the like of an analog signal output from the imaging device 11. Digital image data output from the signal processing unit 130 is stored in the memory 131 and used for display on the display unit 16, recording (storage) in the storage unit 14, calculation of distance information, generation of distance image data, etc. Ru.

距離マップ生成部132は、距離生成処理S22を行う機能部である。距離マップ生成部132は、信号処理部130から出力される撮影画像のデジタル画像データ(以下、単に撮影画像データとも称する)を取得し、その撮影画像データから被写体の距離情報を表す距離マップを生成する。距離マップは複数の距離情報からなるデータであり、画素値として距離値を有する画像と考えられるので、以下では距離画像または距離画像データとも称する。被写体の距離情報を取得する方法は、撮影条件を変えて撮影したぼけ方の異なる撮影画像データを用いる方法(Depth From Defocus法:DFD法)や、視差の異なる撮影画像データを用いる方法(ステレオ法)が挙げられる。その他にもTime of Flight法やDepth From Focusの方法が挙げられる。距離マップ生成部132で生成された距離画像データは、記憶部14に格納、またはメモリ131に一時的に格納され、後段の処理に利用される。   The distance map generation unit 132 is a functional unit that performs distance generation processing S22. The distance map generation unit 132 acquires digital image data (hereinafter, also simply referred to as photographed image data) of the photographed image output from the signal processing unit 130, and generates a distance map representing distance information of the subject from the photographed image data. Do. The distance map is data consisting of a plurality of distance information, and can be considered as an image having a distance value as a pixel value, and hence it is also referred to as a distance image or distance image data below. As a method of acquiring distance information of the subject, a method (Depth From Defocus method: DFD method) using photographed image data of different blurs photographed by changing photographing conditions or a method (stereo method) using photographed image data having different parallax Can be mentioned. Other methods include Time of Flight method and Depth From Focus method. The distance image data generated by the distance map generation unit 132 is stored in the storage unit 14 or temporarily stored in the memory 131, and is used for processing in the subsequent stage.

距離情報は、フォーカス位置からの相対距離であってもよいし、撮影時の撮像装置からの絶対距離であってもよい。2つの画像から距離情報を求める場合、フォーカス位置からの相対距離は、2画像のフォーカス位置の中間位置から被写体までの相対的な距離でもよいし、どちらか1画像のフォーカス位置から被写体までの相対的な距離でもよい。また、絶対距離あるいは相対距離は、像面側での距離、物体側での距離のどちらであってもよい。また、距離は、実空間の距離で表されてもよいし、デフォーカス量や視差量など実空間の距離に換算できる量で表されてもよい。   The distance information may be a relative distance from the focus position or an absolute distance from the imaging device at the time of shooting. When obtaining distance information from two images, the relative distance from the focus position may be a relative distance from the middle position of the focus positions of the two images to the subject, or the relative distance from the focus position of any one image to the subject It may be a long distance. Also, the absolute distance or relative distance may be either the distance on the image plane side or the distance on the object side. Further, the distance may be represented by the distance in the real space, or may be represented by an amount that can be converted to the distance in the real space, such as the defocus amount and the parallax amount.

信頼度データ算出部133は、距離マップ生成部132で生成された距離マップの各画素値(距離値)に対する信頼度を表す信頼度データを算出する機能を有する。信頼度データとは、距離マップの各画素の距離情報が正しい値であるかの指標となる情報である。なお、信頼度データ算出部133は、距離マップの全ての画素について信頼度を求める必要はなく、一部の画素についてのみ信頼度を求めてもよい。信頼度データ算出部133は、図3に示すように、輝度値の類似度を計算する類似度取得部1331と、類似度を用いて周辺画素の統計量、さらに統計量から信頼度データを計算する信頼度取得部1332とを含む。信頼度取得部1332は、統計量を計算する統計量取得部1333と、統計量を信頼度に変換する変換部1334を含む。   The reliability data calculation unit 133 has a function of calculating reliability data representing the reliability of each pixel value (distance value) of the distance map generated by the distance map generation unit 132. The reliability data is information serving as an index as to whether the distance information of each pixel of the distance map is a correct value. The reliability data calculation unit 133 does not have to obtain the reliability for all the pixels of the distance map, and may calculate the reliability for only some of the pixels. As shown in FIG. 3, the reliability data calculation unit 133 calculates the reliability data from the statistics of peripheral pixels and the statistics using the similarity, and the similarity acquisition unit 1331 which calculates the similarity of luminance values. And a reliability acquisition unit 1332. The reliability acquisition unit 1332 includes a statistic acquisition unit 1333 that calculates a statistic, and a conversion unit 1334 that converts the statistic to a reliability.

距離マップ補正部134は、取得された撮影画像データと、距離マップ生成部132で生成された距離画像データと、信頼度データ算出部133で生成された信頼度情報を用いて、距離画像データの各画素の距離情報を補正する機能を有する。   The distance map correction unit 134 uses the acquired captured image data, the distance image data generated by the distance map generation unit 132, and the reliability information generated by the reliability data calculation unit 133 to obtain the distance image data. It has a function of correcting the distance information of each pixel.

信頼度データ算出部133及び距離マップ補正部134が行う処理は、図2Aにおけるデータ処理S23に対応する。データ処理S23の詳細は後述する。   The processing performed by the reliability data calculation unit 133 and the distance map correction unit 134 corresponds to the data processing S23 in FIG. 2A. Details of the data processing S23 will be described later.

記憶部14は、撮影画像データ、距離画像データ、信頼度情報データ、補正後距離画像データ、撮像装置1で利用されるパラメータデータなどが格納される不揮発性の記憶媒体である。記憶部14としては、高速に読み書きでき、且つ、大容量の記憶媒体であればどのようなものを利用してもよい。例えば、記憶部14はフラッシュメモリなどを含むことが好ましい。入力部15はユーザが操作し、撮像装置1に対して情報入力や設定変更を行うためのインターフェイスである。例えば、入力部15はダイヤル、ボタン、スイッチ、タッチパネルなどを含むことができる。表示部16は、液晶ディスプレイや有機ELディスプレイなどで構成される表示手段である。表示部16は、撮影時の構図確認、撮影・記録した画像の閲覧、各種設定画面やメッセージ情報の表示などに利用される。出力・記録処理S24は、撮影画像データ、距離画像データ、信頼度画像データ、補正後距離画像デ
ータなどの記憶部14への記録処理や、これらのデータの表示部16への表示処理が含まれる。
The storage unit 14 is a non-volatile storage medium in which photographed image data, distance image data, reliability information data, corrected distance image data, parameter data used by the imaging device 1 and the like are stored. The storage unit 14 may be any storage medium that can read and write at high speed and has a large capacity. For example, the storage unit 14 preferably includes a flash memory or the like. The input unit 15 is an interface operated by the user to input information to the imaging apparatus 1 and change settings. For example, the input unit 15 can include a dial, a button, a switch, a touch panel, and the like. The display unit 16 is a display unit configured by a liquid crystal display, an organic EL display, or the like. The display unit 16 is used for composition confirmation at the time of photographing, browsing of photographed and recorded images, display of various setting screens and message information, and the like. The output / recording processing S24 includes recording processing of the photographed image data, distance image data, reliability image data, corrected distance image data, etc. in the storage unit 14 and display processing of these data on the display unit 16 .

制御部12は、撮像装置1の各部を制御する機能である。制御部12の機能としては、例えば、オートフォーカス(AF)による自動焦点合わせ、フォーカス位置の変更、F値(絞り)の変更、画像の取り込み、シャッタやフラッシュ(いずれも不図示)の制御、記憶部14や入力部15や表示部16の制御などがある。   The control unit 12 is a function of controlling each unit of the imaging device 1. The functions of the control unit 12 include, for example, automatic focusing by autofocus (AF), change of focus position, change of F value (aperture), capture of image, control of shutter and flash (all not shown), storage There is control of the unit 14, the input unit 15 and the display unit 16.

次に、距離画像データ上に現れる主なエラーについて説明する。1つ目は、距離情報が大きく変化する箇所(オブジェクト境界部とよぶ)において生じるエラーである。この種のエラーは、前側と後側に物体があって、その物体同士が重なる境界付近に現れる。DFD法などの画像の類似度から距離を算出するような手法を用いた場合には、オブジェクト境界部では、距離算出時に前側と後側の情報が混ざるために、算出された距離情報の誤差が大きくなる。   Next, the main errors appearing on the distance image data will be described. The first is an error that occurs at a point where distance information changes significantly (referred to as an object boundary). This type of error appears in the vicinity of the boundary where objects overlap on the front and back sides. When a method is used to calculate the distance from image similarity, such as the DFD method, the error in the calculated distance information is calculated at the object boundary because the information on the front and back sides is mixed at the time of distance calculation. growing.

2つ目は、距離情報が取得できないエラー(データ欠損)である。このエラーが生じる原因は、距離取得方法に依って異なる。ステレオ法を例に挙げると、被写体に模様(テクスチャ)がない領域や、暗い領域、また視差の違いにより片側から見えない領域(オクルージョン領域)などが原因である。またこの種のエラーは連続した複数の画素を含む領域で発生することが多い。   The second is an error (data loss) in which distance information can not be obtained. The cause of this error depends on the distance acquisition method. Taking the stereo method as an example, there are a region where there is no pattern (texture) in the subject, a dark region, and a region (occlusion region) which can not be seen from one side due to a difference in parallax. Also, this type of error often occurs in an area including a plurality of consecutive pixels.

3つ目は、距離情報にノイズが発生して生じるエラーである。ノイズが発生すると、同じ距離にある物体でも、その物体内の距離情報がばらつく。   The third is an error caused by noise in distance information. When noise occurs, even if an object is at the same distance, distance information in the object is dispersed.

以下、データ処理S23についてより詳細に説明する。本実施形態のデータ処理S23では、上記エラーの内、主に1つ目の距離境界部(オブジェクト境界部)におけるエラーの有無を評価した信頼度を算出し、当該信頼度を基に距離画像データを補正する。以下、データ処理S23について、図面を参照しながら、より詳細に説明する。図2Bは、データ処理S23のより詳細なフローチャートである。図3は、信頼度データ算出部133および距離マップ補正部134の機能ブロックをデータの流れとともに示した図である。図4A〜図4Cは処理データの例を示す図である。   The data processing S23 will be described in more detail below. In the data processing S23 of the present embodiment, among the above-mentioned errors, the reliability obtained by mainly evaluating the presence or absence of an error at the first distance boundary (object boundary) is calculated, and distance image data is calculated based on the reliability. Correct the Hereinafter, the data processing S23 will be described in more detail with reference to the drawings. FIG. 2B is a more detailed flowchart of data processing S23. FIG. 3 is a diagram showing functional blocks of the reliability data calculation unit 133 and the distance map correction unit 134 together with the flow of data. 4A to 4C are diagrams showing examples of processing data.

ステップS30において、信頼度データ算出部133は、撮影画像データ41(第一の画像データ)および距離画像データ42(第二の画像データ)を取得する。図4Aは撮影画像データ41の例を示し、図4Bは距離画像データ42の例を示す。撮影画像データ41と距離画像データ42は、略同一視点の画像である。例えば、距離画像データ42は、異なる撮影条件の複数の撮影画像データから算出される距離情報を含む画像データであり、撮影画像データ41は距離情報算出の基となった複数の撮影画像データのいずれかまたはそれらを合成した画像データである。撮影画像データ41は、モノクロ画像(輝度画像)であってもよいし、カラー画像であってもよい。   In step S30, the reliability data calculation unit 133 acquires the photographed image data 41 (first image data) and the distance image data 42 (second image data). FIG. 4A shows an example of the photographed image data 41, and FIG. 4B shows an example of the distance image data. The photographed image data 41 and the distance image data 42 are images of approximately the same viewpoint. For example, the distance image data 42 is image data including distance information calculated from a plurality of photographed image data of different photographing conditions, and the photographed image data 41 is any of a plurality of photographed image data based on the distance information calculation. Or image data obtained by combining them. The photographed image data 41 may be a monochrome image (luminance image) or a color image.

前述したように、距離画像データ42はオブジェクト境界部においてエラーを含んでいる。距離画像データ42のオブジェクト境界部(図4BにおけるA−A’部分)の距離情報は、図4Cに示すようにオブジェクト境界付近において後側のオブジェクト(背景)の距離情報が前側のオブジェクト(人体)の距離情報の影響を受けてエラーを含む。より具体的には、後側オブジェクトの距離情報が実際よりも近く算出されてしまうエラーを含む。このエラーは距離マップ生成処理時に発生したものである。前側オブジェクトによるエラーの影響は、オブジェクト境界から離れるにしたがって徐々に小さくなる。距離情報が正しい距離値から異なっている領域をエラー領域と定義すると、本実施形態では、オブジェクト境界から所定範囲内にある後側オブジェクトの領域がエラー領域となる。信頼度デ
ータ算出部133は、図4Dに示すように、エラー領域を正しく抽出する信頼度情報を得る処理を行う。より具体的には、信頼度データ算出部133は、エラー領域において低信頼度(図4Dでは黒で表示)、それ以外の領域では高信頼度(図4Dでは白で表示)である信頼度情報を取得可能な処理を行う。
As described above, the distance image data 42 contains an error at the object boundary. The distance information of the object boundary portion (the AA ′ portion in FIG. 4B) of the distance image data 42 is an object (human body) on the front side of the distance information of the rear object (background) near the object boundary as shown in FIG. Includes errors under the influence of distance information. More specifically, it includes an error in which distance information of the rear object is calculated closer than actual. This error occurs during the distance map generation process. The impact of errors by the front object diminishes as one moves away from the object boundary. If an area in which the distance information differs from the correct distance value is defined as an error area, in the present embodiment, the area of the rear object within a predetermined range from the object boundary becomes the error area. As shown in FIG. 4D, the reliability data calculation unit 133 performs processing to obtain reliability information for correctly extracting an error area. More specifically, the reliability data calculation unit 133 has reliability information that is low reliability (displayed in black in FIG. 4D) in the error area and reliability (displayed in white in FIG. 4D) in the other areas. Do the process that can be obtained.

ステップS31において、類似度取得部1331が、信頼度の算出対象画素(着目画素)に対応する撮影画像中の画素(第一の画素)の画素値と、その周辺領域内の複数の画素(複数の第二の画素)の画素値の類似度Sを計算する。例えば、撮影画像がモノクロの輝度画像であれば、類似度Sは以下のように輝度差として計算される。

Figure 2019106215
Sは類似度(値が小さいほど類似度が高く、値が大きいほど類似度が低い)、Iは撮影画像の輝度値を表し、pは信頼度算出対象画素の位置、qは信頼度算出対象画素pの周辺画素の位置である。 In step S31, the similarity acquiring unit 1331 calculates the pixel value of the pixel (first pixel) in the captured image corresponding to the calculation target pixel (regarding pixel) of the reliability and a plurality of pixels (plural pixels in the peripheral region). The similarity S of the pixel values of the second pixel of For example, if the photographed image is a monochrome luminance image, the similarity S is calculated as a luminance difference as follows.
Figure 2019106215
S indicates the degree of similarity (the smaller the value, the higher the degree of similarity; the larger the value, the lower the degree of similarity), I represents the luminance value of the photographed image, p is the position of the reliability calculation target pixel, and q is the reliability calculation target It is the position of the peripheral pixel of the pixel p.

また撮影画像がカラー画像であれば、類似度Sは、以下のように色差のユークリッド距離として計算される。

Figure 2019106215
R、G、Bはそれぞれ赤、緑、青のカラーチャンネルを表す。類似度算出手法は上記記載した距離計算だけではなく、マンハッタン距離等、どのような手法を用いても構わない。また、カラー画像からCIELab色空間やYUV色空間など、他の色空間に変換し、上記類似度計算を行ってもよい。 If the photographed image is a color image, the similarity S is calculated as the Euclidean distance of color difference as follows.
Figure 2019106215
R, G and B represent red, green and blue color channels, respectively. The similarity calculation method is not limited to the above-described distance calculation, and any method such as Manhattan distance may be used. Alternatively, the color image may be converted to another color space such as CIELab color space or YUV color space, and the similarity calculation may be performed.

類似度取得部1331は、さらに、類似度Sから統計量計算(S32)で使用する重みWを算出する。重みWは、0から1の間の値をとり、類似度Sが高いほど1に近く、類似度Sが低いほど0に近いように決定される。つまり、重みWは、上記式1、2において類似度Sの値が0の場合には1となり、類似度Sの値が大きくなるに従って、0に近づくように設定される。また、類似度Sに閾値Uを設け、以下のように重みWを決定してもよい。

Figure 2019106215
式3によれば、閾値Uよりも類似度Sが小さい(類似している)周辺画素の重みWが1に決定され、それ以外の周辺画素の重みWを0に決定される。なお、このようにして類似度Sと重みWは関連付けられるため、類似度Sと重みWは同一視することもできる。 The similarity acquisition unit 1331 further calculates the weight W used in the statistic calculation (S32) from the similarity S. The weight W takes a value between 0 and 1, and is determined to be closer to 1 as the similarity S is higher and to be closer to 0 as the similarity S is lower. That is, the weight W is set to 1 when the value of the similarity S is 0 in Equations 1 and 2, and is set to approach 0 as the value of the similarity S increases. In addition, a threshold U may be provided for the similarity S, and the weight W may be determined as follows.
Figure 2019106215
According to Equation 3, the weight W of peripheral pixels whose similarity S is smaller than (or similar to) the threshold value U is determined to be 1, and the weights W of other peripheral pixels are determined to be 0. Since the similarity S is associated with the weight W in this manner, the similarity S and the weight W can be regarded as identical.

次にステップS32において、統計量取得部1333が、信頼度算出対象画素に対応する距離画像データ42中の画素(第三の画素)の統計量Tを計算する。統計量Tは、距離画像データ42中の距離値が推定される真値からどれだけ離れているかを評価する値である。統計量Tは、算出対象画素(第三の画素)とその周辺画素(複数の第四の画素)の距離値および撮影画像における類似度Sを基に、対象画素において正しいと推定される距離値と実際の距離値の差に相当する値として計算される。この際、統計量Tは、上記で求めた重みWを重みとして対象画素の距離値や周辺画素の距離値に対して重み付け平均処理を行って算出される。重みWを式3のように決定すれば、周辺画素のうち、撮影画像において画素値が類似する画素(同じオブジェクトの画素)の距離値のみを用いて統計量Tが算
出される。
Next, in step S32, the statistic acquisition unit 1333 calculates the statistic T of the pixel (third pixel) in the distance image data 42 corresponding to the reliability calculation target pixel. The statistic T is a value for evaluating how far the distance value in the distance image data 42 is from the estimated true value. The statistic T is a distance value estimated to be correct at the target pixel based on the distance value between the calculation target pixel (third pixel) and its peripheral pixels (multiple fourth pixels) and the similarity S in the photographed image. Is calculated as the value corresponding to the difference between the and the actual distance value. At this time, the statistical amount T is calculated by performing weighted averaging on the distance value of the target pixel and the distance values of peripheral pixels using the weight W obtained above as a weight. If the weight W is determined as Expression 3, the statistic T is calculated using only distance values of pixels (pixels of the same object) having similar pixel values in the photographed image among peripheral pixels.

統計量Tは、例えば、以下のような周辺画素の距離値の重み付き平均値と対象画素の距離値との差の絶対値として求めることができる。

Figure 2019106215
Tは統計量、Dは距離値、Qは周辺画素範囲(画素qの集合)を表す。周辺画素範囲Qは、広すぎると輝度(色)が類似している距離情報は値が近いという前提が崩れ、新たなエラーを生む可能性がある。また演算量も増えるという問題もある。一方、周辺画素範囲Qが狭すぎると、エラー領域における統計量Tの計算において周辺画素範囲Q内に含まれる正しい距離を持った画素が少なくなり、適切にステップS33の信頼度計算が行えなくなる可能性が生じる。したがって、周辺画素範囲Qの大きさは、オブジェクト境界において生じるエラー領域の大きさを基にあらかじめ決定しておくことが望ましい。例えば、距離算出においてテンプレートマッチングを採用する場合、エラー領域の大きさはテンプレートマッチングにおけるウィンドウサイズによって決まる。例えば、周辺画素範囲Qの大きさはウィンドウサイズの2倍程度とすることが考えられる。 The statistic T can be obtained, for example, as an absolute value of a difference between a weighted average value of distance values of peripheral pixels as described below and a distance value of a target pixel.
Figure 2019106215
T represents a statistic, D represents a distance value, and Q represents a peripheral pixel range (set of pixels q). If the peripheral pixel range Q is too wide, the premise that the distance information having similar luminance (color) has a similar value is broken, which may cause a new error. There is also the problem that the amount of computation also increases. On the other hand, when the peripheral pixel range Q is too narrow, the calculation of the statistic T in the error area decreases the number of pixels having the correct distance included in the peripheral pixel range Q, and the reliability calculation in step S33 can not be appropriately performed. Sex occurs. Therefore, it is desirable that the size of the peripheral pixel range Q be previously determined based on the size of the error area generated at the object boundary. For example, when template matching is employed in distance calculation, the size of the error area is determined by the window size in template matching. For example, it is conceivable that the size of the peripheral pixel range Q is about twice the window size.

式4の右辺の絶対値内の第1項は、撮影画像における類似度を重みとして、周辺画素の距離値から求められた対象画素において正しいと推定される距離値とみなすことができる。したがって、式4は、対象画素にいて正しいと推定される距離値と実際の距離値との差に相当する値である。なお、上述したように統計量Tは、対象画素の距離情報が真値からどれだけ離れているかを撮影画像における類似度を考慮しつつ評価することができれば、必ずしも式4にによって算出される必要はない。例えば、以下の式5に従って、統計量Tが計算されてもよい。

Figure 2019106215
式5にしたがうと、統計量Tは、補正対象距離D(p)と周辺画素距離D(q)の差の絶対値の重み付き平均値として求められる。このような算出方法によっても、統計量Tは、対象画素において正しいと推定される距離値と実際の距離値の差を表すといえる。 The first term in the absolute value on the right side of Equation 4 can be regarded as a distance value estimated to be correct in the target pixel obtained from the distance values of peripheral pixels, using the similarity in the photographed image as a weight. Therefore, Equation 4 is a value corresponding to the difference between the distance value estimated to be correct in the target pixel and the actual distance value. As described above, the statistic T needs to be calculated by Equation 4 if it can be evaluated how much the distance information of the target pixel is away from the true value in consideration of the similarity in the photographed image. There is no. For example, the statistic T may be calculated according to the following Equation 5.
Figure 2019106215
According to the equation 5, the statistic T is obtained as a weighted average value of absolute values of differences between the correction target distance D (p) and the peripheral pixel distance D (q). Also by such a calculation method, it can be said that the statistic T represents the difference between the distance value estimated to be correct at the target pixel and the actual distance value.

また統計量Tは、式4あるいは式5において、対象画素pと周辺画素qの画素間の空間的な距離|p−q|に応じて、ある分散を持ったガウス分布等で表される重みをさらに付加するなど、その他の計算式に従って求めることもできる。また、重み計算(S31)と統計量計算(S32)の一部はフィルタ処理によって同時に実現しても構わない。重みWが式3のように1または0で表現される場合には、重みWが1となっている画素のみを選択して、統計量Tを計算しても構わない。   The statistic T is a weight represented by a Gaussian distribution or the like having a certain dispersion according to the spatial distance | p−q | between the target pixel p and the peripheral pixels q in Equation 4 or Equation 5. It can also be determined according to other calculation formulas such as adding. In addition, part of the weight calculation (S31) and the statistic calculation (S32) may be realized simultaneously by filter processing. When the weight W is expressed by 1 or 0 as in Equation 3, the statistic T may be calculated by selecting only the pixels for which the weight W is 1.

次にステップS33において、変換部1334が、信頼度Cの計算を行う。信頼度Cは前述の統計量Tに応じて決定される。例えば式4にしたがって統計量Tを算出した場合には、統計量Tが大きい場合により信頼できないと判断され、統計量Tが小さい場合にはより信頼できると判断される。当然、統計量Tの算出方法に依って、統計量Tから信頼度Cの求め方は異なる場合があるが、例えば以下の変換式を採用することができる。

Figure 2019106215
Tminは統計量Tの値の最小値、Tmaxは統計量Tの値の最大値を表す。統計量TがTmaxの場合に信頼度Cは1となり、統計量TがTminの場合に0となり、統計量Tが0と1の間では信頼度Cは連続的に変化する。 Next, in step S33, the converting unit 1334 calculates the reliability C. The reliability C is determined in accordance with the aforementioned statistic T. For example, in the case where the statistic T is calculated according to the equation 4, it is judged to be unreliable when the statistic T is large, and it is judged to be more reliable when the statistic T is small. Naturally, depending on the method of calculating the statistic T, the method of obtaining the reliability C from the statistic T may differ, but for example, the following conversion equation can be adopted.
Figure 2019106215
Tmin represents the minimum value of the statistic T, and Tmax represents the maximum value of the statistic T. The reliability C is 1 when the statistic T is Tmax, 0 when the statistic T is Tmin, and the reliability C changes continuously between 0 and 1 of the statistic T.

あるいは信頼度Cは、統計量Tと閾値との比較に基づいて二値で表してもよい。すなわち、信頼できる信頼度が1、信頼できない信頼度が0であるとし、以下のように信頼度Cを二値で求めてもよい。

Figure 2019106215
Lは閾値を表す。つまり、統計量Tが式4によって求められている場合は、周辺画素距離の重み付き平均値と補正対象距離との差の絶対値と、閾値Lとの比較によって信頼度が決定される。具体的には、統計量Tが閾値よりも大きければ距離値は信頼できないと判定され、閾値以下であれば距離値が信頼できると判定される。 Alternatively, the reliability C may be expressed as a binary value based on the comparison between the statistic T and the threshold. That is, assuming that the reliable reliability is 1 and the unreliable reliability is 0, the reliability C may be obtained as a binary value as follows.
Figure 2019106215
L represents a threshold. That is, when the statistic T is obtained by Equation 4, the reliability is determined by comparing the absolute value of the difference between the weighted average value of the peripheral pixel distances and the correction target distance with the threshold L. Specifically, the distance value is determined to be unreliable if the statistic T is greater than the threshold, and the distance value is determined to be reliable if it is less than the threshold.

図5A〜図5Cは、取得した距離画像データにおける距離値D、ステップS32において求められる統計量T、ステップS33において求められる信頼度Cの例をそれぞれ示す図である。これらの図はいずれも、図4BのA−A’断面部分の値を示す。図5Aでは、図4BのA−A’断面における補正前の距離値を点線で示し、周辺画素距離の重み付き平均距離値を実線で示している。周辺画素距離の重み付き平均値は、輝度画像における類似度Sに基づく重みWを用いて算出されるため、オブジェクトが異なる領域間で距離値が平均化されることはない。ただし、異なるオブジェクト間では異なる輝度分布(色分布)を持っており、異なるオブジェクト領域は類似していないことを仮定している。図5Aにおいて、点A1はオブジェクト境界であり、点A2は補正前距離値と重み付き平均値が同値となる点、点A3はエラー領域とエラーでない領域の境界を表している。   5A to 5C are diagrams showing examples of the distance value D in the acquired distance image data, the statistic T obtained in step S32, and the reliability C obtained in step S33. Each of these figures shows the value of the A-A 'cross-sectional part of FIG. 4B. In FIG. 5A, the distance value before correction in the A-A 'cross section of FIG. 4B is indicated by a dotted line, and the weighted average distance value of the peripheral pixel distances is indicated by a solid line. Since the weighted average value of the peripheral pixel distance is calculated using the weight W based on the similarity S in the luminance image, the distance values are not averaged between the regions where the objects are different. However, it is assumed that different objects have different luminance distributions (color distributions), and different object areas are not similar. In FIG. 5A, a point A1 is an object boundary, a point A2 is a point where the pre-correction distance value and the weighted average value are the same, and a point A3 is a boundary between an error area and a non-error area.

図5Bは、図4BのA−A’断面における統計量Tを示している。ここでの統計量Tは、補正前距離(図5Aの点線)と周辺画素距離の重み付き平均値(図5Aの実線)の差の絶対値、つまり式4にしたがって求められるものとする。点A4は、点A3における統計量T(A3)と同値の統計量を持つ点を表している。図5Bを見ると、式7の閾値Lを点A3における統計量T(A3)の値に設定すると、A1〜A4の領域で信頼度が0になり、その他の領域では信頼度が1となる。すなわち、閾値Lを点A3における統計量T(A3)に設定することで、図5Cに示すような信頼度Cが得られる。A1〜A4の領域はエラー領域であるので、この領域についての信頼度は正しく算出できていることが分かる。閾値Lを統計量T(A3)の値より大きな値に設定すると、低信頼度の領域はより狭い領域となってしまう。また閾値Lを統計量T(A3)の値より小さな値に設定すると、より広い領域を低信頼度とすることができるが、点A3付近のエラー領域ではない部分も低信頼度とされてしまう。このようなことを考慮に入れると、式7の閾値Lには、点A3における統計量T(A3)を用いることが好ましい。   FIG. 5B shows the statistic T in the A-A ′ cross section of FIG. 4B. The statistic T here is obtained in accordance with the absolute value of the difference between the pre-correction distance (dotted line in FIG. 5A) and the weighted average value of the peripheral pixel distances (solid line in FIG. 5A). A point A4 represents a point having the same statistic as the statistic T (A3) at the point A3. Referring to FIG. 5B, when the threshold L of the equation 7 is set to the value of the statistic T (A3) at the point A3, the reliability becomes 0 in the region of A1 to A4, and becomes 1 in the other regions. . That is, by setting the threshold L to the statistic T (A3) at the point A3, the reliability C as shown in FIG. 5C can be obtained. Since the areas A1 to A4 are error areas, it can be seen that the reliability for this area can be calculated correctly. If the threshold L is set to a value larger than the value of the statistic T (A3), the low reliability region becomes a narrower region. Also, if the threshold L is set to a value smaller than the value of the statistic T (A3), a wider area can be made unreliable, but a part that is not an error area near the point A3 will also be unreliable. . In consideration of such a thing, it is preferable to use the statistic T (A3) at the point A3 as the threshold L in the equation 7.

ただし、閾値Lは必ずしも点A3における統計量T(A3)にしなけらばならないというわけではない。閾値Lの値を統計量T(A3)より大きくしても小さくしても、それに応じた効果が得られるため、状況に応じて閾値Lを決定すればよい。   However, the threshold L does not necessarily have to be the statistic T (A3) at the point A3. Even if the value of the threshold L is larger or smaller than the statistic T (A3), the corresponding effect can be obtained. Therefore, the threshold L may be determined according to the situation.

また、撮影画像に含まれる前景と後景のオブジェクトの距離差によって、エラー領域と非エラー領域の境界(点A3)における統計量T(A3)の具体的な値は変化する。例えば、オブジェクトの距離差がより小さい場合は、距離差が大きい場合と比較して、点A3における統計量T(A3)の値は小さくなる。したがって、信頼度計算処理において、信頼できる距離情報を信頼度なしと判定されることを避けるためには、オブジェクト間の距離差が最大の場合の点A3での統計量Tの値をあらかじめ求めておき、その値を閾値Lとして採用すればよい。最大の距離差とは、例えば8ビットで距離相当の情報が表現されていれば、0に相当する距離と255に相当する距離との差である。また、点A3の位置、すなわち、エラー領域と非エラー領域の境界がオブジェクト境界からどれだけの画素数離れているかは、距離マップの算出方法に基づいてあらかじめ推定できる。例えば、テンプレートマッチングを用いる場合には、オブジェクト境界からウィンドウサイズの大きさと等しい画素数離れた位置がエラー領域と非エラー領域の境界となると推定できる。   Further, the specific value of the statistic T (A3) at the boundary (point A3) between the error area and the non-error area changes due to the difference in distance between the foreground and background objects contained in the photographed image. For example, when the distance difference between objects is smaller, the value of the statistic T (A3) at the point A3 is smaller than when the distance difference is large. Therefore, in the reliability calculation process, in order to avoid that the reliable distance information is not determined to be unreliable, the value of the statistic T at the point A3 in the case where the distance difference between objects is the largest is obtained in advance The value may be adopted as the threshold L. The maximum distance difference is, for example, the difference between the distance corresponding to 0 and the distance corresponding to 255 if information corresponding to the distance is represented by 8 bits. Further, the position of the point A3, that is, how many pixels the boundary between the error area and the non-error area is away from the object boundary can be estimated in advance based on the method of calculating the distance map. For example, when template matching is used, it can be estimated that the position away from the object boundary by the number of pixels equal to the size of the window size is the boundary between the error area and the non-error area.

このように閾値Lを決定した場合は、オブジェクト間の距離差が小さい境界領域では信頼度なしと判定される領域は小さくはなるが、信頼できる領域を信頼度なしと誤判定してしまうことはない。以上のように、閾値Lは所望のケースに合わせて、計算やシミュレーション等によって、事前に決めておけばよい。   When the threshold L is determined in this way, in the boundary area where the distance difference between the objects is small, the area determined to be unreliable becomes smaller, but the credible area is erroneously determined to be unreliable. Absent. As described above, the threshold L may be determined in advance by calculation, simulation or the like in accordance with a desired case.

なお、閾値Lとしてあらかじめ定められた値を用いるのではなく、閾値Lを動的に変更してもよい。上述したように、エラー領域と非エラー領域の境界における統計量の値は、主に前景オブジェクトと後景オブジェクトの距離差によって決まる。したがって、信頼度算出対象画素の周辺における距離の最大値と最小値の差に基づいて、閾値Lを決定してもよい。このようにすれば、より適切な信頼度の算出が可能となる。   Instead of using a predetermined value as the threshold L, the threshold L may be changed dynamically. As described above, the value of the statistic at the boundary between the error area and the non-error area mainly depends on the distance difference between the foreground object and the background object. Therefore, the threshold L may be determined based on the difference between the maximum value and the minimum value of the distance around the reliability calculation target pixel. This makes it possible to calculate the reliability more appropriately.

上記の手法によって信頼度の取得(すなわち、エラー領域を判定)が行えるものの、信頼できない情報であるにも関わらず信頼度ありとなってしまっている領域(図5Cの点A4から点A3までの領域)が残ってしまっている。信頼度算出の精度を改善するためには、信頼度取得処理(統計量計算処理S32および信頼度計算処理S33)を繰り返すとよい。繰り返す場合のフローチャートを図2Cに示す。信頼度計算処理S33後に判定処理S40が含まれるが、それ以外の処理は基本的に図2Bと同様である。ただし、二回目以降の処理の場合には、直前の処理で算出した信頼度を暫定信頼度として用いる。例えば、統計量Ti+1の算出時に信頼度Cを暫定信頼度として利用するとすると、統計量の算出式として以下の式8を採用可能である。

Figure 2019106215
ここで、添字iによってi回目(iは1以上の整数)の処理において算出される値であることを示す。重みW(および類似度S)および距離値Dは、繰り返し回数によらず同一の値を取る。 Although the reliability can be acquired (that is, the error area can be determined) by the above-described method, the area having reliability despite the unreliable information (from the point A4 to the point A3 in FIG. 5C) Area is left. In order to improve the accuracy of the reliability calculation, it is preferable to repeat the reliability acquisition process (the statistic calculation process S32 and the reliability calculation process S33). A flowchart for repeating is shown in FIG. 2C. Although the determination process S40 is included after the reliability calculation process S33, the other processes are basically the same as FIG. 2B. However, in the case of the second and subsequent processes, the reliability calculated in the immediately preceding process is used as the temporary reliability. For example, assuming that the reliability C i is used as the temporary reliability at the time of calculating the statistic T i + 1 , the following equation 8 can be adopted as a calculation equation of the statistic.
Figure 2019106215
Here, the subscript i indicates that the value is calculated in the i-th process (i is an integer of 1 or more). Weight W (and similarity S) and distance value D take the same value regardless of the number of repetitions.

本実施形態においては、上述のように、信頼度なしと判定された画素の信頼度の算出結果は正しいと想定される。したがって、前回の繰り返し処理までに信頼度なしと判定された画素については、再度の計算を行うことなく信頼度なしとすればよい。すなわち、C(p)=0である画素pについては、Ci+1(p)=0とすればよい。これにより計算量を削減できるだけでなく、信頼できない画素を誤って信頼できるとする誤検出を防止できる。 In the present embodiment, as described above, it is assumed that the calculation result of the reliability of the pixel determined to have no reliability is correct. Therefore, with regard to a pixel determined to have no reliability by the previous repeated processing, the reliability may be determined without performing calculation again. That is, for a pixel p for which C i (p) = 0, C i + 1 (p) = 0 may be set. As a result, not only the amount of calculation can be reduced, but also false detection can be prevented, in which an unreliable pixel can be erroneously trusted.

周辺画素の信頼度Cを重みとして追加することによる影響を図6A〜図6Cを参照して説明する。図6A〜図6Cは、図5A〜図5Cと同様にそれぞれ距離値D、統計量T,信頼度Cを表す。ここでは、図6Aに示す点A1から点A4までの領域が低信頼度であり、その他の領域は高信頼度であるとする。図6Aにおける実線は、この信頼度も重みとして用いた周辺画素距離の重み付き平均値(式8の絶対値内の第1項)である。図5Aと比較して、既に算出した信頼度なし領域の距離値は重み付き平均値の算出に使用されないため、重み付き平均値は正しい値により近づいた値となっている。重み付き平均値が真値により近づいているため、式8により算出される統計量Tは図6Bに示すように、エラー領域においては図5Bよりも大きな値となる。したがって、前述したように点A3における統計量Tの値を閾値Lとした場合に、図6Cに示すように、より広い領域(点A1から点A4’の領域)で信頼度なしとすることができる。上記の処理を繰り返していくことで、信頼度無しと判定される領域とエラー領域とをより精度良く一致させることができる。繰り返し処理における閾値Lは、上述したように計算やシミュレーション等によって複数の値を事前に決めておくことができる。このような条件であれば、繰り返し処理の回数を重ねるごとに閾値を小さくすることが望ましい。また判定処理S70における繰り返し終了の判定は、事前に定められた回数に達したか否かの判定、新たに信頼度なし判定された画素が所定数以下であるか否かの判定、信頼度ありの領域における統計量の分散が所定値以下であるか否かの判定などが挙げられる。また、統計量の値によって、補正処理後に残存するエラーがおおよそ算出できるため、それを基に繰り返し処理を行うか否かを判定してもよい。   The influence of adding the reliability C of the peripheral pixels as a weight will be described with reference to FIGS. 6A to 6C. 6A to 6C respectively represent the distance value D, the statistic T, and the reliability C, similarly to FIGS. 5A to 5C. Here, it is assumed that the area from point A1 to point A4 shown in FIG. 6A is low in reliability, and the other areas are high in reliability. The solid line in FIG. 6A is a weighted average value of the peripheral pixel distances (the first term in the absolute value of equation 8) in which the reliability is also used as a weight. As compared with FIG. 5A, the weighted average value is closer to the correct value because the distance value of the non-reliability area already calculated is not used to calculate the weighted average value. Since the weighted average value is closer to the true value, the statistic T calculated by the equation 8 becomes a larger value than that in FIG. 5B in the error area as shown in FIG. 6B. Therefore, as described above, when the value of the statistic T at the point A3 is set as the threshold L, as shown in FIG. 6C, it is possible to set no reliability in a wider area (area from the point A1 to the point A4 ′). it can. By repeating the above process, it is possible to more accurately match the area determined to have no reliability with the error area. A plurality of values can be determined in advance by calculation, simulation, or the like as described above, as the threshold L in the repetitive processing. Under such conditions, it is desirable to reduce the threshold each time the number of repeated processing is increased. In addition, the determination of repetition end in the determination process S70 is a determination of whether or not the number of times determined in advance has been reached, a determination of whether or not the number of pixels newly determined to have no reliability is less than a predetermined number, and a reliability For example, it may be determined whether or not the variance of the statistic in the region of is less than a predetermined value. Further, since an error remaining after the correction process can be roughly calculated by the value of the statistic, it may be determined whether or not the process is repeatedly performed based on the error.

なお、式8は繰り返し処理の2回目以降に使用するだけではなく、最初の算出処理(繰り返し処理を行わない場合を含む)にも式4の代わりに採用可能である。その場合には、あらかじめ上述した手法とは異なる何らかの手法で暫定信頼度を算出する必要がある。その方法は特に限定されない。例えば、距離マップ生成部132が距離情報を算出する際に得られる信頼度を暫定信頼度として用いることができる。例えば、距離マップ生成部132は、撮影画像において被写体が有するテクスチャの度合いや、輝度値などに基づいて、信頼度を算出できる。より具体的には、テクスチャが少ない領域や、輝度が低い領域における距離情報は、信頼度が低いと判定できる。   Equation 8 is not only used for the second and subsequent iterations of the iterative process, but may be employed instead of equation 4 for the first calculation process (including the case where the iterative process is not performed). In that case, it is necessary to calculate the provisional reliability in advance by some method different from the method described above. The method is not particularly limited. For example, the reliability obtained when the distance map generation unit 132 calculates distance information can be used as the temporary reliability. For example, the distance map generation unit 132 can calculate the reliability based on the degree of the texture of the subject in the captured image, the luminance value, and the like. More specifically, it is possible to determine that distance information in an area with low texture or an area with low luminance has low reliability.

また、上記の信頼度算出方法は、オブジェクト境界におけるエラー以外のエラーを評価するためにも用いることができる。例えば、距離算出時にある程度の大きさの領域に発生するエラーを評価するために用いることができる。本手法によって、同一オブジェクト内で大きなエラーが発生している領域の信頼度も判定することが可能である。   Also, the above reliability calculation method can also be used to evaluate errors other than errors at object boundaries. For example, it can be used to evaluate an error that occurs in a region of a certain size when calculating a distance. By this method, it is also possible to determine the reliability of the area where a large error occurs in the same object.

次に、ステップS34において、ステップS33で算出された信頼度を用いて、距離マップ補正部134が距離マップを補正する。補正処理は例えば一例として、以下のようなフィルタ処理が挙げられる。

Figure 2019106215
式9において、Dは補正前の距離値、D’は補正後の距離値である。Iは撮影画像データ内の画素の輝度値または色情報である。pは距離画像データ内の補正対象画素の位置、qは補正対象画素pの周辺画素の位置である。Gはガウス関数(σ、σは分散値)で、GσsおよびGσrは異なるガウス関数でもよいし、同じガウス関数でもよい。Q’は計算範囲(画素qの集合)であり、Sが大きいと、周辺画素qの個数も大きくなる。Cは最終的に得られた信頼度を表す。Thは、信頼度Cが高い場合には1、信頼度Cが低い場
合には0に設定される。例えば、信頼度Cが0以上1以下の数値範囲をとる場合、信頼度Cが0.5以上のときにThは1に設定され、Cが0.5未満の場合にThは0に設定されるようにする。なお、Cが0と1の2値の値しかとらない場合には、Th(C)はCと置換してもよい(すなわちTh(C)=Cとしてよい)。 Next, in step S34, the distance map correction unit 134 corrects the distance map using the reliability calculated in step S33. The correction process is, for example, the following filter process as an example.
Figure 2019106215
In Equation 9, D is a distance value before correction, and D ′ is a distance value after correction. I is the luminance value or color information of the pixel in the photographed image data. p is the position of the correction target pixel in the distance image data, and q is the position of the peripheral pixel of the correction target pixel p. G is a Gaussian function (σ s , σ r is a variance value), and G σs and G σr may be different Gaussian functions or may be the same Gaussian function. Q ′ is a calculation range (set of pixels q), and when S is large, the number of peripheral pixels q also increases. C represents the finally obtained reliability. Th is set to 1 when the reliability C is high, and to 0 when the reliability C is low. For example, in the case where the reliability C takes a numerical range of 0 or more and 1 or less, Th is set to 1 when the reliability C is 0.5 or more, and Th is set to 0 when C is less than 0.5. To make When C takes only two values of 0 and 1, Th (C) may be replaced with C (that is, Th (C) may be C).

本実施形態によれば、距離画像データに正しい信頼度を設定することができる。また、正しい信頼度情報に基づいて距離情報の補正処理を行うことにより、より高精度な距離画像データに補正可能という効果がある。   According to the present embodiment, it is possible to set the correct reliability in the distance image data. Further, by performing the correction process of the distance information based on the correct reliability information, it is possible to correct the distance image data with higher accuracy.

(実施形態1の変形例)
上記の式8の第一項と式9の形は非常に類似している。式9が補正後の距離情報であるので、式8(および式4)によって定義される統計量Tは補正後の距離情報と補正前の距離情報との差の絶対値と考えることができる。したがって、実施形態1における信頼度算出処理は、図7に示すような処理によっても実現可能である。すなわち、まず類似度取得部1331が、撮影画像中での着目画素pとその周辺画素qとの類似度Sを算出する(式1)。距離マップ補正部134が、算出された類似度Sに基づく重みW(例えば、Gσs(|p−q|)×Gσr(S))を用いて距離画像における周辺画素qの距離値Dを用いて着目画素pの距離値得の補正を行う(式9)。そして、統計量取得部1333が、着目画素pにおける補正前の距離値Dと補正後の距離値D’の差の絶対値を、統計量Tとして算出する(式8に相当)。最後に、変換部1334が、統計量Tを信頼度Cに変換する(式6または式7)。
(Modification of Embodiment 1)
The first term of equation 8 above and the form of equation 9 are very similar. Since Equation 9 is distance information after correction, the statistic T defined by Equation 8 (and Equation 4) can be considered as an absolute value of the difference between the distance information after correction and the distance information before correction. Therefore, the reliability calculation process in the first embodiment can also be realized by a process as shown in FIG. That is, first, the similarity acquisition unit 1331 calculates the similarity S between the pixel p of interest in the captured image and its neighboring pixels q (Equation 1). The distance map correction unit 134 uses the weight W based on the calculated similarity S (for example, G σs (| p−q |) × G σ r (S)) to calculate the distance value D of the peripheral pixel q in the distance image Correction for obtaining the distance value of the pixel of interest p is performed using the equation (9). Then, the statistic acquisition unit 1333 calculates, as the statistic T, the absolute value of the difference between the distance value D before correction and the distance value D ′ after correction in the pixel of interest p (corresponding to equation 8). Finally, the converting unit 1334 converts the statistic T into the reliability C (Equation 6 or 7).

なお、距離画像の補正処理は、特定の計算方法に限定されるものではない。距離画像の補正処理は、撮影画像における類似度と周辺画素の距離情報とを考慮して推定される着目画素における距離情報の真値との差を小さくするような補正処理であれば、上記で示した補正以外にも任意の補正処理を採用することができる。つまり、何らかの手段を用いて補正した距離情報と補正前の距離情報を比較することで、距離情報に対する信頼度を設定してもよい。前述の繰り返し処理を行った場合には補正した距離情報が得られ、その後信頼度が求まる。つまり、補正が十分であれば、その段階で終了判定することができるため、繰り返し回数の判断を補正結果で行うことができる。   The distance image correction process is not limited to a specific calculation method. The correction process of the distance image is the correction process as long as it reduces the difference between the true value of the distance information in the target pixel estimated in consideration of the degree of similarity in the photographed image and the distance information of peripheral pixels. Arbitrary correction processing can be adopted other than the correction shown. That is, the reliability of the distance information may be set by comparing the distance information corrected using any means with the distance information before correction. When the above-described repetitive processing is performed, corrected distance information is obtained, and thereafter, the reliability is obtained. That is, if the correction is sufficient, the end can be determined at that stage, so that the determination of the number of repetitions can be made based on the correction result.

上述したように、信頼度算出処理を繰り返す場合には、前回の処理で求められた信頼度情報を用いて距離画像の補正を行えばよい。なお、前回の処理までで信頼できないと判定された画素については、統計量の値にかかわらず信頼度なしと決定できる。繰り返し処理終了の判定の具体例として、例えば、事前に定められた回数に達したか否かの判定、距離画像の補正処理による補正量の最大値が所定値以下となった否かの判定、新たに信頼度なし判定された画素が所定数以下であるか否かの判定、などが挙げられる。   As described above, when the reliability calculation process is repeated, the distance image may be corrected using the reliability information obtained in the previous process. Note that for pixels determined to be unreliable by the previous processing, it can be determined that there is no reliability regardless of the value of the statistic. As a specific example of the determination of the end of the repetitive processing, for example, a determination of whether or not the number of times determined in advance has been reached, a determination of whether or not the maximum value of the correction amount by the correction processing of the distance image becomes less than a predetermined value For example, it may be determined whether the number of pixels newly determined to have no reliability is equal to or less than a predetermined number.

実施形態1の方法では統計量の算出処理と距離画像の補正処理が異なる内容であったが、本変形例の方法では、これら2つの計算の主要部分を共通化できるため、同一の演算回路を用いた実装が可能であり、コストの削減を図れる。また、統計量算出の際に距離画像の補正を行っているので、信頼度情報の算出後に、改めて距離画像の補正を行う必要がない点でも計算量の削減が図れる。   In the method of the first embodiment, the calculation process of the statistic and the correction process of the distance image are different contents, but in the method of the present modification, since the main parts of these two calculations can be made common, the same arithmetic circuit is used. The implementation used is possible and the cost can be reduced. Further, since the distance image is corrected at the time of calculating the statistical amount, it is possible to reduce the calculation amount even at the point that the distance image does not need to be corrected again after the calculation of the reliability information.

(実施形態2)
実施形態1では、撮影画像データと距離画像データを使用し、信頼度情報データの生成、距離情報の補正を行っていた。それに対して、本実施形態では、撮影画像データと距離画像データ以外を用いて、信頼度情報の生成及び補正処理が行えることを示す。図8は、本実施形態のデータ処理装置を表す。フローチャートは実施形態1のフローチャートと同じである。本実施形態の画像処理方法を、実施形態1と異なる点を中心に説明する。
Second Embodiment
In the first embodiment, generation of reliability information data and correction of distance information are performed using captured image data and distance image data. On the other hand, in the present embodiment, it is shown that generation and correction processing of reliability information can be performed using something other than photographed image data and distance image data. FIG. 8 shows a data processing device of the present embodiment. The flowchart is the same as the flowchart of the first embodiment. An image processing method according to the present embodiment will be described focusing on differences from the first embodiment.

データ処理装置81は、第一画像データ入力部810、第二画像データ入力部811、信頼度データ算出部812、第二画像データ補正部813を有している。第一画像データ入力部810には、基準となるべき画像データ(第一画像データ)が入力される。第一画像データは、輝度画像データであってよく、それ以外にも例えば、既に補正された距離画像データや原理的にオブジェクトエッジ付近でエラーが発生しないような手法で得られた距離画像データなどであってもよい。第一画像データは、その他にも、赤外光や偏光等の情報でもよい。また、第一画像データとして輝度画像等を取得する場合には、図1のように撮像装置にデータ処理装置81を含ませることができる。また、第一画像データが距離画像データ等の場合には、距離画像データ等を生成するためのデータ生成部をデータ処理装置81が含んでもよい。仮に第一画像データが距離画像データであるとすると、式1のIは距離値(オブジェクト境界において誤差を含まない)に相当する。   The data processing device 81 includes a first image data input unit 810, a second image data input unit 811, a reliability data calculation unit 812, and a second image data correction unit 813. The first image data input unit 810 receives image data (first image data) to be a reference. The first image data may be luminance image data, and in addition to this, for example, distance image data already corrected, distance image data obtained by a method such that an error does not occur in principle near an object edge, etc. It may be The first image data may also be information such as infrared light or polarization. In addition, when acquiring a luminance image or the like as the first image data, as shown in FIG. 1, the data processing device 81 can be included in the imaging device. In addition, when the first image data is distance image data and the like, the data processing device 81 may include a data generation unit for generating distance image data and the like. Assuming that the first image data is distance image data, I in Equation 1 corresponds to a distance value (does not include an error at an object boundary).

第二画像データ入力部811は、信頼度の算出対象となる画像データ(第二画像データ)が入力される。第二画像データは、第一画像データと略同一視点の画像データであり、異なる情報を表す画像データであることが好ましい。第二画像データは、オブジェクト境界においてエラーを含むような画像データである。第一画像データと第二画像データは、異なる算出方法で算出された同一内容の情報を表すデータであってもよい。また、第一画像データと第二画像データは必ずしも同一画角である必要はなく、第二画像データが第一画像データに含まれていればよい。すなわち、第一画像データの画角は、第二画像データの画角と等しくてもよいし、それより大きい画角であってもよい。   The second image data input unit 811 receives image data (second image data) to be subjected to calculation of the reliability. Preferably, the second image data is image data having substantially the same viewpoint as the first image data, and is image data representing different information. The second image data is image data that includes an error at an object boundary. The first image data and the second image data may be data representing the same content information calculated by different calculation methods. Further, the first image data and the second image data do not necessarily have to have the same angle of view, as long as the second image data is included in the first image data. That is, the angle of view of the first image data may be equal to or larger than the angle of view of the second image data.

第二画像データの距離画像データ以外の例として、動きデータ(Optical Flow)が挙げられる。動きデータは被写体(時にはカメラの動きも含む)の動きを表すデータである。例えば、動きデータは、横方向(x方向)と縦方向(y方向)の速度を各画素についてデータとして保持している。被写体の動き情報は、一般的に、ある時間間隔で輝度画像を二枚撮影し、その二枚の画像のテンプレートマッチングによって、尤もらしい対応位置を計算し、その移動量と撮影時間間隔から縦・横方向それぞれの速度を算出することができる。このようにして計算される速度は、テンプレートマッチングのウィンドウ内に複数の異なる速度の画素が混在している場合、これら複数の速度が混ざって中間的な速度が得られてしまう。つまり、異なる速度で移動しているオブジェクトの境界では、算出される動き情報(速度)はエラーを有することになる。第二画像データが動きデータであるとすると、式4におけるDは横方向の速度値及び縦方向の速度値に相当する。   As an example other than the distance image data of the second image data, motion data (Optical Flow) can be mentioned. Motion data is data representing the motion of an object (sometimes including the motion of a camera). For example, motion data holds the velocity in the horizontal direction (x direction) and the vertical direction (y direction) as data for each pixel. Motion information of the subject generally takes two luminance images at a certain time interval, and by template matching of the two images, a likely corresponding position is calculated, and from the movement amount and the photographing time interval Each velocity in the lateral direction can be calculated. The speed calculated in this manner is such that when pixels of different speeds are mixed in the window of template matching, these plural speeds are mixed to obtain an intermediate speed. That is, at the boundaries of objects moving at different speeds, the calculated motion information (speed) will have errors. Assuming that the second image data is motion data, D in Equation 4 corresponds to the lateral velocity value and the longitudinal velocity value.

第二画像データは、赤外画像や偏光画像であってもよい。赤外画像や偏光画像は、レンズの色収差の影響や特殊なセンサ構造により、RGB画像よりも低解像度である場合がある。この場合もオブジェクト境界部にエラーが発生していると考えることができる。   The second image data may be an infrared image or a polarized image. Infrared images and polarized images may have lower resolution than RGB images due to the effects of lens chromatic aberrations and special sensor structures. Also in this case, it can be considered that an error occurs at the object boundary.

ここで挙げた例のように、第二画像データは、異なるオブジェクト同士の境界部にエラーを持つようなデータであればよい。また、第一画像データに対して、第二画像データが小さいサイズ(少ないデータ量)である場合に、拡大(データ補間)処理を行うことがある。その場合、やはり、拡大処理によってオブジェクトの境界付近でエラーが発生する。このような拡大処理後の画像データを第二画像データとして用いることもできる。例えば、前述の赤外画像や偏光画像を取得するためのイメージセンサは、特定の画素にのみ赤外用のカラーフィルタや偏光フィルタを有する場合がある。この場合、取得される赤外画像や偏光画像は、RGB画像と比較して小さいサイズとなるため、拡大処理が施されることがある。第二画像データは、データ処理装置81とは別の装置が生成してデータ処理装置81に入力されてもよいし、データ処理装置81が第一画像データやその他の情報から生成してもよい。   As in the example described here, the second image data may be data that has an error at the boundary between different objects. Further, enlargement (data interpolation) processing may be performed on the first image data when the second image data has a small size (small amount of data). In that case, again, the enlargement process generates an error near the object boundary. Image data after such enlargement processing can also be used as second image data. For example, an image sensor for acquiring the above-mentioned infrared image or polarization image may have an infrared color filter or polarization filter only at a specific pixel. In this case, since the acquired infrared image or polarized image has a smaller size than the RGB image, enlargement processing may be performed. The second image data may be generated by an apparatus different from the data processing apparatus 81 and input to the data processing apparatus 81, or the data processing apparatus 81 may be generated from the first image data or other information. .

以上のように、第二画像データにエラーがあり、第一画像データが補正に対する基準となるデータであれば、その後の重み計算S31、統計量計算S32、信頼度計算S33、補正処理S34は実施形態1と同様に計算できる。データに依っては、補正対象データが複数になることはあるがそれぞれ基本的な処理は変わらない。例えば、動きデータの場合には横方向の動きデータの補正処理と縦方向のデータの補正処理は独立に同様の手法を用いて行われる。   As described above, if there is an error in the second image data and the first image data is data serving as a reference for correction, the weight calculation S31, the statistic calculation S32, the reliability calculation S33, and the correction processing S34 are performed. It can be calculated as in the first embodiment. Depending on the data, there may be multiple correction target data, but the basic processing does not change. For example, in the case of motion data, the correction processing of motion data in the horizontal direction and the correction processing of data in the vertical direction are independently performed using the same method.

本実施形態によれば、距離画像データに限られず、エラーを持った種々のデータに対して信頼度を設定することができる。また、この信頼度を基に補正処理を行うことにより、より高精度なデータに補正することが可能となるという効果がある。   According to the present embodiment, not only distance image data but reliability can be set for various data having an error. Further, by performing the correction processing based on the reliability, it is possible to correct data with higher accuracy.

(実施形態3)
実施形態1では、図4Cに示すように、オブジェクト境界部のエラーが徐々に変化していた。本実施形態では、図9のように、オブジェクト境界部の一方のオブジェクトにおける距離値が、他方のオブジェクトにおける距離値と略同一となるようなエラーを含む画像(第二画像)を対象として、信頼度の算出および情報の補正を行う。本実施形態では、オブジェクト境界において、後景オブジェクトの距離値が前景オブジェクトの距離値として算出されるようなエラーを含む距離画像を対象とする。なお、距離画像がどのようなエラーを有するかは、距離画像の算出方法によって決定される。
(Embodiment 3)
In the first embodiment, as shown in FIG. 4C, the error at the object boundary gradually changes. In the present embodiment, as shown in FIG. 9, the image (second image) including an error such that the distance value of one object in the object boundary portion is substantially the same as the distance value of the other object Calculate the degree and correct the information. The present embodiment is directed to a distance image including an error such that the distance value of the background object is calculated as the distance value of the foreground object at the object boundary. Note that what kind of error the distance image has is determined by the method of calculating the distance image.

本実施形態における処理は、実施形態1と同様に、図2A〜図2Cのフローチャートに示すとおりである。図2Bを参照して、実施形態1と異なる点を中心に、本実施形態のデータ処理方法を説明する。また本実施形態では、輝度情報と距離情報を処理の対象とする例を説明するが、実施形態2で説明したように他のデータについても同様の計算が可能である。   The process in this embodiment is as shown in the flowcharts of FIGS. 2A to 2C, as in the first embodiment. The data processing method according to the present embodiment will be described with reference to FIG. 2B, focusing on differences from the first embodiment. In the present embodiment, an example in which the luminance information and the distance information are targets of processing will be described. However, as described in the second embodiment, similar calculations can be performed for other data.

類似度計算処理S31は実施形態1と同等である。統計量計算処理S32において、例えば以下のように、周辺画素距離の重み付き平均値と補正対象画素の距離の差を統計量Tとする。

Figure 2019106215
図10Aの実線が式10における第一項の周辺画素距離の重み付き平均値を表し、図10Bが式10によって求められる統計量Tを表している。もちろん統計量Tは必ずしも式10によって求められる必要はない。また統計量Tは、式8のようにあらかじめ算出した信頼度情報を用いて計算してもよい。図10Aおよび図10Bにおいて、点B1はオブジェクト境界、点B2はエラー領域とエラーでない領域の境界を表している。輝度画像の類似度を基に重みが決定されているため、点B1を跨いで、距離が平均化されることはない。 The similarity calculation process S31 is equivalent to that of the first embodiment. In the statistic calculation processing S32, for example, the difference between the weighted average value of the peripheral pixel distances and the distance of the correction target pixel is set as the statistic T as follows.
Figure 2019106215
The solid line in FIG. 10A represents the weighted average value of the peripheral pixel distances of the first term in Equation 10, and FIG. 10B represents the statistic T obtained by Equation 10. Of course, the statistic T does not necessarily have to be determined by equation 10. Also, the statistic T may be calculated using reliability information calculated in advance as shown in Equation 8. In FIGS. 10A and 10B, a point B1 represents an object boundary, and a point B2 represents a boundary between an error area and a non-error area. Since the weight is determined based on the degree of similarity of the luminance image, the distance is not averaged across the point B1.

信頼度計算処理S33において、信頼度Cは前述の統計量に応じて、決定される。上述したように、本実施形態では前景オブジェクトの距離値が後景オブジェクトの距離値として算出される距離画像を対象としているので、例えば、式10のような統計量Tを算出した場合には、統計量Tの正負によって信頼度を決定できる。信頼できることを表す信頼度を1、信頼できないことを表す信頼度が0であるとした場合、式11のように統計量Tの符号から信頼度Cを判断してもよい。

Figure 2019106215
In the reliability calculation process S33, the reliability C is determined in accordance with the aforementioned statistic. As described above, in the present embodiment, since the distance image in which the distance value of the foreground object is calculated as the distance value of the background object is targeted, for example, when the statistic T as shown in equation 10 is calculated, The degree of reliability can be determined by the positive or negative of the statistic T. Assuming that the reliability representing reliability is 1 and the reliability representing unreliability is 0, the reliability C may be determined from the sign of the statistic T as shown in Equation 11.
Figure 2019106215

このような算出手法によって、点B1から点B2の範囲の距離値を信頼できないものと判定することができる。なお、式11では統計量Tの正負によって信頼度を判定しているが、エラー領域以外でも、周辺画素の重み付き平均距離値と補正対象画素の距離値は、ノイズなどによっても異なる場合があり、その場合式10の値は正にも負にもなりうる。このような場合にエラーが含まれない画素を信頼できないと誤判定しないように、T<a(a<0)の時にC(p)=0とするようにしてもよい。   By such a calculation method, it is possible to determine that the distance value in the range from the point B1 to the point B2 is unreliable. Although the reliability is determined based on the positive or negative of the statistic T in Equation 11, the weighted average distance value of the peripheral pixels and the distance value of the correction target pixel may be different due to noise or the like even outside the error region. In that case, the value of Equation 10 can be positive or negative. In such a case, C (p) = 0 may be set when T <a (a <0) so that a pixel not including an error is not erroneously determined to be unreliable.

本実施形態によれば、オブジェクト境界部におけるエラーの形状に合わせた統計量及び信頼度計算を行うことにより、正しい信頼度を設定することができることが可能となる。   According to the present embodiment, it is possible to set the correct reliability by calculating the statistic and the reliability in accordance with the shape of the error at the object boundary.

なお、具体的な信頼度の算出手法は、信頼度算出対象画像におけるエラーの発生の仕方によって適宜変更する必要がある。例えば、前景オブジェクトの距離値が後景オブジェクトの距離値として算出されるエラーを含む距離画像であれば、式10による統計量Tが正の時に信頼できないと判定すべきである。   In addition, it is necessary to appropriately change the calculation method of the reliability degree according to the method of the occurrence of the error in the reliability calculation target image. For example, if the distance value of the foreground object is a distance image including an error calculated as the distance value of the background object, it should be determined that the statistical value T according to Equation 10 is unreliable when it is positive.

(その他の実施例)
上述した本発明のデータ処理装置及び方法は、例えば、デジタルカメラやカムコーダなどの撮像装置、或いは撮像装置で得られた画像データに対し画像処理を施す画像処理装置やコンピュータなどに好ましく適用できる。また、このような撮像装置或いは画像処理装置を内蔵する各種の電子機器(携帯電話、スマートフォン、スレート型端末、パーソナルコンピュータを含む)にも本発明の技術を適用可能である。上記実施形態では撮像装置の本体に画像処理装置の機能を組み込んだ構成を示したが、画像処理装置の機能はどのように構成してもよい。例えば、撮像装置を有するコンピュータに画像処理装置を組み込み、撮像装置で撮影した画像をコンピュータが取得して、それに基づいて上記画像処理方法を実行するようにしてもよい。また、有線あるいは無線によりネットワークアクセス可能なコンピュータに画像処理装置が組み込まれて、そのコンピュータがネットワークを介して複数枚の画像を取得し、それに基づいて上記画像処理方法を実行するようにしてもよい。得られた距離情報は、例えば、画像の領域分割、立体画像や奥行き画像の生成、ぼけ効果のエミュレーションなどの各種画像処理に利用することができる。
(Other embodiments)
The data processing apparatus and method of the present invention described above can be preferably applied to, for example, an imaging apparatus such as a digital camera or camcorder, or an image processing apparatus or computer that performs image processing on image data obtained by the imaging apparatus. The technology of the present invention is also applicable to various electronic devices (including mobile phones, smart phones, slate-type terminals, and personal computers) incorporating such imaging devices or image processing devices. Although the configuration in which the function of the image processing apparatus is incorporated in the main body of the imaging device has been described in the above embodiment, the function of the image processing apparatus may be configured in any way. For example, the image processing apparatus may be incorporated into a computer having an imaging device, and the computer may acquire an image captured by the imaging device and execute the image processing method based thereon. Alternatively, the image processing apparatus may be incorporated in a computer capable of network access by wire or wireless, and the computer may acquire a plurality of images via the network and execute the image processing method based thereon. . The obtained distance information can be used, for example, for various image processing such as area division of an image, generation of a stereoscopic image or a depth image, and emulation of a blur effect.

なお、上記装置への具体的な実装は、ソフトウェア(プログラム)による実装とハードウェアによる実装のいずれも可能である。例えば、撮像装置などに内蔵されたコンピュータ(マイコン、FPGA等)のメモリにプログラムを格納し、当該プログラムをコンピュータに実行させることで、本発明の目的を達成するための各種処理を実現してもよい。また、本発明の全部又は一部の処理を論理回路により実現するASIC等の専用プロセッサを設けることも好ましい。   The specific implementation to the above apparatus can be implemented either by software (program) or hardware. For example, even if a program is stored in the memory of a computer (microcomputer, FPGA, etc.) incorporated in an imaging device etc. and the computer is executed by the computer, various processes for achieving the object of the present invention can be realized. Good. It is also preferable to provide a dedicated processor such as an ASIC that implements all or part of the processing of the present invention by a logic circuit.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

133 信頼度データ算出部
1331 類似度取得部
1332 信頼度取得部
133 Reliability Data Calculation Unit 1331 Similarity Acquisition Unit 1332 Reliability Acquisition Unit

本発明の第一の態様は、画像データと、該画像データに対応する距離情報の分布を示す距離マップを取得する取得手段と、前記画像データの対応する領域を参照して前記距離マップの各領域にフィルタ処理を施して補正距離マップを生成する補正手段と、を有し、前記補正手段は、前記距離マップにおける対象領域の距離情報に対して、前記距離マップ上の第1の位置の距離情報よりも、前記距離マップ上の前記第1の位置よりも前記距離マップ上で前記対象領域に近い第2の位置の距離情報により大きい重みをつけ、前記画像データの第1の画素値を有する画素の位置に対応する距離情報よりも、前記第1の画素値よりも前記対象領域に対応する画像データの画素値に近い第2の画素値を有する画素の位置に対応する距離情報により大きい重みをつけて、前記対象領域の周辺の距離情報を用いた重みづけ加算を行うことで前記対象領域の距離情報を補正し、前記補正距離マップを生成することを特徴とするデータ処理装置である。
According to a first aspect of the present invention, there is provided an acquisition means for acquiring an image data and a distance map indicating a distribution of distance information corresponding to the image data, and each of the distance maps with reference to a corresponding region of the image data. And correcting means for applying a filtering process to the area to generate a correction distance map, wherein the correction means is configured to calculate the distance of the first position on the distance map relative to the distance information of the target area on the distance map. It has a first pixel value of the image data by giving greater weight to distance information of a second position closer to the target area on the distance map than the first position on the distance map than information. The distance information corresponding to the position of a pixel having a second pixel value closer to the pixel value of the image data corresponding to the target area than the first pixel value is larger than the distance information corresponding to the position of the pixel Data processing apparatus characterized by correcting distance information of the target region by performing weighted addition using distance information around the target region, and generating the corrected distance map. .

本発明の第二の態様は、画像データと、該画像データに対応する距離情報の分布を示す距離マップを取得する取得ステップと、前記画像データの対応する領域を参照して前記距離マップの各領域にフィルタ処理を施して補正距離マップを生成する補正ステップと、を有し、前記補正ステップでは、前記距離マップにおける対象領域の距離情報に対して、前記距離マップ上の第1の位置の距離情報よりも、前記距離マップ上の前記第1の位置よりも前記距離マップ上で前記対象領域に近い第2の位置の距離情報により大きい重みをつけ、前記画像データの第1の画素値を有する画素の位置に対応する距離情報よりも、前記第1の画素値よりも前記対象領域に対応する画像データの画素値に近い第2の画素値を有する画素の位置に対応する距離情報により大きい重みをつけて、前記対象領域の周辺の距離情報を用いた重みづけ加算を行うことで前記対象領域の距離情報を補正して、前記補正距離マップを生成することを特徴とするデータ処理方法である。
According to a second aspect of the present invention, there is provided an acquiring step of acquiring image data and a distance map indicating distribution of distance information corresponding to the image data, and each of the distance maps with reference to a corresponding region of the image data. And a correction step of applying a filtering process to the area to generate a correction distance map, wherein in the correction step, the distance of the first position on the distance map with respect to the distance information of the target area in the distance map It has a first pixel value of the image data by giving greater weight to distance information of a second position closer to the target area on the distance map than the first position on the distance map than information. The distance information corresponding to the position of a pixel having a second pixel value closer to the pixel value of the image data corresponding to the target area than the first pixel value than the distance information corresponding to the position of the pixel Data processing characterized by correcting distance information of the target area by performing weighted addition using distance information on the periphery of the target area by giving a larger weight to It is a method.

本発明の第三の態様は、第1の画像データと、各データが該第1の画像データの各領域に対応するマップとを取得する取得手段と、前記第1の画像データの対応する領域を参照して前記マップの各領域にフィルタ処理を施して補正マップを生成する補正手段と、を有
し、前記補正手段は、前記マップにおける対象領域のデータに対して、前記マップ上の第1の位置のデータよりも、前記マップ上の前記第1の位置よりも前記マップ上で前記対象領域に近い第2の位置のデータにより大きい重みをつけ、前記画像データの第1の画素値を有する画素の位置に対応するデータよりも、前記第1の画素値よりも前記対象領域に対応する画像データの画素値に近い第2の画素値を有する画素の位置に対応するデータにより大きい重みをつけて、前記対象領域の周辺のデータを用いた重みづけ加算を行うことで前記対象領域のデータを補正し、前記補正マップを生成することを特徴とするデータ処理装置である。
According to a third aspect of the present invention, there is provided an acquisition means for acquiring a first image data and a map in which each data corresponds to each area of the first image data, and an area corresponding to the first image data. And correction means for applying a filtering process to each area of the map with reference to
And the correction means is configured to set the target area on the map more than the first position on the map than the data on the first position on the map with respect to data of the target area on the map. Image data corresponding to the target area rather than the first pixel value rather than data corresponding to the position of the pixel having the first pixel value of the image data given more weight to the data of the closer second position The data in the target area is corrected by performing weighted addition using data in the vicinity of the target area by giving greater weight to data corresponding to the position of the pixel having the second pixel value close to the pixel value of And generating the correction map.

本発明の第四の態様は、第1の画像データと、各データが該第1の画像データの各領域に対応するマップとを取得する取得ステップと、前記第1の画像データの対応する領域を参照して前記マップの各領域にフィルタ処理を施して補正マップを生成する補正ステップと、を有し、前記補正ステップでは、前記マップにおける対象領域のデータに対して、前記マップ上の第1の位置のデータよりも、前記マップ上の前記第1の位置よりも前記マップ上で前記対象領域に近い第2の位置のデータにより大きい重みをつけ、前記画像データの第1の画素値を有する画素の位置に対応するデータよりも、前記第1の画素値よりも前記対象領域に対応する画像データの画素値に近い第2の画素値を有する画素の位置に対応するデータにより大きい重みをつけて、記対象領域の周辺のデータを用いた重みづけ加算を行うことで前記対象領域のデータを補正し、前記補正マップを生成することを特徴とするデータ処理方法である。 A fourth aspect of the present invention is an acquisition step of acquiring first image data and a map in which each data corresponds to each area of the first image data, and an area corresponding to the first image data. And correcting the respective areas of the map with reference to the correction process to generate a correction map, wherein in the correction step, data of a target area in the map is compared with the first on the map. The data of the second position closer to the target area on the map than the first position on the map is weighted more than the data on the first position, and has a first pixel value of the image data More weight is given to data corresponding to the position of a pixel having a second pixel value closer to the pixel value of the image data corresponding to the target area than the data corresponding to the position of the pixel than the data corresponding to the position of the pixel. Only, the data of the target area is corrected by performing a weighted addition using data around the serial target area, a data processing method and generates the correction map.

Claims (34)

第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出するデータ処理装置であって、
前記信頼度データの着目画素に対応する前記第一の画像データの第一の画素の画素値と、前記第一の画素の所定の周辺領域内の複数の第二の画素それぞれの画素値と、の類似度を取得する類似度取得部と、
前記複数の第二の画素それぞれについての前記類似度と、前記第一の画素に対応する前記第二の画像データの第三の画素の画素値と、前記第三の画素の前記所定の周辺領域内のに位置し前記複数の第二の画素それぞれに対応する複数の第四の画素それぞれの画素値と、から前記信頼度データの着目画素の画素値である信頼度を取得する信頼度取得部と、
を備えることを特徴とするデータ処理装置。
A data processing apparatus for calculating reliability data representing reliability of pixel values of at least a part of pixels of the second image data from the first image data and the second image data,
A pixel value of a first pixel of the first image data corresponding to a target pixel of the reliability data, and a pixel value of each of a plurality of second pixels in a predetermined peripheral region of the first pixel; A similarity acquisition unit for acquiring the similarity of
The degree of similarity for each of the plurality of second pixels, the pixel value of a third pixel of the second image data corresponding to the first pixel, and the predetermined peripheral region of the third pixel A reliability acquisition unit for acquiring a reliability, which is a pixel value of a pixel of interest of the reliability data, from the pixel values of the plurality of fourth pixels corresponding to the plurality of second pixels and located inside the When,
A data processing apparatus comprising:
前記信頼度取得部は、前記複数の第二の画素それぞれについての前記類似度を重みとして、前記複数の第四の画素のそれぞれの画素値または当該画素値に基づいて得られる値に対する重み付け平均処理を行って、前記信頼度を取得する、
請求項1に記載のデータ処理装置。
The reliability acquisition unit performs weighted averaging processing on each pixel value of the plurality of fourth pixels or a value obtained based on the pixel value, using the similarity for each of the plurality of second pixels as a weight. To get the confidence,
The data processing apparatus according to claim 1.
前記信頼度取得部は、前記複数の第二の画素それぞれについての前記類似度と、前記複数の第四の画素のぞれぞれの画素値と、前記第三の画素の画素値に基づいて、前記第三の画素において正しいと推定される画素値と実際の画素値の差に相当する値を求め、この値に基づいて前記信頼度を取得する、
請求項1または2に記載のデータ処理装置。
The reliability acquisition unit is configured based on the degree of similarity for each of the plurality of second pixels, the pixel value of each of the plurality of fourth pixels, and the pixel value of the third pixel. Obtaining a value corresponding to a difference between a pixel value estimated to be correct in the third pixel and an actual pixel value, and acquiring the reliability based on the value;
The data processing apparatus according to claim 1.
前記信頼度取得部は、下記の式で算出される値に基づいて前記信頼度を算出する、
請求項1から3のいずれか1項に記載のデータ処理装置。
Figure 2019106215
ここで、pは前記第三の画素、qは前記第四の画素、Qは前記第四の画素の集合、W(q)は前記第四の画素に対応する前記第二の画素における類似度、D(q)は前記第四の画素の画素値、D(p)は前記第三の画素の画素値である。
The reliability acquisition unit calculates the reliability based on a value calculated by the following equation:
The data processing apparatus according to any one of claims 1 to 3.
Figure 2019106215
Here, p is the third pixel, q is the fourth pixel, Q is a set of the fourth pixels, and W (q) is the similarity in the second pixel corresponding to the fourth pixel. , D (q) is the pixel value of the fourth pixel, and D (p) is the pixel value of the third pixel.
前記信頼度取得部は、前記式Aで算出された値の絶対値が閾値より大きい場合には、前記着目画素の画素値として信頼度が低いことを示す値を取得し、前記式Aで算出された値の絶対値が前記閾値以下の場合には、前記着目画素の画素値として信頼度が高いことを示す値を取得する、
請求項4に記載のデータ処理装置。
When the absolute value of the value calculated by the expression A is larger than the threshold, the reliability acquisition unit acquires a value indicating that the reliability is low as the pixel value of the focused pixel, and the calculation is performed by the expression A When the absolute value of the calculated value is equal to or less than the threshold value, a value indicating that the reliability is high is acquired as the pixel value of the pixel of interest.
The data processing device according to claim 4.
前記信頼度取得部は、下記の式で算出される値に基づいて前記信頼度を算出する、
請求項1から3のいずれか1項に記載のデータ処理装置。
Figure 2019106215
ここで、pは前記第三の画素、qは前記第四の画素、Qは前記第四の画素の集合、W(q)は前記第四の画素に対応する前記第二の画素における類似度、D(q)は前記第四の画素の画素値、D(p)は前記第三の画素の画素値である。
The reliability acquisition unit calculates the reliability based on a value calculated by the following equation:
The data processing apparatus according to any one of claims 1 to 3.
Figure 2019106215
Here, p is the third pixel, q is the fourth pixel, Q is a set of the fourth pixels, and W (q) is the similarity in the second pixel corresponding to the fourth pixel. , D (q) is the pixel value of the fourth pixel, and D (p) is the pixel value of the third pixel.
前記信頼度取得部は、前記式Bで算出された値が閾値より大きい場合には、前記着目画素の画素値として信頼度が低いことを示す値を取得し、前記式Bで算出された値の絶対値が前記閾値以下の場合には、前記着目画素の画素値として信頼度が高いことを示す値を取得する、
請求項6に記載のデータ処理装置。
The reliability acquisition unit acquires a value indicating that the reliability is low as the pixel value of the pixel of interest when the value calculated by the expression B is larger than the threshold, and the value calculated by the expression B In the case where the absolute value of is smaller than the threshold value, a value indicating that the reliability is high is acquired as the pixel value of the target pixel,
The data processing apparatus according to claim 6.
前記信頼度取得部は、前記第三の画素の画素値と前記複数の第四の画素それぞれの画素値の暫定信頼度をさらに用いて、前記信頼度を取得する、
請求項1から7のいずれか1項に記載のデータ処理装置。
The reliability acquisition unit further acquires the reliability by further using the temporary reliability of the pixel value of the third pixel and the pixel value of each of the plurality of fourth pixels.
The data processing device according to any one of claims 1 to 7.
前記信頼度取得部は、前記信頼度の取得処理を繰り返し実行し、
前記暫定信頼度は、直前の繰り返し処理によって取得された信頼度である、
請求項8に記載のデータ処理装置。
The reliability acquisition unit repeatedly executes acquisition processing of the reliability,
The provisional reliability is the reliability acquired by the immediately preceding iterative process,
The data processing apparatus according to claim 8.
前記信頼度取得部は、繰り返し処理における最初の信頼度の取得処理では、前記取得処理とは異なる方法によってあらかじめ求められた信頼度を前記暫定信頼度として用いる、
請求項9に記載のデータ処理装置。
The reliability acquisition unit uses the reliability obtained in advance by a method different from the acquisition processing as the temporary reliability in the acquisition processing of the first reliability in the repeated processing.
The data processing device according to claim 9.
前記信頼度取得部は、前記繰り返し処理の繰り返し回数を、前記信頼度の結果に基づいて決定する、
請求項9または10に記載のデータ処理装置。
The reliability acquisition unit determines the number of repetitions of the repetitive processing based on the result of the reliability.
A data processing apparatus according to claim 9 or 10.
前記信頼度取得部は、下記の式で算出される値に基づいて前記信頼度を算出する、
請求項8から11のいずれか1項に記載のデータ処理装置。
Figure 2019106215
ここで、pは前記第三の画素、qは前記第四の画素、Qは前記第四の画素の集合、W(q)は前記第四の画素に対応する前記第二の画素における類似度、D(q)は前記第四の画素の画素値、D(p)は前記第三の画素の画素値、C(q)は前記第四の画素の画素値に対する暫定信頼度を示す値である。
The reliability acquisition unit calculates the reliability based on a value calculated by the following equation:
A data processing apparatus according to any one of claims 8 to 11.
Figure 2019106215
Here, p is the third pixel, q is the fourth pixel, Q is a set of the fourth pixels, and W (q) is the similarity in the second pixel corresponding to the fourth pixel. , D (q) is the pixel value of the fourth pixel, D (p) is the pixel value of the third pixel, and C (q) is a value indicating the provisional reliability of the pixel value of the fourth pixel. is there.
前記信頼度取得部は、前記式Cで算出された値の絶対値が閾値より大きい場合には、前記着目画素の画素値として信頼度が低いことを示す値を取得し、前記式Cで算出された値の絶対値が前記閾値以下の場合には、前記着目画素の画素値として信頼度が低いことを示す値を取得する、
請求項12に記載のデータ処理装置。
The reliability acquisition unit acquires a value indicating that the reliability is low as the pixel value of the pixel of interest when the absolute value of the value calculated by the expression C is larger than a threshold, and the calculation is performed by the expression C. If the absolute value of the calculated value is equal to or less than the threshold value, a value indicating that the reliability is low is acquired as the pixel value of the pixel of interest.
A data processing apparatus according to claim 12.
前記信頼度取得部は、前記信頼度の取得処理を繰り返し実行し、
繰り返し回数が多いほど、前記閾値を小さく設定する、
請求項13に記載のデータ処理装置。
The reliability acquisition unit repeatedly executes acquisition processing of the reliability,
The threshold value is set smaller as the number of repetitions increases.
The data processing device according to claim 13.
前記閾値は、オブジェクト境界から所定の画素数だけ離れた位置だけ離れた画素におけ
る式A、式Bまたは式Cの値に設定される、
請求項5、7、13、14のいずれか1項に記載のデータ処理装置。
The threshold value is set to a value of Formula A, Formula B or Formula C at a pixel separated by a position separated by a predetermined number of pixels from an object boundary.
A data processing apparatus according to any one of claims 5, 7, 13, 14.
前記信頼度取得部は、前記取得処理とは異なる方法によってあらかじめ求められた信頼度を前記暫定信頼度として用いる、
請求項8に記載のデータ処理装置。
The reliability acquisition unit uses, as the temporary reliability, a reliability obtained in advance by a method different from the acquisition processing.
The data processing apparatus according to claim 8.
前記暫定信頼度は、被写体が有するテクスチャの度合いに基づいて算出される、
請求項16に記載のデータ処理装置。
The provisional reliability is calculated based on the degree of texture of the subject.
The data processing apparatus according to claim 16.
前記類似度は0または1の値である、
請求項1から17のいずれか1項に記載のデータ処理装置。
The similarity is a value of 0 or 1.
The data processing apparatus according to any one of claims 1 to 17.
前記所定の周辺領域の大きさは、オブジェクト境界において前記第二の画像データの画素値がエラーを含む領域の大きさよりも大きい、
請求項1から18のいずれか1項に記載のデータ処理装置。
The size of the predetermined peripheral area is larger than the size of the area including the error in the pixel value of the second image data at the object boundary.
A data processing apparatus according to any one of the preceding claims.
前記信頼度取得部は、前記式Aまたは式Cで算出された値が負の場合には、前記着目画素の画素値として信頼度が低いことを示す値を取得し、前記式Aまたは式Cで算出された値が正の場合には、前記着目画素の画素値として信頼度が高いことを示す値を取得する、
請求項4または12に記載のデータ処理装置。
The reliability acquisition unit acquires a value indicating that the reliability is low as the pixel value of the pixel of interest when the value calculated by the expression A or C is negative, and the expression A or C is obtained. If the value calculated in is positive, a value indicating that the reliability is high is acquired as the pixel value of the pixel of interest.
A data processing apparatus according to claim 4 or 12.
前記信頼度取得部にて取得された信頼度を用いて、第二の画像データを補正する補正部をさらに有する、
請求項1から20のいずれか1項に記載のデータ処理装置。
The image processing apparatus further includes a correction unit that corrects second image data using the reliability acquired by the reliability acquisition unit.
21. A data processing apparatus according to any one of the preceding claims.
第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出するデータ処理装置であって、
前記第一の画像データと前記第二の画像データに基づいて前記第二の画像データを補正し、補正後の第二の画像データを生成する補正部と、
補正後の第二の画像データと補正前の第二の画像データとを比較して、信頼度を取得する信頼度取得部と、
を備えることを特徴とするデータ処理装置。
A data processing apparatus for calculating reliability data representing reliability of pixel values of at least a part of pixels of the second image data from the first image data and the second image data,
A correction unit that corrects the second image data based on the first image data and the second image data, and generates a second image data after correction;
A reliability acquisition unit that acquires a reliability by comparing the second image data after correction and the second image data before correction;
A data processing apparatus comprising:
前記補正部が、暫定信頼度をさらに用いて、前記第二の画像データを補正する、
請求項22に記載のデータ処理装置。
The correction unit further corrects the second image data using the temporary reliability.
A data processing apparatus according to claim 22.
前記補正部および前記信頼度取得部による処理を繰り返し実行し、
前記補正部は、最初の処理においてはあらかじめ求められた信頼度を暫定信頼度として用い、2回目以降の処理においては前記信頼度取得部によって直前に取得された信頼度を暫定信頼度として用いる、
請求項23に記載のデータ処理装置。
Repeatedly executing processing by the correction unit and the reliability acquisition unit;
The correction unit uses the reliability obtained in advance as the temporary reliability in the first process, and uses the reliability acquired immediately before by the reliability acquiring unit as the temporary reliability in the second and subsequent processes.
A data processing apparatus according to claim 23.
前記繰り返し処理の繰り返し回数を前記補正部による第二の画像データの補正結果に従って決定する、
請求項24に記載のデータ処理装置。
The number of repetitions of the repetitive processing is determined according to the correction result of the second image data by the correction unit.
The data processing device according to claim 24.
前記第一の画像データおよび前記第二の画像データは、略同一視点の異なる情報を表す画像データであり、
前記第一の画像データの画角は、前記第二の画像データの画角と等しいかそれ以上であ
る、
請求項1から25のいずれか1項に記載のデータ処理装置。
The first image data and the second image data are image data representing different information of substantially the same viewpoint,
The angle of view of the first image data is equal to or greater than the angle of view of the second image data.
26. A data processing apparatus according to any one of the preceding claims.
前記第二の画像データは、オブジェクト境界においてエラーを含む画像データである、
請求項1から26のいずれか1項に記載のデータ処理装置。
The second image data is image data including an error at an object boundary.
The data processing device according to any one of claims 1 to 26.
前記第一の画像データが、画素値として輝度または色情報を有する画像データであり、
前記第二の画像データが、画素値として距離情報を有する画像データである、
請求項1から27のいずれか1項に記載のデータ処理装置。
The first image data is image data having luminance or color information as a pixel value,
The second image data is image data having distance information as a pixel value,
28. A data processing apparatus according to any one of the preceding claims.
前記第一の画像データが、画素値として輝度または色情報を有する画像データであり、
前記第二の画像データが、画素値として動き情報を有する画像データである、
請求項1から27のいずれか1項に記載のデータ処理装置。
The first image data is image data having luminance or color information as a pixel value,
The second image data is image data having motion information as a pixel value,
28. A data processing apparatus according to any one of the preceding claims.
前記第一の画像データが、画素値として距離情報を有する画像データであり、
前記第二の画像データが、画素値として動き情報を有する画像データである、
請求項1から27のいずれか1項に記載のデータ処理装置。
The first image data is image data having distance information as a pixel value,
The second image data is image data having motion information as a pixel value,
28. A data processing apparatus according to any one of the preceding claims.
前記類似度取得部は、前記第一の画素と前記複数の第二の画素それぞれの輝度差または色差に基づいて複数の第二の画素それぞれにおける類似度を取得する、
請求項28または29に記載のデータ処理装置。
The similarity acquisition unit acquires the similarity in each of a plurality of second pixels based on a luminance difference or a color difference of each of the first pixel and the plurality of second pixels.
A data processing apparatus according to claim 28 or 29.
撮像素子と、
請求項1から31のいずれか1項に記載のデータ処理装置と、
を有する撮像装置。
An imaging device,
32. A data processing apparatus according to any one of the preceding claims,
An imaging device having
第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出する、データ処理装置が行うデータ処理方法であって、
前記信頼度データの着目画素に対応する前記第一の画像データの第一の画素の画素値と、前記第一の画素の所定の周辺領域内の複数の第二の画素それぞれの画素値と、の類似度を取得する類似度ステップと、
前記複数の第二の画素それぞれについての前記類似度と、前記第一の画素に対応する前記第二の画像データの第三の画素の画素値と、前記第三の画素の前記所定の周辺領域内のに位置し前記複数の第二の画素それぞれに対応する複数の第四の画素それぞれの画素値と、から前記信頼度データの着目画素の画素値である信頼度を取得する信頼度取得ステップと、
を含むことを特徴とするデータ処理方法。
A data processing method performed by a data processing apparatus, which calculates reliability data representing reliability of pixel values of at least a part of pixels of the second image data from first image data and second image data. There,
A pixel value of a first pixel of the first image data corresponding to a target pixel of the reliability data, and a pixel value of each of a plurality of second pixels in a predetermined peripheral region of the first pixel; Similarity step to obtain the similarity of
The degree of similarity for each of the plurality of second pixels, the pixel value of a third pixel of the second image data corresponding to the first pixel, and the predetermined peripheral region of the third pixel A reliability acquisition step of acquiring the reliability, which is the pixel value of the pixel of interest of the reliability data, from the pixel values of each of the plurality of fourth pixels corresponding to the plurality of second pixels located within When,
A data processing method comprising:
第一の画像データと第二の画像データとから、前記第二の画像データの少なくとも一部の画素の画素値に対する信頼度を表す信頼度データを算出する、データ処理装置が行うデータ処理方法であって、
前記第一の画像データと前記第二の画像データに基づいて前記第二の画像データを補正し、補正後の第二の画像データを生成する補正ステップと、
補正後の第二の画像データと補正前の第二の画像データとを比較して、信頼度を取得する信頼度ステップと、
を含むことを特徴とするデータ処理方法。
A data processing method performed by a data processing apparatus, which calculates reliability data representing reliability of pixel values of at least a part of pixels of the second image data from first image data and second image data. There,
Correcting the second image data based on the first image data and the second image data, and generating a second image data after the correction;
A reliability step of acquiring reliability by comparing the second image data after correction and the second image data before correction;
A data processing method comprising:
JP2019053674A 2019-03-20 2019-03-20 Data processing equipment, imaging equipment, and data processing methods Active JP6808770B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019053674A JP6808770B2 (en) 2019-03-20 2019-03-20 Data processing equipment, imaging equipment, and data processing methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019053674A JP6808770B2 (en) 2019-03-20 2019-03-20 Data processing equipment, imaging equipment, and data processing methods

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016146320A Division JP6501732B2 (en) 2016-07-26 2016-07-26 Data processing apparatus, imaging apparatus, and control method of data processing apparatus

Publications (2)

Publication Number Publication Date
JP2019106215A true JP2019106215A (en) 2019-06-27
JP6808770B2 JP6808770B2 (en) 2021-01-06

Family

ID=67061393

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019053674A Active JP6808770B2 (en) 2019-03-20 2019-03-20 Data processing equipment, imaging equipment, and data processing methods

Country Status (1)

Country Link
JP (1) JP6808770B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003269917A (en) * 2002-03-15 2003-09-25 Sony Corp Method of measuring distance, instrument therefor, program therefor, recording medium therefor, and distance measuring instrument mounting type robot apparatus

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003269917A (en) * 2002-03-15 2003-09-25 Sony Corp Method of measuring distance, instrument therefor, program therefor, recording medium therefor, and distance measuring instrument mounting type robot apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
松尾琢也 他: "重み付きクロスバイラテラルフィルタによる奥行推定精度の向上", 映像情報メディア学会誌, vol. 66, no. 11, JPN6020021560, 2012, JP, pages 434 - 443, ISSN: 0004291509 *

Also Published As

Publication number Publication date
JP6808770B2 (en) 2021-01-06

Similar Documents

Publication Publication Date Title
JP5980294B2 (en) Data processing apparatus, imaging apparatus, and data processing method
US9288392B2 (en) Image capturing device capable of blending images and image processing method for blending images thereof
KR101364421B1 (en) System and method for generating robust depth maps utilizing a multi-resolution procedure
US9558543B2 (en) Image fusion method and image processing apparatus
JP5398156B2 (en) WHITE BALANCE CONTROL DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
JP6308748B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US11508038B2 (en) Image processing method, storage medium, image processing apparatus, learned model manufacturing method, and image processing system
JP6362068B2 (en) Distance measuring device, imaging device, distance measuring method, and program
JP2020166628A (en) Image processing method, image processing device, program, image processing system, and learned model manufacturing method
JP2015148532A (en) Distance measuring device, imaging apparatus, distance measuring method, and program
JP2016061609A (en) Distance measuring device, imaging apparatus, and distance measuring method
JP6838918B2 (en) Image data processing device and method
JP2016090568A (en) Distance measurement device, imaging device, and distance measurement method
JP2015207090A (en) Image processor, and control method thereof
CN114945943A (en) Estimating depth based on iris size
JP5927265B2 (en) Image processing apparatus and program
JP6501732B2 (en) Data processing apparatus, imaging apparatus, and control method of data processing apparatus
JP6808770B2 (en) Data processing equipment, imaging equipment, and data processing methods
US10565712B2 (en) Image processing apparatus and method for controlling the same
JP2017130106A (en) Data processing apparatus, imaging apparatus and data processing method
JP6514577B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND IMAGING APPARATUS
JP2017182668A (en) Data processor, imaging device, and data processing method
JP6570706B2 (en) Distance measuring device, imaging device, distance measuring method, and program
JP2016162376A (en) Image processor, imaging apparatus, and method for image processing
JP2015133532A (en) Imaging apparatus and image processing method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190419

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190419

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200525

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200623

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200731

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201209

R151 Written notification of patent or utility model registration

Ref document number: 6808770

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151