to display an 8bit image
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ash fairy
am 18 Jun. 2017
Beantwortet: Image Analyst
am 18 Jun. 2017
i have an 8 bit image which is green in colour.... whenever m loading, the color appears as grey...how do i convert it and display as its true green color??
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 18 Jun. 2017
If you want to zero out the red and blue channels of your RGB image, you can do this:
rgbImage(:, :, [1, 3]) = 0;
imshow(rgbImage);
The reason that it was appearing gray is that the red and blue channels are the same as the green channel. Zeroing them out will make it look green.
Alternatively you can extract the green channel and apply a colormap.
rgbImage = imread('peppers.png'); % Sample image.
greenChannel = rgbImage(:, :, 2); % Extract green channel
z = zeros(256, 1);
ramp = (0:255)' / 255;
cmap = [z, ramp, z];
colormap(cmap);
colorbar;
imshow(greenChannel, cmap);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Red 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!