This statement is not inside any function. (It follows the END that terminates the definition of the function "extract_tiff".)

2 ビュー (過去 30 日間)
Could you please help with explanation. Thank you in advance.
I am trying to pass a file, but I keep getting this ERROR!
This statement is not inside any function.
(It follows the END that terminates the definition of the function "extract_tiff".)
function [] = extract_tiff()
[filename,pathname]=uigetfile({'*.avi';'*.mov'},'File Selector');
outPath = [pathname,'frame\'];
if ~exist(outPath,'dir')
mkdir(outPath)
end
mov = VideoReader([pathname,filename]);
k = 1;
images = readFrame(mov);
images=im2uint8(images);
outName=sprintf('cam_0_%06d.tif',k);
imwrite(images,[outPath,outName],'tiff');
% outName = sprintf('cam_0_%06d.tif',k);
% imwrite = images,[outPath,outName],'tiff');
k=k+1;
end
end

回答 (1 件)

per isakson
per isakson 2020 年 5 月 31 日
There are two end at the end of the function.
k=k+1;
end
end
Remove one of them

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by