Click here to Skip to main content
11,931,104 members (61,393 online)
Click here to Skip to main content


69 bookmarked

Image Alignment Algorithms - Part II

, 21 Apr 2008 CPOL
Implementing and comparing the forwards compositional and the Hager-Belhumeur algorithms.
// Module: auxfunc.h
// Brief:  
// Author: Oleg A. Krivtsov
// Email:
// Date:  March 2008

#ifndef __AUXFUNC_H__
#define __AUXFUNC_H__

#include "cv.h"

void init_warp(CvMat* W, float wz, float tx, float ty, float s);

void warp_image(IplImage* pSrcFrame, IplImage* pDstFrame, CvMat* W, float step=1.0f);
void draw_warped_rect(IplImage* pImage, CvRect rect, CvMat* W);

 *  Helper macros for getting/setting CvMat elements.

#define SET_VECTOR(X, u, v)\
	CV_MAT_ELEM(*(X), float, 0, 0) = (float)(u);\
	CV_MAT_ELEM(*(X), float, 1, 0) = (float)(v);\
	CV_MAT_ELEM(*(X), float, 2, 0) = 1.0f;

#define GET_VECTOR(X, u, v)\
	(u) = (int)CV_MAT_ELEM(*(X), float, 0, 0);\
	(v) = (int)CV_MAT_ELEM(*(X), float, 1, 0);
#endif //__AUXFUNC_H__

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Oleg Krivtsov
Software Developer
Russian Federation Russian Federation
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 21 Apr 2008
Article Copyright 2008 by Oleg Krivtsov
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid