Friday, December 14, 2012

C++ : Sketcher - Fourier Transform

I'll make this quick.

Fourier transform is a neat trick used in signal analysis that allows you to isolate frequencies within data.  Look at that badly-scaled Audacity screenshot.  The top track shows a 1000 Hz sine wave added to a 2000 Hz sine wave.  The bottom track shows a spectrogram.  Notice the white bands around the 1000 Hz and 2000 Hz marks.

With the Sketcher project, I was trying to match blobs by partitioning the image into 16x16 px images and running a 2D Fourier transform on them, and hopefully similar textures would also have similar Fourier transforms.

It turns out there's no rotational invariance at all.

Copyright these people
Above are two sine waves and their corresponding Fourier transforms.  The top-left one is perfectly uniform, and the Fourier transform of it in the bottom-left reflects this.  Turn it 45 degrees and the transform is completely off and doesn't resemble the first at all.

So, texture segmentation this way is really awful and I'll have to try something else.

No comments:

Post a Comment