Running OpenCV SuperpixelSEEDS class without installing contrib module
I want to utilize SuperpixelSEEDS class implementing the SEEDS (Superpixels Extracted via Energy-Driven Sampling) superpixels algorithm described in:
Michael Van den Bergh, Xavier Boix, Gemma Roig, Luc Van Gool: SEEDS: Superpixels Extracted via Energy-Driven Sampling. International Journal of Computer Vision (IJCV), 2014.
Full documentation:
However, installing contrib module is not an option in this case since I will be integrating it to Android platform.
Is it possible to compile seeds.hpp along with the implementation seeds.cpp with opencv not compiled along with opencv_contrib module?
Here's one failed attempt:
$ g++ -ggdb `pkg-config --cflags --libs opencv` seeds_sample.cpp seeds.cpp
/tmp/ccwT1ohy.o: In function `cv::operator*=(cv::Mat&, double const&)':
/usr/local/include/opencv2/core/operations.hpp:254: undefined reference to `cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
/tmp/ccwT1ohy.o: In function `cv::operator&=(cv::Mat&, cv::Scalar_<double> const&)':
/usr/local/include/opencv2/core.hpp:1143: undefined reference to `cv::noArray()'
/tmp/ccwT1ohy.o: In function `cv::operator&=(cv::Mat&, cv::Scalar_<double> const&)':
/usr/local/include/opencv2/core/operations.hpp:264: undefined reference to `cv::bitwise_and(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&)'
/tmp/ccwT1ohy.o: In function `main':
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:41: undefined reference to `cv::VideoCapture::VideoCapture()'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:48: undefined reference to `cv::VideoCapture::open(int)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:53: undefined reference to `cv::imread(cv::String const&, int)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:58: undefined reference to `cv::VideoCapture::isOpened() const'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:70: undefined reference to `cv::namedWindow(cv::String const&, int)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:77: undefined reference to `cv::createTrackbar(cv::String const&, cv::String const&, int*, int, void (*)(int, void*), void*)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:78: undefined reference to `cv::createTrackbar(cv::String const&, cv::String const&, int*, int, void (*)(int, void*), void*)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:79: undefined reference to `cv::createTrackbar(cv::String const&, cv::String const&, int*, int, void (*)(int, void*), void*)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:80: undefined reference to `cv::createTrackbar(cv::String const&, cv::String const&, int*, int, void (*)(int, void*), void*)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:91: undefined reference to `vtable for cv::VideoCapture'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:93: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:107: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:109: undefined reference to `cv::getTickCount()'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:114: undefined reference to `cv::getTickCount()'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:114: undefined reference to `cv::getTickFrequency()'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:124: undefined reference to `cv::Mat::setTo(cv::_InputArray const&, cv::_InputArray const&)'
/home/cobalt/Workspace/SEEDS/seeds_sample.cpp:130: undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
/home/cobalt/Workspace/SEEDS/seeds_sample ...
In cmake you can select what you want to build. As SuperpixelSEEDS seems to be in module ximgproc you can disable all other contrib module. I haven't try but may be it could work