JP2013228798A - Image processing device, imaging device, endoscope, program and image processing method - Google Patents

Image processing device, imaging device, endoscope, program and image processing method Download PDF

Info

Publication number
JP2013228798A
JP2013228798A JP2012098841A JP2012098841A JP2013228798A JP 2013228798 A JP2013228798 A JP 2013228798A JP 2012098841 A JP2012098841 A JP 2012098841A JP 2012098841 A JP2012098841 A JP 2012098841A JP 2013228798 A JP2013228798 A JP 2013228798A
Authority
JP
Japan
Prior art keywords
image
evaluation value
pattern
unit
image signals
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012098841A
Other languages
Japanese (ja)
Inventor
Junichi Koga
隼一 古賀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Olympus Corp filed Critical Olympus Corp
Priority to JP2012098841A priority Critical patent/JP2013228798A/en
Publication of JP2013228798A publication Critical patent/JP2013228798A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device, an imaging device and the like that can perform image synthetic processing to even an image signal of low contrast by suppressing occurence of an artifact.SOLUTION: An image processing device 100 is configured to comprise: an image acquisition unit 110 that performs acquisition processing of a plurality of image signals; an evaluation value calculation unit 120 that performs calculation processing of an evaluation value on the basis of an acquired image signal; and an image synthetic unit 130 that performs synthetic processing of the plurality of image signals on the basis of the evaluation value. The image acquisition unit 110 acquires a plurality of image signals different in an in-focus object position, and acquires a plurality of pattern image signals different in an in-focus object position photographed by projecting a geometric pattern onto a subject. The evaluation value calculation unit 120 calculates a first evaluation value on the basis of the plurality of pattern image signals, and calculates a second evaluation value on the basis of the plurality of image signals. The image synthetic unit 130 performs comparison processing of the first evaluation value with the second evaluation value, and performs synthetic processing of the plurality of image signals on the basis of a result of the comparison processing.

Description

本発明は、画像処理装置、撮像装置、内視鏡、プログラム及び画像処理方法等に関係する。   The present invention relates to an image processing device, an imaging device, an endoscope, a program, an image processing method, and the like.

撮像装置を用いて、離れた位置に位置する2つの被写体を撮像した場合に、一方の被写体だけが合焦状態にあり、もう一方の被写体は合焦状態ではない場合がある。例えば、患部を発見又は観察するために内視鏡を用いる場面において、合焦状態ではない部分が映っていると、医師が患部を見逃す可能性が高くなる。そのため、このような場合には、撮像された画像に映る被写体が全て合焦状態にあることが望ましい。   In the case where two subjects located at distant positions are imaged using the imaging device, only one subject may be in focus and the other subject may not be in focus. For example, in a scene where an endoscope is used to discover or observe an affected area, if a portion that is not in focus is reflected, the possibility that a doctor misses the affected area increases. For this reason, in such a case, it is desirable that all subjects appearing in the captured image are in focus.

この時、撮像装置の絞りを調節することによって、被写界深度を調整する等して、両方の被写体を合焦状態とすることができる場合もある。しかし、2つの被写体の距離によっては、単純に被写界深度を調整しただけでは、両方の被写体を合焦状態とすることができないことがある。   At this time, there are cases where both subjects can be brought into focus, for example, by adjusting the aperture of the imaging device to adjust the depth of field. However, depending on the distance between the two subjects, it may not be possible to bring both subjects into focus by simply adjusting the depth of field.

このような場合でも、全焦点画像を取得するための手法として、例えば特許文献1に示される手法が開示されている。特許文献1に示される手法では、複数の画像信号の各画素に関して鮮鋭度(シャープネス)を算出し、その鮮鋭度から得られる第1の参照値を空間平滑化して第2の参照値を算出し、算出した第2の参照値に基づいて画像合成処理を行い、全焦点画像を取得する。   Even in such a case, for example, a technique disclosed in Patent Document 1 is disclosed as a technique for acquiring an omnifocal image. In the method disclosed in Patent Document 1, the sharpness is calculated for each pixel of a plurality of image signals, and the first reference value obtained from the sharpness is spatially smoothed to calculate the second reference value. Then, an image synthesis process is performed based on the calculated second reference value to obtain an omnifocal image.

特開2010−20758号公報JP 2010-20758 A

前述した特許文献1において示される従来技術では、複数の画像信号から鮮鋭度を算出し、その鮮鋭度から得られる参照値により合成画像を生成する。そのため、画像信号内のテクスチャが少ない領域、すなわちコントラストの低い被写体では、鮮鋭度や鮮鋭度から得られる合成画像を生成するための参照値が安定して算出できず、合成画像にアーチファクトが発生する場合がある。   In the prior art disclosed in Patent Document 1 described above, the sharpness is calculated from a plurality of image signals, and a composite image is generated based on a reference value obtained from the sharpness. For this reason, in a region with a low texture in the image signal, that is, a subject with low contrast, the sharpness and the reference value for generating a composite image obtained from the sharpness cannot be calculated stably, and artifacts occur in the composite image. There is a case.

本発明の幾つかの態様によれば、コントラストの低い画像信号でも、アーチファクトの発生を抑制して画像合成処理を行うことができる画像処理装置、撮像装置、内視鏡、プログラム及び画像処理方法等を提供することができる。   According to some aspects of the present invention, an image processing device, an imaging device, an endoscope, a program, an image processing method, and the like that can perform image composition processing while suppressing the occurrence of artifacts even with low-contrast image signals Can be provided.

本発明の一態様は、複数の画像信号の取得処理を行う画像取得部と、取得した前記画像信号に基づいて評価値の算出処理を行う評価値算出部と、前記評価値に基づいて前記複数の画像信号の合成処理を行う画像合成部と、を含み、前記画像取得部は、合焦物体位置の異なる前記複数の画像信号を撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された前記合焦物体位置の異なる複数のパターン画像信号を前記撮像部から取得し、前記評価値算出部は、前記複数のパターン画像信号に基づいて第1評価値を算出すると共に、前記複数の画像信号に基づいて第2評価値を算出し、前記画像合成部は、前記第1評価値と前記第2評価値との比較処理を行い、前記比較処理の結果に基づいて、前記複数の画像信号の前記合成処理を行うことを特徴とする画像処理装置に関係する。   One aspect of the present invention is an image acquisition unit that performs acquisition processing of a plurality of image signals, an evaluation value calculation unit that performs evaluation value calculation processing based on the acquired image signals, and the plurality of the plurality of image signals based on the evaluation values. An image synthesizing unit that performs image signal synthesizing processing, wherein the image acquisition unit acquires the plurality of image signals having different in-focus object positions from the imaging unit, and projects a geometric pattern on the subject to perform imaging The plurality of pattern image signals having different in-focus object positions are acquired from the imaging unit, and the evaluation value calculation unit calculates a first evaluation value based on the plurality of pattern image signals, and A second evaluation value is calculated based on an image signal, and the image composition unit performs a comparison process between the first evaluation value and the second evaluation value, and based on a result of the comparison process, the plurality of images Perform the above signal synthesis process It is related to the image processing apparatus according to claim.

本発明の一態様では、幾何パターンを投影して撮像された画像の信号から第1評価値を算出し、幾何パターンを投影せずに撮像された画像の信号から第2評価値を算出する。そして、算出した第1評価値及び第2評価値に基づいて、画像合成処理を行う。   In one aspect of the present invention, the first evaluation value is calculated from the signal of the image captured by projecting the geometric pattern, and the second evaluation value is calculated from the signal of the image captured without projecting the geometric pattern. Then, image composition processing is performed based on the calculated first evaluation value and second evaluation value.

これにより、コントラストの低い画像信号でも、アーチファクトの発生を抑制して画像合成処理を行うことができる。   As a result, even with an image signal having a low contrast, image synthesis processing can be performed while suppressing the occurrence of artifacts.

また、本発明の一態様では、前記評価値算出部は、前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に前記第1評価値を算出すると共に、前記複数の画像信号の前記合成対象画素毎に前記第2評価値を算出し、前記画像合成部は、前記合成対象画素毎に前記第1評価値と前記第2評価値との比較処理を行って、前記比較処理結果に基づいて、前記複数の画像信号の前記合成処理を前記合成対象画素毎に行ってもよい。   In the aspect of the invention, the evaluation value calculation unit may calculate the first evaluation value for each synthesis target pixel that is a pixel that is a target of the synthesis process in the plurality of pattern image signals, and The second evaluation value is calculated for each of the synthesis target pixels of the image signal, and the image synthesis unit performs a comparison process between the first evaluation value and the second evaluation value for each of the synthesis target pixels, Based on the comparison processing result, the synthesis processing of the plurality of image signals may be performed for each synthesis target pixel.

これにより、画像合成の対象となる画素に対して、第1評価値と第2評価値を算出することができ、全ての合成対象画素に対して比較処理を行って、例えば、画像の合焦状態等を判定して、より正確な画像合成処理を行うこと等が可能になる。   As a result, the first evaluation value and the second evaluation value can be calculated for the pixel to be image-combined, and comparison processing is performed on all the pixels to be combined, for example, focusing of the image It is possible to determine the state or the like and perform more accurate image composition processing.

また、本発明の一態様では、前記評価値算出部は、前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に、算出した前記第1評価値が所与の閾値以下であるか否かの判定処理を行い、前記第1評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に対して補間処理を行ってもよい。   In the aspect of the invention, the evaluation value calculation unit may provide the calculated first evaluation value for each combination target pixel that is a target of the combination process in the plurality of pattern image signals. If it is determined whether or not the threshold value is equal to or less than a threshold value, and it is determined that the first evaluation value is equal to or less than the given threshold value, an interpolation process may be performed on the first evaluation value.

これにより、例えばドットパターンが疎となる場合であっても、全ての合成対象画素について、画像合成処理の評価値として有効な第1評価値を求めること等が可能になる。   As a result, for example, even when the dot pattern is sparse, it is possible to obtain a first evaluation value that is effective as an evaluation value for image synthesis processing for all the synthesis target pixels.

また、本発明の一態様では、前記評価値算出部は、前記第1評価値が前記所与の閾値以下であると判定した場合に、前記補間処理として、0次補間処理及び線形補間処理、モルフォロジー膨張処理のうちのいずれかの処理を前記第1評価値に対して行ってもよい。   In one aspect of the present invention, when the evaluation value calculation unit determines that the first evaluation value is equal to or less than the given threshold, the interpolation process includes a zero-order interpolation process and a linear interpolation process, Any one of the morphological expansion processes may be performed on the first evaluation value.

これにより、画像合成処理の評価値として有効でないと判定された第1評価値を、同一のパターン画像信号から算出された他の第1評価値に基づいて補間すること等が可能になる。   Thereby, it is possible to interpolate the first evaluation value determined as not being effective as the evaluation value of the image composition processing based on the other first evaluation value calculated from the same pattern image signal.

また、本発明の一態様では、前記画像取得部は、前記複数のパターン画像信号を前記撮像部から取得すると共に、先に投影した前記幾何パターンと異なる幾何パターンを前記被写体に投影して撮像された複数の相補パターン画像信号を前記撮像部から取得し、前記評価値算出部は、前記複数のパターン画像信号から算出した前記第1評価値が、前記所与の閾値以下であると判定した前記合成対象画素に対して、前記複数の相補パターン画像に基づいて前記第1評価値を算出し直す処理を前記補間処理として行ってもよい。   In the aspect of the invention, the image acquisition unit acquires the plurality of pattern image signals from the imaging unit, and projects a geometric pattern different from the previously projected geometric pattern onto the subject. The plurality of complementary pattern image signals are acquired from the imaging unit, and the evaluation value calculation unit determines that the first evaluation value calculated from the plurality of pattern image signals is equal to or less than the given threshold value. Processing for recalculating the first evaluation value based on the plurality of complementary pattern images may be performed as the interpolation processing on the synthesis target pixel.

これにより、画像合成処理の評価値として有効でないと判定された第1評価値を、相補パターン画像信号から算出された同一の合成対象画素に対応する第1評価値に置換すること等が可能になる。   As a result, it is possible to replace the first evaluation value determined not to be effective as the evaluation value of the image composition processing with the first evaluation value corresponding to the same composition target pixel calculated from the complementary pattern image signal. Become.

また、本発明の一態様では、前記画像合成部は、前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に、算出した前記第2評価値が所与の閾値以下であるか否かの判定処理を行い、前記第2評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて前記合成処理を行い、前記第2評価値が前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記合成処理を行ってもよい。   In the aspect of the invention, the image synthesis unit may calculate the second evaluation value as a given threshold value for each synthesis target pixel that is a target of the synthesis process in the plurality of pattern image signals. If the second evaluation value is determined to be equal to or less than the given threshold value, the combining process is performed based on the first evaluation value, and the second evaluation value is determined based on the first evaluation value. When it is determined that the evaluation value is larger than the given threshold value, the combining process may be performed based on the second evaluation value.

これにより、第1評価値と第2評価値の中から有効な評価値を選択して、画像合成処理を行うこと等が可能になる。   Thereby, it is possible to select an effective evaluation value from the first evaluation value and the second evaluation value and perform image composition processing.

また、本発明の一態様では、前記画像合成部は、前記第2評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて画像合成係数を算出し、前記画像合成係数を用いて前記合成対象画素毎に前記合成処理を行い、前記第2評価値が前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記画像合成係数を算出し、前記画像合成係数を用いて前記合成対象画素毎に前記合成処理を行ってもよい。   In one aspect of the present invention, when the image synthesis unit determines that the second evaluation value is equal to or less than the given threshold value, the image synthesis unit calculates an image synthesis coefficient based on the first evaluation value. , Performing the synthesis process for each of the synthesis target pixels using the image synthesis coefficient, and determining that the second evaluation value is greater than the given threshold value, based on the second evaluation value, An image synthesis coefficient may be calculated, and the synthesis process may be performed for each synthesis target pixel using the image synthesis coefficient.

これにより、例えば合焦領域と非合焦領域の切り替わり部分を滑らかに合成すること等が可能になる。   Thereby, for example, it is possible to smoothly synthesize a switching portion between the in-focus area and the out-of-focus area.

また、本発明の一態様では、前記画像取得部は、第1の画像信号と、前記第1の画像信号と前記合焦物体位置の異なる第2の画像信号とを前記撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された第1のパターン画像信号と、前記第1のパターン画像信号と前記合焦物体位置の異なる第2のパターン画像信号とを前記撮像部から取得し、前記評価値算出部は、前記合成処理の対象となる画素である合成対象画素毎に、前記第1のパターン画像信号と前記第2のパターン画像信号についての前記第1評価値を算出すると共に、前記第1の画像信号と前記第2の画像信号についての前記第2評価値を算出し、前記画像合成部は、前記合成対象画素毎に、前記第1の画像信号と前記第2の画像信号についての前記第2評価値が共に所与の閾値以下であるか否かの判定処理を行い、前記第2評価値が共に前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて前記第1の画像信号と前記第2の画像信号の前記合成処理を行い、前記第2評価値が共に前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記第1の画像信号と前記第2の画像信号の前記合成処理を行ってもよい。   In the aspect of the invention, the image acquisition unit acquires the first image signal and the first image signal and the second image signal having a different focused object position from the imaging unit. Acquiring a first pattern image signal captured by projecting a geometric pattern onto a subject, a first pattern image signal and a second pattern image signal having a different focused object position from the imaging unit; The evaluation value calculation unit calculates the first evaluation value for the first pattern image signal and the second pattern image signal for each synthesis target pixel that is a pixel that is a target of the synthesis process, and The second evaluation value for the first image signal and the second image signal is calculated, and the image synthesis unit is configured to calculate the first image signal and the second image signal for each synthesis target pixel. The second evaluation value for If it is determined whether or not both of the second evaluation values are equal to or less than the given threshold, the first evaluation value is determined based on the first evaluation value. When the image signal and the second image signal are combined, and when it is determined that both the second evaluation values are larger than the given threshold, the first evaluation value is based on the second evaluation value. The combining process of the image signal and the second image signal may be performed.

