Skip to main content

Rectify oblique images to a planar surface

Project description

Tests

Plan-Rect

Plan-Rect is command line tool for rectifying oblique images to a plane.

Installation

Plan-Rect is a python 3 package that depends on Orthority. It has not yet been published to PyPI or conda-forge. To install the package, first clone the repository:

git clone https://github.com/leftfield-geospatial/plan-rect.git
cd plan-rect

Then use pip to install in editable mode:

pip install -e .

If installing into a conda environment, it is best to install Orthority with conda first, before running the command above:

conda install -c conda-forge "orthority>=0.6.0"

Usage

Rectification is performed with the plan-rect command. It requires an image, camera interior parameters and marker locations as inputs, and creates a rectified image and rectification data file as outputs. Its options are described below:

Option Value Description
-im / --image FILE Path / URI of the source image (required).
-fl / --focal-len FLOAT Camera focal length (any units).
-ss / --sensor-size WIDTH HEIGHT Camera sensor size in the same units as -fl / --focal-len.
-ip / --int-param FILE Path / URI of an Orthority format interior parameter file.
-m / --marker ID X Y COL ROW Marker ID and location in world and pixel coordinates, with pixel coordinate origin at the bottom left image corner.
-g / --gcp FILE Path / URI of an Orthority GCP file defining marker locations.
-r / --res FLOAT Rectified pixel size in meters. Can be used twice for non-square pixels: --res WIDTH --res HEIGHT. Defaults to the ground sampling distance.
-i / --interp nearest, average, bilinear, cubic, lanczos Interpolation method for remapping source to rectified image. Defaults to cubic.
-n / --nodata FLOAT Nodata value for the rectified image. Defaults to the maximum value of the image data type if it is integer, and nan if it is floating point.
-ep / --export-params Export interior parameters and markers to Orthority format files and exit.
-od / --out-dir DIRECTORY Path / URI of the output file directory. Defaults to the current working directory.
-o / --overwrite Overwrite existing output(s).
--version Show the version and exit.
--help Show the help and exit.

Camera interior parameters are required with either -fl / --focal-len and -ss / --sensor-size, or -ip / --int-param.

Marker locations are required with either -m / --marker or -g / --gcp. The -m / --marker option can be provided multiple times. At least three markers are required.

Examples

Supply interior parameters with -fl / --focal-len and -ss / --sensor-size, and marker locations with -m / --marker:

plan-rect --image source.jpg --focal-len 50 --sensor-size 31.290 23.491 --marker A 0 0 1002 1221 --marker B 2.659 0 4261 1067 --marker C 2.321 5.198 3440 3706 --marker D -0.313 4.729 1410 3663

Supply interior parameters with -ip / --int-param and marker locations with -g / --gcp:

plan-rect --image source.jpg --int-param int_param.yaml --gcp gcps.geojson

Set the rectified image pixel size with -r / --res:

plan-rect --image source.jpg --res 0.01 --int-param int_param.yaml --gcp gcps.geojson

Export interior parameters and marker locations to Orthority format files in the data directory, overwriting existing outputs:

plan-rect --image source.jpg --export-params --out-dir data --overwrite --focal-len 50 --sensor-size 31.290 23.491 --marker A 0 0 1002 1221 --marker B 2.659 0 4261 1067 --marker C 2.321 5.198 3440 3706 --marker D -0.313 4.729 1410 3663

Licence

Plan-Rect is licenced under the GNU Affero General Public License v3.0 (AGPLv3).

Acknowledgments

This project was funded by NedCAD.

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

plan_rect-0.1.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

plan_rect-0.1.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file plan_rect-0.1.0.tar.gz.

File metadata

  • Download URL: plan_rect-0.1.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for plan_rect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d98f39773c0720bdb91bdc98eedcfc7f20db7fd9073e80bdfe92facc61ee0fb8
MD5 875e4ecaa8448aaed462144b3147ae6b
BLAKE2b-256 afc90768e17fc287cf2c5e3427a5a44b7534e1fc608e6cd96931a646c45c3b10

See more details on using hashes here.

Provenance

The following attestation bundles were made for plan_rect-0.1.0.tar.gz:

Publisher: publish-pypi.yml on leftfield-geospatial/plan-rect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plan_rect-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: plan_rect-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for plan_rect-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 390082cd854721e97c105f799a7a90b62f6bf14f75c66b6beb445cc49e7455bf
MD5 8ea46b1e6725a77080c2d00c3cdd6159
BLAKE2b-256 d063aadc0c2a621e8ec3bc5f2fa3f69f408504da8f503a3fb5a4e3a09a82f1ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for plan_rect-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on leftfield-geospatial/plan-rect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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