face_align_test.cpp
Go to the documentation of this file.
00001 #include"cob_people_detection/face_normalizer.h"
00002 #include<iostream>
00003 #include<opencv/cv.h>
00004 #include<opencv/highgui.h>
00005 int main(int argc, const char *argv[])
00006 {
00007 
00008         std::cout << "[FaceNormalizer] running scene no. " << argv[1] << "...\n";
00009         FaceNormalizer::FNConfig cfg;
00010         cfg.eq_ill = false;
00011         cfg.align = true;
00012         cfg.resize = true;
00013         cfg.cvt2gray = true;
00014         cfg.extreme_illumination_condtions = false;
00015 
00016         std::string class_path = "/opt/ros/groovy/share/OpenCV/";
00017 
00018         FaceNormalizer fn;
00019         fn.init(class_path, cfg);
00020         cv::Mat depth, img, xyz;
00021         std::string i_path;
00022         //else      i_path="/share/goa-tz/people_detection/eval/Kinect3DSelect/";
00023         i_path = "/share/goa-tz/people_detection/eval/KinectIPA/";
00024 
00025         i_path.append(argv[1]);
00026         std::string xml_path = i_path;
00027         xml_path.append(".xml");
00028 
00029         fn.read_scene(xyz, img, xml_path);
00030         cv::Mat wmat1, wmat2;
00031         img.copyTo(wmat1);
00032         img.copyTo(wmat2);
00033         cv::Size norm_size = cv::Size(100, 100);
00034         //cv::cvtColor(wmat1,wmat1,CV_RGB2BGR);
00035 
00036         cv::imshow("ORIGINAL", wmat1);
00037 
00038         cv::Mat depth_res;
00039         std::vector<cv::Mat> synth_images;
00040         // call member functions of FaceNormalizer
00041         fn.synthFace(wmat1, xyz, norm_size, synth_images);
00042         //fn.isolateFace(wmat1,xyz);
00043         //fn.normalizeFace(wmat1,xyz,norm_size,depth);
00044         //fn.recordFace(wmat1,xyz);
00045 
00046 
00047         synth_images.push_back(wmat1);
00048         // depth.convertTo(depth,CV_8UC1,255);
00049         // cv::equalizeHist(depth,depth);
00050 
00051 
00052         //cv::imshow("NORMALIZED",wmat1);
00053         for (int j = 0; j < synth_images.size(); j++)
00054         {
00055                 cv::imshow("NORMALIZED", synth_images[j]);
00056                 cv::waitKey(0);
00057                 std::cout << j << std::endl;
00058         }
00059         std::cout << "..done\n";
00060         return 0;
00061 }


cob_people_detection
Author(s): Richard Bormann , Thomas Zwölfer
autogenerated on Fri Aug 28 2015 10:24:12