Click here to Skip to main content
15,884,788 members
Articles / Programming Languages / C

Image Alignment Algorithms - Part II

Rate me:
Please Sign up or sign in to vote.
4.13/5 (23 votes)
21 Apr 2008CPOL11 min read 93.5K   4.9K   75  
Implementing and comparing the forwards compositional and the Hager-Belhumeur algorithms.
// Module: auxfunc.h
// Brief:  
// Author: Oleg A. Krivtsov
// Email:  olegkrivtsov@mail.ru
// 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.

License

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


Written By
Software Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions