Question

I need to modify some of the variables inside the dft function in OpenCV to make it suitable for my application.

  1. Where can I find the dft source code? I've tried C:\opencv243\build\include\opencv2\core.hpp but it only gives me the description of dft:

    //! performs forward or inverse 1D or 2D Discrete Fourier Transformation CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags=0, int nonzeroRows=0);

  2. What is the procedure after source code modification? Do I have to give it a different name such as dft2()?

  3. Where to save the new function?

I'm using visual Studio 2010 and OpenCV 2.4.3 installed on windows7 (32 bit). Please note that I'm new to OpenCV and just switched from MATLAB. Therefore if you are willing to help, I would be grateful if you could explain clearly.

In MATLAB I could simply right-click on the function and see the source file (for the open source functions only).

Thanks

Payam

Was it helpful?

Solution

  1. DFT function can be found in the dxt.cpp source file. This is located in $opencv2.3$\opencv\modules\core\src

  2. If you save it as the same function you will Overwrite that function and wont be able to use the original function. If you only want your new function then just change the code, if you want the original functionality save it as something else, dft2 would surfice but i suggest saving it as something more meaningfull like dft"whathaveIdone"

  3. Either create some new files etc or just save it as a new function with dxt.cpp, you will need to create function definitions etc

  4. In order to find this information I opened the OpenCV solution in Visual Studio and did a solution wide search for DFT

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