Skip to main content

pyorc: free and open-source image-based surface velocity and discharge.

Project description


pyOpenRiverCam

PyPI Conda-Forge Coverage python docs_latest Binder License downloads

pyorc, short for "pyOpenRiverCam" is a fully Open Source library for performing image-based river flow analysis. It is the underlying library for computations on the fully open software stack OpenRiverCam. pyorc can only be successful if the underlying methods are made available openly for all. Currently, we use LSPIV as our central velocimetry method, powered by FF-PIV. See https://github.com/localdevices/ffpiv. We wish to extend this to Space-Time Image Velocimetry (STIV) for conditions that are less favourable for LSPIV using open libraries or extensions to this code.

example_image Image: Example of pyorc velocimetry over Ngwerere river at the Zambezi Road crossing - Lusaka, Zambia.

Current capabilities are:

  • Reading of frames and reprojection to surface
  • Velocimetry estimation at user-defined resolution
  • Discharge estimation over provided cross-section
  • Plotting of velocimetry results and cross-section flows in camera, geographical and orthoprojected perspectives.

We use the well-known xarray data models and computation pipelines (with dask) throughout the entire library to guarantee an easy interoperability with other tools and methods, and allow for lazy computing.

We are seeking funding for the following frequently requested functionalities:

  • Exports to augmented reality videos
  • Implementation of additional processing algorithms (STIV)
  • Improved nighttime / poor weather conditions processing through learning approaches

If you wish to fund this or other work on features, please contact us at info@rainbowsensing.com.

[!NOTE] For instructions how to get Anaconda (with lots of pre-installed libraries) or Miniconda (light weight) installed, please go to https://docs.conda.io/projects/conda/en/latest/

[!TIP] Please go to https://localdevices.github.io/pyorc for the latest documentation

[!IMPORTANT] At this moment pyorc works with any video compatible with OpenCV as long as it has proper metadata.

Installation

You need a python environment. We recommend using the Miniforge project. Download the latest miniforge installer from https://github.com/conda-forge/miniforge and follow the installation instructions before continuing installing pyorc.

virtual environment

To get started with pyorc, we recommend to set up a python virtual environment. This ensures that installed libraries pyorc will not conflict with other libraries or library versions which you may need for other projects.

Setting up a virtual environment can be done with:

python -m venv pyorc_env

this creates a new folder pyorc_env on your disk which contains your virtual environment. After activating the environment, any package you install will be installed in this environment only. Activating in Unix/Linux is done as follows:

source pyorc_env/bin/activate

In Windows, the activation script is in a different folder. Type the following to activate the environment.

pyorc_env\Scripts\activate

Installation for direct use

If you simply want to add pyorc to an existing python installation or virtual environment, then follow these instructions.

