LabHints5

# LabHints5 - Lab Exercise Hints(Worksheet 5: MATLAB...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lab Exercise Hints (Worksheet 5): MATLAB Graphics Image and Video Formats MATLAB Graphics Image and Video Formats 1. Dithering can be implemented as follows: Load the image im = imread('lena.bmp'); Input the dithering matrix di = [0 8 2 10; 12 4 14 6; 3 11 1 9; 15 7 13 5]; Obtain image size [m n] = size(im) Repeat the matrix to same size mat = repmat(di, m/4, n/4); Map intensity to 0—16 im = im / 17; Set 1 when entry has im > mat dithered = im > mat; Show the dithered image imshow(dithered); 2. Basically follow the instructions. To load GIF image with colour map, use [im cm] = imread('parrots.gif'); where im holds indexes while cm holds colour map. To negate the image, keep the index while change cm to 255 ­cm: >> cm=1 ­cm; >> imshow(im, cm); 3. Most conversions are directly supported by MATLAB. RGB to CMYK can be implemented following the formulae in the lecture notes. 4. As described in the lectures, 4:2:2, 4:1:1 chroma subsampling can be implemented with imresize using nearest neighbour interpolation while 4:2:0 can be implemented with imresize using bilinear interpolation. 5 ­7. Follow instructions in the lab sheet. 1 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online