2016-06-19 52 views
0

opencvのtraincascade.exeを使用しようとすると、私は1つのprolemを持っています。私は20の陽性サンプルと100の陰性サンプルを持っています。おそらく、サンプル数は少ないですが、私はopencvのtraincascade.exeの使い方をテストしたいだけです。TrainCascade.exeを実行するとエラーが発生する

opencv_createsamples.exeを使用して、コマンドでベクターファイルを作成します。

D:\Project_Android\Classifier\bin\opencv_createsamples.exe -info positive.txt -vec vector.vec -num 442 -w 24 -h 24 PAUSE 

は、それが行われ、私はあまりにも絶対的な方向でnegative.txtている、vector.vecを持っています。

しかし、私は、コマンド

D:\Project_Android\Classifier\bin\opencv_traincascade.exe -data HaarTraining -vec vector.vec -bg negative.txt -npos 10 -nneg 10 -numStages 3 -nsplits 2 -nonsym -minhitrate 0.95 -maxfalsealarm 0.4 -mem 1024 -mode ALL -w 24 -h 24 PAUSE 

でtraincascade.exeを使用する場合、今、それは、下図のようなエラーを言います。

enter image description here

だから私は、今では数分を実行するコマンドで

D:\Project_Android\Classifier\bin\opencv_haartraining.exe -data HaarTraining -vec vector.vec -bg negative.txt -npos 10 -nneg 10 -numStages 3 -nsplits 2 -nonsym -minhitrate 0.95 -maxfalsealarm 0.4 -mem 1024 -mode ALL -w 24 -h 24 PAUSE 

をopencv_haartraining.exeするopencv_traincascade.exeを交換決めます。

HaarTrainingフォルダ内に8つのフォルダ(0,1,2、...)が表示されていますが、xmlファイルを見つけようとしましたが表示されません。xmlファイルは生成されません。 enter image description here

私はそれに何の問題があるのか​​教えてください。なぜopencv_traincascade.exeでエラーが発生し、opencv_haartraining.exeでエラーが発生するのか分かりませんが、xmlファイルは生成されません。私はpositive.txtとnegative.txtが正しい絶対方向のイメージを持っていると確信しています。

だからあなたの助けのための多くの感謝

答えて

1

まず、opencv_haartraining.exeを使用しないでください。現在は推奨されていません。あなたの質問に答えるために

、あなたのパラメータは次のようする必要があります:あなたの-mem 1024-nsplits 2、および-nonsymフラグのよう

opencv_traincascade.exe -data HaarTraining -vec vector.vec -bg negative.txt -numPos 10 -numNeg 10 -numStages 3 -minHitRate 0.95 -maxFalseAlarmRate 0.4 -mode ALL -w 24 -h 24 

、彼らはopencv_traincascade.exeで使用される実際のパラメータではありません。あなたの-memフラグに最も近いものは、おそらく-precalcValBufSize-precalcIdxBufSizeのいずれかです。

引数の包括的なリストについては、the official documentationをご覧ください。

関連する問題