First activate the environment you want pyorc to be installed in (if you don't care about virtual environments, then simply skip this step). See the above sub-section for information. You can simply install pyorc with all its dependencies as follows:

pip install pyopenrivercam[extra]

The [extra] section ensures that also geographical plotting is supported, which we recommend especially for the set up of a camera configuration with RTK-GPS measured control points.

[!NOTE]

Most of the heavy lifting is done while deriving cross-correlations for estimation of velocity vectors with Particle Image Velocimetry. This is very fast thanks to the dependency rocket-fft. This dependency is now available up to python=3.14 and does not require a separate installation instruction anymore. This gives python compatibility from 3.9 up to 3.14.

Upgrading from pypi with pip

Did you read about a new version and you want to upgrade? Simply activate your virtual environment, type

pip install --upgrade pyopenrivercam[extra]

and then enjoy the latest features.

installation with mamba package manager

If you use mamba as a package manager, then the steps are the same, except for the installation step, which is:

mamba install pyopenrivercam

The version installed may not have the latest underlying libraries and therefore may be slower than the latest PyPi version. We therefore recommend using pip for installation (see above).

Installation from latest code base

To install pyorc from scratch in a new virtual environment from the code base, go through these steps. Logical cases when you wish to install from the code base are when you wish to have the very latest non-released version.

First, clone the code with git and move into the cloned folder.

git clone https://github.com/localdevices/pyorc.git
cd pyorc

Set up a virtual environment with all dependencies as follows:

conda env create -f envs/pyorc-dev.yml
conda activate pyorc-dev

then install pyorc from the code base as follows:

pip install .

note: pyorc is now installed in a virtual environment called pyorc-dev. This means that if you wish to run python with pyorc. You need to always first activate this environment before running python (or jupyter). This is done with the following command:

conda activate pyorc-dev

Installation from latest code base as developer

Clone the repository with ssh and move into the cloned folder.

git clone git@github.com:localdevices/pyorc.git
cd pyorc

Setup a virtual developers environment and install the package as follows:

conda env create -f envs/pyorc-dev.yml
conda activate pyorc-dev
pip install -e .

Make sure you install pre-commit hooks so that code is properly linted before pushing.

pip install pre-commit
pre-commit install

Using pyorc

To use pyorc, you can use the API for processing. We also have a command-line interface. Please read our full documentation for further explanation, API description and command-line interfacing.

Acknowledgement

The first development of pyorc has been supported by the World Meteorological Organisation - HydroHub.

License

pyorc is licensed under AGPL Version 3 (see LICENSE file).

pyorc uses the following important libraries and software with said licenses. We do not actively update version numbers in the README. The last update was made on 2026-05-21.

Package Version License
ffpiv 0.2.1 AGPLv3
numpy >=2.0.0 BSD License
opencv2 4.13.0 MIT License
matplotlib >3.10.0 Python Software Foundation License
geopandas >=1.0.0 BSD License
pandas >3.0.0 BSD License
xarray >2026 Apache 2.0

Project organisation

.
├── CHANGELOG.md        <- Version-based changelog documentation
├── README.md           <- This file
├── LICENSE             <- License file containing AGPLv3.0 license terms
├── TRADEMARK.md        <- Trademark guidelines
├── pyproject.toml      <- setup pipeline compatible with pip
├── environment.yml     <- YML-file for setting up a conda environment with dependencies
├── docs                <- Sphinx documentation source code
    ├── ...             <- Sphinx source code files
├── examples            <- Jupyter notebooks with examples how to use the API
    ├── ...             <- individual notebooks and folder with example data files
├── pyorc               <- pyorc library
    ├── ...             <- pyorc functions and API files
├── tests               <- pytest suite
    ├── ...             <- pytest functions on API level

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyopenrivercam-0.9.6.tar.gz (154.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyopenrivercam-0.9.6-py3-none-any.whl (152.1 kB view details)

Uploaded Python 3

File details

Details for the file pyopenrivercam-0.9.6.tar.gz.

File metadata

  • Download URL: pyopenrivercam-0.9.6.tar.gz
  • Upload date:
  • Size: 154.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyopenrivercam-0.9.6.tar.gz
Algorithm Hash digest
SHA256 17cf0e90b7e750923949462bd0a68ca246fcc954ec68f100813726e97799af86
MD5 07b8377bc5e1d265ae3936c94525387d
BLAKE2b-256 5afddad4d8377d1d88ed25b9a1aef7b374cdab524ac1a7903416a4906349e7cc

See more details on using hashes here.

File details

Details for the file pyopenrivercam-0.9.6-py3-none-any.whl.

File metadata

  • Download URL: pyopenrivercam-0.9.6-py3-none-any.whl
  • Upload date:
  • Size: 152.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyopenrivercam-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8e8559bd4079f754b66553019b4f2e71ecf8858227982e3dbd5307b62f9761c6
MD5 5a09ab2dbe1ee6869b0237a9f6d44678
BLAKE2b-256 17906eea11eff864e6e5de39d30de706e4755fe939c72e554ef7b92b943206ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page