필터 지우기
필터 지우기

please i need a help.. how to remove the darkest handwritten text (black and red) from this image? just the text?

조회 수: 1 (최근 30일)

답변 (2개)

Walter Roberson
Walter Roberson 2016년 10월 24일
somethreshold = 11; %found by examining the image RGB values
mask = YourImage(:,:,3) > somethreshold;
NewImage = YourImage .* cast(mask(:,:,[1 1 1]), class(YourImage));
%And to view it,
image(NewImage, 'AlphaData', double(mask))
Only the darkest text is removed.
  댓글 수: 4
Walter Roberson
Walter Roberson 2016년 10월 24일
No, it relies upon the blue channel being low for both black and red text. You asked to remove the dark black and dark red from the image, which implies you want to leave dark green or dark blue alone, but when you convert to grayscale you cannot distinguish original source colors.
Given your other questions, I suspect that what you are looking for with regards to grayscale is:
mask = YourGrayImage >= lowerbound & YourGrayImage <= upperbound
for some lowerbound and upperbound; this would be for extracting portions that are not too dark and not too bright. Then
NewImage = YourGrayImage .* cast(mask, class(YourImage));
%And to view it,
image(NewImage, 'AlphaData', double(mask))
Walter Roberson
Walter Roberson 2016년 10월 25일
There is no white colored text.
Notice the "And to view it" portion. The image is being displayed with transparency for the pixels that are not selected. You are seeing the white of the background showing through. The image itself has been set to black at all other locations. The locations that are selected (the ROI, region of interest) are the ones where mask is true.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 10월 25일
Try imtophat() or imbothat() to do a morphological filter.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by