Need help to mask the image.
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I need help to mask this attached image. I just want the black background to be white and other image remains the same.
Please guide, thank you.
0 件のコメント
回答 (1 件)
Walter Roberson
2021 年 4 月 9 日
編集済み: Walter Roberson
2021 年 4 月 9 日
img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/578172/untitled.jpg');
grimg = rgb2gray(img);
black = grimg < 10;
background = bwareafilt(black, 1);
grimg(background) = 255;
imshow(img); title('original')
imshow(grimg); title('filtered')
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!