So, I`m extracting frames from a video and saving them as JPEG images. However I want to save the frames automaticaly in a folder named after the video they`re from. I`m really struggling with this. This is the code I`m using. The frame extrating works as intended, the new automatic folder is the problem.
numFrames = vid.NumberOfFrames;
Folder = 'C:\Users\Myname\Documents\Test\Videos\Extrac\';
for iFrame = 1:n
frames = read(vid, iFrame);
imwrite(frames, fullfile(Folder, sprintf('%03d.jpg', iFrame)));
I tried using mkdir but I`m really confused by its syntax and how to get the new folder`s path.
For example : mkdir vid.Path vid.Name . This should create a new folder named after the video`s name right ?
How do I get the path of this folder ? This syntax does not seem to work