vini
vini

Reputation: 4722

how do I design my own filter in matlab?

Can I design my very own filter for removing noise in images in MATLAB by changing the kernel / mask values . I am new to MATLAB and I really need help.

Upvotes: 1

Views: 6492

Answers (3)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272457

Yes. The filter2 function takes a user-specified filter kernel. So to apply, for example, a vertical Sobel filter:

h = [ 1  2  1 
      0  0  0
     -1 -2 -1 ];

im_out = filter2(h, im_in);

If you're asking how to choose the values for your filter kernel, well, that's a vast topic. But if you have the Image Processing Toolbox, then you could use the fspecial function to get several pre-defined kernels.

Upvotes: 9

Asp.net my life
Asp.net my life

Reputation: 386

You can review all the existing filters and propose changes in them. A thorough analysis would be beneficial in that case.

There are different filters for removing impulse noise, gaussian noise etc.

You can start of with finding the noise present in images and go step by step in counteracting the problem

The MATLAB help section provides a lot of links for the same.

Upvotes: -1

MyCarta
MyCarta

Reputation: 818

The answer above is all you need to get started. Then if you want to learn more, these helped me immensely at the beginning:

For concepts http://www.imagemagick.org/Usage/fourier/ Code not in Matlab but this is one of the best tutorials I have seen

For Matlab check http://blogs.mathworks.com/steve/category/image-deblurring/ and http://blogs.mathworks.com/steve/category/fourier-transforms/

Upvotes: 1

Related Questions