How can I set contineous trigger using image acquisition toolbox

3 views (last 30 days)
OM
OM on 19 Jan 2018
Answered: Etsuo Maeda on 22 Jan 2018
I am using Hamamatsu ORCA-flash 4.0 camera and imaging acquisition toolbox. What I am trying to do is setting number of recording frames and frame rates, and acquire image data using for loop.The problem is each loop is taking too much time (more than 1s, when camera exposure is mearly 0.01s), so the recording speed is really slow. Could you help me to improve this code, so I can get the recording speed up?
Here is my code:
%Set total frames and frame rates.
frames = 100;
fps = 2;
%Start recording.
for k = 1:frames
%Start stopwatch
tic
vid = handles.vid;
start(vid);
trigger(vid);
currentFrame = getdata(vid);
%Save triggered image data
fname = sprintf('data_%03d.tif',k);
imwrite(currentFrame,fname,'tif');
%Finish stopwatch
toc;
%Wait for the next trigger
pause(1/fps-toc);
stop(vid);
end

Answers (1)

Etsuo Maeda
Etsuo Maeda on 22 Jan 2018
Could you please decrease the size of input images?
If the size of the image is larger than 4GB, TIFF may not work well because of the limitation of the image format.
Also, the size of the physical memory and Java heap memory are important.
You can increase the size of Java heap memory from
Preferences - MATLAB - General - Java Heap Memory
NOTE: you need to restart MATLAB after increasing the size of Java heap memory

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!