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);
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);
'[old 정리중] study > vision' 카테고리의 다른 글
[펌] OpenCV 를 이용한 템플릿 매칭(Template Matching) + 소스 포함 (0) | 2011.12.13 |
---|---|
필터를 사용하는 영상처리 (image processing using filter) (0) | 2011.08.03 |
uint8 -matlab , gray image를 저장하는 변수 생성 (0) | 2011.06.23 |
normxcorr2 - matlab , NCC (normalized cross correlation) (1) | 2011.06.22 |
imread - matlab , color image 불러오기 (3) | 2011.06.22 |