当前位置 : 主页 > 编程语言 > python >

【目标检测】基于计算机视觉实现物体检测含Matlab源码

来源:互联网 收集:自由互联 发布时间:2022-06-15
1 简介 基于计算机视觉实现物体检测。 2 部分代码 function [ background_frame ] = BackgroundExt( input_video ) % This script make a background frame based on the samples of the frames. That is, it takes the average of the %


1 简介

基于计算机视觉实现物体检测。

2 部分代码

function [ background_frame ] = BackgroundExt( input_video )
% This script make a background frame based on the samples of the frames. That is, it takes the average of the
% frames and save the result as the background frame
% If you have the background frame, then you can use it directly. We are
% using averaging because we do not have access to the background image,
% and by averaging we can supress the effect of moving objects in the
% resulting frame and have a better estimation of background frame.
sample_step = 2;
vid = VideoReader(input_video);
%vid = VideoReader('sample.mov');
%frame = vid.read(inf);
Height = vid.height;
Width = vid.width;
nframes = vid.NumberOfFrames; %Number of frames
background = zeros(Height,Width,3); %Initial Background Image
%% First Stage: averaging over all of the background samples
for i=1:sample_step:nframes-sample_step
background = background + double(read(vid,i));
end
background = sample_step*background/(nframes);
%imshow(uint8(background));
background_frame = background;
end

3 仿真结果

【目标检测】基于计算机视觉实现物体检测含Matlab源码_ide

【目标检测】基于计算机视觉实现物体检测含Matlab源码_ide_02

【目标检测】基于计算机视觉实现物体检测含Matlab源码_上传_03正在上传…重新上传取消

【目标检测】基于计算机视觉实现物体检测含Matlab源码_计算机视觉_04

【目标检测】基于计算机视觉实现物体检测含Matlab源码_ide_05

4 参考文献

[1]邹华宇, 王剑. 一种基于计算机视觉的目标检测方法及系统:. 

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

【目标检测】基于计算机视觉实现物体检测含Matlab源码_计算机视觉_06

【目标检测】基于计算机视觉实现物体检测含Matlab源码_上传_07

网友评论