Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use cv::format to make a String of your data, then use that to print it to screen:

String  desc = format("%d_%d_%d", rect.x, rect.y, rect.w * rect.h);
putText(image, desc, Point(x+5,y+5), Scalar(200,0,0), FONT_HERSHEY_PLAIN, 1.0,  Scalar(200,0,0));

later, use the same string to save the image:

String fn = desc + ".png";
imwrite(cropped, fn);