我想將原始尺寸的彩色圖像保存爲原始尺寸(這裏是146×220像素),但通過這種方法,圖像將被保存在1200×897中,包括額外的邊緣。實際上,圖像將以較大的尺寸保存。我想把它保存在146×220像素。因爲我想將它的像素與原始圖像逐一比較。如果我獲得額外的像素比較活動將是我的問題。 非常感謝您的關注。在matlab中以實際尺寸保存圖像
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
非常感謝。正是我只想要數字的內容。它比我期望的更完美。你做了很大的幫助...... – user3313281