これにより、2つの画像信号と2つのパターン画像信号を取得する場合にも、第1評価値と第2評価値の中から有効な評価値を選択して、画像合成処理を行うこと等が可能になる。   As a result, even when two image signals and two pattern image signals are acquired, it is possible to select an effective evaluation value from the first evaluation value and the second evaluation value and perform image composition processing, etc. become.

また、本発明の一態様では、前記評価値算出部は、前記複数のパターン画像信号の輝度値を前記第1評価値として算出してもよい。   In the aspect of the invention, the evaluation value calculation unit may calculate a luminance value of the plurality of pattern image signals as the first evaluation value.

これにより、例えば画像合成処理において有効なコントラスト等を算出できない場合であっても、画像合成処理に用いる他の評価値を算出すること等が可能になる。   As a result, for example, even when effective contrast or the like cannot be calculated in the image composition process, it is possible to calculate other evaluation values used for the image composition process.

また、本発明の一態様では、前記評価値算出部は、前記複数の画像信号のコントラスト又はエッジ成分を表す前記第2評価値を算出してもよい。   In the aspect of the invention, the evaluation value calculation unit may calculate the second evaluation value representing a contrast or an edge component of the plurality of image signals.

これにより、画像のコントラスト又はエッジ成分に基づいて、画像合成処理を行うこと等が可能になる。   This makes it possible to perform image composition processing based on the contrast or edge component of the image.

また、本発明の一態様では、前記画像取得部は、光学劣化関数に基づいて設定された前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得してもよい。   In the aspect of the invention, the image acquisition unit may acquire the plurality of pattern image signals captured by projecting the geometric pattern set based on an optical degradation function from the imaging unit. .

これにより、幾何パターンが投影されている各画素位置の合焦状態を、パターン画像の輝度値に基づいて評価すること等が可能になる。   This makes it possible to evaluate the in-focus state of each pixel position on which the geometric pattern is projected based on the luminance value of the pattern image.

また、本発明の一態様では、前記画像取得部は、前記光学劣化関数に基づいて、ぼけ半径Rに対してドット間距離dがd≧2R(d及びRは正の整数)となるように設定されたドットパターンを投影して撮像された前記複数のパターン画像信号を取得してもよい。   In one aspect of the present invention, the image acquisition unit is configured such that the inter-dot distance d is d ≧ 2R with respect to the blur radius R based on the optical degradation function (d and R are positive integers). The plurality of pattern image signals captured by projecting the set dot pattern may be acquired.

これにより、ドットが重ならないように被写体にドットパターンを投影すること等が可能になる。   This makes it possible to project a dot pattern onto the subject so that the dots do not overlap.

また、本発明の一態様では、前記画像取得部は、コヒーレント光源と光空間変調器とを用いて前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得してもよい。   In one aspect of the present invention, the image acquisition unit acquires, from the imaging unit, the plurality of pattern image signals captured by projecting the geometric pattern using a coherent light source and a spatial light modulator. Also good.

これにより、明瞭な任意の幾何パターンが映されたパターン画像信号を取得すること等が可能になる。   This makes it possible to acquire a pattern image signal in which a clear arbitrary geometric pattern is reflected.

また、本発明の一態様では、前記画像取得部は、非可視波長の前記コヒーレント光源と前記光空間変調器とを用いて前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得してもよい。   In one aspect of the present invention, the image acquisition unit outputs the plurality of pattern image signals captured by projecting the geometric pattern using the coherent light source having an invisible wavelength and the spatial light modulator. You may acquire from an imaging part.

これにより、近点画像と同じタイミングに撮像された近点パターン画像のパターン画像信号と、遠点画像と同じタイミングに撮像された遠点パターン画像のパターン画像信号とを取得すること等が可能になる。   This makes it possible to acquire the pattern image signal of the near point pattern image captured at the same timing as the near point image and the pattern image signal of the far point pattern image captured at the same timing as the far point image. Become.

また、本発明の他の態様は、前記画像処理装置と、前記撮像部と、前記被写体に対して前記幾何パターンを投影するパターン投影部と、を含む撮像装置に関係する。   Another aspect of the invention relates to an imaging device including the image processing device, the imaging unit, and a pattern projection unit that projects the geometric pattern onto the subject.

また、本発明の他の態様は、前記画像処理装置と、前記撮像部と、前記被写体に対して前記幾何パターンを投影するパターン投影部と、を含む内視鏡に関係する。   Another aspect of the present invention relates to an endoscope including the image processing device, the imaging unit, and a pattern projection unit that projects the geometric pattern onto the subject.

また、本発明の他の態様は、上記各部としてコンピューターを機能させるプログラムに関係する。   Moreover, the other aspect of this invention is related with the program which functions a computer as said each part.

また、本発明の他の態様は、合焦物体位置の異なる複数の画像信号を撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された前記合焦物体位置の異なる複数のパターン画像信号を前記撮像部から取得し、前記複数のパターン画像信号に基づいて第1評価値を算出すると共に、前記複数の画像信号に基づいて第2評価値を算出し、前記第1評価値と前記第2評価値との比較処理を行い、前記比較処理の結果に基づいて、前記複数の画像信号の合成処理を行うことを特徴とする画像処理方法に関係する。   According to another aspect of the present invention, a plurality of image signals with different in-focus object positions are acquired from an imaging unit, and a plurality of pattern images with different in-focus object positions are captured by projecting a geometric pattern onto a subject. A signal is acquired from the imaging unit, a first evaluation value is calculated based on the plurality of pattern image signals, a second evaluation value is calculated based on the plurality of image signals, and the first evaluation value and the The present invention relates to an image processing method characterized in that a comparison process with a second evaluation value is performed, and a synthesis process of the plurality of image signals is performed based on a result of the comparison process.

本実施形態のシステム構成例。The system configuration example of this embodiment. 図2(A)〜図2(C)は、画像信号の説明図。2A to 2C are explanatory diagrams of image signals. 図3(A)〜図3(C)は、パターン画像信号の説明図。FIG. 3A to FIG. 3C are explanatory diagrams of pattern image signals. 図4(A)〜図4(C)は、幾何パターンの説明図。FIG. 4A to FIG. 4C are explanatory diagrams of geometric patterns. 図5(A)〜図5(C)は、画像合成処理の説明図。FIG. 5A to FIG. 5C are explanatory diagrams of image composition processing. 画像合成処理結果の一例。An example of an image composition process result. 本実施形態の処理の流れを説明するフローチャート。The flowchart explaining the flow of a process of this embodiment. 補間処理の流れを詳細に説明するフローチャート。The flowchart explaining the flow of an interpolation process in detail. 画像合成処理の流れを詳細に説明するフローチャート。The flowchart explaining the flow of an image synthesis process in detail.

以下、本実施形態について説明する。まず、本実施形態の概要を説明し、次にシステム構成例について説明する。そして、フローチャート等を用いて本実施形態で行う処理の詳細について詳細に説明する。最後に、本実施形態の手法についてまとめる。なお、以下に説明する本実施形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また本実施形態で説明される構成の全てが、本発明の必須構成要件であるとは限らない。   Hereinafter, this embodiment will be described. First, an overview of the present embodiment will be described, and then a system configuration example will be described. Details of processing performed in this embodiment will be described in detail with reference to flowcharts and the like. Finally, the technique of this embodiment will be summarized. In addition, this embodiment demonstrated below does not unduly limit the content of this invention described in the claim. In addition, all the configurations described in the present embodiment are not necessarily essential configuration requirements of the present invention.

1.概要
撮像装置を用いて、離れた位置に位置する2つの被写体を撮像した場合に、一方の被写体だけが合焦状態にあり、もう一方の被写体は合焦状態ではない場合がある。例えば、患部を発見又は観察するために内視鏡を用いる場面において、合焦状態ではない部分が映っていると、医師が患部を見逃す可能性が高くなる。そのため、このような場合には、撮像された画像に映る被写体が全て合焦状態にあることが望ましい。
1. Outline When an image pickup apparatus is used to image two subjects located at distant positions, only one subject may be in focus and the other subject may not be in focus. For example, in a scene where an endoscope is used to discover or observe an affected area, if a portion that is not in focus is reflected, the possibility that a doctor misses the affected area increases. For this reason, in such a case, it is desirable that all subjects appearing in the captured image are in focus.

この時、撮像装置の絞りを調節することによって、被写界深度を調整する等して、両方の被写体を合焦状態とすることができる場合もある。しかし、2つの被写体の距離によっては、単純に被写界深度を調整しただけでは、両方の被写体を合焦状態とすることができないことがある。具体的には、2つの被写体の距離が所定の閾値以下であれば、被写界深度を調整するだけでも対応することができるが、所定の閾値よりも距離が離れている場合には、被写界深度を調整するだけでは対応しきれなくなる。   At this time, there are cases where both subjects can be brought into focus, for example, by adjusting the aperture of the imaging device to adjust the depth of field. However, depending on the distance between the two subjects, it may not be possible to bring both subjects into focus by simply adjusting the depth of field. Specifically, if the distance between two subjects is equal to or smaller than a predetermined threshold, it can be dealt with only by adjusting the depth of field, but if the distance is larger than the predetermined threshold, Just adjusting the depth of field is not enough.

このような場合でも、全焦点画像を取得するための手法として、例えば上述の特許文献1に示される手法が開示されている。特許文献1に示される手法では、複数の画像信号の各画素に関して鮮鋭度(シャープネス)を算出し、その鮮鋭度から得られる第1の参照値を空間平滑化して第2の参照値を算出し、算出した第2の参照値に基づいて画像合成処理を行い、全焦点画像を取得する。   Even in such a case, as a technique for acquiring an omnifocal image, for example, the technique disclosed in Patent Document 1 is disclosed. In the method disclosed in Patent Document 1, the sharpness is calculated for each pixel of a plurality of image signals, and the first reference value obtained from the sharpness is spatially smoothed to calculate the second reference value. Then, an image synthesis process is performed based on the calculated second reference value to obtain an omnifocal image.

しかし、前述した特許文献1において示される従来技術では、画像信号内のテクスチャが少ない領域、すなわちコントラストの低い被写体では、鮮鋭度や第1の参照値、第2の参照値が安定して算出できず、合成画像にアーチファクトが発生する場合がある。ここで、アーチファクトとは、画像信号の生成(合成)段階で発生したデータの歪みやノイズ等を指す。   However, in the conventional technique disclosed in Patent Document 1 described above, the sharpness, the first reference value, and the second reference value can be stably calculated in a region where the texture in the image signal is small, that is, an object with low contrast. In some cases, artifacts may occur in the composite image. Here, the artifact refers to data distortion, noise, and the like generated at the generation (synthesis) stage of the image signal.

そこで、本実施形態の画像処理装置等は、被写体に幾何パターンを投影し、パターン投影された画像(パターン画像)の輝度値に基づいて、合成画像を生成するための評価値を算出する。すなわち、被写体に幾何パターンを投影して、意図的に輝度変化を発生させたパターン画像を用いて画像合成処理を行う。以上のような処理を行うことで、テクスチャが少ない領域、すなわちコントラストの低い被写体においても安定して合成画像を生成するための評価値が算出でき、より高品位な合成画像を生成することができる。   Therefore, the image processing apparatus or the like according to the present embodiment projects a geometric pattern onto a subject, and calculates an evaluation value for generating a composite image based on the luminance value of the pattern-projected image (pattern image). In other words, image composition processing is performed using a pattern image in which a geometric pattern is projected onto a subject and a luminance change is intentionally generated. By performing the processing as described above, it is possible to calculate an evaluation value for stably generating a composite image even in an area with less texture, that is, a low-contrast subject, and it is possible to generate a higher-quality composite image. .

さらに具体的に言えば、例えば前述した内視鏡を用いて患部を発見又は観察する場面に本実施形態を適用する場合には、合成画像として全焦点画像を生成すること等ができる。これによれば、医師等が体内をより観察しやすい画像を生成することができ、患部の見落とし等を防止すること等が可能になる。   More specifically, for example, when the present embodiment is applied to a scene where the affected part is found or observed using the endoscope described above, an omnifocal image can be generated as a composite image. According to this, it is possible to generate an image that makes it easier for a doctor or the like to observe the inside of the body, and it is possible to prevent oversight of the affected area.

2.システム構成例
次に、図1に本実施形態の画像処理装置100及びこれを含む撮像装置(内視鏡)400の構成例を示す。
2. System Configuration Example Next, FIG. 1 shows a configuration example of an image processing apparatus 100 of the present embodiment and an imaging apparatus (endoscope) 400 including the same.

画像処理装置100は、画像取得部110と、評価値算出部120と、画像合成部130と、を含む。また、画像処理装置100を含む撮像装置400の例としては、撮像部200や、パターン投影部300などを含む内視鏡400などが挙げられる。なお、画像処理装置100及びこれを含む撮像装置(内視鏡)400は、図1の構成に限定されず、これらの一部の構成要素を省略したり、他の構成要素を追加したりするなどの種々の変形実施が可能である。   The image processing apparatus 100 includes an image acquisition unit 110, an evaluation value calculation unit 120, and an image composition unit 130. Examples of the imaging apparatus 400 including the image processing apparatus 100 include an imaging unit 200, an endoscope 400 including a pattern projection unit 300, and the like. Note that the image processing apparatus 100 and the imaging apparatus (endoscope) 400 including the image processing apparatus 100 are not limited to the configuration in FIG. 1, and some of these components are omitted or other components are added. Various modifications such as these are possible.

次に各部の接続について説明する。画像取得部110は、評価値算出部120と画像合成部130とに接続されている。評価値算出部120は、画像合成部130に接続されている。撮像部200は、画像取得部110に接続されている。   Next, the connection of each part is demonstrated. The image acquisition unit 110 is connected to the evaluation value calculation unit 120 and the image composition unit 130. The evaluation value calculation unit 120 is connected to the image composition unit 130. The imaging unit 200 is connected to the image acquisition unit 110.

次に各部で行われる処理の概要と構成について説明する。   Next, the outline and configuration of processing performed in each unit will be described.

