checkDisplayRange error

1 次查看(过去 30 天)
D
D 2011-7-12
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
Sean de Wolski 2011-7-12
what happens if you
implay(bwAreaOpenBW)
does it look correct?
what does
class(Stack)
return?
D
D 2011-7-12
implay returns only the first image, the rest are blank, this seems to be the problem.
class(Stack) returns double which is expected.

请先登录,再进行评论。

回答(1 个)

Sean de Wolski
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.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by