Ask Your Question

Punith K's profile - activity

2018-10-01 10:47:53 -0500 received badge  Notable Question (source)
2017-03-14 05:25:26 -0500 received badge  Popular Question (source)
2014-09-06 00:29:18 -0500 asked a question How to destroy frames every minute after processing : OpenCV4Android

I'm working on OpenCV project using android, where the yawning detection is done in,

public Mat onCameraFrame(CvCameraViewFrame inputFrame){

        //Yawning detection done here using detectMultiScale() method
        //code is working fine
        .....
       }

As the detection continues application starts slowing down, because it is storing the frames in the application ( After installation application size is 2 Mb, after few minutes of detection size grows to 30 Mb and growing). The frames are released using,

public void onCameraViewStopped() {
        mGray.release();
        mRgba.release();

    }

But I want my app to run for long time without any lagging, Actually it is Real-time app to detect yawning.

I wanted to release the each frame mRgba or mGray every minute instead of releasing them once camera stopped.

Is there any possible solution that enables us to destroy frames every minute.

Can I release frames just after processing them.

Please do help me, please do not close this question.

2014-08-19 06:32:38 -0500 asked a question How to trigger some action when yawning detected.

Yawning detection is working in Android, It draws rectangle when yawning is detected, I want to raise an alarm or play audio to wake the driver.

Is it possible to count the number of times the driver yawned and depends on the count Can I raise alarm or play some audio.

Can I able to store the count or area, i.e the area of rectangle which is been marked by the rectangle() function.

2014-08-19 05:29:32 -0500 commented question how to detect only one face.

MatOfRect faces = new MatOfRect(); . . . . .

    Rect[] facesArray = faces.toArray();
    for (int i = 0; i < facesArray.length; i++)
        Core.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(), FACE_RECT_COLOR, 3);

above code draws rectangle over the detected area. So I want above loop only works once, I tried removing for, but it shows error.

2014-08-19 05:20:53 -0500 commented question how to detect only one face.

@StevenPuttemans Thanks for your advice, My question goes like this,

I'm using, OpenCV sample - Face Detection for Android, (Actually I'm working on Android), The source code given shows all the faces in the video it captures. But, my project is to detect yawning and I have created an cascade classifier, and I'm using it for the same source code. It detects the yawning, when I take my camera very close to the mouth. If I try to identify from some distance it shows so many rectangles. Actually I want to detect only one person yawning,(This project mainly concentrates on single person).

My problem with detecting yawning is that, even it sometimes marks eyes and other objects as positive. So, I want to optimize it to show only yawning in the video

2014-08-18 05:41:30 -0500 commented question how to detect only one face.

No. I want to only one face to be detected, since my application requires yawning to be detected. It detects even the other parts as positive because of the size of the mouth specified as 24X24

2014-08-18 05:19:12 -0500 asked a question how to detect only one face.

I Dont want to deetct all the faces in the video, I tried removing the for, it doesn't identify anything. I use following code in Android,

Rect[] facesArray = faces.toArray();
for (int i = 0; i < facesArray.length; i++)
Core.rectangle(mRgba, facesArray[i].tl(), facesArray[i].br(),FACE_RECT_COLOR, 3);

But I want to detect only one, how can I convert facesArray so that I can use tl() and br() methods for rectangle() method.

2014-08-16 02:17:54 -0500 commented question traincascade stops every time at stage 5 or less,

@StevenPuttemans Clearly, I use

find ./positive -name '*.jpg' -exec echo {} 1 0 0 <width> <height> \; > file.info , to create info file

then

find ./negative -name '*.jpg' > bg.txt,

opencv_createsamples -info file.info -num 1000 -w 100 -h 40 -vec data.vec

finally,

opencv_traincascade -data data -vec data.vec -bg bg.txt -numStages 20 -nsplits 2 -minhitrate 0.95 -maxfalsealarm 0.5 -numPos 1000 -numNeg 2000 -w 100 -h 40

It runs for few stages, may for stage 4, then it stops.

2014-08-13 04:28:05 -0500 received badge  Editor (source)
2014-08-13 04:27:21 -0500 asked a question traincascade stops every time at stage 5 or less,

I want to know clearly,Is there any hard rule to chose the number of positive and negative samples so that training never stops in between.

