#include <opencv.hpp>
#include <Windows.h>
//#include <time.h>
#include "atlstr.h"
using namespace cv;
using namespace std;
void OutputDebugPrintf(const char* strOutputString, ...)
{
char strBuffer[4096] = { 0 };
va_list vlArgs;
va_start(vlArgs, strOutputString);
_vsnprintf_s(strBuffer, sizeof(strBuffer)-1, strOutputString, vlArgs);
va_end(vlArgs);
OutputDebugString(CA2W(strBuffer));
}
int main(int argc, char* argv[])
{
VideoCapture cap(0); // open the default camera
if (!cap.isOpened()) // check if we succeeded
return -1;
double w = cap.get(CV_CAP_PROP_FRAME_WIDTH);
double h = cap.get(CV_CAP_PROP_FRAME_HEIGHT);
double count = cap.get(CV_CAP_PROP_FPS);
Mat edges;
namedWindow("edges", CV_WINDOW_NORMAL | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED);
cv::Point p = cv::Point(300, 20);
struct tm t; //tm结构指针
time_t now; //声明time_t类型变量
char ch[64];
clock_t tick1, tick2
Opencv 调用摄像头显示视频并添加时间戳水印
最新推荐文章于 2024-09-17 19:06:08 发布
本文介绍了如何利用OpenCV库从摄像头捕获视频,并在实时视频流上添加动态时间戳作为水印。通过示例代码详细阐述了实现这一功能的步骤和技术要点。
摘要由CSDN通过智能技术生成