hog_detector/src/integral_hog_trainer.cc
void AddTrainingEntriesFromCenter(IntegralHogDetector* detector,
                                  const vector<string>& imageFiles,
                                  float label) {
  for (vector<string>::const_iterator imageFile = imageFiles.begin();
       imageFile != imageFiles.end(); ++imageFile) {
    ROS_DEBUG_STREAM("Extracting HOG descriptors from " << *imageFile);

    // Start by opening the image
    Mat image = imread(*imageFile);

    // Find the winSize_ window in the center of the image
    cv::Rect win((image.cols - FLAGS_winW) / 2,
                 (image.rows - FLAGS_winH) / 2,
                 FLAGS_winW,
                 FLAGS_winH);

    detector->AddRegionsForTraining(image, vector<Rect>(1, win),
                                    vector<float>(1, label));

  }
}
// Adds the center of the images to the detector for training
Adds the center of the images to the detector for training
Adds the center of the images to the detector for training
void AddTrainingEntriesFromCenter(IntegralHogDetector* detector,
                                  const vector<string>& imageFiles,
                                  float label) {
  for (vector<string>::const_iterator imageFile = imageFiles.begin();
       imageFile != imageFiles.end(); ++imageFile) {
    ROS_DEBUG_STREAM("Extracting HOG descriptors from " << *imageFile);
    Mat image = imread(*imageFile);
    cv::Rect win((image.cols - FLAGS_winW) / 2,
                 (image.rows - FLAGS_winH) / 2,
                 FLAGS_winW,
                 FLAGS_winH);
    detector->AddRegionsForTraining(image, vector<Rect>(1, win),
                                    vector<float>(1, label));
  }
}
void AddTrainingEntriesFromCenter ( IntegralHogDetector * detector , const vector < string > & imageFiles , float label ) { for ( vector < string > :: const_iterator imageFile = imageFiles . begin ( ) ; imageFile != imageFiles . end ( ) ; ++ imageFile ) { ROS_DEBUG_STREAM ( " " << * imageFile ) ; Mat image = imread ( * imageFile ) ; cv :: Rect win ( ( image . cols - FLAGS_winW ) / 2 , ( image . rows - FLAGS_winH ) / 2 , FLAGS_winW , FLAGS_winH ) ; detector -> AddRegionsForTraining ( image , vector < Rect > ( 1 , win ) , vector < float > ( 1 , label ) ) ; } }
Adds the center of the images to the detector for training
Adds the center of the images to the detector for training
// Start by opening the image // Find the winSize_ window in the center of the image