Ask Your Question

samkhan13's profile - activity

2014-04-05 19:27:00 -0500 received badge  Necromancer (source)
2013-11-21 04:06:53 -0500 commented answer haar cascade parameters

@ioanna read section 5.3 and look at figure 11 in this paper: larger input pattern size for the cascade training are not advisable. to detect a complex pattern like a car for instance, you need to decide on the viewing angle. top and side views of a car will likely have rectangular bounding box. front and rear views could fit in a square region. haar wavelets are always square or rectangular. you have to construct a feature set with those wavelets to describe the complex pattern you are interested in. finding the smallest such feature set is computationally advantageous.

2013-11-21 02:46:41 -0500 commented answer haar cascade parameters

i trained a haar cascade face detector using real adaboost with -w 40 and -h 40. i had -numPos 6800 and -numNeg 3000. it took three days on a linux machine with 4x2.3 GHz processors and 7GB ram. during training 4.4 GB were occupied though I had set -precalcValBufSize 1024 and -precalcIdxBufSize 1024. also, during training, some stages would automatically take more than 6800 positives, like 6812 or so, from the vec file which had 7000 positive samples. ultimately the cascade file generated wasn't so good even when i used the CV_HAAR_SCALE_IMAGE flag during detection. i realized i needed to read the papers by viola-jones and lienhart again to better understand cascade training. it seems for any object the height and width defined between 15 and 24 are better.

2013-11-06 05:57:43 -0500 answered a question Mergevec.cpp : Error (compilation)
2013-11-04 11:30:01 -0500 commented question Python, OpenCV: unable to make custom LBP cascade using opencv_traincascade

started a bounty on SO: lets see if someone can help find a solution

2013-10-23 05:00:32 -0500 commented question Problems with Traincascade: A Practical Problem

@Median did you manage to solve the problem or get a meaningful error message via VisualStudio?

2013-10-22 23:26:55 -0500 commented question Python, OpenCV: unable to make custom LBP cascade using opencv_traincascade

it crashes right away. the training doesn't start.

2013-10-22 23:24:54 -0500 commented question VideoCapture not working even in opencv

my solution was to install opencv 2.4.4 via macports.

2013-10-22 03:06:52 -0500 asked a question Python, OpenCV: unable to make custom LBP cascade using opencv_traincascade

This is a copy of my question on stackoverflow...

I am using opencv 2.4.4 installed via macports with python 2.7.5 on a mac os x 10.7.5.

I want to train a cascade to look for male frontal faces. But I am getting the terminate called throwing an exceptionAbort trap: 6 error. I request your help in figuring out why this errors occurs. For instance is there something wrong in my .txt files or in the parameters given to opencv_traincascade?

The negative (background) image are taken from google: googleImages_noFaces (293 images)

The positive images are taken from Karolinska database: trainingSet (70 images)

I created a text file which indicates the relative location of background images: bgDesc.txt

I also created a text file indicating the relative location, number of positive instances in the image (which is always 1) and bounding region of the object (which is the entire image): maleDesc.txt

All these files can be downloaded from here

The organization of the files is in this form:





when I use opencv_createsamples a maleDesc.vec file is successfully created with the following line:

opencv_createsamples -vec maleDesc.vec -info maleDesc.txt -bg bgDesc.txt -num 70 -w 24 -h 24

if I use -show parameter I can see that 24x24 pixel images are created.

I then try

opencv_traincascade -data cascadeFiles -vec maleDesc.vec -bg bgDesc.txt -numPos 70 - numNeg 293 -numStages 1 -precalcValBufSize 500 -precalcIdxBufSize 500 -featureType LBP -w 24 -h 24

which gives me an error.

I have tried different values of -numPos such as 10, 20 and so on up to 70 along with different values of -numNeg as 30, 60 and so on up to 293. I have tried to use numPos values that are less than numNeg values and even those which are greater than. I have also tried different -numStages values like 1, 5, 10, 20 and 100 but in all of these attempts I get the same error.

I have not tried different values of -minHitRate, -maxFalseAlarmRate, -weightTrimRate, -maxDepth, -maxWeakCount because I don't really understand how they influence the behavior of opencv_traincascade algorithm.

Any help is much appreciated :)

2013-09-16 09:24:07 -0500 asked a question VideoCapture not working even in opencv

I installed opencv @ + python27 via macports on my mac os x 10.7.5 and the VideoCapture stopped working. Can any of you verify that the latest version of opencv with python27 on macports is working properly?

I've read all the discussions online about how opencv 2.4.6 had a bug in the video capture pipeline for linux machines and I've noticed how people have had to rebuild and reinstall python, numpy and opencv in the past week. Their problem seemed to have been resolved by rebuilding opencv with WITH_V4L=ON. But I am stuck because I have been using macports for various libraries and I dont want to go through the whole download>build>make>install routine for all my different libraries.

Please help.

2013-05-28 08:30:53 -0500 received badge  Supporter (source)