Ask Your Question
0

-w -h in create_samples

asked 2018-02-27 07:03:27 -0600

saideepthik gravatar image

updated 2018-02-28 11:02:41 -0600

berak gravatar image

in opencv while creating samples the +ve image will create samples using -ve background images. so, my question is we are metioning -w and -h, how it will impact on generated vector file?

i tried to see the created samples using cmd: opencv_createsamples -w 50 -h 50 -vec filename.jpg.vec so got a image window with resolution of 200200 for -w 50 and -h 50. and +ve and -ve images are of same resolution (300300). if anyone knows in depth concept of this please help us to get into it. thanks in advance,

  • an aspirant on opencv
edit retag flag offensive close merge delete

Comments

What do you mean with the +ve and -ve images? createsamples is used to create a vector file (format handled during training) or your annotated data. Have a look at how to use it here.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-02-27 08:24:13 -0600 )edit

Hi Steven, -w <sample_width> : Width (in pixels) of the output samples. -h <sample_height> : Height (in pixels) of the output samples. i saw this output samples using cmd: opencv_createsamples -w 50 -h 50 -vec filename.jpg.vec

i'm working on this algorithm since 4months. now, i have an idea how algorithm will train some object. so, i'm looking into algorithm how it works internally. i'm getting into each step of training how the parameters (arguments) will impose on that output. i saw in some question you commented that you wrote on book on opencv concept, did you publish? if published please lets know the details of that.

saideepthik gravatar imagesaideepthik ( 2018-02-27 23:16:05 -0600 )edit

Yes the book is published at Packt under the name of OpenCV 3 Blueprints, and chapter 5 has all the information you need. But again, there are parts in your question that do not make sense. What is the +ve and -ve???

StevenPuttemans gravatar imageStevenPuttemans ( 2018-02-28 02:53:04 -0600 )edit

OK Steven thanks for replying, +ve images= positive images that are going to give for training -ve images = negative images which are background images for training

saideepthik gravatar imagesaideepthik ( 2018-02-28 03:11:48 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2018-02-28 11:00:03 -0600

Joshitha gravatar image

I think -w and -h signify the size of the window the Haar algorithm will use to sample the images, from the set of positives and negatives you have provided.

Default values of the opencv_createsamples.exe utility distributed with the OpenCV library

image description

Source

This info is provided in the documenatation as well.

edit flag offensive delete link more

Comments

yes, i agreed according to the document. but , created samples having different -w and -h which i got. so, now i'm searching for that as Steven published a book i'll go through into that and some other publications also, will see... what's the actual mechanism.

saideepthik gravatar imagesaideepthik ( 2018-03-02 01:00:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-27 07:03:27 -0600

Seen: 420 times

Last updated: Feb 28 '18