<div align="center">
<a target="_blank" href="https://github.com/CNES/cars">
<picture>
<source
srcset="https://raw.githubusercontent.com/CNES/cars/master/docs/source/images/picto_dark.png"
media="(prefers-color-scheme: dark)"
/>
<img
src="https://raw.githubusercontent.com/CNES/cars/master/docs/source/images/picto_light.png"
alt="CARS"
width="40%"
/>
</picture>
</a>
<h4>cars-rasterize</h4>
[![Python](https://img.shields.io/badge/python-v3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](CONTRIBUTING.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0/)
<p>
<a href="#overview">Overview</a> •
<a href="#installation">Installation</a> •
<a href="#quick-start">Quick Start</a> •
<a href="#how-it-works">How It Works</a> •
<a href="#contribution">Contribution</a>
</p>
</div>
## 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](https://github.com/cnes/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 |
:-------------------------:|
<img src="https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes.gif" alt="drawing" width="400"/>
[subsampled_nimes.laz*](./data/subsampled_nimes.laz) is from https://geoservices.ign.fr/lidarhd. and has been downsampled (1 point every 50cm) to make the file smaller.
2. Run **las2tif** executable:
```
las2tif subsampled_nimes.laz dsm.tif --clr_out clr.tif
```
3. ✅ 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
:-------------------------:|:-------------------------:
<img src="https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes_elevation.png" alt="drawing" width="300"/>| <img src="https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes_colors.png" alt="drawing" width="300"/>
## 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 |
:-------------------------:|
<img src="https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/contributing_points.png" alt="drawing" width="600"/>
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](./CONTRIBUTING.md) manual.
Raw data
{
"_id": null,
"home_page": "https://github.com/CNES/cars-rasterize",
"name": "cars-rasterize",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "cars-rasterize, 3D, DEM, cars, pandora, photogrammetry",
"author": "CNES",
"author_email": "cars@cnes.fr",
"download_url": "https://files.pythonhosted.org/packages/fe/c6/21546607c33523b19fd22aa3feb8845a60ed3f930518c562fa1a63a38d6b/cars_rasterize-0.2.2.tar.gz",
"platform": "any",
"description": "<div align=\"center\">\n<a target=\"_blank\" href=\"https://github.com/CNES/cars\">\n<picture>\n <source\n srcset=\"https://raw.githubusercontent.com/CNES/cars/master/docs/source/images/picto_dark.png\"\n media=\"(prefers-color-scheme: dark)\"\n />\n <img\n src=\"https://raw.githubusercontent.com/CNES/cars/master/docs/source/images/picto_light.png\"\n alt=\"CARS\"\n width=\"40%\"\n />\n</picture>\n</a>\n\n<h4>cars-rasterize</h4>\n\n[![Python](https://img.shields.io/badge/python-v3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](CONTRIBUTING.md)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0/)\n\n<p>\n <a href=\"#overview\">Overview</a> \u2022\n <a href=\"#installation\">Installation</a> \u2022\n <a href=\"#quick-start\">Quick Start</a> \u2022\n <a href=\"#how-it-works\">How It Works</a> \u2022\n <a href=\"#contribution\">Contribution</a>\n</p>\n</div>\n\n## Overview\n\n**cars-rasterize** aims to convert a point cloud into a digital surface (or terrain) model with colors.\n\nIt is a part of the photogrammetry tool [cars](https://github.com/cnes/cars) extracting Digital Surface Models from satellite images.\n\n## Installation\n**cars-rasterize** is available on Pypi and can be installed by:\n```\npip install cars-rasterize\n```\n\n## Quick start\n\n1. Download **subsampled_nimes.laz***:\n```\nwget https://raw.githubusercontent.com/CNES/cars-rasterize/master/data/subsampled_nimes.laz\n```\n\nsubsampled_nimes.laz |\n:-------------------------:|\n<img src=\"https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes.gif\" alt=\"drawing\" width=\"400\"/> \n\n[subsampled_nimes.laz*](./data/subsampled_nimes.laz) is from https://geoservices.ign.fr/lidarhd. and has been downsampled (1 point every 50cm) to make the file smaller.\n\n2. Run **las2tif** executable:\n```\nlas2tif subsampled_nimes.laz dsm.tif --clr_out clr.tif\n```\n\n3. \u2705 Done! The executable generates two files:\n- **dsm.tif**: the elevation of the points (Z dimension) are projected into a regular grid to generate a raster file named Digital Surface Model.\n- **clr.tif**: the red, the green and the blue dimensions can be also projected producing a color interpretation map superimposable on DSM\n\ndsm.tif | clr.tif\n:-------------------------:|:-------------------------:\n<img src=\"https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes_elevation.png\" alt=\"drawing\" width=\"300\"/>| <img src=\"https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/nimes_colors.png\" alt=\"drawing\" width=\"300\"/>\n\n\n## How it works\n\nA LAS file contains a set of points $P = \\{(x, y, z, r, g, b)_k\\}$ each having several dimensions:\n- $x$ and $y$ correspond to planimetric information\n- $z$ corresponds to the altitude\n- $r$, $g$ and $b$ correspond to colorimetric information (respectively red, green, blue )\n\n\nTo 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**.\n\nFor 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):\n\nContributing points |\n:-------------------------:|\n<img src=\"https://raw.githubusercontent.com/CNES/cars-rasterize/master/docs/images/contributing_points.png\" alt=\"drawing\" width=\"600\"/>\n\nThen, 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 :\n\n$$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}}$$\n\nFinally, to have a superimposable color to this dsm, the colors are averaged in the same way.\n\n## Contribution\n**cars-rasterize** is a free software: Apache Software License 2.0. See [Contribution](./CONTRIBUTING.md) manual.\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Convert a point cloud into a digital surface (or terrain) model with colors.",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/CNES/cars-rasterize"
},
"split_keywords": [
"cars-rasterize",
" 3d",
" dem",
" cars",
" pandora",
" photogrammetry"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fec621546607c33523b19fd22aa3feb8845a60ed3f930518c562fa1a63a38d6b",
"md5": "f1fce832e7c31943d63807dd66753478",
"sha256": "cc5479f4884d888c48c3b2d8d05eb6f51e6f0dd48742a38f8fb753545fc01438"
},
"downloads": -1,
"filename": "cars_rasterize-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "f1fce832e7c31943d63807dd66753478",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12923093,
"upload_time": "2024-09-27T15:59:29",
"upload_time_iso_8601": "2024-09-27T15:59:29.248892Z",
"url": "https://files.pythonhosted.org/packages/fe/c6/21546607c33523b19fd22aa3feb8845a60ed3f930518c562fa1a63a38d6b/cars_rasterize-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-27 15:59:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CNES",
"github_project": "cars-rasterize",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"tox": true,
"lcname": "cars-rasterize"
}