Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a Gaussian filtering in 3D

How do i do a gaussi smoothing in the 3th dimension?

I have this detection pyramid, votes accumulated at four scales. Objects are found at each peak.

Detection Pyramid

I already smoothed each of them in 2d, and reading in my papers that i need to filter the third dimension with a \sigma = 1, which i havent tried before, i am not even sure what it means.

I Figured out how to do it in Matlab, and need something simular in opencv/c++.

Matlab Raw Values: Raw Matlab Smoothen with M0 = smooth3(M0,'gaussian'); : Smooth

like image 730
Poul K. Sørensen Avatar asked Mar 21 '12 23:03

Poul K. Sørensen


People also ask

How does Gaussian filtering work?

A Gaussian Filter is a low pass filter used for reducing noise (high frequency components) and blurring regions of an image. The filter is implemented as an Odd sized Symmetric Kernel (DIP version of a Matrix) which is passed through each pixel of the Region of Interest to get the desired effect.

How do you implement a Gaussian blur?

TLDR: A Gaussian blur is applied by convolving the image with a Gaussian function. In English, this means that we'll take the Gaussian function and we'll generate an n x m matrix. Using this matrix and the height of the Gaussian distribution at that pixel location, we'll compute new RGB values for the blurred image.

What is Gaussian filter algorithm?

Gaussian Filtering is widely used in the field of image processing. It is used to reduce the noise of an image. In this article we will generate a 2D Gaussian Kernel. The 2D Gaussian Kernel follows the below given Gaussian Distribution.

Is Gaussian blur a filter?

Gaussian blur is a low-pass filter, attenuating high frequency signals.


1 Answers

Gaussian filters are separable. You apply 1D filter at each dimension as follows:

for (dim = 0; dim < D; dim++)
    tensor = gaussian_filter(tensor, dim);

I would recommend OpenCV for an implementation of a gaussian filter (and image processing in general) in C++.

Note that this assumes that your pyramid levels are all of the same size. You can have your own functions that sample your scale-space pyramid on the fly while convolving the third dimension, but if you have enough memory I believe that it would be faster to scale up your coarser level to have the same size of the finest level.

like image 192
Yoav Avatar answered Oct 02 '22 21:10

Yoav