Ask Your Question

yogeshmurthy_'s profile - activity

2020-02-10 06:16:56 -0600 commented question Is there a way to use a trained CascadeClassifier for just classification in OpenCV 3.x?

Yes, I've got crops already, just need to know if the object is present or not. I need something that runs fast because

2020-02-10 02:51:54 -0600 commented question How to tracking multiple vehicle (e.g car and motorcycle) using haar cascade classifier?

@berak By recent OpenCV, are you referring to version 3.x or 4.x? The tools to train Haar cascades still seem to exist i

2020-02-10 02:51:34 -0600 commented question How to tracking multiple vehicle (e.g car and motorcycle) using haar cascade classifier?

@berak By recent OpenCV, are you referring to version 3.x or 4.x? The tools to train Haar cascades still seem to exist i

2020-02-10 02:49:37 -0600 commented question How to tracking multiple vehicle (e.g car and motorcycle) using haar cascade classifier?

If you are trying to detect vehicles, your training set should contain multiple images of different vehicles. After trai

2020-02-10 02:49:00 -0600 commented question How to tracking multiple vehicle (e.g car and motorcycle) using haar cascade classifier?

If you are trying to detect vehicles, your training set should contain multiple images of different vehicles. After trai

2020-02-10 02:45:55 -0600 commented question trouble in using detectmultiple command

Since the error is in the cvtColor function, it means that your source image, img is empty. Before calling cvtColor, ple

2020-02-10 00:12:12 -0600 asked a question Is there a way to use a trained CascadeClassifier for just classification in OpenCV 3.x?

Is there a way to use a trained CascadeClassifier for just classification in OpenCV 3.x? I have trained a cascade classi

2018-09-12 02:24:23 -0600 received badge  Supporter (source)
2017-09-02 11:22:22 -0600 received badge  Student (source)
2017-09-01 03:23:05 -0600 commented answer How does scale factor behave in HOG multiscale detector ?

Using mean shift algorithm?

2017-09-01 01:40:42 -0600 commented answer How does scale factor behave in HOG multiscale detector ?

@StevenPuttemans How is the merge done?

2017-08-24 01:35:04 -0600 received badge  Enthusiast
2017-08-08 01:38:03 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

Cool. No issues. Thanks a ton for your help. I'd have upvoted your comments but I don't have enough points yet. Sorry :(

2017-08-08 01:21:57 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

Thanks. Can you tell me why and how regression is used for a classification problem? Is there any developer manual/documentation for OpenCV from where I can get this information?

2017-08-07 06:19:16 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

Thanks for clarifying that. Can you tell me in which part of the code the restriction of SVR+LINEAR kernel is enforced? Also, the assertion fails at getSupportVectors() and getDecisionFunction(), much before setting the SVM detector for a HOGDescriptor object. Printing the values gives alpha.total( ) = 200, svidx.total( ) = 200 and sv_total = 200. Can you help me understand what's happening here?

2017-08-07 02:48:18 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

Do you mean I cannot use any kernel other than LINEAR on HOG data? How do I experiment with other kernels and different parameters for HOG+SVM? Can you point me to appropriate resources? Are you aware of what dataset and method has been used to train the defaultPeopleDetector?

2017-08-07 02:20:16 -0600 received badge  Editor (source)
2017-08-07 01:41:39 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

The issue I am facing is before the prediction phase. It happens when I am trying to get the support vectors and decision function from the trained SVM. Here's the code snippet where the assertion is failing.

Mat sv = svm->getSupportVectors(); const int sv_total = sv.rows; Mat alpha, svidx; double rho = svm->getDecisionFunction(0, alpha, svidx); CV_Assert( alpha.total() == 1 && svidx.total() == 1 && sv_total == 1 );

Can you help me pinpoint the exact issue?

2017-08-07 00:10:05 -0600 commented question Issues with OpenCV train_HOG c++ sample code?

For prediction, the SVM associated with a HOGDescriptor object is set explicitly using the setSVMDetector method of the class. I imagine as long as the vectors, in both training and test sets, are of the same size, this should work, right?

2017-08-04 04:57:04 -0600 asked a question Issues with OpenCV train_HOG c++ sample code?

I am trying to train a HOG+SVM on the INRIA dataset using the OpenCV sample code train_HOG.cpp. Firstly, I am confused why Support Vector Regression (EPS_SVR) is used for what is clearly a classification problem. I've tried changing it to C_SVC but am getting the following runtime error with all kernels other than linear (this happens for the regression case as well) while testing on the training set itself:

OpenCV Error: Assertion failed (alpha.total() == 1 && svidx.total() == 1 && sv_total == 1) in get_svm_detector terminate called after throwing an instance of 'cv::Exception' what(): HOGsvm.cpp:41: error: (-215) alpha.total() == 1 && svidx.total() == 1 && sv_total == 1 in function get_svm_detector Aborted (core dumped)

Any idea on why it is happening and how to resolve it?

EDIT: Here's the code snippet that's raising the error

Ptr<svm> svm = SVM::create() ;

svm->setTermCriteria(TermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-3 ));

svm->setType(SVM::C_SVC);

svm->setKernel(SVM::RBF);

svm->setC(0.01);

svm->setGamma(0.1);

svm->train(train_data, ROW_SAMPLE, Mat(labels));

HOGDescriptor myHog ;

myHog.winSize = Size(64, 128) ;

vector<float> hogDetector ;

Mat sv = svm->getSupportVectors();

const int sv_total = sv.rows;

Mat alpha, svidx;

double rho = svm->getDecisionFunction(0, alpha, svidx);

CV_Assert( alpha.total() == 1 && svidx.total() == 1 && sv_total == 1 );