开发者

Coding UnsharpMask without Fourier functions

I am doing some image processing code in C#,开发者_运维知识库 but I cant use any libraries or GNU like code.

The UnsharpMask function depends on Gaussian blur which in turn depends on Fourier Transforms. I wrote code for all this and things are working, but to make a long story short, I need to remove the FFT functions. Is there any way to perform unsharp mask in another way that perhaps does not need FFT?


The Fourier transform part of a Gaussian blur is just an efficient way of doing the convolution with a Gaussian kernel. You can do it using straight forward convolution with a Gaussian kernel of the appropriate standard deviation and size (an odd size kernel around 5-6 times the standard deviation is about right).

See Convolution on Wikipedia.


I found a solution to fit my needs.

I tried several quick and dirty blurring algorithms and found both Box Blur and Stack Blur to be sufficient. Stack Blur has a cleaner blur then Box Blur and is several times faster then Gaussian. So I can use either one in place of Gaussian.

So now I can get rid of all the FFT code mess and replace it with something much more manageable. This solution might not be for everyone, but since UnsharpMask is based on blurring, I did not feel that it was too exact of a science.

By the way Gimp's Gaussian blur seems to be avoiding FFTs as well.


I believe that even if you can't use any libraries or GNU thingy, you can look at their implementation and try to reproduce similar code for your requirements ?

openCV function list. check out the function details here and then the implementation details in the header files. http://opencv.willowgarage.com/documentation/genindex.html

Also if you are interested in C# based implementation I would suggest the following http://aforgenet.com/framework/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