Ask Your Question

Bad argument in function cvReleaseData, how to fix the error?

asked 2018-03-05 21:50:00 -0500

Joshitha gravatar image

I tried creating samples for my 100 positive images but run into this error:


At first I assumed that I had not extracted the same number of samples as I was specifying in the command using Objectmarker.exe but even on rectifying that,I still ran into this error.

Currently I am using 100 positive images , but I got the error when I used 70 images as well.

What exactly is the Bad Argument here and how do I fix it?


PS E:\FYP\dasar_haartrain> .\createsamples.exe -info positive/info.txt -vec vector/vector.vec -num 100000 -w 55 -h 35

Info file name: positive/info.txt

Img file name: (NULL)

Vec file name: vector/vector.vec

BG file name: (NULL)

Num: 100000

BG color: 0

BG threshold: 80

Invert: FALSE

Max intensity deviation: 40

Max x angle: 1.1

Max y angle: 1.1

Max z angle: 0.5

Show samples: FALSE

Width: 55

Height: 35

Create training samples from images collection...

edit retag flag offensive close merge delete


@berak any views?

Joshitha gravatar imageJoshitha ( 2018-03-08 09:47:26 -0500 )edit

not really. why does it say: "OpenCV GUI" in the msgbox ? that looks non-standard already

berak gravatar imageberak ( 2018-03-08 10:32:13 -0500 )edit

EXACTLY! and the said path does not even exit

Joshitha gravatar imageJoshitha ( 2018-03-08 10:44:04 -0500 )edit

"said path does not even exist" -- no, that's the path to the cvxarray.xpp, where the program was built

berak gravatar imageberak ( 2018-03-08 10:46:50 -0500 )edit

@berak, I have found a solution. please look into the answer as the moderator

Joshitha gravatar imageJoshitha ( 2018-03-16 01:58:33 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-16 01:57:39 -0500

Joshitha gravatar image

I think I have finally resolved this issue.

My positive images were named as ' pr(1).bmp, pr(2).bmp, pr(3).bmp' and so on, hence my positive/info.txt file contained these names.

The brackets used in the file names have posed this 'Bad Arguments..' problem .

I changed the file names and I was successfully able to proceed.

This was probable a minor issue which not many must have faced, but I hope this solution helps them when in need :)

edit flag offensive delete link more


whoa, thanks for coming back with a solution !

berak gravatar imageberak ( 2018-03-16 01:59:31 -0500 )edit

Question Tools

1 follower


Asked: 2018-03-05 21:50:00 -0500

Seen: 990 times

Last updated: Mar 16 '18