what does it mean Error using image TrueColor CData contains element out of range 0.0 <= value <= 1.0
5 ビュー (過去 30 日間)
古いコメントを表示
trying to work out wfusimg example in mathwork
ct=imread('grayplay900x900.jpg');
mri = imread('graygoogle900x900.jpg');
XFUSmean = wfusimg(ct,mri,'db2',5,'mean','mean');
XFUSmaxmin = wfusimg(ct,mri,'db2',5,'max','min');
colormap(maps);
subplot(221),image(ct),axis square, title('play')
subplot(222), image(mri),axis square, title('google logo')
subplot(223), image(XFUSmean),axis square, title('mean')
however it gives the error ,Error using image TrueColor CData contains element out of range 0.0 <= value <= 1.0
回答 (1 件)
Jan
2017 年 3 月 6 日
The error message is clear: The command image is called with an agrument, which contains an RGB value outside the allowed range [0, 1]. Check this by using the debugger: Type this in the command line:
dbstop if error
Then run the code again. Matlab stops, when the error occurres. Then:
max(XFUSmean(:)) % Or which variable is concerned - I cannot guess this
min(XFUSmean(:))
class(XFUSmean)
What do you obeserve? The class double and values in the range of [0, 255]? Then divide the variable by 255 to get the standard image format.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!