How to use Image Acquisition Toolbox function in Simulink?

조회 수: 1 (최근 30일)
Antoine
Antoine 2018년 12월 4일
Dear all,
I would like to use these functions from the Image Acquisition Toolbox inside Simulink.
% PART A
src.EFLensFocusCurrent = 1000;
snapshot = getsnapshot(vidobj);
For this code to work, we need the following initialization
% PART B
vidobj = videoinput('gentl',1,'Mono8');
src = getselectedsource(videobj);
Besides, when the simulation ends, I have to add
% PART C
stop(vidobj); clear vidobj src;
The Part B is time consumming and it is not possible to execute it for every image.
To summarise, I already wrote the code in Matlab and it works. I need to translate it into simulink.
vidobj = videoinput('gentl',1,'Mono8');
src = getselectedsource(videobj);
for i=1:10
snapshot = getsnapshot(vidobj);
src.EFLensFocusCurrent = 100*i;
% some processing with the snapshot
end
stop(vidobj); clear vidobj src;
Thank you very much for your help,
Best regards,
Antoine

답변 (0개)

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by