【发布时间】:2014-02-18 03:09:33
【问题描述】:
我想以原始尺寸保存彩色图像(这里是 146 x 220 像素),但是通过这种方法,图像将保存在 1200 x 897 中,包括额外的边距。实际上图像会以更大的尺寸保存。我想将它完全保存在 146 x 220 像素中。因为我想将其像素与原始图像一一比较。如果我获得额外的像素比较活动对我来说将是有问题的。 提前感谢您的关注。
function []=doCmeans (imInput)
H = single(imInput(:));% original image is gray scale
nRegions = 5;
options = [2 100 1e-5 0];
[Center, U, obj_fun] = fcm (H,nRegions,options);
maxU = max(U);
for i = 1:nRegions
tmpindex = find (U(i,1))==maxU;
H (tmpindex)= i;
end
[r c]=size (imInput);
imFClass = reshape (H, r,c);
colormap(hsv(5));
h = figure('visible', 'off'); imshow(imFClass,[]);
print(h,'-djpeg',sprintf('ImFuzzy.jpg'));
end
【问题讨论】:
标签: matlab