Saving Images Captured by Raspberry Pi Camera
3 views (last 30 days)
Show older comments
Hi I want to have a standalone code on Raspberry Pi generated from a matlab function that takes images evey one second and save them in a directory of my Raspberry Pi... but in many websites they say that the captured image must be returned to host computer... How can I make it standalone?
function CaptureImage()
%#codegen
%Create raspi & webcam obj
raspiObj = raspi('192.168.1.101','pi','pi');
cam = webcam(raspiObj,1);
% Main loop
start = tic;
fprintf('Entering into while loop.\n');
while true
elapsedTime = toc(start);
%Process frames at 1 per second
if elapsedTime > 1
%Capture image from webcam
img = snapshot(cam);
%what should I add here to save captured image in Raspberry Pi
start = tic;
end
end
end
1 Comment
Walter Roberson
on 5 Dec 2021
When I look at https://www.mathworks.com/help/supportpkg/raspberrypiio/ug/functions-supported-for-deployment.html it appears to me that the functions you are using should create img in the memory of the Raspberry Pi.
Deployment to the Raspberry Pi is relatively new; perhaps those sites were out of date.
Answers (0)
See Also
Categories
Find more on MATLAB Support Package for Raspberry Pi Hardware 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!