Mat img_raw = imread("C:\\testimg.png", 1); // load as color image resize(img_raw, img_raw, Size(64,128) ); Mat img; cvtColor(img_raw, img, CV_RGB2GRAY); HOGDescriptor d; // Size(128,64), //winSize // Size(16,16), //blocksize // Size(8,8), //blockStride, // Size(8,8), //cellSize, // 9, //nbins, // 0, //derivAper, // -1, //winSigma, // 0, //histogramNormType, // 0.2, //L2HysThresh, // 0 //gammal co