how to convert the background(white) of a image to blaclk.
조회 수: 5 (최근 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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!