How to extract mesh periodic pattern in this image?

Hi all,
I need some help extracting the cross-mesh periodic pattern of the Proj2.jpg image that I've attached. I'm taking an Image Processing course, and I'm very rusty with Matlab coding.
I have a good idea of how to perform this. I would assume you would take a fft of the image, shift it through a low pass filter, and multiply it by the original image to get the crossed mesh pattern out of it.
But I really am lost about how to perform this coding-wise in Matlab. Could anyone on here show me an example? Thank You!

 Accepted Answer

What exactly does "extracting the cross-mesh periodic pattern" mean to you?
Does it mean that you want to remove the pattern from the image and get an image that looks like there is no pattern in there at all? If so, Fourier transform, look for the spikes, zero them out, and then inverse transform.
Does it mean that you want to get an image of only the harmonic, periodic structure without any of the finer texture? If so, you want to do the opposite of what I said above. You still want to FT and look for the spikes, but instead of zeroing out the spikes, you want to leave the spikes alone and zero out everything else. Then inverse transform.
See my demo, attached below, for a coding example.

4 Comments

Michael
Michael on 15 Oct 2013
Edited: Michael on 15 Oct 2013
I'm supposed to create an output image that looks like what is below using the first image I sent to you as the input image. As you can see, the output image is just the mesh periodic pattern from the smoothed image.
I understand fully that you use the Fourier transform, look for spikes, and zero them out.
I'm just not quite too sure how to get the coding to work the way I would like. I expect it shouldn't be too long of a program. Probably just 30 lines max if even that.
Seeing an example would help though. Thanks!
Let me know if you can view the periodicPattern.jpg image I've attached.
I can see the image. But you don't zero out the spikes like you said, so I'm not sure you fully understand. The spikes represent the periodic part of the signal, and that's what you want to keep. So you keep the spikes and zero out everything else. The hard part is figuring out where the spikes are because the pattern is so faint that I think the spikes might be lost in the noise, but you'd just have to take the FT and display the log of the magnitude and see if you can see any sort of periodic spike pattern.
Michael
Michael on 15 Oct 2013
Edited: Michael on 15 Oct 2013
Yeah, you are correct about keeping the spikes. I was thinking about possibly using a Gaussian filter of some sort to perform this. I don't know, it may not be necessary and just make the program more complex than it needs to be.
You have any example coding I could look at to help me?
I agree that the noise makes the pattern very faint, but I have no clue how to tackle that obstacle and get rid of it to get the program working right.
I'm so used to extracting and removing periodic patterns from images to give me smoothed output images, but I can't seem to figure out doing this in reverse (i.e. keeping the periodic pattern of the smoothed input image and displaying it as an output)
Again, I'm by no means an expert at this Matlab programming environment since I've just been playing around with it for about 2 weeks. So just learning how to implement all the important functions in Matlab such as fft and using it correctly to remove spikes from an image was a bit of a hard knock lesson for me.
And just thinking about doing the reverse-order of that confuses me so much.
Michael
Michael on 15 Oct 2013
Edited: Michael on 15 Oct 2013
I still need some help on this question. Don't me wrong, I understand completely what to do theory-wise like you explained, but implementing this through Matlab is what I'm having issues with.
I don't know if this helps much, but this is what I would do if my objective was to remove the periodic pattern to get a smoothed output image (even though that isn't what I am looking for):
image1 = 'Proj2.jpg'; im = imread(image1); im = im(:,:,1);
imFft = fftshift(fft2(double(im))); mask = zeros(size(im)); center = floor(size(im)/2); W = 50;
mask(floor(center(1)) - 1 : floor(center(1)) + 1,:) = 1;
mask(:,floor(center(2)) - W : floor(center(2))+W) = 0; figure; imshow(real(ifft2(ifftshift(imFft.*(1-mask)))),[]);
I just don't know how I would go about performing the reverse operation of this to get the mesh pattern as my output.

Sign in to comment.

More Answers (0)

Asked:

on 15 Oct 2013

Commented:

on 15 Oct 2013

Community Treasure Hunt

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

Start Hunting!