图像边缘检测和特征提取实验报告

  • 虫虫123456
    了解作者
  • matlab
    开发工具
  • 3.8MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 5 积分
    下载积分
  • 0
    下载次数
  • 2022-06-27 15:44
    上传日期
图像边缘检测和特征提取实验报告。图像边缘检测和特征提取实验报告
边缘检测特征提取.rar
  • 边缘检测特征提取
  • Pictures
  • 22_m03.tif
    1.2MB
  • apple.jpg
    13.7KB
  • 10_m02.tif
    1.2MB
  • 5_m01.tif
    1.2MB
  • 4_m03.tif
    1.2MB
  • 实验效果图
  • EdgeDetection (3).JPG
    95.3KB
  • MatlabEdge.jpg
    75.1KB
  • EdgeDetection (2).JPG
    101.4KB
  • EdgeDetection (1).jpg
    79.9KB
  • EdgeDetection (4).JPG
    85.6KB
  • CharacterExtracting.jpg
    91.2KB
  • ApplePerimeter.jpg
    27.8KB
  • CharacterExtracting.m
    527B
  • MatlabEdge.m
    582B
  • EdgeDetection.m
    2.9KB
  • ApplePerimeter.m
    667B
  • ~$边缘检测和特征提取实验报告.doc
    162B
内容介绍
clc; close all; clear all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %读入图像 f=imread('Pictures/4_m03.tif'); %f=imread('Pictures/5_m01.tif'); %f=imread('Pictures/10_m02.tif'); %f=imread('Pictures/22_m03.tif'); f=imresize(f,0.25); f=im2double(f); [m,n]=size(f); subplot(2,3,1),imshow(f); title('原始图像'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %生成高斯平滑滤波模板 hg=zeros(3,3); %设定模板大小3*3 delta=0.5; for x=1:1:3 for y=1:1:3 u=x-2; v=y-2; hg(x,y)=exp(-(u^2+v^2)/(2*pi*delta^2)); end end h=hg/sum(hg(:)); %高斯滤波 ftemp=zeros(m,n); rowhigh=m-1; colhigh=n-1; for x=2:1:rowhigh-1 for y=2:1:colhigh-1 mod=[f(x-1,y-1) f(x-1,y) f(x-1,y+1); f(x,y-1) f(x,y) f(x,y+1);f(x+1,y-1) f(x+1,y) f(x+1,y+1)]; A=h.*mod; ftemp(x,y)=sum(A(:)); end end f=ftemp; subplot(2,3,4),imshow(f); title('高斯滤波后的图像'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %利用Sobel算子进行边缘检测 sx=[-1 0 1;-2 0 2;-1 0 1]; sy=[-1 -2 -1;0 0 0;1 2 1]; for x=2:1:rowhigh-1 for y=2:1:colhigh-1 mod=[f(x-1,y-1) f(x-1,y) f(x-1,y+1); f(x,y-1) f(x,y) f(x,y+1);f(x+1,y-1) f(x+1,y) f(x+1,y+1)]; fsx=sx.*mod; fsy=sy.*mod; ftemp(x,y)=max((abs(sum(fsx(:)))),(abs(sum(fsy(:))))); end end fs=im2uint8(ftemp); subplot(2,3,2),imshow(fs); title('Sobel算子进行边缘检测的原始图像'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %阈值分割 TH1=140; %设定阈值 for x=2:1:rowhigh-1 for y=2:1:colhigh-1 if (fs(x,y)>=TH1)&((fs(x,y-1) <= fs(x,y)) & (fs(x,y) > fs(x,y+1)) ) fs(x,y)=200; elseif(fs(x,y)>=TH1)&( (fs(x-1,y) <=fs(x,y)) & (fs(x,y) >fs(x+1,y))) fs(x,y)=200; else fs(x,y)=50; end end end subplot(2,3,5),imshow(fs); title('Sobel算子边缘检测并细化后的图像'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %利用Prewitt算子进行边缘检测 sx=[1 0 -1;1 0 -1;1 0 -1]; sy=[-1 -1 -1;0 0 0;1 1 1]; for x=2:1:rowhigh-1 for y=2:1:colhigh-1 mod=[f(x-1,y-1) f(x-1,y) f(x-1,y+1); f(x,y-1) f(x,y) f(x,y+1);f(x+1,y-1) f(x+1,y) f(x+1,y+1)]; fsx=sx.*mod; fsy=sy.*mod; ftemp(x,y)=max((abs(sum(fsx(:)))),(abs(sum(fsy(:))))); end end fs=im2uint8(ftemp); subplot(2,3,3),imshow(fs); title('Prewitt算子进行边缘检测的原始图像'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %阈值分割 TH1=100; %设定阈值 for x=2:1:rowhigh-1 for y=2:1:colhigh-1 if (fs(x,y)>=TH1)&((fs(x,y-1) <= fs(x,y)) & (fs(x,y) > fs(x,y+1)) ) fs(x,y)=200; elseif(fs(x,y)>=TH1)&( (fs(x-1,y) <=fs(x,y)) & (fs(x,y) >fs(x+1,y))) fs(x,y)=200; else fs(x,y)=50; end end end subplot(2,3,6),imshow(fs); title('Prewitt算子边缘检测并细化后的图像');
评论
    相关推荐
    • FPGA的图像边缘检测
      FPGA的图像边缘检测。。。。。。。。。。。。。。
    • sar图像边缘提取的一种算法
      sar图像边缘提取的一种算法sar图像边缘提取的一种算法
    • 图像边缘检测
      基于opencv的图像边缘检测,适合新人
    • 图像边缘提取
      c#彩色图像边缘提取
    • 图像边缘检测
      图像边缘检测 描述>=20个字符,不支持HTML标签。 详细的资源描述有机会获得我们的推荐,更有利于他人下载,赚取更多积分。
    • 图像边缘探测
      vb.net版图像边缘探测算法代码,包含Roberts算子、Robinsou算子、Kirsch算子、prewitt算子、拉普拉斯算子1、拉普拉斯算子2、右下边缘抽出等。
    • 图像边缘检测.zip
      关于图像处理的边缘检测算法,通过三种算反对比运算,蚁群算法,蒙特卡洛算法,程序点击运行按钮直接运行
    • 图像边缘提取
      图像边缘提取算法有很多。这里给出prewitte算子进行边缘检测的代码。
    • 图像边缘提取
      一个可以提取bmp,jpg图像边缘特征的demo,提供多种提取算法
    • libiconv-1.1.tar.gz
      字符集转换程序