ncnn
ncnn copied to clipboard
ncnn interact with opencv Mat got core dumped
With master brance ncnn, they always error when convert image data from cv::Mat from ncnn
(gdb) run
Starting program: //face_recognize/build/face_recognize
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00000000004a9622 in ncnn::Interp::forward(ncnn::Mat const&, ncnn::Mat&, ncnn::Option const&) const ()
error comes from here:
ncnn::Mat ncnn_img = ncnn::Mat::from_pixels(frame_in.data,
ncnn::Mat::PIXEL_BGR2RGB, frame_in.cols, frame_in.rows);
With previouly version ncnn, it can run successfully, but with master branch fail. Besides, I found when I change PIXEL_BGR2RGB to PIXEL_BGR, previous version ncnn also core dumped. So I suppose it was a bug or unhandled exception when process cvMat?
I also encountered this problem. My problem is on ubuntu 18.04. At first, I thought it was the version of opencv, but it is not.
@teleger Have you solved the problem?
For conversion between opencv and ncnn Mat, see https://github.com/Tencent/ncnn/wiki/use-ncnn-with-opencv
same problem at ncnn::Mat ncnn_in = ncnn::Mat::from_pixels_resize(img.data, ncnn::Mat::PIXEL_BGR2RGB, img.cols, img.rows, 512, 512);
With previouly version ncnn, it can run successfully, but with master branch fail. Besides, I found when I change PIXEL_BGR2RGB to PIXEL_BGR, previous version ncnn also core dumped. So I suppose it was a bug or unhandled exception when process cvMat?
Hi. Did you resolve this issue. I have the same problem on windows after use something like this ncnn::Mat ncnn_in = ncnn::Mat::from_pixels_resize(img.data, ncnn::Mat::PIXEL_BGR2RGB, img.cols, img.rows, 512, 512); I get core dump