JP2011090445A - Image processing method - Google Patents

Image processing method Download PDF

Info

Publication number
JP2011090445A
JP2011090445A JP2009242351A JP2009242351A JP2011090445A JP 2011090445 A JP2011090445 A JP 2011090445A JP 2009242351 A JP2009242351 A JP 2009242351A JP 2009242351 A JP2009242351 A JP 2009242351A JP 2011090445 A JP2011090445 A JP 2011090445A
Authority
JP
Japan
Prior art keywords
image
pixel
line
pixels
averaging
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
JP2009242351A
Other languages
Japanese (ja)
Inventor
Hiroyuki Oka
弘之 岡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2009242351A priority Critical patent/JP2011090445A/en
Publication of JP2011090445A publication Critical patent/JP2011090445A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To achieve an image processing method, along with an image processing apparatus and image processing program, capable of greatly reducing a calculation amount in a Bilateral filter where smoothing processing is performed to a flat part while maintaining an edge part of an image. <P>SOLUTION: The image processing method includes: a lateral direction averaging processing section that performs an averaging processing to only pixel on lines to each lateral line of an image; and a vertical direction averaging processing section that performs an averaging processing on only pixel on lines to each vertical line of the image. In the method, the lateral averaging processing to the input image is followed by the vertical averaging processing. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は画像データに対して画像内のエッジ情報を保持しつつ画像全体で平滑化を行う画像処理装置および画像処理方法ならびに画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program that perform smoothing on the entire image while retaining edge information in the image data.

写真画像は、物体の輪郭などの小刻みに信号値が変化する「エッジ成分」と、物体の表面など緩やかに信号値が変化する「平坦成分」と、大きく分けて2種類の成分に分別できる。この平坦部分にはノイズが載りやすく、ノイズを除去するために一般に平滑化処理が行われる。また、逆光解析のために画像の平坦成分を取り出して暗部と明部に分割する処理が行われるが、このときにも平滑化処理が実施される。   A photographic image can be roughly divided into two types of components: an “edge component” whose signal value changes in small increments such as the contour of an object and a “flat component” whose signal value changes gently such as the surface of an object. Noise is likely to be placed on the flat portion, and generally a smoothing process is performed to remove the noise. Further, for the backlight analysis, a process of taking out a flat component of an image and dividing it into a dark part and a bright part is performed. At this time, a smoothing process is also performed.

平滑化を行う手法として代表的なものに、Gaussianフィルタがある。Gaussianフィルタは画像の各画素に対して周辺画素と距離の重み付けを行い平均化する処理である。   A typical method for smoothing is a Gaussian filter. The Gaussian filter is a process in which each pixel of the image is weighted with a peripheral pixel and the distance is averaged.

しかし、Gaussianフィルタには平滑化によってエッジ成分を壊してしまうという問題がある。例えば、図7に示すような一次元空間の画素分布がある場合、これに対してGaussianフィルタをかけると図8のようにエッジがなまされた画素分布となってしまう。これによってエッジ部分近辺の画質が劣化したり、正しい暗部・明部が取得できないという問題があった。   However, the Gaussian filter has a problem that the edge component is broken by smoothing. For example, when there is a pixel distribution in a one-dimensional space as shown in FIG. 7, if a Gaussian filter is applied to this, a pixel distribution with an edge as shown in FIG. 8 will be obtained. As a result, there is a problem that the image quality in the vicinity of the edge portion is deteriorated, and correct dark and bright portions cannot be acquired.

このような問題を改善するために、Bilateralフィルタが考案された。BilateralフィルタはGaussianフィルタを改良したもので、注目画素の周辺画素に対してGaussianフィルタにおける「距離方向の重み付け」にさらに「画素値差分の重み付け」を掛け合わせる(非特許文献1)。これにより、近い画素値の画素でGaussianフィルタをかける効果が発生し、エッジ成分を壊さずに平滑化を行うことが可能となった。例えば図7に示すような位置次元空間の画素分布がある場合、これに対してBilateralフィルタをかけると図9のような画素分布が得られる。これはエッジを維持しつつ平坦部には平滑化効果が得られている。   In order to improve such problems, a Bilateral filter was devised. The Bilateral filter is an improvement of the Gaussian filter, and the “pixel value difference weighting” is further multiplied by the “weighting in the distance direction” in the Gaussian filter with respect to the peripheral pixels of the target pixel (Non-patent Document 1). As a result, an effect of applying a Gaussian filter with pixels having close pixel values is generated, and smoothing can be performed without breaking the edge component. For example, when there is a pixel distribution in a position dimensional space as shown in FIG. 7, if a Bilateral filter is applied to this, a pixel distribution as shown in FIG. 9 is obtained. As a result, a smoothing effect is obtained on the flat portion while maintaining the edge.

また、Bilateralフィルタを擬似的に模した処理が特許文献1に公開されている。注目画素との信号値差が閾値範囲内の画素に対してラベリングを行い、ラベリングを行った画素だけでGaussianフィルタをかける方式である。   Also, Patent Document 1 discloses a process that simulates a Bilateral filter. In this method, a pixel whose signal value difference from the target pixel is within a threshold range is labeled, and a Gaussian filter is applied only to the labeled pixel.

特開2007−48104号公報(第1頁、図1)JP 2007-48104 A (first page, FIG. 1)

C. Tomasi and R. Manduchi. Bilateral Filtering for Gray and Color Images. Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India.C. Tomasi and R. Manduchi. Bilateral Filtering for Gray and Color Images.Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India.

