OPENCV_HAARTRAINING(1)
β¨ NAME β¨
okay so this is opencv_haartraining β it trains a classifier. that's it, that's the vibe. it's the OPENCV_HAARTRAINING(1) girlie from the User Commands section and she is booked and busy π
πΈ SYNOPSIS πΈ
opencv_haartraining [options]
π¦ DESCRIPTION π¦
bestie, opencv_haartraining is literally training the classifier. and here's the cute part: while it's running you can already peek and get an impression of whether your classifier is gonna be suitable, or if you need to go back and improve the training set and/or the parameters. it's giving "live progress, no waiting for the finale" π
in the output, here's what you're reading:
'POS:'β shows the hitrate in the set of training samples. this should be equal or near to1.0, same energy as in stage0. π'NEG:'β indicates the false alarm rate. it should reach at least5*10-6to be a usable classifier for real world applications. like, that's the bar, no cap.
β οΈ if one of the above values gets 0 (zero) there is an overflow. in this case the false alarm rate is so low that further training doesn't make sense anymore, so it can be stopped. not me telling you to just let it go π
π OPTIONS π
opencv_haartraining supports the following options:
-data dir_nameβ the directory in which the trained classifier is stored. this is where your baby lives πΌ-vec vec_file_nameβ the file name of the positive samples file (e.g. created by theopencv_createsamples(1)utility).-bg background_file_nameβ the background description file (the negative sample set). it contains a list of images into which randomly distorted versions of the object are pasted for positive sample generation. chaotic, but make it fashion.-bg-vecfileβ this option is thatbgfilenamerepresents a vec file with discrete negatives. the default is not set.-npos number_of_positive_samplesβ the number of positive samples used in training of each classifier stage. the default is2000.-nneg number_of_negative_samplesβ the number of negative samples used in training of each classifier stage. the default is2000.
reasonable values are -npos 7000 -nneg 3000. π
-nstages number_of_stageβ the number of stages to be trained. the default is14.-nsplits number_of_splitsβ determine the weak classifier used in stage classifiers. if the value is:1, then a simple stump classifier is used>=2, then CART classifier withnumber_of_splitsinternal (split) nodes is used
the default is 1.
-mem memory_in_MBβ available memory in MB for precalculation. the more memory you have the faster the training process is. the default is200.-sym,-nonsymβ specify whether the object class under training has vertical symmetry or not. vertical symmetry speeds up training process and reduces memory usage. for instance, frontal faces show off vertical symmetry. the default is-sym. β¨ symmetrical queen β¨-minhitrate min_hit_rateβ the minimal desired hit rate for each stage classifier. overall hit rate may be estimated asmin_hit_rate^number_of_stages. the default is0.950000.-maxfalsealarm max_false_alarm_rateβ the maximal desired false alarm rate for each stage classifier. overall false alarm rate may be estimated asmax_false_alarm_rate^number_of_stages. the default is0.500000.-weighttrimming weight_trimmingβ specifies whether and how much weight trimming should be used. the default is0.950000. a decent choice is0.900000.-eqwβ specify if initial weights of all samples will be equal. equality, we love her π«Ά-mode {BASIC|CORE|ALL}β select the type of haar features set used in training.BASICuses only upright features, whileCOREuses the full upright feature set andALLuses the full set of upright and 45 degree rotated feature set. the default isBASIC.
for more information on this see http://www.lienhart.de/ICIP2002.pdf. π
-h sample_heightβ the sample height (must have the same value as used during creation). the default is24.-w sample_widthβ the sample width (must have the same value as used during creation). the default is24.-bt {DAB|RAB|LB|GAB}β the type of the applied boosting algorithm. you can choose between Discrete AdaBoost (DAB), Real AdaBoost (RAB), LogitBoost (LB) and Gentle AdaBoost (GAB). the default isGAB. pick your fighter π-err {misclass|gini|entropy}β the type of used error if Discrete AdaBoost (-bt DAB) algorithm is applied. the default ismisclass.-maxtreesplits max_number_of_splits_in_tree_cascadeβ the maximal number of splits in a tree cascade. the default is0.-minpos min_number_of_positive_samples_per_clusterβ the minimal number of positive samples per cluster. the default is500.
the same information is shown, if opencv_haartraining is called without any arguments/options. so like, if you're confused, just run it naked and it'll spill the tea π
π EXAMPLES π
TODO
not the manpage leaving the examples as a TODO π bestie we're all waiting
π SEE ALSO π
more information and examples can be found in the OpenCV documentation.
π AUTHORS π
this manual page was written by Daniel Leidert <daniel.leidert@wgdd.de> and Nobuhiro Iwamatsu <iwamatsu@debian.org> for the Debian project (but may be used by others). icons, fr fr π«Ά
okay that's the whole page, mwah π it's from OpenCV, dated May 2010, and the original header/footer said OPENCV_HAARTRAINING(1) top and bottom β so there you go bestie, go train that classifier and slay β¨ππ¦
π¦ where this page comes from
- ubuntu jammy: libopencv-dev 4.5.4+dfsg-9ubuntu4 Β· Apache-2.0 AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms