adaptive gaussian filter

5 次查看(过去 30 天)
Pavel Psota
Pavel Psota 2011-8-9
Hi everybody,
I have been dealing with problem for 3 days without succes so I would like you to apply for an advice.
I want to do an adaptive spatial filter, which is based on convolution (gaussian filter) but for every processing pixel I have to use different scale parameter (sigma) of the gaussian function. It can be done by calculation of convolution "properly" with 4 "for" cycles but I think it is not too effective. Do you have any idea how to solve it? I tried to use fcn nlfilter(A, [m n], fun)with my function fun function but I coudn´t find how to e.g. determine position of current processing pixel. Probably there exists better way how to solve it...
Thank you for all response!
Pavel

回答(1 个)

Image Analyst
Image Analyst 2011-8-10
You could use global or persistent variables inside the "fun" function to keep track of where the window is. I believe it goes down rows in the first column, then moves over to the next column and goes down the rows, etc. until all columns have been processed. (If not then it goes in the other direction.) This knowledge of the window location can then be used in your algorithm to decide on the sigma.

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by