しかしながら、Bilateralフィルタは画像の全画素に対して周囲の画素との重み付けを計算する必要があるため、計算量が非常に多く膨大な処理時間がかかるという問題があった。また、特許文献1に記載されているラベリングの方法では、ラベリング時の閾値の選び方によって画質に大きく影響してしまうという問題があった。   However, since the Bilateral filter needs to calculate the weights of the surrounding pixels for all the pixels of the image, there is a problem that the calculation amount is very large and enormous processing time is required. In addition, the labeling method described in Patent Document 1 has a problem in that the image quality is greatly affected by the selection of the threshold value during labeling.

本発明は維持王の課題に鑑みてなされたものであって、Bilateralフィルタの画像処理効果を維持しつつ、計算量を大幅に削減することが可能な画像処理方法および画像処理装置ならびに画像処理プログラムを実現することを目的とする。   The present invention has been made in view of the problems of the maintenance king, and can maintain an image processing effect of the Bilateral filter and can greatly reduce the amount of calculation, an image processing method, an image processing apparatus, and an image processing program It aims at realizing.

画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理装置において、
画像の横方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う横方向平均化処理部と、
画像に対して縦方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う縦方向平均化処理部と、
を有し、入力画像に対して横方向に平均化処理を行った後に縦方向に平均化処理を行うことを特徴とする画像処理装置。
In an image processing apparatus that performs weighted averaging with peripheral pixels by weighting according to a distance and a pixel value difference with the peripheral pixels for each pixel of the image,
A horizontal direction averaging processing unit that performs the averaging process on each line in the horizontal direction of the image only with pixels on the line;
A vertical direction averaging processing unit that performs the averaging process only on pixels on the line for each vertical line on the image;
And an averaging process in the vertical direction after performing the averaging process in the horizontal direction on the input image.

本発明によれば、二次元空間のBilateralフィルタを一次元空間のBilateralフィルタの二回処理で近似することができ、本来のBilateralフィルタの効果を維持しつつ計算量の大幅な削減を実現することが可能となる。   According to the present invention, a bilateral filter in a two-dimensional space can be approximated by a two-time process of a bilateral filter in a one-dimensional space, and the amount of calculation can be greatly reduced while maintaining the effect of the original bilateral filter. Is possible.

第1の実施形態における処理部の構成を示す図。The figure which shows the structure of the process part in 1st Embodiment. 第1の実施形態における横方向Bilateralフィルタの処理手順を示す図。The figure which shows the process sequence of the horizontal direction Bilateral filter in 1st Embodiment. 第1の実施形態における縦方向Bilateralフィルタの処理手順を示す図。The figure which shows the process sequence of the vertical direction Bilateral filter in 1st Embodiment. 第1の実施形態における重み付け計算の処理手順を示す図。The figure which shows the process sequence of weighting calculation in 1st Embodiment. 第2の実施形態における処理部の構成を示す図。The figure which shows the structure of the process part in 2nd Embodiment. 第2の実施形態におけるBilateralフィルタの処理手順を示す図。The figure which shows the process sequence of the Bilateral filter in 2nd Embodiment. 画素信号値の分布の一例を示す図。The figure which shows an example of distribution of a pixel signal value. 画素信号に対してGaussian フィルタをかけた後の信号値の分布を示す図。The figure which shows distribution of the signal value after applying a Gaussian filter with respect to a pixel signal. 画素信号に対してBilateralフィルタをかけた後の信号値の分布を示す図。The figure which shows distribution of the signal value after applying a Bilateral filter with respect to a pixel signal. 「距離の重み」を横・縦方向に分解した状態を示す図。The figure which shows the state which decomposed | disassembled the "weight of distance" horizontally and vertically. フィルタを二次元空間の式のまま計算した場合の計算量を示す図。The figure which shows the calculation amount at the time of calculating a filter with the formula of two-dimensional space. フィルタを一次元空間の式に分解して計算した場合の計算量を示す図。The figure which shows the calculation amount at the time of calculating by decomposing | disassembling a filter into the formula of one-dimensional space. 「画素値差分の重み」を横・縦方向に分解した状態を示す図。The figure which shows the state which decomposed | disassembled the "weight of a pixel value difference" to horizontal and vertical direction.

以下、本発明を実施するための最良の形態について図面を用いて説明する。   The best mode for carrying out the present invention will be described below with reference to the drawings.

本発明の第1の実施形態を図を用いて説明する。   A first embodiment of the present invention will be described with reference to the drawings.

図1は第1の実施形態における画像処理装置のシステム構成を示している。この画像処理装置は、画像取得部101、横方向の一次元Bilateralフィルタ処理部102、縦方向の一次元Bilateralフィルタ処理部103、画像出力部104より構成される。まず、最初に画像取得部101が画像処理を行う対象の画像データをメモリやHDDなどの記憶媒体から取得すると、横方向の一次元Bilateralフィルタ処理部102に画像データを伝達する。横方向の一次元Bilateralフィルタ処理部102では、図2のフローチャートに示す処理を行って画像データの各横ライン上で横方向の一次元Bilateralフィルタ処理を実施し、縦方向の一次元Bilateralフィルタ処理部103に画像データを伝達する。次に、縦方向の一次元Bilateralフィルタ処理部103では、図3のフローチャートに示す処理を行って画像データの各縦ライン上で縦方向の一次元Bilateralフィルタ処理を実施し、画像出力部104に画像データを伝達する。画像出力部104は、上記画像処理を行った画像データを指定されたメモリやHDDなどの記憶媒体に出力する。   FIG. 1 shows a system configuration of an image processing apparatus according to the first embodiment. The image processing apparatus includes an image acquisition unit 101, a horizontal one-dimensional bilateral filter processing unit 102, a vertical one-dimensional bilateral filter processing unit 103, and an image output unit 104. First, when the image acquisition unit 101 first acquires image data to be subjected to image processing from a storage medium such as a memory or an HDD, the image data is transmitted to the horizontal one-dimensional Bilateral filter processing unit 102. The horizontal one-dimensional bilateral filter processing unit 102 performs the process shown in the flowchart of FIG. 2 to perform the horizontal one-dimensional bilateral filter processing on each horizontal line of the image data, and the vertical one-dimensional bilateral filter processing. The image data is transmitted to the unit 103. Next, the vertical one-dimensional Bilateral filter processing unit 103 performs the processing shown in the flowchart of FIG. 3 to perform the vertical one-dimensional Bilateral filter processing on each vertical line of the image data. Transmit image data. The image output unit 104 outputs the image data subjected to the image processing to a designated storage medium such as a memory or HDD.

図2は横方向の一次元Bilateralフィルタ処理の手順を示すフローチャートである。まず、処理S201で画像の横ラインの番号を表す変数iを用意し、ライン番号0で初期化する。次に処理S202で変数iが画像高さ未満であるかどうかをチェックする。後に1つのラインにBilateralフィルタ処理を施すたびにiを1つインクリメントするため、全ラインに対してBilateralフィルタ処理が完了していない場合は処理S203に進むが、全て完了している場合は全ての処理が終了となる。処理S203では画像の番号iのライン上にて各画素を走査するための変数jを用意し、画素番号0で初期化する。次に処理S204で変数jが画像幅未満であるかどうかをチェックする。後に1つの画素にBilateralフィルタ処理を施すたびにjを1つインクリメントするため、ラインi上の画素全てに対してBilateralフィルタ処理が完了していない場合は処理S205に進むが、全て完了している場合は処理S208に進む。処理S205では、画素jに対する各周辺画素(ライン上の画素)の「重み付け」を、注目画素jと各周辺画素との距離や画素値差に応じて計算する。この計算を行う処理手順は、図4のフローチャートに示している。図4についての説明は後述する。次に処理S206ではラインi上の各画素に対して前記「重み付け」を掛け、注目画素jをその値で更新する。処理S207では注目画素を隣に移動するためにjの値をインクリメントする。以上が横方向の一次元Bilateralフィルタ処理の説明である。   FIG. 2 is a flowchart showing the procedure of the horizontal one-dimensional Bilateral filter processing. First, in step S201, a variable i representing the horizontal line number of the image is prepared and initialized with line number 0. In step S202, it is checked whether the variable i is less than the image height. Every time Bilateral filter processing is performed on one line, i is incremented by 1. Therefore, if Bilateral filter processing is not completed for all lines, the process proceeds to step S203. The process ends. In process S203, a variable j for scanning each pixel on the line number i of the image is prepared and initialized with pixel number 0. In step S204, it is checked whether the variable j is less than the image width. Since j is incremented by 1 every time the pixel is subjected to Bilateral filter processing later, if Bilateral filter processing is not completed for all the pixels on line i, the process proceeds to step S205, but all are completed. In the case, the process proceeds to step S208. In the process S205, the “weighting” of each peripheral pixel (pixel on the line) with respect to the pixel j is calculated according to the distance between the target pixel j and each peripheral pixel and the pixel value difference. The processing procedure for performing this calculation is shown in the flowchart of FIG. A description of FIG. 4 will be given later. In step S206, each pixel on the line i is multiplied by the “weight”, and the target pixel j is updated with the value. In process S207, the value of j is incremented to move the target pixel to the next. The above is the description of the one-dimensional Bilateral filter processing in the horizontal direction.

図3は縦方向の一次元Bilateralフィルタ処理の手順を示すフローチャートである。まず、処理S301で画像の縦ラインの番号を表す変数iを用意し、ライン番号0で初期化する。次に処理S302で変数iが画像幅未満であるかどうかをチェックする。後に1つのラインにBilateralフィルタ処理を施すたびにiを1つインクリメントするため、全ラインに対してBilateralフィルタ処理が完了していない場合は処理S303に進むが、全て完了している場合は全ての処理が終了となる。処理S303では画像の番号iのライン上にて各画素を走査するための変数jを用意し、画素番号0で初期化する。次に処理S304で変数jが画像高さ未満であるかどうかをチェックする。後に1つの画素にBilateralフィルタ処理を施すたびにjを1つインクリメントするため、ラインi上の画素全てに対してBilateralフィルタ処理が完了していない場合は処理S305に進むが、全て完了している場合は処理S308に進む。処理S305では、画素jに対する各周辺画素(ライン上の画素)の「重み付け」を、注目画素jと各周辺画素との距離や画素値差に応じて計算する。この計算を行う処理手順は、図4のフローチャートに示している。図4についての説明は後述する。次に処理S306ではラインi上の各画素に対して前記「重み付け」を掛け、注目画素jをその値で更新する。処理S307では注目画素を隣に移動するためにjの値をインクリメントする。以上が縦方向の一次元Bilateralフィルタ処理の説明である。   FIG. 3 is a flowchart showing the procedure of one-dimensional Bilateral filter processing in the vertical direction. First, in step S301, a variable i representing the vertical line number of the image is prepared and initialized with a line number 0. In step S302, it is checked whether the variable i is less than the image width. Each time Bilateral filter processing is performed on one line, i is incremented by 1. Therefore, if Bilateral filter processing is not completed for all lines, the process proceeds to step S303. The process ends. In step S303, a variable j for scanning each pixel on the line number i of the image is prepared and initialized with pixel number 0. In step S304, it is checked whether the variable j is less than the image height. Since j is incremented by 1 every time a pixel is subjected to Bilateral filter processing later, if Bilateral filter processing is not completed for all pixels on line i, the process proceeds to step S305, but all are completed. In the case, the process proceeds to step S308. In the process S305, the “weighting” of each peripheral pixel (pixel on the line) with respect to the pixel j is calculated according to the distance between the target pixel j and each peripheral pixel and the pixel value difference. The processing procedure for performing this calculation is shown in the flowchart of FIG. A description of FIG. 4 will be given later. Next, in process S306, the “weighting” is applied to each pixel on the line i, and the target pixel j is updated with the value. In process S307, the value of j is incremented to move the pixel of interest to the next. The above is the description of the one-dimensional Bilateral filter processing in the vertical direction.

