I modified train_HOG.cpp in OpenCV samples: - training image size can be indicated with "-W" and "-H" options. - hard negative training can be run with "-v" option. - input format of positive sample text is the same as one of opencv_traincascade.exe.