how to convert the background(white) of a image to blaclk.
4 ビュー (過去 30 日間)
古いコメントを表示
I obtained a image which is output of my intermediate process.It contains white background and small gray patches(grayscale image).I want the background to be black.Please suggest me a solution.
0 件のコメント
回答 (1 件)
Image Analyst
2012 年 4 月 13 日
You mean like this:
grayPatchGrayLevel = 150; % or whatever it is.
% Turn anything brighter than that to black.
grayImage(grayImage >= (grayPatchGrayLevel +1)) = 0;
Or, if you know for a fact that all your "white" is actually exactly 255, then:
grayImage(grayImage == 255) = 0;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Read, Write, and Modify Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!