Ask Your Question

Loam's profile - activity

2017-12-31 21:16:49 -0600 received badge  Student (source)
2014-06-05 18:40:13 -0600 asked a question Opencv. LBP cascade. How to exclude redected results at the same place

I have trained LBP classifier for searching cars top view. And i do not know how to exlude redetection at the same places during searching.

I saved a resulting picture, as you see one car is found twice: image description

I use this function:

cascade.detectMultiScale( smallImg, cars,
    1.1, 3, 0
    //|CV_HAAR_FIND_BIGGEST_OBJECT
    //|CV_HAAR_DO_ROUGH_SEARCH
    |CV_HAAR_SCALE_IMAGE
    ,
    Size(30, 30),
    Size(700,700)
    );
2014-04-22 15:51:44 -0600 commented answer Some questions about training LBP classifier.

@StevenPuttemans Thank you very much, i'l try what u said and will response later

2014-04-22 06:16:23 -0600 commented answer Some questions about training LBP classifier.
  1. You mean to rotate images in programm which uses classifier?
  2. I have to create 2 classifiers for an up facing car and a down facing car or what?
  3. And last. I still can't understand: i have to cut cars neatly rotating them to one direction or just use opencv_objdetect for example, which means i will have a file containing all images and ROI (in ROI will be a car with it's own orientation and pieces of ground).
2014-04-22 05:30:36 -0600 asked a question Some questions about training LBP classifier.

Hi!

I'm working on creating LBP or HAAR classifier for detecting cars top view. I have created LBP classifier and when i checked it's work, it finds only vertically oriented cars and even not all of them: result1 result2

1) Could this be due to the fact that in all samples I used images with a clear cut vertically disposed cars? I mean i rotated them myself vertically and cuted using Adobe Photoshop. For example:

car1 car2 car3

And does this mean that i have to cut cars from images like this (with parts of ground): car1 car2 car3

OR it's just because i used too few pictures (150 positives -> opencv_createsamples -> 600 samples)?

OR because of both reasons?

2) opencv_createsamples.exe applies to much distortions that i do not need, especially Z angle. With wich parameters should i run this programm to not to make Z distortion? (probably: -maxzangle 0 (?))

Pls give me some advises ;)

P.S. sorry for my bad English

2014-04-21 00:07:20 -0600 received badge  Teacher (source)
2014-04-20 16:56:14 -0600 answered a question Change the color of a string text with createTrackbar
cvPutText(

  CvArr*        img, // Image

  const char*   text, // Text

  CvPoint       origin, // Left bottom corner from which text is drawed

  const CvFont* font, // font

  CvScalar      color // Color

);

for example:

cvPutText(image, "Hello World!", cvPoint(50, 50), &font, CV_RGB(0,255,255));
2014-04-19 07:20:27 -0600 received badge  Critic (source)
2014-04-19 06:54:30 -0600 commented question Training HAAR classifier takes too long

@StevenPuttemans Here is my samples.vec, which can be opened with createsamples.exe -vec samples.vec -w 40 -h 90 -show

2014-04-19 06:44:21 -0600 commented question Training HAAR classifier takes too long

@StevenPuttemans I'm working under Windows 8.1, and it actually really have took that long for 1 stage . I started this process yesterday at 15:00, more than 24 hours left, and it's still training second stage (stage 1) (almost finished).

2014-04-19 02:20:22 -0600 commented question I know how to make artificial intelligence

Very intriguing!

2014-04-19 01:39:12 -0600 asked a question Training HAAR classifier takes too long
$ traincascade.exe -data classifier1/ -vec samples.vec -bg negatives.txt -numPos 500 -numNeg 1134 -numStages 10 -precalcValBufSize 1024 -precalcIdxBufSize 1024 -featureType HAAR -w 40 -h 90 -minHitRate 0.995 -maxFalseAlarmRate 0.5 -mode ALL
PARAMETERS:
cascadeDirName: classifier1/
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 500
numNeg: 1134
numStages: 10
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 40
sampleHeight: 90
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   500 : 500
NEG count : acceptanceRatio    1134 : 1
Precalculation time: 37.424
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+
|   3|    0.996| 0.622575|
+----+---------+---------+
|   4|    0.996| 0.622575|
+----+---------+---------+
|   5|    0.996| 0.623457|
+----+---------+---------+
|   6|    0.998|  0.55291|
+----+---------+---------+
|   7|    0.998| 0.568783|
+----+---------+---------+
|   8|    0.996| 0.539683|
+----+---------+---------+
|   9|    0.996| 0.428571|
+----+---------+---------+
END>
Training until now has taken 0 days **14 hours 15 minutes 46 seconds**.

===== TRAINING 1-stage =====
<BEGIN
POS count : consumed   500 : 502
NEG count : acceptanceRatio    1134 : 0.584838
Precalculation time: 38.191
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+
|   1|        1|        1|
+----+---------+---------+
|   2|        1|        1|
+----+---------+---------+

14 hours just for 1 stage, is it normal?

This is what my task manager shows. It seems to me all cores are working, but only 20% of my CPU is under load: image description image description

Is it possible to make it work faster?

2014-04-18 04:27:21 -0600 commented question Problem in training HAAR classifier

@StevenPuttemans I found it here: link text So, what do you advise me to use with this purpose?

2014-04-18 04:10:39 -0600 commented question Problem in training HAAR classifier

@StevenPuttemans I used mergevec.exe to combine them with cmd options:

mergevec.exe "C:\OPENCV\bin\Debug\samples.txt" samples.vec

2014-04-18 04:00:01 -0600 received badge  Supporter (source)
2014-04-18 03:54:56 -0600 received badge  Editor (source)
2014-04-18 03:53:38 -0600 asked a question Problem in training HAAR classifier

When i try to start classifier training after about 1 minute i got this:

opencv_traincascaded.exe -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 600 -numNeg 900 -w 40 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024

This generates the following output

PARAMETERS:
cascadeDirName: classifier
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 600
numNeg: 900
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 40
sampleHeight: 90
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====

<BEGIN
POS count : consumed   600 : 600
NEG count : acceptanceRatio    900 : 1
Precalculation time: 90.112
+----+---------+---------+
|  N |    HR   |    FA   |
+----+---------+---------+

OpenCV Error:

Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1<< 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file C:\OPENCV\opencv-master\modules\core\include\opencv2/core/mat.inl.hpp, line 845

Interesting thing is that if I use this option:

-featureType LBP

then training works fine. I am trying to create a classifier for detecting cars top view. This training I started just for example, and if it will begun to work I will find more positive images to create good classifier. I used 73 positives and with help of createsamples.exe I created 600 samples (73 vec files) and merged them to create one samples.vec (4 Mb). All negative images I used are greyscale, I took them from base of negative images wich was used to create face recognizing classifier and sorted them out deleting any images with cars.

P. S. Sorry for my bad english :)