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!