convert grayscale to rgb
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
evangeline
am 22 Jan. 2014
Beantwortet: DGM
am 19 Apr. 2022
I want to convert a grayscale image to rgb, but I don't want to use the gray2rgb command, I know that the input matrix is 2D, but the output image should be 3D, but I just don't know how to do it.. I dont know how to map the 2D matrix values to 3D matrix values...
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 22 Jan. 2014
rgbimage = grayimage(:,:,[1 1 1]);
3 Kommentare
Walter Roberson
am 22 Jan. 2014
grayslice (second form, supplying a vector of values), followed by ind2rgb() to do the conversion to an RGB image.
Weitere Antworten (1)
DGM
am 19 Apr. 2022
Depending on what the goals are, there are various ways to interpret the question. The following link includes demonstrations of converting a single-channel image to a 3-channel image via:
- channel replication (like above)
- channel filling/deletion and potential hue adjustment
- uniform and nonuniform colorization methods
- color mapping
I imagine most needs are met with replication or colormapping, but I like generalizable answers to be somewhat comprehensive.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!