Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameters of opencv_traincascade

I've been using the old implementation of OpenCV's haartraining for quite some time. Now, after finally moving to OpenCV 2.3, I'm wondering how to set parameters like I did with the old implementation. As far as I know, there is no documentation for opencv_traincascade yet.

I'm missing the "-nonsym" switch and the "-nsplits". Now, there is only a "maxDepth" parameter which has as description "max_depth_of_weak_tree". Is a weak three a stump? Are all haar features now assumed to be nonsym?

Thanks a lot!

like image 726
Durin Avatar asked Aug 11 '11 08:08

Durin


2 Answers

@Alex: Here's a good description about all parameters given by opencv 2.3.2 documentation, I'm working on a python script working with opencv for lying human detection and tracking. If you plan to use the python functions beginning with the new wrapper cv2.() don't forget to set the right PATH or its pain in the ass...

http://opencv.itseez.com/trunk/doc/user_guide/ug_traincascade.html

like image 170
Reinecke Fox Avatar answered Sep 22 '22 14:09

Reinecke Fox


I dont know if this will help as I have not tried and it seems to be very similar to the older haarcascade.exe

opencv_traincascade.exe

Usage:

opencv_traincascade.exe
-data <cascade_dir_name>
-vec <vec_file_name>
-bg <background_file_name>
[-numPos <number_of_positive_samples = 2000>]
[-numNeg <number_of_negative_samples = 1000>]
[-numStages <number_of_stages = 20>]
[-precalcValBufSize <precalculated_vals_buffer_size_in_Mb = 256>]
[-precalcIdxBufSize <precalculated_idxs_buffer_size_in_Mb = 256>]
[-baseFormatSave]
—cascadeParams—
[-stageType <BOOST(default)>]
[-featureType <{HAAR(default), LBP}>]
[-w <sampleWidth = 24>]
[-h <sampleHeight = 24>]
—boostParams—
[-bt <{DAB, RAB, LB, GAB(default)}>]
[-minHitRate <min_hit_rate> = 0.995>]
[-maxFalseAlarmRate <max_false_alarm_rate = 0.5>]
[-weightTrimRate <weight_trim_rate = 0.95>]
[-maxDepth <max_depth_of_weak_tree = 1>]
[-maxWeakCount <max_weak_tree_count = 100>]
—haarFeatureParams—
[-mode <BASIC(default) | CORE | ALL
—lbpFeatureParams—
like image 27
Alex Avatar answered Sep 22 '22 14:09

Alex