在matlab上遇到问题,尝试在不调整大小的情况下将一半图像变为空白。ATM即时通讯使用该简单代码
im=imread('spinpie.bmp');
n=fix(size(im,1)/2);
A=im(n+1:end,:,:);
imshow(A)
我正在得到这个:
我实际上需要的是这样的东西:
泰
尝试一下:
im=imread('spinpie.bmp');
n=fix(size(im,1)/2);
A = repmat(255,size(im)); %// PreAllocating with white pixels
A(n+1:end,:,:) = im(n+1:end,:,:); %// Assigning only the required pixels to original image
imshow(uint8(A)); %// lastly converting double to uint8 before displaying