THORLABS camera CS2100M-USB runs on Python [for research]

Introduction

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].

Execution result of sample program

9.png

Development environment

Equipment to use

Installation

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 コメント 2020-02-18 110907.png

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. 2.PNG

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) 3.PNG

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 5.PNG

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. 8.png

** 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.

Checking the operation of the sample program

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.

9.png

To customize

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

THORLABS camera CS2100M-USB runs on Python [for research]
Move THORLABS automatic stage with Python [for research]
Install confluent-kafka for Python on Ubuntu
Notes for using OpenCV on Windows10 Python 3.8.3.
Notes on nfc.ContactlessFrontend () for nfcpy in python
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
Tweet (API 1.1) on Google App Engine for Python
A memorandum for touching python Flask on heroku
Installing TensorFlow on Windows Easy for Python beginners
Install Python and libraries for Python on MacOS Catalina
2016-10-30 else for Python3> for:
python [for myself]
Python on Windows
twitter on python3
python on mac
Python on Windbg
Initial settings for using Python3.8 and pip on CentOS8
Install psycopg2 (pgsql library for python3) on Apple Silicon
I tried Python on Mac for the first time.
[Python] This is easy! Search for tweets on Twitter
Build a Python extension for E-Cell 4 on Windows 7 (64bit)
I tried python on heroku for the first time
Information for controlling the motor with Python on RaspberryPi
PIL with Python on Windows 8 (for Google App Engine)
Support for Python 2.7 runtime on AWS Lambda (as of 2020.1)
Procedure for building a CDK environment on Windows (Python)
Settings for testing C ++ 11 Python modules on Travis CI
Notes on writing config files for Python Note: configparser
Beginners use Python for web scraping (4) --2 Scraping on Cloud Shell
For those who can't install Python on Windows XP