Announce

PukiWiki contents have been moved into SONOTS Plugin (20070703)

mergevec.cpp

First Edition. 02/26/2006
Last Modified. 06/03/2007

Merge vec files created by createsamples

Compatible VersionsVerified with opencv-1.0.0
Developersonots
First Edition02/26/2006
Last Modified06/03/2007
LicenseBSD
Table of Contents

Abstract

This utility merges vec files created by OpenCV haartraining/createsamples utility.

Tag: OpenCV haartraining

How to use

mergevec.exe
  <collection_file_of_vecs>
  <output_vec_filename>
  [-show] [-w <sample_width = 24>] [-h <sample_height = 24>]

Tips: You may execute a find command as

$ find <dir> -name '*.vec' > <collection_file_of_vecs>

to create a collection file.

Examples

$ find samples/ -name '*.vec' > samplescollection.dat
$ mergevec samplescollection.dat samplescollection.vec

Show images concurrently with merging, stop showing by Esc key like createsamples.exe.

$ mergevec samplescollection.dat samplescollection.vec -show -w 24 -h 24

Or you can show later using createsamples

$ createsamples -vec samplescollection.vec -show -w 24 -h 24

Download

Source Code

mergevec.cpp

Windows

Binary (XP, 32bits)

mergevec.exe

Visual Studio .Net Project File (Assume OpenCV is installed on C:\Program Files\OpenCV)

mergevec.vcproj

Linux

Binary

not available now

How to compile

I assume you have finished installing OpenCV and have ever compiled OpenCV codes.

Find haartraining/ directory in OpenCV source code directory tree. Copy mergevec.cpp to haartraining/ directory. If you are working on linux,

$ g++ `pkg-config --cflags opencv` `pkg-config --libs opencv` -o mergevec mergevec.cpp cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp

This is an usual way of compiling OpenCV codes + linking with cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp, and cvhaartraining.cpp.