-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation on OpenCV reference (#455)
Plus reorder TestImagePath type alphabetically.
- Loading branch information
Showing
5 changed files
with
108 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Development documentation | ||
|
||
## Writing unit tests | ||
|
||
### Tests that compare with OpenCV | ||
|
||
[OpenCV](https://opencv.org/) 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`](./test/img/opencv/generate.py). | ||
|
||
To add a new test reference file: | ||
|
||
- Update [`generate.py`](./test/img/opencv/generate.py) with the OpenCV code that creates the file. | ||
- Run `generate.py` (see following paragraph). | ||
- Add the new filename to the [`TestImagePath`](./test/TestImagePath.ts) 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` and `python` commands. | ||
- `source .venv/bin/activate` (UNIX) | ||
- `.venv/Scripts/Activate.ps1` (Windows) | ||
- Run `pip install opencv-python` | ||
- Run `python test/img/opencv/generate.py` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters