function [] = select()
clc
close all;
clear all;
obj = mmreader('shaky_car.avi'); % 读入avi文件,视频文件不能用数字命名
% 读取所有的帧数据
vidFrames = read(obj);
% 帧的总数,用于获取动画的帧个数,也就是按照顺序播放了几张图片
numFrames = obj.numberOfFrames;
%%%%%%%%%%%%%%%%%%根据一幅目标全可见的图像圈定跟踪目标%%%%%%%%%%%%%%%%%%%%%%%
I=vidFrames(:,:,:,1)
figure(1);%控制窗口数量
imshow(I);
[temp,rect]=imcrop(I); %函数用于返回图像的一个裁剪区域
[a,b,c]=size(temp); %a:row,b:col
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%计算目标图像的权值矩阵%%%%%%%%%%%%%%%%%%%%%%%
y(1)=a/2;
y(2)=b/2;
tic_x=rect(1)+rect(3)/2;
tic_y=rect(2)+rect(4)/2;
m_wei=zeros(a,b);%权值矩阵
h=y(1)^2+y(2)^2 ;%带宽
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载