实现边缘连接和线段拟合源码MATLAB实现源码程序 - matlab算法设计 - 谷速源码
下载频道> 资源分类> matlab源码> 算法设计> 实现边缘连接和线段拟合源码MATLAB实现源码程序

标题:实现边缘连接和线段拟合源码MATLAB实现源码程序
分享到:

所属分类: 算法设计 资源类型:程序源码 文件大小: 12.13 KB 上传时间: 2019-06-16 15:49:28 下载次数: 10 资源积分:1分 提 供 者: zhangsan456 Edgelink_
内容:
实现边缘连接和线段拟合源码MATLAB实现源码程序
% DRAWEDGELIST - plots pixels in edgelists
%
% Usage:      drawedgelist(edgelist, rowscols, randcol, figno)
%
%    edgelist   - Cell array of edgelists in the form
%                     { [r1 c1   [r1 c1   etc }
%                        ...
%                        rN cN]   ....]
%    rowscols -   2 element vector [rows cols] specifying the size of the
%                 image from which edges were detected (used to set size
%                 of plotted image) 
%    randcol    - Optional flag (1/0) to turn on/off random color coding for
%                 each edgelist so that it is easier to see how the edges
%                 have been broken up into separate lists.  Default is 0.
%    figno      - Optional figure number in which to display image.
%
% See also: EDGE , LINESEG
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, subject to the following conditions:
% The above copyright notice and this permission notice shall be included in 
% all copies or substantial portions of the Software.
%
% The Software is provided "as is", without warranty of any kind.
 
% February  2003 - Original version
% September 2004 - Revised and updated
 
function drawedgelist(edgelist, rowscols, randcol, figno)
    
    if nargin == 4
figure(figno);
    end
    
    if nargin == 2
randcol = 0;
    end
    
    Nedge = length(edgelist);
 
    if randcol
colourmp = hsv(Nedge);    % HSV colour map with Nedge entries
colourmp = colourmp(randperm(Nedge),:);  % Random permutation
for I = 1:Nedge
   line(edgelist{I}(:,2), edgelist{I}(:,1),'color',colourmp(I,:));
end
    else
for I = 1:Nedge
   line(edgelist{I}(:,2), edgelist{I}(:,1));
end
    end
 
    % Check whether we need to expand bounds
    
    minx = 1; miny = 1;
    maxx = rowscols(2); maxy = rowscols(1);
    
    for I = 1:Nedge
minx = min(min(edgelist{I}(:,2)),minx);
miny = min(min(edgelist{I}(:,1)),miny);
maxx = max(max(edgelist{I}(:,2)),maxx);
maxy = max(max(edgelist{I}(:,1)),maxy);
    end    
    
    %    axis([1 rowscols(2) 1 rowscols(1)]);
    axis([minx maxx miny maxy]);
    axis('equal'); axis('ij');

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

关键词:

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