次に、図4を用いてライン上の画素jに対する周辺画素の重み付けを計算する手順について説明する。まず、処理S401にて重み付けの計算結果を格納するweight配列を用意し、処理S402にてweight配列を重み0で初期化する。その後、処理S403〜処理S409にて画素jから画素番号が小さくなる方向に順次重みを計算した後、処理S410〜処理S416にて画素jから画素番号が大きくなる方向に順次重みを計算する。   Next, a procedure for calculating the weights of the peripheral pixels for the pixel j on the line will be described with reference to FIG. First, in step S401, a weight array for storing a weighted calculation result is prepared, and in step S402, the weight array is initialized with a weight of zero. Thereafter, weights are sequentially calculated in the direction in which the pixel number decreases from the pixel j in steps S403 to S409, and then weights are sequentially calculated in the direction in which the pixel number increases from the pixel j in steps S410 to S416.

処理S403では、画素番号が小さくなる方向に画素番号を進めるための変数kを用意し、jで初期化する。処理S404では距離重みを表す変数distと画素値差分重みを表す変数diffを用意し、1.0で初期化する。次に、処理S405では画素番号kが0以上であり、かつ距離重みと画素値差重みの積が所定の閾値より大きいことをチェックする。所定の閾値としては、例えば0.01が考えられる。この閾値を導入することにより、注目画素jと画素値差が大きい画素より先の画素をフィルタ計算の対象から除外し高速化を実現している。次に、S406で画素kの距離重みを計算し、dist変数に代入する。距離重みは式1を用いて計算する。   In process S403, a variable k for advancing the pixel number in the direction of decreasing the pixel number is prepared and initialized with j. In process S404, a variable dist representing the distance weight and a variable diff representing the pixel value difference weight are prepared and initialized with 1.0. In step S405, it is checked whether the pixel number k is 0 or more and the product of the distance weight and the pixel value difference weight is larger than a predetermined threshold. For example, 0.01 may be considered as the predetermined threshold. By introducing this threshold value, a pixel higher than the pixel of interest j and a pixel ahead of a pixel having a large pixel value difference is excluded from the target of the filter calculation, thereby realizing high speed. Next, in S406, the distance weight of the pixel k is calculated and substituted into the dist variable. The distance weight is calculated using Equation 1.

Figure 2011090445
Figure 2011090445

σはガウシアンの広がりを表すパラメータあり、例えばσ=5などが使われる。xkは画素kの座標、xjは画素jの座標であるが、ここではそのままkとjを表している。次に、処理S407で画素kの画素値差分重みを計算し、diff変数に代入する。画素値差分重みは式2を用いて計算する。σはガウシアンの広がりを表すパラメータであり、例えばσ=50などが使われる。vkは画素kの画素値、vjは画素jの画素値を表している。次に処理S408でdistとdiffの積を重み配列weightに代入する。そして処理S409で変数kを1つデクリメントして小さい画素番号に処理を進める。以上のS403〜S409の処理が番号j以下の画素について完了したら、処理S410に進む。   σ is a parameter representing the spread of Gaussian. For example, σ = 5 is used. xk is the coordinate of the pixel k, and xj is the coordinate of the pixel j. Here, k and j are represented as they are. Next, in step S407, the pixel value difference weight of the pixel k is calculated and substituted into the diff variable. The pixel value difference weight is calculated using Equation 2. σ is a parameter representing the spread of Gaussian. For example, σ = 50 is used. vk represents the pixel value of the pixel k, and vj represents the pixel value of the pixel j. In step S408, the product of dist and diff is substituted into the weight array weight. In step S409, the variable k is decremented by one and the process proceeds to a smaller pixel number. When the above processes of S403 to S409 are completed for the pixels having the number j or less, the process proceeds to process S410.