まず、画像取得部110は、撮像部200から複数の画像信号を取得する処理を行う。画像取得部110は、画像信号としてアナログ信号を取得してもよいし、デジタル信号を取得してもよい。また、画像取得部110は、撮像部200とのI/F部(通信部)であってもよい。I/F部(通信部)は、有線又は内部バスにより通信を行うものであってもよく、無線により通信を行うものであってもよい。   First, the image acquisition unit 110 performs processing for acquiring a plurality of image signals from the imaging unit 200. The image acquisition unit 110 may acquire an analog signal as an image signal, or may acquire a digital signal. The image acquisition unit 110 may be an I / F unit (communication unit) with the imaging unit 200. The I / F unit (communication unit) may perform communication using a wired or internal bus, or may perform communication wirelessly.

次に、評価値算出部120は、取得した画像信号に基づいて評価値の算出処理を行う。   Next, the evaluation value calculation unit 120 performs evaluation value calculation processing based on the acquired image signal.

そして、画像合成部130は、評価値に基づいて複数の画像信号の合成処理を行う。   Then, the image composition unit 130 performs composition processing of a plurality of image signals based on the evaluation value.

なお、評価値算出部120と、画像合成部130の機能は、各種プロセッサー(CPU等)、ASIC(ゲートアレイ等)などのハードウェアや、プログラムなどにより実現できる。また、画像処理装置100は、上記の構成要素の他にも、図示しないバッファや記憶部、出力部(提示部)等を含んでも良い。   The functions of the evaluation value calculation unit 120 and the image composition unit 130 can be realized by hardware such as various processors (CPU or the like), ASIC (gate array or the like), a program, or the like. In addition to the above-described components, the image processing apparatus 100 may include a buffer, a storage unit, an output unit (presentation unit), and the like (not shown).

また撮像部200は、図示しない光学系、絞り、撮像素子、合焦物体位置制御部等から構成される。撮像部200では、合焦物体位置制御部により、光学系、絞り及び撮像素子を制御して、合焦物体位置の異なる複数の画像を撮像する。さらに、撮像部200は、図示しない前処理部等を含んでもよい。前処理部は、撮像した画像をデジタル信号に変換する処理等を行ってもよい。   The imaging unit 200 includes an optical system (not shown), an aperture, an imaging device, a focused object position control unit, and the like. In the imaging unit 200, the focused object position control unit controls the optical system, the diaphragm, and the imaging device, and captures a plurality of images with different focused object positions. Furthermore, the imaging unit 200 may include a preprocessing unit (not shown) and the like. The preprocessing unit may perform processing for converting a captured image into a digital signal.

さらに、パターン投影部300は、被写体に対して幾何パターン(パターン光)を投影する。パターン投影部300は、図示しないコヒーレント光源と光空間変調器から構成されていてもよい。コヒーレント光源は、例えばレーザ光であり、干渉性が高く、回折格子を通過すると明瞭な回折格子に基づくパターンが形成される。光空間変調器は、例えばLCD(Liquid Crystal Display)であり、回折格子として作用する任意の幾何パターンを瞬時に形成することができる。パターン投影部300を前記のように構成することで明瞭な任意の幾何パターンを瞬時に投影することができる。なお、コヒーレント光源に非可視光波長を用い、撮像素子に非可視光用の受光部を付加する構成としてもよい。   Furthermore, the pattern projection unit 300 projects a geometric pattern (pattern light) onto the subject. The pattern projection unit 300 may include a coherent light source and a spatial light modulator (not shown). The coherent light source is, for example, a laser beam, and has a high coherence. When the coherent light source passes through the diffraction grating, a clear pattern based on the diffraction grating is formed. The spatial light modulator is, for example, an LCD (Liquid Crystal Display), and can form an arbitrary geometric pattern that acts as a diffraction grating instantly. By configuring the pattern projection unit 300 as described above, a clear arbitrary geometric pattern can be projected instantaneously. In addition, it is good also as a structure which uses a non-visible light wavelength for a coherent light source, and adds the light-receiving part for non-visible light to an image pick-up element.

3.処理の詳細
以下では、図7のフローチャートを参照しながら、本実施形態の処理の流れについて説明する。
3. Details of Processing Hereinafter, the processing flow of the present embodiment will be described with reference to the flowchart of FIG.

まず、画像取得部110は、撮像部200から複数の画像信号を取得する(S101)。画像取得部110が取得する画像信号は、本実施形態では2つとするが、3つ以上の任意の数の画像信号を取得してもよい。これらの画像信号は画角が変化しないよう、光学系にテレセントリック光学系を用いたり、幾何変換処理等を行って画角を合わせたりすることが望ましい。後述するステップS102のパターン画像信号についても同様である。   First, the image acquisition unit 110 acquires a plurality of image signals from the imaging unit 200 (S101). In the present embodiment, two image signals are acquired by the image acquisition unit 110, but an arbitrary number of three or more image signals may be acquired. It is desirable to use a telecentric optical system for the optical system or adjust the angle of view by performing a geometric transformation process or the like so that the angle of view of these image signals does not change. The same applies to the pattern image signal in step S102 described later.

また、ステップS101では、画像取得部110は、互いに合焦物体位置が異なる画像信号を取得する。具体的に、画像取得部110は、図2(A)に示すようにして撮像部200が撮像した画像を取得する。   In step S101, the image acquisition unit 110 acquires image signals having different in-focus object positions. Specifically, the image acquisition unit 110 acquires an image captured by the imaging unit 200 as illustrated in FIG.

まず前提として、図2(A)に示すように、被写体SB1と被写体SB2が異なる位置にある。この時に、撮像部200は、合焦物体位置制御部にて光学系、絞り及び撮像素子を制御して、合焦物体位置を被写体SB1に合わせて、図2(B)に示すような画像を取得し、さらに合焦物体位置を被写体SB2に合わせて、図2(C)に示すような画像を取得する。   First, as a premise, the subject SB1 and the subject SB2 are at different positions as shown in FIG. At this time, the imaging unit 200 controls the optical system, the diaphragm, and the imaging device by the focused object position control unit, and aligns the focused object position with the subject SB1, and displays an image as shown in FIG. Further, an image as shown in FIG. 2C is acquired by aligning the focused object position with the subject SB2.

以下では、図2(B)の画像IM1を近点画像(第1の画像)IM1と呼び、図2(C)の画像IM2を遠点画像(第2の画像)IM2と呼ぶ。近点画像(第1の画像)IM1は、図2(C)の画像IM2が撮像された時よりも、撮像部200と近い位置(被写体SB1の位置)に合焦物体位置が合わせられた時に撮像された画像である。一方、遠点画像(第2の画像)IM2は、図2(B)の画像IM1が撮像された時よりも、撮像部200と遠い位置(被写体SB2の位置)に合焦物体位置が合わせられた時に撮像された画像である。   Hereinafter, the image IM1 in FIG. 2B is referred to as a near point image (first image) IM1, and the image IM2 in FIG. 2C is referred to as a far point image (second image) IM2. The near-point image (first image) IM1 is when the focused object position is adjusted to a position closer to the imaging unit 200 (position of the subject SB1) than when the image IM2 in FIG. 2C is captured. This is a captured image. On the other hand, the far-point image (second image) IM2 has its focused object position aligned with a position (the position of the subject SB2) farther from the imaging unit 200 than when the image IM1 in FIG. This is an image taken at the time of shooting.

また、図2(B)及び図2(C)に示すように、近点画像IM1及び遠点画像IM2内には、光学系による被写界深度の制限により、合焦領域と非合焦領域が存在している。合焦領域では、被写体SB1及び被写体SB2に記載された文字「A」がはっきり映し出されており(図2(B)では右側領域)、非合焦領域では、文字「A」がぼやけて映し出されている(図2(B)では左側領域)。本来であれば、被写体SB1と被写体SB2に記載された文字「A」がどちらもはっきりと映し出された全焦点画像を取得できることが望ましいが、本例では、前述した被写界深度の制限により、被写界深度や合焦物体位置等を調整しただけでは、全焦点画像を取得することができない。そのため、以下の方法により、全焦点画像を画像合成処理によって生成する。   Further, as shown in FIGS. 2B and 2C, in the near-point image IM1 and the far-point image IM2, the in-focus area and the out-of-focus area are limited by the depth of field by the optical system. Is present. In the in-focus area, the letter “A” written on the subject SB1 and the subject SB2 is clearly projected (the right-side area in FIG. 2B), and in the out-of-focus area, the letter “A” is projected in a blurred manner. (The left region in FIG. 2B). Originally, it is desirable to be able to acquire an omnifocal image in which both of the characters “A” written on the subject SB1 and the subject SB2 are clearly projected, but in this example, due to the limitation of the depth of field described above, An omnifocal image cannot be acquired simply by adjusting the depth of field and the position of the focused object. Therefore, an omnifocal image is generated by image synthesis processing by the following method.

次に、画像取得部110は、互いに合焦物体位置が異なる複数のパターン画像信号を取得する(S102)。具体的に、画像取得部110は、図3(A)に示すようにして撮像部200が撮像した画像を取得する。   Next, the image acquisition unit 110 acquires a plurality of pattern image signals having different in-focus object positions (S102). Specifically, the image acquisition unit 110 acquires an image captured by the imaging unit 200 as illustrated in FIG.

図3(A)の被写体SB1及び被写体SB2の位置等は、図2(A)と同様であるが、被写体SB1及び被写体SB2に対してパターン投影部300が幾何パターンを投影した時に、撮像部200が被写体を撮像する点が図2(A)と異なる。その結果、撮像されたパターン画像は、図3(B)及び図3(C)のようになる。また本来であれば、ステップS102では、ステップS101において画像を撮像した時と同じタイミングで、かつ同じ被写体を映したパターン画像、すなわち同じシーンを映したパターン画像を取得できることが望ましい。そのため、ステップS101の処理後できるだけ早くステップS102の処理を行うことが望ましい。   The positions of the subject SB1 and the subject SB2 in FIG. 3A are the same as those in FIG. 2A, but when the pattern projection unit 300 projects a geometric pattern onto the subject SB1 and the subject SB2, the imaging unit 200 2 differs from FIG. 2A in that it captures the subject. As a result, the captured pattern image is as shown in FIG. 3 (B) and FIG. 3 (C). Originally, in step S102, it is desirable to be able to acquire a pattern image showing the same subject, that is, a pattern image showing the same scene, at the same timing as when the image was captured in step S101. Therefore, it is desirable to perform the process of step S102 as soon as possible after the process of step S101.

以下では、図3(B)の画像IM3を近点パターン画像(第1のパターン画像)IM3と呼び、図3(C)の画像IM4を遠点パターン画像(第2のパターン画像)IM4と呼ぶ。近点パターン画像(第1のパターン画像)IM3は、図3(C)の画像IM4が撮像された時よりも、撮像部200と近い位置(被写体SB1の位置)に合焦物体位置が合わせられた時に撮像された画像である。一方、遠点パターン画像(第2のパターン画像)IM4は、図3(B)の画像IM3が撮像された時よりも、撮像部200と遠い位置(被写体SB2の位置)に合焦物体位置が合わせられた時に撮像された画像である。   In the following, the image IM3 in FIG. 3B is referred to as a near point pattern image (first pattern image) IM3, and the image IM4 in FIG. 3C is referred to as a far point pattern image (second pattern image) IM4. . In the near point pattern image (first pattern image) IM3, the focused object position is adjusted to a position closer to the imaging unit 200 (position of the subject SB1) than when the image IM4 in FIG. 3C is captured. This is an image taken at the time of shooting. On the other hand, the far-point pattern image (second pattern image) IM4 has a focused object position at a position farther from the imaging unit 200 (position of the subject SB2) than when the image IM3 in FIG. It is the image imaged when it was put together.

さらに、図3(B)及び図3(C)に示すように、近点パターン画像IM3及び遠点パターン画像IM4内には、近点画像及び遠点画像と同様に、合焦領域と非合焦領域が存在している。合焦領域では、投影された幾何パターンがはっきり映し出されており(図3(B)では右側領域)、非合焦領域では、投影された幾何パターンがぼやけて映し出されている(図3(B)では左側領域)。そのため、パターンの投影されている各画素位置が被写界深度内か否か、つまり各画素位置の合焦状態を、パターン画像の輝度値に基づいて評価(判定)できる。なお、実際には、被写体SB1及び被写体SB2に記載された文字「A」に幾何パターンが投影された部分では、文字「A」の一部分も映し出されるが、図3(B)及び図3(C)では、図示の都合上省略している。   Further, as shown in FIG. 3B and FIG. 3C, the near-point pattern image IM3 and the far-point pattern image IM4 are not focused on the in-focus area as in the near-point image and far-point image. A focal area exists. In the in-focus area, the projected geometric pattern is clearly shown (the right area in FIG. 3B), and in the out-of-focus area, the projected geometric pattern is shown in a blurred manner (FIG. 3B ) In the left area). Therefore, whether or not each pixel position on which the pattern is projected is within the depth of field, that is, the focused state of each pixel position can be evaluated (determined) based on the luminance value of the pattern image. Actually, in the portion where the geometric pattern is projected onto the character “A” described in the subject SB1 and the subject SB2, a part of the character “A” is also displayed, but FIG. 3B and FIG. ) Is omitted for the sake of illustration.

また、具体的に内視鏡で上記のパターン画像を撮像するシーンでは、外光の影響がないため、撮像時に幾何パターンのみを投影した場合、明瞭なパターン画像信号が得られる。内視鏡での撮像シーンにはコントラストの低い被写体、テクスチャの少ない領域が含まれる場合も多く、暗闇での撮像となることが多い。そのため投影した幾何パターンが明瞭に得られ、本実施形態の手法が特に有効なシーンである。   In addition, in a scene where the above pattern image is specifically captured by an endoscope, there is no influence of external light. Therefore, when only a geometric pattern is projected at the time of imaging, a clear pattern image signal is obtained. In many cases, an imaging scene with an endoscope includes a low-contrast subject and an area with little texture, and imaging is often performed in the dark. Therefore, the projected geometric pattern can be obtained clearly, and the method of this embodiment is a particularly effective scene.

ここで、投影する幾何パターンの一例としてドットパターンPIMを図4(A)に示す。前述した図2(A)〜図2(C)及び図3(A)〜図3(C)の例においても、ドットパターンを投影している。なお、投影する幾何パターンは、ドットパターンに限ったものではなく、格子パターンや図4(B)に示すようなラインパターンPIM2、図4(C)に示すようなランダムパターンPIM3等の任意の幾何パターンを投影してもよい。また、幾何パターンの決定方法については、後述する。   Here, a dot pattern PIM is shown in FIG. 4A as an example of a geometric pattern to be projected. In the above-described examples of FIGS. 2A to 2C and FIGS. 3A to 3C, the dot pattern is projected. The projected geometric pattern is not limited to the dot pattern, but can be any geometric pattern such as a lattice pattern, a line pattern PIM2 as shown in FIG. 4B, a random pattern PIM3 as shown in FIG. A pattern may be projected. The method for determining the geometric pattern will be described later.

次に、評価値算出部120は、近点パターン画像信号及び遠点パターン画像信号に基づいて、各合成対象画素について第1評価値を算出する(S103)。具体的に第1評価値は、近点パターン画像信号及び遠点パターン画像信号の輝度値とする。   Next, the evaluation value calculation unit 120 calculates a first evaluation value for each synthesis target pixel based on the near point pattern image signal and the far point pattern image signal (S103). Specifically, the first evaluation value is a luminance value of the near point pattern image signal and the far point pattern image signal.

同様に、評価値算出部120は、近点画像信号及び遠点画像信号に基づいて、各合成対象画素について第2評価値を算出する(S104)。具体的に第2評価値は、画像信号のコントラスト又はエッジ成分とする。   Similarly, the evaluation value calculation unit 120 calculates a second evaluation value for each synthesis target pixel based on the near point image signal and the far point image signal (S104). Specifically, the second evaluation value is the contrast or edge component of the image signal.

例えば、第2評価値としてコントラストを用いる場合には、算出対象の画素位置を中心とした所定の領域内において式(1)を用いて算出する。   For example, when contrast is used as the second evaluation value, calculation is performed using Expression (1) within a predetermined region centered on the pixel position to be calculated.

なお、Cはコントラスト、Imaxは所定の領域内の最大の輝度値(画素値)、Iminは所定領域内の最小の輝度値(画素値)である。また、第2評価値としてエッジ成分を用いる場合は、例えばソーベルフィルタやラプラシアンフィルタといった既存のエッジ抽出フィルタによるエッジ成分を算出する。 C is the contrast, I max is the maximum luminance value (pixel value) in the predetermined area, and I min is the minimum luminance value (pixel value) in the predetermined area. When an edge component is used as the second evaluation value, an edge component by an existing edge extraction filter such as a Sobel filter or a Laplacian filter is calculated.

ここで、近点パターン画像及び遠点パターン画像の各画素の輝度値である第1評価値は、光学劣化関数に従って、各画像の合焦領域では非合焦領域に比べて高い値となり、非合焦領域では合焦領域に比べて低い値となる。また、投影する幾何パターンが疎であるため、近点パターン画像及び遠点パターン画像も疎となり、幾何パターンの影響がない画素(例えば、図3(B)の近点パターン画像IM3の黒色部分の画素P1)が存在する。   Here, the first evaluation value, which is the luminance value of each pixel of the near point pattern image and the far point pattern image, is higher in the focused area of each image than the unfocused area according to the optical degradation function. The in-focus area has a lower value than the in-focus area. Further, since the projected geometric pattern is sparse, the near-point pattern image and the far-point pattern image are also sparse, and pixels that are not affected by the geometric pattern (for example, the black portion of the near-point pattern image IM3 in FIG. 3B). There is a pixel P1).

このような幾何パターンの影響がない画素では、近点パターン画像と遠点パターン画像とで、第1評価値が(ほぼ)同じ値になってしまい、算出した第1評価値を用いても、当該画素が合焦状態であるか、非合焦状態であるか判断することができない。   In a pixel that is not affected by such a geometric pattern, the first evaluation value becomes (almost) the same in the near point pattern image and the far point pattern image, and even if the calculated first evaluation value is used, It cannot be determined whether the pixel is in focus or out of focus.

具体例を挙げて説明する。例えば、図3(B)の近点パターン画像IM3の黒色部分の画素P1と白色部分の画素P3は、どちらも非合焦状態である。一方、図3(C)の遠点パターン画像IM4の黒色部分において、画素P1に対応する位置にある画素P2と、画素P3に対応する位置にある画素P4は、どちらも合焦状態である。この時に、画素P3から求められた第1評価値vP3と、画素P4から求められた第1評価値vP4とを比較すると、vP3≦Th≦vP4(Thは所定の閾値)となり、画素P4が合焦状態であり、画素P3が非合焦状態であると判定できる。しかし、画素P1から求められた第1評価値vP1と、画素P2から求められた第1評価値vP2は(ほぼ)同じ値になってしまい、これらの値を比較しても、画素P1と画素P2が合焦状態であるか、非合焦状態であるか判断することができない。 A specific example will be described. For example, the black portion pixel P1 and the white portion pixel P3 of the near point pattern image IM3 in FIG. 3B are both out of focus. On the other hand, in the black portion of the far point pattern image IM4 in FIG. 3C, the pixel P2 at the position corresponding to the pixel P1 and the pixel P4 at the position corresponding to the pixel P3 are both in focus. At this time, when the first evaluation value v P3 obtained from the pixel P3 is compared with the first evaluation value v P4 obtained from the pixel P4, v P3 ≦ Th ≦ v P4 (Th is a predetermined threshold), It can be determined that the pixel P4 is in focus and the pixel P3 is out of focus. However, the first evaluation value v P1 obtained from the pixel P1 and the first evaluation value v P2 obtained from the pixel P2 become (almost) the same value, and even if these values are compared, the pixel P1 It is impossible to determine whether the pixel P2 is in focus or not in focus.

従って、幾何パターンの影響がない画素については、合成対象画素毎に第1評価値を再算出する(第1評価値の補間処理を行う)必要がある(S105)。内視鏡のような暗闇での撮像の場合、幾何パターンの影響がない画素は、非常に低輝度となるため、第1評価値に対して所与の閾値を設けることで識別が可能である。   Therefore, for pixels that are not affected by the geometric pattern, it is necessary to recalculate the first evaluation value (interpolate the first evaluation value) for each synthesis target pixel (S105). In the case of imaging in the dark like an endoscope, pixels that are not affected by the geometric pattern have very low luminance, and therefore can be identified by providing a given threshold value for the first evaluation value. .

ここで、第1評価値の補間処理の詳細な処理の流れを図8のフローチャートに示す。図8の処理は、ある1つの合成対象画素に対して行う補間処理の流れを示したものであるため、図7のステップS105では、全ての合成対象画素に対して図8の処理を行う必要がある。   Here, the detailed processing flow of the interpolation processing of the first evaluation value is shown in the flowchart of FIG. Since the process of FIG. 8 shows the flow of the interpolation process performed on a certain synthesis target pixel, it is necessary to perform the process of FIG. 8 on all synthesis target pixels in step S105 of FIG. There is.

まず、近点パターン画像信号(第1のパターン画像信号)についての第1評価値が所与の閾値以下であるか否かを判定する(S201)。   First, it is determined whether or not the first evaluation value for the near point pattern image signal (first pattern image signal) is equal to or less than a given threshold value (S201).

近点パターン画像信号についての第1評価値が所与の閾値よりも大きいと判定した場合には、補間処理を行わずに処理を終了する。   If it is determined that the first evaluation value for the near point pattern image signal is greater than the given threshold value, the process ends without performing the interpolation process.

一方、近点パターン画像信号についての第1評価値が所与の閾値以下であると判定した場合には、遠点パターン画像信号(第2のパターン画像信号)についての第1評価値が所与の閾値以下であるか否かを判定する(S202)。なお本実施形態では、ステップS202において用いる所与の閾値は、ステップS201において用いる閾値と同じ値であるが、異なる値を用いてもよい。   On the other hand, when it is determined that the first evaluation value for the near point pattern image signal is equal to or less than the given threshold value, the first evaluation value for the far point pattern image signal (second pattern image signal) is given. It is determined whether it is below the threshold value (S202). In the present embodiment, the given threshold value used in step S202 is the same value as the threshold value used in step S201, but a different value may be used.

ステップS202において、遠点パターン画像信号についての第1評価値が所与の閾値よりも大きいと判定した場合には、補間処理を行わずに処理を終了する。   If it is determined in step S202 that the first evaluation value for the far-point pattern image signal is greater than the given threshold value, the process ends without performing the interpolation process.

一方、近点パターン画像信号(第1のパターン画像信号)についての第1評価値が所与の閾値以下であると判定した場合には、第1評価値の補間処理を実行する(S203)。ここでは、例えば、既存の0次補間、線形補間、モルフォロジー膨張処理等により周辺の閾値以上の画素から補間処理した値を新たな第1評価値とする。あるいは後述するように、幾何パターンの位置等を変えて得られる相補パターン画像に基づいて補間処理を行ってもよい。以上により、第1評価値の補間処理を終了する。   On the other hand, when it is determined that the first evaluation value for the near point pattern image signal (first pattern image signal) is equal to or less than a given threshold value, interpolation processing of the first evaluation value is executed (S203). Here, for example, a value obtained by performing interpolation processing from a pixel that is equal to or higher than a peripheral threshold by existing zero-order interpolation, linear interpolation, morphological expansion processing, or the like is set as a new first evaluation value. Alternatively, as will be described later, interpolation processing may be performed based on a complementary pattern image obtained by changing the position of the geometric pattern or the like. Thus, the first evaluation value interpolation process is completed.

そして、画像合成部130は、合成対象画素毎に画像合成処理を行う(S106)。近点画像及び遠点画像から得られる第2評価値が共に所定の閾値以下である場合は、コントラストやエッジ成分が安定して算出できていない画素であるため、第1評価値に基づいて画像合成処理を行う。一方、近点画像及び遠点画像から得られる第2評価値が共に所定の閾値よりも大きい場合には、コントラストやエッジ成分が安定して算出できている画素であるため、第2評価値に基づいて画像合成処理を行う。   Then, the image composition unit 130 performs image composition processing for each composition target pixel (S106). When both the second evaluation values obtained from the near point image and the far point image are equal to or less than a predetermined threshold, the image is based on the first evaluation value because the contrast and edge components cannot be stably calculated. Perform synthesis processing. On the other hand, when the second evaluation values obtained from the near point image and the far point image are both larger than a predetermined threshold, the contrast and edge components are pixels that can be stably calculated. Based on this, image composition processing is performed.

ここで、画像合成処理の詳細な処理の流れを図9のフローチャートに示す。図9の処理は、ある1つの合成対象画素に対して行う画像合成処理の流れを示したものであるため、図7のステップS106では、全ての合成対象画素に対して図9の処理を行う必要がある。   Here, the detailed processing flow of the image composition processing is shown in the flowchart of FIG. Since the process of FIG. 9 shows the flow of the image composition process performed for a certain compositing target pixel, in step S106 of FIG. 7, the process of FIG. 9 is performed for all compositing target pixels. There is a need.

まず、近点画像信号(第1の画像信号)についての第2評価値が所与の閾値以下であるか否かを判定する(S301)。   First, it is determined whether or not the second evaluation value for the near point image signal (first image signal) is equal to or less than a given threshold (S301).

近点画像信号(第1の画像信号)についての第2評価値が所与の閾値以下であると判定した場合には、遠点画像信号(第2の画像信号)についての第2評価値も所与の閾値以下であるか否かを判定する(S302)。なお本実施形態では、ステップS302において用いる所与の閾値は、ステップS301において用いる閾値と同じ値であるが、異なる値を用いてもよい。   If it is determined that the second evaluation value for the near point image signal (first image signal) is equal to or less than a given threshold, the second evaluation value for the far point image signal (second image signal) is also It is determined whether it is below a given threshold (S302). In the present embodiment, the given threshold value used in step S302 is the same value as the threshold value used in step S301, but a different value may be used.

そして、遠点画像信号(第2の画像信号)についての第2評価値が所与の閾値以下であると判定した場合には、第1評価値を用いて画像合成係数を算出する(S303)。   And when it determines with the 2nd evaluation value about a far point image signal (2nd image signal) being below a given threshold value, an image synthesis coefficient is calculated using a 1st evaluation value (S303). .

ここで、画像合成係数c(x,y)は、例えば下式(2)により求められる。なお、下式(2)において、vnearは近点パターン画像から得られる第1評価値であり、vfarは遠点パターン画像から得られる第1評価値である。 Here, the image synthesis coefficient c (x, y) is obtained by the following equation (2), for example. In the following formula (2), v near is a first evaluation value obtained from the near point pattern image, and v far is a first evaluation value obtained from the far point pattern image.

他にも、画像合成係数c(x,y)は、例えば下式(3)により求めてもよい。なお、下式(3)において、αは正規化係数である。   In addition, the image synthesis coefficient c (x, y) may be obtained by the following equation (3), for example. In the following formula (3), α is a normalization coefficient.

これによれば、0と1の2値判定(近点画像か遠点画像のどちらか)ではなく、近点画像と遠点画像をブレンドする係数を画像合成係数として算出して、合焦領域と非合焦領域の切り替わる部分を滑らかにすることが可能になる。   According to this, instead of binary determination of 0 and 1 (either the near-point image or the far-point image), a coefficient for blending the near-point image and the far-point image is calculated as an image synthesis coefficient, and the in-focus area It is possible to smooth the part where the out-of-focus area is switched.

一方、ステップS301において、近点画像信号(第1の画像信号)についての第2評価値が所与の閾値よりも大きいと判定した場合、又はステップS302において、遠点画像信号(第2の画像信号)についての第2評価値が所与の閾値よりも大きいと判定した場合には、第2評価値を用いて画像合成係数を算出する(S304)。   On the other hand, when it is determined in step S301 that the second evaluation value for the near point image signal (first image signal) is larger than a given threshold value, or in step S302, the far point image signal (second image signal). If it is determined that the second evaluation value for the signal) is greater than a given threshold value, an image synthesis coefficient is calculated using the second evaluation value (S304).

ステップS304においても、画像合成係数は、上式(2)や上式(3)などにより求められる。ただし、第2評価値を用いて画像合成係数を求める場合には、上式(2)と上式(3)において、vnearは近点画像から得られる第2評価値に置き換えられ、vfarは遠点画像から得られる第2評価値に置き換えられるものとする。 Also in step S304, the image synthesis coefficient is obtained by the above equation (2), the above equation (3), and the like. However, in the case of obtaining the image synthesis coefficient using the second evaluation value, v near is replaced with the second evaluation value obtained from the near- point image in the above expressions (2) and (3), and v far Is replaced with the second evaluation value obtained from the far point image.

そして、ステップS303又はステップS304後に、算出した画像合成係数を用いて画像合成処理を行う(S305)。具体的に画像合成処理は、下式(4)に従って行う。なお、式(4)において、a(x,y)は、合成画像の座標(x,y)の画素値、a(x,y)は、近点画像の座標(x,y)の画素値、a(x,y)は、遠点画像の座標(x,y)の画素値を表す。 Then, after step S303 or step S304, image composition processing is performed using the calculated image composition coefficient (S305). Specifically, the image composition processing is performed according to the following equation (4). In Expression (4), a (x, y) is a pixel value of coordinates (x, y) of the composite image, and a 1 (x, y) is a pixel of coordinates (x, y) of the near-point image. The value a 2 (x, y) represents the pixel value of the coordinates (x, y) of the far point image.

