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

3 ビュー (過去 30 日間)
Piyum Rangana
Piyum Rangana 2017 年 3 月 5 日
コメント済み: Jan 2017 年 3 月 6 日
How I set all channels(RGB) into zero of a particular pixel in a RGB image ?

回答 (1 件)

Jan
Jan 2017 年 3 月 5 日
編集済み: Jan 2017 年 3 月 5 日
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 件のコメント
Piyum Rangana
Piyum Rangana 2017 年 3 月 5 日
編集済み: Piyum Rangana 2017 年 3 月 5 日
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 2017 年 3 月 6 日
Please post your code.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImages についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by