Compile error with OpenCV 3.3.0 and xfeatures2d - c++

I downloaded the latest versions of opencv 3.3.0 and opencv_contrib, did the cmake with CUDA support and the make gives me:
....
[ 80%] Built target opencv_xfeatures2d_pch_dephelp
[ 80%] Built target pch_Generate_opencv_xfeatures2d
[ 80%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/sift.cpp.o
/home/cesar/programas/instaladores/OpenCV/opencv_contrib-master/modules/xfeatures2d/src/sift.cpp: In member function ‘virtual void cv::xfeatures2d::SIFT_Impl::detectAndCompute(cv::InputArray, cv::InputArray, std::vector<cv::KeyPoint>&, cv::OutputArray, bool)’:
/home/cesar/programas/instaladores/OpenCV/opencv_contrib-master/modules/xfeatures2d/src/sift.cpp:1156:9: error: ‘removeDuplicatedSorted’ is not a member of ‘cv::KeyPointsFilter’
KeyPointsFilter::removeDuplicatedSorted( keypoints );
^
modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/build.make:670: fallo en las instrucciones para el objetivo 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/sift.cpp.o'
make[2]: *** [modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/src/sift.cpp.o] Error 1
CMakeFiles/Makefile2:21949: fallo en las instrucciones para el objetivo 'modules/xfeatures2d/CMakeFiles/opencv_xfeatures2d.dir/all'
I'm lost here. I tried updating my cmake from 3.5 to 3.8 and the building stops at the same point.
Thanks for any help!

It seems you got downmodded, yet have not received any feedback.
Your question, I believe, doesn't really belong on stackoverflow. opencv_contrib Is explicitly unstable. The API's for the contained modules are under development and are subject to change at any point in time. Build errors may well arise when building it, too.
I think you'd be better off trying to file a bug report with the module's developers.

removeDuplicatedSorted is just added to opencv master branch 3 days ago and is not back ported to 3.3.0 yet. However sift is updated to it. opencv_contrib tend to sync with master branch. it doesn't have a matching version branch/tag

Related

Error using Cygwin: "collect2: fatal error: ld terminated with signal 11 [Segmentation fault]"

I'm trying to use cygwin to download openslide (building natively on Windows) on a Windows 10 x64 system. I ran into an error earlier relating to chk_fail and set the line in the build file with -D_FORTIFY_SOURCE to 0 instead of the default (2). You can probably tell by now I don't really know what I'm doing. But I got a new error below relating to a memory error from what I've read. I tried deleting the whole package folder including the makefiles and object files, then clone from Github again and rebuild, but it didn't work. Can anyone give me pointers about what's happening here and how to fix it? It would be much appreciated.
Scanning dependencies of target ziptool
[ 90%] Building C object src/CMakeFiles/ziptool.dir/ziptool.c.obj
[ 90%] Linking C executable ziptool.exe
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make[2]: *** [src/CMakeFiles/ziptool.dir/build.make:109: src/ziptool.exe] Error 1
make[2]: *** Deleting file 'src/ziptool.exe'
make[1]: *** [CMakeFiles/Makefile2:442: src/CMakeFiles/ziptool.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
Failed: make $parallel (line 417)
I solved this problem. Firstly, don't even bother to build this package using Cygwin. It won't work because of dependency issues and there is no record for version control in the package README.
For anyone else who has this problem like I did, you can download the latest versions of the code here: https://github.com/openslide/openslide-winbuild/releases and pick the latest one.
I first pip installed openslide-python. Then I moved openslide-win64-20171122 (from Github) into anaconda3/site-packages (not necessary, but nice), and then from anaconda3/site-packages/openslide I opened lowlevel.py.
In lowlevel.py, you need to add the following lines:
(in the beginning after importing libraries)
os.environ['PATH'] = "path/to/openslide-win64-20171122/bin" + ";" + os.environ['PATH']
You can also change this line:
if platform.system() == 'Windows':
_lib = cdll.LoadLibrary('libopenslide-0.dll')
to this:
if platform.system() == 'Windows':
_lib = cdll.LoadLibrary(util.find_library("libopenslide-0.dll"))
so that it searches for the libopenslide-0.dll file. Then don't forget to add from ctypes import util at the beginning.

fatal error while compiling pybind11 test cases on raspbian

Following this question, I'm now trying to compile the pybind11 test cases as instructed here on a Raspberry Pi. What I have done so far:
installed Raspbian Raspbian Buster Lite from the official page
updated/upgraded all packages
updated/upgraded python packages following the instructions here
compiled and installed pybind11 following the instructions here
my environment is:
Raspbian buster version 10
python 3.7.3
pip 20.0.2
gcc 8.3.0
Then running the command make check -j 4 the compiler stops at:
[ 68%] Building CXX object CmakeFiles/pybind11_tests.dir/test_numpy_dtypes.cpp.o
and the errors are:
c++: fatal error: Killed signal terminated program cplusplus
compilation terminated.
make[3]: *** [CMakeFiles/pybind11_tests.dir/build.make:297: CMakeFiles/pybind11_tests.dir/test_local_bindings.cpp.o] Error 1
make[3]: *** waiting for unfinished jobs...
make[2]: *** [CMakeFiles/Makefile2:110: CMakeFiles/pybind11_tests.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:191: CMakeFile/check.dir/rule] Error 2
make: *** [Makefile:157: check] Error 2
I would appreciate it if you could help me understand what is the problem and how I can solve it.
Doing more research and using the right keyword query, it seems this issue has nothing to do with bypynd11 or Raspbian for that matter. The issue seems to be with memory overflow as described in numerous posts before (including here and here). The solution might be to use fewer parallel processes -j <n> where n < 4, or do not use it at all as suggested here. For example, I tested the
make check -j 3
and it works. Or alternatively to create a swape file as described here.
Yes you have to create first swap file. After that you can do it. Acctually swap file will increase yor ram memory. It will use rom space for ram performance.
Please go through with below link it would help you.
https://youtu.be/Cr5mDFxvsb0

Coding error on BaseMacLayer

When building the Veins (Version:4.4) on Omnet version omnetpp-5.1pre2-src-windows, I get the following error output:
**19:58:05 **** Incremental Build of configuration gcc-release for project veins ****
make MODE=release all
make[1]: Entering directory '/c/Users/SIA/Omnet/omnetpp-5.1pre2-src-windows/omnetpp-5.1pre2/samples/veins/src'
veins/base/modules/BaseMacLayer.cc
veins/base/modules/BaseMacLayer.cc:74:29: error: cast from pointer to smaller type 'LAddress::L2Type' (aka 'long') loses information
myMacAddr = LAddress::L2Type(addressString.c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:165: ../out/clang-release/src/veins/base/modules/BaseMacLayer.o] Error 1
make[1]: Leaving directory '/c/Users/SIA/Omnet/omnetpp-5.1pre2-src-windows/omnetpp-5.1pre2/samples/veins/src'
make: *** [Makefile:12: all] Error 2
19:58:08 Build Finished (took 3s.360ms)**
Appreciate if someone can help me on this.
Though, admittedly, this also points to an underlying inconsistency in the code, Veins 4.4 is a simulation module library for OMNeT++ 4.6. It is also compatible with OMNeT++ 5.0.
You are using a version of OMNeT++ (5.1 pre-release) that Veins is not compatible with.
This means that a downgrade of your OMNeT++ installation should rectify the build error.
The Veins tutorial on http://veins.car2x.org/tutorial/ goes into more detail of which software needs to be installed (and how) for Veins to work.

Building emulator for AOSP 4.2.2 with make -j4

I am trying to build emulator for Android open source project (AOSP) 4.2.2 and when I compile make -j4, I get the following error.
ost C: acp <= build/tools/acp/acp.c
host C: libhost <= build/libs/host/CopyFile.c
host C++: libandroidfw <= frameworks/base/libs/androidfw/AssetDir.cpp
host C++: libandroidfw <= frameworks/base/libs/androidfw/AssetManager.cpp
/var/folders/1v/7qwg76xn3fs34bpkbj7sw0k00000gq/T//ccmomvtt.s:1854:FATAL:Symbol _isSourceNewer.eh already defined.
/var/folders/1v/7qwg76xn3fs34bpkbj7sw0k00000gq/T//ccGfRe2w.s:829:FATAL:Symbol _process.eh already defined.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libhost_intermediates/CopyFile.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [out/host/darwin-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
What is going wrong? I followed source website to build this. My system configuration: Mac OS 10.7.5
I finally figured out the what the problem is. I did couple of things to make this work.
Remove any previous version of Xcode on your machine running on
OS x 10.7.
Look for Developer/ folder in the home directory. Move that to trash (It belongs to Xcode)
Reinstall Xcode 4.2 (which I used and it worked)
Follow the AOSP documentation to update the rest using macports.

Crash with opencv video intitialisation

I have the problem which is described here.
The extension i have already set correct.
What i have done regarding the suggestet Points on the link:
Point 1: I have looked in my cmake file and ffmpeg, libavutil etc is all chosen.
Point 2: I thought all files are installed automatically in usr/src if you don't change it, isn't it?
Point 3: It is a new installation. But btw. how can i deinstall the lib?
Point 4: Shouldn't be the problem.
Thx in advance
Further infos:
Opensuse 12.3
Opencv-2.4.3
Qt4 Environment
C++ Commands used last:
VW.open(vsm, CV_FOURCC('F','L','V','1'), 25, vidImg.size(),!(vidImg.channels() == 1));
Filename in vsm: /home/Ingeborg/DA/videos/IMG-2013-11-19-22-3-5.avi
Do you have a flv or avi? These are two different formats. If you do a ffprobe on the file it will tell you the format. Also you need to check if you have compiled ffmpeg with the codec support for the codecs used in your file. ffmpeg -codecs ffmpeg -formats will help you with that.
Yes. At last i have found libavcodec , which was missing. With ffmpeg installed manually i've got different other problems. I think the main thing is that i don't know how to install the stuff correctly on its place.
At the moment i have a similar problem and i think i found a solution. While installing OpenCV 2.4.7 i got this output :
Linking CXX shared library ../../lib/libopencv_world.so
c++: error: ../highgui/CMakeFiles/opencv_highgui.dir/__/__ /release/modules/highgui
/qrc_window_QT.cpp.o: Datei oder Verzeichnis nicht gefunden
make[2]: *** [lib/libopencv_world.so.2.4.7] Fehler 1
make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Fehler 2
make: *** [all] Fehler 2
I think the solution is here. My simple question is (i feel a little mad, because it seems totally common), where i have to write the LD_LIBRARY_PATH down ?
Thanks!