Announce

PukiWiki contents have been moved into SONOTS Plugin (20070703)

vec2img.cpp

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

Extract image files from a vec file 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 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

vec2img.cpp

Windows

Binary (XP, 32bits)

vec2img.exe

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

vec2img.vcproj

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.