Azzera filtri
Azzera filtri

How to remove the Alpha channel?

15 visualizzazioni (ultimi 30 giorni)
ramin bba
ramin bba il 8 Ago 2014
Commentato: ramin bba il 8 Ago 2014
I have created an image via PowerPoint using only black and white colors and saved it as a ".tif" file. I want to convert it to an actual binary image in MATLAB but have a problem (the histogram of the intensity is not only 0 and 255 and has some pixels with intensity close to either 0 or 255).
When I open this image in MATLAB (using imread), the image size is m*m*4. I have previously opened such files (not created via PowerPoint though) but the size was m*m*3. How can I convert the m*m*4 image to a m*m*3 one? I think the added number is due to "alpha channel" but do not know how to remove it.
tnx in advance

Risposta accettata

Image Analyst
Image Analyst il 8 Ago 2014
binaryImage = m(:,:,2) < 128;
  1 Commento
ramin bba
ramin bba il 8 Ago 2014
So efficient! Would you mind elaborating a bit on the method (why did you choose 2)?
tnx

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by