MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB图像处理] 分裂合并法图像分割的问题 (https://www.labfans.com/bbs/showthread.php?t=12899)

ylji 2011-03-08 17:44

分裂合并法图像分割的问题
 
我有一个分裂合并法图像分割的程序但是只能分解128*128的图像,各个大侠帮我改一下变成能分割其他的图像;
I=imread('D:\aa.jpg');%%%只能分割128*128的图像%%%
J=rgb2gray(I);
S = qtdecomp(J,.1);
blocks = repmat(uint8(0),size(S));

for dim = [512 256 128 64 32 16 8 4 2 1];
numblocks = length(find(S==dim));
if (numblocks > 0)
values = repmat(uint8(1),[dim dim numblocks]);%%产生多为数组%%%
values(2:dim,2:dim,:) = 0;
blocks = qtsetblk(blocks,S,dim,values);
end
end
blocks(end,1:end) = 1;
blocks(1:end,end) = 1;

imshow(I), figure, imshow(blocks,[])


所有时间均为北京时间。现在的时间是 11:35

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.