処理S410では、画素番号が大きくなる方向に画素番号を進めるための変数kを用意し、j+1で初期化する。処理S411では距離重みを表す変数distと画素値差分重みを表す変数diffを用意し、1.0で初期化する。次に、処理S412では画素番号kが0以上であり、かつ距離重みと画素値差重みの積が所定の閾値より大きいことをチェックする。所定の閾値としては、例えば0.01が考えられる。この閾値を導入することにより、注目画素jと画素値差が大きい画素より先の画素をフィルタ計算の対象から除外し高速化を実現している。次に、S413で画素kの距離重みを計算し、dist変数に代入する。距離重みは式1を用いて計算する。σはガウシアンの広がりを表すパラメータあり、例えばσ=5などが使われる。xkは画素kの座標、xjは画素jの座標であるが、ここではそのままkとjを表している。次に、処理S414で画素kの画素値差分重みを計算し、diff変数に代入する。画素値差分重みは式2を用いて計算する。   In step S410, a variable k for advancing the pixel number in the direction in which the pixel number increases is prepared and initialized with j + 1. In process S411, a variable dist representing the distance weight and a variable diff representing the pixel value difference weight are prepared and initialized to 1.0. Next, in step S412, it is checked whether the pixel number k is 0 or more and the product of the distance weight and the pixel value difference weight is larger than a predetermined threshold value. For example, 0.01 may be considered as the predetermined threshold. By introducing this threshold value, a pixel higher than the pixel of interest j and a pixel ahead of a pixel having a large pixel value difference is excluded from the target of the filter calculation, thereby realizing high speed. Next, in S413, the distance weight of the pixel k is calculated and substituted into the dist variable. The distance weight is calculated using Equation 1. σ is a parameter representing the spread of Gaussian. For example, σ = 5 is used. xk is the coordinate of the pixel k, and xj is the coordinate of the pixel j. Here, k and j are represented as they are. Next, in step S414, the pixel value difference weight of the pixel k is calculated and substituted into the diff variable. The pixel value difference weight is calculated using Equation 2.

Figure 2011090445
Figure 2011090445

σはガウシアンの広がりを表すパラメータであり、例えばσ=50などが使われる。vkは画素kの画素値、vjは画素jの画素値を表している。次に処理S415でdistとdiffの積を重み配列weightに代入する。そして処理S416で変数kを1つインクリメントして大きい画素番号に処理を進める。以上のS410〜S416の処理が番号j+1以上の画素について完了したら、処理S417に進む。   σ is a parameter representing the spread of Gaussian. For example, σ = 50 is used. vk represents the pixel value of the pixel k, and vj represents the pixel value of the pixel j. In step S415, the product of dist and diff is substituted into the weight array weight. In step S416, the variable k is incremented by 1, and the process proceeds to a larger pixel number. When the processes of S410 to S416 are completed for the pixels with the number j + 1 or more, the process proceeds to process S417.

処理S417にて重み配列weightを出力し、重み付けの計算を終了する。   In step S417, the weight array weight is output, and the weight calculation is terminated.

以上に説明した第1の実施形態によれば、二次元空間のBilateralフィルタを一次元空間のBilateralフィルタの二回処理で近似することができ、本来のBilateralフィルタの効果を維持しつつ計算量の大幅な削減を実現することが可能となる。また、周辺画素の重みを計算する際に、重みがある一定の閾値以下となった時点で逐次処理を終了しているため、計算量のさらなる削減が可能となる。   According to the first embodiment described above, the Bilateral filter in the two-dimensional space can be approximated by the two-time processing of the Bilateral filter in the one-dimensional space, and the calculation amount can be reduced while maintaining the effect of the original Bilateral filter. A significant reduction can be realized. Further, when calculating the weights of the peripheral pixels, the sequential processing is completed when the weights are equal to or less than a certain threshold value, so that the calculation amount can be further reduced.

本発明の第1の実施形態を図を用いて説明する。   A first embodiment of the present invention will be described with reference to the drawings.

図5は第2の実施形態における画像処理装置のシステム構成を示している。この画像処理装置は、画像取得部501、横方向の一次元Bilateralフィルタ処理部502、画像回転処理部503、画像出力部504より構成される。まず、最初に画像取得部501が画像処理を行う対象の画像データをメモリやHDDなどの記憶媒体から取得すると、横方向の一次元Bilateralフィルタ処理部502に画像データを伝達する。横方向の一次元Bilateralフィルタ処理部502は、画像回転処理部503と連携した画像処理を行い第一の実施形態と同等の画像処理効果を得る。その処理手順を図6のフローチャートに示す。まず処理S601にて横方向の一次元Bilateralフィルタ処理を実施する。この処理の内容は第一の実施形態における図2の処理フローと同一である。次に画像を画像回転処理部503に渡して処理S602で画像を90度回転する。そして、画像を再度横方向一次元Bilateralフィルタ処理部に渡し、処理S603にて横方向の一次元Bilateralフィルタ処理を実施する。これにより、第一の実施形態における縦方向のBilateralフィルタと同一の効果を実現することができる。その後にもう一度画像データを画像回転処理部503に渡し、処理S604で90度回転してもとの画像に戻す。そして、最後に画像出力部504で画像データをメモリまたはHDDなどの記憶媒体に出力する。   FIG. 5 shows a system configuration of the image processing apparatus according to the second embodiment. This image processing apparatus includes an image acquisition unit 501, a horizontal one-dimensional bilateral filter processing unit 502, an image rotation processing unit 503, and an image output unit 504. First, when the image acquisition unit 501 first acquires image data to be subjected to image processing from a storage medium such as a memory or an HDD, the image data is transmitted to the horizontal one-dimensional Bilateral filter processing unit 502. The horizontal one-dimensional Bilateral filter processing unit 502 performs image processing in cooperation with the image rotation processing unit 503 to obtain an image processing effect equivalent to that of the first embodiment. The processing procedure is shown in the flowchart of FIG. First, a horizontal one-dimensional bilateral filter process is performed in process S601. The content of this process is the same as the process flow of FIG. 2 in the first embodiment. Next, the image is transferred to the image rotation processing unit 503, and the image is rotated 90 degrees in step S602. Then, the image is transferred again to the horizontal one-dimensional Bilateral filter processing unit, and the horizontal one-dimensional Bilateral filter processing is performed in Step S603. Thereby, the same effect as the vertical Bilateral filter in the first embodiment can be realized. Thereafter, the image data is once again transferred to the image rotation processing unit 503, and the original image is restored after being rotated by 90 degrees in step S604. Finally, the image output unit 504 outputs the image data to a storage medium such as a memory or HDD.

