Camera Setup and Image Acquisition Using Visual Studio® and C# Programming | Thorlabs Insights
When a scientific camera is integrated into a setup, it can be convenient to automate image acquisition and storage using a hardware trigger. This can be enabled using the software development kit (SDK) provided with Thorlabs' scientific cameras. The use of the SDK to control the operation of a scientific camera is demonstrated using a custom Visual Studio® console application written in C#, as well as a setup that includes a scientific camera, light emitting diode (LED), LED driver, and PC. The demonstration begins with a general overview of the setup, and then steps through the settings needed to configure the LED driver to pulse the LED five times while providing a TTL output signal each time. Pulsing the light source is one approach to limiting a sample's total light exposure, and the TTL signal can be used to synchronize image acquisition with the illumination of the sample. A cable couples the TTL hardware trigger to the camera. A blank Visual Studio console application is then opened, and the code is explained as it is typed line-by-line. The program finds all available cameras connected to the PC and is used to select one, whose parameters the program will configure for the setup. The exposure time is set to be slightly less than the LED pulse duration, and a single image acquisition is specified to occur when a hardware trigger is received. Each image is saved to a file as a bitmap, and the total number of acquired images is limited to five. The demonstration concludes with the successful execution of the program, which results in five saved image files that were each taken during a separate flash of the LED. The C# code demonstrated during this video can be downloaded from Thorlabs' official GitHub account: https://github.com/Thorlabs/Camera_Examples/blob/main/C%23/Compact_Scientific_Cameras/Hardware_Triggering/Program.cs The DLLs added during project setup are provided in the Scientific Camera Interfaces folder: C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific Camera Interfaces Detailed documentation that includes the camera's supported features is found in this folder: C:\Program Files\Thorlabs\Scientific Imaging\Documentation\Scientific Camera Documents 00:00 - Introduction 00:35 - LED Controller Setup and Connection 02:30 - Brief Discussion of Project Setup (Libraries, Imports) 03:58 - Discover Available Cameras 05:39 -Open a Selected Camera 06:03 - Set Camera Parameters 07:59 - Prepare Camera to Acquire Desired Images 09:44 - Receive and Save Acquired Images 11:29 - Clean Up the Camera Resources 12:03 - Successful Execution of Code Components used in this demonstration include: - Thorlabs' software download page: https://www.thorlabs.com/software_pages/ViewSoftwarePage.cfm?Code=ThorCam&YVI=19 - CS165MU1 1.6 MP Monochrome CMOS Camera: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=13677&pn=CS165MU1&YVI=19 - DC2200 LED Driver with Pulse Modulation: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=9117&pn=DC2200&YVI=19 - Mounted LED: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=2692&YVI=19 - DG10-600-MD SM1-Mounted Ground Glass Diffuser: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=6905&pn=DG10-600-MD&YVI=19 - SM1RC Slip-Ring Mount for SM1 Lens Tubes: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=1533&pn=SM1RC&YVI=19 - R1L3S3P Positive Grid Distortion Target: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=7501&pn=R1L3S3P&YVI=19 - XYF1 XY Translation Mount for Rectangular Optics: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=5343&pn=XYF1&YVI=19 - 1" Diameter, SM1 Lens Tubes: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=3307&YVI=19 - 1" Diameter, Adjustable SM1 Lens Tubes: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=4109&YVI=19 - Unmounted, AR-Coated, Achromatic Doublets: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=120&YVI=19 For more photonics how-to videos, visit https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=14062&YVI=19
Download
0 formatsNo download links available.