I did follow the new Train Cascade method over the same sample, but it stuck as well at stage 5. I found that there is one equation for number of files to be there in vec file. I could not able to achieve that since while creating samples I could not able to create as many I want. It always creates one less than the number of positive samples I have in my positive folder. I tried both method i.e haar training and train cascade methods, for the same dataset positive=1000 and negative=2000. and false alarm rate=0.499 and mishitrate=0.95.

I use, $opencv_haartraining -data data -vec samples.vec -bg negatives.txt -nstages 3 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -npos 1000 -nneg 2000 -w 100 -h 40 -nonsym -mem 1024 -mode ALL runs well till stage 5 then it stops ( doesn't move even a bit, i waited more than 12 hours to see progress, but no progress noticed, then gave up waiting).

@StevenPuttemans

2014-08-13 04:23:27 -0500 asked a question can we use same c++ function to detect objects for xml file generated using haartraining and traincascade interfaces.

@StevenPuttemans I noticed that xml file generated using traincascade interface is lot more different than the one created by haartraining interface. Is existing detectMultiScale and other functions that loads and interprets this new xml properly. I checked that there were no work done for reading xml created using new traincascade interface, If any please do help me.

2014-08-13 00:58:45 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

@StevenPuttemans I noticed that xml file generated using traincascade interface is lot more different than the one created by haartraining interface.

Is existing detectMultiScale and other functions that loads and interprets this new xml properly. I checked that there were no work done for reading xml created using new traincascade interface, If any please do help me.

2014-08-13 00:52:59 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

@StevenPuttemans I use,

$opencv_haartraining -data data -vec samples.vec -bg negatives.txt -nstages 3 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -npos 1000 -nneg 2000 -w 100 -h 40 -nonsym -mem 1024 -mode ALL

runs well till stage 5 then it stops ( doesn't move even a bit, i waited more than 12 hours to see progress, but no progress noticed, then gave up waiting).

If you want to share your mail id (I'm looking forward to get help from you If you don't want share here, please mail me, kpunith8@gmail.com) , I can mail my data set and obtained files, to once cross verified by you.

2014-08-13 00:48:27 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

@StevenPuttemans I want to know clearly,Is there any hard rule to chose the number of positive and negative samples so that training never stops in between. Like you said I have gone through all possible answers in the forum.

I did follow the new Train Cascade method over the same sample, but it stuck as well at stage 5.

I found that there is one equation for number of files to be there in vec file. I could not able to achieve that since while creating samples I could not able to create as many I want. It always creates one less than the number of positive samples I have in my positive folder.

I tried both method i.e haar training and train cascade methods, for the same dataset positive=1000 and negative=2000. and false alarm rate=0.499 and mishitrate=0.95.

2014-08-12 02:36:30 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

@berak I want to ask you one more thing, whenever I start training it always stops in middle i.e it stopped every time in the 5th stage, either Haar Training or Train cascade method I use, any possible solution, Please.

2014-08-12 02:34:24 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

Thanks a lot, now I can able to create my xml file.

2014-08-12 02:08:14 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

Thanks for your answer, I never thought of it. If you have convert_cascade source please do give me the link, and compilation process.

2014-08-12 01:48:33 -0500 commented question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

I have convert_cascade executable, compiled but it shows the above error.

2014-08-12 01:22:21 -0500 asked a question convert_cascade: error while loading shared libraries: libml.so.2.1: cannot open shared object file: No such file or directory

I'm following http://note.sonots.com/SciSoftware/haartraining.html to train my cascade classifier, it has created some folder is my data folder, I want to create the xml file using convert_cascade executable, but it pops up above error, even though I set environmental variables and created symbolic link in the working directory, but I don't find any libml.so.2.1 in my lib folder. I have seen libopencv_ml.so.2.4 and linopencv_ml.so.2.4.9. even if a create symbolic link to these files, it's still pops above error message. any possible solution. I searched everything. Please help if anyone knows the answer.

2014-07-31 04:05:05 -0500 commented question How to create our own Haarcascade.xml.

Thanks you @steven and @abhishek for your replays and suggestions.

2014-07-31 02:49:06 -0500 commented question How to create our own Haarcascade.xml.

@stevan I have gone through official documentation about the command line arguments to be passed while creating classifier. If you have any online resource to make use to create the classifier. please do post it here.

2014-07-31 02:47:16 -0500 commented question How to create our own Haarcascade.xml.

@abhishek Kumar Is there a constraint to use specified number of Positive and negative samples, I'm using only 12 positive and 30 negative images for my haar classifier. Does the number of samples affect on training a classifier, and I'm using w=120 and h=20 for my all images as dimension.

2014-07-30 00:56:40 -0500 asked a question Error while creating Haar Classifier in Ubuntu

I'm refererring http://abhishek4273.wordpress.com/2014/02/10/opencv-haar-training/ to create the Haar Classifier in OpenCV, I have got the error in,

$ perl createtrainsamples.pl positives.txt negatives.txt samples 200 "opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 20 -h 20"

opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 maxzangle 0.5 -maxidev 40 -w 20 -h 20 -img ./pos/5.jpg -bg tmp -vec samples/5.jpg.vec -num 40 Info file name: (NULL) Img file name: ./pos/5.jpg Vec file name: samples/5.jpg.vec BG file name: tmp Num: 40 BG color: 0 BG threshold: 0 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: 20 Height: 20 Create training samples from single image applying distortions...

OpenCV Error: Bad argument (Quadrangle is nonconvex or degenerated.) in cvWarpPerspective, file /home/project/OpenCV/opencv-2.4.9/apps/haartraining/cvsamples.cpp, line 217

terminate called after throwing an instance of 'cv::Exception'

what(): /home/project/OpenCV/opencv-2.4.9/apps/haartraining/cvsamples.cpp:217: error: (-5) Quadrangle is nonconvex or degenerated. in function cvWarpPerspective

Eventhough it generates error, it has created 8 samples.jpg.vec files in the samples folder.

Actually i have passed 200 as my samples, but it is creating only 8 of those in samples folder and throwing above error, and if try to merge using,

$./mergevec samples.txt samples.vec

It shows following error,

OpenCV Error: Assertion failed (elements_read == 1) in icvGetHaarTraininDataFromVecCallback, file cvhaartraining.cpp, line 1859 terminate called after throwing an instance of 'cv::Exception' what(): cvhaartraining.cpp:1859: error: (-215) elements_read == 1 in function icvGetHaarTraininDataFromVecCallback

Aborted (core dumped)

If any one knows the answer for the following please do post it.

~~~ THANKS IN ADVANCE ~~

2014-07-30 00:30:36 -0500 commented question How to create our own Haarcascade.xml.

Hi, @abhishek Kumar, I refered your opencv-haar-training from your answer, I found the following error while merging it,

./mergevec samples.txt samples.vec OpenCV Error: Assertion failed (elements_read == 1) in icvGetHaarTraininDataFromVecCallback, file cvhaartraining.cpp, line 1859 terminate called after throwing an instance of 'cv::Exception' what(): cvhaartraining.cpp:1859: error: (-215) elements_read == 1 in function icvGetHaarTraininDataFromVecCallback

Aborted (core dumped)

2014-07-30 00:15:39 -0500 commented question How to create our own Haarcascade.xml.

Thank you guys for your answers. After searching all possibilities for creating haar classifier in Ubuntu 14.04 and in windows, there were no proper solution given, i have seen so many people posting their comment saying there are lot of errors. I want at least bug free tutorials to create my Haarcascade.

2014-07-26 01:07:14 -0500 asked a question How to create our own Haarcascade.xml.

How to create an haar classifier, by using some set of images/trainig set.

2014-07-25 05:16:33 -0500 commented answer How to match given video stream with set of images

Thanks man :)

2014-07-25 05:00:37 -0500 commented answer How to match given video stream with set of images

okay. Do you know any good site to know about SVM classifier creation, I searched almost the entire internet. Please do mention some of the sites useful for beginners.

2014-07-25 04:50:39 -0500 commented answer How to match given video stream with set of images

Thanks #StevenPuttemans for your replay. I am using VJ's face detector to extract the face features. I have extracted each frame from the video and I'm thinking to match those frames with set of yawning images i have in my database.

Or Can I try with pattern matching to match each frame with database I have.

2014-07-25 04:38:53 -0500 asked a question How to match given video stream with set of images

I want to match video with set of images to identify whether user is yawning or not. Can we try matching Histogram to match pattern with video input.