9

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

Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283
  • What is the purpose of the additional smoothing? Is there some different information in each pyramid level? – Michael Kupchick Mar 22 '12 at 11:38
  • If you look at the image, the peaks are found in one of the four scales, so i assume that the smoothing is for finding a global peak across all scales. Its written in my paper for detection, atm i am just finding peaks in all scales and validates which is the best candidate and would like to compare with the suggested method. – Poul K. Sørensen Mar 22 '12 at 11:49
  • Gaussian Smoothing in 3D is the same thing as gaussian smoothing in 2D. You apply a convolution filter for 3 dimensions such that G(x,y,z) = Q – Adam Mar 23 '12 at 20:40
  • I figured that much, and from matlab I found the smooth3d could do it. Any suggestions on how to do this in OpenCV – Poul K. Sørensen Mar 29 '12 at 01:40
  • How you draw image pyramid? – mrgloom Jul 20 '15 at 15:54

2 Answers2

3

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.

Yoav
  • 5,962
  • 5
  • 39
  • 61
2

Long ago (in 2008-2009) I have developed a small C++ template lib to apply some simple transformations and convolution filters. The library's source can be found in the Linderdaum Engine - it has nothing to do with the rest of the engine and does not use any of the engine's features. The license is MIT, so do whatever you want with it.

Take a look into the Linderdaum's source code (http://www.linderdaum.com) at Src/Linderdaum/Images/VolumeLib.*

The function to prepare the kernel is PrepareGaussianFilter() and MakeScalarVolumeConvolution() applies the filter. It is easy to adapt the library for the different data sources because the I/O is implemented using callback functions.

Sergey K.
  • 24,894
  • 13
  • 106
  • 174
Viktor Latypov
  • 14,289
  • 3
  • 40
  • 55