Frequency filtering for pattern matching

asked 2017-11-14 05:36:00 -0500

LLSH gravatar image

I am trying to perform a pattern matching. I am stuck at doing frequency filtering when i try to multiply my image and my mask. Both of my image and my mask are suppose to be in the fourier space while I multiply them. Can you help me to solve this problem. Thanks I find the step in this website: https://homepages.inf.ed.ac.uk/rbf/HI...

Mat planes[] = {Mat_<float>(roi), Mat::zeros(roi.size(), CV_32F)};  //roi is my mask
Mat complexI;
merge(planes, 2, complexI);
dft(complexI, complexI, DFT_COMPLEX_OUTPUT);

Mat planes2[] = {Mat_<float>(imgCanny), Mat::zeros(imgCanny.size(), CV_32F)}; //imgCanny is my image
Mat complexP;    //Complex plane to contain the DFT coefficients {[0]-Real,[1]-Img}
merge(planes2, 2, complexP);
dft(complexP, complexP);  // Applying DFT

Mat complexA;
complexA =  complexP * complexI;
edit retag flag offensive close merge delete

Comments

this is written in C++

LLSH gravatar imageLLSH ( 2017-11-14 05:36:46 -0500 )edit