I would like to share how to run the THORLABS camera CS2100M-USB in Python. This is the same camera used in the previous article Move THORLABS automatic stage with Python [for research].
The languages that can be used are as follows. It's fulfilling.
C、C++、C#、Python、Visual Basic .NET API LabVIEW, MATLAB and µManager third-party software
The SDK (Software Development kits) comes with the download of ThorCam ™ software for Windows® 7 and 10. Let's download it right away.
** 1. Download ThorCam ™ software ** First, download the ThorCam ™ software. ThorCam™ Software for Scientific and Compact USB Cameras Click ① in the red frame
Download screen
Finally, it's done.
** 2. Check directory **
Make sure that a folder with the following name has been created.
Work in this folder.
C:\Program Files\Thorlabs\Scientific Imaging
** 3. This and that ** Unzip Scientific_Camera_Interfaces.zip. If you can't unzip it, choosing unzip with administrator privileges will work.
C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific_Camera_Interfaces\Scientific Camera Interfaces
Contains the SDK.
Let's do this and that according to the Python README.txt
. (This is troublesome)
Select all the files in the following directory and
C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific_Camera_Interfaces\Scientific Camera Interfaces\SDK\Native Compact Scientific Camera Toolkit\dlls\Native_64_lib
Copy it to the following directory (see photo).
C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific_Camera_Interfaces\Scientific Camera Interfaces\SDK\Python Compact Scientific Camera Toolkit\dlls\64_lib
Next, unzip thorlabs_tsi_camera_python_sdk_package.zip
in the following directory with administrator privileges.
C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific_Camera_Interfaces\Scientific Camera Interfaces\SDK\Python Compact Scientific Camera Toolkit
Copy the thorlabs_tsi_sdk
folder inside the unzipped folder
C:\Program Files\Thorlabs\Scientific Imaging\Scientific Camera Support\Scientific Camera Interfaces\SDK\Python Compact Scientific Camera Toolkit\examples
Paste in.
** 4. Installation of required modules ** Install the following modules with the pip or conda command.
I'm ready. Let's take a break once we can reach this point.
Stored in the example folder,
tkinter_camera_live_view.py
Let's run.
A window will appear as shown in the picture below, and the video will be displayed.
This time I am observing the test chart.
Class instructions are provided for customizing the sample program. Please refer to the following file.
C:\Program Files\Thorlabs\Scientific Imaging\Documentation\Scientific Camera Documents\Thorlabs_Camera_Python_API_Reference.pdf
Recommended Posts