How to remove other color line in graph ?

7 visualizzazioni (ultimi 30 giorni)
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 Commenti
Walter Roberson
Walter Roberson il 16 Ago 2022
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 il 16 Ago 2022
I am starting from an image not a .fig

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 16 Ago 2022
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 Commento
Jenifer NG
Jenifer NG il 16 Ago 2022
Modificato: Jenifer NG il 16 Ago 2022
Thanks you,
It work !
I learned new function repmat() from your answer

Accedi per commentare.

Più risposte (1)

Mandar
Mandar il 16 Ago 2022
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 Commento
Jenifer NG
Jenifer NG il 16 Ago 2022
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

Accedi per commentare.

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by