3차원 배열의 크기를 가지는 RGB (color) image 를
2차원 배열의 크기를 가지는 gray image 로 변환한다.

ex)

peppers_rgb=imread(peppers.png');    % peppers_rgb -> 384x512x3 크기를 가지는 3차원 배열
peppers_gray=rgb2gray(peppers_rgb);    % peppers_gray -> 384x512    크기를 가지는 2차원 배열
figure
subplot(2,1,1); imshow(peppers_rgb);
subplot(2,1,2); imshow(peppers_gray);

+ Recent posts