opencv_train级联崩溃,没有解释 [英] opencv_traincascade crash without explanation
问题描述
我尝试使用opencv_traincascade.exe,但它发生崩溃几秒钟后,我启动它。这是我如何进行:
I try to use opencv_traincascade.exe but it crashes few seconds after I launch it. Here is how I proceeded:
我首先使用以下方法创建了正样本:
I first create the positive sample using:
opencv_createsamples -info info.txt -vec vecFile.vec -bg neg.txt -num 100 -w 100 -h 100
-
info.txt有116行,全部类似:
info.txt has 116 lines which are all like:
imagepath 1 0 0 100 100
imagepath 1 0 0 100 100
只是文件更改的名称在不同的行,但所有的图像大小为100 * 100(我正在干细胞的高分辨率图片上工作,因此在25 * 25的图片,我想我不会有足够的信息来检测我正在寻找什么)
just the name of the file change in the different lines but all the images are of size 100*100 (I am working on high resolution picture on stem cells, therefore in a 25*25 image, I think I would not have enough information to detect what I am looking for)
neg.txt包含715行只有文件路径
neg.txt contains 715 lines with just file paths
已成功建立100个取样
which successfully created 100 samples
训练:
opencv_traincascade -data Cascade -vec vecFile.vec -bg neg.txt -numPos 10 -numNeg 20 -numStages 2 -featureType HAAR -w 100 -h 100
然后我收到以下错误信息:
And then I got the following error message:
opencv_traincascade.exe has stopped working
没有别的。
有什么想法吗?
/ p>
Thanks
推荐答案
这是因为您选择的窗口大小。内存traincascade.exe用于训练分类器与窗口大小成指数增长,并且有少数家庭计算机将处理100x100窗口大小在traincascade ..
This is happening because of the window size you chose. The memory traincascade.exe uses for training a classifier grows exponentially with window size, and there are few home computers that would handle a 100x100 window size in traincascade..
做这个练习:打开你的任务管理器,并监控内存使用增长,当你开始训练,你会注意到,当它不能分配更多的内存程序崩溃。
要解决这个问题,你必须选择一个更小的窗口大小。Do this exercise: open your task manager and monitorize the memory usage growing when you start training, you'll notice that the program crashes when it can't allocate more memory. To fix this you'll really have to choose a smaller window size.
这篇关于opencv_train级联崩溃,没有解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!