We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
OpenCV version: 4.10.0 Operating System / Platform: Windows 11 Pro Compiler & compiler version: MSVC 19.29.30154
With larger (~4000x4000px) uint16 images converted to float32, phaseCorrelate sometimes fails because infs and NaNs appear in divSpectrums().
#include <opencv2/imgproc.hpp> int main(int argc, char ** argv) { using namespace cv; // load Mat im = imread("<path/to/opencv_extra>/testdata/shared/baboon.png", IMREAD_GRAYSCALE); assert(im.type() == CV_8UC1); // convert to 32F, scale values as if original image was 16U constexpr auto u8Max = std::numeric_limits<std::uint8_t>::max(); constexpr auto u16Max = std::numeric_limits<std::uint16_t>::max(); im.convertTo(im, CV_32FC1, double(u16Max) / double(u8Max)); // enlarge and create ROIs const auto w = im.cols * 5; const auto h = im.rows * 5; const auto roiW = (w * 2) / 3; // 50% overlap Mat imLarge; resize(im, imLarge, { w, h }); const auto roiLeft = imLarge(Rect(0, 0, roiW, h)); const auto roiRight = imLarge(Rect(w - roiW, 0, roiW, h)); // correlate double response = 0.0; Point2d phaseShift = phaseCorrelate(roiLeft, roiRight, cv::noArray(), &response); assert(std::isnormal(phaseShift.x) || 0.0 == phaseShift.x); assert(std::isnormal(phaseShift.y) || 0.0 == phaseShift.y); assert(std::isnormal(response) || 0.0 == response); return 0; }
Test data: baboon.png
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
System Information
OpenCV version: 4.10.0
Operating System / Platform: Windows 11 Pro
Compiler & compiler version: MSVC 19.29.30154
Detailed description
With larger (~4000x4000px) uint16 images converted to float32, phaseCorrelate sometimes fails because infs and NaNs appear in divSpectrums().
Steps to reproduce
Test data: baboon.png
Issue submission checklist
The text was updated successfully, but these errors were encountered: