+ update_idle(faces->total);
+
+ /* draw all the rectangles */
+ for(i = 0; i < faces->total; i++)
+ {
+ /* extract the rectangles only */
+ CvRect face = *(CvRect*)cvGetSeqElem(faces, i);
+ CvPoint upperLeft = cvPoint(face.x * scale, face.y * scale);
+ CvPoint bottomRight = cvPoint((face.x + face.width) * scale,
+ (face.y + face.height) * scale);
+ cvRectangle(image, upperLeft, bottomRight, CV_RGB(255,0,0), 3);
+ }
+
+ if(small_image != image)
+ cvReleaseImage(&small_image);
+ cvReleaseMemStorage(&storage);
+}
+
+void update_idle(int faces_total)
+{
+ static int saw_last_time = 0;
+
+ if(0 < faces_total)