Esempio n. 1
0
File: circles.cpp Progetto: Lyph/CSE
int main(int argc, const char * argv[])
{
    Circle myCircle;
    
    cout << "Center:\t(" << myCircle.getX() << ", " << myCircle.getY() << ")" << endl;
    cout << "Radius:\t" << myCircle.getR() << endl;
    cout << "Area:\t" << myCircle.area << endl;
    
    myCircle.setX(1);
    myCircle.setY(2);
    myCircle.setR(3);
    
    cout << endl;
    
    cout << "Center:\t(" << myCircle.getX() << ", " << myCircle.getY() << ")" << endl;
    cout << "Radius:\t" << myCircle.getR() << endl;
    
    return 0;
}
Esempio n. 2
0
void showTemplate(const MinutiaeTemplate & mt, double T, const char *name)
{
	Circle c;
	c.setT(T);
	c.getCenter(mt);
	c.fromTemplate(mt);
	Mat mat(500, 500, CV_8UC3, Scalar(255, 255, 255));
	int offsetx = 100, offsety = 100, R = c.getR();
	circle(mat,Point(c.getCenterX()+offsetx,c.getCenterY()+offsety),R,Scalar(0,255,0));
	for(int i = 1; i < c.getSize(); i+=2)
	{
		double p1 = c.getPoint(i-1);
		double p2 = c.getPoint(i);
		line(mat,Point(R*cos(p1)+c.getCenterX()+offsetx,R*sin(p1)+c.getCenterY()+offsety),
				Point(R*cos(p2)+c.getCenterX()+offsetx,R*sin(p2)+c.getCenterY()+offsety),
				Scalar(255,0,0));
	}
	for(int i = 0; i < mt.getSize(); i++)
		circle(mat,Point(mt.getMinutia(i).getX()+offsetx,mt.getMinutia(i).getY()+offsety),3,Scalar(0,0,255),CV_FILLED);
	imshow(name,mat);
}