Edge function error while loop video frames, VideoReader - Index in position is invalid
이전 댓글 표시
v = VideoReader('images_video/Maldives.mp4');
while hasFrame(v)
frame = readFrame(v);
figure, imshow(frame);
BW = rgb2gray(frame);
edge = edge(BW, 'canny', 0.2);
figure, imshow(edge);
end
When we run this, the first frame shows with imshow(frame) then the edge function works and the first edge shows with imshow(edge), the loop starts again and the next imshow(frame) works, and then we get an error:
Index in position 3 is invalid. Array indices must be positive integers or logical values.
Otherwise, the loop runs fine. Clearly something to do with the edge function is trying to operate on itself or something. Probably something simple. Any ideas please?
MATLAB: R2018b
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!