using ofxFaceTracker, want to analyze pixels of mouth.. how to use fillPoly???

hi there-

I have a ofPolyline for the mouth, and I want to analyze the pixels within that contour in order to differentiate between something like a toothy grin and a tongue sticking out.

ofPolyline mouth = tracker.getImageFeature(tracker.INNER_MOUTH);

I understand that I should use fillPoly() to access the pixels from within this boundary, but I’m not sure how.

could someone look at the following and let me know what the correct parameters would be? (doc not great for beginners)

const Mat& shape = tracker._shape; //need ref or new image?

fillPoly(shape, mouth, mouth.size(), 1, cvScalar(255,NULL,NULL,NULL))

Next, I would then somehow take this shape that I drew into, and access the pixels (how??), and compare it to a saved expression’s shape and decide what is most similar.

I would probably do this inside ExpressionClassifier::classify

and use the Mat cur = tracker.getObjectPointsMat().clone(); and do that fillPoly function as well?

I think the average the color of the pixels could be a simple test.

Any help is greatly appreciated!

THanks,
Cindy