Frame Difference
1 次查看(过去 30 天)
显示 更早的评论
In the frame difference method,on converting an image to frame,i have got an error in the following statement:
M(i-1)=im2frame(unit8(fg),gray);
fg is gray image.
the error is :
Indexed movie data values must be legal color map indices:
1.0<=value<=length(colormap) for double-precision movie data,and
0<=value<=length(colormap)-1 for unit8 movie data.
plzz tell me how can i fix this error?
0 个评论
采纳的回答
Walter Roberson
2012-6-2
The default size of the colormap for gray() is smaller than 256 elements. You need to use
M(i-1)=im2frame(uint8(fg),gray(256));
3 个评论
Image Analyst
2012-7-28
Why are you casting it to double? Don't do that. There's probably a zero in there and it says it must have values between 1 and 4096. Why did you want to cast to double anyway, when it was not necessary?
Hari Patel
2012-7-30
编辑:Hari Patel
2012-7-30
I am casting it to DOUBLE because im2frame can only make movie frame from image matrices of type double or unit8 and i checked, its not zero.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!