How to change all the colours in the image to black
Mostrar comentarios más antiguos

how to change all the colours in the image to black except the white colour in image?
Respuesta aceptada
Más respuestas (1)
yanqi liu
el 1 de Feb. de 2021
clc; clear all; close all;
I = imread('ceshi.png');
I2 = rgb2hsv(I);
s = mat2gray(I2(:,:,2));
bw = im2bw(s, 0.5);
figure; imshow(~bw)

Categorías
Más información sobre Image Filtering and Enhancement en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!