Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problems with train_hog example

hi l m new to opencv .when l try to execute the example here ,i don t konw what is wrong with my input

https://docs.opencv.org/4.0.0/d0/df8/samples_2cpp_2train_HOG_8cpp-example.html

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}" };

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

problems with train_hog example

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

https://docs.opencv.org/4.0.0/d0/df8/samples_2cpp_2train_HOG_8cpp-example.html

int main(int argc, char* char** argv)
    const char 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

90