• 大小: 203KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-05
  • 语言: 其他
  • 标签: A题  附程序  

资源简介

08年全国大学生数学建模竞赛 A题 优秀获奖论文 附程序 对于数学建模爱好者,是很好的资源哦

资源截图

代码片段和文件信息

% 提取图像边界点的程序
% A、AA图形矩阵(7681024),yuan 边界点的坐标,
function yuan=bianjie
A=imread(‘ph02.bmp‘);
AA=A;
s=size(A);
for i=2:s(1)-1
    for j=2:s(2)-1
        if A(i-1j)==0&A(ij-1)==0&A(i+1j)==0&A(ij+1)==0
            AA(ij)=1;  %将内点赋值为1
        end
    end
end
%提取边界点像素位置作为其坐标
yuan=cell(15);
[mn]=find(AA(140:260280:370)==0);
yuan{1}(:1)=n+280;
yuan{1}(:2)=768-(m+140);

[mn]=find(AA(140:260370:470)==0);
yuan{2}(:1)=n+370;
yuan{2}(:2)=768-(m+140);

[mn]=find(AA(140:260600:680)==0);
yuan{3}(:1)=n+600;
yuan{3}(:2)=768-(m+140);

[mn]=find(AA(460:540540:620)==0);
yuan{4}(:1)=n+540;
yuan{4}(:2)=768-(m+460);

[mn]=find(AA(460:540240:330)==0);
yuan{5}(:1)=n+240;
yuan{5}(:2)=768-(m+460);
%将边界点按逆时针方向排列
for i=1:5
    yuan0=yuan{i};
    m=zeros(18);
    m(1)=min(yuan0(:1));
    m(2)=max(yuan0(find(yuan0(:2)==min(yuan0(:2)))1));
    m(3)=max(yuan0(:1));
    m(4)=min(yuan0(find(yuan0(:2)==max(yuan0(:2)))1));
    m(5)=max(yuan0(find(yuan0(:1)==m(1))2));
    m(6)=min(yuan0(:2));
    m(7)=max(yuan0(find(yuan0(:1)==m(3))2));
    m(8)=max(yuan0(:2));
    k=0;
    s=size(yuan0);
    for j=1:s(1)
        if yuan0(j1)>=m(1)&yuan0(j1)<=m(2)&yuan0(j2)<=m(5)&yuan0(j2)>=m(6)
            k=k+1;
            yuan{i}(k:)=yuan0(j:);
        end
    end

    for j=2:s(1)
        if yuan0(j1)>m(2)&yuan0(j1)<=m(3)&yuan0(j2)<=m(7)&yuan0(j2)>=m(6)&yuan{i}(k1)~=yuan0(j1)
            f1=find(yuan0(:1)==yuan0(j1));
            a=yuan0(f1:);
            f2=find(a(:2)<=m(7));
            b=a(f2:);
            k=k+length(f2);
            yuan{i}(k-length(f2)+1:k:)=b(length(f2):-1:1:);
        end
    end

    for j=s(1)-1:-1:1
        if yuan0(j1)>=m(4)&yuan0(j1)<=m(3)&yuan0(j2)<=m(8)&yuan0(j2)>m(7)&yuan{i}(k1)~=yuan0(j1)
            f1=find(yuan0(:1)==yuan0(j1));
            a=yuan0(f1:);
            f2=find(a(:2)>m(7));
            b=a(f2:);
            k=k+length(f2);
            yuan{i}(k-length(f2)+1:k:)=b(length(f2):-1:1:);
        end
    end
    for j=s(1):-1:1
        if yuan0(j1)>m(1)&yuan0(j1)m(5)
            k=k+1;
            yuan{i}(k:)=yuan0(j:);
        end
    end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2316  2008-09-22 08:28  数码相机定位\程序\bianjie.m

     文件        395  2008-09-22 08:30  数码相机定位\程序\data.mat

     文件      98366  2008-09-19 10:56  数码相机定位\程序\ph02.bmp

     文件       3956  2005-04-13 12:29  数码相机定位\程序\qiexian.m

     目录          0  2009-08-07 21:09  数码相机定位\程序

     文件     755712  2009-08-07 21:08  数码相机定位\论文.doc

     目录          0  2009-08-07 21:09  数码相机定位

----------- ---------  ---------- -----  ----

               860745                    7


评论

共有 条评论

相关资源