affine modle

// tttt.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "opencv/cv.h"
#include "opencv/highgui.h"

int _tmain(int argc, _TCHAR* argv[])
{
	IplImage *img1 = cvLoadImage("0.bmp",0);
	IplImage *img2 = cvLoadImage("1.bmp",0);
	IplImage *diff = cvCreateImage(cvGetSize(img1),8,1);
	cvSub(img1,img2,diff);
// 	cvScale(diff,diff,10);
	CvScalar err = cvSum(diff);
	cvShowImage("tewt",diff);
	CvMat *mat = cvCreateMat(6,1,CV_32FC1);
	int _grad[4];
	int _x[12];
	int _a[36];
	int _b[6];
	CvMat grad = cvMat(2,2,CV_32SC1,_grad);
	CvMat X = cvMat(6,2,CV_32SC1,_x);
	CvMat *tmp = cvCreateMat(6,2,CV_32SC1);
	CvMat A = cvMat(6,6,CV_32SC1,_a);
	CvMat B = cvMat(6,1,CV_32SC1,_b);
	cvSetZero(&A);
	cvSetZero(&B);

	uchar *p1 = img1->imageData+img1->widthStep;
	uchar *p2 = img2->imageData+img2->widthStep;
	for (int  i = 1 ; i < img1->height - 1 ; i++ , p1+=img1->widthStep , p2+=img2->widthStep)
	{
		for (int j = 1 ; j < img1->width - 1 ; j++)
		{

		}
	}

	cvWaitKey(0);
	return 0;
}

你可能感兴趣的:(affine modle)