Reputation: 21
I am writing a program in C++ with OpenCv which needs to find the phase correlation matrix between two images and find all the peaks present above a response threshold. I did find a function called phaseCorrRes() but it returns only the highest peak using minMaxLoc(). How do I modify this function to retrive all the peaks?
Upvotes: 1
Views: 2198
Reputation: 21
It is best to follow the sequence as mentioned in the phaseCorrRes(). we can just add two more steps after carrying FFTShift() which are normalization and threshold. Now if we just change the pixels near and at each peak extracted using minMaxLoc() to 0 (i.e. black) we can iteratively find all the peaks using minMaxLoc(). However, just change the function by creating a copy of the function in the program and not in the original source code.
Upvotes: 1
Reputation: 482
I think you shold use other way to solve your problem, if that function do not useful for you. I recommend you the following steps:
For this steps you need:
dft()
phase()
matchTemplate()
with method = CV_TM_CCORR_NORMED
threshold()
with type = THRESH_TOZERO
Hope this helps you.
Upvotes: 3