以上に説明した第2の実施形態によれば、1つのBilateralフィルタ処理部と1つの画像回転処理部だけで第1の実施形態と同一の効果を得られるため、実装するための電子回路やプログラムのサイズを小さくすることが可能となる。   According to the second embodiment described above, the same effect as that of the first embodiment can be obtained with only one bilateral filter processing unit and one image rotation processing unit. Can be reduced in size.

<アルゴリズムの説明>
実施形態1または2によって計算量を大幅に削減できる理由を、アルゴリズムを説明しながら解説する。
<Description of algorithm>
The reason why the calculation amount can be greatly reduced by the first or second embodiment will be described while explaining the algorithm.

BilateralフィルタのベースであるGaussianフィルタはBilateralフィルタと同様に膨大な処理時間がかかるが、Gaussianフィルタは計算方法を工夫することにより処理時間を大幅に短縮することが可能である。Gaussianフィルタの重みは式4により計算される(簡略化のため係数は1とした)。   The Gaussian filter that is the base of the Bilateral filter takes enormous processing time like the Bilateral filter, but the Gaussian filter can greatly reduce the processing time by devising the calculation method. The weight of the Gaussian filter is calculated by Equation 4 (the coefficient is 1 for simplification).

Figure 2011090445
Figure 2011090445

ここで図10に示すように画素xkと画素xjの中継点として画素xmを取ると、式4は式5のように記述することができる。   Here, when the pixel xm is taken as a relay point between the pixel xk and the pixel xj as shown in FIG. 10, Equation 4 can be expressed as Equation 5.

Figure 2011090445
Figure 2011090445

これは、二次元空間の式である式4を、一次元空間の式5に分解できることを示している。よって、横方向のライン上で一次元空間のGaussianフィルタをかけてさらに縦方向のライン上で一次元空間のGaussianフィルタをかけることで、二次元空間のGaussianフィルタと同じ効果を実現できる。しかも計算量はO記法で4乗から3乗への削減(変数Nを画像の1辺の画素数とする)に相当する。   This indicates that Formula 4 which is a formula in the two-dimensional space can be decomposed into Formula 5 in the one-dimensional space. Therefore, the same effect as the Gaussian filter in the two-dimensional space can be realized by applying the Gaussian filter in the one-dimensional space on the horizontal line and further applying the Gaussian filter in the one-dimensional space on the vertical line. Moreover, the amount of calculation corresponds to a reduction from the fourth power to the third power in the O notation (the variable N is the number of pixels on one side of the image).

計算量が削減できる理由を以下にわかりやすく説明する。図11と図12に、注目画素uとvに周辺画素a〜kの値を足しこんでGaussianフィルタを計算する例を示す。このとき、図11は二次元空間の式を使った場合(式4)の計算手順を示し、図12は一次元空間の式に分解して使った場合(式5)の計算手順を示している。図11では、画素uと画素vそれぞれに対して画素a〜kの値を足し込んでおり、合計で22回の計算を行っている。一方、図12では、最初に画素gに画素a〜kの値を足し込んでから画素uと画素vに画素gの値を足し込んでおり、合計で13回の計算量で済んでいる。このように、横方向の一次元空間Gaussianフィルタの計算結果を縦方向の一次元空間Gaussianフィルタの計算時に再利用することで、二次元空間のGaussianフィルタよりも大幅に計算量を削減することが可能となる。   The reason why the amount of calculation can be reduced is explained in an easy-to-understand manner. FIG. 11 and FIG. 12 show examples in which the Gaussian filter is calculated by adding the values of the peripheral pixels a to k to the target pixels u and v. At this time, FIG. 11 shows the calculation procedure in the case of using the equation in the two-dimensional space (Equation 4), and FIG. Yes. In FIG. 11, the values of the pixels a to k are added to the pixel u and the pixel v, respectively, and the calculation is performed 22 times in total. On the other hand, in FIG. 12, the values of the pixels a to k are first added to the pixel g, and then the values of the pixel g are added to the pixels u and v, and the calculation amount is 13 times in total. In this way, by reusing the calculation result of the horizontal one-dimensional spatial Gaussian filter when calculating the vertical one-dimensional spatial Gaussian filter, the computational complexity can be significantly reduced compared to the two-dimensional spatial Gaussian filter. It becomes possible.

一方で、BilateralフィルタはそのままではGaussianフィルタのように一次元の積に分解することはできない。それは、Bilateralフィルタは式5にさらに式6の係数を掛けたものを重みとしているためである。   On the other hand, a Bilateral filter cannot be decomposed into a one-dimensional product like a Gaussian filter as it is. This is because the Bilateral filter uses a weight obtained by multiplying Equation 5 by the coefficient of Equation 6.

Figure 2011090445
Figure 2011090445

式6は注目画素と周辺画素との「画素地の差分」に依存しており、画素値の差分は空間的な関係性はないため、図10と同様ように縦・横に分解することが通常はできない。   Equation 6 depends on the “pixel ground difference” between the pixel of interest and the surrounding pixels, and the pixel value difference has no spatial relationship, so that it can be decomposed vertically and horizontally as in FIG. Usually not possible.

