コード例 #1
0
void   Morphining::DoAffineTrsform(IplImage *src,IplImage *dst,vector<Coordinate> coord1,vector<Coordinate> coord2,double T,int type,bool debug)//T:Threshold of SSD's error;
{
	CvMat* Matrix = cvCreateMat(3,3,CV_32FC1);
	Matrix = GetAffineMatrix(coord1,coord2,debug);

	//if(SSD(coord1,coord2,Matrix,100))
	//{ 
		Vertex = new Coordinate [m_numFeature];
		for(int i = 0;i < m_numFeature;i++)
		{
			Vertex[i] = coord1[i];
		}
		Graphic FindLine;
		FindLine.CuttingRegion(coord1,m_numFeature,m,b);	
        AffineTrsform(src,dst,Matrix,type,debug);
		if(debug)
		{
			cvNamedWindow("dst",0);
			cvShowImage("dst",dst);
			cvWaitKey(0);
		}
	//}
		
	cvReleaseMat(&Matrix);	   
}