ここで、図5(A)〜図5(C)を用いて画像合成処理の具体例を示す。まず、図5(A)の画像SIM1は、図2(A)の近点画像の一部分を拡大した図であり、図5(B)の画像SIM2は、図2(B)の遠点画像の一部分を拡大した図である。そして、図5(C)の画像SCIMは、式(2)により求められる画像合成係数と式(4)に従って、図5(A)の画像SIM1と図5(B)の画像SIM2を合成した結果得られる画像である。なお、図5(A)〜図5(C)において、A1〜A16、B1〜B16は、それぞれ合成対象画素を表している。さらに、斜線が掛けられている合成対象画素(具体的には、A1〜A7、A9、A10、A13、B8、B11、B12、B14〜B16)は、非合焦状態にあり、それ以外の斜線が掛けられていない合成対象画素は、合焦状態にあるものとする。なお、実際には、一部分が合焦状態であり、他の一部分が非合焦状態である合成対象画素も存在し得るが、ここでは説明の簡略化のため、合成対象画素は、合焦状態又は非合焦状態のどちらかであるものとして説明する。   Here, a specific example of the image composition processing will be described with reference to FIGS. First, an image SIM1 in FIG. 5A is an enlarged view of a part of the near point image in FIG. 2A, and an image SIM2 in FIG. 5B is an image of the far point image in FIG. It is the figure which expanded a part. Then, the image SCIM in FIG. 5C is a result of combining the image SIM1 in FIG. 5A and the image SIM2 in FIG. 5B in accordance with the image synthesis coefficient obtained by the equation (2) and the equation (4). It is an obtained image. 5A to 5C, A1 to A16 and B1 to B16 each represent a synthesis target pixel. Furthermore, the synthesis target pixels (specifically, A1 to A7, A9, A10, A13, B8, B11, B12, and B14 to B16) that are hatched are in an out-of-focus state, and other hatched lines It is assumed that the compositing target pixel not covered by is in a focused state. In actuality, there may be a compositing target pixel in which one part is in an in-focus state and the other part is in an out-of-focus state. Or it demonstrates as what is in a non-focus state.

まず、合成画像SCIMの座標(1、1)の画素に着目する。前述したように、合成画像SCIMの座標(1、1)の画素を求めるには、近点画像SIM1の同位置の画素A1と、遠点画像SIM2の同位置の画素B1とを比較して、どちらの画素を用いるか決定する。この時、画像SIM1の画素A1から求められた第1評価値(又は第2評価値)vnearは、画像SIM2の画素B1から求められた第1評価値(又は第2評価値)vfarよりも小さくなる。従って、式(2)により、画像合成係数c(1,1)=0となるため、式(4)により、a(1,1)=a(1,1)となる。よって、合成画像SCIMの座標(1,1)の画素には、画像SIM2の画素B1が選択される。その他の画素についても同様の処理を行うと、図5(C)のような合成画像SCIMが求められる。 First, focus on the pixel at the coordinates (1, 1) of the composite image SCIM. As described above, in order to obtain the pixel at the coordinates (1, 1) of the composite image SCIM, the pixel A1 at the same position in the near-point image SIM1 is compared with the pixel B1 at the same position in the far-point image SIM2. Decide which pixel to use. At this time, the first evaluation value (or second evaluation value) v near obtained from the pixel A1 of the image SIM1 is obtained from the first evaluation value (or second evaluation value) v far obtained from the pixel B1 of the image SIM2. Becomes smaller. Therefore, since the image synthesis coefficient c (1, 1) = 0 is obtained from the equation (2), a (1, 1) = a 2 (1, 1) is obtained from the equation (4). Therefore, the pixel B1 of the image SIM2 is selected as the pixel at the coordinates (1, 1) of the composite image SCIM. When similar processing is performed for other pixels, a composite image SCIM as shown in FIG. 5C is obtained.

以上により、画像合成処理を終了し、これらの処理を全ての合成対象画素について実行して、本実施形態の処理を終了する。   As described above, the image compositing process is finished, these processes are executed for all compositing target pixels, and the process of the present embodiment is finished.

そして、図2(B)に示した近点画像IM1と図2(C)に示した遠点画像IM2を、前述した第1評価値と第2評価値を用いて、式(4)に従って合成した画像AFIMを図6に示す。図5(A)〜図5(C)を用いて説明したように、近点画像IM1及び遠点画像IM2のそれぞれの合焦領域を合成すると、画像全体で合焦している画像AFIMが得られる。   Then, the near point image IM1 shown in FIG. 2B and the far point image IM2 shown in FIG. 2C are synthesized according to the equation (4) using the first evaluation value and the second evaluation value described above. The resulting image AFIM is shown in FIG. As described with reference to FIGS. 5A to 5C, when the in-focus areas of the near-point image IM1 and the far-point image IM2 are synthesized, an image AFIM that is focused on the entire image is obtained. It is done.

その後、合成画像AFIMを、例えば図示しない出力部(提示部)に転送して、ディスプレイ等に出力してもよい。   Thereafter, the composite image AFIM may be transferred to an output unit (presentation unit) (not shown) and output to a display or the like.

4.本実施形態の手法
以上の本実施形態の画像処理装置100は、複数の画像信号の取得処理を行う画像取得部110と、取得した画像信号に基づいて評価値の算出処理を行う評価値算出部120と、評価値に基づいて複数の画像信号の合成処理を行う画像合成部130と、を含む。まず、画像取得部110は、合焦物体位置の異なる複数の画像信号を撮像部200から取得すると共に、被写体に幾何パターンを投影して撮像された合焦物体位置の異なる複数のパターン画像信号を撮像部200から取得する。次に、評価値算出部120は、複数のパターン画像信号に基づいて第1評価値を算出すると共に、複数の画像信号に基づいて第2評価値を算出する。そして、画像合成部130は、第1評価値と第2評価値との比較処理を行い、比較処理の結果に基づいて、複数の画像信号の合成処理を行う。
4). Method of this Embodiment The image processing apparatus 100 according to this embodiment described above includes an image acquisition unit 110 that performs acquisition processing of a plurality of image signals, and an evaluation value calculation unit that performs evaluation value calculation processing based on the acquired image signals. 120 and an image composition unit 130 that performs composition processing of a plurality of image signals based on the evaluation value. First, the image acquisition unit 110 acquires a plurality of image signals having different in-focus object positions from the imaging unit 200, and projects a plurality of pattern image signals having different in-focus object positions that are captured by projecting a geometric pattern onto the subject. Obtained from the imaging unit 200. Next, the evaluation value calculation unit 120 calculates a first evaluation value based on the plurality of pattern image signals, and calculates a second evaluation value based on the plurality of image signals. Then, the image composition unit 130 performs a comparison process between the first evaluation value and the second evaluation value, and performs a combination process of a plurality of image signals based on the result of the comparison process.

ここで、画像信号とは、被写体を撮像した画像を表す信号のことをいう。また、画像信号は、アナログ信号であってもよいし、デジタル信号であってもよい。   Here, the image signal refers to a signal representing an image obtained by imaging a subject. The image signal may be an analog signal or a digital signal.

また、評価値とは、画像合成処理において、第1の画像信号と第2の画像信号をどの割合で使うかを評価するための値のことをいう。また、評価値は、画像が合焦状態であるか否かを評価するために用いる値、すなわち画像の合焦の度合いを評価するために用いる値とも言える。さらに、評価値は、後述する光学劣化関数に基づいて変化する値であるとも言える。   The evaluation value is a value for evaluating at what ratio the first image signal and the second image signal are used in the image composition processing. The evaluation value can also be said to be a value used for evaluating whether or not the image is in focus, that is, a value used for evaluating the degree of focusing of the image. Further, it can be said that the evaluation value is a value that changes based on an optical deterioration function described later.

ここで、評価値算出部120は、複数の画像信号のコントラスト又はエッジ成分を表す第2評価値を算出してもよい。   Here, the evaluation value calculation unit 120 may calculate a second evaluation value representing the contrast or edge component of a plurality of image signals.

すなわち、第2評価値は、コントラスト又はエッジ成分そのものであってもよいし、コントラスト又はエッジ成分を表す他の値であってもよい。   That is, the second evaluation value may be the contrast or edge component itself, or may be another value representing the contrast or edge component.

ここで、コントラスト(コントラスト値)は、例えば前述した式(1)により求められる値等であってもよい。   Here, the contrast (contrast value) may be, for example, a value obtained by the above-described equation (1).

また、エッジ成分は、前述したように、例えばソーベルフィルタやラプラシアンフィルタといった既存のエッジ抽出フィルタによって算出する値であってもよい。   Further, as described above, the edge component may be a value calculated by an existing edge extraction filter such as a Sobel filter or a Laplacian filter.

これにより、画像のコントラスト又はエッジ成分に基づいて、画像合成処理を行うこと等が可能になる。   This makes it possible to perform image composition processing based on the contrast or edge component of the image.

また、評価値算出部120は、複数のパターン画像信号の輝度値を第1評価値として算出してもよい。   Further, the evaluation value calculation unit 120 may calculate the luminance values of the plurality of pattern image signals as the first evaluation value.

パターン画像信号の輝度値を第1評価値として用いる場合には、合焦状態である場合に、非合焦状態である場合よりも第1評価値が大きくなり、非合焦状態である場合に、合焦状態である場合よりも第1評価値が小さくなる。すなわち、画像の合焦の度合いが強くなればなるほど、第1評価値は大きくなる。   When the luminance value of the pattern image signal is used as the first evaluation value, the first evaluation value is larger in the in-focus state than in the out-of-focus state, and in the out-of-focus state. The first evaluation value is smaller than that in the in-focus state. That is, the first evaluation value increases as the degree of focusing of the image increases.

また、幾何パターン(パターン光)を投影するため、幾何パターンを投影された画素の輝度値が、算出できない程小さくなるということもない。   Further, since the geometric pattern (pattern light) is projected, the luminance value of the pixel onto which the geometric pattern is projected does not become so small that it cannot be calculated.

これにより、例えば画像合成処理において有効なコントラスト等を算出できない場合であっても、画像合成処理に用いる他の評価値を算出すること等が可能になる。   As a result, for example, even when effective contrast or the like cannot be calculated in the image composition process, it is possible to calculate other evaluation values used for the image composition process.

さて、このような第1評価値は、パターン画像信号から求められるが、パターン画像信号とは、幾何パターンを投影して、撮像された画像の信号のことをいう。本実施形態では、合焦物体位置の異なるパターン画像信号を取得する。具体例としては、図3(B)の近点パターン画像IM3の信号及び図3(C)の遠点パターン画像IM4の信号などが挙げられる。   Such a first evaluation value is obtained from a pattern image signal. The pattern image signal refers to a signal of an image captured by projecting a geometric pattern. In the present embodiment, pattern image signals having different in-focus object positions are acquired. Specific examples include the signal of the near point pattern image IM3 in FIG. 3B and the signal of the far point pattern image IM4 in FIG. 3C.

また、幾何パターンとしては、図4(A)〜図4(C)を用いて説明したようなパターンが挙げられる。但し、幾何パターンは、図4(A)〜図4(C)の例に限定されず、他のパターンを用いてもよい。   Examples of the geometric pattern include patterns described with reference to FIGS. 4 (A) to 4 (C). However, the geometric pattern is not limited to the examples shown in FIGS. 4A to 4C, and other patterns may be used.

さらに、合焦物体位置とは、レンズを通して撮像される画像に映る被写体が合焦状態となる被写体側の位置のことをいう。すなわち、合焦物体位置は、現在合焦している被写体側の位置である。   Further, the in-focus object position refers to a position on the object side where an object reflected in an image captured through a lens is in an in-focus state. That is, the focused object position is a position on the subject side that is currently focused.

以上のように本実施形態では、幾何パターンを投影して撮像された画像の信号から第1評価値を算出し、幾何パターンを投影せずに撮像された画像の信号から第2評価値を算出する。そして、算出した第1評価値及び第2評価値に基づいて、画像合成処理を行う。   As described above, in this embodiment, the first evaluation value is calculated from the signal of the image captured by projecting the geometric pattern, and the second evaluation value is calculated from the signal of the image captured without projecting the geometric pattern. To do. Then, image composition processing is performed based on the calculated first evaluation value and second evaluation value.

第1評価値は、被写体のコントラストやテクスチャ等に影響されないため、コントラストが低い被写体や、テクスチャが少ない被写体でも、画像合成処理に対して有効な評価値を算出することができる。すなわち、テクスチャが少ない領域、コントラストの低い被写体においても安定して合成画像を生成するための評価値が算出できる。   Since the first evaluation value is not affected by the contrast or texture of the subject, an evaluation value effective for the image composition process can be calculated even for a subject with low contrast or a subject with little texture. That is, it is possible to calculate an evaluation value for stably generating a composite image even in an area with less texture and a subject with low contrast.

これにより、コントラストの低い画像信号でも、アーチファクトの発生を抑制して画像合成処理を行うことができる。   As a result, even with an image signal having a low contrast, image synthesis processing can be performed while suppressing the occurrence of artifacts.

また、このような処理を行うことで、複数の画像信号から画像全体で焦点の合った全焦点画像を生成することも可能となる。   Also, by performing such processing, it is possible to generate an omnifocal image in which the entire image is in focus from a plurality of image signals.

また、評価値算出部120は、複数のパターン画像信号において合成処理の対象となる画素である合成対象画素毎に第1評価値を算出すると共に、複数の画像信号の合成対象画素毎に第2評価値を算出してもよい。そして、画像合成部130は、合成対象画素毎に第1評価値と第2評価値との比較処理を行って、比較処理結果に基づいて、複数の画像信号の合成処理を合成対象画素毎に行ってもよい。   In addition, the evaluation value calculation unit 120 calculates a first evaluation value for each synthesis target pixel that is a pixel to be synthesized in a plurality of pattern image signals, and a second value for each synthesis target pixel of the plurality of image signals. An evaluation value may be calculated. Then, the image synthesis unit 130 performs a comparison process between the first evaluation value and the second evaluation value for each synthesis target pixel, and performs a synthesis process of a plurality of image signals for each synthesis target pixel based on the comparison process result. You may go.

ここで、合成対象画素とは、画像合成処理の対象となる少なくとも一つの画素のことをいう。合成対象画素は、1画素であってもよいし、複数画素から構成される画素のまとまりであってもよい。例えば、縦2画素、横2画素の4画素をひとまとまりに、合成対象画素として扱っても良い。   Here, the synthesis target pixel means at least one pixel to be subjected to image synthesis processing. The synthesis target pixel may be one pixel or a group of pixels composed of a plurality of pixels. For example, four pixels of 2 pixels in the vertical direction and 2 pixels in the horizontal direction may be collectively treated as the synthesis target pixels.

これにより、画像合成の対象となる画素に対して、第1評価値と第2評価値を算出することができ、全ての合成対象画素に対して比較処理を行って、例えば、画像の合焦状態等を判定して、より正確な画像合成処理を行うこと等が可能になる。   As a result, the first evaluation value and the second evaluation value can be calculated for the pixel to be image-combined, and comparison processing is performed on all the pixels to be combined, for example, focusing of the image It is possible to determine the state or the like and perform more accurate image composition processing.

さて次に、図4(A)に示すようなドットパターンPIMのドット間距離dの決定方法について具体的に説明する。まず、図3(B)又は図3(C)に示すように、投影されたドットは、光学系の光学劣化関数に従って被写界深度内では明瞭な形で撮像されるが、被写界深度外ではぼけて撮像される。なお、光学劣化関数とは、例えば点拡がり関数(PSF:Point Spread Function)であり、光学系の点光源に対する応答を表す関数のことをいう。   Next, a method for determining the inter-dot distance d of the dot pattern PIM as shown in FIG. First, as shown in FIG. 3B or FIG. 3C, the projected dots are captured in a clear form within the depth of field according to the optical degradation function of the optical system. The image is blurred outside. The optical deterioration function is, for example, a point spread function (PSF), which is a function representing a response of the optical system to a point light source.

