资源简介
目标检测matlab代码,我下载的,希望下载这个的支持Matlab中文论坛。谢谢!
代码片段和文件信息
% Target Recongition
% This program detects a target in a given image and focuses on it
% Programmed By: Mina Ayman Makar
% On 2/2/2004
% Part(1) : Entering the image for MATLAB
fprintf(‘\n This program detects a target in an image‘)
fprintf(‘\n Entering the image for MATLAB...‘)
fprintf(‘\n Save the image or its copy in MATLAB working Directory‘)
imagname = input(‘\n Enter the name of the image file (filename.ext) : ‘‘s‘);
w = imread(imagname);
w = im2double(w);
sizw = size(w);
figure
imshow(w)
title(‘Input Image‘)
pause(3.5);
close;
fprintf(‘\n Entering the target image for MATLAB...‘)
fprintf(‘\n Save the target image or its copy in MATLAB working Directory‘)
tarname = input(‘\n Enter the name of the target image file (filename.ext) : ‘‘s‘);
t = imread(tarname);
t = im2double(t);
sizt = size(t);
figure
imshow(t)
title(‘Target Image‘)
pause(3.5);
close;
ww = rgb2gray(w);
tt = rgb2gray(t);
tedge = edge(tt);
wedge = edge(ww);
out = filter2(tedgewedge);
o = max(max(out));
output = (1/o)*out;
pixel = find(output == 1);
pcolumn = fix(pixel / sizw(1));
prow = mod(pixelsizw(1));
rdis = fix(sizt(1)/2);
cdis = fix(sizt(2)/2);
cmin = pcolumn - cdis;
cmax = pcolumn + cdis;
rmin = prow - rdis;
rmax = prow + rdis;
c = [cmin cmin cmax cmax];
r = [rmin rmax rmax rmin];
m = roipoly(wwcr);
m = im2double(m);
m = 0.5 * (m + 1);
mask(::1) = m;
mask(::2) = m;
mask(::3) = m;
final = mask .* w;
figure
imshow(final)
title(‘Result Image‘)
pause(3.5);
close;
subplot(121)
imshow(w)
title(‘Input Image‘)
subplot(122)
imshow(final)
title(‘Result Image‘)
sav = input(‘\n Do you like to SAVE Result Image? (y/n) : ‘‘s‘);
if (sav == ‘y‘)
fprintf(‘\n You choose to SAVE the Result Image‘)
naming = input(‘\n Type the name of the new image file (filename.ext) : ‘‘s‘);
fprintf(‘\n Saving ...‘)
imwrite(finalnaming);
fprintf(‘\n The new file is called %s and it is saved in MATLAB working Directory‘naming)
else
fprintf(‘\n You choose NOT to SAVE the Result Image‘)
end
clear
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 2093 2006-10-16 20:01 target.m
----------- --------- ---------- ----- ----
2093 1
相关资源
- 基于帧差法的运动目标检测的matlab代
- 均值背景建模目标检测
- 视频运动目标检测与跟踪 matlab代码
- 目标跟踪的MATLAB代码
- matlab 目标检测算法
- 帧间差法进行视频目标检测
- 基于深度学习的汽车目标检测
- Vibe算法matlab
- 均值建模法
- MATLAB程序实现视频中运动的目标的跟
- MATLAB+背景减除目标检测+鱼头截取
- 基于空间分形特性差异的海杂波目标
- 多类分类 目标检测
- 视频监控阴影去除
- CPHD的方法实现多目标跟踪
- 小波变换的水下图像目标检测
- 一种显著性特征检测算法
- 深度学习汽车目标检测matlab2017
- 运动目标检测的matlab代码
- 运动目标检测与跟踪算法 Matlab
- 多目标检测追踪算法MATLAB实现
- 红外图像的弱小目标检测与跟踪
- 弱小目标检测与跟踪 (Small Target De
- matlab机动微弱目标检测前跟踪
- SAR-GMTI 星座SAR动目标检测
- 改进的VIBE运动目标检测算法
- 改进的混合高斯背景模型
- MotionDetection 静止背景下运动目标检测
- automsft 该程序初始时使用背景差分法
- MutiTargetDetection 多目标检测与跟踪算法
评论
共有 条评论