[英]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.