しかしながら、写真画像の一般的なエッジ成分の多くは、閉じた線(途切れていない線)状に存在しているという特徴がある。エッジ成分が閉じた線であるならば、ある2つの画素の差分値は任意の経路の勾配データの積分で近似的に表現可能である。よって、ある2つの画素xkとxjの画素値差分を図13のようにxmを経由することで、画素値差分の重みの計算を近似的に一次元空間の式に分解した式7で表現することが可能となる。   However, most of the general edge components of photographic images are characterized by being in the form of closed lines (unbroken lines). If the edge component is a closed line, the difference value between two pixels can be approximately expressed by integration of gradient data of an arbitrary path. Therefore, by calculating the pixel value difference between two pixels xk and xj via xm as shown in FIG. 13, the calculation of the weight of the pixel value difference is expressed by Equation 7 which is approximately decomposed into a one-dimensional space equation. It becomes possible.

Figure 2011090445
Figure 2011090445

一次元に分解することで、縦・横方向に一次元空間のBilateralフィルタを順次適用して二次元空間のBilateralフィルタに近い効果を得ることが可能である。また、計算量はO記法で4乗から3乗への削減(変数Nを画像の1辺の画素数とする)に相当する。計算量が削減できる理由はGaussianフィルタと同一である。   By disassembling in one dimension, it is possible to obtain a similar effect to the bilateral filter in the two-dimensional space by sequentially applying the bilateral filter in the one-dimensional space in the vertical and horizontal directions. The amount of calculation corresponds to a reduction from the fourth power to the third power in O notation (the variable N is the number of pixels on one side of the image). The reason why the amount of calculation can be reduced is the same as that of the Gaussian filter.

Claims (12)

画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理装置において、
画像の横方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う横方向平均化処理部(102)と、
画像に対して縦方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う縦方向平均化処理部(103)と、
を有し、入力画像に対して横方向に平均化処理を行った後に縦方向に平均化処理を行うことを特徴とする画像処理装置。
In an image processing apparatus that performs weighted averaging with peripheral pixels by weighting according to a distance and a pixel value difference with the peripheral pixels for each pixel of the image,
A horizontal averaging processing unit (102) that performs the averaging process on each line in the horizontal direction of the image only with pixels on the line;
A vertical averaging unit (103) that performs the averaging process on each line in the vertical direction of the image only with pixels on the line;
And an averaging process in the vertical direction after performing the averaging process in the horizontal direction on the input image.
画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理装置において、
画像の横方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う横方向平均化処理部(102)と、
画像に対して縦方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う縦方向平均化処理部(103)と、
を有し、入力画像に対して縦方向に平均化処理を行った後に横方向に平均化処理を行うことを特徴とする画像処理装置。
In an image processing apparatus that performs weighted averaging with peripheral pixels by weighting according to a distance and a pixel value difference with the peripheral pixels for each pixel of the image,
A horizontal averaging processing unit (102) that performs the averaging process on each line in the horizontal direction of the image only with pixels on the line;
A vertical averaging unit (103) that performs the averaging process on each line in the vertical direction of the image only with pixels on the line;
And an averaging process in the horizontal direction after the averaging process is performed on the input image.
画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理装置において、
画像の各ラインに対してそのライン上の画素のみで前記平均化処理を行う横方向平均化処理部(502)と、
画像を90度回転する回転処理部(503)と、
を有し、入力画像に対して横または縦方向に平均化処理を行った後に画像を90度回転し、さらに横または縦方向に平均化処理を行うことを特徴とする画像処理装置。
In an image processing apparatus that performs weighted averaging with peripheral pixels by weighting according to a distance and a pixel value difference with the peripheral pixels for each pixel of the image,
A horizontal direction averaging processing unit (502) that performs the averaging process on each line of the image only with pixels on the line;
A rotation processing unit (503) for rotating the image by 90 degrees;
An image processing apparatus characterized in that after performing an averaging process on an input image in the horizontal or vertical direction, the image is rotated 90 degrees, and further, the averaging process is performed in the horizontal or vertical direction.
請求項1から3に記載の画像処理装置において、
注目画素に対して平均化処理を行う際に、ライン上における前記注目画素に隣接する画素から画像端部に向かって周辺画素の重みを順次計算すること、
を特徴とする画像処理装置。
The image processing apparatus according to claim 1, wherein
Sequentially calculating weights of peripheral pixels from the pixel adjacent to the target pixel on the line toward the edge of the image when performing averaging processing on the target pixel;
An image processing apparatus.
請求項1から4に記載の画像処理装置において、
周辺画素の重みを順次計算する際に、重みがある所定の閾値を下回った時点で重みの計算を終了すること、
を特徴とする画像処理装置。
The image processing apparatus according to claim 1, wherein
When calculating the weights of neighboring pixels sequentially, the weight calculation ends when the weight falls below a predetermined threshold,
An image processing apparatus.
画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理方法において、
画像の横方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行うステップ(S201〜S208)と、
画像に対して縦方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行うステップ(S301〜S308)と、
を有することを特徴とする画像処理方法。
In the image processing method for performing weighted averaging with the surrounding pixels by weighting according to the distance and the pixel value difference with the surrounding pixels for each pixel of the image,
Performing the averaging process on each line in the horizontal direction of the image only with pixels on the line (S201 to S208);
Performing the averaging process on each line in the vertical direction of the image only with pixels on the line (S301 to S308);
An image processing method comprising:
請求項6に記載の画像処理方法において、
前記横方向の平均化処理を行ってから前記縦方向の平均化処理を行うこと、
を特徴とする画像処理方法。
The image processing method according to claim 6,
Performing the averaging process in the vertical direction after performing the averaging process in the horizontal direction,
An image processing method characterized by the above.
請求項6に記載の画像処理方法において、
前記縦方向の平均化処理を行ってから前記横方向の平均化処理を行うこと、
を特徴とする画像処理方法。
The image processing method according to claim 6,
Performing the averaging process in the horizontal direction after performing the averaging process in the vertical direction,
An image processing method characterized by the above.
画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理方法において、
画像の各ラインに対してそのライン上の画素のみで前記平均化処理を行うステップ(S601)と、
前記平均化処理後の画像を90度回転するステップ(S602)と、
前記回転後の画像の各ラインに対してそのライン上の画素のみで前記平均化処理を行うステップ(S603)と、
前記平均化処理後の画像を−90度回転するステップ(S604)と、
を有することを特徴とする画像処理方法。
In the image processing method for performing weighted averaging with the surrounding pixels by weighting according to the distance and the pixel value difference with the surrounding pixels for each pixel of the image,
Performing the averaging process on each line of the image with only pixels on the line (S601);
Rotating the averaged image by 90 degrees (S602);
Performing the averaging process on each line of the rotated image with only pixels on the line (S603);
Rotating the image after the averaging process by -90 degrees (S604);
An image processing method comprising:
請求項6から9に記載の画像処理方法において、
注目画素に対して平均化処理を行う際に、ライン上における前記注目画素に隣接する画素から画像端部に向かって周辺画素の重みを順次計算すること、
を特徴とする画像処理方法。
The image processing method according to claim 6, wherein:
Sequentially calculating weights of peripheral pixels from the pixel adjacent to the target pixel on the line toward the edge of the image when performing averaging processing on the target pixel;
An image processing method characterized by the above.
請求項6から10に記載の画像処理方法において、
周辺画素の重みを順次計算する際に、重みがある所定の閾値を下回った時点で重みの計算を終了すること、
を特徴とする画像処理方法。
The image processing method according to claim 6, wherein:
When calculating the weights of neighboring pixels sequentially, the weight calculation ends when the weight falls below a predetermined threshold,
An image processing method characterized by the above.
画像の各画素に対して周辺画素との距離・画素値差分に応じた重み付けで周辺画素との重み平均化を行う画像処理プログラムにおいて、
画像の横方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う手順と、
画像に対して縦方向の各ラインに対してそのライン上の画素のみで前記平均化処理を行う手順と、
を有することを特徴とする画像処理プログラム。
In an image processing program that performs weighted averaging with surrounding pixels by weighting according to the distance and pixel value difference with the surrounding pixels for each pixel of the image,
A procedure for performing the averaging process on only the pixels on the horizontal direction of each line in the image;
A procedure for performing the averaging process on each line in the vertical direction of the image only with pixels on the line;
An image processing program comprising:
JP2009242351A 2009-10-21 2009-10-21 Image processing method Pending JP2011090445A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009242351A JP2011090445A (en) 2009-10-21 2009-10-21 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009242351A JP2011090445A (en) 2009-10-21 2009-10-21 Image processing method

