Starburst- based eye tracking algorithm on single images
3 次查看(过去 30 天)
显示 更早的评论
Hi everybody, I'm trying to process some eye images for eye tracking and I am trying currently with Starburst algorithm. Since the algorithm originally takes videos while I'd like to process single images, I must break down the single functions to do what I want. I am going through the single functions to do so. I am not familiar with the file handling, so this bit of code for me turns out very hard to understand:
[sfname, spname] = uigetfile('*.mp4','Scene movie file');
sf = strcat(spname, sfname);
[efname, epname] = uigetfile('*.mp4','Eye movie file', spname);
ef = strcat(epname, efname);
eval(sprintf('!mkdir %s/Scene', spname));
eval(sprintf('!mkdir %s/Eye', epname));
eval(sprintf('!ffmpeg -i %s -img jpeg %sScene/Scene_%%5d.jpg', sf, spname));
eval(sprintf('!ffmpeg -i %s -img jpeg %sEye/Eye_%%5d.jpg', ef, epname));
Supposedly breaks the video into single images (which would be my starting point). However, the !ffmpeg command doesn't seem to be working, as it raise and error:
The syntax of the command is incorrect.
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.
Can anybody help me out with understanding what this snippet will actually do (I understand what 'eval' and 'sprintf' do but what it's inside there remains obscure) and why it raises and error?
Thank you very much!
0 个评论
采纳的回答
Walter Roberson
2017-10-24
ffmpeg = '/usr/local/bin/ffmpeg'; %full path to executable
[sfname, spname] = uigetfile('*.mp4','Scene movie file');
sf = fullfile(spname, sfname);
[efname, epname] = uigetfile('*.mp4','Eye movie file', spname);
ef = fullfile(epname, efname);
mkdir( fullfile(spnane, 'Scene') );
mkdir( fullfile(epnae, 'Eye') );
cmd1 = sprintf('''%s'' -i ''%s'' -img jpeg ''%s/Scene/Scene_%%5d.jpg''', ffmpeg, sf, spname);
cmd2 = sprintf('''%s'' -i ''%s'' -img jpeg ''%s/Eye/Eye_%%5d.jpg''', ffmpeg, ef, epname);
system(cmd1)
system(cmd2)
8 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!