フィルターのクリア

How do I separate the white pixel data from binary image?

1 回表示 (過去 30 日間)
Ritwik Dhar
Ritwik Dhar 2019 年 7 月 23 日
コメント済み: mohd akmal masud 2019 年 7 月 30 日
Basically, I applied thresholding using Otsu's method and it gave me the below image.
I want to separate the white pixel data from this binary image and convert it back to the rgb image for further use.
How do I separate the white pixels?
otsu.PNG
  3 件のコメント
Ritwik Dhar
Ritwik Dhar 2019 年 7 月 24 日
Sorry for that..
mohd akmal masud
mohd akmal masud 2019 年 7 月 30 日
i think the question is how to calculate the no of pixel of white? if im not wrong

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

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 24 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 24 日
I want to separate the white pixel data from this binary image and convert it back to the rgb image for further use.
What I undestood (and certainly sure), you want to mask the binary image on RGB Image. No need to ectract the white pixels from Binary Image (just index position of white pixels is sufficient). You can directly apply it on RGB Image. In the following example, forced the pixels to those in RGB Image, where mask (Binary Image) represents as white pixels.
RGBImage=imread('image_test.jpg'); % This RGB Image
subplot(131),imshow(RGBImage),title('RGB Image');
grayImage=rgb2gray(RGBImage);
bwImage=im2bw(grayImage,0.7); % This is your Result of Otshu Thresholding
subplot(132),imshow(bwImage),title('Binary Image-Mask');
% Apply the Mask (Binary Image) on RGB
mask=cat(3,bwImage, bwImage,bwImage);
% Force all those pixels to Black, where white pixels represent in Binary Image
RGBImage(mask)=0;
subplot(133),imshow(RGBImage),title('RGB with Black White Mask Area');
test_im.png
Hope it helps!
  2 件のコメント
Ritwik Dhar
Ritwik Dhar 2019 年 7 月 24 日
Oh thanks..
That's what I wanted..
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 24 日
You are welcome @Ritwik. Most parts: I am learning on Image+Matlab tricks from @ImageAnalyst sir.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by