すなわち、投影されたドットのぼけ具合を判定すれば、幾何パターンが投影されている各画素位置が被写界深度内か否かを判定することができる。一般的には、明瞭に撮像された部分は、ぼけている部分に比べて輝度が高く、ぼけている部分は明瞭に撮像された部分に比べて輝度が低くなるため、輝度等を用いれば、画像のぼけ具合を判定することも可能である。   That is, if the degree of blur of the projected dots is determined, it can be determined whether or not each pixel position onto which the geometric pattern is projected is within the depth of field. Generally, a clearly imaged part has a higher brightness than a blurred part, and a blurred part has a lower brightness than a clearly imaged part. It is also possible to determine the degree of image blur.

よって、画像取得部110は、光学劣化関数に基づいて設定された幾何パターンを投影して撮像された複数のパターン画像信号を撮像部200から取得してもよい。   Therefore, the image acquisition unit 110 may acquire a plurality of pattern image signals captured by projecting a geometric pattern set based on the optical degradation function from the imaging unit 200.

これにより、幾何パターンが投影されている各画素位置が被写界深度内か否か、つまり各画素位置の合焦状態をパターン画像の輝度値に基づいて評価(判定)すること等が可能になる。   This makes it possible to evaluate (determine) whether or not each pixel position onto which the geometric pattern is projected is within the depth of field, that is, the focused state of each pixel position based on the luminance value of the pattern image. Become.

しかし、投影されたドットが重なる場合には、光学劣化関数による輝度値の変化が正確に算出できない。よって、光学系の光学劣化関数による所定の被写体距離においての、ぼけ半径がRとすると、投影されたドットが重ならないように、ドット間距離dが2R以上となるように設定する必要がある。   However, when the projected dots overlap, the change in luminance value due to the optical degradation function cannot be calculated accurately. Therefore, when the blur radius is R at a predetermined subject distance due to the optical degradation function of the optical system, it is necessary to set the inter-dot distance d to be 2R or more so that the projected dots do not overlap.

すなわち、画像取得部110は、光学劣化関数に基づいて、ぼけ半径Rに対してドット間距離dがd≧2R(d及びRは正の整数)となるように設定されたドットパターンを投影して撮像された複数のパターン画像信号を取得してもよい。   That is, the image acquisition unit 110 projects a dot pattern set such that the inter-dot distance d is d ≧ 2R (d and R are positive integers) with respect to the blur radius R based on the optical degradation function. A plurality of pattern image signals captured in this manner may be acquired.

これにより、ドットが重ならないように被写体にドットパターンを投影すること等が可能になる。   This makes it possible to project a dot pattern onto the subject so that the dots do not overlap.

しかし、このようにしてドット間距離dを定めると、投影するドットパターンが疎となる。ここで、ドットパターンが疎となるとは、パターン画像内にドットが投影されていない画素があることを指す。前述したようにd≧2Rとすると、必ず疎となる。   However, when the inter-dot distance d is determined in this way, the projected dot pattern becomes sparse. Here, the sparse dot pattern indicates that there is a pixel in which no dot is projected in the pattern image. As described above, when d ≧ 2R, it is always sparse.

例えば、本実施形態を内視鏡に適用する場面では、暗い体内の画像を撮像するため、ドットが投影されていない部分の輝度は非常に小さくなり、このような値を求めても、画像合成処理の評価値として有効に使えない場合がある。   For example, in a scene where the present embodiment is applied to an endoscope, an image in a dark body is picked up, so the brightness of a portion where no dots are projected is very small. It may not be used effectively as an evaluation value for processing.

そこで、本実施形態では、算出した第1評価値が所与の閾値以下の場合には、その第1評価値を補間(再算出)してもよい。   Therefore, in the present embodiment, when the calculated first evaluation value is equal to or less than a given threshold value, the first evaluation value may be interpolated (recalculated).

すなわち、評価値算出部120は、複数のパターン画像信号において合成処理の対象となる画素である合成対象画素毎に、算出した第1評価値が所与の閾値以下であるか否かの判定処理を行い、第1評価値が所与の閾値以下であると判定した場合には、第1評価値に対して補間処理を行ってもよい。   That is, the evaluation value calculation unit 120 determines whether or not the calculated first evaluation value is equal to or less than a given threshold value for each synthesis target pixel that is a pixel that is a target of the synthesis process in a plurality of pattern image signals. When it is determined that the first evaluation value is equal to or less than a given threshold value, an interpolation process may be performed on the first evaluation value.

なお、第1評価値と所与の閾値との比較処理において、符号を反転する等の変形を加えることも可能であり、このような変形も本発明の範囲内であるものとする。   In the comparison process between the first evaluation value and a given threshold, it is possible to add a modification such as inversion of the sign, and such a modification is also within the scope of the present invention.

これにより、ドットパターンが疎となる場合であっても、全ての合成対象画素について、画像合成処理の評価値として有効な第1評価値を求めること等が可能になる。   As a result, even if the dot pattern is sparse, it is possible to obtain a first evaluation value that is effective as an evaluation value for image composition processing for all the compositing target pixels.

また、評価値算出部120は、第1評価値が所与の閾値以下であると判定した場合に、補間処理として、0次補間処理及び線形補間処理、モルフォロジー膨張処理のうちのいずれかの処理を第1評価値に対して行ってもよい。   In addition, when the evaluation value calculation unit 120 determines that the first evaluation value is equal to or less than a given threshold value, any one of zero-order interpolation processing, linear interpolation processing, and morphological expansion processing is performed as the interpolation processing. May be performed on the first evaluation value.

これにより、画像合成処理の評価値として有効でないと判定された第1評価値を、同一のパターン画像信号から算出された他の第1評価値に基づいて補間すること等が可能になる。   Thereby, it is possible to interpolate the first evaluation value determined as not being effective as the evaluation value of the image composition processing based on the other first evaluation value calculated from the same pattern image signal.

また補間処理の他の方法として、光空間変調器を制御し、投影パターンを水平垂直方向に移動する、あるいは明暗を反転させる等、幾何パターンを変更し複数回投影し、近点パターン画像(第1パターン画像)及び遠点パターン画像(第2パターン画像)を複数回撮像することで、疎な領域を補間する相補パターン画像を取得することも可能である。   As another method of interpolation processing, the spatial pattern modulator is controlled, the projection pattern is moved in the horizontal and vertical directions, or the light and dark are reversed. By capturing a single pattern image) and a far point pattern image (second pattern image) a plurality of times, a complementary pattern image that interpolates a sparse area can be acquired.

すなわち、画像取得部110は、複数のパターン画像信号を撮像部200から取得すると共に、先に投影した幾何パターンと異なる幾何パターンを被写体に投影して撮像された複数の相補パターン画像信号を撮像部200から取得してもよい。そして、評価値算出部120は、複数のパターン画像信号から算出した第1評価値が、所与の閾値以下であると判定した合成対象画素に対して、複数の相補パターン画像に基づいて第1評価値を算出し直す処理を補間処理として行ってもよい。   That is, the image acquisition unit 110 acquires a plurality of pattern image signals from the imaging unit 200, and projects a plurality of complementary pattern image signals captured by projecting a geometric pattern different from the previously projected geometric pattern onto the subject. You may acquire from 200. Then, the evaluation value calculation unit 120 applies the first evaluation value calculated from the plurality of pattern image signals to the synthesis target pixel determined to be equal to or less than a given threshold based on the plurality of complementary pattern images. The process of recalculating the evaluation value may be performed as an interpolation process.

ここで、先に投影した幾何パターンと異なる幾何パターン(以下では、相補幾何パターンと呼ぶ)とは、先に投影した幾何パターンと、今回投影した相補幾何パターンとを組み合わせると、全ての合成対象画素に対して、パターン光が投影されるような幾何パターンをいう。例えば、先に投影した幾何パターンが図4(B)のようなラインパターンPIM2である場合には、PIM2の白いラインを全て所定距離だけ下に移動させたラインパターンなどを指す。但し、必ずしも2つの幾何パターンで、全ての合成対象画素に対して、パターン光が投影されなければならない訳ではなく、3つ以上の幾何パターン、例えば幾何パターンA〜Cを組み合わせると、全ての合成対象画素にパターン光が投影されるものであっても良い。この場合には、幾何パターンAにとっては、幾何パターンB及びCが相補幾何パターンとなる。   Here, a geometric pattern different from the previously projected geometric pattern (hereinafter referred to as a complementary geometric pattern) means that all the synthesis target pixels are obtained by combining the previously projected geometric pattern and the complementary geometric pattern projected this time. On the other hand, it refers to a geometric pattern on which pattern light is projected. For example, when the previously projected geometric pattern is a line pattern PIM2 as shown in FIG. 4B, it indicates a line pattern in which all white lines of PIM2 are moved downward by a predetermined distance. However, pattern light does not necessarily have to be projected onto all synthesis target pixels in two geometric patterns. When three or more geometric patterns, for example, geometric patterns A to C are combined, all synthesis is performed. The pattern light may be projected onto the target pixel. In this case, for the geometric pattern A, the geometric patterns B and C are complementary geometric patterns.

また、相補パターン画像信号とは、相補幾何パターンを投影して撮像された画像信号のことをいう。   The complementary pattern image signal refers to an image signal captured by projecting a complementary geometric pattern.

これにより、画像合成処理の評価値として有効でないと判定された第1評価値を、相補パターン画像信号から算出された同一の合成対象画素に対応する第1評価値に置換すること等が可能になる。   As a result, it is possible to replace the first evaluation value determined not to be effective as the evaluation value of the image composition processing with the first evaluation value corresponding to the same composition target pixel calculated from the complementary pattern image signal. Become.

さらに、使用した幾何パターンを全て組み合わせても、パターン光が投影されない合成対象画素があっても良い。この場合には、補間処理として、0次補間処理及び線形補間処理、モルフォロジー膨張処理のうちのいずれかの処理をさらに行っても良い。すなわち、0次補間処理等と相補パターン画像を用いた補間処理の両方の処理を行っても良い。   Furthermore, even if all the used geometric patterns are combined, there may be a synthesis target pixel on which pattern light is not projected. In this case, as the interpolation process, any one of a zero-order interpolation process, a linear interpolation process, and a morphological expansion process may be further performed. That is, both the zero-order interpolation process and the interpolation process using the complementary pattern image may be performed.

さて、以上のようにして第1評価値と第2評価値を求めるが、基本的には第2評価値に基づいて画像合成処理を行う。ただし、第2評価値が画像合成処理の評価値として有効でない場合には、第1評価値に基づいて画像合成処理を行う。第2評価値が有効でない場合とは、前述したように、被写体のコントラストが低かったり、テクスチャが少なかったりするために、第2評価値が非常に小さい値となってしまう場合である。   Now, the first evaluation value and the second evaluation value are obtained as described above. Basically, the image composition processing is performed based on the second evaluation value. However, when the second evaluation value is not valid as the evaluation value of the image composition process, the image composition process is performed based on the first evaluation value. The case where the second evaluation value is not valid is a case where the second evaluation value becomes a very small value because the contrast of the subject is low or the texture is small as described above.

そこで、本実施形態では、第2評価値が所与の閾値以下であるか否かの判定処理を行うことにより、第2評価値が画像合成処理の評価値として有効であるか否かを判定し、第2評価値が画像合成処理の評価値として有効であると判定した場合には、第2評価値を用いて画像合成処理を行い、第2評価値が画像合成処理の評価値として有効ではないと判定した場合には、第1評価値を用いて画像合成処理を行ってもよい。   Therefore, in the present embodiment, it is determined whether or not the second evaluation value is effective as an evaluation value for the image composition processing by performing a determination process whether or not the second evaluation value is equal to or less than a given threshold value. If it is determined that the second evaluation value is valid as the evaluation value for the image composition process, the second evaluation value is used to perform the image composition process, and the second evaluation value is valid as the evaluation value for the image composition process. If it is determined that it is not, the image composition processing may be performed using the first evaluation value.

すなわち、画像合成部130は、複数のパターン画像信号において合成処理の対象となる画素である合成対象画素毎に、算出した第2評価値が所与の閾値以下であるか否かの判定処理を行い、第2評価値が所与の閾値以下であると判定した場合には、第1評価値に基づいて合成処理を行い、第2評価値が所与の閾値よりも大きいと判定した場合には、第2評価値に基づいて合成処理を行ってもよい。   That is, the image synthesis unit 130 performs a determination process as to whether or not the calculated second evaluation value is equal to or less than a given threshold value for each synthesis target pixel that is a pixel that is a target of the synthesis process in the plurality of pattern image signals. If it is determined that the second evaluation value is less than or equal to the given threshold value, a synthesis process is performed based on the first evaluation value, and if it is determined that the second evaluation value is greater than the given threshold value May perform the synthesis process based on the second evaluation value.

なお、第2評価値と所与の閾値との比較処理において、符号を反転する等の変形を加えることも可能であり、このような変形も本発明の範囲内であるものとする。   In the comparison process between the second evaluation value and a given threshold value, it is possible to add a modification such as inversion of the sign, and such a modification is also within the scope of the present invention.

これにより、第2評価値が画像合成処理の評価値として有効であると判定した場合には、第2評価値を用いて画像合成処理を行い、第2評価値が画像合成処理の評価値として有効ではないと判定した場合には、第1評価値を用いて画像合成処理を行うこと等が可能になる。   As a result, when it is determined that the second evaluation value is valid as the evaluation value for the image composition processing, the image composition processing is performed using the second evaluation value, and the second evaluation value is used as the evaluation value for the image composition processing. If it is determined that the image is not valid, it is possible to perform image composition processing using the first evaluation value.

また、画像合成処理では、第1評価値や第2評価値から画像合成係数を算出してもよい。   In the image composition process, an image composition coefficient may be calculated from the first evaluation value or the second evaluation value.

すなわち、画像合成部130は、第2評価値が所与の閾値以下であると判定した場合には、第1評価値に基づいて画像合成係数を算出し、画像合成係数を用いて合成対象画素毎に合成処理を行い、第2評価値が所与の閾値よりも大きいと判定した場合には、第2評価値に基づいて画像合成係数を算出し、画像合成係数を用いて合成対象画素毎に合成処理を行ってもよい。   That is, when the image synthesis unit 130 determines that the second evaluation value is equal to or less than a given threshold value, the image synthesis unit 130 calculates an image synthesis coefficient based on the first evaluation value, and uses the image synthesis coefficient to combine the target pixel. When it is determined that the second evaluation value is greater than a given threshold value, an image synthesis coefficient is calculated based on the second evaluation value, and each synthesis target pixel is used using the image synthesis coefficient. A synthesis process may be performed.

ここで、画像合成係数とは、具体的には前述した式(4)におけるc(x,y)のことを指し、前述した式(2)や式(3)等により求められる。但し、画像合成係数は、式(2)や式(3)により算出される値に限定されず、任意の方法により算出してもよい。   Here, the image synthesis coefficient specifically refers to c (x, y) in the above-described formula (4), and is obtained by the above-described formula (2), formula (3), or the like. However, the image synthesis coefficient is not limited to the value calculated by Expression (2) or Expression (3), and may be calculated by an arbitrary method.

