Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example application for FFT code usage #600

Open
ihhub opened this issue Jan 3, 2020 · 6 comments
Open

Add an example application for FFT code usage #600

ihhub opened this issue Jan 3, 2020 · 6 comments
Labels
cmake All related tasks to CMake files good first issue An issue is perfectly suitable for first comers. A very minimal knowledge of the project is required help wanted We need a help makefile makefile changes required
Milestone

Comments

@ihhub
Copy link
Owner

ihhub commented Jan 3, 2020

We would like to add an example for FFT code usage like. As a reference we could use Gaussian filtering.
We need to do these steps:

  1. Create a directory examples/fft
  2. Include src/fft.cpp, src/fft.h, src/filtering.h, src/filtering.cpp and src/thirdparty/kissfft header files into the project
  3. Create VS project file (you could copy from examples/blob_detection folder for example
  4. Create make file for the project
  5. Create CMake file for the project
  6. Modify examples/CMakeLists.txt file to include new project
  7. Modify examples/makefile file to include new project

You could refer to any of existing example projects as a reference.

The code for this example project should include file loading, filter usage and file saving.

@ihhub ihhub added help wanted We need a help cmake All related tasks to CMake files makefile makefile changes required good first issue An issue is perfectly suitable for first comers. A very minimal knowledge of the project is required labels Jan 3, 2020
@ihhub ihhub added this to the Release milestone Jan 3, 2020
@theoniko
Copy link
Contributor

theoniko commented Jan 9, 2020

Hello @ihhub
Is this issue still available? If yes, i would be interested to work on it.

@ihhub
Copy link
Owner Author

ihhub commented Jan 11, 2020

Hi @theoniko , surely you can take this issue. Please be free to ask any questions for clarification of the task requirements.

@theoniko
Copy link
Contributor

Hello @ihhub
Could you be a little more specific about the expected example content?
As far as i know the FFT image displays the absolute value (or complex magnitude) of the spatial frequencies found in the image.

@ihhub
Copy link
Owner Author

ihhub commented Jan 22, 2020

We could use FFT to make Gaussian blur:

std::vector<float> filter;
Image_Function::GetGaussianKernel( filter, input.width(), input.height(), 5, 2 );

FFT::ComplexData imageFFT( image );
FFT::ComplexData filterFFT;
filterFFT.resize( input.width(), input.height() );
filterFFT.set( filter );

FFT::FFTExecutor fftExecutor( input.width(), input.height() );

fftExecutor.directTransform( imageFFT );
fftExecutor.directTransform( filterFFT );
fftExecutor.complexMultiplication( imageFFT, filterFFT, imageFFT );
fftExecutor.inverseTransform( imageFFT );

const penguinV::Image output = imageFFT.get();

I think it should work.

@ihhub
Copy link
Owner Author

ihhub commented Jan 22, 2020

@theoniko I've created a pull request to simplify above code from:

FFT::ComplexData filterFFT;
filterFFT.resize( input.width(), input.height() );
filterFFT.set( filter );

into:

FFT::ComplexData filterFFT( filter, input.width(), input.height() );

@theoniko
Copy link
Contributor

I will apply those changes at the weekend.

@theoniko theoniko removed their assignment Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake All related tasks to CMake files good first issue An issue is perfectly suitable for first comers. A very minimal knowledge of the project is required help wanted We need a help makefile makefile changes required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants