Skip to content

Commit 4b804dc

Browse files
committed
switched from drawing circle around faces to rectangle
1 parent c3085ae commit 4b804dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ Mat draw_faces(Mat frame1, vector<Rect> faces)
105105
{
106106
for ( size_t i = 0; i < faces.size(); i++ )
107107
{
108-
/*Drawing circle around faces*/
109-
Point center( faces[i].x + faces[i].width/2, faces[i].y + faces[i].height/2 );
110-
ellipse( frame1, center, Size( faces[i].width/2, faces[i].height/2 ), 0, 0, 360, Scalar( 0, 250, 255 ), 4, 8, 0 );
108+
/*Drawing rectangle around faces*/
109+
rectangle(frame1, Point(faces[i].x, faces[i].y), Point(faces[i].x + faces[i].width, faces[i].y + faces[i].height), Scalar(0, 250, 255), 2, LINE_8, 0);
111110
}
112111
return frame1;
113112

@@ -144,7 +143,8 @@ Mat put_label_on_face(Mat frame,vector<Rect> faces,int* label)
144143
ss << label[j];
145144
string str_label = ss.str();
146145
/*writing label on the image frame*/
147-
putText(frame, str_label, Point(faces[j].x, faces[j].y), FONT_HERSHEY_SIMPLEX,2, Scalar(0,255,255), 4);
146+
/*putText(InputOutputArray img, const String& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=LINE_8, bool bottomLeftOrigin=false )*/
147+
putText(frame, str_label, Point(faces[j].x, faces[j].y), FONT_HERSHEY_SIMPLEX,1, Scalar(0,0,255), 2);
148148
}
149149
return frame;
150150
}

0 commit comments

Comments
 (0)