How to use Gaussian filter on images?

조회 수: 10 (최근 30일)
Fego Etese
Fego Etese 2020년 4월 30일
편집: Fego Etese 2020년 5월 1일
Hi, I've been trying to do some research into the implementation of this aglorithm below and I am confused about the Gaussian filter part of this equation.
I have been able to implement most of the algorithm but I am stuck at one point of the implementation, in this paper i don't understand the Eq 10 about the Guassian filter, I have only one value for each direction from Eq 8 and 9, but it asks me to apply a 2D gaussian filter to the image. I am assuming that I am to create two matrices of zeros same size as the block, fill the two block with the two values i have individually, and do a gaussian filter on both matrices using imgaussfilt, and then pick only one value from each of the filtered matrices. the problem here is that i don't understand that EQ10. Please am I correct in my understanding so far? Thank you

답변 (1개)

Image Analyst
Image Analyst 2020년 4월 30일
The equation simply does a convolution of the image phi with Gaussian filter window W. This is done internally by imgaussfilt(). You do NOT need to "create two matrices of zeros same size as the block, fill the two block with the two values i have individually, and do a gaussian filter on both matrices using imgaussfilt, and then pick only one value from each of the filtered matrices" That is all done for you internally by imgaussfilt(). Simply pass it your image and the width of the Gaussian.
  댓글 수: 3
Image Analyst
Image Analyst 2020년 5월 1일
Not sure I follow you. For example, the contradictory "the algorithm is not using an image for the filtering, it is getting the orientation of the image" <== so is it (or you) using an image or not?
There is an imgradientxy() function to get gradients in each direction if you want that. It gives you the magnitude (equations 10 and 11) and the direction (equation 12).
Fego Etese
Fego Etese 2020년 5월 1일
편집: Fego Etese 2020년 5월 1일
I have used the imgradient() function already on each block, but that gives me the magnitude and direction of the gradient in that block and then i convert it to x and y gradient direction which is from equations 5 - 7 and then I get the average gradient direction in the x and y directions.
Equations 8 and 9 changes the gradient direction to a continuous vector field and equations 10 and 11 uses a gaussian filter as lowpass for the continuous vector field, while equation 12 gets the final ridge orentation from the gaussian filtered value. All these is performed on the image in a block processing approach of block size 16 x 16, for each block and each block has a single orientation value.
So the problem here is that I am actually getting a single value for each block which is average gradient direction and trying to apply a low pass filter on that value. Which is what is confusing me here, because i know that filters are usually applied to the image matrix but here i have a single value so I don't know whether i should create a matrix of the same size as the block and fill it with the single value i have because i don't understand what the PhiX(i - uw, j - vw) means when phiX(i, j) is just one value gotten from equation 8.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by