ACQUIRING IMAGES BY USING THE PYTHON SAMPLE WITH PYTHON SCRIPT USING PYCHARM
Python is a programming language that can be used for creating machine vision programs. This article guides you through downloading, installing, and using a Python sample to acquire images using the program PyCharm. Follow these simple steps to get started.
Once downloaded, double-click on the file to run the installer. Follow the prompts to install PyCharm.
Ensure that the options “64-bit launcher,” “Add launchers dir to the PATH,” and “.py” are selected.
Click on Install. Once installation is complete, reboot the PC.
You can choose now whether you do or do not want to send Statistics.
You will be shown the customization page, you can choose the theme for PyCharm, or click on “Skip remaining and set Defaults”.
RUN THE PYTHON SCRIPT SAMPLE WITH PYCHARM
Now that PyCharm is installed, you can run the Python script sample. Click on the button + New Project button and ensure that all the options are selected.
Wait for the program to finish “Creating Virtual Environment” In the top toolbar go to file > settings and expand the menu for Project
In the top toolbar go to file > settings and expand the menu for Project: python Project.
Click on the + sign on the right side of the page.
Add the following modules by searching them by name, selecting them one by one and clicking “install package”:
Here you can see all packages installed.
When done close the interpreter packages window, click ok.
WE CAN NOW RUN THE PYTHON SAMPLE
Next, go to File > Open and select C:\Program Files\Daheng Imaging\GalaxySDK\Samples\Python SDK\GxSingleCamColor.py. Click OK and execute the script by selectin Run > GxSingleCamColor.py from the Menu toolbar.
Click OK and execute the script by selectin Run > GxSingleCamColor.py from the Menu toolbar. *Please note that GXIPY folder should be on the location of the scripts
The Python script sample will run, showing the result of the operation within PyCharm. Any errors or warnings will also be displayed.
If you have followed these steps you are now able to acquire images by running python scripts in PyCharm.