필터 지우기
필터 지우기

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

조회 수: 26 (최근 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