- #include <opencv2/core/core.hpp>
- #include <opencv2/highgui/highgui.hpp>
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- using namespace cv;
- using namespace std;
- int main()
- {
- void draw_framecount(Mat Frame,int framecount);
- namedWindow("text");
- for (int count=1;count<=6000;count++)
- {
- char img_str[200];
- sprintf(img_str,"D:\\image\\UMN\\Crowd-Activity-%04d.jpg",count);
- Mat img=imread(img_str);
- draw_framecount(img,count);
- imshow("text",img);
- waitKey(100);
- }
- }
- void draw_framecount(Mat Frame,int framecount)//Frameframecount
- {
- char strFrame[10];
- sprintf(strFrame, "#%0d ",framecount);
- putText(Frame,strFrame,cvPoint(0,20),2,1,CV_RGB(25,200,25));
- }