How to store 80 images from a camera in mat file i am capturing images from frame variable described.
조회 수: 1 (최근 30일)
이전 댓글 표시
frame = getsnapshot(handles.vid); %.....Capturing the images
imshow(frame);
for k = 1:80
frame = k;
imshow(frame(:,:,:,1))
save('C:\Users\Vasoptic Medical\Desktop\Neo_BlkFly_Mizumi_Pixelink\Data\images_ .mat' , 'frame');
end
댓글 수: 0
답변 (1개)
Ananya Tewari
2021년 8월 3일
Hi,
As per my understanding you want to save 80 images in a .mat file and you are actually using a video to take snapshots of frames. The getsnapShot function returns just one frame, if you want to capture multiple images from a video you can use the VideoReader function to capture multiple frames and save it. Here is an example to do the same.
v = VideoReader('xylophone.mp4'); % reading video
frame = read(v,[1 80]); % Capturing first 80 frames and saving in 'frame'
save('images.mat',"frame"); % creating the MAT file in current directory
imshow(frame(:,:,:,15)) % Displaying 15th frame from 'frame' variable
Hope this helps !
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!