Alternative to findHomography ?

asked 2015-05-17 04:02:18 -0500

lock042 gravatar image

Hi there, I'm here with an annoying problem. I have 2 images I want to register. To do that I own 2 datasets of points in which I can have some outliers. The best function I could use for that would be findHomography, but I can't. Indeed I'm using a GTK3 project while calib3d is using GTK2. As a consequence I have :

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

So, as it seems I cannot use findHomography, are there other functions (not in opencv3) to do what I want ?

Or, maybe someone has an idea to use findHomography by avoiding the conflict (for sure, findHomography is exactly what I want ... So I'm feeling frustrated)

edit retag flag offensive close merge delete


findHomography, or even opencv's calib3d module are absolutely unrelated to gtk, only the highgui module(imshow) might depend on it.

several things to try:

  • if you're using opencv3, do not link against highgui (and modify the code, so it'S not using imshow, but your own gtk3 window

  • you could try to rebuild opencv without gtk support (cmake -DWITH_GTK=OFF)

berak gravatar imageberak ( 2015-05-17 04:10:44 -0500 )edit

I'm using opencv2 and do not include highgui. I took the repository version. I'm sure what i'm saying because every time I add the flag : lopencv_calib3d to compil the project, I have the GTK error ... Maybe because of the drawChessboardCorners function ? This function is available in the module but not used in my project.

May I disable the gtk support from repository version ? With a compiler flag ?

lock042 gravatar imagelock042 ( 2015-05-17 04:52:50 -0500 )edit

ok, i might be wrong about it, but drawChessboardCorners is only manipulating an image.

it might rather be due to inter-modules dependancies, also, image loading is in highgui (in 2.4, but not in 3.0)

"I took the repository version" - means what ? ppa ? git src ? (and no, if you only got binaries, you can't change any behaviour of that)

btw, which opencv version is it ?

berak gravatar imageberak ( 2015-05-17 05:15:47 -0500 )edit

Sorry I was not clear enough. I'm on Debian testing. I took the version on the debian repository : (opencv 2.4.9). I don't use highgui at all. Indeed, I load images without opencv.

lock042 gravatar imagelock042 ( 2015-05-17 05:22:39 -0500 )edit

ok. would you be able to locate the gtk dependancy ? what exactly do you link ? problem might be related to inter-module dependancies

berak gravatar imageberak ( 2015-05-17 06:13:48 -0500 )edit

ok. would you be able to locate the gtk dependancy ?

No I can't. I just know that when I add lopencv_calib3d in the compiler flag I have the problem.

I already use -lopencv_core -lopencv_imgproc with no problem. These are the only module I use.

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>

Thanks for trying to help

lock042 gravatar imagelock042 ( 2015-05-17 07:41:59 -0500 )edit

Ok. After doing ldd on the application, I did see that I have a link on highgui when I use "calib3d" ..... That's un bug ? I don't want to use it !!

lock042 gravatar imagelock042 ( 2015-05-18 02:23:51 -0500 )edit

yea, seen your issue. i'd say bug, too. still clueless, why the dependancy on highgui exists at all.

berak gravatar imageberak ( 2015-05-18 02:31:58 -0500 )edit

Ok thanks. Do you have any idea to avoid this problem ?

I tried to compil OpenCV but apparently as I'm on 64bits it's not that easy : I get errors during compilation even if I have dependencies installed ....

lock042 gravatar imagelock042 ( 2015-05-18 04:14:34 -0500 )edit

Ok, I have found a workaround by removing repository version and compiling the 2.4.10.

lock042 gravatar imagelock042 ( 2015-05-19 04:14:22 -0500 )edit