资源简介
使用VC设计了基于OpenCV的摄像头云台控制系统 实现了运动跟踪、运动报警、抓拍、手动云台控制、云台状态显示、摄像头设置和实时曲线绘制等功能。
代码片段和文件信息
#include
#include
#define CMD ‘O‘
#define END ‘E‘
#define INVAIL 0
#define READY ‘R‘
#define BUSY ‘B‘
#define CONNECT ‘C‘ //连接
#define WAIT ‘W‘ //等待
#define MOVEX ‘X‘ //X移位
#define MOVEY ‘Y‘ //Y移位
#define MOVEXY ‘P‘ //X-Y移位
#define uchar unsigned char
#define EOS ‘A‘
#define BUFFLEN 40
#define CMDLEN 5
struct COMMAND{ //指令结构
uchar cmd;
uchar dat1;
uchar dat2;
};
uchar buff[BUFFLEN]bcnt=00bhead=0bend=0; //接受数据缓存 及计数器
unsigned char ccnt=0; //指令队列计数器
struct COMMAND cmd_buff[15]={{000}}; //指令队列
void Send_Str(uchar * str);
void showbuff(void){
char i;
Send_Str(“ [Buff: A“);
for(i=0;i {
if(buff[i]==INVAIL) putchar(‘-‘);
else putchar(buff[i]);
}
Send_Str(“ ] A“);
putchar(‘ ‘);
}
void Cmd_buffPro(void)
{uchar ij=0tbendt=0f=0;
tbend=bcnt;
i=bhead;
while(i!=tbend)
{tbend=bcnt;
if(buff[i]==CMD)
{
f=1;
if(bhead<=tbend)
{
if((((i+CMDLEN-1)%BUFFLEN>bhead)&&((i+CMDLEN-1)%BUFFLEN }else {
if((((i+CMDLEN-1)%BUFFLEN>bhead)||((i+CMDLEN-1)%BUFFLEN }
if(t)
{
if(buff[(i+CMDLEN-1)%BUFFLEN]==END)
{
f=0;
//Send_Str(“ [CMD] A“);j++;
//putchar(j+‘0‘);
ccnt=ccnt+1;buff[i%BUFFLEN]=INVAIL;
cmd_buff[ccnt].cmd =buff[(i+1)%BUFFLEN];buff[(i+1)%BUFFLEN]=INVAIL;
cmd_buff[ccnt].dat1=buff[(i+2)%BUFFLEN];buff[(i+2)%BUFFLEN]=INVAIL;
cmd_buff[ccnt].dat2=buff[(i+3)%BUFFLEN];buff[(i+3)%BUFFLEN]=INVAIL;
buff[(i+4)%BUFFLEN]=INVAIL;
bhead=((i+CMDLEN)%(BUFFLEN));
i=bhead;
//putchar(‘[‘);putchar(i/10+‘0‘);putchar(i%10+‘0‘);putchar(‘]‘);
//putchar(‘[‘);putchar(tbend/10+‘0‘);putchar(tbend%10+‘0‘);putchar(‘]‘);
}else {
f=0;buff[i]=INVAIL;
}
}
}else{
if(f==0)buff[i]=INVAIL;
i++;
i=i%BUFFLEN;bhead=i;
}
}
}
void Cmd_pro(void)
{uchar i;
if(ccnt>0)
{
for(i=0;i {
cmd_buff[i].cmd=cmd_buff[i+1].cmd;
cmd_buff[i].dat1=cmd_buff[i+1].cmd;
cmd_buff[i].dat2=cmd_buff[i+1].cmd;
putchar(‘[‘);putchar((‘0‘+ccnt));
Send_Str(“:proCMD] A“);
putchar(cmd_buff[0].cmd);
}
ccnt--;
switch(cmd_buff[0].cmd)
{
case CONNECT:Send_Str(“connect A“);break;
case WAIT :Send_Str(“waiting A“);break;
case MOVEX :Send_Str(“movex A“);break;
case MOVEY :Send_Str(“movey A“);break;
case MOVEXY :Send_Str(“movexy A“);break;
default:Send_Str(“Inlegal Command!A“);break;
}
}
}
#pragma interrupt_handler ReceivePro:19
void ReceivePro(void) //串口接受中断服务程序
{
buff[bcnt]=UDR0;
bcnt++;
bcnt=bcnt%(BUFFLEN);
showbuff();
//putchar(‘[‘); putchar(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 105 2009-08-01 09:49 源码00\说明.txt
文件 179704 2004-08-17 12:00 源码00\自动跟踪改进DM_CtrlPad\a.wav
文件 11232 2009-05-04 15:10 源码00\自动跟踪改进DM_CtrlPad\commondialog.cpp
文件 3239 2009-05-04 15:10 源码00\自动跟踪改进DM_CtrlPad\commondialog.h
文件 29272 2009-07-26 10:01 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.aps
文件 5996 2009-07-26 10:02 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.clw
文件 2119 2009-04-29 15:21 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.cpp
文件 7188 2009-05-30 19:53 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.dsp
文件 677 2009-05-04 15:38 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.dsw
文件 1368 2009-04-29 15:21 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.h
文件 476160 2009-07-26 10:03 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.ncb
文件 53760 2009-07-26 10:03 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.opt
文件 254 2009-06-04 10:09 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.plg
文件 13512 2009-05-30 20:49 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPad.rc
文件 46163 2009-06-04 08:47 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPadDlg.cpp
文件 3212 2009-06-01 16:20 源码00\自动跟踪改进DM_CtrlPad\DM_CtrlPadDlg.h
文件 1445 2009-05-04 10:52 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlg.cpp
文件 1332 2009-05-04 10:50 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlg.h
文件 2504 2009-05-10 18:14 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgCapture.cpp
文件 1465 2009-05-10 18:08 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgCapture.h
文件 2225 2009-05-10 18:18 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgPhoto.cpp
文件 1430 2009-05-10 18:16 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgPhoto.h
文件 2364 2009-05-28 22:56 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgWarn.cpp
文件 1414 2009-05-28 22:40 源码00\自动跟踪改进DM_CtrlPad\DM_SFOptionDlgWarn.h
文件 2098 2009-04-29 16:14 源码00\自动跟踪改进DM_CtrlPad\font.cpp
文件 1461 2009-04-29 16:14 源码00\自动跟踪改进DM_CtrlPad\font.h
文件 8569 2009-04-29 16:14 源码00\自动跟踪改进DM_CtrlPad\mscomm.cpp
文件 3221 2009-04-29 16:14 源码00\自动跟踪改进DM_CtrlPad\mscomm.h
文件 486 2009-05-30 19:39 源码00\自动跟踪改进DM_CtrlPad\ob
文件 2209 2009-04-29 16:14 源码00\自动跟踪改进DM_CtrlPad\oleob
............此处省略40个文件信息
- 上一篇:用友数据库表结构分析
- 下一篇:qxdm 日志分析工具
相关资源
- 基于opencv的blob分析代码
- GrabCut算法详解
- opencv中图片添加文字
- 自动聚焦源程序(基于openCV)
- QT+OpenCV+USB摄像头
- SIFT算法实现及代码详解
- 派尔高云台控制PC软件.zip
- IMAQ Labview打开USB摄像头.vi
- OV7670摄像头模块原理图.rar
- opencv使用圆靶标标定相机参数
- OpenCV轮廓匹配
- 四向边沿跟踪算子.c
- qml+Gstreamer实现网络摄像头播放硬解码
- OpenCVForUnity,Unity插件
- opencv 320 编译需要 vgg_generated 包
- qt+openc循线四旋翼
- Camshift 全自动跟踪算法/opencv
- OPENCV函数手册(带目录)pdf
- Qt编写调用网络摄像头完成视频录制、
- OpenCV3.3
- opencv实现两种手势识别
- OpenCV+SVM简单应用-------路面箭头分类
- IE+Flash+vue项目调用摄像头拍照
- 基于Qt与OpenCV的图片读取、保存,并利
- Cannot load info library for OpenCV解决方案文
- Xvid-1.1.3-27042008
- 使用VIBE算法进行车流量检测并消除鬼
- opencv库文件
- opencv中的cvaux.lib文件
-
opencv的各种haarcascade.xm
l文件
评论
共有 条评论