#include "cardIdentifier.h"
	
//------------------------------
cardIdentifier::cardIdentifier(){

}

//------------------------------
void cardIdentifier::setup(){
	cardAnal.setup(CARD_CV_W, CARD_CV_H);
}

//this can definately be bypassed with caching!
//------------------------------
void cardIdentifier::processCard(card &theCard, ofxCvGrayscaleImage &GreyFrame, ofxCvColorImage &VideoFrame){
			
	cardAnal.getCardAsCvImage(theCard, GreyFrame, VideoFrame); 
	cardAnal.dynamicThreshold();
	cardAnal.calculateHuMoments(theCard, true);
	cardAnal.calculateCardProperties(theCard);

}


//------------------------------
void cardIdentifier::processCard(card & theCard, cardImageSet & cardOut, ofxCvGrayscaleImage &GreyFrame, ofxCvColorImage &VideoFrame){
	
	cardAnal.getCardAsCvImage(theCard, GreyFrame, VideoFrame); 
	cardAnal.dynamicThreshold();
	cardAnal.calculateHuMoments(theCard, true);
	cardAnal.calculateCardProperties(theCard);
	cardAnal.copyCardDataIntoCardImage(cardOut);
	
}