엔지니어가 되고 싶은 공돌이

04. Image Display 본문

Computer Science/Image Processing

04. Image Display

Geca 2025. 4. 1. 23:15

 

4. 1. Image Function

 

- Space Resolution: 영상의 크기(Number of Pixels).

 

- Quantization: 하나의 화소를 몇 개의 색으로 표현할 수 있는지.

 

- Quality: 주관적인 문제이며, Space Resolution과 Quantization으로 결정됩니다.

 

 

- image(imread output variable); : Image Array의 값을 현재 Color Map에 맞추어 출력합니다.

 

  c = imread(~); image(c); colorbar(Output a Color Map);

 

- Color Map: 임의의 수를 컬러로 바꿔주는 표.

 

  1) default: 64X3의 컬러 값 / 사용자가 만들 수 도 있고 기존 컬러맵을 호출 할 수 도 있습니다.

 

       colormap gray(247); -> 0 ~ 246 Gray Map을 적용.

 

  2) Indexed Image: [x, map] = imread(‘ filename ‘); image(x); colormap(map); axis off; truesize;

 

       axis off : axis의 Labeling 제거, truesize: image pixel을 screen pixel과 1:1로 매핑.

 

  3) Color Image: 현재의 Color Map을 무시하고, 3차원 배열에 기반하여 Image를 출력합니다.

 


 

4. 2. Imshow Function

 

- [uint8] Binary Image, 0 ~ 255 GrayScale Image, RGB(truecolor) Image 출력.

 

- [double] 0~1 GrayScale Image, RGB(truecolor) Image 출력.

 

  double은 0~1 값에 255를 곱해서 출력하므로, unit8을 double로 바꿀 때는 255로 나누어 주어야 합니다.

 

- 영상처리는 주로 Grayscale을 처리하며 RGB는 각각의 채널에 그냥 적용만 하면 됩니다.

 

- cd = im2double(c): c image matrix를 double로 바꾸는 동시에 0 ~ 1의 값으로 바꿉니다.

 

  double(c)는 double Type으로만 바꾸지, 값을 바꾸지는 않습니다.

 

  im2uint8도 존재합니다.

 

 

- Binary Image를 위한 데이터 타입은 없습니다. 그러므로 double형의 0 1을 사용합니다.

 

- 또는 Logic Operations을 이용해서 기존 영상을 Binary Image로 바꿀 수 있습니다.

 

  c = imread( ~ ); clogic = c > 128; imshow(clogic);

 


 

4. 3. Bit Plane

 

 

- Bit Plane: 8비트 영상을 2진수로 변환했을 때 각 비트에 해당하는 평면.

 

- MSB(Most Significant Bit): 첫 번째 비트로 구성된 평면, 가장 큰 효과.

 

- LSB(Least Significant Bit): 마지막 비트로 구성된 평면, 가장 작은 효과.

 

  c = imread('filename');

 

  cd = double(c);                            <- double Transformation.

 

  c0 = mod(cd, 2);                          <- LSB

 

  c1 = mod(floor(cd/2), 2);

 

  c2 = mod(floor(cd/4), 2); ....

 

  c7 = mod(floor(cd/128), 2);            <- MSB

 

  mod는 remaider Operator, floor는 음의 방향으로 가장 가까운 정수를 구합니다.

 

- LSB는 salt and pepper Noise Removal에 적용될 수 있다.

 


'Computer Science > Image Processing' 카테고리의 다른 글

06. Error Diffusion  (0) 2025.04.08
05. Quantization and Dithering  (0) 2025.04.02
03. Image File and Format  (1) 2025.03.29
02. Image  (0) 2025.03.20
01. Overview of Image Processing  (0) 2025.03.19
Comments