Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

haar createsamples error


I'm trying to create positive samples with the opencv_createsamples tool but i'm having some problems:

I want to detect this images image description

As I found, I can create positive samples using the createsamples tool with other background images.

_Folder structure:_

 Parent folder    (wehere I'm running the instruction)
 ───  haar
│   └─── neg
│       │   bg.txt   (with path of the bg images)
│   └─── train
│   └─── pos
│        └─── images
└─── images     (images to detect)
    │   image1.jpg

Instruction i'm running:

opencv_createsamples -img images/image1.jpg -bg haar/neg/bg.txt -info haar/pos/info.dat -bgthresh 0 -maxxangle 0.3 -maxyangle 0.3 -maxzangle 0.3 -num 50 -w 150 -h 15

The problems are:

1 - Sometimes i get an error during the execution:

OpenCV Error: Incorrect size of input array () in cvGetSubRect, file /home/jorge/dev/fingerP/opencv-3.2.0/modules/core/src/array.cpp, line 1275
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/jorge/dev/fingerP/opencv-3.2.0/modules/core/src/array.cpp:1275: error: (-201)  in function cvGetSubRect

2 - in other ocasions the execution finishes but neither images nor data into the _info.dat_ file has been created

3- When images are created (in the case 1 of these problems) the image looks like this:

image description

with the positive image on it but cropped.

Can anyone help me?