Skip to content

Commit

Permalink
Add opencv_calib3 check arounf vpKeyPoint usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Dec 11, 2024
1 parent 94ef334 commit 870a795
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 21 deletions.
3 changes: 2 additions & 1 deletion modules/vision/include/visp3/vision/vpKeyPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

#include <visp3/core/vpConfig.h>

#if (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
#if ((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <algorithm> // std::transform
#include <float.h> // DBL_MAX
Expand Down
15 changes: 7 additions & 8 deletions modules/vision/src/key-point/vpKeyPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,29 @@

#include <visp3/core/vpConfig.h>

#if (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
// opencv_xfeatures2d and opencv_nonfree are optional
#if ((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <iomanip>
#include <limits>

#include <visp3/core/vpIoTools.h>
#include <visp3/vision/vpKeyPoint.h>

#if defined(HAVE_OPENCV_3D)
#if (VISP_HAVE_OPENCV_VERSION >= 0x050000)
#include <opencv2/3d.hpp>
#include <opencv2/features.hpp>
#endif

#if defined(HAVE_OPENCV_FEATURES)
#include <opencv2/features.hpp>
#if (VISP_HAVE_OPENCV_VERSION <0x050000)
#include <opencv2/calib3d.hpp>
#endif

#if defined(HAVE_OPENCV_XFEATURES2D)
#include <opencv2/xfeatures2d.hpp>
#endif

#if defined(HAVE_OPENCV_3D)
#include <opencv2/3d.hpp>
#endif

#if defined(VISP_HAVE_PUGIXML)
#include <pugixml.hpp>
#endif
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
#if defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpImage.h>
#include <visp3/core/vpIoTools.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))
#if defined(HAVE_OPENCV_IMGPROC) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))

#if defined(HAVE_OPENCV_FEATURES)
#include <opencv2/features.hpp>
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint-4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))
#if defined(HAVE_OPENCV_IMGPROC) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpImage.h>
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint-5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))
#if defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpImage.h>
#include <visp3/core/vpIoTools.h>
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint-6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))
#if defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpImage.h>
#include <visp3/core/vpIoTools.h>
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint-7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES))
#if defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpException.h>
#include <visp3/core/vpImage.h>
Expand Down
4 changes: 3 additions & 1 deletion modules/vision/test/keypoint-with-dataset/testKeyPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
#if defined(HAVE_OPENCV_IMGPROC) && defined(HAVE_OPENCV_VIDEO) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#include <visp3/core/vpImage.h>
#include <visp3/core/vpIoTools.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ int main()
{
//! [Define]
#if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_XFEATURES2D)) || ((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_FEATURES))
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D) && defined(HAVE_OPENCV_XFEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

//! [Define]
#ifdef ENABLE_VISP_NAMESPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

int main(int argc, const char **argv)
{
#if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
#if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
Expand Down
6 changes: 4 additions & 2 deletions tutorial/detection/matching/tutorial-matching-keypoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
int main()
{
//! [Define]
#if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_FEATURES) || defined(HAVE_OPENCV_XFEATURES2D) || defined(HAVE_OPENCV_NONFREE))
//! [Define]
#if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_IMGPROC) && \
((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && defined(HAVE_OPENCV_FEATURES2D)) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES))
//! [Define]
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
int main(int argc, char **argv)
{
#if defined(HAVE_OPENCV_IMGPROC) && \
(((VISP_HAVE_OPENCV_VERSION < 0x050000) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_XFEATURES2D))) || ((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_FEATURES)))
(((VISP_HAVE_OPENCV_VERSION < 0x050000) && defined(HAVE_OPENCV_CALIB3D) && (defined(HAVE_OPENCV_FEATURES2D) || defined(HAVE_OPENCV_XFEATURES2D))) || \
((VISP_HAVE_OPENCV_VERSION >= 0x050000) && defined(HAVE_OPENCV_3D) && defined(HAVE_OPENCV_FEATURES)))

#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
Expand Down

0 comments on commit 870a795

Please sign in to comment.