Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build with OpenCV 4 #596

Open
ChristophHaag opened this issue Jan 22, 2019 · 6 comments
Open

Does not build with OpenCV 4 #596

ChristophHaag opened this issue Jan 22, 2019 · 6 comments
Assignees

Comments

@ChristophHaag
Copy link
Contributor

ChristophHaag commented Jan 22, 2019

Archlinux ships OpenCV 4 and osvr-core does not build with it.

There are several #ifdefs in the code checking explicitly for OpenCV 2 or 3 and producing an #error for OpenCV 4 but just removing those does not help, apparently the API changed.

osvr-core should either

  1. build an appropriate opencv version with osvr-core
  2. allow the selection of an opencv installation in a non default path (/opt/...) in cmake It already does that with OpenCV_DIR
  3. update to the opencv 4 API
@rpavlik
Copy link
Member

rpavlik commented Jan 22, 2019 via email

@ChristophHaag
Copy link
Contributor Author

This method was not immediately obvious from the CMakeList.txt but it works. Thanks.

@rpavlik
Copy link
Member

rpavlik commented Jan 22, 2019 via email

@rpavlik rpavlik self-assigned this Jan 22, 2019
@ChristophHaag
Copy link
Contributor Author

Updated to make it compile with OpenCV4: ChristophHaag@f693399

I have not tested running this, I mostly just used the suggestions from my IDE. I haven't cared to test whether the code still works with OpenCV3, personally I would just ditch OpenCV2 and OpencV3 support to minimize the maintenance burden.

@rpavlik
Copy link
Member

rpavlik commented Jul 27, 2020

awesome thanks christoph, I will check and merge this soonish.

@isopix
Copy link

isopix commented Oct 16, 2020

[(https://aur.archlinux.org/packages/osvr-core-git/)]
it's patched version for OpenCV4. It compiled with OpenCV 4.3 and older gcc. But it won't compile with OpenCV 4.5

[85%] Built target com_osvr_Multiserver Scanning dependencies of target vbtracker-core [ 85%] Building CXX object plugins/videobasedtracker/CMakeFiles/vbtracker-core.dir/BeaconBasedPoseEstimator.cpp.o /mnt/magazyn/archlinux/aur-osvr-core-git/src/osvr-core/plugins/videobasedtracker/BeaconBasedPoseEstimator.cpp: In member function ‘bool osvr::vbtracker::BeaconBasedPoseEstimator::m_pnpransacEstimator(osvr::vbtracker::LedGroup&)’: /mnt/magazyn/archlinux/aur-osvr-core-git/src/osvr-core/plugins/videobasedtracker/BeaconBasedPoseEstimator.cpp:303:14: error: ‘void ransacResult’ has incomplete type 303 | auto ransacResult = cv::solvePnPRansac( | ^~~~~~~~~~~~ make[2]: [plugins/videobasedtracker/CMakeFiles/vbtracker-core.dir/build.make:82: plugins/videobasedtracker/CMakeFiles/vbtracker-core.dir/BeaconBasedPoseEstimator.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:2083: plugins/videobasedtracker/CMakeFiles/vbtracker-core.dir/all] Error 2 make: *** [Makefile:171: all] Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants