Ask Your Question

JoeyChu's profile - activity

2020-05-03 16:53:55 -0600 received badge  Famous Question (source)
2015-03-10 11:09:51 -0600 received badge  Notable Question (source)
2014-03-23 17:43:47 -0600 received badge  Nice Question (source)
2014-01-13 03:48:19 -0600 received badge  Popular Question (source)
2013-04-18 03:29:48 -0600 commented answer trouble when use opencv_traincascade.exe

@StevenPuttemans

because the training process is so long, so If just use different parameters to try again, I do not think it is ok for me, what is the root cause?

right now, just familiar with HAAR classfier, not involve the other classifiers,

2013-04-16 21:22:53 -0600 commented answer trouble when use opencv_traincascade.exe

@StevenPuttemans

sigh...

ONE month, still stucking at stage 6, My boss told me yesterday, If the demo workaround still NOK, he maybe cancel the project...sigh..sigh..

2013-04-02 04:17:08 -0600 commented answer trouble when use opencv_traincascade.exe

@StevenPuttemans

some weeks :(

here is an question about eye detection, could you give me some advice?

when I use the original eye detect cascade xml to detect eye area, when I get these, How can I judge the eyes state, open or close?

here is an idear but I think it is not good enough, binaryzation the eyes, then calculate the the toppest and lowest black dots? then compare with the one default vlaue? sound Ok, but these are more limitations about this, like glasses, the eye original status..etc..

2013-04-01 21:51:22 -0600 commented answer trouble when use opencv_traincascade.exe

@StevenPuttemans

It is 2 weeks now, still at stage 6, which the whole stage is 24 :(

OK, I will still keep this running and waiting for your solution :)

2013-03-26 03:54:05 -0600 commented answer trouble when use opencv_traincascade.exe

@ steven

@herezt

the 2 PCs that I took in parallel both stuck at stage 6, the process both take almost one week now

what is the next action?

2013-03-24 09:46:51 -0600 answered a question trouble when use opencv_traincascade.exe

@ Steven,

any update about my trouble? I am still waiting here, aha...:)

2013-03-20 09:43:54 -0600 commented answer trouble when use opencv_traincascade.exe

@steven,

:) I open this website everyday and refresh it every 1 hour...I am waiting here, really appreciate for the nice help for you

2013-03-20 09:22:06 -0600 commented answer trouble when use opencv_traincascade.exe

@herezt

I took your advice to add this "printf" statement, all process is ongoing now at stage 6, because that I add the printf to output the rows/cols of the image too, so all the print info is showing on the screen fast now, I think that training progress is ongoing OK

2013-03-20 09:17:57 -0600 commented answer trouble when use opencv_traincascade.exe

@steven

:) I am not sure it was a good news or not that you ran into this problem, I am waiting for your workaround, thanks

2013-03-20 00:35:27 -0600 commented answer trouble when use opencv_traincascade.exe

@ Steven

1, yes, just image names in the bg.txt, without size, like

f002549.bmp

f002831.bmp

f003621.bmp

f004901.bmp

f006151.bmp

f006201.bmp

....

2, Then increace the precalcValBufSize value and cldxBufSize value both to 1024, Still, I add 2 printf funtion to print "src.rows, src.cols winSize.height and winSize.width" in NegReader::nextImg() to check the training process whether ongoing at stage 6,

then re-compile, now at stage 6, all the printf information output here, it does continue keep calculating.

2013-03-19 09:46:29 -0600 commented answer trouble when use opencv_traincascade.exe

2, cascade train with opencv_traincascade.exe,

"traincascade" direction was created by manual,

pos.vec is the file that created by create_samples application above,

the "bg.txt" file is about negative images that account is 4381, and still, all the size is 20*20

-numPos value was calculted as 1188 by the "famous" formula which discussed before,

training featrue type is LBP.

opencv_traincascade.exe -data D:\traincascade -vec D:\data\pos.vec -bg D:\bg.txt -numPos 1188 numNeg 4381 -numStages 22 -precalcValBufSize 200 -precalcIdxBufSize 1000 -featureType LBP -w 20 -h 20

is this correct?

2013-03-19 09:39:30 -0600 commented answer trouble when use opencv_traincascade.exe

@ Steven

I have 2 PCs, In order to compare, I intend to work on cascade training application in parallel, one is no code changed, the other is from herezt,

So, again, I output the all the cmd and parameters here, Please piont it out when any find any errors,

1, create_samples

all 5706 positive images with size 20* 20 pixels were collected, so

opencv_createsamples.exe -vec E:data\pos.vec -info E:\info.dat -num 5706 -w 20 -h 20

the pos.vec was created by manual, the info.dat file is fill with all 5706 file name and parameter like below

10010.bmp 1 0 0 20 20

10011.bmp 1 0 0 20 20

10012.bmp 1 0 0 20 20

10013.bmp 1 0 0 20 20

10014.bmp 1 0 0 20 20

all above is correct?

2013-03-19 05:18:37 -0600 received badge  Student (source)
2013-03-19 05:17:01 -0600 commented answer trouble when use opencv_traincascade.exe

@ herezt

All above is ready, now the training process still came to stage 6, I will keep it at least 3 days then,

2013-03-19 04:39:12 -0600 commented answer trouble when use opencv_traincascade.exe

@ herezt

thanks for your advice, I will add this code and re-compile it, then redo this with all parameter not changed, BTW, my opencv version is 2.4.0

keep u informed no matter any results

2013-03-19 04:21:17 -0600 commented answer trouble when use opencv_traincascade.exe

@steven Puttemans as discussed last week, at cascade training stage 6, this process lasts almost 6 days, and still keep that way, seems stuck Then unfortunetly, my PC system Win 7 with many applications running stuck really at that way, so, I have to reboot it and re-run cascade app, 5 stages fast be loaded, then still at stage 6

I have no idear about that any results I can get with this way

2013-03-12 09:56:50 -0600 received badge  Scholar (source)
2013-03-12 09:49:48 -0600 commented answer trouble when use opencv_traincascade.exe

Aha, OK very helpful and nice answers, I will mark them as correct answers,

BTW, If later I still need sth to ask you, How can I contact you? an MSN or Skype account will be very nice

2013-03-12 09:42:30 -0600 commented answer trouble when use opencv_traincascade.exe

OK,

For me, now the current status is that I collected 5706 positive images and 4381 Negative images that both size are 20* 20 pixels and all are normalization

Q1: Is the vec-file is correct when I use below cmd? opencv_createsamples.exe -vec E:\data\pos2.vec -info E:\faces\info.dat -num 5706 -w 20 -h 20

Q2: If the vec-file is correct, In order to avoid the assert failure about "OpenCV Error: Assertion failed (elements_read == 1) in unknown function" I follow the formula to calculate the numPos as 1188 to train, is this correct? 5706 >= x + (24-1)(1-0.995)x + 4381

x <=1188

If all above operations are correct, now that I only have to do is to be patient about the training process, right?

2013-03-12 09:28:14 -0600 commented answer trouble when use opencv_traincascade.exe

3, I cannot get you what Negative images that you define above, I am not sure that I get it right, please figure me out, If I collect 4381 negative images which all are 20 pixel height and 20 pixel width, What it the negateive image parameter should I use? 4381 or any larger value than 4381?

Still, when I collect the negative images, not focus on the size, right? no need to re-size them all as 20*20 pixel which In order to reduce the calculation?

If, as you metioned, when I collect 200 negatives of 500*500 pixels, then how, what numNeg value should I use ? any randomly value that larger than 200 is OK?

2013-03-12 09:19:23 -0600 commented answer trouble when use opencv_traincascade.exe

@ Steven

Really appreciate for your answer,

1, Sorry, seems that I cannot re-organized the comments structure right now, "Interanl server Error" occurs, Later, i will try it again

2, Here still sth confused about the vec-file that created by below create sampels application that i used actually, the Number of all the positive images is 5706, the positive detections are face and eyes, all the positive images contain face and eyes of one person, If I want to detect face and eyes both, how can I use the application to create samples? Is it correct that I only want to detect face?

opencv_createsamples.exe -vec E:\data\pos2.vec -info E:\faces\info.dat -num 5706 -w 20 -h 20

2013-03-12 02:52:32 -0600 commented answer trouble when use opencv_traincascade.exe

BTW, my opencv version is 2.4.0

at Stage 5, the cal result is

