I have a binary image with black background and a white object in circle ,now i want to change the colour of white to gray plz help

4 件のコメント

Alessandro
Alessandro 2013 年 3 月 18 日
use class(image) to determinate what kind of data you have. If it is int8 than you can just image2 = image./2 If it is logical than you can write image2 = int8(image).*127
kash
kash 2013 年 3 月 18 日
Alessandro i need the white object to become gray;in ur code the background becomes gray
Jan
Jan 2013 年 3 月 18 日
@kash: Please post the class of the input, because "binary image" is not an exact definition.
kash
kash 2013 年 3 月 19 日
the class is logical

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

 採用された回答

Image Analyst
Image Analyst 2013 年 3 月 19 日

0 投票

grayValue = uint8(128); % or whatever you want in the range of 1-255
grayScaleImage = grayValue * uint8(binaryImage);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Images についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by