/** Function Headers */
void detectAndDisplay( Mat frame );
/** Global variables */
//-- Note, either copy these two files from opencv/data/haarscascades to your current folder, or change these locations
String face_cascade_name = "haarcascade_frontalface_alt.xml";
String eyes_cascade_name = "haarcascade_eye_tree_eyeglasses.xml";
CascadeClassifier face_cascade;
CascadeClassifier eyes_cascade;
string window_name = "Capture - Face detection - Remixed by TechBitar";
// Serial to Arduino global declarations
int arduino_command;
Tserial *arduino_com;
short MSBLSB = 0;
unsigned char MSB = 0;
unsigned char LSB = 0;
// Serial to Arduino global declarations
int main( int argc, const char** argv )
{
CvCapture* capture;
Mat frame;
// serial to Arduino setup
arduino_com = new Tserial();
if (arduino_com!=0) {
arduino_com->connect("COM7", 57600, spNONE); }
// serial to Arduino setup
// send X,Y of face center to serial com port
// send X axis
// read least significant byte
LSB = faces.x & 0xff;
// read next significant byte
MSB = (faces.x >> smiley-cool & 0xff;
arduino_com->sendChar( MSB );
arduino_com->sendChar( LSB );
// Send Y axis
LSB = faces.y & 0xff;
MSB = (faces.y >> smiley-cool & 0xff;
arduino_com->sendChar( MSB );
arduino_com->sendChar( LSB );
// serial com port send
Mat faceROI = frame_gray( faces );
std::vector<Rect> eyes;
}
//-- Show what you got
imshow( window_name, frame );