Crop images in Python with array indexes
Posted 22nd May 2024
No comments
The advantage of this simple procedure for image cropping is that there’s no need to install special image manipulation packages.
Batch rename files using a CSV in Python
Posted 19th January 2023
No comments
Use this simple Python script to change hundreds or thousands of file names automatically, based on a CSV. This procedure will work on all operating systems.
Structuring elements in Python
Posted 1st September 2022
1 comment
Some simple methods to generate structuring elements as part of an image morphology pipeline in Python.
Add your Conda environment to your Jupyter Notebook
Posted 31st May 2022
No comments
By default, Jupyter Notebook will only display a single kernel (called ipykernel) when installed in a new environment. Here’s a procedure for choosing another Conda environment in a Jupyter Notebook.
Bounding rectangles in Python OpenCV
Posted 20th July 2021
No comments
There are two methods in OpenCV to derive a bounding rectangle and extract the relevant values of an object or series of objects in an image.
Peak Signal-to-Noise Ratio (PSNR) in Python
Posted 12th February 2021
No comments
Quantitatively check the quality of a compressed image using a simple Python code for calculating the Peak Signal-to-Noise Ratio (PSNR) between two images.
Reading EXIF data in Python
Posted 2nd February 2021
2 comments
In order to review the properties of various common-format image files, I wrote a command-prompt script in Python that will display EXIF data and other properties of JPG, PNG, TIF, CR2 and NEF files.
Query a PostgreSQL database via Python
Posted 11th December 2020
No comments
Use this simple template script created in Python to connect to your PostgreSQL database and run a query.
Iterate both i and j in Python
Posted 2nd September 2020
No comments
Two methods for implimenting nested iterations of i and j in Python.
SQL to CSV via Python, with Headers
Posted 7th June 2019
1 comment
Nifty Python code that converts a SQL database file into a CSV file and includes column headers.