Use matlab to control Hamamatsu sCMOS, but binning doesn't work.

4 views (last 30 days)
bin=2; % bin = 1, 2 or 4
if bin==1
mode='MONO16_2048x2048_Std';
elseif bin==2
mode='MONO16_BIN2x2_1024x1024_Std';
elseif bin==4
mode='MONO16_BIN4x4_512x512_Std';
end
vid = videoinput('hamamatsu', 1, mode);
src = getselectedsource(vid);
vid.FramesPerTrigger = 1;
vid.ROIPosition = [0 0 2048/bin 2048/bin];
triggerconfig(vid,'manual');
set(vid,'TriggerRepeat',inf);
src.TriggerSource = 'External';
src.TriggerDelay = 0.002;
Exp = 0.05; % in s
src.ExposureTime=Exp;
% crop
start(vid);
calllib('Blink_C_wrapper','Write_image',board_number,SLM_shape_in_zero,...
slm_size(1)*slm_size(2),wait_For_Trigger,flip_immediate,...
output_pulse_image_flip,output_pulse_image_refresh,timeout_ms);
fullimg = getsnapshot(vid);
stop(vid);
figure('NumberTitle', 'on', 'Name', 'full'); imagesc(fullimg); daspect([1 1 1]);
I am trying to use matlab (tried both r2021a and r2024a) to control Hamamatsu c13440 sCMOS(adaptor version is the newest available on official web.). I want to do get binning image from camera. But what I get is the top left corner of the full image rather than a real binning. The first screenshot is the image when I use 'MONO16_2048x2048_Std',
while the second one is the image when I use 'MONO16_BIN2x2_1024x1024_Std'

Answers (0)

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!