将图像数据从cv :: Mat转换为Halide :: Image时遇到一些问题。我正在使用Visual Studio 2015社区在Windows 7上工作,并使用Halide for Windows 32bit的可下载二进制文件。 例如:
cv::Mat image = cv::imread(...); // read grayscale image
Halide::Buffer input_buffer( Halide::UInt(8), image.cols, image.rows, 1, 1, image.data, "input_image" );
Halide::Image< uint8_t > input( input_buffer );
Halide::Func clamped = Halide::BoundaryConditions::repeat_edge(input);
收到以下错误消息
File: f:\dd\vctools\crt\crtw32\misc\dbgdel.cpp
Line: 52
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
我还尝试使用普通的malloc数据并将其提供给Halid :: Buffer,但是出现了相同的错误。我想内存所有权存在一些问题,因为如果您尝试删除对象两次会出现此错误,但我对此不确定。 这是Halide中的一个错误,还是我做了s.th.错?
编辑:Callstack
msvcr120d.dll!000007feddd3082e()
msvcr120d.dll!000007feddd30196()
msvcr120d.dll!000007feddd2d1e5()
Halide.dll!000007feddf2b8c2()
Halide.dll!000007feddf2157d()
Halide.dll!000007feddf15678()
Halide.dll!000007feddf166e7()
Halide.dll!000007fede1d4db5()
Test.exe!Halide::Internal::Variable::make(Halide::Type type, std::basic_string<char,std::char_traits<char>,std::allocator<char> > name) Zeile 3255
Test.exe!Halide::Var::operator Halide::Expr() Zeile 5476
Test.exe!Halide::BoundaryConditions::Internal::func_like_to_func<Halide::Image<unsigned char> >(Halide::Image<unsigned char> func_like) Zeile 9187
Test.exe!Halide::BoundaryConditions::repeat_edge<Halide::Image<unsigned char> >(Halide::Image<unsigned char> func_like) Zeile 9247