checkDisplayRange error
1 次查看(过去 30 天)
显示 更早的评论
Hello, I posted this question in a previous section, but I doubt it will get view so I am re-posting it to a new topic.
Odd, I am having the error again, and this time without the ability to fix it.
My data flow is MxNxK Logical -> double -> 1x1 Struct -> 4-D uint8, I get the same error: ?? Error using ==> checkDisplayRange at 22 HIGH must be greater than LOW.
using the rand values it works fine, so it must be a data problem. Here is my code:
clear all
close all
clc;
fileIn= 'input.avi';
fileInfo = aviinfo(filein);
nFrames = fileinfo.NumFrames;
Y=fileinfo.Height;
X=fileinfo.Width;
aviInfo= avifile(fout, 'compression', 'none', 'fps',fileinfo.FramesPerSecond);
Stack=zeros([Y, X, nframes]);
for i = 1:nFrames %1
movie_in = aviread(fin,i);
[Stack(:,:,i),map]=frame2im(movie_in,i);
bwAreaOpenBW = bwareaopen(Stack,200);
L = bwlabeln(bwAreaOpenBW,26);
s=regionprops(L,'Centroid','Area','PixelList','PixelIdxList');
movie_out=label2CC(L);
V=CC2RGB3(movie_out);
movie2avi(immovie(V),'Output');
end
I get this error output:
?? Error using ==>
checkDisplayRange at 22
HIGH must be greater than LOW.
Error in ==>
imageDisplayParseInputs at 215
common_args.DisplayRange =
checkDisplayRange(common_args.DisplayRange,mfilename);
Error in ==> imshow at 173
[common_args,specific_args] =
...
Error in ==> immovie at 56
imshow(X(:,:,:,k),map);
Error in ==> bwlabeltoavi at 22
movie2avi(immovie(V),'Output');
2 个评论
Sean de Wolski
2011-7-12
what happens if you
implay(bwAreaOpenBW)
does it look correct?
what does
class(Stack)
return?
回答(1 个)
Sean de Wolski
2011-7-12
for i = 1:nFrames %1
movie_in = aviread(fin,i);
[Stack(:,:,i),map]=frame2im(movie_in,i);
end
I think you want the end of the for-loop there and then continue. Also bwareaopen will turn your double image into a logical, so make sure it's a logical beforehand.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!