Fast Image Capture Using Frame Grabber and TDI Camera

6 views (last 30 days)
I'm trying to obtain an image as quickly as possible using an Active Silicon frame grabber and a Hamamatsu TDI camera connected over Camera Link. It's resolution is 1024x64, and is presently not running in TDI mode. Ideally this camera should be taking an image and adding it to one composite image every 10.04ms. I have tried a few methods which I'll briefly describe below:
Method 1: A timer is set to call a function that will snap the image for every subset of time. This method will take the image, but very slowly (2.5s per image). This problem seems to appear from the 'getsnapshot' function.
Method 2: Instead of trying to capture individual frames, a video was attempted, where the timer would now trigger the camera for every subset of time. I was also careful to make sure I'm not re-initializing the camera every frame. This time I got the images, but they came in as just noise no matter what the subject is.
The only possibility I've seen is to use the Machine Vision toolbox for faster aqusition, but I'd ideally like to try first with the toolboxes I have. Also I'm currently saving each image over each other; the composite methedology has not been implemented yet, but I would assume that's just adding to the matrix with every shot. Does anyone have any ideas on how I can either alter these methods or use a different method to obtain images more quickly? Thanks!
Method 1:
vid = videoinput('hamamatsu',1, 'MONO16_BIN2x2_1024x64');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
src.PixelType = 'mono16';
src.TriggerConnector = 'multi';
a = timer('ExecutionMode','fixedRate','Period',0.1004,'TimerFcn',{@PanoramicImage, vid},'TasksToExecute',10);
start(a);wait(a);
disp('timer done')
function PanoramicImage(~,~,vid)
img = getsnapshot(vid);
img = double(img)/65535;
figure; imshow(img,[])
end
Method 2:
vid = videoinput('hamamatsu',1, 'MONO16_BIN2x2_1024x64');
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
src.PixelType = 'mono16';
src.TriggerConnector = 'multi';
triggerconfig(vid, 'manual');
set(vid,'TriggerRepeat',inf);
a = timer('ExecutionMode','fixedRate','Period',0.1004,'TimerFcn',{@PanoramicImage, vid},'TasksToExecute',10);
start(a);wait(a);
disp('timer done')
imaqreset;
img = double(fdat)/65535;
function PanoramicImage(~,~,vid)
trigger(vid);
fdat = getdata(vid);
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!