Ask Your Question
6

Missing HOG Cascade in Ver 3

asked Sep 24 '15

mefmef gravatar image

updated Sep 24 '15

It seems that opencv 3 no longer support HOG Cascade. Why is that?

in cascadedetect.cpp:

if( featureTypeStr == CC_HAAR )
    featureType = FeatureEvaluator::HAAR;
else if( featureTypeStr == CC_LBP )
    featureType = FeatureEvaluator::LBP;
else if( featureTypeStr == CC_HOG )
{
    featureType = FeatureEvaluator::HOG;
    CV_Error(Error::StsNotImplemented, "HOG cascade is not supported in 3.0");
}
else
    return false;

It was working very good and in many cases the results were better than Haar cascade and LBP!! Moreover, the training time was very good (in my experience 20 times faster than Haar and 2 times faster than LBP).

Preview: (hide)

Comments

Can you give more details of the problem? Afaik, CascadeClassifier still supports HOG descriptors

LorenaGdL gravatar imageLorenaGdL (Sep 24 '15)edit

I've edited the question

mefmef gravatar imagemefmef (Sep 24 '15)edit

2 answers

Sort by » oldest newest most voted
7

answered Sep 24 '15

LorenaGdL gravatar image

updated Sep 24 '15

I wasn't aware of this lack of functionality, but I have found this issue (#4989) where developers state the reasons for dropping.

Preview: (hide)

Comments

They mentioned that "The implemented HOG features are quite weird - different from Dalal's interpretation of HOG, different from P. Dollar integral channel features"

I don't understand why it should be omitted if it is not the same as Dalal's interpretation!!! It was working very good and in many cases the results were better than Haar cascade and LBP!!

mefmef gravatar imagemefmef (Sep 24 '15)edit

Actually I think dropping faulty implementations is a good approach since you are telling people that it follows a certain convention while it does not. It will return once somebody can integrate the working HOGDescriptor interface into this. In the meanwhile, just use the 2.4 branch if you want this or port the functionality locally.

StevenPuttemans gravatar imageStevenPuttemans (Sep 24 '15)edit

I think instead of dropping, the author of the code can write a document and describe the method.

mefmef gravatar imagemefmef (Sep 24 '15)edit
2

The original author was not available for help anymore as I understood from one of the core developers. And actually, there is only 1 way of calculating HOG features so we cannot just add a semiHOG implementation because it does something good... that is not the purpose of a computer vision library...

StevenPuttemans gravatar imageStevenPuttemans (Sep 24 '15)edit
2

It is strange that the HOG implementation was not documented so it may be rewritten... I suggest you to do documentation of all the approaches in OpenCV for not having the same problems later... ;)

thdrksdfthmn gravatar imagethdrksdfthmn (Sep 24 '15)edit

so.. it is not documented anymore but is still callable? because im pretty sure im calling it and getting back a classifier that seems to work decently in certain params and situations (opencv 3 python API)

jsky gravatar imagejsky (Nov 2 '15)edit

@jsky there is a difference between HOG cascades and HOG+SVM as the HOGPeopleDetector. The latter still works perfectly fine! The first one is disabled.

StevenPuttemans gravatar imageStevenPuttemans (Nov 2 '15)edit
1

but i call pkg-config --modversion opencv : 3.0.0 and opencv_traincascade ... -featureType HOG and i get back a cascade that seems to use HOG features <featureType>HOG</featureType>.. Are you saying this is using an SVM implementation as opposed to decision tree?

jsky gravatar imagejsky (Nov 4 '15)edit

Well that is because the traincascade app has not been adapted according to the detection algorithm. So you will be perfectly fine in training one, but as I recall it, at calling detectMultiScale, the featureEvaluator does not know how to handle the HOG features anymore.

  • As you can see here, in the latest master branch, there is no line anymore to evaluate the HOG features.
  • Checked it for 3.0.0 also and there it is also missing.

So even if you train a model using the faulty feature set, you won't be able to call it at detection time.

StevenPuttemans gravatar imageStevenPuttemans (Nov 4 '15)edit

hmm i see.. but it seems that i am calling it in detection and getting decent results. i guess its because its still in the python api? as im using python. nowhere do i tell it to use a particular evaluator, i just tell it about the classifier and then call detectMultiscale ..

jsky gravatar imagejsky (Nov 6 '15)edit
0

answered Mar 29 '0

ComputerVisionary gravatar image

updated Mar 29 '0

You can keep training Hog cascades with opencv <3.0 and use the resulting xml with versions <3.0.

Preview: (hide)

Comments

1

Sorry I was trying to support this community, I remove the link a correct the answer.

Question Tools

1 follower

Stats

Asked: Sep 24 '15

Seen: 4,753 times

Last updated: Mar 29 '20