Publications (1)

Publication Number Publication Date
JP2011090445A true JP2011090445A (en) 2011-05-06

Family

ID=44108654

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009242351A Pending JP2011090445A (en) 2009-10-21 2009-10-21 Image processing method

Country Status (1)

Country Link
JP (1) JP2011090445A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101577918B1 (en) 2011-08-02 2015-12-15 레이던 컴퍼니 Local area contrast enhancement
JP2019114878A (en) * 2017-12-21 2019-07-11 日本電信電話株式会社 Channel estimation apparatus and channel estimation method of broadband wireless communication system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101577918B1 (en) 2011-08-02 2015-12-15 레이던 컴퍼니 Local area contrast enhancement
JP2019114878A (en) * 2017-12-21 2019-07-11 日本電信電話株式会社 Channel estimation apparatus and channel estimation method of broadband wireless communication system

Similar Documents

Publication Publication Date Title
EP3696769A1 (en) Image filtering based on image gradients
US10198801B2 (en) Image enhancement using self-examples and external examples
JP2015225665A (en) Image noise removal method and image noise removal device
WO2017096814A1 (en) Image processing method and apparatus
Bai Morphological infrared image enhancement based on multi-scale sequential toggle operator using opening and closing as primitives
CN111179196B (en) Multi-resolution depth network image highlight removing method based on divide-and-conquer
US10728446B2 (en) Method and apparatus for performing processing in a camera
Wang et al. Enhancement for dust-sand storm images
US20150187051A1 (en) Method and apparatus for estimating image noise
CN110874827A (en) Turbulent image restoration method and device, terminal equipment and computer readable medium
CN113963009A (en) Local self-attention image processing method and model based on deformable blocks
CN111062878B (en) Image denoising method and device and computer readable storage medium
JP2011090445A (en) Image processing method
CN110717913A (en) Image segmentation method and device
CN107292839B (en) TDI flutter image restoration method based on image block self-adaptive adjustment
CN106897975B (en) Image denoising method for hypercube particle calculation
CN109886901B (en) Night image enhancement method based on multi-channel decomposition
JP7140491B2 (en) Image processing device, image processing method, and program
CN103077396B (en) The vector space Feature Points Extraction of a kind of coloured image and device
CN109993694B (en) Method and device for generating super-resolution image
CN101364303B (en) Edge pixel extracting and processing method
JP5169926B2 (en) Image processing device
Tangsakul et al. Improving single image haze removal based on cellular automata model
US9330445B2 (en) Local contrast enhancement method and apparatus
CN112734660B (en) Overexposure image quality enhancement method based on moving window particle swarm optimization