diff --git a/modules/objdetect/src/hog.cpp b/modules/objdetect/src/hog.cpp index cce5d27ac3..b7030fdd17 100644 --- a/modules/objdetect/src/hog.cpp +++ b/modules/objdetect/src/hog.cpp @@ -138,6 +138,8 @@ void HOGDescriptor::setSVMDetector(InputArray _svmDetector) bool HOGDescriptor::read(FileNode& obj) { + CV_Assert(!obj["winSize"].empty()); + if( !obj.isMap() ) return false; FileNodeIterator it = obj["winSize"].begin();