How to use SIFT in opencv 4.7.0? (Apple, EXC_BAD_INSTRUCTION EXC_I386_INVOP)

void myFeatureExtractor::extractSIFT(){
    //clone image to be safe
    cv::Ptr<cv::SIFT> myDetector{NULL};
    if (input_image.empty()) {
        std::cout << "Picture couldn't be loaded correctly." << std::endl;
    cv::Mat myInput = input_image.clone();
    //cv::imshow("Input Image", myInput);
    myDetector = cv::SIFT::create(); //0,3,0.04,10,1.6
    std::vector<cv::KeyPoint> keypoints;
    cv::Mat SIFT_output_image;

    // Add results to image and save.
    cv::drawKeypoints(myInput, keypoints, SIFT_output_image);
    result_image = SIFT_output_image;


Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

os ? hw ? compiler ? how did you install this ?

is this somehow apple related ?

MacOS Monterey 12.6.3, 1,4 GHz Quad-Core Intel Core i5,
I am using Xcode
I installed with Homebrew.
Most probably it is related to MacOS because other friends using Apple have the same error.


1 Like