Ask Your Question

Revision history [back]

Simply replace the line of the rectangle with this one.

sprintf( buf, "%f", expressions.at<double>(0,i)/MAX_VALUE*100. );
cvPutText( img, buf, cvPoint(80, current), &font, expColor );

Where "buf" is a buffer of characters (let says of size 255, but anything large enough is OK). You also need to know the max value for your emotion detector (or compute the sum for all emotions and compute a relative percentage).