Presentation is loading. Please wait.

Presentation is loading. Please wait.

Images In Matlab.

Similar presentations


Presentation on theme: "Images In Matlab."— Presentation transcript:

1 Images In Matlab

2 Colour Images Digital images are represented as a matrix of numbers.
The matrix has three pages, one for red, one for green and one for blue. Each red, green or blue value goes from 0 to 1, where 0 is off, 0.5 is on half-way, and 1 is on all the way. Combining red, green, and blue values in different proportions yields different colours. 1 0.5 0.25 0.75 0.1 0.9 0.4 1 0.5 0.25 0.75 0.1 0.9 0.4 1 0.5 0.25 0.75 0.1 0.9 0.4

3 Colour Images 1,0,0 0,1,0 0,0,1 Puts red, green and blue values on separate pages.

4 Colour Images 1,0,1 1,1,0 0,1,1

5 Grayscale Images 0.25 Grayscale images have the same values on all three pages. 0.75 1

6 Reading in Images From Files

7 Reading in Images From Files

8 Reading in Images From Files
Images read in from files have R,G,B values that go from 0 to 255 and are of class uint8 (i.e. unsigned 8-bit integer). =0×27 + 0×26 + 0×25 + 0× ×23 + 1×22 + 0×21 + 0×20 = = 12

9 Colour maps Index Red Green Blue 1 2 3 4 Instead of specifying the R,G,B value at each pixel, you can make a look-up table that contains different colours and then your image only has to contain references to the look- up table. This is a good way to save space and send images more quickly. 1 2 3 4

10 Colour maps Converts to unsigned 8-bit integers.

11 Colour maps

12 Colour maps

13 Colour maps

14 Colour maps Matlab has several built-in colour maps:
parula - Blue-green-orange-yellow color map hsv - Hue-saturation-value color map. hot - Black-red-yellow-white color map. gray - Linear gray-scale color map. bone - Gray-scale with tinge of blue color map. copper - Linear copper-tone color map. pink - Pastel shades of pink color map. white - All white color map. flag - Alternating red, white, blue, and black color map. lines - Color map with the line colors. colorcube - Enhanced color-cube color map. vga - Windows colormap for 16 colors. jet - Variant of HSV. prism - Prism color map. cool - Shades of cyan and magenta color map. autumn - Shades of red and yellow color map. spring - Shades of magenta and yellow color map. winter - Shades of blue and green color map. summer - Shades of green and yellow color map.

15 Scaled Images Indicates that we want to scale the image.

16 Scaled Images

17 Scaled Images

18 Writing Images to Files
MyImage.jpg Image matrix File name Image format

19 Writing Images to Files
MyMappedImage.tif Colour map


Download ppt "Images In Matlab."

Similar presentations


Ads by Google