• PUDN用户
    了解作者
  • matlab
    开发工具
  • 1.9MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 76
    下载次数
  • 2008-02-01 21:46
    上传日期
kass的经典snake的matlab实现,用于图像边缘检测分割等
traditionSnake(matlab).rar
  • images
  • U64.pgm
    4KB
  • room.pgm
    4KB
  • WS_FTP.LOG
    298B
  • snake
  • rawread.m
    3.2KB
  • snakeinterp1.m
    1.3KB
  • imdisp.m
    252B
  • BoundMirrorExpand.m
    699B
  • gaussianMask.m
    255B
  • snakeinterp.m
    1.6KB
  • snakeindex.m
    190B
  • GVF.m
    1.6KB
  • snakeinit.m
    894B
  • snakedisp.m
    551B
  • BoundMirrorEnsure.m
    916B
  • xconv2.m
    913B
  • rawwrite.m
    1.5KB
  • snakedeform.m
    1.5KB
  • gaussianBlur.m
    500B
  • snakedeform2.m
    1.8KB
  • dt.m
    608B
  • Contents.m
    1.1KB
  • BoundMirrorShrink.m
    488B
  • papers
  • tip.ps
    4MB
  • WS_FTP.LOG
    298B
  • cvpr97.ps
    2MB
  • traditionSnake(matlab)
  • images
  • U64.pgm
    4KB
  • room.pgm
    4KB
  • WS_FTP.LOG
    298B
  • snake
  • rawread.m
    3.2KB
  • snakeinterp1.m
    1.3KB
  • imdisp.m
    252B
  • BoundMirrorExpand.m
    699B
  • gaussianMask.m
    255B
  • snakeinterp.m
    1.6KB
  • snakeindex.m
    190B
  • GVF.m
    1.6KB
  • snakeinit.m
    894B
  • snakedisp.m
    551B
  • BoundMirrorEnsure.m
    916B
  • xconv2.m
    913B
  • rawwrite.m
    1.5KB
  • snakedeform.m
    1.5KB
  • gaussianBlur.m
    500B
  • snakedeform2.m
    1.8KB
  • dt.m
    608B
  • Contents.m
    1.1KB
  • BoundMirrorShrink.m
    488B
  • examples
  • tradition_ex.m
    2.1KB
  • papers
  • tip.ps
    4MB
  • WS_FTP.LOG
    298B
  • cvpr97.ps
    2MB
  • tradition_ex.m
    2.1KB
  • www.pudn.com.txt
    218B
内容介绍
function [X,map] = rawread(filename,n,m); % RAWREAD Read a Portable Bitmap file, or a raw file. % RAWREAD('imagefile.raw', xsize, ysize) reads a "raw" image file % RAWREAD('imagefile.pgm') reads a "pgm" (portable gray map) image % [X,map] = RAWREAD('imagefile.raw') returns both the image and a % color map, so that % [X,map] = rawread('imagefile.raw',sx,sy); % or [X,map] = rawread('imagefile.pgm'); % image(X) % colormap(map) % will display the result with the proper colors. % % NOTE : map is optional and could be replaced during the display by % the "colormap('gray')" command % % See also IMWRITE, IMREAD, IMAGE, COLORMAP. dot = max(find(filename == '.')); suffix = filename(dot+1:dot+3); if strcmp(suffix,'pgm') | strcmp(suffix,'raw') disp(sprintf('\nopens %s file\n',filename)); fp = fopen(filename,'rb','b'); % "Big-endian" byte order. if (fp<0) error(['Cannot open ' filename '.']); end if strcmp(suffix,'pgm') % Read and crack the header head = fread(fp,2,'uchar'); % pgm magic number : P5 if ~strcmp(head,'P5'), fprintf(1,'\n Magic Number : %s\n',head); else fprintf(1,'\n Bad Magic Number : %s\n',head); error('cannot continue this way, good bye cruel world'); end c = fread(fp,1,'uchar'); %reads the carriage return separating P5 from the creator precreator = fread(fp,1,'uchar'); % look for a '#' character preceeding a creator signature if precreator == '#', c = setstr(20); % any character except carriage return cr = setstr(10); % defines a carriage return while c ~= cr, c = fread(fp,1,'uchar'); creator = [creator,c]; end; fprintf(1,'\n creator : %s\n',creator); else fprintf('\n No creator signature\n'); fseek(fp,-1,'cof'); % return one char before end; end if nargin <2, if strcmp(suffix,'raw') % assume image size is 256x256 disp('RAW file without size : assume image size is 256x256'); n = 256; m = 256; else % for PGM files % reads the size and depth disp(' reads sizes'); n = fscanf(fp,'%d',1); tn = num2str(n); disp([' xsize = ' tn]); m = fscanf(fp,'%d',1); tm = num2str(m); disp([' ysize = ' tm]); p = fscanf(fp,'%d',1); tp = num2str(p); disp([' depth = ' tp]); c = fread(fp,1,'uchar'); %reads the last carriage return end; end % Creates a gray palette and scale it to [0,1]. disp(' create gray palette'); for i=1:256, map(i,[1:3])=[i/256,i/256,i/256]; end; % Read the image disp(' Reads image data ...'); [X,l] = fread(fp,[n,m],'uchar'); if l ~= m*n, l, error('HSI image file is wrong length'), end % Image elements are colormap indices, so start at 1. X = X'+1; fclose(fp); disp('end'); else error('Image file name must end in ''raw'' or ''pgm''.') end
评论
    相关推荐
    • snake.rar
      matlab编写得snake算法程序,可用于图像分割和边缘检测
    • snake-.rar
      用于图像分割及边缘检测,它的算法是蛇形算法,效果明显
    • Snake2D.m.tar.gz
      snake模型算法 matlab源程序 主动轮廓线模型是一个自顶向下定位图像特征的机制,用户或其他自动处理过程通过事先在感兴趣目标附近放置一个初始轮廓线,在内部能量(内力)和外部能量(外力)的作用下变形外部能量...
    • snake.rar
      实现snake分割 通过snake方法 对图像边缘进行提取
    • matlab代码做游戏-CV:简历
      matlab代码做游戏奇安 +49 15258388092 | | 教育 柏林工业大学(预计2019年4月-2021年11月,柏林进行中) ...坎尼边缘检测 霍夫变换 模板匹配 k均值分割 学习了Tensorflow并实现了几种机器学习模型 卷积神经网络的
    • MATLAB图像处理GVF算法
      利用GVF算法实现对医学图像的分割,十分有用处
    • 手工画边缘matlab程序
      手工画边缘matlab程序,手工画点,程序自动连线平滑
    • 带类的蛇:使用类实现蛇以在图像上自动显示蛇。-matlab开发
      函数“snakeminimize”修改蛇以将其移动到较低能量的配置,这通常对应于蛇跟随图像中的边缘。 当分号离开返回此类的对象的语句时,蛇将自动绘制在当前图形窗口中的图像顶部。 `snakeminimize` 非常通用,因为它...
    • GVFSnake(matlab)边缘检测图像分割
      利用GVFSnake算法实现灰度图像边缘检测图像分割
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载