Need to set all channels(RGB) into 0 of a particular pixel in a RGB image

2 vues (au cours des 30 derniers jours)
Piyum Rangana
Piyum Rangana le 5 Mar 2017
Commenté : Jan le 6 Mar 2017
How I set all channels(RGB) into zero of a particular pixel in a RGB image ?

Réponses (1)

Jan
Jan le 5 Mar 2017
Modifié(e) : Jan le 5 Mar 2017
img = 0.6 + 0.4 * rand(30, 20, 3); % Test image with light colors
pixel = [12, 17];
img(pixel(1), pixel(2), :) = 0;
figure;
image(img);
Not the pixel at position (12, 17) is black.
  2 commentaires
Piyum Rangana
Piyum Rangana le 5 Mar 2017
Modifié(e) : Piyum Rangana le 5 Mar 2017
Hi Jan
Although I set zero like that, the uint8 array values does not get 0. in my case it is a '16×35×3 uint8 array'.
Jan
Jan le 6 Mar 2017
Please post your code.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by