Video frame selection

Technical Source
1 min readFeb 24, 2022

I’m sure this has an easy answer but if I set a trigger to capture 2 frames how can I independently assign ‘[vid,1]’ and ‘[vid,2]’ as variables? My reason for doing this is to subtract one image from another (and then divide the qualitative noise. 2 to the power of 0.5, Dark current calculations).

vid = videoinput('gige', 1, 'Mono16');
src = getselectedsource(vid);
vid.FramesPerTrigger = 2;
start(vid);

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

There are a number of ways to this that are roughly equivalent. By default the GETDATA command returns N frames where N is equal to the value of the FramesPerTrigger property when GETDATA is called. You could do something like:

data = getdata(vid);
diffFrame = data(:,:,:,2) - data(:,:,:,1);

You can also specify the number of frames that GETDATA should return:

image1 = getdata(vid, 1); % Here 1 is the number of frames to return
image2 = getdata(vid, 1);
diffFrame = image2 - image1;

Of course, you could also do:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.