JP7409607B2 - Image processing device, image processing method and program - Google Patents
Image processing device, image processing method and program Download PDFInfo
- Publication number
- JP7409607B2 JP7409607B2 JP2020022180A JP2020022180A JP7409607B2 JP 7409607 B2 JP7409607 B2 JP 7409607B2 JP 2020022180 A JP2020022180 A JP 2020022180A JP 2020022180 A JP2020022180 A JP 2020022180A JP 7409607 B2 JP7409607 B2 JP 7409607B2
- Authority
- JP
- Japan
- Prior art keywords
- correction
- patches
- patch
- pixels
- image processing
- 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.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Picture Signal Circuits (AREA)
Description
本発明は、画像のノイズ低減を行う画像処理装置、画像処理方法およびプログラムに関する。 The present invention relates to an image processing device, an image processing method, and a program for reducing noise in an image.
従来、カメラで撮影した画像に含まれるノイズを抑制するため、画像中の複数画素からなるパッチに着目し、パッチベースでノイズを低減する技術が知られている。非特許文献1に記載された処理は、撮影画像中の複数のパッチからなるパッチ集合を選び出してその平均と共分散行列で表されるパッチの確率モデルを生成し、パッチ集合を構成するパッチ各々に対して最大事後確率法に基づいたノイズ低減処理を行う。そして、ノイズ低減処理されたパッチを用い出力画像を生成する。この時、前記共分散行列の逆行列である逆共分散行列を算出し、これに基づいてノイズ低減処理後の画素値を決定する。 BACKGROUND ART Conventionally, in order to suppress noise contained in images taken with a camera, a technique is known in which noise is reduced on a patch basis by focusing on patches made up of multiple pixels in an image. The process described in Non-Patent Document 1 selects a patch set consisting of a plurality of patches in a photographed image, generates a probability model of the patch represented by the mean and covariance matrix, and calculates each patch constituting the patch set. Perform noise reduction processing based on the maximum a posteriori probability method. Then, an output image is generated using the noise-reduced patch. At this time, an inverse covariance matrix, which is an inverse matrix of the covariance matrix, is calculated, and based on this, a pixel value after the noise reduction process is determined.
しかしながら、従来の技術ではノイズ低減処理後のパッチ内の画素の値が異常値になる場合があり、結果として出力画像が破綻する可能性があった。 However, in the conventional technology, the value of a pixel within a patch after noise reduction processing may become an abnormal value, and as a result, there is a possibility that the output image may be corrupted.
本発明は、上記課題を鑑みてなされたものであり、ノイズ低減処理後の出力画像の破綻を抑制することを目的とする。 The present invention has been made in view of the above problems, and an object of the present invention is to suppress failure of an output image after noise reduction processing.
本発明は、画像のノイズを低減する画像処理装置であって、前記画像中に複数のパッチを設定する設定手段と、前記複数のパッチに基づいて共分散行列を算出する算出手段と、前記共分散行列を用いて前記複数のパッチに含まれる画素に対して、第1の補正を行う第1の補正手段と、前記複数のパッチに含まれる前記第1の補正前の画素に対して、前記第1の補正とは異なる第2の補正を行う第2の補正手段と、前記第1の補正後の前記複数のパッチそれぞれに異常があるか否かを判定する判定手段と、前記判定手段により異常と判定されたパッチに含まれる前記第1の補正後の画素を前記第2の補正の結果で修正する修正手段と、前記第1の補正後の画素もしくは、前記修正された画素で出力画像を生成する生成手段と、を有することを特徴とする。 The present invention provides an image processing device for reducing noise in an image, comprising: a setting means for setting a plurality of patches in the image; a calculation means for calculating a covariance matrix based on the plurality of patches; a first correction means for performing a first correction on pixels included in the plurality of patches using a dispersion matrix; and a first correction means for performing a first correction on pixels included in the plurality of patches using a dispersion matrix; a second correction means for performing a second correction different from the first correction; a determination means for determining whether or not each of the plurality of patches has an abnormality after the first correction; a correction means for correcting the first corrected pixels included in the patch determined to be abnormal with the result of the second correction; and an output image using the first corrected pixels or the corrected pixels. and generating means for generating.
本発明によれば、ノイズ低減処理後の出力画像の破綻を抑制することが出来る。 According to the present invention, it is possible to suppress failure of an output image after noise reduction processing.
(実施形態1)
本実施形態では、パッチベースのノイズ低減処理において共分散行列を用いた補正の異常を判定して、異常な場合に出力画像の破綻を回避する方法を説明する。
(Embodiment 1)
In this embodiment, a method will be described in which an abnormality in correction using a covariance matrix is determined in patch-based noise reduction processing, and in the case of an abnormality, a failure in the output image is avoided.
本実施形態では、着目パッチとその周辺の小領域のノイズ量に基づいて適応的に類似パッチ数を決定することで、好適な画質を得るノイズ低減処理の例について述べる。 In this embodiment, an example of noise reduction processing that obtains suitable image quality by adaptively determining the number of similar patches based on the amount of noise in a patch of interest and a small area around it will be described.
図1は、本実施形態に係るハードウェア構成を示すブロック図である。図1において、画像処理装置はCPU101、RAM102、HDD103、汎用インターフェース(I/F)104、モニタ108、及びメインバス109を備える。汎用I/Fは、カメラなどの撮像装置105や、マウス、キーボードなどの入力装置106、及びメモリカードなどの外部メモリ107をメインバス109に接続する。
FIG. 1 is a block diagram showing the hardware configuration according to this embodiment. In FIG. 1, the image processing apparatus includes a
以下では、CPU101がHDD103に格納された各種ソフトウェア(コンピュータプログラム)を動作させることで実現する各種処理について述べる。
Below, various processes realized by the
まず、CPU101はHDD103に格納されている画像処理アプリケーションを起動し、RAM102に展開するとともに、モニタ108にユーザインターフェース(UI)を表示する。続いて、HDD103や外部メモリ107に格納されている各種データ、撮像装置105で撮影された画像データ、入力装置106からの指示などがRAM102に転送される。さらに、画像処理アプリケーション内の処理に従って、RAM102に格納されているデータはCPU101からの指令に基づき各種演算される。演算結果はモニタ108に表示したり、HDD103または外部メモリ107に格納したりする。なお、HDD103や外部メモリ107に格納されている画像データがRAM102に転送されてもよい。また、不図示のネットワークを介してサーバから送信された画像データがRAM102に転送されてもよい。
First, the
上記の構成に於いて、CPU101からの指令に基づき、画像処理アプリケーションに画像データを入力してノイズを低減した画像データを生成し、出力する処理の詳細について説明する。
In the above configuration, details of a process of inputting image data to an image processing application, generating noise-reduced image data, and outputting the image data based on a command from the
ここで、パッチベースのノイズ低減処理の概要について説明する。入力画像データの一部を切りだした部分画像をパッチと呼ぶ。着目パッチ近傍の所定の参照領域に存在する複数のパッチを参照パッチとし、着目パッチに対応したノイズ低減処理をする際に参照する。パッチベースのノイズ低減処理では、参照パッチのうち、着目パッチの画素値分布と類似したパッチを類似パッチとして検出し、それらをパッチ集合とする。なお、複数の参照パッチの中には着目パッチ自身が含まれていても構わない。パッチ集合に基づいて、各類似パッチに対してノイズ低減処理を実行する。ノイズを低減した類似パッチを集約(Aggregation)することにより、入力画像データに対してノイズ低減処理した画像を生成する。 Here, an overview of patch-based noise reduction processing will be explained. A partial image obtained by cutting out a part of input image data is called a patch. A plurality of patches existing in a predetermined reference area near the patch of interest are used as reference patches, and are referred to when performing noise reduction processing corresponding to the patch of interest. In patch-based noise reduction processing, patches similar to the pixel value distribution of the patch of interest are detected from among the reference patches as similar patches, and these are set as a patch set. Note that the patch of interest itself may be included among the plurality of reference patches. Noise reduction processing is performed on each similar patch based on the patch set. By aggregating similar patches with reduced noise, an image in which input image data is subjected to noise reduction processing is generated.
図2は、本実施形態にかかる画像処理のブロック図である。 FIG. 2 is a block diagram of image processing according to this embodiment.
画像入力部201は、入力画像データを取得する。
The
着目パッチ設定部202は、入力画像データから所定の形状の部分画像を切り出し着目パッチとする。本実施形態では、所定の形状を6画素×6画素の正方形とする。
A patch of
類似パッチ検出部203は、着目パッチ近傍の所定の参照領域に存在する複数のパッチを参照パッチとして設定し、参照パッチの内で着目パッチに類似するものを類似パッチとして検出する。各参照パッチは着目パッチと同一の形状である。また、本実施形態では類似パッチの中に着目パッチを含むものとする。
The similar
共分散行列算出部204は、複数の類似パッチに基づいて共分散行列を算出する。
The covariance
第1の補正部205は、共分散行列を用いて複数の類似パッチを補正する。
The
異常判定部206は、補正した複数の類似パッチ各々に対して、異常であるか否(正常である)かを判定する。
The
第2の補正部207は、異常判定部206で異常と判定された場合に、第1の補正前のパッチに対して、第1の補正とは異なる補正を行う。パッチ修正部208は、第2の補正による結果を用いて複数の類似パッチを修正する。パッチ集約部209は、補正された複数の類似パッチを集約(Aggregation)して、ノイズ低減された出力画像を生成する。
When the
パッチベースのノイズ低減処理において、複数の類似パッチの補正前後の変化から補正後のパッチの異常を判定する異常判定部を持ち、異常である場合は別の補正を行ってパッチを修正する点が本発明の特徴である。本実施形態では、2つの異なる補正処理部を持ち、異常判定部の判定結果に応じて2つの補正処理部による補正結果を選択して用いる構成を説明する。本実施形態では、処理対象パッチについて、第1の補正結果が異常であると判定された場合にのみ、第2の補正部207が当該パッチを補正し、パッチ修正部208が補正された結果を用いて当該パッチを修正する構成について説明する。
In patch-based noise reduction processing, it has an abnormality determination section that determines abnormalities in the patch after correction based on changes in multiple similar patches before and after correction, and if it is abnormal, performs another correction to correct the patch. This is a feature of the present invention. In this embodiment, a configuration will be described in which there are two different correction processing units, and correction results from the two correction processing units are selected and used according to the determination result of the abnormality determination unit. In this embodiment, only when it is determined that the first correction result is abnormal for the patch to be processed, the
図3は、本実施形態にかかる画像処理のフローチャートである。 FIG. 3 is a flowchart of image processing according to this embodiment.
ステップS301で画像入力部201は、入力画像データを取得する。また、集約用画像データをゼロで初期化する。集約用画像データは分母画像データと分子画像データからなり、いずれも入力画像データと同じ画素数である。
In step S301, the
ステップS302で着目パッチ設定部202は、着目パッチを1つ設定する。一般に1つの入力画像データに対して複数のパッチを着目パッチとして設定することができる。本ステップ以降の処理は、設定する着目パッチの位置を変えて繰り返し実行される。その際、すべてのパッチを1回ずつ着目パッチとして設定するように制御してもよいし、一部のパッチのみを着目パッチとして設定するように制御してもよい。本実施形態では、左上からラスタ順に全てのパッチを着目パッチとして設定する。前述の通り、本実施形態では入力画像データから6画素×6画素の正方形の部分画像を切り出し着目パッチとする。つまり着目パッチは36画素からなる。以下では、着目パッチを、36画素を縦に並べた列ベクトルTで表す。一般に着目パッチがM画素からなる場合、着目パッチを、M画素を縦に並べた列ベクトルTで表す。
In step S302, the patch of interest setting
ステップS303で類似パッチ検出部203は、類似パッチを検出する。まず、着目パッチT近傍の所定の参照領域に存在する複数のパッチを参照パッチとして設定する。各参照パッチの形状は、着目パッチTの形状と一致する。以下では、i番目の参照パッチを、M画素を縦に並べた列ベクトルR_iで表す。次に、複数の参照パッチそれぞれについて、着目パッチTとの類似度を算出する。類似度は、参照パッチと着目パッチTの、各画素の差分二乗和(SSD)により算出される。具体的には、i番目の参照パッチR_iの類似度SSD_iは以下の式(1)で算出される。
In step S303, the similar
ここで、ベクトルTのj番目の成分(画素値)をT(j)で表している。この算出方法から明らかなように、類似度SSD_iの値が小さいほど、参照パッチR_iが着目パッチTに類似していることを意味する。さらに、複数の参照パッチの内から、類似度に基づいて一部のパッチを類似パッチとして検出する。本実施形態では、予め定める閾値より類似度が小さいパッチを類似パッチとして検出する。ここで検出された類似パッチの個数をNとし、i番目の類似パッチをP_iで表す。 Here, the j-th component (pixel value) of the vector T is represented by T(j). As is clear from this calculation method, the smaller the value of the similarity SSD_i, the more similar the reference patch R_i is to the patch T of interest. Furthermore, some patches are detected as similar patches from among the plurality of reference patches based on the degree of similarity. In this embodiment, patches whose degree of similarity is smaller than a predetermined threshold are detected as similar patches. Let N be the number of similar patches detected here, and represent the i-th similar patch as P_i.
ステップS304で共分散行列算出部204は、複数の類似パッチに基づいて共分散行列を算出する。まず、複数の類似パッチに基づいて基準パッチQを以下の式(2)で算出する。
In step S304, the covariance
次に、基準パッチQを用いてノイズ量パッチVを以下の式(3)で算出する。 Next, a noise amount patch V is calculated using the reference patch Q using the following equation (3).
ここで、kは定数、V_0は基準パッチQと同じ形状のベクトルであり、いずれも予め定めて保存しておく。 Here, k is a constant, and V_0 is a vector having the same shape as the reference patch Q, both of which are determined and stored in advance.
そして、複数の類似パッチに基づき基準パッチQを用いて、共分散行列Cを以下の式(4)で算出する。 Then, a covariance matrix C is calculated using the following equation (4) using a reference patch Q based on a plurality of similar patches.
ここでは、パッチを表すベクトルを行列とみなし、行列としての演算を行う。tは行列の転置である。ステップS305で、第1の補正部205は、複数の類似パッチに対して第1の補正処理を行う。図4は第1の補正処理のフローチャートである。各ステップは全て第1の補正部205が行う。以下では、第1の補正を行う前の類似パッチを第1補正前パッチ、第1の補正を行った後の類似パッチを第1補正後パッチと表す。
Here, a vector representing a patch is regarded as a matrix, and calculations are performed as a matrix. t is the transpose of the matrix. In step S305, the
ステップS401で、ステップS304で算出した共分散行列Cの逆行列である逆共分散行列C^-1を算出する。 In step S401, an inverse covariance matrix C^-1, which is an inverse matrix of the covariance matrix C calculated in step S304, is calculated.
ステップS402で、補正行列Hを以下の式(5)で算出する。 In step S402, a correction matrix H is calculated using the following equation (5).
ここでdiag(V)は主対角上にベクトルVの要素をもつ正方対角行列を表す。 Here, diag(V) represents a square diagonal matrix having elements of vector V on the main diagonal.
ステップS403で、複数の類似パッチそれぞれP_iに対応する補正済みパッチO_iを以下の式(6)で算出する。 In step S403, a corrected patch O_i corresponding to each of the plurality of similar patches P_i is calculated using the following equation (6).
ステップS306で、異常判定部206は、第1補正後パッチに対して異常判定を行う。図5は異常判定のフローチャートである。各ステップは全て異常判定部206が行う。
In step S306, the
ステップS501で、異常判定結果を記憶する判定データを初期化する。判定データには、全処理対象パッチについて正常(=「0」)か異常(=「1」)かを判定した結果と、全処理対象パッチの画素位置が記憶される。 In step S501, determination data that stores abnormality determination results is initialized. The determination data stores the results of determining whether all the processing target patches are normal (="0") or abnormal (="1") and the pixel positions of all the processing target patches.
ステップS502で、第1補正前パッチと第1補正後パッチの中から処理対象パッチをそれぞれ1つ選択する。第1補正前パッチから選択したパッチを処理対象パッチI、第1補正後パッチから選択したパッチを処理対象パッチI’とする。さらに、選択する両パッチは画素位置が一致するものとする。 In step S502, one patch to be processed is selected from the first patch before correction and the first patch after correction. The patch selected from the first pre-correction patch is designated as a processing target patch I, and the patch selected from the first post-correction patch is designated as a processing target patch I'. Furthermore, it is assumed that both patches to be selected have the same pixel position.
ステップS503で、処理対象パッチIと処理対象パッチI’各々について標準偏差σ_I、σ_I’を算出する。 In step S503, standard deviations σ_I and σ_I' are calculated for each of the processing target patch I and the processing target patch I'.
ステップS504で、以下の式(7)に基づいて、標準偏差σ_I、σ_I’の比率と閾値thを比較する。 In step S504, the ratio of the standard deviations σ_I and σ_I' is compared with the threshold value th based on the following equation (7).
比率が閾値th以上である場合は変化が大きいとしてS505に進み、そうでない場合にS506に進む。ここで、閾値thはあらかじめ設定された値でも良いし、パッチに含まれる各画素の統計量(平均値、分散)に基づく算出されるようにしても良い。 If the ratio is greater than or equal to the threshold th, it is determined that the change is large and the process proceeds to S505; otherwise, the process proceeds to S506. Here, the threshold th may be a preset value, or may be calculated based on the statistics (average value, variance) of each pixel included in the patch.
ステップS505で、処理対象パッチI’が異常であると判定し、判定データに処理対象パッチI’の画素位置と判定結果である「1」を出力する。 In step S505, it is determined that the patch I' to be processed is abnormal, and the pixel position of the patch I' to be processed and the determination result "1" are output as determination data.
ステップS506で、処理対象パッチI’が正常であると判定し、判定データに処理対象パッチI’の画素位置と判定結果である「0」を出力する。 In step S506, it is determined that the patch I' to be processed is normal, and the pixel position of the patch I' to be processed and the determination result "0" are output as determination data.
ステップS507で、全ての処理対象パッチが処理済みであるか否かを判定する。全ての処理対象パッチが処理済みである場合は異常判定処理を終了し、そうでない場合はS502に進む。 In step S507, it is determined whether all the processing target patches have been processed. If all the target patches have been processed, the abnormality determination process ends; otherwise, the process advances to S502.
ステップS307で、異常判定部206は、判定データに基づき全ての第1補正後パッチに対して補正結果が異常であるか否かを判定する。異常と判定された第1補正後パッチは、ステップS308へ進み、正常と判定された第1補正後パッチは、ステップS309に進む。
In step S307, the
ステップS308で、第2の補正部207は、異常と判定された第1補正後パッチに画素位置が対応する第1補正前パッチに対して、第2の補正を行う。第2の補正は、第1の補正とは異なる処理であり、本実施形態では、平均値フィルタを適用する。
In step S308, the
ステップS309で、パッチ修正部208は、第2の補正結果を用いて第1補正後パッチを修正する。具体的には、第1補正後パッチを第2の補正結果に置換する。
In step S309, the
ステップS310において、全ての着目パッチが処理済みであるか否かを判定する。全ての着目パッチが処理済みである場合にS311に進み、そうでない場合にS302に進む。 In step S310, it is determined whether all patches of interest have been processed. If all the patches of interest have been processed, the process advances to S311; otherwise, the process advances to S302.
ステップS311で、パッチ集約部209は、第1或いは第2の補正が成された複数の補正済みパッチに基づき集約用画像データを編集する。前述の通り、集約用画像データは分母画像データと分子画像データからなる。複数の補正済みパッチO_iそれぞれについて、全画素の値を分子用画像データの対応する位置に加算する。この位置は、入力画像データにおいて各画素が存在した位置である。また、分母用画像における同じ位置に1を加算する。
In step S311, the
以上が本実施形態の画像処理のフローである。 The above is the flow of image processing in this embodiment.
以上の処理により、共分散行列を用いたパッチベースのノイズ低減処理において、ノイズ低減後に異常が生じた場合でも当該異常を修正し、好適な出力画像を得ることができる。 Through the above processing, even if an abnormality occurs after noise reduction in patch-based noise reduction processing using a covariance matrix, the abnormality can be corrected and a suitable output image can be obtained.
なお、本実施形態の処理は、各種の形式の画像データに適用できる。例えばモノクロ画像に対して適用できるし、複数の色成分からなるカラー画像にも適用できるし、Bayer配列の画像にも適用できる。 Note that the processing of this embodiment can be applied to image data in various formats. For example, it can be applied to monochrome images, color images consisting of a plurality of color components, and Bayer array images.
また、参照パッチと着目パッチTの類似度を、各画素の差分二乗和(SSD)により算出したが、他の方法で算出してもよい。例えば、各画素の差分絶対値和(SAD)で算出してもよいし、各画素の差分の絶対値の最大値、最小値、平均値、中央値などを用いてもよい。 Further, although the similarity between the reference patch and the patch T of interest is calculated using the sum of squared differences (SSD) of each pixel, it may be calculated using other methods. For example, it may be calculated using the sum of absolute differences (SAD) of each pixel, or the maximum value, minimum value, average value, median value, etc. of the absolute value of the difference between each pixel may be used.
また、異常判定として、第1補正前パッチと第1補正後パッチの中から処理対象パッチをそれぞれ1つ選択し、パッチの標準偏差の比率と閾値thとを比較したが、他の方法で異常を判定してもよい。例えば、パッチの分散、平均、最小値、最大値など他の統計量の比もしくは差分を用いてもよい。また、比もしくは差分以外でも、変化量が分かれば良い。 In addition, for abnormality determination, we selected one patch to be processed from the first patch before correction and the first patch after correction, and compared the ratio of the standard deviation of the patch with the threshold th. may be determined. For example, a ratio or difference of other statistical quantities such as patch variance, average, minimum value, and maximum value may be used. Further, it is sufficient to know the amount of change other than the ratio or difference.
また、第2の補正として、第1補正前パッチに平均値フィルタを適用する例について述べたが、他の方法で補正してもよい。例えば、第1補正前パッチにガウシアンフィルタのようなノイズを低減可能なローパスフィルタを適用してもよい。他に、第1補正前パッチに対して、異常と判定された画素のみ補正を行わず、補正前の値をそのまま出力してもよいし、パッチ内の数画素から算出した平均画素値を出力してもよい。 Further, as the second correction, an example has been described in which an average value filter is applied to the patch before the first correction, but correction may be performed using other methods. For example, a low-pass filter capable of reducing noise, such as a Gaussian filter, may be applied to the first patch before correction. In addition, for the first pre-correction patch, only the pixels determined to be abnormal may be output without correction, and the value before correction may be output as is, or the average pixel value calculated from several pixels in the patch may be output. You may.
また、基準パッチを、複数の類似パッチの平均で算出したが、これに限らない。例えば、基準パッチの各画素の値を、複数の類似パッチの対応する画素の中央値や最小値などで定めても良い。共分散行列の異常を判定する異常判定部を持ち、共分散行列が正常であると判定された場合に通常の「パッチベースのノイズ低減処理」を行う。一方で、共分散行列が異常であると判定された場合には通常の「パッチベースのノイズ低減処理」とは異なる補正処理を行うことが本実施形態の主眼である。この補正処理は、本実施形態で説明したものに限らない。例えば、補正済みパッチを、補正対象の類似パッチ、基準パッチ、あるいはそれらの線形和として算出するなどの方法がある。 Further, although the reference patch is calculated as the average of a plurality of similar patches, the present invention is not limited to this. For example, the value of each pixel of the reference patch may be determined by the median value, minimum value, etc. of corresponding pixels of a plurality of similar patches. It has an anomaly determination unit that determines whether the covariance matrix is abnormal, and performs normal "patch-based noise reduction processing" when the covariance matrix is determined to be normal. On the other hand, the main focus of this embodiment is to perform a correction process different from the normal "patch-based noise reduction process" when it is determined that the covariance matrix is abnormal. This correction processing is not limited to that described in this embodiment. For example, there is a method of calculating the corrected patch as a similar patch to be corrected, a reference patch, or a linear sum thereof.
(実施形態2)
実施形態1では、補正されたパッチが異常であるか否かの判定をパッチ単位で行い、パッチ単位で修正処理を行う例について説明した。本実施形態では、補正されたパッチが異常であるか否かの判定処理を2段階で行う方法を説明する。
(Embodiment 2)
In the first embodiment, an example has been described in which it is determined whether or not a corrected patch is abnormal on a patch-by-patch basis, and correction processing is performed on a patch-by-patch basis. In this embodiment, a method will be described in which the process of determining whether or not a corrected patch is abnormal is performed in two stages.
具体的には、処理対象パッチ内の画素毎に異常判定する処理(1段階目)に加えて、1段階目の異常判定結果で異常と判定された画素の数を用いて処理対象パッチが異常であるか否かの判定処理(2段階目)を行う方法を説明する。実施形態1と共通の部分は説明を省略する。 Specifically, in addition to the process of determining abnormality for each pixel in the patch to be processed (first stage), the patch to be processed is determined to be abnormal using the number of pixels determined to be abnormal in the first stage abnormality determination result. A method for determining whether or not this is the case (second stage) will be explained. Description of parts common to Embodiment 1 will be omitted.
図6は、本実施形態にかかる画像処理のブロック図である。 FIG. 6 is a block diagram of image processing according to this embodiment.
第1の異常判定部601は、第1の補正を行った類似パッチ(=第1補正後パッチ)各々に対して、画素毎に異常であるか否(正常である)かを判定する。
The first
第2の異常判定部602は、より高精度に異常を判定するために、第1の異常判定結果を用いて第2の異常判定を行う。
The second
第2の補正部603は、第2の異常判定部602で異常と判定された場合に、第1の補正前のパッチに対して、第1の補正とは異なる補正を行う。
The
図7は、本実施形態にかかる画像処理のフローチャートである。 FIG. 7 is a flowchart of image processing according to this embodiment.
ステップS701で、第1の異常判定部601は、第1補正後パッチに対して異常判定を行う。
In step S701, the first
図8は、第1の異常判定のフローチャートである。各ステップは全て第1の異常判定部601が行う。
FIG. 8 is a flowchart of the first abnormality determination. All steps are performed by the first
ステップS801で、第1の異常判定結果を記憶する第1判定データを初期化する。第1判定データには、全処理対象パッチについて画素毎に正常(=「0」)か異常(=「1」)かを判定した結果と、処理対象パッチ毎に異常と判定された画素をカウントした値CNTと、パッチの画素位置が記憶される。CNTはゼロで初期化しておく。 In step S801, first determination data that stores the first abnormality determination result is initialized. The first judgment data includes the results of determining whether each pixel is normal (= "0") or abnormal (= "1") for all patches to be processed, and a count of pixels determined to be abnormal for each patch to be processed. The value CNT and the pixel position of the patch are stored. CNT is initialized with zero.
ステップS802は、ステップS502と同様の処理である。 Step S802 is the same process as step S502.
ステップS803で、処理対象パッチIと処理対象パッチI’から同じ位置の画素をそれぞれ1つ選択する。選択した画素を順にI_j、I’_jとする。 In step S803, one pixel at the same position is selected from each of the processing target patch I and the processing target patch I'. The selected pixels are designated as I_j and I'_j in order.
ステップS804で、画素I_j、I’_jの差分絶対値と閾値th1を比較する。ここで、閾値th1は、ノイズ量パッチVと予め定めた係数mを用いて以下の式(8)で算出される。 In step S804, the absolute difference value between pixels I_j and I'_j is compared with threshold value th1. Here, the threshold th1 is calculated by the following equation (8) using the noise amount patch V and a predetermined coefficient m.
差分絶対値が閾値th1以上である場合にS805に進み、そうでない場合にS806に進む。 If the absolute difference value is greater than or equal to the threshold th1, the process advances to S805; otherwise, the process advances to S806.
ステップS805で、第1判定データのCNTを1つインクリメントし、併せて画素位置も記憶しておく。 In step S805, CNT of the first determination data is incremented by one, and the pixel position is also stored.
ステップS806で、処理対象パッチ内の全画素が選択済みであるか否かを判定する。処理対象パッチ内の全画素が選択済みである場合は第1の異常判定処理を終了し、そうでない場合はS803に進む。 In step S806, it is determined whether all pixels in the patch to be processed have been selected. If all pixels in the patch to be processed have been selected, the first abnormality determination process ends; otherwise, the process advances to S803.
ステップS807で、全ての処理対象パッチが処理済みであるか否かを判定する。全ての処理対象パッチが処理済みである場合は第1の異常判定処理を終了し、そうでない場合はS802に進む。 In step S807, it is determined whether all the processing target patches have been processed. If all the target patches have been processed, the first abnormality determination process ends; otherwise, the process advances to S802.
ステップS702で、第2の異常判定部602は、第1の異常判定が行われたパッチに対して第1判定データに基づいて第2の異常判定を行う。
In step S702, the second
図9は、第2の異常判定のフローチャートである。各ステップは全て第2の異常判定部602が行う。
FIG. 9 is a flowchart of the second abnormality determination. All steps are performed by the second
ステップS901で、第1判定データを読み込み、第2判定データを初期化する。第2判定データには、全処理対象パッチについて正常(=「0」)か異常(=「1」)かを判定した結果と、全処理対象パッチの画素位置が記憶される。 In step S901, first determination data is read and second determination data is initialized. The second determination data stores the results of determining whether all the processing target patches are normal (="0") or abnormal (="1") and the pixel positions of all the processing target patches.
ステップS902で、ステップS502と同様の処理である。 Step S902 is the same process as step S502.
ステップS903で、CNTと予め設定しておいた閾値th2を比較する。閾値th2は、処理対象パッチを内の画素数のx%として設定し、例えばx=10の場合、th2=3(小数点切り捨て)となる。CNTが閾値2以上である場合にS904に進み、そうでない場合にS905に進む。 In step S903, CNT is compared with a preset threshold th2. The threshold value th2 is set as x% of the number of pixels in the patch to be processed. For example, when x=10, th2=3 (rounding down the decimal point). If CNT is equal to or greater than the threshold value 2, the process advances to S904; otherwise, the process advances to S905.
ステップS904で、処理対象パッチI’が異常であると判定し、判定データに処理対象パッチI’の画素位置と判定結果である「1」を出力する。 In step S904, it is determined that the patch I' to be processed is abnormal, and the pixel position of the patch I' to be processed and the determination result "1" are output as determination data.
ステップS905で、処理対象パッチI’が正常であると判定し、判定データに処理対象パッチI’の画素位置と判定結果である「0」を出力する。 In step S905, the patch to be processed I' is determined to be normal, and the pixel position of the patch to be processed I' and the determination result "0" are output as determination data.
ステップS906で、全ての処理対象パッチが処理済みであるか否かを判定する。全ての処理対象パッチが処理済みである場合は第2の異常判定処理を終了し、そうでない場合はS902に進む。 In step S906, it is determined whether all the processing target patches have been processed. If all the target patches have been processed, the second abnormality determination process ends; otherwise, the process advances to S902.
ステップS703で、第2の補正部603は、第1補正前パッチに対して、第2の補正を行う。第2の補正は、第1の補正とは異なる処理であり、本実施形態では、第1補正前パッチに対して、第1の異常判定でカウントアップされた画素のみを用いて平均値フィルタを適用する。
In step S703, the
以上、補正されたパッチが異常であるか否かの判定処理を2段階で行うことで、より精度良く第1の補正処理の異常結果を修正し、好適な出力画像を得ることができる。 As described above, by performing the process of determining whether or not a corrected patch is abnormal in two stages, it is possible to more accurately correct the abnormal result of the first correction process and obtain a suitable output image.
なお、異常判定として、第1補正前パッチと第1補正後パッチの中から処理対象パッチをそれぞれ1つ選択し、各パッチ内の同位置の画素毎に画素値の差分絶対値と閾値thとを比較したが、他の方法で異常を判定してもよい。例えば、処理対象パッチ内の各画素の画素値とノイズ量パッチV_iの平方根との差分を比較してもよい。或いは、処理対象パッチ内の全画素の平均値と当該パッチ内の各画素との差分を比較してもよい。 In addition, for abnormality determination, one patch to be processed is selected from the first patch before correction and the first patch after correction, and the absolute difference value of the pixel value and the threshold value th are calculated for each pixel at the same position in each patch. However, other methods may be used to determine abnormality. For example, the difference between the pixel value of each pixel in the patch to be processed and the square root of the noise amount patch V_i may be compared. Alternatively, the difference between the average value of all pixels in the patch to be processed and each pixel in the patch may be compared.
(その他の実施形態)
本発明は、前述の各実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける一つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。
(Other embodiments)
The present invention provides a system or device with a program that implements one or more functions of each of the above-described embodiments via a network or a storage medium, and one or more processors in the computer of the system or device reads the program. This can also be achieved by executing a process.
また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
前述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。 The above-described embodiments are merely examples of implementation of the present invention, and the technical scope of the present invention should not be construed as limited by these embodiments.
即ち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。例えば、二次関数係数演算部の一部は上位の制御手段から与えられる演算開始信号によって動作し、演算結果を保持しておき、画像が入力されている間は、ここで保持したデータ参照するのみにすることで電力を削減することが可能である。
That is, the present invention can be implemented in various forms without departing from its technical idea or its main features. For example, a part of the quadratic function coefficient calculation section is operated by a calculation start signal given from a higher-level control means, holds the calculation result, and refers to the data held here while an image is being input. It is possible to reduce power consumption by only using
Claims (9)
前記画像中に複数のパッチを設定する設定手段と
前記複数のパッチに基づいて共分散行列を算出する算出手段と
前記共分散行列を用いて前記複数のパッチに含まれる画素に対して、第1の補正を行う第1の補正手段と、
前記複数のパッチに含まれる前記第1の補正前の画素に対して、前記第1の補正とは異なる第2の補正を行う第2の補正手段と、
前記第1の補正後の前記複数のパッチそれぞれに異常があるか否かを判定する判定手段と、
前記判定手段により異常と判定されたパッチに含まれる前記第1の補正後の画素を前記第2の補正の結果で修正する修正手段と、
前記第1の補正後の画素もしくは、前記修正された画素で出力画像を生成する生成手段と、を有することを特徴とする画像処理装置。 An image processing device that reduces image noise,
a setting means for setting a plurality of patches in the image; a calculation means for calculating a covariance matrix based on the plurality of patches; and a calculation means for calculating a covariance matrix based on the plurality of patches; a first correction means for correcting;
a second correction unit that performs a second correction different from the first correction on the pixels included in the plurality of patches before the first correction;
determining means for determining whether or not each of the plurality of patches after the first correction has an abnormality;
correction means for correcting the pixels after the first correction, which are included in the patch determined to be abnormal by the determination means, with the result of the second correction;
An image processing apparatus comprising: a generating unit that generates an output image using the pixels after the first correction or the corrected pixels.
前記変化量は、差分と、比率との少なくともいずれか一つに基づき算出されることを特徴とする請求項2に記載の画像処理装置。 The statistic is at least one of the standard deviation, variance, maximum value pixel, and minimum value pixel of pixels included in the patch,
The image processing apparatus according to claim 2, wherein the amount of change is calculated based on at least one of a difference and a ratio.
設定手段が、前記画像中に複数のパッチを設定する設定工程と
算出手段が、前記複数のパッチに基づいて共分散行列を算出する算出工程と
第1の補正手段が、前記共分散行列を用いて前記複数のパッチに含まれる画素に対して、第1の補正を行う第1の補正工程と、
第2の補正手段が、前記複数のパッチに含まれる前記第1の補正前の画素に対して、前記第1の補正とは異なる第2の補正を行う第2の補正工程と、
判定手段が、前記第1の補正後の前記複数のパッチそれぞれに異常があるか否かを判定する判定工程と、
修正手段が、前記判定工程で異常と判定されたパッチに含まれる前記第1の補正後の画素を前記第2の補正の結果で修正する修正工程と、
生成手段が、前記第1の補正後の画素もしくは、前記修正された画素で出力画像を生成する生成工程と、を有することを特徴とする画像処理方法。 An image processing method for reducing image noise, the method comprising:
a setting step in which the setting means sets a plurality of patches in the image; a calculation step in which the calculation means calculates a covariance matrix based on the plurality of patches; and a first correction means using the covariance matrix. a first correction step of performing a first correction on pixels included in the plurality of patches;
a second correction step in which a second correction means performs a second correction different from the first correction on the pixels included in the plurality of patches before the first correction;
a determining step in which the determining means determines whether or not each of the plurality of patches after the first correction has an abnormality;
a correction step in which the correction means corrects the pixels after the first correction included in the patch determined to be abnormal in the determination step, using the result of the second correction;
An image processing method characterized in that the generating means has a generating step of generating an output image using the pixels after the first correction or the corrected pixels.
画像のノイズを低減する画像処理装置であって、
前記画像中に複数のパッチを設定する設定手段と
前記複数のパッチに基づいて共分散行列を算出する算出手段と
前記共分散行列を用いて前記複数のパッチに含まれる画素に対して、第1の補正を行う第1の補正手段と、
前記複数のパッチに含まれる前記第1の補正前の画素に対して、前記第1の補正とは異なる第2の補正を行う第2の補正手段と、
前記第1の補正後の前記複数のパッチそれぞれに異常があるか否かを判定する判定手段と、
前記判定手段により異常と判定されたパッチに含まれる前記第1の補正後の画素を前記第2の補正の結果で修正する修正手段と、
前記第1の補正後の画素もしくは、前記修正された画素で出力画像を生成する生成手段と、を有することを特徴とする画像処理装置として機能させるためのプログラム。
computer,
An image processing device that reduces image noise,
a setting means for setting a plurality of patches in the image; a calculation means for calculating a covariance matrix based on the plurality of patches; and a calculation means for calculating a covariance matrix based on the plurality of patches; a first correction means for correcting;
a second correction unit that performs a second correction different from the first correction on the pixels included in the plurality of patches before the first correction;
determining means for determining whether or not each of the plurality of patches after the first correction has an abnormality;
correction means for correcting the pixels after the first correction, which are included in the patch determined to be abnormal by the determination means, with the result of the second correction;
A program for functioning as an image processing apparatus, comprising: generating means for generating an output image using the pixels after the first correction or the corrected pixels.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020022180A JP7409607B2 (en) | 2020-02-13 | 2020-02-13 | Image processing device, image processing method and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020022180A JP7409607B2 (en) | 2020-02-13 | 2020-02-13 | Image processing device, image processing method and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2021129191A JP2021129191A (en) | 2021-09-02 |
| JP7409607B2 true JP7409607B2 (en) | 2024-01-09 |
Family
ID=77489040
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2020022180A Active JP7409607B2 (en) | 2020-02-13 | 2020-02-13 | Image processing device, image processing method and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7409607B2 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017041732A (en) | 2015-08-19 | 2017-02-23 | キヤノン株式会社 | Image processing device, image processing method, and program |
| JP2018185586A (en) | 2017-04-24 | 2018-11-22 | キヤノン株式会社 | Image processing apparatus, image processing method, and imaging apparatus |
| JP2019101686A (en) | 2017-11-30 | 2019-06-24 | キヤノン株式会社 | Image processor, method for processing image, and program |
-
2020
- 2020-02-13 JP JP2020022180A patent/JP7409607B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2017041732A (en) | 2015-08-19 | 2017-02-23 | キヤノン株式会社 | Image processing device, image processing method, and program |
| JP2018185586A (en) | 2017-04-24 | 2018-11-22 | キヤノン株式会社 | Image processing apparatus, image processing method, and imaging apparatus |
| JP2019101686A (en) | 2017-11-30 | 2019-06-24 | キヤノン株式会社 | Image processor, method for processing image, and program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2021129191A (en) | 2021-09-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7409606B2 (en) | Image processing device, image processing method and program | |
| JP6362333B2 (en) | Image processing apparatus, image processing method, and program | |
| CN110036279B (en) | Inspection device and inspection method | |
| US10388018B2 (en) | Image processing apparatus, image processing method, and storage medium | |
| EP2927864B1 (en) | Image processing device and image processing method | |
| US9558534B2 (en) | Image processing apparatus, image processing method, and medium | |
| US10740878B2 (en) | Image processing apparatus, image processing method, and non-transitory computer-readable storage medium | |
| JP5890547B2 (en) | Image processing device | |
| WO2014070489A1 (en) | Recursive conditional means image denoising | |
| CN109035167B (en) | Method, device, equipment and medium for processing multiple faces in image | |
| CN111415317A (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
| US20200143582A1 (en) | Image processing apparatus, image processing method, and storage medium | |
| JP7328096B2 (en) | Image processing device, image processing method, and program | |
| JP7409607B2 (en) | Image processing device, image processing method and program | |
| US11132776B2 (en) | Image processing device, image processing method, and image processing program for maintaining sharpness of image | |
| US20240354905A1 (en) | Information processing apparatus, information processing method, and storage medium | |
| US20240338933A1 (en) | Image generation apparatus, image generation method, image generation program, learning device, and learning data | |
| CN113822823B (en) | Method and system for point-nearest neighbor restoration of spatially variable blur kernel of aero-optic effect images | |
| US20130114888A1 (en) | Image processing apparatus, computer program product, and image processing method | |
| JP6254813B2 (en) | X-ray image processing apparatus and method, X-ray imaging apparatus, and program | |
| CN115829872A (en) | Method, device and equipment for enhancing image contrast and storage medium | |
| JP2021077037A (en) | Image processing apparatus, image processing method, and program | |
| JP2019176532A (en) | Image processing apparatus, image processing method, and program | |
| EP3719740B1 (en) | Image processing device, image processing method, and image processing program | |
| JP2021128497A (en) | Image processing device, image processing method and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230206 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20231026 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20231114 |
|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20231213 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20231213 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 7409607 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |