• 大小: 80KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-26
  • 语言: 其他
  • 标签: 霍夫变换  

资源简介

霍夫变换检测圆和直线 数字图像处理的课程设计 直接使用 非常方便

资源截图

代码片段和文件信息

% clear all; close all; clc;
function [ncirst]=circle_product
ncir=ones(300300);
[mn]=size(ncir);
center=[0 0];%x=(b-a)*r + a
center(1)=round(((0.6-0.5)*rand+0.5)*m);%y
center(2)=round(((0.6-0.5)*rand+0.5)*n);%x
ol=ones(15);ol(1)=abs(center(1)-1);ol(2)=abs(center(1)-m);ol(3)=abs(center(2)-1);ol(4)=abs(center(2)-n);
for i=1:1:4
    if ol(i)<=ol(i+1)
        ol(5)=ol(i);
        ol(i)=ol(i+1);
        ol(i+1)=ol(5);
    end
    ol(5)=ol(i+1);
end
r=round(ol(5)*(3/4));
for k1=1:1:m
    for k2=1:1:n
       xxx=k2-1;yyy=m+1-k1;
       if abs(((xxx-center(2))*(xxx-center(2))+(yyy-center(1))*(yyy-center(1)))-r*r)<=101
           ncir(k1k2)=0;
       end
    end
end
imwrite(ncir‘circle.bmp‘‘bmp‘);
i2=imread(‘circle.bmp‘);
    figure;
    imshow(i2);
    st=[center(2)center(1)r]

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-12-25 12:20  霍夫变换检测形状\
     文件         818  2011-12-20 14:14  霍夫变换检测形状\circle_product.asv
     文件         818  2011-12-20 14:14  霍夫变换检测形状\circle_product.m
     文件        2551  2011-12-20 13:59  霍夫变换检测形状\circle_try.m
     文件        2614  2011-12-20 14:29  霍夫变换检测形状\circle_try_hu.asv
     文件        2614  2011-12-20 14:30  霍夫变换检测形状\circle_try_hu.m
     文件         294  2007-11-19 19:53  霍夫变换检测形状\gather_point.m
     文件        1739  2011-12-20 14:12  霍夫变换检测形状\machZ_try.m
     文件         256  2007-11-17 00:33  霍夫变换检测形状\pll.m
     文件       41462  2011-12-20 14:05  霍夫变换检测形状\sample.bmp
     文件         511  2007-11-20 22:49  霍夫变换检测形状\the_max1.m
     目录           0  2011-12-25 12:20  霍夫变换检测形状\实验报告\
     文件      139264  2011-12-20 15:37  霍夫变换检测形状\实验报告\实验设计报告.doc
     文件      325078  2011-12-22 11:50  霍夫变换检测形状\找出的圆.bmp
     文件      325078  2011-12-22 11:51  霍夫变换检测形状\找出的直线.bmp
     文件          60  2007-11-20 21:54  霍夫变换检测形状\新建 文本文档.txt

评论

共有 条评论