How do I change image background to red
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Kirti
il 18 Feb 2014
Commentato: Image Analyst
il 20 Set 2018
I have an image with black background, which I got from imfreehand function. I want to change that black background to red. Following is link for image.
0 Commenti
Risposta accettata
Image Analyst
il 18 Feb 2014
background = grayImage == 0; % Find black pixels.
redChannel = grayImage;
redChannel(background) = 255; % Set black pixels to max value.
% Create true color image.
rgbImage = cat(3, redChannel, grayImage, grayImage);
imshow(rgbImage); % Display it.
5 Commenti
Image Analyst
il 20 Feb 2014
numberOfBackgroundPixels = sum(background(:)); % Red/white pixels in background.
numberOfROIPixels = numel(background) - numberOfBackgroundPixels;
Più risposte (2)
Ravi Shekhar
il 29 Mar 2018
Hi, you can use following MATLAB code to change the color scheme of a gray image.
gray_image = imread('cameraman.tif');
map = colormap('autumn');
rgb_image = ind2rgb(gray_image,map);
You can get different color schemes under 'colormap' function in MATLAB.
0 Commenti
hf fh
il 19 Set 2018
Please help me I have an image and I want to make the background color white I used the previous method but did not good out with me
5 Commenti
hf fh
il 20 Set 2018
To make sure there is no noise in the image and also make sure the edges of the image
Image Analyst
il 20 Set 2018
Making the surround white does not make sure there is no noise in the image. And you didn't finish the second part of the sentence about making sure the edges.....are what?
Vedere anche
Categorie
Scopri di più su Red in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!