problems with train_hog example

asked 2019-03-07 08:03:15 -0500

zdszx gravatar image

updated 2019-03-07 13:02:00 -0500

hi I am new to opencv. when I try to execute the example here ,i don't know what is wrong with my input

int main(int argc, char** argv)
    const char* keys =
        "{dw    |   | width of the detector}" <------------how to decide this input?
        "{dh    |   | height of the detector}" <------------how to decide this input?
        "{f     |false| indicates if the program will generate and use mirrored samples or not}"
        "{d     |false| train twice}"
        "{t     |false| test a trained detector}"
        "{v     |true| visualize training steps}"
        "{fn    |my_detector.yml| file name of trained SVM}"

my output:

Positive images are being loaded......[done]
Negative images are being loaded......[done]
Histogram of Gradients are being calculated for positive images...OpenCV(4.0.0) Error: Assertion failed ((winSize.width - blockSize.width) % blockStride.width == 0 && (winSize.height - blockSize.height) % blockStride.height == 0) in cv::HOGDescriptor::getDescriptorSize, file C:\build\master_winpack-build-win64-vc14\opencv\modules\objdetect\src\hog.cpp, line 90
edit retag flag offensive close merge delete



see cv::HOGDescriptor::winSizewidth and height values should be multiple of 8 like 48, 64,128 ... what is the dimensions of your positive images. also see

sturkmen gravatar imagesturkmen ( 2019-03-07 13:13:17 -0500 )edit