OpenCV is a popular image processing library for C++ and Python. We use it as a reference for some of the functions implemented in ImageJS.
All images used for comparison with OpenCV are generated by the Python script test/img/opencv/generate.py
.
To add a new test reference file:
- Update
generate.py
with the OpenCV code that creates the file. - Run
generate.py
(see following paragraph). - Add the new filename to the
TestImagePath
type (alphabetical order).
To run the generation script, use the following steps:
- Install Python 3.x
- Run
python3 -m venv .venv
to create a virtual environment for the project - Activate the venv or run the local
pip
andpython
commands.source .venv/bin/activate
(UNIX).venv/Scripts/Activate.ps1
(Windows)
- Run
pip install opencv-python
- Run
python test/img/opencv/generate.py