I am processing binary images with OpenCV, that have very different phase angles which I try to detect with phaseCorrelate. My code works, but the result is disappointing: I receive some value for the x-axis, and for y-axis a very small, hardly > 0 (e.g.2,5E-15), so I do round them to integers which results in e.g. -365 / 0, which I use to shift and flip my binary. my code looks like this:
Mat reference; // is of some size and type CV_8U,
Mat workImage; // dito
...
cv::Point2d cr = phaseCorrelate( Mat_<float>( reference ), Mat_<float>( workImage ) );
Mat correctedMat = ShiftAndFlipImage(workImage, cr);
The result of my method ShiftAndFlipImage
equals the image I receive with
GIMP: Layer-Transform-Offset (Ctrl+Shift+O), so there's no doubt.
Only question I have is about the result of phaseCorrelate
.
I also tried this hanning-Window approach, but no advance.
Can anyone give recommendations on this? The resulting image does not really match the reference,
答案 0 :(得分:0)
在这种特殊情况下,我只需要切换参数,从而导致符号更改。 mea culpa 8- | (另外,我会在一篇新帖子中提出我对此的真实问题)