【OpenCV】カスケード分類器を自作してみた!【MacOS】を参考に進めているのですが、opencv_traincascadeを実行すると以下のようなエラーがでます。
===== TRAINING 0-stage ===== <BEGIN libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.15) /tmp/opencvA3-20210927-72191-103awhg/opencv-3.4.15/apps/traincascade/imagestorage.cpp:158: error: (-5:Bad argument) in function 'get' > Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
-numPosの数字を変えてみても同様のエラーが出ます。
opencv_createsamples実行時のこれが原因でしょうか?
Create training samples from images collection... libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.15) /tmp/opencvA3-20210927-72191-103awhg/opencv-3.4.15/modules/core/src/matrix.cpp:751: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat' zsh: abort ./opencv_createsamples -info posgun/positive.txt -vec vec/positive.vec -num
解決方法を教えてください
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。