First time here? Check out the FAQ!

Ask Your Question
0

cascade classifier data structure

asked Feb 21 '13

Bibliarij gravatar image

Hello all! For my own implementation of Viola-Jones algorithm partly I use some methods and structures of OpenCV. For example, reading of images to structure CvMat. Now I need to use cascade classifier. For example, I decide to use class cv::CascadeClassifier. Is there easy way to access members of this class? For example to vector<stage>. This member somehow is protected... Or exists another similar structure? Thanks for the answers.

Preview: (hide)

Comments

btw, i just found, that there's an option in the haartraining tool (from haartraining.htm) :

- mode <BASIC (default) | CORE | ALL>

selects the type of haar features set used in training. BASIC use only upright features, while ALL uses the full set of upright and 45 degree rotated feature set.

so, seems to me, only when ALL is used, it produces tilted features

berak gravatar imageberak (Feb 21 '13)edit
1

mmm, ok, thanks

Bibliarij gravatar imageBibliarij (Feb 21 '13)edit

1 answer

Sort by » oldest newest most voted
0

answered Feb 21 '13

Bibliarij gravatar image

updated Feb 21 '13

SR gravatar image

It is possible to use CvHaarClassifierCascade structure in such manner:

CvHaarClassifierCascade* c = (CvHaarClassifierCascade*)cvLoad("haarcascade_frontalface_alt.xml", 0, 0, 0);
for (int i = 0; i< c->count; i++)
{
    CvHaarStageClassifier* stage = c->stage_classifier + i;
    for (int j = 0; j < stage->count; j++)
    {
        CvHaarClassifier* hc = stage->classifier + j;
        for (int k = 0; k < hc->count; k++)
        {
            CvHaarFeature* feature = hc->haar_feature + k;
            if(feature->tilted) std::cout << "has titled!";
        }
    }
}
Preview: (hide)

Question Tools

Stats

Asked: Feb 21 '13

Seen: 807 times

Last updated: Feb 21 '13