===== TRAINING 5-stage ===== <BEGIN POS count : consumed 1188 : 1193 NEG count : acceptanceRatio 4381 : 0.00230658 Precalculation time: 2.158 +----+---------+---------+ | N | HR | FA | +----+---------+---------+ | 1| 1| 1| +----+---------+---------+ | 2| 1| 0| +----+---------+---------+ END>

2013-03-12 02:46:30 -0600 commented answer trouble when use opencv_traincascade.exe

Hi Steven according this link http://code.opencv.org/issues/1834 this bug seems have the same issue with me so, I took the advice from Maria Dimashova mentioned which is still about the formula,

now, i do below steps 1, i use numPos 5706 to create samples, 2, In order to cal the numPos value, then i took it as unknown vec-file has to contain >= (numPos) + (numStages-1)(1-minHitRate)numPos- + S here, S is bg size, 4381

5706 >= x + (24-1)(1-0.995)x + 4381

x <=1188

then, re-train above opencv_traincascade.exe -data D:\traincascade -vec D:\data\pos.vec -bg D:\bg.txt -numPos 1188 numNeg 4381 -numStages 22 -precalcValBufSize 200 -precalcIdxBufSize 1000 -featureType LBP -w 20 -h 20

still, seems stuck at stage 6 here

===== TRAINING 6-stage ===== <BEGIN POS count : consumed 1188 : 119

2013-03-11 21:15:18 -0600 commented answer trouble when use opencv_traincascade.exe

Hi Steven,

oops, what I not change the numPos param which is 5706, just enlarge the numNeg param as 8000, 10000, or 20000, without really get that number Negative image samples, then redo all the above

still below assert failure came out

OpenCV Error: Assertion failed (elements_read == 1) in unknown function, file .. ....\apps\traincascade\imagestorage.cpp, line 154

before, when I get the error, i only changed the numPos param, what about this now?

2013-03-11 21:08:43 -0600 commented question trouble when use opencv_traincascade.exe

@ berak,

acturally, that i restart it for many times, still not work out yet, so i post this question here, thank u

2013-03-11 21:05:09 -0600 commented answer trouble when use opencv_traincascade.exe

Hi Steven,

thanks a lot about your answer above, but still sth confused here 1, about this formula vec-file has to contain >= (numPos) + (numStages-1)(1-minHitRate)numPos- + S what is the vec-file? the size that vec-file contains? here, 4MB? or what? numPos amount? 5706? btw, you said you are confused about this too. aha, if you know it, please tell me

2, about the solution, here, i still use the the numPos as 5706 that in my vec file, right? no chaned, but, what about negative image amout, here, the negetive image samples that I have is only 4831, u mean although that, i can still change the amount as large, right? no need to get more negative images, just change the numNeg as large when I run the cascade train cmd?

2013-03-11 08:53:37 -0600 commented question trouble when use opencv_traincascade.exe

berak,

I cannot understand u absolutely, u mean when i want to train 22 stages, if the cmd stuck at stage 8, then i need to stop the train procedure, and restart with what ? just stage 8?

i have no idea about that, with that, i can get the XML that i really want?

2013-03-11 08:15:58 -0600 commented question trouble when use opencv_traincascade.exe

@ berak

nope, no blank missing actually in the cmd that I run if it is, i think errors will occur

2013-03-11 02:11:49 -0600 asked a question trouble when use opencv_traincascade.exe

hi all

I am tring to train my owen XM with following key steps

1, create vec data with createsamples.exe with some main para posNum 5709, negNum 4381, -w 20, -h 20

this runs OK, then the vec data be created, which size is about 4M

2, when i use below cmd firstly, opencv_traincascade.exe -data D:\traincascade -vec D:\data\pos.vec -bg D:\bg.txt -numPos 5709-numNeg 4381 -numStages 22 -precalcValBufSize 200 -precalcIdxBufSize 1000 -featureType LBP -w 20 -h 20, this runs NOK, with assert pops out, opencv_traincascade.exe OpenCV Error: Assertion failed (elements_read == 1)

so then i changed para numPos to 5000, numNeg to 4350 then redo this, all works ok, but seems stuck all the time at Stage 8, this keeps 2 days so far

so, my question is what the relationship with numPos, numNeg and numStages ?

how can i train this XML with above para?