Program used to merge .vec files for use in openCV's opencv_traincascade
Switch branches/tags
Nothing to show
Clone or download
wulfebw Merge pull request #1 from thacoon/python3
updated to use with python3
Latest commit 06a3114 Aug 6, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Jun 13, 2014
LICENSE Update LICENSE Jun 13, 2014 Update May 21, 2015 update to use with python3 Jul 11, 2016


Update (20/05/15): This approach worked for my purposes, but a few people have raised concerns that using artificial data is not the best way to train a classifier [1]. As such, I would recommend approaching this method with a fair amount of skepticism. is used to merge .vec files for use in training a cascade classifier with openCV's opencv_traincascade. This code was made as replacement for mergevec.cpp (created by Naotoshi Seo. See: in order to avoid recompiling opencv with mergevec.cpp.

#To use

(1) Place all .vec files to be merged in a single directory ("vec_directory").
(2) Download
(3) Navigate to in your CLI (terminal or cmd) and enter "python -v your_vec_directory -o your_output_filename.vec".

#To test the output of

(1) Install openCV.
(2) Navigate to the output file in your CLI (terminal or cmd).
(3) Type "opencv_createsamples -w img_width -h img_height -vec your_output_filename.vec". This should show the .vec files in sequence.

The aggregate .vec output from has successfully been used to train a cascade. See the below for resources on training cascade classifiers. #opencv_traincascade Resources

[1] Counterargument:

[2] OpenCV:

[3] Naotoshi Seo:

[4] Coding Robin:

[5] StackOverflow: