Skip to main content

Convert a point cloud into a digital surface (or terrain) model with colors.

Project description

Overview

cars-rasterize aims to convert a point cloud into a digital surface (or terrain) model with colors.

It is a part of the photogrammetry tool cars extracting Digital Surface Models from satellite images.

Installation

cars-rasterize is available on Pypi and can be installed by:

pip install cars-rasterize

Quick start

  1. Download subsampled_nimes.laz*:
wget https://raw.githubusercontent.com/CNES/cars-rasterize/master/data/subsampled_nimes.laz
subsampled_nimes.laz
drawing

subsampled_nimes.laz* is from https://geoservices.ign.fr/lidarhd. and has been downsampled (1 point every 50cm) to make the file smaller.

  1. Run las2tif executable:
las2tif subsampled_nimes.laz dsm.tif --clr_out clr.tif
  1. ✅ Done! The executable generates two files:
  • dsm.tif: the elevation of the points (Z dimension) are projected into a regular grid to generate a raster file named Digital Surface Model.
  • clr.tif: the red, the green and the blue dimensions can be also projected producing a color interpretation map superimposable on DSM
dsm.tif clr.tif
drawing drawing

How it works

A LAS file contains a set of points $P = {(x, y, z, r, g, b)_k}$ each having several dimensions:

  • $x$ and $y$ correspond to planimetric information
  • $z$ corresponds to the altitude
  • $r$, $g$ and $b$ correspond to colorimetric information (respectively red, green, blue )

To create a raster digital surface model, we define a regular grid on a region of interest roi of origin $(x_{start}, y_{start})$, size $(x_{size}, y_{size})$ with a constant resolution.

For each cell of center $(c_x, c_y)$, we consider the subset of points contained in the disk $D$ (parameter radius) centered on this cell (see figure below):

Contributing points
drawing

Then, the altitude assigned $z(c_x, c_y)$ to the cell is a Gaussian weighted average (standard deviation sigma $\sigma$) of the distance $d$ to its center :

$$z(c_x, c_y) = \frac{\sum_{p_k \in D} z_k e^{-d_k^2/2\sigma^2}}{\sum_{p_k \in D} e^{-d_k^2/2\sigma^2}}$$

Finally, to have a superimposable color to this dsm, the colors are averaged in the same way.

Contribution

cars-rasterize is a free software: Apache Software License 2.0. See Contribution manual.

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

cars_rasterize-0.2.2.tar.gz (12.9 MB view details)

Uploaded Source

File details

Details for the file cars_rasterize-0.2.2.tar.gz.

File metadata

  • Download URL: cars_rasterize-0.2.2.tar.gz
  • Upload date:
  • Size: 12.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.4

File hashes

Hashes for cars_rasterize-0.2.2.tar.gz
Algorithm Hash digest
SHA256 cc5479f4884d888c48c3b2d8d05eb6f51e6f0dd48742a38f8fb753545fc01438
MD5 f1fce832e7c31943d63807dd66753478
BLAKE2b-256 fec621546607c33523b19fd22aa3feb8845a60ed3f930518c562fa1a63a38d6b

See more details on using hashes here.

Supported by

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