简体   繁体   English

OpenCV错误:重复断言失败(ny> 0 && nx> 0),文件opencv / modules / core / src / copy.cpp,

[英]OpenCV Error: Assertion failed (ny > 0 && nx > 0) in repeat, file opencv/modules/core/src/copy.cpp,

I am compiling my source codes with : 我正在编译我的源代码:

g++ -o bc main.cpp comm_lib.cpp mxnet_mtcnn.cpp utils.cpp -std=c++11 -o3 $(pkg-config --cflags --libs opencv) g ++ -o bc main.cpp comm_lib.cpp mxnet_mtcnn.cpp utils.cpp -std = c ++ 11 -o3 $(pkg-config --cflags --libs opencv)

-I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/include/ -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/cpp-package/include -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/tvm/nnvm/include/ -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/dmlc-core/include -L/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib -lmxnet -I / Users / xxx / Downloads / apache-mxnet-src-1.3.0-incubating / include / -I / Users / xxx / Downloads / apache-mxnet-src-1.3.0-incubating / cpp-package / include - I / Users / xxx / Downloads / apache-mxnet-src-1.3.0-incubating / 3rdparty / tvm / nnvm / include / -I / Users / xxx / Downloads / apache-mxnet-src-1.3.0-incubating / 3rdparty / dmlc-core / include -L / Users / xxx / Downloads / apache-mxnet-src-1.3.0-incubating / lib -lmxnet

and resulting file working correctly , opens the camera etc. 并生成的文件正常工作,打开相机等。

when try to compile through CMakeList.txt . 当尝试通过CMakeList.txt编译时。 with : 用:

> cmake_minimum_required(VERSION 2.8.9) project (BCFacev4)
> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -std=c++11 ")
> 
> set(MXNET /Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib)
> 
> find_package( OpenCV REQUIRED )
> 
> 
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/include/
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/cpp-package/include
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/tvm/nnvm/include/
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/dmlc-core/include
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib)
> 
> SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
> -L/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib  -lmxnet ")
> 
> 
> 
> ADD_EXECUTABLE(main  main.cpp comm_lib.cpp mxnet_mtcnn.cpp utils.cpp)
> TARGET_LINK_LIBRARIES(main   ${OpenCV_LIBS} ${MXNET_LIBS} )

it also compiles and runs the program BUT exiting below error : 它还编译并运行程序但退出以下错误:

> OpenCV Error: Assertion failed (ny > 0 && nx > 0) in repeat, file
> /Users/xxx/Projects/opencv/modules/core/src/copy.cpp, line 864
> libc++abi.dylib: terminating with uncaught exception of type
> cv::Exception:
> /Users/xxx/Projects/opencv/modules/core/src/copy.cpp:864: error:
> (-215) ny > 0 && nx > 0 in function repeat

I didnt understand why cmake compiled binary gives this error ? 我不明白为什么cmake编译二进制会给出这个错误? Am I missing some configuration ? 我错过了一些配置吗?

Thanks 谢谢

I found the sneaky problem :() 我发现了鬼鬼祟祟的问题:()

one of the files in the source compile file and the resulting binary found it and working. 源编译文件中的一个文件和生成的二进制文件找到它并正常工作。

Bur Cmake and CLion creating different build folder and running there so THE file silently not found and the misery starts. Bur Cmake和CLion创建了不同的构建文件夹并在那里运行,因此静默找不到文件,并开始痛苦。

Sorry for this. 非常遗憾。

I found the problem. 我发现了这个问题。

Best 最好

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OpenCV错误:断言失败(scn == 3 || scn == 4)在cv :: cvtColor中,文件.. \\ .. \\ .. \\ .. \\ opencv \\ modules \\ imgproc \\ src \\ color.cpp,第3737行 - OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv:: cvtColor, file ..\..\..\..\opencv\modules\imgproc\src\color.cpp, line 3737 OpenCV错误:cv :: imdecode_,文件.. \\ .. \\ .. \\ .. \\ opencv \\ modules \\ highgui \\ src \\ loadsave.cpp中的断言失败(buf.data &amp;&amp; buf.isContinuous()) - OpenCV Error: Assertion failed (buf.data && buf.isContinuous()) in cv::imdecode_, file ..\..\..\..\opencv\modules\highgui\src\loadsave.cpp OpenCV 2.2:未知 function 中的错误参数,文件..\..\..\..\ocv\opencv\modules\core\src\array.cpp - OpenCV 2.2: bad argument in unknown function, file ..\..\..\..\ocv\opencv\modules\core\src\array.cpp 断言失败<dst.data != src.data >在未知函数 ../../ocv/opencv/modules/imgproc/src/imgwarp.cpp - Assertion failed <dst.data != src.data > in unknown function ../../ocv/opencv/modules/imgproc/src/imgwarp.cpp opencv\modules\core\src\persistence.cpp:2697: 错误: (-27) NULL 或 function cvOpenFileStorage 中的空缓冲区 - opencv\modules\core\src\persistence.cpp:2697: error: (-27) NULL or empty buffer in function cvOpenFileStorage OpenCV错误:相机校准:断言matrix_wrap.cpp中失败 - OpenCV Error: Camera Calibration: Assertion failed in matrix_wrap.cpp Opencv错误:断言失败 - Opencv Error:Assertion failed OpenCV错误:断言失败,mat.cpp行537 - OpenCV Error: Assertion failed, mat.cpp line 537 OpenCV错误:断言失败(i &lt;src.channels())在cvSplit中 - OpenCV Error: Assertion failed (i < src.channels()) in cvSplit opencv错误:校准摄像机时,convert.cpp(opencv)中的断言失败 - opencv error: assertion failed in convert.cpp (opencv) when i calibrate a camera
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM