Is there a way to stop preview lag during image acquisition?

3 ビュー (過去 30 日間)
Piotr Bednarz
Piotr Bednarz 2023 年 12 月 14 日
コメント済み: Piotr Bednarz 2023 年 12 月 15 日
Hi, I have this script that connects BASLER acA1440 camera and records 10 seconds of video in 60 FPS with preview on:
vid = videoinput('gentl',1,'RGB8');
src = getselectedsource(vid);
vid.ReturnedColorSpace = "rgb";
vid.LoggingMode = "disk";
vid.FramesPerTrigger = 600;
src.Gain = 5;
src.AcquisitionFrameRateEnable = "True";
vid.TriggerFrameDelay = 5;
src.AcquisitionFrameRate = 60;
src.ExposureTime = 16000; % exposure that enables 60 FPS on camera
vidWr = VideoWriter("video.mp4","MPEG-4");
vidWr.FrameRate = 60;
vid.DiskLogger = vidWr;
preview(vid)
open(vidWr);
start(vid);
wait(vid,60,"running");
close(vidWr);
stoppreview(vid);
The video file I get is good. The higher the exposure time the lag gets bigger.
Is there way to get rid of/reduce preview lag?

採用された回答

atharva
atharva 2023 年 12 月 15 日
Hey Piotr,
I understand that you want to stop preview lag during image acquisition.
You can reduce the preview lag by reducing the resolution of the preview window or by disabling the preview altogether. You can also try optimizing your code to reduce processing time.
You can also disable the preview window using the function stoppreview. You can learn more about the stoppreview function from the official mathworks documentation mentioned below-
I hope this helps!
  1 件のコメント
Piotr Bednarz
Piotr Bednarz 2023 年 12 月 15 日
Hi, thanks for the answer. I want to keep preview running during acquisition. Reducing resolution helped. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by