Skip to content
New issue

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

Convert result image to OpenCV cv::Mat ERROR #24

Open
Sun-ZhenXing opened this issue Sep 7, 2022 · 0 comments
Open

Convert result image to OpenCV cv::Mat ERROR #24

Sun-ZhenXing opened this issue Sep 7, 2022 · 0 comments

Comments

@Sun-ZhenXing
Copy link

I have test ncnn::Mat.to_pixels() with inimage, but outimage report error when converting:

// (main.cpp 376 line)
ncnn::Mat out = v.outimage;
cv::Mat res(out.h, out.w, CV_8UC3);
out.to_pixels(res.data, ncnn::Mat::PIXEL_BGR2RGB); // ERROR here
cv::imshow("res", res);
cv::waitKey();
cv::destroyAllWindows();

With OpenCV 4.6.0 Windows 10x, always get this:

Exception has occurred: W32/0xC0000005
Unhandled exception thrown: read access violation.
ptr1 was 0x1ACAC042000.

/src/ncnn/src/mat_pixel.cpp 734 line, is the problem with out.data or other ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant