/* * main.cpp * * Copyright (c) 2010 Machine Perception Technologies */ #include // for cout and cerr #include "rimage.h" #include "ImageLoader.h" #include "mp_FDEyes.h" void displayFaceParameters(ObjectWithFeatures * obj) { float x=0.0, y=0.0, width=0.0, height=0.0, scale=0.0; x = obj->x; y = obj->y; width = obj->xSize; height = obj->ySize; scale = obj->scale; std::cout << "x: " << x << '\t'; std::cout << "y: " << y << '\t'; std::cout << "width: " << width << '\t'; std::cout << "height: " << height << '\t'; std::cout << "scale: " << scale << std::endl; } int main (int argc, char *argv[]) { CERT::ImageLoader loader; RImage pixels(0,0); std::string path_in = "images/test.jpg"; loader.loadRImage( pixels, path_in ); mp_FDEyes featureDetector; featureDetector.clearFeatures(); featureDetector.findAllFaces( pixels, false ); // false = don't use previously found face to restrict search ObjectWithFeatures *largestObject = featureDetector.getLargestFace(); // Find the largest face if( largestObject ){ std::cout<< "*** Largest Face:" << std::endl; displayFaceParameters(largestObject); } // find all faces OWFList faces= featureDetector.allFaces(); for(int i=0;i