예제 #1
0
/*  =============================================================================
    Method: prints out coords of all points
    
    @param  none
    @return none
    ========================================================================== */
int Figure_6::printAll() {

	//polygon and circle variable to check
	Polygon *p;
	Circle *c;

	//run through all the layers and find out which 
	for (unsigned j = 0; j < oldLayers.size(); ++j) {
	
		cout << "-----------------------------" << endl;
		
		for (unsigned k = 0; k < oldLayers[j].size(); ++k) {
		
			if ((p = dynamic_cast<Polygon*>(oldLayers.at(j).at(k)))) {  
				// Is Polygon
				
				for (unsigned i = 0; i < p->getVertexCount(); ++i) { 
				
					//print out layer and vertices
					cout << "P: (" << p->getVertexX(i) << ", " << p->getVertexY(i) << ") "; 
					cout << "Layer: " << j << endl;
				}
				
			} else if ((c = dynamic_cast<Circle*>(oldLayers.at(j).at(k)))) {
			 
				// Is Circle
				cout << "C: (" << c->getCenterX() << ", " << c->getCenterY() << ") "; 
				cout << "Layer: " << j << endl;
			}
		}
	}

	return 0;
}
예제 #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);
}