checkDisplayRange error

6 visualizzazioni (ultimi 30 giorni)
D
D il 12 Lug 2011
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 Commenti
Sean de Wolski
Sean de Wolski il 12 Lug 2011
what happens if you
implay(bwAreaOpenBW)
does it look correct?
what does
class(Stack)
return?
D
D il 12 Lug 2011
implay returns only the first image, the rest are blank, this seems to be the problem.
class(Stack) returns double which is expected.

Accedi per commentare.

Risposte (1)

Sean de Wolski
Sean de Wolski il 12 Lug 2011
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.

Categorie

Scopri di più su System Commands in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by