I have detected the Face in an Image(Only 1 Person) and have the coordinates of the Face Rectangle.
Since the image can be of any size,I need only the part of the image that is important(head.shoulders).What intent to do is extend the bounds of the detected rectangle by some factor so that the important parts are included. Is this the right approach?
Update:
I have tried this .. but its not giving the correct result.Note that i have changed 1.7 to 2 since it only takes integer arguments.And Top and Left are readonly properties.
foreach (Rectangle f in objects)
{
int x, y;
x = f.Top - (f.Height / 8);
y = f.Left - (f.Width / 2);
Rectangle myrect = new Rectangle(x, y, f.Width * 2, f.Height * 2);
g.DrawRectangle(Pens.Gray, myrect);
}
Detected Face Rectangle
Top----->62
Right----->470
Left----->217
Bottom----->315
Extended Rectangle as per answer
Top----->91
Right----->537
Left----->31
Bottom----->597
Extended rectangle