文件名称:image resampling
- 所属分类:
- matlab例程
- 资源属性:
- [Matlab] [源码]
- 上传时间:
- 2010-09-10
- 文件大小:
- 1.67kb
- 下载次数:
- 0次
- 提 供 者:
- whitewalter
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
%This is a simple function that resamples the image
%at a different pixel size
function nimg = imresample(oldpixsize,img,newpixsize,intmethod)
% This function resamples the images at the new grid points
% defined by the new pixel sizes. It assumes that intensities are
% defined at pixel centers
%
% img : original image to be resampled
% nimg : newly sampled image
% oldpixsize : a vector of the form [xpixsize, ypixsize]
% for the original image, e.g., [0.5,0.5]
% newpixsize : is a vector of the form [xpixsize, ypixsize]
% for the new image, e.g., [0.2,0.2]
% intmethod: same as interp2
% 'nearest' - nearest neighbor
% 'linear' - bilinear
% 'cubic' - bicubic
% 'spline' - spline
% Example:
%
% % Create a 2D gaussian function
% H = fspecial('gaussian',[31,31],5);
% % Resample it at a smaller pixel size
% NH = imresample([1,1],H,[0.2,0.2],'spline');
% figure;subplot(211);imshow(H,[]);title('Original');
% subplot(212);imshow(NH,[]);
% title('Resampled using spline interplolation');
%at a different pixel size
function nimg = imresample(oldpixsize,img,newpixsize,intmethod)
% This function resamples the images at the new grid points
% defined by the new pixel sizes. It assumes that intensities are
% defined at pixel centers
%
% img : original image to be resampled
% nimg : newly sampled image
% oldpixsize : a vector of the form [xpixsize, ypixsize]
% for the original image, e.g., [0.5,0.5]
% newpixsize : is a vector of the form [xpixsize, ypixsize]
% for the new image, e.g., [0.2,0.2]
% intmethod: same as interp2
% 'nearest' - nearest neighbor
% 'linear' - bilinear
% 'cubic' - bicubic
% 'spline' - spline
% Example:
%
% % Create a 2D gaussian function
% H = fspecial('gaussian',[31,31],5);
% % Resample it at a smaller pixel size
% NH = imresample([1,1],H,[0.2,0.2],'spline');
% figure;subplot(211);imshow(H,[]);title('Original');
% subplot(212);imshow(NH,[]);
% title('Resampled using spline interplolation');
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : imresample.zip 列表 imresample.m license.txt