Ask Your Question

Missing cv::MOTION_HOMOGRAPHY and findTransformECC()

asked 2015-09-03 11:16:05 -0500

aarpon gravatar image

I am new to opencv and I guess I am doing something silly. But so far I really could not figure out what I am doing wrong.

I have used SIFT/SURF and ORB feature detection and matching in opencv 2.4, and I wanted to give the Enhanced Correlation Coefficient (ECC) Maximization algorithm a shot.

As an illustration, I took Satya Mallick's example from

Basically, even though other people seem to be able to use the findTransformECC() function and set (among others) the cv::MOTION_HOMOGRAPHY enum, I don't seem to have them defined anywhere.

I tried openCV 3.0 in Windows + VS 2013/2015 Community (downloaded the official release and added include and lib folders to the project) and Ubuntu + python 2.7 (checked out and built opencv + opencv_contrib from source) and I also tried the same code with opencv 2.4 both in Windows and in Ubuntu.

Any idea what I might be doing wrong?

Thanks a lot for any help, a2

edit retag flag offensive close merge delete



The function is only available in OpenCV 3.0 afaik. To use it in a C++ program, you need to include the corresponding header: #include <opencv2/video/video.hpp>

LorenaGdL gravatar imageLorenaGdL ( 2015-09-03 11:44:05 -0500 )edit
berak gravatar imageberak ( 2015-09-04 00:45:52 -0500 )edit

As far as I can tell, the opencv2/video/tracking.hpp header that comes with the opencv-3.0.0.exe download from does not define the findTransformECC function. Am I downloading the wrong distribution?

aarpon gravatar imageaarpon ( 2015-09-04 02:23:52 -0500 )edit

if that is so, you might have to clone/fork the github src code, and build from scratch using cmake.

(sounds scary, i know, but this way you'll get easy access to updates, bugfixes and such)

berak gravatar imageberak ( 2015-09-04 02:31:33 -0500 )edit

just saying ..

  • it's got nothing to do with the contrib repo, it's all in video module in the main trunk.
  • "I re-downloaded the official release for Windows" - this way you downloaded ~300mb of unuseable binaries, and you still don't have any git information. really, prefer git !
berak gravatar imageberak ( 2015-09-04 09:18:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-04 09:06:43 -0500

aarpon gravatar image

It turns out I must have downloaded opencv without the contrib package. I re-downloaded the official release for Windows and built it again from source in Ubuntu Linux and now everything is there... I apologize.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-09-03 11:16:05 -0500

Seen: 1,587 times

Last updated: Sep 03 '15