Filter löschen
Filter löschen

What is an indexed image?

4 Ansichten (letzte 30 Tage)
Nathan L
Nathan L am 8 Jun. 2016
Bearbeitet: Stephen23 am 8 Jun. 2016
What is indexed image and what does map do with indexed image?

Akzeptierte Antwort

Stephen23
Stephen23 am 8 Jun. 2016
Bearbeitet: Stephen23 am 8 Jun. 2016
There are very good and thorough explanations online:
In a nutshell: imagine that you have an image with just two colors, blue and red. Encoding this simple image in a way that can represent every possible RGB color would be totally unnecessary and a waste of memory... so instead you can simply index the colors by defining a map of colors (which defines as many colors as the image has):
map = [
0,0,1; % blue;
1,0,0; % red
]
And then the image matrix consists simply of indices into this map:
img =
1,2,1,2
1,2,2,1
1,1,2,2
So every 2 in the image matrix uses the color specified by the second row of the map, etc.. So you can recreate the the pixel colors of the image:
blue,red,blue,red
blue,red,red,blue
blue,blue,red,red
For a limited set of colors this method can take up a lot less memory than specifying the complete RGB for every pixel. Usually the order of the index is arbitrary, but specific to that image. Read the documentation for a more detailed explanation with lots of examples!

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by