Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opencv stitching with free dll

I have a function in my project that would do stitching, the function is working fine, it is very simple:

Mat output(m_Img, true), pano; // a panaoramic image

    bool try_use_gpu = true;
    Stitcher iSticher = Stitcher::createDefault(try_use_gpu);   
    // Set Feature finder to be ORB
    iSticher.setFeaturesFinder(new detail::OrbFeaturesFinder());

    try{

        Stitcher::Status status = iSticher.stitch(Imgs, pano);
        if (status != Stitcher::OK)
        {
            LOG("Error stitching - Code: %d", int(status));
            return -1;
        }
    }
    catch(exception e)
    {
        LOG("Cannot Stitch Image,%s",e.what());
    }

The code works well and I was able to stitch images fairly well. The only problem is that when I want to deploy my code, I realized that I have to use non-free dll. Otherwise, the .exe won't run. My questions are: in order to use Stitcher class from opencv does that mean you have to pay, even if you are not using SURF or SIFT algorithms? Is there a way to do it without using "nonfree dlls"? Note: I am using opencv 2.4.2. Edit: I also tested it with OpenCV 2.4.11

like image 991
Samer Avatar asked Nov 09 '22 21:11

Samer


1 Answers

So, after a lot of digging. I think I have found a solution to this issue: There is a flag in opencv_modules.hpp called: HAVE_OPENCV_NONFREE If you undefine or comment the definition of this flag and build opencv from source then this should fix this issue, i.e. opencv_stitching.dll will not depeneds on opencv_non-free.dll

like image 197
Samer Avatar answered Nov 15 '22 13:11

Samer