How to change all the colours in the image to black
Afficher commentaires plus anciens

how to change all the colours in the image to black except the white colour in image?
Réponse acceptée
Plus de réponses (1)
yanqi liu
le 1 Fév 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)

Catégories
En savoir plus sur Image Filtering and Enhancement dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!