これにより、例えば式(3)により算出される画像合成係数を用いれば、合焦領域と非合焦領域の切り替わり部分を滑らかに合成すること等が可能になる。   Thus, for example, by using the image synthesis coefficient calculated by Expression (3), it is possible to smoothly synthesize the switching portion between the in-focus area and the out-of-focus area.

以上のように説明してきた本実施形態の手法を、前述した2つ画像信号と、2つのパターン画像信号を用いる例に適用して、言い換えると次のようになる。   The method of the present embodiment described above is applied to the example using the above-described two image signals and two pattern image signals, in other words, as follows.

画像取得部110は、第1の画像信号と、第1の画像信号と合焦物体位置の異なる第2の画像信号とを撮像部200から取得すると共に、被写体に幾何パターンを投影して撮像された第1のパターン画像信号と、第1のパターン画像信号と合焦物体位置の異なる第2のパターン画像信号とを撮像部200から取得してもよい。そして、評価値算出部120は、合成処理の対象となる画素である合成対象画素毎に、第1のパターン画像信号と第2のパターン画像信号についての第1評価値を算出すると共に、第1の画像信号と第2の画像信号についての第2評価値を算出してもよい。さらに、画像合成部130は、合成対象画素毎に、第1の画像信号と第2の画像信号についての第2評価値が共に所与の閾値以下であるか否かの判定処理を行い、第2評価値が共に所与の閾値以下であると判定した場合には、第1評価値に基づいて第1の画像信号と第2の画像信号の合成処理を行い、第2評価値が共に所与の閾値よりも大きいと判定した場合には、第2評価値に基づいて第1の画像信号と第2の画像信号の合成処理を行ってもよい。   The image acquisition unit 110 acquires the first image signal and the first image signal and the second image signal having a different in-focus object position from the imaging unit 200, and is imaged by projecting a geometric pattern onto the subject. Alternatively, the first pattern image signal and the second pattern image signal having a different focus object position from the first pattern image signal may be acquired from the imaging unit 200. Then, the evaluation value calculation unit 120 calculates a first evaluation value for the first pattern image signal and the second pattern image signal for each synthesis target pixel that is a pixel that is a target of the synthesis process, and first The second evaluation value for the image signal and the second image signal may be calculated. Further, the image synthesis unit 130 performs a determination process for determining whether or not both of the second evaluation values for the first image signal and the second image signal are equal to or less than a given threshold value for each synthesis target pixel. When it is determined that both the two evaluation values are equal to or less than the given threshold value, the first image signal and the second image signal are combined based on the first evaluation value, and both the second evaluation values are given. When it is determined that the value is larger than the given threshold value, the first image signal and the second image signal may be combined based on the second evaluation value.

ここで、第1の画像信号とは、前述した近点画像を表す信号のことをいい、例えば図2(B)の画像IM1を表す信号のことをいう。一方、第2の画像信号とは、前述した遠点画像を表す信号のことをいい、例えば図2(C)の画像IM2を表す信号のことをいう。   Here, the first image signal refers to a signal representing the above-described near-point image, for example, a signal representing the image IM1 in FIG. On the other hand, the second image signal refers to a signal representing the far point image described above, for example, a signal representing the image IM2 in FIG.

またここで、第1のパターン画像信号とは、前述した近点パターン画像を表す信号のことをいい、例えば図3(B)の画像IM3を表す信号のことをいう。一方、第2のパターン画像信号とは、前述した遠点パターン画像を表す信号のことをいい、例えば図3(C)の画像IM4を表す信号のことをいう。   Here, the first pattern image signal refers to a signal representing the above-described near point pattern image, for example, a signal representing the image IM3 in FIG. 3B. On the other hand, the second pattern image signal refers to a signal representing the far-point pattern image described above, for example, a signal representing the image IM4 in FIG.

これにより、第1の画像信号と第2の画像信号についての第2評価値が共に所与の閾値以下であると判定した場合には、画像合成処理に有効な第2評価値が算出されていないと判定し、第1評価値に基づいて第1の画像信号と第2の画像信号の合成処理を行うこと等が可能になる。また、第1の画像信号と第2の画像信号についての第2評価値が共に所与の閾値よりも大きいと判定した場合には、画像合成処理に有効な第2評価値が算出されていると判定し、第2評価値に基づいて第1の画像信号と第2の画像信号の合成処理を行うこと等が可能になる。   As a result, when it is determined that the second evaluation values for the first image signal and the second image signal are both equal to or less than a given threshold, a second evaluation value effective for the image composition process is calculated. It can be determined that the first image signal and the second image signal are combined based on the first evaluation value. Further, when it is determined that the second evaluation values for the first image signal and the second image signal are both greater than a given threshold value, a second evaluation value effective for the image composition process is calculated. And the first image signal and the second image signal can be combined based on the second evaluation value.

すなわち、2つの画像信号と2つのパターン画像信号を取得する場合にも、第1評価値と第2評価値の中から有効な評価値を選択して、画像合成処理を行うこと等が可能になる。なお、この場合にも、第1評価値の補間処理等を行っても良い。   That is, even when two image signals and two pattern image signals are acquired, it is possible to select an effective evaluation value from the first evaluation value and the second evaluation value and perform image composition processing, etc. Become. In this case as well, the first evaluation value interpolation processing or the like may be performed.

また、画像取得部110は、コヒーレント光源と光空間変調器とを用いて幾何パターンを投影して撮像された複数のパターン画像信号を撮像部200から取得してもよい。   The image acquisition unit 110 may acquire a plurality of pattern image signals captured by projecting a geometric pattern using a coherent light source and a spatial light modulator from the imaging unit 200.

これにより、明瞭な任意の幾何パターンが映されたパターン画像信号を取得すること等が可能になる。   This makes it possible to acquire a pattern image signal in which a clear arbitrary geometric pattern is reflected.

また、画像取得部110は、非可視波長のコヒーレント光源と光空間変調器とを用いて幾何パターンを投影して撮像された複数のパターン画像信号を撮像部200から取得してもよい。   Further, the image acquisition unit 110 may acquire a plurality of pattern image signals captured by projecting a geometric pattern using a coherent light source having a non-visible wavelength and an optical spatial modulator from the imaging unit 200.

これにより、近点画像と同じタイミングに撮像された近点パターン画像のパターン画像信号と、遠点画像と同じタイミングに撮像された遠点パターン画像のパターン画像信号とを取得すること等が可能になる。   This makes it possible to acquire the pattern image signal of the near point pattern image captured at the same timing as the near point image and the pattern image signal of the far point pattern image captured at the same timing as the far point image. Become.

また、本実施形態の画像処理装置100は、撮像装置400や内視鏡400の構成要素としてもよい。これらの撮像装置400や内視鏡400は、画像処理装置100と、撮像部200と、被写体に対して幾何パターンを投影するパターン投影部300と、を含んでもよい。   Further, the image processing apparatus 100 according to the present embodiment may be a component of the imaging apparatus 400 or the endoscope 400. The imaging device 400 and the endoscope 400 may include the image processing device 100, the imaging unit 200, and a pattern projection unit 300 that projects a geometric pattern onto a subject.

なお、本実施形態の画像処理装置100等は、その処理の一部または大部分をプログラムにより実現してもよい。この場合には、CPU等のプロセッサーがプログラムを実行することで、本実施形態の画像処理装置100等が実現される。具体的には、情報記憶媒体に記憶されたプログラムが読み出され、読み出されたプログラムをCPU等のプロセッサーが実行する。ここで、情報記憶媒体(コンピューターにより読み取り可能な媒体)は、プログラムやデータなどを格納するものであり、その機能は、光ディスク(DVD、CD等)、HDD(ハードディスクドライブ)、或いはメモリー(カード型メモリー、ROM等)などにより実現できる。そして、CPU等のプロセッサーは、情報記憶媒体に格納されるプログラム(データ)に基づいて本実施形態の種々の処理を行う。即ち、情報記憶媒体には、本実施形態の各部としてコンピューター(操作部、処理部、記憶部、出力部を備える装置)を機能させるためのプログラム(各部の処理をコンピューターに実行させるためのプログラム)が記憶される。   Note that the image processing apparatus 100 or the like according to the present embodiment may realize part or most of the processing by a program. In this case, the image processing apparatus 100 according to the present embodiment is realized by a processor such as a CPU executing a program. Specifically, a program stored in the information storage medium is read, and a processor such as a CPU executes the read program. Here, the information storage medium (computer-readable medium) stores programs, data, and the like, and functions as an optical disk (DVD, CD, etc.), HDD (hard disk drive), or memory (card type). It can be realized by memory, ROM, etc. A processor such as a CPU performs various processes according to the present embodiment based on a program (data) stored in the information storage medium. That is, in the information storage medium, a program for causing a computer (an apparatus including an operation unit, a processing unit, a storage unit, and an output unit) to function as each unit of the present embodiment (a program for causing the computer to execute processing of each unit) Is memorized.

以上のように本実施形態について詳細に説明したが、本発明の新規事項及び効果から実体的に逸脱しない多くの変形が可能であることは当業者には容易に理解できるであろう。従って、このような変形例はすべて本発明の範囲に含まれるものとする。例えば、明細書又は図面において、少なくとも一度、より広義または同義な異なる用語と共に記載された用語は、明細書又は図面のいかなる箇所においても、その異なる用語に置き換えることができる。また、画像処理装置100、撮像装置400、内視鏡400等の構成、動作も本実施形態で説明したものに限定されず、種々の変形実施が可能である。   Although the present embodiment has been described in detail as described above, it will be easily understood by those skilled in the art that many modifications can be made without departing from the novel matters and effects of the present invention. Accordingly, all such modifications are intended to be included in the scope of the present invention. For example, a term described at least once together with a different term having a broader meaning or the same meaning in the specification or the drawings can be replaced with the different term in any part of the specification or the drawings. The configurations and operations of the image processing apparatus 100, the imaging apparatus 400, the endoscope 400, and the like are not limited to those described in the present embodiment, and various modifications can be made.

100 画像処理装置、110 画像取得部、120 評価値算出部、
130 画像合成部、200 撮像部、300 パターン投影部、
400 撮像装置(内視鏡)
100 image processing apparatus, 110 image acquisition unit, 120 evaluation value calculation unit,
130 image composition unit, 200 imaging unit, 300 pattern projection unit,
400 Imaging device (endoscope)

Claims (18)

