Question

I am trying to approximate shape boundaries by using Fourier descriptors. I know this can be done because I've learned about it in class and read about it in several sources.

To obtain the Fourier descriptors of a boundary of (x,y) coordinates, I do the following: 1) Turn (x,y) coordinates into complex numbers of the form x + iy 2) Feed this new set of numbers into the 1D Fourier transform 3) The output are the Fourier descriptors

To approximate the boundary, I simply remove (set to zero) the high frequencies, then apply the inverse Fourier transform, then convert the complex numbers back to (x,y) coordinates, and then reconstruct the image from this new set of coordinates. The goal of my project is to find out how well I can approximate boundaries depending on how many of the terms I set to zero.

My problem is that whenever I set ANY of the frequencies to 0, my output image is very small and comes out as very weird patterns.

I've included an example below. The input image is a normal square. The first output image given is the reconstruction of the image using all the Fourier descriptors as normal. Note that the whole boundary is not there because the number of boundary pixels was sampled to 256 and I didn't bother connecting the dots when I output. Also note that the output is translated to the bottom left corner, this was on purpose. The second output image is when I use only the first 128 frequencies.

Input Image http://img19.imageshack.us/my.php?image=square0.bmp

Output Image 1: All frequencies http://img27.imageshack.us/my.php?image=square0normal.bmp

Output Image 2: First half of frequencies http://img23.imageshack.us/my.php?image=square0out.bmp

Does anyone have any idea why this might be happening?

Edit: First time putting images on here, not sure why they aren't showing up.. here are the links:
Input image
Output1
Output2

Also here is a link to a document that talks about this a bit, it starts at the end of page 5.

Was it helpful?

Solution

The result you are getting is what would be expected if you threw out the low frequencies instead of the high ones. Are you sure about which frequencies are which?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top