Absolutely NO idea what is wrong here, or how to fix it. Any help would be greatly appreciated.
Software:
uname -ao:
Linux tegra-ubuntu 3.10.40-grinch-21.3.4 #1 SMP PREEMPT Fri May 1 10:41:09 UTC 2015 armv7l armv7l armv7l GNU/Linux
g++ --version:
g++ (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.4) 4.8.4
OpenCv and OpenCv_Contrib I am attempting to compile:
4.0.1
Cuda Version (a.k.a. nvcc --version):
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Tue_Feb_17_22:53:16_CST_2015
Cuda compilation tools, release 6.5, V6.5.45
Hardware:
Nvidia Jetson TK1
Thats about it...
Heres the terminal from right above the error to the end of make comp...
/usr/local/cuda/include/math_functions.h:965:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1184:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1281:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1521:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1559:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1575:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1591:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1645:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1699:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1866:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1921:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1951:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:1981:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2057:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2133:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2209:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2285:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2452:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2469:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2487:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2505:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2523:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2541:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2556:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2571:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2587:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2603:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2619:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2635:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2688:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2741:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2815:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2830:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2856:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:2882:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:3044:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1600
^
/usr/local/cuda/include/math_functions.h:3135:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1600
^
/usr/local/cuda/include/math_functions.h:3269:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:3355:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:4249:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:4339:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:4393:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:4447:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:5194:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:5276:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:5428:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:5466:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:5594:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6191:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6300:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6409:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6422:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6435:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6472:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6509:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6525:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6541:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6717:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:6875:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
In file included from /usr/local/cuda/include/common_functions.h:169:0,
from /usr/local/cuda/include/cuda_runtime.h:76,
from :0:
/usr/local/cuda/include/math_functions.h:8617:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
/usr/local/cuda/include/math_functions.h:8679:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER < 1800
^
In file included from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev.hpp:53:0,
from /home/ubuntu/opencv-4.0.1/sources/modules/core/src/cuda/gpu_mat.cu:52:
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp:50:5: warning: "__CUDACC_VER_MAJOR__" is not defined [-Wundef]
#if __CUDACC_VER_MAJOR__ >= 9
^
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp:280:5: warning: "__CUDACC_VER_MAJOR__" is not defined [-Wundef]
#if __CUDACC_VER_MAJOR__ >= 9
^
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp:289:5: warning: "__CUDACC_VER_MAJOR__" is not defined [-Wundef]
#if __CUDACC_VER_MAJOR__ >= 9
^
In file included from /usr/local/cuda/include/thrust/detail/config/config.h:32:0,
from /usr/local/cuda/include/thrust/detail/config.h:22,
from /usr/local/cuda/include/thrust/tuple.h:33,
from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/util/detail/tuple.hpp:49,
from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/util/tuple.hpp:50,
from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev.hpp:55,
from /home/ubuntu/opencv-4.0.1/sources/modules/core/src/cuda/gpu_mat.cu:52:
/usr/local/cuda/include/thrust/detail/config/debug.h:27:5: warning: "THRUST_DEBUG" is not defined [-Wundef]
#if THRUST_DEBUG
^
In file included from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/warp/detail/reduce.hpp:51:0,
from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/warp/reduce.hpp:51,
from /home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev.hpp:64,
from /home/ubuntu/opencv-4.0.1/sources/modules/core/src/cuda/gpu_mat.cu:52:
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/warp/detail/../../warp/shuffle.hpp:59:5: warning: "__CUDACC_VER_MAJOR__" is not defined [-Wundef]
#if __CUDACC_VER_MAJOR__ >= 9
^
/usr/include/c++/4.8/new(91): error: first parameter of allocation function must be of type "size_t"
/usr/include/c++/4.8/new(93): error: first parameter of allocation function must be of type "size_t"
/usr/include/c++/4.8/new(99): error: first parameter of allocation function must be of type "size_t"
/usr/include/c++/4.8/new(101): error: first parameter of allocation function must be of type "size_t"
/usr/include/c++/4.8/new(109): error: first parameter of allocation function must be of type "size_t"
/usr/include/c++/4.8/new(111): error: first parameter of allocation function must be of type "size_t"
/usr/local/cuda/include/common_functions.h(91): error: first parameter of allocation function must be of type "size_t"
/usr/local/cuda/include/common_functions.h(92): error: first parameter of allocation function must be of type "size_t"
/usr/local/cuda/include/common_functions.h(145): error: first parameter of allocation function must be of type "size_t"
/usr/local/cuda/include/common_functions.h(146): error: first parameter of allocation function must be of type "size_t"
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/grid/detail/integral.hpp(602): warning: conversion from pointer to smaller integer
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/grid/detail/integral.hpp(603): warning: conversion from pointer to smaller integer
/usr/include/c++/4.8/bits/stl_construct.h(75): error: function "operator new" cannot be called with the given argument list
argument types are: (unsigned long, void *)
detected during:
instantiation of "void std::_Construct(_T1 *, _Args &&...) [with _T1=cv::DMatch, _Args=]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(75): here
instantiation of "_ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _TrivialValueTypes=false, _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::DMatch *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(117): here
instantiation of "_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::DMatch *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(258): here
instantiation of "_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::DMatch *, _Tp=cv::DMatch]"
/usr/include/c++/4.8/bits/stl_vector.h(1142): here
instantiation of "std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(std::vector<_Tp, _Alloc>::size_type, _ForwardIterator, _ForwardIterator) [with _Tp=cv::DMatch, _Alloc=std::allocator, _ForwardIterator=__gnu_cxx::__normal_iterator>>]"
/usr/include/c++/4.8/bits/vector.tcc(188): here
instantiation of "std::vector<_Tp, _Alloc>&std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp=cv::DMatch, _Alloc=std::allocator]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/include/opencv2/core/persistence.hpp(1189): here
/usr/include/c++/4.8/bits/stl_construct.h(75): error: function "operator new" cannot be called with the given argument list
argument types are: (unsigned long, void *)
detected during:
instantiation of "void std::_Construct(_T1 *, _Args &&...) [with _T1=cv::DMatch, _Args=]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(75): here
instantiation of "_ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _TrivialValueTypes=false, _InputIterator=cv::DMatch *, _ForwardIterator=cv::DMatch *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(117): here
instantiation of "_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator=cv::DMatch *, _ForwardIterator=cv::DMatch *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(258): here
instantiation of "_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator=cv::DMatch *, _ForwardIterator=cv::DMatch *, _Tp=cv::DMatch]"
/usr/include/c++/4.8/bits/vector.tcc(209): here
instantiation of "std::vector<_Tp, _Alloc>&std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp=cv::DMatch, _Alloc=std::allocator]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/include/opencv2/core/persistence.hpp(1189): here
/usr/include/c++/4.8/bits/stl_construct.h(75): error: function "operator new" cannot be called with the given argument list
argument types are: (unsigned long, void *)
detected during:
instantiation of "void std::_Construct(_T1 *, _Args &&...) [with _T1=cv::KeyPoint, _Args=]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(75): here
instantiation of "_ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _TrivialValueTypes=false, _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::KeyPoint *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(117): here
instantiation of "_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::KeyPoint *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(258): here
instantiation of "_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator=__gnu_cxx::__normal_iterator>>, _ForwardIterator=cv::KeyPoint *, _Tp=cv::KeyPoint]"
/usr/include/c++/4.8/bits/stl_vector.h(1142): here
instantiation of "std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(std::vector<_Tp, _Alloc>::size_type, _ForwardIterator, _ForwardIterator) [with _Tp=cv::KeyPoint, _Alloc=std::allocator, _ForwardIterator=__gnu_cxx::__normal_iterator>>]"
/usr/include/c++/4.8/bits/vector.tcc(188): here
instantiation of "std::vector<_Tp, _Alloc>&std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp=cv::KeyPoint, _Alloc=std::allocator]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/include/opencv2/core/persistence.hpp(1180): here
/usr/include/c++/4.8/bits/stl_construct.h(75): error: function "operator new" cannot be called with the given argument list
argument types are: (unsigned long, void *)
detected during:
instantiation of "void std::_Construct(_T1 *, _Args &&...) [with _T1=cv::KeyPoint, _Args=]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(75): here
instantiation of "_ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _TrivialValueTypes=false, _InputIterator=cv::KeyPoint *, _ForwardIterator=cv::KeyPoint *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(117): here
instantiation of "_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator=cv::KeyPoint *, _ForwardIterator=cv::KeyPoint *]"
/usr/include/c++/4.8/bits/stl_uninitialized.h(258): here
instantiation of "_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator=cv::KeyPoint *, _ForwardIterator=cv::KeyPoint *, _Tp=cv::KeyPoint]"
/usr/include/c++/4.8/bits/vector.tcc(209): here
instantiation of "std::vector<_Tp, _Alloc>&std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp=cv::KeyPoint, _Alloc=std::allocator]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/include/opencv2/core/persistence.hpp(1180): here
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/grid/detail/transform.hpp(289): warning: conversion from pointer to smaller integer
detected during:
instantiation of "void cv::cudev::grid_transform_detail::TransformDispatcher::call(const cv::cudev::GlobPtr&, const cv::cudev::GlobPtr&, const UnOp &, const MaskPtr &, int, int, cudaStream_t) [with Policy=::CopyToPolicy<1U>, SrcType=uchar, DstType=uchar, UnOp=cv::cudev::identity, MaskPtr=cv::cudev::GlobPtr]"
(356): here
instantiation of "void cv::cudev::grid_transform_detail::transform_unary(const cv::cudev::GlobPtr&, const cv::cudev::GlobPtr&, const UnOp &, const MaskPtr &, int, int, cudaStream_t) [with Policy=::CopyToPolicy<1U>, SrcType=uchar, DstType=uchar, UnOp=cv::cudev::identity, MaskPtr=cv::cudev::GlobPtr]"
/home/ubuntu/opencv-4.0.1/opencv_contrib/modules/cudev/include/opencv2/cudev/grid/transform.hpp(85): here
instantiation of "void cv::cudev::gridTransformUnary_(const SrcPtr &, const cv::cudev::GlobPtrSz&, const UnOp &, const MaskPtr &, cv::cuda::Stream &) [with Policy=::CopyToPolicy<1U>, SrcPtr=cv::cudev::GlobPtrSz, DstType=uchar, UnOp=cv::cudev::identity, MaskPtr=cv::cudev::GlobPtrSz]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/src/cuda/gpu_mat.cu(308): here
instantiation of "void ::copyWithMask(const cv::cuda::GpuMat &, const cv::cuda::GpuMat &, const cv::cuda::GpuMat &, cv::cuda::Stream &) [with T=uchar]"
/home/ubuntu/opencv-4.0.1/sources/modules/core/src/cuda/gpu_mat.cu(333): here
14 errors detected in the compilation of "/tmp/tmpxft_000021c8_00000000-6_gpu_mat.cpp1.ii".
-- Removing /home/ubuntu/opencv-4.0.1/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
/usr/bin/cmake -E remove /home/ubuntu/opencv-4.0.1/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:264 (message):
Error generating file
/home/ubuntu/opencv-4.0.1/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o] Error 1
make[2]: Leaving directory `/home/ubuntu/opencv-4.0.1/build'
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[1]: Leaving directory `/home/ubuntu/opencv-4.0.1/build'
make: *** [all] Error 2
↧
OpenCv 4.0.1, Cuda-6.5, G++, CMake , and an error, or 14...
↧
is it possible to build binary 32 bit of OpenCv_world345 with Cuda
is it possible to build binary 32 bit of OpenCv_world345 with Cuda?
↧
↧
build 4.01 with vs2017 + WITH_QT & WITH_OPENGL errors
OPENCV_EXTRA_MODULES_PATH : opencv_contrib-master/opencv_contrib-master/modules;
ERRORS:
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_highgui401d.lib' opencv_perf_imgcodecs ;
Error LNK1104 cannot open file '..\..\lib\Debug\opencv_structured_light401d.lib' opencv_test_structured_light
and other silimar 96 errors;
Error C2065 'GL_PERSPECTIVE_CORRECTION_HINT': undeclared identifier opencv_highgui opencv-master\opencv-master\modules\highgui\src opencv-master\opencv-master\modules\highgui\src\window_QT.cpp 3228
↧
HDR Merge possible bug ?
I try in Python the example of the "memorial". There are two possibilities to call the merge:
1. Calibrate the response on images and times and use to use it for the merge
2. Do the merge directly on images and times
I do not get the same result. The image created by 2 is correct and the image created by 2 bad
Do I make some mistake ?
Regards
calibrate = cv.createCalibrateDebevec()
response = calibrate.process(images, times)
merge_debevec = cv.createMergeDebevec()
#hdr = merge_debevec.process(images, times, response) #Bad
hdr = merge_debevec.process(images, times) #Good
tonemap = cv.createTonemapReinhard()
ldr = tonemap.process(hdr)
cv.imwrite('ldr.png', ldr * 255)
cv.imwrite('hdr.hdr', hdr)
↧
ArUco detection x-y axis values are extremely different
Hello. My problem is that I am trying to detect aruco markers. I need coordinates aruco centered so I implemented [this part of the code](https://github.com/tizianofiorenzani/how_do_drones_work/blob/6433bdac938fcb91192097f7a82e43ba9b33f530/opencv/lib_aruco_pose.py#L165) to c++ and checked. Some of the output:
frame: 110
A X: -0.804775 Y: 0.208516 Z: 1.2107
R X: -0.791306 Y: 0.218932 Z: 1.23775
frame: 111
A X: -0.796757 Y: 0.199679 Z: 1.21298
R X: -0.794136 Y: 0.180792 Z: 1.20928
frame: 112
A X: -0.783294 Y: 0.193594 Z: 1.22591
R X: -0.760558 Y: 0.178313 Z: 1.24112
frame: 113
A X: -0.783294 Y: 0.193594 Z: 1.22591
frame: 114
A X: -0.772219 Y: 0.19086 Z: 1.22949
R X: -0.742878 Y: 0.185402 Z: 1.22981
frame: 115
A X: -0.760471 Y: 0.200374 Z: 1.23279
R X: -0.744311 Y: 0.256989 Z: 1.25096
frame: 116
A X: -0.731878 Y: 0.198095 Z: 1.26505
R X: -0.679766 Y: 0.171675 Z: 1.33831
frame: 117
A X: -0.695487 Y: 0.210412 Z: 1.30437
R X: -0.614995 Y: 0.227583 Z: 1.39838
frame: 118
A X: -0.368503 Y: 0.0875881 Z: 1.35784
R X: 0.565061 Y: -0.305894 Z: 1.4437
frame: 119
A X: -0.368503 Y: 0.0875881 Z: 1.35784
frame: 120
A X: -0.341719 Y: 0.0898316 Z: 1.38558
R X: -0.637176 Y: 0.265963 Z: 1.36194
frame: 121
A X: -0.325253 Y: 0.119372 Z: 1.39677
R X: -0.613902 Y: 0.289834 Z: 1.38308
frame: 122
A X: -0.325253 Y: 0.119372 Z: 1.39677
frame: 123
A X: -0.327192 Y: 0.153936 Z: 1.36274
R X: -0.622752 Y: 0.36584 Z: 1.26225
frame: 124
A X: -0.633316 Y: 0.331566 Z: 1.29572
R X: -0.659435 Y: 0.404626 Z: 1.17562
frame: 125
A X: -0.333012 Y: 0.149866 Z: 1.25675
R X: 0.564042 Y: -0.460838 Z: 1.20607
When I check 2 consecutive frames, we can see that even though there are almost no difference in images we get 30 centimeters of difference:

I calibrated well enough and I am sure of it because Z axis is very good. Results for Z axis very fine( in terms of world coordinates) but X and Y axis values are changing very different.
Has anyone got the same problem? What could be the problem ?
Any idea is helpful. For the code you can check the permalink above.
PS: Numbers in the image-> "Frame number: X Y"
Edit: Frame 110 and 121 below. Dict name -> cv::aruco::DICT_6X6_100
And calibration matrix(copy pasting):
"Çrş 28 Kas 2018 12:26:15 CET" 18 640 480 9 6 2.5000000372529030e-02 1. 14 3 3 d
3.5605857107067891e+02 0. 320. 0. 3.5605857107067891e+02 240. 0. 0.
1.5 1 d
-3.6909717721129226e-01 1.8826472886300075e-01 0. 0.
-5.3866147191806595e-021.0509950499922032e+00 18 1 f
4.21753258e-01 4.32509392e-01 5.25688529e-01 1.05710530e+00
2.86682010e+00 3.88209701e-01 3.67245942e-01 3.48465264e-01
5.46378076e-01 5.44550776e-01 3.82966489e-01 7.16525733e-01
1.44962454e+00 3.42115909e-01 2.36480251e-01 3.18511754e-01
3.61394346e-01 2.39512825e+0018 6 d
2.3581028259579853e-01 3.4539730619057274e-01 1.5523727598471431e+00
6.9464469780005714e-02 -7.1694380841610492e-02
2.0463295376002996e-01 2.9418612466600841e-01 4.2676946569039953e-01
1.5364493644155324e+00 -4.6404770426430618e-02
-8.4565075422056782e-02 2.6070531698922517e-01
5.9691185609737846e-03 8.6559798484542996e-02 1.6962936517036924e+00
-2.6473938720402771e-02 -8.7766539473429439e-02
1.8687467346387215e-01 7.0130552689413717e-01 7.3882343349733670e-01
1.4088088052476528e+00 2.2876335404880907e-01
-3.9252476855882609e-02 4.3295500159094941e-01
3.6420169858140539e-01 5.5503239295526918e-01 1.3842808555868522e+00
3.8500024333253530e-02 3.8227889750786351e-02 4.6073001470197378e-01
4.9913440052463015e-01 6.4511698850380506e-01 1.4040472224346119e+00
1.5372913101538044e-01 -6.9727318344403169e-02
2.1026752095524409e-01 2.4867644100931541e-01 2.1155425331581862e-01
1.0833360018240219e+00 -8.9277884861856602e-02
-5.7505480153457744e-02 2.7636181076417121e-01
5.0049683625497488e-01 1.4667573142132226e-01 1.5479570605011996e+00
1.9542080280279706e-02 -1.6139684495309319e-02
3.0785585364881435e-01 3.4285133529340034e-01 1.8426958215181805e-01
1.6380107852799111e+00 7.2066994089945616e-02
-1.1623841164969324e-01 1.8225618963197235e-01
1.7346308279257647e-01 1.0306068457409524e-01 1.6988854236892463e+00
-3.8748602274881222e-02 -1.0505785959022078e-01
1.8296145373312206e-01 6.3259254790171082e-01 5.2242977054390771e-01
1.5509774010247288e+00 1.6159727649707073e-01
-1.2754641230786581e-01 1.9665889763934019e-01
1.9846684098363976e-01 3.8205315130670375e-01 1.5509453961009463e+00
-7.7036794049779450e-02 -7.6206066240487522e-02
2.5051726675420971e-01 6.8622350896385076e-01 2.3949573314491704e-01
1.4269589534584088e+00 1.5778180182133075e-02
-1.4989968578995053e-01 3.7309965747309826e-01
2.6573184511757264e-01 2.6615917692392121e-01 1.5512812261896871e+00
-1.8045034972342607e-02 -9.5223197452107777e-02
2.8197527003124989e-01 1.5068834884307616e-01 6.4139545186130353e-02
1.9685217727179372e+00 -6.9291829129256952e-02
-1.1772227236425828e-01 3.4473521602563412e-01
4.4730915438449298e-01 4.4432074273144823e-01 1.4585243030781976e+00
6.5735408278935939e-02 -8.5038756333707943e-02
2.9567322726385536e-01 6.7765344951514184e-01 4.2568754889520533e-01
8.2808184592947853e-01 4.5146101431694771e-02
-1.2967637962832648e-01 2.7086308987256902e-01
6.8202115853238410e-01 2.2932931237326193e-01 1.0637596715838866e+00
-2.7202954328139729e-02 -1.1480272501957763e-01
3.9745759535277375e-01


↧
↧
cv::viz::Viz3d::spinOnce performances
Is there a way to optimize the performances of the viz::spinOnce(1, true) based on VTKRender? Should I get into the vtk renderer?
↧
How to increase TOTAL_MEMORY for OpenCV JS?
I am using **opencv.js **. After some time working (about 1 min) it crashes and in the browser console, I see the following.
Uncaught abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 2147221504, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "). Build with -s ASSERTIONS=1 for more info.
How can I increase TOTAL_MEMORY or set **ALLOW_MEMORY_GROWTH = 1** for Opencv JS
I built opencv.js as it's described [here](https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html)
↧
Installation error: opencv_perf_features2d
- OpenCV => 3.4.3
- Operating System / Platform => Raspbian Stretch
Hi,
following the standard procedure on https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/
after doing:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.3/modules \
-D BUILD_EXAMPLES=ON ..
gives me the following error at around 48%:
[ 46%] Built target opencv_perf_bioinspired
Scanning dependencies of target opencv_line_descriptor
[ 46%] Built target example_dpm_cascade_detect_sequence
[ 46%] Building CXX object modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/LSDDetector.cpp.o
Scanning dependencies of target opencv_saliency
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/BING/CmFile.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/BING/CmShow.cpp.o
[ 46%] Building CXX object modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/binary_descriptor.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/BING/FilterTIG.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/BING/ValStructVec.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/BING/objectnessBING.cpp.o
[ 46%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/ocl/test_feature2d.cpp.o
[ 46%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/opencl/perf_feature2d.cpp.o
[ 46%] Building CXX object modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/binary_descriptor_matcher.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/motionSaliency.cpp.o
[ 46%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/motionSaliencyBinWangApr2014.cpp.o
[ 47%] Building CXX object modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/draw.cpp.o
[ 47%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_agast.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_batchDistance.cpp.o
[ 48%] Linking CXX shared library ../../lib/libopencv_line_descriptor.so
[ 48%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/objectness.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_akaze.cpp.o
[ 48%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/saliency.cpp.o
/usr/bin/ld: error: ../../lib/libopencv_features2d.so.3.4.3: file too short
collect2: error: ld returned 1 exit status
modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/build.make:180: recipe for target 'lib/libopencv_line_descriptor.so.3.4.3' failed
make[2]: *** [lib/libopencv_line_descriptor.so.3.4.3] Error 1
CMakeFiles/Makefile2:12442: recipe for target 'modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/all' failed
make[1]: *** [modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 48%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/staticSaliency.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_feature2d.cpp.o
[ 48%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/staticSaliencyFineGrained.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_brisk.cpp.o
[ 48%] Building CXX object modules/saliency/CMakeFiles/opencv_saliency.dir/src/staticSaliencySpectralResidual.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_invariance.cpp.o
[ 48%] Linking CXX shared library ../../lib/libopencv_saliency.so
/usr/bin/ld: error: ../../lib/libopencv_features2d.so.3.4.3: file too short
collect2: error: ld returned 1 exit status
modules/saliency/CMakeFiles/opencv_saliency.dir/build.make:388: recipe for target 'lib/libopencv_saliency.so.3.4.3' failed
make[2]: *** [lib/libopencv_saliency.so.3.4.3] Error 1
CMakeFiles/Makefile2:13226: recipe for target 'modules/saliency/CMakeFiles/opencv_saliency.dir/all' failed
make[1]: *** [modules/saliency/CMakeFiles/opencv_saliency.dir/all] Error 2
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_regression.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_detectors_invariance.cpp.o
[ 48%] Linking CXX executable ../../bin/opencv_perf_features2d
/usr/bin/ld: error: ../../lib/libopencv_features2d.so.3.4.3: file too short
collect2: error: ld returned 1 exit status
modules/features2d/CMakeFiles/opencv_perf_features2d.dir/build.make:207: recipe for target 'bin/opencv_perf_features2d' failed
make[2]: *** [bin/opencv_perf_features2d] Error 1
CMakeFiles/Makefile2:12252: recipe for target 'modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all' failed
make[1]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all] Error 2
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_detectors_regression.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_fast.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_keypoints.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_main.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_matchers_algorithmic.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_mser.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_nearestneighbors.cpp.o
[ 48%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_orb.cpp.o
[ 48%] Linking CXX executable ../../bin/opencv_test_features2d
/usr/bin/ld: error: ../../lib/libopencv_features2d.so.3.4.3: file too short
collect2: error: ld returned 1 exit status
modules/features2d/CMakeFiles/opencv_test_features2d.dir/build.make:493: recipe for target 'bin/opencv_test_features2d' failed
make[2]: *** [bin/opencv_test_features2d] Error 1
CMakeFiles/Makefile2:12024: recipe for target 'modules/features2d/CMakeFiles/opencv_test_features2d.dir/all' failed
make[1]: *** [modules/features2d/CMakeFiles/opencv_test_features2d.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
Any suggestions?
Cheers
Bettina
↧
OpenCV on Android crash if resolution of image for laplace is too small
Hello!
I am working on a blur detection with OpenCV for Android and used following code found here which seemed to work correctly:
http://answers.opencv.org/question/111798/android-blur-image-detection-with-opencv-results-into-heavy-apk-size/
Now, my problem is that it crashs, if the resolution of the image is too small. In the sample code the transformed image gets resized to 2000*2000, but only if it is bigger than that.
It happens here:
> Imgproc.Laplacian(matImageGrey,> laplacianImage, CvType.CV_8U);
I have tested it serveral times and no crash with big images!
No crash image resolution: 1048 * 1048
Crash with resolution: 511*511
Does anybody now why this happens? It seems that there is a minimum image resolution size needed, but I can not find any info in the OpenCV documentation or in the internet.
Thanks!
↧
↧
opencv 4.0.1, build error if enabled openvx,skipSmallImagfes is not a member of cv::{anonymous}::ovx
opencv version, opencv4.0.1
platform, arm64
cmake, 3.10
if Enabled OpenVX, build error as following,
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:994:44: error: expected initializer before ‘<’ token
template <> inline bool skipSmallImages(int w, int h) { return w*h < 1280 * 720; }
^
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp: In function ‘bool cv::{anonymous}::openvx_medianFilter(cv::InputArray, cv::OutputArray, int)’:
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1010:28: error: ‘skipSmallImages’ is not a member of ‘cv::{anonymous}::ovx’
ksize != 3 ? ovx::skipSmallImages(src.cols, src.rows) :
^~~~~~~~~~~~~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1010:28: note: suggested alternative:
In file included from /home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:51:0:
/home/b55880/work/opencv_pro/opencv/modules/core/include/opencv2/core/openvx/ovx_defs.hpp:28:38: note: ‘cv::ovx::skipSmallImages’
template inline bool skipSmallImages(int w, int h) { return w*h < 3840 * 2160; }
^~~~~~~~~~~~~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1010:77: warning: left operand of comma operator has no effect [-Wunused-value]
ksize != 3 ? ovx::skipSmallImages(src.cols, src.rows) :
~~~~^~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1012:15: error: ‘skipSmallImages’ is not a member of ‘cv::{anonymous}::ovx’
ovx::skipSmallImages(src.cols, src.rows)
^~~~~~~~~~~~~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1012:15: note: suggested alternative:
In file included from /home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:51:0:
/home/b55880/work/opencv_pro/opencv/modules/core/include/opencv2/core/openvx/ovx_defs.hpp:28:38: note: ‘cv::ovx::skipSmallImages’
template inline bool skipSmallImages(int w, int h) { return w*h < 3840 * 2160; }
^~~~~~~~~~~~~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1012:57: warning: left operand of comma operator has no effect [-Wunused-value]
ovx::skipSmallImages(src.cols, src.rows)
~~~~^~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1018:33: error: ‘getOpenVXContext’ is not a member of ‘cv::{anonymous}::ovx’
ivx::Context ctx = ovx::getOpenVXContext();
^~~~~~~~~~~~~~~~
/home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:1018:33: note: suggested alternative:
In file included from /home/b55880/work/opencv_pro/opencv/modules/imgproc/src/median_blur.cpp:51:0:
/home/b55880/work/opencv_pro/opencv/modules/core/include/opencv2/core/openvx/ovx_defs.hpp:26:28: note: ‘cv::ovx::getOpenVXContext’
CV_EXPORTS_W ivx::Context& getOpenVXContext();
^~~~~~~~~~~~~~~~
modules/imgproc/CMakeFiles/opencv_imgproc.dir/build.make:1072: recipe for target 'modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/median_blur.cpp.o' failed
make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/median_blur.cpp.o] Error 1
CMakeFiles/Makefile2:1661: recipe for target 'modules/imgproc/CMakeFiles/opencv_imgproc.dir/all' failed
make[1]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2
↧
How MAC compiles opencv4.0.1
1. I want each module to be a separate so.
2. In particular, delete JNI from Java.
3. It's better to have a specific compilation step
↧
Plotting opencv coordinate to android screen
How to plot coordinates given by opencv on particular color detection to android screen accurately
↧
[Ubuntu 18.04] how add opencv built from source to QT applications
I have built opencv 4 from source and I would like to add it to my QT5 application.
source folder: /home/mike/opencv-4.0.1/
build folder: /home/mike/opencv-4.0.1/build/
I tried to define the below opencv.pri file to keep things organized but I get so many no such file or directory for included files in the source.
Any clue is much appreciate it.
here is the pri file:
INCLUDEPATH += -I/home/mike/opencv-4.0.1/include
LIBS += -L/home/mike/opencv-4.0.1/build -lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_shape -lopencv_videoio -lopencv_calib3d -lopencv_face
and here is the pro file.
#-------------------------------------------------
#
# Project created by QtCreator 2019-01-01T16:34:40
#
#-------------------------------------------------
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
include(/home/mike/opencv-4.0.1/opencv.pri)
TARGET = OpticalMeasure
TEMPLATE = app
QT += core gui xml xmlpatterns
QT += multimedia multimediawidgets
QT += concurrent widgets
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += c++11
LD_LIBRARY_PATH=/home/mike/Qt5.12.0/5.12.0/gcc_64/lib
#INCLUDEPATH += /usr/include/opencv
#LIBS += -L/usr/lib/x86_64-linux-gnu/ -lopencv_core -lopencv_imgcodecs -lopencv_highgui
#LIBS += -L/usr/local/lib -lopencv_shape -lopencv_videoio
#-lopencv_core -lopencv_imgcodecs -lopencv_highgui -lopencv_shape -lopencv_videoio -lopencv_calib3d -lopencv_face
LIBS += -L/home/mike/Qt5.12.0/5.12.0/gcc_64/lib
SOURCES += \
main.cpp \
mainwindow.cpp \
utils/settings.cpp \
utils/utils.cpp \
workerthread.cpp \
camera_calibration.cpp
HEADERS += \
mainwindow.h \
utils/constants.h \
utils/settings.h \
utils/utils.h \
workerthread.h
FORMS += \
mainwindow.ui \
videosettings.ui \
imagesettings.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += \
resources.qrc \
camera.qrc
QT+=widgets
DISTFILES += \
resources/calibration.xml \
resources/calibration.xml \
resources/calibration.json \
test
↧
↧
BGR to Lab conversion issue
Hi all,
I wrote the code for RGB to lab color conversion for cuda by using mathematical formulae which are mentioned in the OpenCV documentation but when I compare the l ,a ,b values from the cvColor function and my cuda function, there is a difference of 5 to 15. It will be great, if you suggest me the way.
__global__ void kRgb2CIELab(PtrStepSz src, PtrStepSz dst, int width, int height) {
int px = blockIdx.x * blockDim.x + threadIdx.x;
int py = blockIdx.y * blockDim.y + threadIdx.y;
if (px < width && py < height)
{
uchar3 nPixel = src(py, px);
float blue = (float)nPixel.x / 255.0;
float green = (float)nPixel.y / 255.0;
float red = (float)nPixel.z / 255.0;
float x = red * 0.412453 + green * 0.357580 + blue * 0.180423;
float y = red * 0.212671 + green * 0.715160 + blue * 0.072169;
float z = red * 0.019334 + green * 0.119193 + blue * 0.950227;
x /= 0.950456;
float y3 = exp(log(y) / 3.0);
z /= 1.088754;
float l, a, b;
x = x > 0.008856 ? exp(log(x) / 3.0) : (7.787 * x + 16/116);
y = y > 0.008856 ? y3 : 7.787 * y + 16/116;
z = z > 0.008856 ? z /= exp(log(z) / 3.0) : (7.787 * z + 16/116);
l = y > 0.008856 ? (116.0 * y3 - 16.0) : 903.3 * y;
a = (x - y) * 500.0;
b = (y - z) * 200.0;
uchar3 fPixel;
fPixel.x = static_cast(l * 255 / 100) ;
fPixel.y = static_cast(a + 128);
fPixel.z = static_cast(b + 128);
dst(py, px) = fPixel;
}
}
↧
Image Classification
I am trying to classify two kinds of images as follows:
(1)
(2)
classes can be called unscrewable/screwable. The screwable ones(1) are the ones with a slot on them, in addition to the hole, whereas the unscrewable ones only contain a hole.
There are two ways of solving this problem.
1. Train a network.
2. Use edge information.
I tried to use sobel derivates and Canny but one can't implement something that works for all, I mean, anything that is threshold-dependent is not so reliable, I try to avoid using such methods, therefore. What works for these two images, does not work for more and etc. Perhaps sobel derivates weren't the best choice for this type, I don't know. Hence, my question.
I was curious if anyone here try to achieve something similar. The difference between these two classes are really little, and I wonder if it makes sense to use purely traditional image processing techniques found in OpenCV or to deploy a neural network. I suspect haar classifier wouldn't be able to tackle this either.
What do you think?
↧
Taking 5 pictures in difference of 400 ms
Hi all,
I'm new in opencv for android and I'm trying to take 5 pictures every 400 ms and save them.
Here is what I did:
> btn_ok = findViewById(R.id.btn_ok);
btn_ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "on button click");
for(int i =0; i<5;i++) {
try {
TimeUnit.MILLISECONDS.sleep(400);
} catch (InterruptedException e) {
Log.i(TAG, "sleep exception");
e.printStackTrace();
}
Date sdf = new Date();
Log.i(TAG, "loop number: "+i);
String currentDateandTime = sdf.toString();
String fileName = Environment.getExternalStorageDirectory().getPath() +
"/sample_" + currentDateandTime +"__"+ i + ".jpeg";
cameraBridgeViewBase.takePicture(fileName);
}
}
also:
> public class myJavaCameraView extends JavaCameraView implements android.hardware.Camera.PictureCallback {
static{
System.loadLibrary("native-lib");
}
private static final String TAG = "Opencv";
private String mPictureFilename;
public myJavaCameraView(Context context, AttributeSet attrs ){
super(context,attrs);
}
public void takePicture(final String fileName)
{
Log.i(TAG,"Taking picture");
this.mPictureFilename = fileName;
mCamera.setPreviewCallback(null);
mCamera.takePicture(null,null,this);
}
@Override
public void onPictureTaken(byte[] data, Camera camera) {
Log.i(TAG,"saving bit,ap to file");
// the camera preview automatically stopped so we start it again
mCamera.startPreview();
mCamera.setPreviewCallback(this);
// write image to file
try {
FileOutputStream fos = new FileOutputStream(mPictureFilename);
fos.write(data);
fos.close();
}
catch (java.io.IOException e)
{
Log.e("PictureDemo", "exception in photocallback",e);
}
}
Looking at the log files I can see that after the fifth call to takePicture the OnPictureTaken get called 3/4 times so I guess it been stored in a queue. Someone know how can I overcome this problem? I need OnPictureTaken to be called right after every call for takePicture.
↧
Filtering a video with python
Hello I'd like to filter a video mp4 with IPython using openCV. Meaning turning a video with color to a white and black video. How can I do that ? Is there any tutorial about it please ?
Thanks in advance
↧
↧
Dense Optical flow from sparse motion vectors
Hi community,
I created a sparse optical flow (vector field) from KLT but I want to extend this to a dense optical flow (like Gunnar Farnback is doing). I found the function cv::ximgproc::EdgeAwareInterpolator() but this is very slow and without any acceleration. Could someone give me a hint?
↧
Linking prebuilt opencv static library in Android.mk
Hi
I am trying to link prebuilt external/opencv3 libopencv_core.a in the Android tree to my project that's also in the tree. I get the following error
ninja: error: 'out/target/product/neo/obj/STATIC_LIBRARIES/libopencv_core_prebuilt_intermediates/export_includes', needed by 'out/target/product/neo/obj/STATIC_LIBRARIES/libNV_intermediates/import_includes', missing and no known rule to make it
I am able to link to libopencv_core when Android builds it, but I need to link to opencv3 built with opencl created using the following make.
cd /hdd/NEO8/external/opencv3/platforms
./scripts/cmake_android_arm.sh -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=android-23 -DWITH_OPENCL=yes -DWITH_CUDA=no
cd build_android_arm
make -j8
OpenCV static libraries are created in the lib/arm64-v8a directory.
My project is all native code (c++) with no jni or Java.
The tree structure is:
hdd/NEO8/
external/opencv3 (this is where I build the libopencv_core.a)
device/my_app (this is where my Android.mk is)
The external/opencv3 code is v3.0 downloaded from Google.
I'd attach the Android.mk but this forum only allows image attachments. Below is how I'm adding the prebuilt to the Android.mk
include $(CLEAR_VARS)
PREBUILT_PATH := /hdd/NEO8/external/opencv3/platforms/build_android_arm/lib/arm64-v8a
PREBUILT_INCLUDE_PATH := /hdd/NEO8/external/opencv3
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(PREBUILT_INCLUDE_PATH) \
$(PREBUILT_INCLUDE_PATH)/modules/core/include \
$(PREBUILT_INCLUDE_PATH)/opencv2 \
$(PREBUILT_INCLUDE_PATH)/modules/hal/include
LOCAL_MODULE := libopencv_core_prebuilt
LOCAL_SRC_FILES := $(PREBUILT_PATH)/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)
The LOCAL_EXPORT_C_INCLUDE_DIRS is the same as what I use when I link to Android built opencv3.
I can tell that the Android build process is finding the libopencv_core.a file because when I change the static library name to something bogus, i.e.
LOCAL_SRC_FILES := $(PREBUILT_PATH)/libopencv_core_bogusName.a
the linker says it can't find **libopencv_core_bogusName.a**.
Is there a way to get more information out of the Android build info like a verbose=true setting?
Any ideas on what I can try would be greatly appreciated.
This is the entire Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
PREBUILT_PATH := /hdd/NEO8/external/opencv3/platforms/build_android_arm/lib/arm64-v8a
PREBUILT_INCLUDE_PATH := /hdd/NEO8/external/opencv3
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(PREBUILT_INCLUDE_PATH) \
$(PREBUILT_INCLUDE_PATH)/modules/core/include \
$(PREBUILT_INCLUDE_PATH)/opencv2 \
$(PREBUILT_INCLUDE_PATH)/modules/hal/include
LOCAL_MODULE := libopencv_core_prebuilt
LOCAL_SRC_FILES := $(PREBUILT_PATH)/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libNV
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
LOCAL_C_INCLUDES := \
external/opencv3/include/opencv \
external/opencv3/include \
external/opencv3/modules/core/include \
external/opencv3/modules/hal/include \
external/opencv3/modules/imgproc/include \
external/opencv3/modules/photo/include \
external/opencv3/modules/video/include \
external/opencv3/modules/objdetect/include \
external/opencv3/modules/features2d/include \
external/opencv3/modules/flann/include \
external/opencv3/modules/calib3d/include \
external/opencv3/modules/imgcodecs/include \
external/opencv3/modules/videoio/include \
external/opencv3/modules/highgui/include \
external/opencv3/modules/ml/include \
external/opencv3/modules/shape/include \
external/opencv3/modules/stitching/include \
external/opencv3/modules/superres/include \
external/opencv3/modules/videostab/include \
external/jsoncpp/include \
device/my_app/apps/external/OpenCL \
$(LOCAL_PATH)/include \
system/core/include
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH)/include
LOCAL_SRC_FILES := \
src/NVOpencv.cpp \
src/NVProcAngles.cpp \
src/NVUtils.cpp \
src/ILogger.cpp
LOCAL_CPPFLAGS := \
-std=c++14 \
-fPIC \
-fsigned-char \
-frtti \
-fexceptions \
-Wno-non-virtual-dtor \
-Wno-unused-parameter \
-Wno-write-strings
LOCAL_STATIC_LIBRARIES := \
libopencv_hal \
libopencv_core_prebuilt
LOCAL_SHARED_LIBRARIES := \
libc++ \
libopencv_imgproc \
#libopencv_core \
libdl \
liblog \
libion \
libOpenCL
LOCAL_TIDY = true
include $(BUILD_STATIC_LIBRARY)
↧
[Opencv4] Settings.write not working Incorrect element name {; should start with a letter or '_' in function 'operator
I am just trying to perform chessboard camera calibration based on [camera calibration](https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp) sample.
So I am trying to let my QT app save the calibrations settings using Settings class as defined int above code. There is a function for this which is Settings.write but when I call as below it gives me this error:
void saveCalibrationSettings(const Settings currentSettings){
FileStorage fs = FileStorage(Ui::calibrationFilename, FileStorage::WRITE);
currentSettings.write(fs);
fs.release();
}
the error is as below:
Gtk-Message: 02:56:21.529: Failed to load module "canberra-gtk-module"
Input does not exist: images/CameraCalibration/VID5/VID5.xmlterminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.0.1) /home/mike/opencv-4.0.1/modules/core/src/persistence.cpp:1995: error: (-2:Unspecified error) Incorrect element name {; should start with a letter or '_' in function 'operator<<'
I just need my QT GUI application to be able to save a Settings object into a file so that it could follow the correct calibration settings format which then can be fed to the calibration process.
↧