Ask Your Question

Asalle's profile - activity

2016-08-19 07:23:28 -0500 received badge  Critic (source)
2016-08-19 07:15:48 -0500 received badge  Supporter (source)
2016-08-18 04:24:40 -0500 received badge  Editor (source)
2016-08-18 04:23:14 -0500 received badge  Scholar (source)
2016-08-18 04:23:10 -0500 received badge  Self-Learner (source)
2016-08-18 04:20:08 -0500 commented question Linking ThinPlateSplineShapeTransformer failed (undefined reference)

It was a stupid mistake. It seems that the order of g++'s arguments matter:

g++ -std=c++11 -I../install/include -L../install/lib -lopencv_shape -o try try.cpp won't work, while

g++ -std=c++11 -I../install/include -L../install/lib -o try try.cpp -lopencv_shape will. So, all I did was postpone the -lopencv_shape to the end. Silly Billy.

Thank you for such a warm welcome and support, I hope to become a valuable member of this community!

2016-08-18 01:33:05 -0500 commented question Linking ThinPlateSplineShapeTransformer failed (undefined reference)

I am sorry, I have not quite understood what do you mean by 'what does X resolve to?'. If you're asking about its meaning then is equivalent to the following

 -I/home/asalle/opencv/install/include/opencv -I/home/asalle/opencv/install/include -L/home/asalle/opencv/install/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core

Fortunately, I figured it out and already answered my own question, but it has not shown yet. Is there some kind of answers moderation here?

Thanks anyway!

2016-08-17 10:04:54 -0500 asked a question Linking ThinPlateSplineShapeTransformer failed (undefined reference)

Hi all,

I built OpenCV 3.1.0-dev (latest by today) and installed it to a subdir of my home dir. Now, I want to compile a simple example cpp-file, using my freshly installed OpenCV

#include <iostream>
#include <opencv2/shape/shape_transformer.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <vector>

int main()
    auto tps = cv::createThinPlateSplineShapeTransformer();
    std::vector<cv::Point2f> sourceP, targetP;
    sourceP.push_back(cv::Point2f(0, 0));
    targetP.push_back(cv::Point2f(100, 0));
    sourceP.push_back(cv::Point2f(799, 0));
    targetP.push_back(cv::Point2f(799, 0));
    sourceP.push_back(cv::Point2f(0, 599));
    targetP.push_back(cv::Point2f(0, 599));
    sourceP.push_back(cv::Point2f(799, 599));
    targetP.push_back(cv::Point2f(799, 599));

    std::vector<cv::DMatch> matches;

    for (int i = 0; i < sourceP.size(); ++i)    
         matches.push_back(cv::DMatch(i, i, 0)); 

    return 0;

with the following Makefile

try: try.cpp
    g++ -ggdb -std=c++11 `pkg-config --cflags --libs ../install/lib/pkgconfig/opencv.pc` try.cpp -o try

install is the directory, where I installed the opencv, it contains include, lib, share and others

try.cpp is the code snippet

The error I'm getting is as follows: asalle@azazaz:~/opencv/try$ make

g++ -ggdb -std=c++11 `pkg-config --cflags --libs ../install/lib/pkgconfig/opencv.pc` try.cpp -o try
/tmp/ccncYN0U.o: In function `main':
/home/asalle/opencv/try/try.cpp:10: undefined reference to `cv::createThinPlateSplineShapeTransformer(double)'
collect2: error: ld returned 1 exit status
make: *** [try] Error 1

I already tried

g++ -std=c++11 -I../install/include -L../install/lib/ -lopencv_shape try.cpp -o try

but with no success.

Any help will be appreciated, Asalle