How to remove the Alpha channel?

9 ビュー (過去 30 日間)
ramin bba
ramin bba 2014 年 8 月 8 日
コメント済み: ramin bba 2014 年 8 月 8 日
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

採用された回答

Image Analyst
Image Analyst 2014 年 8 月 8 日
binaryImage = m(:,:,2) < 128;
  1 件のコメント
ramin bba
ramin bba 2014 年 8 月 8 日
So efficient! Would you mind elaborating a bit on the method (why did you choose 2)?
tnx

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by