Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to put measurement function on the text?

Hi, actually I want to put the measurement on the text. But I doesn't have any idea how to put it. There's anyone can help me? Here is the code that I want to implement the measurement function on it. I'm not sure whether the code is right or not. Thank you in advanced.

    int imgW = 650;
    int imgH = 50;

    Mat frame = Mat::zeros(imgH,imgW, CV_8UC1);
    int fontFace = FONT_HERSHEY_COMPLEX_SMALL;
    double fontScale = 1.5;
    int thickness = 2;
    Point textOrg(imgW/5, imgH/1.2);
    string someText = "Dimension: ";
    putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness,8);