Skip to content

Commit

Permalink
Disable SIFT usage during testing on macOS. Closes #1106
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Oct 6, 2022
1 parent 492a5eb commit bccc7d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ViSP 3.5.1 (under development)
. [#1080] Fails to configure with Xcode generator
. [#1094] vpIoTools::makeTempDirectory() fails to create a temporary directory inside
a parent directory on Unix
. [#1106] SIFT Illegal Instruction error on macOS Intel with OpenCV 4.6.0 installed with brew
----------------------------------------------
ViSP 3.5.0 (released February 15, 2022)
- Contributors:
Expand Down
15 changes: 11 additions & 4 deletions modules/vision/test/keypoint-with-dataset/testKeyPoint-5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ void run_test(const std::string &env_ipath, bool opt_click_allowed, bool opt_dis
#if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) || \
(VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400)
#if (VISP_HAVE_OPENCV_VERSION != 0x040504) && (VISP_HAVE_OPENCV_VERSION != 0x040505) && \
(defined(__APPLE__) && defined(__MACH__))
(VISP_HAVE_OPENCV_VERSION != 0x040600) && (defined(__APPLE__) && defined(__MACH__))
// SIFT is known to be unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
// Same for OpenCV 4.6.0 (see #1106) where it produces an Illegal Instruction error when OpenCV 4.6.0 is
// installed with brew. It seems working when OpenCV is build from source
detectorNames.push_back("PyramidSIFT");
detectorNames.push_back("SIFT"); // SIFT is known unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
detectorNames.push_back("SIFT");
#endif
#endif
#if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D)
Expand Down Expand Up @@ -258,9 +261,13 @@ void run_test(const std::string &env_ipath, bool opt_click_allowed, bool opt_dis
for (int i = 0; i < vpKeyPoint::DETECTOR_TYPE_SIZE; i++) {
#if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) || \
(VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400)
#if (VISP_HAVE_OPENCV_VERSION == 0x040504 || VISP_HAVE_OPENCV_VERSION == 0x040505) && \
#if ((VISP_HAVE_OPENCV_VERSION == 0x040504) || (VISP_HAVE_OPENCV_VERSION == 0x040505) || \
(VISP_HAVE_OPENCV_VERSION == 0x040600)) && \
(defined(__APPLE__) && defined(__MACH__))
if (i == vpKeyPoint::DETECTOR_SIFT) { // SIFT is known unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
// SIFT is known to be unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
// Same for OpenCV 4.6.0 (see #1106) where it produces an Illegal Instruction error when OpenCV 4.6.0 is
// installed with brew. It seems working when OpenCV is build from source
if (i == vpKeyPoint::DETECTOR_SIFT) {
continue;
}
#endif
Expand Down
9 changes: 6 additions & 3 deletions modules/vision/test/keypoint-with-dataset/testKeyPoint-7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,12 @@ template <typename Type> void run_test(const std::string &env_ipath, const std::
((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(VISP_HAVE_OPENCV_XFEATURES2D) || \
(VISP_HAVE_OPENCV_VERSION >= 0x030411 && CV_MAJOR_VERSION < 4) || (VISP_HAVE_OPENCV_VERSION >= 0x040400))
{
#if !((VISP_HAVE_OPENCV_VERSION == 0x040504 || VISP_HAVE_OPENCV_VERSION == 0x040505) && \
(defined(__APPLE__) && defined(__MACH__))) // OpenCV != 4.5.4 and 4.5.5 on macOS
std::string keypointName = "SIFT"; // SIFT is known unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
#if (VISP_HAVE_OPENCV_VERSION != 0x040504) && (VISP_HAVE_OPENCV_VERSION != 0x040505) && \
(VISP_HAVE_OPENCV_VERSION != 0x040600) && (defined(__APPLE__) && defined(__MACH__))
// SIFT is known to be unstable with OpenCV 4.5.4 and 4.5.5 on macOS (see #1048)
// Same for OpenCV 4.6.0 (see #1106) where it produces an Illegal Instruction error when OpenCV 4.6.0 is
// installed with brew. It seems working when OpenCV is build from source
std::string keypointName = "SIFT";
keyPoints.setDetector(keypointName);
keyPoints.setExtractor(keypointName);

Expand Down

0 comments on commit bccc7d9

Please sign in to comment.