when i display input image using "imagesc", it shows in a different format compared to "imshow"
imagesc(Img,[0 255]); colormap(gray); %code i used
is it possible to save the image i view from imagesc to a variable so that i can use it for further processing

 Réponse acceptée

Walter Roberson
Walter Roberson le 20 Jan 2018

1 vote

Use mat2grey()

4 commentaires

scaled_Img = mat2gray(Img, [0 255]);
Elysi Cochin
Elysi Cochin le 22 Jan 2018
Modifié(e) : Elysi Cochin le 26 Jan 2018
sir, scaled_Img is exactly what i wanted. Is there any way to set the outer portions to white from scaled image (like if more white regions, set the outer pixels also to white). Will something like that work? If so how can i do that portion.
Walter Roberson
Walter Roberson le 22 Jan 2018
Take 255 minus the image. imclearborder. Take 255 minutes that result.
IM2 = 255 - imclearborder( 255 - scaled_Img );

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 20 Jan 2018

0 votes

Try using imwrite() to save your indexed image:
imwrite(Img, filename);

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by