Error using image Error using image TrueColor - How to plot images created by joining arrays instead of using imread

Hello there, i have a question.
Let's suppose i have a image of 3x3 pixels with only a blue dot on the center.
>> image=imread('dot.bmp')
image(:,:,1) =
255 255 255
255 0 255
255 255 255
image(:,:,2) =
255 255 255
255 162 255
255 255 255
image(:,:,3) =
255 255 255
255 232 255
255 255 255
If i get the arrays separately and join them into an array:
dot(:,:,1) = [255 255 255; 255 0 255; 255 255 255] dot(:,:,2) = [255 255 255; 255 162 255; 255 255 255] dot(:,:,3) = [ 255 255 255; 255 232 255; 255 255 255]
>> image(dot) Error using image Error using image TrueColor CData contains element out of range 0.0 <= value <= 1.0
The question is, what should i do to make it work?
Regards.

 採用された回答

Adam
Adam 2016 年 12 月 2 日
編集済み: Adam 2016 年 12 月 2 日
image( uint8( dot ) )
should work, although just doing what you put works for me too in R2016b

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by