}
}
+// From http://www.juergenwiki.de/work/wiki/doku.php?id=public:hog_descriptor_computation_and_visualization
Mat get_hogdescriptor_visu(Mat& color_origImg, vector<float>& descriptorValues, const Size & size )
{
const int DIMX = size.width;
Mat visu;
resize(color_origImg, visu, Size(color_origImg.cols*zoomFac, color_origImg.rows*zoomFac));
- int blockSize = 16;
int cellSize = 8;
int gradientBinSize = 9;
float radRangeForOneBin = CV_PI/(float)gradientBinSize; // dividing 180° into 9 bins, how large (in rad) is one bin?
// prepare data structure: 9 orientation / gradient strenghts for each cell
int cells_in_x_dir = DIMX / cellSize;
int cells_in_y_dir = DIMY / cellSize;
- int totalnrofcells = cells_in_x_dir * cells_in_y_dir;
float*** gradientStrengths = new float**[cells_in_y_dir];
int** cellUpdateCounter = new int*[cells_in_y_dir];
for (int y=0; y<cells_in_y_dir; y++)
for (int cellNr=0; cellNr<4; cellNr++)
{
// compute corresponding cell nr
- int cellx = blockx;
- int celly = blocky;
+ cellx = blockx;
+ celly = blocky;
if (cellNr==1) celly++;
if (cellNr==2) cellx++;
if (cellNr==3)
load_images( argv[1], argv[2], pos_lst );
labels.assign( pos_lst.size(), +1 );
- const int old = labels.size();
+ const unsigned int old = labels.size();
load_images( argv[3], argv[4], full_neg_lst );
sample_neg( full_neg_lst, neg_lst, Size( 96,160 ) );
labels.insert( labels.end(), neg_lst.size(), -1 );