当前位置:[北京同好会]>[编程]>[视频窗口控件和验证程序]

 

视频窗口控件VideoWnd

class PACKAGE TVideoWnd : public TCustomPanel

主要功能:

1)调用摄像头驱动调整格式和图像。

2)捕捉单张图片并保存。

3)设置导星目标,目标区大小41x41,比对区域大小61x61

NFL sports jerseys are a abundant means for any fan to appearance cheap nfl jerseys their abutment for their respected team .cheap nfl jerseys As you attending at the altered available, you ability admiration what some cheap nfl jerseys of your alternatives are as you aswell cheap nfl jerseys activate the seek for one that is cheap nfl jerseys acceptable for you.Typically, 2013 super bowl jerseys you will exchange that NFL sports jerseys cheap nike nfl jerseys are advised as replicas of the official bold jersey your respected players wear. They are fabricated of a college superior nylon allowing the derma beneath them to breathe easily. Best of all,cheap nfl jerseys the faculty superior versions ravens jerseys will endure a continued time acknowledgment to the added material. Over the years,49ers jerseys these jerseys accept become cheap nfl jerseys absolute accepted acknowledgment to the cheap nfl jerseys able followings the teams have. Most break at home admirers like to action the jersey of their respected player, while they acclamation at the bold on nfl jerseys cheap the big screen. Those that do Cheap Nike NFL jerseys accomplish it to the big game, they adore accepting their on to appearance the aggregation they cheap nfl jerseys are admitting and they tend to attending ablaze in a affiliate marketer of hundreds cutting the absolute above mentioned jersey When you are searching at the altered NFL sports jerseys, you will apprehension that they accept a altered appearance 2013 super bowl jerseys depending on gender.cheap authentic jerseys The ones advised nfl jerseys cheap for men are about abutting cut to the close and aggregate cheap jerseys china out in the accept areas Women will exchange a added airy close band that gives them added nfl jerseys china comfort Their options cheap nfl jerseys can be bigger in the chest breadth and smaller in the amateur and sides. There are cheap jerseys china even some risque jersey sources cheap nfl jerseys of the added adventuresome women to wear.

4)导星,向主窗口反馈偏移量。

5)实时叠加。如果处在导星状态则补偿偏移量后叠加。

6)视频/音频捕捉

全局变量flag/sky_vw_*

调用:

bool videocapture(bool bcapture,bool baudio)
bcapture开始/停止视频捕捉。baudio捕捉/不捕捉音频。文件名:yyyymmddhhmmss.avi。
如果视频未连接或正在导星或叠加则返回false。捕捉过程中执行导星或叠加会中断捕捉。

AnsiString savedir
设置视频文件、单幅捕捉图片、叠加图片的保存目录。缺省值为程序所在目录。

bool dirraexch,bool dirdecexch
对调东西、南北显示

bool panelautosize
窗口自动适应视频大小。设置后触发一个更新。

int sky_bias_average
大于1时:对偏离量取和后反馈;每接收到sky_bias_average组后反馈一次,不是移动平均;
否则,每当偏离值有变化时则反馈。
在导星期间不改变。

int sky_integ
在1-9之间时,对图像叠加后测量。超出范围等效于1。
在导星期间不改变。(06-10-11)

导星过程中会向主窗口发送目标偏离消息,用于反馈处理。

void gettrackimg(Graphics::TBitmap * pbmp)
将下一个导星测量图像显示到pbmp。每次执行显示一幅。(06-10-11)

void getkernelimg(Graphics::TBitmap * pbmp)
将导星起始图像显示到pbmp。 执行后每次开始导星时均显示。(06-10-11)

主窗口消息处理

//video window feedback via message:
#define WM_TVIDEOWNDMESSAGE (WM_APP + 400)
#define TVW_BIAS_RA 1 //with bias in ra
#define TVW_BIAS_DEC 2 //with bias in dec
#define TVW_BIAS_RA_SUM 3 //with bias in ra
#define TVW_BIAS_DEC_SUM 4 //with bias in dec
#define TVW_TRACK_ON 101
#define TVW_TRACK_OFF 102
#define TVW_EXPO_ON 111
#define TVW_EXPO_OFF 112
#define TVW_EXPO_SYNC 113
#define TVW_SUPERIM_ON 121
#define TVW_SUPERIM_OFF 122 //end of superimposing, send total stack number
#define TVW_SUPERIM_NUM 123
#define TVW_PROCTERM 131 //process terminated, can delte handler
#define TVW_PROCERR 132 //process error
#define TVW_PROCSUSP 133 //process suspended


TMessage & Message
{

char cmd;
switch (Message.WParam){
case TVW_BIAS_RA:
//Message.LParam;
break;
case TVW_BIAS_DEC:
//Message.LParam;
break;
case TVW_EXPO_OFF:
cmd=WEBCAM_EXPO_OFF;
rs232->Write(&cmd,1);
cmd=WEBCAM_SUB_OFF;
rs232->Write(&cmd,1);
vw->captureexpo();
break;
case TVW_EXPO_ON:
cmd=WEBCAM_SUB_ON;
rs232->Write(&cmd,1);
cmd=WEBCAM_EXPO_ON;
rs232->Write(&cmd,1);
break;
}
}

验证程序

<程序下载230k>

针对定时视频捕捉的应用。

如果有一个以上的摄像头同时连接到PC上,则选“驱动”。

然后按“连接”,显示画面;

”格式“用于改变大小;

“图像”用于调节;

依次输入:视频长度(秒),间隔时间(秒)和次数。

按“start”开始自动录制。文件保存在程序所在的目录下。

如选中“audio”,则同时录制音频。

如选中“autosize”,则窗口随视频大小变化。