模版匹配定位跟踪源码程序 - matlab算法设计 - 谷速源码
下载频道> 资源分类> matlab源码> 算法设计> 模版匹配定位跟踪源码程序

标题:模版匹配定位跟踪源码程序
分享到:

所属分类: 算法设计 资源类型: 文件大小: 466.79 KB 上传时间: 2016-01-28 19:12:25 下载次数: 12 资源积分:1分 提 供 者: xiaopeng2 模版匹配定位跟踪源码程序
内容:
模版匹配定位跟踪源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
function findBallFcn(greenBall1)
 
%% Find Green Object
% This script reads in an image file and then attempts to find a green
% object in the image. It is designed to find one green ball and highlight
% that ball on the original image
 
% Copyright 2013 The MathWorks, Inc.
 
%% Step 1: Read image into MATLAB 
% First we read the specified image from the file and bring it into MATLAB
% as a variable. We also display the image to ensure it is correct.
% greenBall1 = imread('greenBall3.jpg');
% imtool(greenBall1);
 
%% Step 2: Identify Unique Characteristics of Object of Interest
 
%%
% Extract each color
% Next we using indexing to extract three 2D matrices from the 3D image
% data corresponding to the red, green, and blue components of the image.
r = greenBall1(:, :, 1);
g = greenBall1(:, :, 2);
b = greenBall1(:, :, 3);
 
%% 
% View different color planes
% figure
% subplot(2,2,1),imagesc(r)
% subplot(2,2,2),imagesc(g)
% subplot(2,2,3),imagesc(b)
 
%%
% Calculate Green
% Then we perform an arithmetic operation on the matrices as a whole to try
% to create one matrix that represents an intensity of green.
justGreen = g - r/2 - b/2;
% colorPlanesPlot(r,g,b,justGreen);
 
%%
% close all
 
%% Step 3: Isolate Object of Interest
 
%% 
% Threshold the image
% Now we can set a threshold to separate the parts of the image that we
% consider to be green from the rest.
bw = justGreen > 50;
% imagesc(bw);
% colormap(gray);
 
%%
% Remove small unwanted objects
% We can use special functions provided by the Image Processing toolbox to
% quickly perform common image processing tasks. Here we are using
% BWAREAOPEN to remove groups of pixels less than 30.
ball1 = bwareaopen(bw, 30);
% imagesc(ball1);
 
%% Step 4: Find center of green object
% Now we are using REGIONPROPS to extract the centroid of the group of
% pixels representing the ball.
s  = regionprops(ball1, {'centroid','area'});
if isempty(s)
  error('No ball found!');
else
  [~, id] = max([s.Area]);
  hold on, plot(s(id).Centroid(1),s(id).Centroid(2),'wp','MarkerSize',20,'MarkerFaceColor','r'), hold off
  disp(['Center location is (',num2str(s(id).Centroid(1),4),', ',num2str(s(id).Centroid(2),4),')'])
end
 
%% Step 5: Verify estimated location
% Finally we will plot the center on the original image to clearly evaluate
% how well we have found the center.
imagesc(greenBall1);
hold on, plot(s(id).Centroid(1),s(id).Centroid(2),'wp','MarkerSize',20,'MarkerFaceColor','r'), hold off
 

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

模版匹配定位跟踪源码程序/
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/ImageGUI.fig
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/ImageGUI.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/findBallFcn.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/greenBall1.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/greenBall2.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/greenBall3.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/greenBall4.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/ImageGUI/readme.txt
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/BallDetectionGUI.fig
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/BallDetectionGUI.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/GUIShot.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/Green Object Detection Algorithm_24.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/Green Object Detection App.mlappinstall
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/Green Object Detection App.prj
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/findBallFcn.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/readme.txt
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/WebcamGUI/webcam.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/colorPlanesPlot.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/findBall.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/findBallFcn.m
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/greenBall1.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/greenBall2.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/greenBall3.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/greenBall4.jpg
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall.html
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_01.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_02.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_03.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_04.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_05.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_06.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/html/findBall_07.png
模版匹配定位跟踪源码程序/AlgorithmDevelopmentWithMATLAB/readme.txt

关键词: 源码 目标 程序

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved