I have to implement the SURF algorithm for image stitching. I was having trouble with the libraries, as listed here
After trying the solutions I could find, I removed the opencv and started to build from scratch. I tried to include the 'opencv_contrib' library during installation, but it didn't work.
So I installed opencv, and then tried to integrate the package as told int he github repository of the package. During the
make -j2
line, I keep getting the following error.
[ 77%] Building CXX object modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/src/sparse_match_interpolators.cpp.o
In file included from /home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core.hpp:54:0,
from /home/akshat/OpenCV/opencv-3.0.0/build/modules/ximgproc/precomp.hpp:40:
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp: In member function ‘virtual void cv::ximgproc::EdgeAwareInterpolatorImpl::interpolate(cv::InputArray, cv::InputArray, cv::InputArray, cv::InputArray, cv::OutputArray)’:
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:171:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’
CV_Assert( !from_points.empty() && from_points.isVector() &&
^
/home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core/base.hpp:389:33: note: in definition of macro ‘CV_Assert’
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
^
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:172:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’
!to_points .empty() && to_points .isVector() &&
^
/home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core/base.hpp:389:33: note: in definition of macro ‘CV_Assert’
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
^
make[2]: *** [modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/src/sparse_match_interpolators.cpp.o] Error 1
make[1]: *** [modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/all] Error 2
make: *** [all] Error 2
Thanks in advance
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:171:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’
testifies this is a version incompatibility. The code in ximgproc expects a different interface from cv (specifically, cv::_InputArray) than the one your stock one is providing.
Your options here are:
try the version of the opencv-contrib codebase that corresponds to your installed version of cv
make yet another attempt to build the newer cv that corresponds to your current opencv-contrib
Related
I'm Trying to install TensorFlow (c++ lib) by source compiling on ODROID XU4 but get error while eager become build.
Error is:
ERROR: /home/odroid/buildFile/tensorflow/tensorflow/tensorflow/core/distributed_runtime/eager/BUILD:148:1: C++ compilation of rule '//tensorflow/core/distributed_runtime/eager:remote_tensor_handle_data' failed (Exit 1)
tensorflow/core/distributed_runtime/eager/remote_tensor_handle_data.cc: In function 'void tensorflow::{anonymous}::DestoryRemoteTensorHandle(tensorflow::EagerContext*, tensorflow::eager::EagerClient*, tensorflow::uint64, tensorflow::uint64, int)':
tensorflow/core/distributed_runtime/eager/remote_tensor_handle_data.cc:30:12: error: 'class tensorflow::EagerContext' has no member named 'GetContextId'; did you mean 'NewContextId'?
if (ctx->GetContextId() != context_id) {
^~~~~~~~~~~~
NewContextId
Target //tensorflow:libtensorflow_cc.so failed to build
How I can fix it?
OR Is Impossible for me to disable building this module in bazel command?
tnx.
I was trying to compile the GStreamer wrapper for QT, so I downloaded the 2 packages iam using QT 5.12.3 and Mingw32 7.3.0
gstreamer-1.0-devel-mingw-x86-1.16.0.msi
gstreamer-1.0-mingw-x86-1.16.0.msi
Then I installed them, and add the bin folder to the system environment so the Cmake can recognize the dependencies needed from the GStreamer when compiling the QtGstreamer, I downloaded the last version of QtGStreamer 1.2.0 and used Cmake to generate the file, I linked all the dependencies which is QT, Boost, and GStreamer.
when I came to the step of mingw32-make I got error on 17% which is
In file included from C:/boost_1_69_0/boost/detail/workaround.hpp:8:0,
from C:/boost_1_69_0/boost/mpl/aux_/config/workaround.hpp:17,
from C:/boost_1_69_0/boost/mpl/aux_/static_cast.hpp:17,
from C:/boost_1_69_0/boost/mpl/aux_/value_wknd.hpp:17,
from C:/boost_1_69_0/boost/mpl/if.hpp:17,
from D:/build/qtgstreamer/qt-gstreamer-master/src/QGlib/type.h:24,
from D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\global.h:25,
from D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\caps.h:20,
from D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\caps.cpp:17:
C:/boost_1_69_0/boost/type_traits/detail/config.hpp:85:69: warning: "__clang_major___WORKAROUND_GUARD" is not defined, evaluates to 0 [-Wundef]
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(__clang_major__, <= 4)
^
C:/boost_1_69_0/boost/config/workaround.hpp:246:10: note: in definition of macro 'BOOST_WORKAROUND'
((symbol ## _WORKAROUND_GUARD + 0 == 0) && \
^~~~~~
C:/boost_1_69_0/boost/type_traits/detail/config.hpp:85:69: warning: "__clang_major__" is not defined, evaluates to 0 [-Wundef]
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(__clang_major__, <= 4)
^
C:/boost_1_69_0/boost/config/workaround.hpp:247:9: note: in definition of macro 'BOOST_WORKAROUND'
(symbol != 0) && (1 % (( (symbol test) ) + 1)))
^~~~~~
In file included from D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstbuffer.h:30:0,
from D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstpad.h:70,
from D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstelement.h:87,
from D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstbin.h:27,
from D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gst.h:35,
from D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\caps.cpp:22:
D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\caps.cpp: In member function 'void QGst::Caps::append(const CapsPtr&)':
D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstminiobject.h:33:65: error: invalid cast from type 'const CapsPtr {aka const QGlib::RefPointer<QGst::Caps>}' to type 'GstMiniObject* {aka _GstMiniObject*}'
#define GST_MINI_OBJECT_CAST(obj) ((GstMiniObject*)(obj))
^
D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstcaps.h:35:47: note: in definition of macro 'GST_CAPS_CAST'
#define GST_CAPS_CAST(obj) ((GstCaps*)(obj))
^~~
D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstcaps.h:249:29: note: in expansion of macro 'GST_CAPS'
#define gst_caps_copy(caps) GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)))
^~~~~~~~
D:/gstreamer/1.0/x86/include/gstreamer-1.0/gst/gstcaps.h:249:61: note: in expansion of macro 'GST_MINI_OBJECT_CAST'
#define gst_caps_copy(caps) GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)))
^~~~~~~~~~~~~~~~~~~~
D:\build\qtgstreamer\qt-gstreamer-master\src\QGst\caps.cpp:57:40: note: in expansion of macro 'gst_caps_copy'
gst_caps_append(object<GstCaps>(), gst_caps_copy(caps2));
^~~~~~~~~~~~~
mingw32-make[2]: *** [src\QGst\CMakeFiles\Qt5GStreamer.dir\build.make:137: src/QGst/CMakeFiles/Qt5GStreamer.dir/caps.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:309: src/QGst/CMakeFiles/Qt5GStreamer.dir/all] Error 2
mingw32-make: *** [Makefile:140: all] Error 2
so what is the mistake I did?
I don't know if there is anything else needed to clear my Error, please tell me if you need anything to add
Update
When I configure the Cmake options, I did not add qt5declarative Cmake, I left it empty, after I made searches on this part i found that this part is no longer supported from QT 5.6, I am not sure if the problem is related to this part, but totaly this is eveyrhting I have done so far.
a screenshot from my cmake GUI
You should try with Gstreamer 1.14.4
First I am not very familiar with C++ compile process, but I have to compile the emgucv repository on Ubuntu 18.04. I follow the instruction and try to figure out things by searching through Stack Exchange.
I got every dependencies setup, then the only file I need to execute is this one.
Although it is written for 16.04, seems to work for 18.04, but the compilation throws an error. It says _MAX_DRIVE, _MAX_DIR, _MAX_PATH, DWORD, errno_t, etc. are not declared. As suggested by the comment, they are Windows-specific. The error occurs in this file. And the module that contains this file is this.
My question is how to get this compiled on Ubuntu 18.04? I am very confused, since Emgucv says they support Linux (instruction at the end), and I believe others could have successfully compiled it on their Linux. I attempted to replace those constants _MAX_DRIVE, _MAX_DIR, _MAX_PATH by just numbers, the DWORD by unsigned long, and errno_t by int, then it says now GetModuleFileName, _splitpath_s are not declared. I don't know how to do. Is there anyway for this to work for Ubuntu?
[ 74%] Building CXX object Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp: In member function ‘void tesseract::CCUtil::main_setup(const char*, const char*)’:
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:77:16: error: ‘_MAX_DRIVE’ was not declared in this scope
char drive[_MAX_DRIVE];
^~~~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:78:14: error: ‘_MAX_DIR’ was not declared in this scope
char dir[_MAX_DIR];
^~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:79:15: error: ‘_MAX_PATH’ was not declared in this scope
char path[_MAX_PATH];
^~~~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:83:5: error: ‘DWORD’ was not declared in this scope
DWORD length = GetModuleFileName(nullptr, path, sizeof(path));
^~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:85:9: error: ‘length’ was not declared in this scope
if (length > 0 && length < sizeof(path)) {
^~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:85:39: error: ‘path’ was not declared in this scope
if (length > 0 && length < sizeof(path)) {
^~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:86:7: error: ‘errno_t’ was not declared in this scope
errno_t result = _splitpath_s(path, drive, sizeof(drive),
^~~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:88:11: error: ‘result’ was not declared in this scope
if (result == ERANGE) {
^~~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:92:17: error: ‘drive’ was not declared in this scope
datadir = drive;
^~~~~
/media/philips_cpm/data1/emgucv/Emgu.CV.Extern/tesseract/libtesseract/tesseract-ocr.git/src/ccutil/mainblk.cpp:93:18: error: ‘dir’ was not declared in this scope
datadir += dir;
^~~
Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/build.make:302: recipe for target 'Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o' failed
make[2]: *** [Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/tesseract-ocr.git/src/ccutil/mainblk.cpp.o] Error 1
CMakeFiles/Makefile2:5929: recipe for target 'Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/all' failed
make[1]: *** [Emgu.CV.Extern/tesseract/libtesseract/CMakeFiles/tesseract_ccutil.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
Emgu CV compile manual for Ubuntu
The commands are summarized below
git clone https://github.com/emgucv/emgucv emgucv
cd emgucv
git submodule update --init --recursive
cd platforms/ubuntu/16.04
./apt_install_dependency.sh
./cmake_configure.sh
I'm trying to install openalpr on MacOSX El Capitan 10.11.6
and when I tried to run 'make' command, it goes smoothly until it reaches 55% which it generates following errors. Here are the steps that I followed (https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(OS-X))
error output image
The remaining outputs are:
In file included from /Users/Anonymous/openalpr/src/daemon.cpp:8:
In file included from
/Users/Anonymous/openalpr/src/video/logging_videobuffer.h:5:
In file included from /usr/local/include/log4cplus/logger.h:36:
In file included from
/usr/local/include/log4cplus/spi/appenderattachable.h:33:
In file included from /usr/local/include/log4cplus/appender.h:36:
/usr/local/include/log4cplus/helpers/pointer.h:134:21: error: cannot
initialize object parameter of type 'const
log4cplus::helpers::SharedObject' with an expression of type
'log4cplus::spi::Filter'
pointee->removeReference();
^~~~~~~
/usr/local/include/log4cplus/helpers/pointer.h:152:17: note: in
instantiation of member function
'log4cplus::helpers::SharedObjectPtr<log4cplus::spi::Filter>::~SharedObjectPtr' requested here
SharedObjectPtr<T> (rhs).swap (*this);
^
/usr/local/include/log4cplus/helpers/pointer.h:147:30: note: in instantiation of member function 'log4cplus::helpers::SharedObjectPtr<log4cplus::spi::Filter>::operator=' requested here
return this->operator = (rhs.pointee);
^
/usr/local/include/log4cplus/appender.h:211:62: note: in instantiation of member function
'log4cplus::helpers::SharedObjectPtr<log4cplus::spi::Filter>::operator=' requested here
void setFilter(log4cplus::spi::FilterPtr f) { filter = f; }
^
1 warning and 7 errors generated.
make[2]: *** [CMakeFiles/alprd.dir/daemon.cpp.o] Error 1
make[1]: *** [CMakeFiles/alprd.dir/all] Error 2
make: *** [all] Error 2`
I believe you're missing the atomic library. You can find it here. Place it alongside all the other c++ include files in your system.
I'm tring to conform a part of matlab source to C++. The matlab source calls a matlab lib named Manopt for params optimizing, So I found a lib in C++ named ROPTLIB(http://www.math.fsu.edu/ROPTLIB/) to realize the same optimization as Manopt.
The problem occured when I download ROPTLIB and try to run the example demo in ROPTLIB user manual. I wrote a CMakeLists.txt(as follow) to compile the lib source code, for there is no compiling tools in lib diretory(except matlab script, but I want the lib run in pure C++ environment in my ubuntu 14.04LTS). The package of lapack and blas are also link to project as you can see in CMakelists.txt.
I try to search the Problem both in google and other forums, but no one can help me. If you have any experience for debug locale_facets_nonio.tcc:918:22: error: expected unqualified-id before or ROPTLIB, printing it blow mat help me.
CmakeLists.txt:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
SET(ProjectName TestProductExample)
PROJECT(${ProjectName})
FILE(GLOB_RECURSE all_files
"${CMAKE_CURRENT_SOURCE_DIR}/Solvers/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Problems/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Others/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/*.cpp"
)
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}/Solvers/"
"${CMAKE_CURRENT_SOURCE_DIR}/Problems/"
"${CMAKE_CURRENT_SOURCE_DIR}/Problems/StieSumBrockett/"
"${CMAKE_CURRENT_SOURCE_DIR}/Others/"
"${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/"
"${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/Stiefel/"
"${CMAKE_CURRENT_SOURCE_DIR}/Manifolds/Euclidean/"
"${CMAKE_CURRENT_SOURCE_DIR}/blas/"
"${CMAKE_CURRENT_SOURCE_DIR}/lapack/"
)
message(STATUS "add include_directories " ${INCLUDE_DIRECTORIES})
if(${CMAKE_COMPILER_IS_GNUCC})
message (STATUS "add c++11 flags")
add_definitions(-Wall -s -std=c++11 )
endif()
set(LIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/;${LIB}")
message (STATUS "blas and lapack lib is in ${LIB}")
add_executable(${ProjectName} ${CMAKE_CURRENT_SOURCE_DIR}/test/TestProductExample.cpp ${all_files})
link_directories({${LIB}})
target_link_libraries(${ProjectName} lapack_LINUX.a blas_LINUX.a tmglib_LINUX.a)
message (STATUS "CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}, CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
message (STATUS "CMAKE_COMPILER_IS_GNUCC is ${CMAKE_COMPILER_IS_GNUCC}")`
error log:
[ 1%] Building CXX object CMakeFiles/TestProductExample.dir/test/TestProductExample.cpp.o
In file included from /usr/include/c++/4.7/bits/locale_facets_nonio.h:1903:0,
from /usr/include/c++/4.7/locale:43,
from /usr/include/c++/4.7/iomanip:45,
from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Manifolds/Manifold.h:23,
from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Problems/Problem.h:16,
from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/test/TestProductExample.cpp:20:
/usr/include/c++/4.7/bits/locale_facets_nonio.tcc: In member function ‘_InIter std::time_get<_CharT, _InIter>::_M_extract_name(std::time_get<_CharT, _InIter>::iter_type, std::time_get<_CharT, _InIter>::iter_type, int&, const _CharT**, std::size_t, std::ios_base&, std::ios_base::iostate&) const’:
/usr/include/c++/4.7/bits/locale_facets_nonio.tcc:918:22: error: expected unqualified-id before ‘(’ token
In file included from /home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/test/TestProductExample.cpp:15:0:
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h: At global scope:
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:69:13: warning: ‘void next_state()’ declared ‘static’ but never defined [-Wunused-function]
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:64:22: warning: ‘randgen::state’ defined but not used [-Wunused-variable]
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:65:12: warning: ‘randgen::left’ defined but not used [-Wunused-variable]
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:66:12: warning: ‘randgen::initf’ defined but not used [-Wunused-variable]
/home/wangyuanjiang/Documents/software/ROPTLIB_2016-04-29_CPP/Others/randgen.h:67:23: warning: ‘randgen::next’ defined but not used [-Wunused-variable]
make[2]: *** [CMakeFiles/TestProductExample.dir/test/TestProductExample.cpp.o] Error 1
make[1]: *** [CMakeFiles/TestProductExample.dir/all] Error 2
make: *** [all] Error 2