vec2img.cpp
Last Modified. 06/03/2007
Extract image files from a vec file created by createsamples
| Compatible Versions | Verified with opencv-1.0.0 |
|---|---|
| Developer | sonots |
| First Edition | 02/26/2006 |
| Last Modified | 06/03/2007 |
| License | BSD |
| Table of Contents |
Abstract
This utility extracts image files from a vec file created by OpenCV haartraining/createsamples utility.
Tag: OpenCV haartraining
How to use
Usage: vec2img.exe <input_vec_filename> <output_filename_format> [-w <sample_width = 24>] [-h <sample_height = 24>] The output filename format is a string having one %d such as '%04d.png'. The image file format is automatically determined by the extension.
Examples
$ mkdir image $ vec2img test.vec image/test_%04d.png -w 20 -h 20
Download
Source Code
Windows
Binary (XP, 32bits)
Visual Studio .Net Project File (Assume OpenCV is installed on C:\Program Files\OpenCV)
Linux
Binary
not available now
How to compile
I assume you have finished to set an environment up to compile original OpenCV codes.
Find haartraining/ directory in OpenCV source code directory tree. Copy vec2img.cpp to haartraining/ directory. If you are working on linux,
$ g++ `pkg-config --cflags opencv` `pkg-config --libs opencv` -o ve2img vec2img.cpp cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp
This is an usual way of compiling OpenCV codes, except that it requires cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp cvhaartraining.cpp together.

