Aquiring images from mobile camera is too slow
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Matt J
am 12 Mai 2025
Bearbeitet: Matt J
am 12 Mai 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 Kommentare
Walter Roberson
am 12 Mai 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 Kommentare
Siehe auch
Kategorien
Mehr zu Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!