필터 지우기
필터 지우기

How to remove other color line in graph ?

조회 수: 7 (최근 30일)
Jenifer NG
Jenifer NG 2022년 8월 10일
편집: Jenifer NG 2022년 8월 16일
Dear All,
I am going to find the way to remove other color line in a image
I try to use threshold but it is not working.
for example this figure bellow. I want to remove red line and keep blue line
Could anyone help me ?
Thank and Regard!
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 8월 16일
Are you starting from an image, or are you starting from a current plot, or are you starting from a .fig file?
Jenifer NG
Jenifer NG 2022년 8월 16일
I am starting from an image not a .fig

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 16일
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092850/image.png';
rgb = imread(filename);
mask = rgb(:,:,1) > 128 & rgb(:,:,2) < 200;
newrgb = rgb;
newrgb(repmat(mask,1,1,3)) = 255;
imshow(rgb)
imshow(newrgb)
You might want to make some subtle cleanup.
  댓글 수: 1
Jenifer NG
Jenifer NG 2022년 8월 16일
편집: Jenifer NG 2022년 8월 16일
Thanks you,
It work !
I learned new function repmat() from your answer

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

추가 답변 (1개)

Mandar
Mandar 2022년 8월 16일
I understand that you want to remove one of the lines from the plot.
As a workaround, please use the 'Property Inspector' to delete the plots/lines. Refer to the link below to for more details.
  댓글 수: 1
Jenifer NG
Jenifer NG 2022년 8월 16일
Hi Mandar,
Thanks so much for your information. But I want to remove red line from an image not a .fig.
Sorry for my explaination in question not clear

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

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by