A simple code snippet to read, and write images using the Python OpenCV library. Python >= 3.6
git clone https://github.com/BehzadRp98/ReadWriteImage_Python_Component.git
It is recommended that a virtual environment be enabled to install and test the code snippet.
python -m pip install virtualenv
python -m venv rwImages
rwImagesEnv\Scripts\activate
python -m pip install -r requirements.txt
To test the repository quickly there is a flower photo in "images" folder:
python rwImages.py --input images\flower.jpg --output out.png
All options:
python rwImages.py --help
usage: rwImages.py [-h] --input INPUT --output OUTPUT
Read and write images
optional arguments:
-h, --help show this help message and exit
--input INPUT [REQUIRED] Source image path
--output OUTPUT [REQUIRED] Destination image path like: output.jpg
git clone https://github.com/BehzadRp98/ReadWriteImage_Python_Component.git
It is recommended that a virtual environment be enabled to install and test the code snippet
python3 -m pip install virtualenv
python3 -m venv rwImages
source ./rwImages/bin/activate
python3 -m pip install -r requirements.txt
To test the repository quickly there is a flower photo in "images" folder:
python3 rwImages.py --input ./images/flower.jpg --output ./out.png
All options:
python3 rwImages.py --help
usage: rwImages.py [-h] --input INPUT --output OUTPUT
Read and write images
optional arguments:
-h, --help show this help message and exit
--input INPUT [REQUIRED] Source image path
--output OUTPUT [REQUIRED] Destination image path like: output.jpg
git clone https://github.com/BehzadRp98/ReadWriteImage_Python_Component.git
It is recommended that a virtual environment be enabled to install and test the code snippet
python3 -m pip install virtualenv
python3 -m venv rwImages
source ./rwImages/bin/activate
OpenCV is the only requirement of this repository. To install it on Raspberry Pi 4, follow steps in https://qengineering.eu/install-opencv-4.3-on-raspberry-pi-4.html
To test the repository quickly there is a flower photo in "images" folder:
python3 rwImages.py --input ./images/flower.jpg --output ./out.png
All options:
python3 rwImages.py --help
usage: rwImages.py [-h] --input INPUT --output OUTPUT
Read and write images
optional arguments:
-h, --help show this help message and exit
--input INPUT [REQUIRED] Source image path
--output OUTPUT [REQUIRED] Destination image path like: output.jpg