خیر .. اگر به شما گفتن حتما از دستور RESAMPLE استفاده کنید .. همین کدها رو بنویسید فقط به جای دستور imresize از imresample استفاده کنید ..سلام
ممنون از توضیح کامل و دقیق شما
اما من میخواهم resampling را انجام دهم و حتی استادم تاکید کرده که resampling انجام بدم نه resize
بازم میتونم از پاسخ شما استفاده کنم؟
من مثالی از این دستور ندارم .. ولی این عبارات رو از سایت MATHWORK براتون قرار میدم :
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'); |