コード例 #1
0
int main(int argc, char *argv[]) {
  hog.setSVMDetector(cv::HOGDescriptor::getDefaultPeopleDetector());
  //hog.setSVMDetector(cv::HOGDescriptor::getDaimlerPeopleDetector());

  cv::Mat input_img;
  if (argc == 2) {
    //printf("Usage %s [file]\n", argv[0]);
    // return -1;
    std::string file(argv[1]);
    input_img = cv::imread(file, CV_LOAD_IMAGE_COLOR);
    process_image(input_img);
    cv::waitKey(0);
  }

  //cv::VideoCapture cap(0);
  cv::VideoCapture cap;
  cap.open("/home/arnaud/Desktop/Baudet-Rob.mp4");
  if (!cap.isOpened()) {
        printf("Cannot open camera!"); return -1;
  }

  while(true) {
    cap >> input_img;
    cv::resize(input_img, input_img, cv::Size(320, 240));
    process_image(input_img);
    cv::waitKey(15);
  }
  return 0;
}
コード例 #2
0
 people_detection_hog(const options& in_opt):
     opt(in_opt.person_d)
 {
     scenter_x=in_opt.width*opt.scale/2.0;
     scenter_y=in_opt.height*opt.scale/2.0;
     center_x=in_opt.width/2.0;
     center_y=in_opt.height/2.0;
     hog.setSVMDetector(hog.getDefaultPeopleDetector());
 }
コード例 #3
0
void peopleDetectApp::setup()
{
    hog.setSVMDetector(cv::HOGDescriptor::getDefaultPeopleDetector());
    
    capture = Capture(640, 480);
    capture.start();
    
    stillSurface = loadImage(loadAsset( "people_in_park.jpg" ) );
	stillTex = gl::Texture(stillSurface);
    
}
コード例 #4
0
void ocvOpticalFlowApp::setup()
{
	mDrawPoints = true;
	
//	mCapture = Capture( 640, 480 );
//	mCapture.start();
    
	fs::path moviePath = getOpenFilePath();
	if( ! moviePath.empty() )
		loadMovieFile( moviePath );  

    hog.setSVMDetector( cv::HOGDescriptor::getDefaultPeopleDetector() );

}