Aquiring images from mobile camera is too slow
6 views (last 30 days)
Show older comments
Hi, I am trying to aquire images from my mobile phone's camera using Matlab mobile. Is there any way I can get images from the camera faster ?
clc;clear;close all; %% Connect to device m = mobiledev; %% Create camera cam = camera(m,'back'); cam.Resolution = '640x480'; %% Get images for i=1:1000 [img,t] = snapshot(cam,"immediate"); imshow(img) t end %% Delete object delete(m)
0 Comments
Answers (2)
Matt J
on 12 May 2025
Edited: Matt J
on 12 May 2025
Yes, you can postpone the image display until after the acquisition.
N=1000;
[img,t]=deal(cell(1,N));
for i=1:N
[img{i},t{i}] = snapshot(cam,"immediate");
end
for j=1:N
imshow(img{j}); drawnow
t{j}
end
Or, display the images at less frequent intervals, instead of at every i.
0 Comments
Walter Roberson
on 12 May 2025
Possibly. You might be able to use the IP Camera support
Android: https://www.mathworks.com/help/matlab/supportpkg/acquire-images-from-an-ip-camera-android-app.html
(there does not appear to be an IOS specific page)
You can probably expect that preview() would be faster than snapshot().
However, if you need to capture frames then you end up using snapshot() anyhow even for IP cameras. The question then becomes whether using snapshot() through mobiledev() is faster or slower than using snapshot() through ipcam(). I do not know the answer to that... I would tend to suspect that ipcam() would be faster, but I do not know.
0 Comments
See Also
Categories
Find more on Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!