Ask Your Question
1

Save frame with face co-ordinates

asked 2016-09-11 15:20:43 -0600

Kam gravatar image

updated 2018-10-07 09:23:57 -0600

Hi

can you be able to help me with this.

I want to 1. scan my webcam for a face 2. draw rectangle around it 3. Calculate the area of rectangle 4 print Rectangle co-ordinate and area of that rectangle in Video (imshow) 5. Save that frame with all that info

Only thing I am not sure about is point 4 i.e print Rectangle co-ordinate and area of that rectangle in Video (imshow)

Let me know if you need see my code

thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-09-13 00:53:29 -0600

berak gravatar image

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);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-09-11 15:20:43 -0600

Seen: 87 times

Last updated: Sep 13 '16