フィルターのクリア

How can i convert YCBCR image to binary image.

1 回表示 (過去 30 日間)
Sarmad Paracha
Sarmad Paracha 2018 年 10 月 28 日
コメント済み: Image Analyst 2018 年 10 月 30 日
I am making a project using image processing and i need to convert the rgb image to YCBCR and then convert it to binary image.

採用された回答

Image Analyst
Image Analyst 2018 年 10 月 28 日
There are functions rgb2ycbcr() and imbinarize().
If those don't work, read this link and write back.
  7 件のコメント
Sarmad Paracha
Sarmad Paracha 2018 年 10 月 30 日
I dont think it is a issue with software it is just the code. I used the image from the examples and binirized it without changing its colour space and it runs
I = imread('coins.png');
subplot(1,3,1);
imshow(I)
title('Original Image')
BW = imbinarize(I);
subplot(1,3,2);
imshow(BW)
title('Binary Image')
BW2 = imfill(BW,'holes');
subplot(1,3,3);
imshow(BW2)
title('Filled Image')
Image Analyst
Image Analyst 2018 年 10 月 30 日
imbinarize() works with gray scale images. "coins.png" is a gray scale image while "1.tif" is NOT.
Note how you tried to binarize YCBCR, a multiband image, while I did not. I binarized just the Y, Cb, or Cr channels alone, which are grayscale. That is why your code did not work while mine did.

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

その他の回答 (0 件)

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by