複数の画像信号の取得処理を行う画像取得部と、
取得した前記画像信号に基づいて評価値の算出処理を行う評価値算出部と、
前記評価値に基づいて前記複数の画像信号の合成処理を行う画像合成部と、
を含み、
前記画像取得部は、
合焦物体位置の異なる前記複数の画像信号を撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された前記合焦物体位置の異なる複数のパターン画像信号を前記撮像部から取得し、
前記評価値算出部は、
前記複数のパターン画像信号に基づいて第1評価値を算出すると共に、前記複数の画像信号に基づいて第2評価値を算出し、
前記画像合成部は、
前記第1評価値と前記第2評価値との比較処理を行い、前記比較処理の結果に基づいて、前記複数の画像信号の前記合成処理を行うことを特徴とする画像処理装置。
An image acquisition unit for acquiring a plurality of image signals;
An evaluation value calculation unit that performs an evaluation value calculation process based on the acquired image signal;
An image composition unit that performs composition processing of the plurality of image signals based on the evaluation value;
Including
The image acquisition unit
The plurality of image signals having different in-focus object positions are acquired from the imaging unit, and the plurality of pattern image signals having different in-focus object positions captured by projecting a geometric pattern onto a subject are acquired from the imaging unit,
The evaluation value calculation unit
Calculating a first evaluation value based on the plurality of pattern image signals, and calculating a second evaluation value based on the plurality of image signals;
The image composition unit
An image processing apparatus that performs a comparison process between the first evaluation value and the second evaluation value, and performs the synthesis process of the plurality of image signals based on a result of the comparison process.
請求項1において、
前記評価値算出部は、
前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に前記第1評価値を算出すると共に、前記複数の画像信号の前記合成対象画素毎に前記第2評価値を算出し、
前記画像合成部は、
前記合成対象画素毎に前記第1評価値と前記第2評価値との比較処理を行って、前記比較処理結果に基づいて、前記複数の画像信号の前記合成処理を前記合成対象画素毎に行うことを特徴とする画像処理装置。
In claim 1,
The evaluation value calculation unit
The first evaluation value is calculated for each synthesis target pixel that is a pixel that is the target of the synthesis process in the plurality of pattern image signals, and the second evaluation value is calculated for each synthesis target pixel of the plurality of image signals. Calculate
The image composition unit
A comparison process between the first evaluation value and the second evaluation value is performed for each synthesis target pixel, and the synthesis process of the plurality of image signals is performed for each synthesis target pixel based on the comparison process result. An image processing apparatus.
請求項1又は2において、
前記評価値算出部は、
前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に、算出した前記第1評価値が所与の閾値以下であるか否かの判定処理を行い、前記第1評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に対して補間処理を行うことを特徴とする画像処理装置。
In claim 1 or 2,
The evaluation value calculation unit
In each of the plurality of pattern image signals, a determination process is performed to determine whether or not the calculated first evaluation value is equal to or less than a given threshold value for each synthesis target pixel that is a pixel that is a target of the synthesis process. An image processing apparatus characterized by performing an interpolation process on the first evaluation value when it is determined that the evaluation value is equal to or less than the given threshold value.
請求項3において、
前記評価値算出部は、
前記第1評価値が前記所与の閾値以下であると判定した場合に、前記補間処理として、0次補間処理及び線形補間処理、モルフォロジー膨張処理のうちのいずれかの処理を前記第1評価値に対して行うことを特徴とする画像処理装置。
In claim 3,
The evaluation value calculation unit
When it is determined that the first evaluation value is less than or equal to the given threshold value, any one of a zero-order interpolation process, a linear interpolation process, and a morphological expansion process is performed as the interpolation process. An image processing apparatus characterized by being performed on
請求項3又は4において、
前記画像取得部は、
前記複数のパターン画像信号を前記撮像部から取得すると共に、先に投影した前記幾何パターンと異なる幾何パターンを前記被写体に投影して撮像された複数の相補パターン画像信号を前記撮像部から取得し、
前記評価値算出部は、
前記複数のパターン画像信号から算出した前記第1評価値が、前記所与の閾値以下であると判定した前記合成対象画素に対して、前記複数の相補パターン画像に基づいて前記第1評価値を算出し直す処理を前記補間処理として行うことを特徴とする画像処理装置。
In claim 3 or 4,
The image acquisition unit
The plurality of pattern image signals are acquired from the imaging unit, and a plurality of complementary pattern image signals captured by projecting a geometric pattern different from the previously projected geometric pattern onto the subject are acquired from the imaging unit,
The evaluation value calculation unit
The first evaluation value calculated from the plurality of pattern image signals is determined based on the plurality of complementary pattern images for the synthesis target pixel determined to be equal to or less than the given threshold value. An image processing apparatus that performs a recalculation process as the interpolation process.
請求項1乃至5のいずれかにおいて、
前記画像合成部は、
前記複数のパターン画像信号において前記合成処理の対象となる画素である合成対象画素毎に、算出した前記第2評価値が所与の閾値以下であるか否かの判定処理を行い、
前記第2評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて前記合成処理を行い、
前記第2評価値が前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記合成処理を行うことを特徴とする画像処理装置。
In any one of Claims 1 thru | or 5,
The image composition unit
For each synthesis target pixel that is a pixel that is a target of the synthesis process in the plurality of pattern image signals, a determination process is performed to determine whether the calculated second evaluation value is equal to or less than a given threshold value,
If it is determined that the second evaluation value is less than or equal to the given threshold value, the combining process is performed based on the first evaluation value,
An image processing apparatus, wherein when it is determined that the second evaluation value is greater than the given threshold value, the composition processing is performed based on the second evaluation value.
請求項6において、
前記画像合成部は、
前記第2評価値が前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて画像合成係数を算出し、前記画像合成係数を用いて前記合成対象画素毎に前記合成処理を行い、
前記第2評価値が前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記画像合成係数を算出し、前記画像合成係数を用いて前記合成対象画素毎に前記合成処理を行うことを特徴とする画像処理装置。
In claim 6,
The image composition unit
When it is determined that the second evaluation value is equal to or less than the given threshold, an image synthesis coefficient is calculated based on the first evaluation value, and the synthesis target pixel is used for each synthesis target pixel using the image synthesis coefficient. Perform the synthesis process,
If it is determined that the second evaluation value is greater than the given threshold value, the image synthesis coefficient is calculated based on the second evaluation value, and for each synthesis target pixel using the image synthesis coefficient An image processing apparatus that performs the composition processing.
請求項1乃至7のいずれかにおいて、
前記画像取得部は、
第1の画像信号と、前記第1の画像信号と前記合焦物体位置の異なる第2の画像信号とを前記撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された第1のパターン画像信号と、前記第1のパターン画像信号と前記合焦物体位置の異なる第2のパターン画像信号とを前記撮像部から取得し、
前記評価値算出部は、
前記合成処理の対象となる画素である合成対象画素毎に、前記第1のパターン画像信号と前記第2のパターン画像信号についての前記第1評価値を算出すると共に、前記第1の画像信号と前記第2の画像信号についての前記第2評価値を算出し、
前記画像合成部は、
前記合成対象画素毎に、前記第1の画像信号と前記第2の画像信号についての前記第2評価値が共に所与の閾値以下であるか否かの判定処理を行い、
前記第2評価値が共に前記所与の閾値以下であると判定した場合には、前記第1評価値に基づいて前記第1の画像信号と前記第2の画像信号の前記合成処理を行い、
前記第2評価値が共に前記所与の閾値よりも大きいと判定した場合には、前記第2評価値に基づいて前記第1の画像信号と前記第2の画像信号の前記合成処理を行うことを特徴とする画像処理装置。
In any one of Claims 1 thru | or 7,
The image acquisition unit
The first image signal, the first image signal, and the second image signal having a different in-focus object position are acquired from the imaging unit, and the first image signal is captured by projecting a geometric pattern onto the subject. A pattern image signal, the first pattern image signal, and a second pattern image signal having a different focused object position are acquired from the imaging unit,
The evaluation value calculation unit
The first evaluation value for the first pattern image signal and the second pattern image signal is calculated for each synthesis target pixel that is a pixel that is a target of the synthesis process, and the first image signal and Calculating the second evaluation value for the second image signal;
The image composition unit
For each of the synthesis target pixels, a determination process is performed to determine whether or not both of the second evaluation values for the first image signal and the second image signal are equal to or less than a given threshold value,
If it is determined that both of the second evaluation values are less than or equal to the given threshold value, the composition processing of the first image signal and the second image signal is performed based on the first evaluation value,
When it is determined that both of the second evaluation values are larger than the given threshold value, the synthesis processing of the first image signal and the second image signal is performed based on the second evaluation value. An image processing apparatus.
請求項1乃至8のいずれかにおいて、
前記評価値算出部は、
前記複数のパターン画像信号の輝度値を前記第1評価値として算出することを特徴とする画像処理装置。
In any one of Claims 1 thru | or 8.
The evaluation value calculation unit
An image processing apparatus, wherein brightness values of the plurality of pattern image signals are calculated as the first evaluation value.
請求項1乃至9のいずれかにおいて、
前記評価値算出部は、
前記複数の画像信号のコントラスト又はエッジ成分を表す前記第2評価値を算出することを特徴とする画像処理装置。
In any one of Claims 1 thru | or 9,
The evaluation value calculation unit
An image processing apparatus that calculates the second evaluation value representing a contrast or an edge component of the plurality of image signals.
請求項1乃至10のいずれかにおいて、
前記画像取得部は、
光学劣化関数に基づいて設定された前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得することを特徴とする画像処理装置。
In any one of Claims 1 thru | or 10.
The image acquisition unit
An image processing apparatus, wherein the plurality of pattern image signals captured by projecting the geometric pattern set based on an optical degradation function are acquired from the imaging unit.
請求項11において、
前記画像取得部は、
前記光学劣化関数に基づいて、ぼけ半径Rに対してドット間距離dがd≧2R(d及びRは正の整数)となるように設定されたドットパターンを投影して撮像された前記複数のパターン画像信号を取得することを特徴とする画像処理装置。
In claim 11,
The image acquisition unit
Based on the optical degradation function, the plurality of images captured by projecting a dot pattern set such that the inter-dot distance d is d ≧ 2R with respect to the blur radius R (d and R are positive integers) An image processing apparatus characterized by acquiring a pattern image signal.
請求項1乃至12のいずれかにおいて、
前記画像取得部は、
コヒーレント光源と光空間変調器とを用いて前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得することを特徴とする画像処理装置。
In any one of Claims 1 to 12,
The image acquisition unit
An image processing apparatus, wherein the plurality of pattern image signals captured by projecting the geometric pattern using a coherent light source and a spatial light modulator are acquired from the imaging unit.
請求項13において、
前記画像取得部は、
非可視波長の前記コヒーレント光源と前記光空間変調器とを用いて前記幾何パターンを投影して撮像された前記複数のパターン画像信号を前記撮像部から取得することを特徴とする画像処理装置。
In claim 13,
The image acquisition unit
An image processing apparatus, wherein the plurality of pattern image signals captured by projecting the geometric pattern using the coherent light source having an invisible wavelength and the spatial light modulator are acquired from the imaging unit.
請求項1乃至14のいずれかに記載の画像処理装置と、
前記撮像部と、
前記被写体に対して前記幾何パターンを投影するパターン投影部と、
を含むことを特徴とする撮像装置。
An image processing device according to any one of claims 1 to 14,
The imaging unit;
A pattern projection unit that projects the geometric pattern onto the subject;
An imaging apparatus comprising:
請求項1乃至14のいずれかに記載の画像処理装置と、
前記撮像部と、
前記被写体に対して前記幾何パターンを投影するパターン投影部と、
を含むことを特徴とする内視鏡。
An image processing device according to any one of claims 1 to 14,
The imaging unit;
A pattern projection unit that projects the geometric pattern onto the subject;
The endoscope characterized by including.
複数の画像信号の取得処理を行う画像取得部と、
取得した前記画像信号に基づいて評価値の算出処理を行う評価値算出部と、
前記評価値に基づいて前記複数の画像信号の合成処理を行う画像合成部として、
コンピューターを機能させ、
前記画像取得部は、
合焦物体位置の異なる前記複数の画像信号を撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された前記合焦物体位置の異なる複数のパターン画像信号を前記撮像部から取得し、
前記評価値算出部は、
前記複数のパターン画像信号に基づいて第1評価値を算出すると共に、前記複数の画像信号に基づいて第2評価値を算出し、
前記画像合成部は、
前記第1評価値と前記第2評価値との比較処理を行って、前記比較処理結果に基づいて、前記複数の画像信号の前記合成処理を行うことを特徴とするプログラム。
An image acquisition unit for acquiring a plurality of image signals;
An evaluation value calculation unit that performs an evaluation value calculation process based on the acquired image signal;
As an image composition unit that performs composition processing of the plurality of image signals based on the evaluation value,
Make the computer work,
The image acquisition unit
The plurality of image signals having different in-focus object positions are acquired from the imaging unit, and the plurality of pattern image signals having different in-focus object positions captured by projecting a geometric pattern onto a subject are acquired from the imaging unit,
The evaluation value calculation unit
Calculating a first evaluation value based on the plurality of pattern image signals, and calculating a second evaluation value based on the plurality of image signals;
The image composition unit
A program for performing comparison processing between the first evaluation value and the second evaluation value, and performing the synthesis processing of the plurality of image signals based on the comparison processing result.
合焦物体位置の異なる複数の画像信号を撮像部から取得すると共に、被写体に幾何パターンを投影して撮像された前記合焦物体位置の異なる複数のパターン画像信号を前記撮像部から取得し、
前記複数のパターン画像信号に基づいて第1評価値を算出すると共に、前記複数の画像信号に基づいて第2評価値を算出し、
前記第1評価値と前記第2評価値との比較処理を行い、前記比較処理の結果に基づいて、前記複数の画像信号の合成処理を行うことを特徴とする画像処理方法。
A plurality of image signals with different in-focus object positions are acquired from the imaging unit, and a plurality of pattern image signals with different in-focus object positions captured by projecting a geometric pattern onto a subject are acquired from the imaging unit,
Calculating a first evaluation value based on the plurality of pattern image signals, and calculating a second evaluation value based on the plurality of image signals;
An image processing method comprising performing comparison processing between the first evaluation value and the second evaluation value, and combining the plurality of image signals based on a result of the comparison processing.
JP2012098841A 2012-04-24 2012-04-24 Image processing device, imaging device, endoscope, program and image processing method Pending JP2013228798A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012098841A JP2013228798A (en) 2012-04-24 2012-04-24 Image processing device, imaging device, endoscope, program and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012098841A JP2013228798A (en) 2012-04-24 2012-04-24 Image processing device, imaging device, endoscope, program and image processing method

Publications (1)

Publication Number Publication Date
JP2013228798A true JP2013228798A (en) 2013-11-07

Family

ID=49676391

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012098841A Pending JP2013228798A (en) 2012-04-24 2012-04-24 Image processing device, imaging device, endoscope, program and image processing method

Country Status (1)

Country Link
JP (1) JP2013228798A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015213615A (en) * 2014-05-09 2015-12-03 学校法人 名城大学 Image generating method, image generating device, and endoscopic examining apparatus including the same
WO2016178326A1 (en) * 2015-05-07 2016-11-10 オリンパス株式会社 Image processing device, imaging device, image processing method, and storage medium storing image processing program for image processing device
WO2016203626A1 (en) * 2015-06-18 2016-12-22 オリンパス株式会社 Endoscope system and illumination device
WO2018042786A1 (en) * 2016-09-05 2018-03-08 株式会社Screenホールディングス Image processing method, image processing device, and imaging device
JP2018096931A (en) * 2016-12-16 2018-06-21 日立Geニュークリア・エナジー株式会社 Fuel arrangement confirmation method and fuel arrangement confirmation device
WO2020026383A1 (en) * 2018-08-01 2020-02-06 オリンパス株式会社 Endoscopic device, endoscopic device operating method, and program
JP7454417B2 (en) 2020-03-18 2024-03-22 ソニー・オリンパスメディカルソリューションズ株式会社 Medical control device and medical observation system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015213615A (en) * 2014-05-09 2015-12-03 学校法人 名城大学 Image generating method, image generating device, and endoscopic examining apparatus including the same
WO2016178326A1 (en) * 2015-05-07 2016-11-10 オリンパス株式会社 Image processing device, imaging device, image processing method, and storage medium storing image processing program for image processing device
CN107533756B (en) * 2015-05-07 2021-09-28 奥林巴斯株式会社 Image processing device, imaging device, image processing method, and storage medium storing image processing program for image processing device
CN107533756A (en) * 2015-05-07 2018-01-02 奥林巴斯株式会社 Image processing apparatus, camera device, image processing method and storage image processing unit image processing program storage medium
JPWO2016203626A1 (en) * 2015-06-18 2018-04-26 オリンパス株式会社 Endoscope system and illumination device
US10863885B2 (en) 2015-06-18 2020-12-15 Olympus Corporation Endoscope system and illumination device
WO2016203626A1 (en) * 2015-06-18 2016-12-22 オリンパス株式会社 Endoscope system and illumination device
JP2018042006A (en) * 2016-09-05 2018-03-15 株式会社Screenホールディングス Image processing method, image processing device, and imaging apparatus
WO2018042786A1 (en) * 2016-09-05 2018-03-08 株式会社Screenホールディングス Image processing method, image processing device, and imaging device
US11323630B2 (en) 2016-09-05 2022-05-03 SCREEN Holdings Co., Ltd. Image processing method, image processor, and image capturing device
JP2018096931A (en) * 2016-12-16 2018-06-21 日立Geニュークリア・エナジー株式会社 Fuel arrangement confirmation method and fuel arrangement confirmation device
WO2020026383A1 (en) * 2018-08-01 2020-02-06 オリンパス株式会社 Endoscopic device, endoscopic device operating method, and program
JPWO2020026383A1 (en) * 2018-08-01 2021-05-13 オリンパス株式会社 Endoscope device, operation method and program of the endoscope device
JP7454417B2 (en) 2020-03-18 2024-03-22 ソニー・オリンパスメディカルソリューションズ株式会社 Medical control device and medical observation system

Similar Documents

Publication Publication Date Title
US9749601B2 (en) Imaging device, image display method, and storage medium for displaying reconstruction image
JP2013228798A (en) Image processing device, imaging device, endoscope, program and image processing method
US8942506B2 (en) Image processing apparatus, image processing method, and program
US9992478B2 (en) Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium for synthesizing images
JP5991749B2 (en) Image processing apparatus and method
JP6548367B2 (en) Image processing apparatus, imaging apparatus, image processing method and program
JP4825748B2 (en) Image data processing method and imaging apparatus
JP2015204599A (en) Image processing device, image processing method, and image processing program
JP2016213702A (en) Image processing system, control method thereof, and control program
JP2011135563A (en) Image capturing apparatus, and image processing method
JP7234057B2 (en) Image processing method, image processing device, imaging device, lens device, program, storage medium, and image processing system
JP2013020610A (en) Image processing apparatus, image processing method and program
JP2011215707A (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP2010034964A (en) Image composition apparatus, image composition method and image composition program
WO2018129692A1 (en) Image refocusing
US9538074B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US10291899B2 (en) Image processing apparatus, image pickup apparatus, image processing method, and non-transitory computer-readable storage medium for generating restored image
JP5968088B2 (en) Image processing apparatus, image processing method, and program
JP2015115733A (en) Image processing method, image processor, imaging device, and image processing program
JP2016219985A (en) Image processing device, imaging apparatus, image processing method, and image processing program
JP2011199407A (en) Imaging device, image processor, and image processing method
WO2014077024A1 (en) Image processing device, image processing method and image processing program
JP6436840B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
US9924157B2 (en) Image processing device, image pickup apparatus, image processing method, and storage medium
JP2017050662A (en) Image processing system, imaging apparatus, and image processing program