내가 3 개 채널 matlab에 - 인덱스 매트릭스 크기 오류
img = imread('canoe.tif'); % Read image
red = img(:,:,1); % Red channel
green = img(:,:,2); % Green channel
blue = img(:,:,3); % Blue channel
a = zeros(size(img, 1), size(img, 2));
just_red = cat(3, red, a, a);
just_green = cat(3, a, green, a);
just_blue = cat(3, a, a, blue);
back_to_original_img = cat(3, red, green, blue);
figure, imshow(img), title('Original image')
figure, imshow(just_red), title('Red channel')
figure, imshow(just_green), title('Green channel')
figure, imshow(just_blue), title('Blue channel')
figure, imshow(back_to_original_img), title('Back to original image')
로 이미지를 분할하려고 초과 오류가 세 번째 줄에 온다. 일반적으로이 예외는 배열과 유사합니다. 왜 여기서 일어날까요? 두 번째 줄에 오류가 표시되지 않는 이유는 무엇입니까?
내 답변이 문제를 해결하는 데 도움이 되었다면 동의하십시오. 감사! –