Skip to main content

Height normalization for point clouds using the Re-Height Normalization (ReHN) algorithm.

Project description

ReHN: Point Cloud Re-Height Normalization

English | 中文

Introduction

This repository contains the python implementation of point cloud Re-Height Normalization (ReHN). The code is based on the paper:

Fu, B., Deng, L., Sun, W., He, H., Li, H., Wang, Y., Wang, Y., 2024. Quantifying vegetation species functional traits along hydrologic gradients in karst wetland based on 3D mapping with UAV hyperspectral point cloud. Remote Sens. Environ. 307, 114160. doi:10.1016/j.rse.2024.114160. https://www.sciencedirect.com/science/article/pii/S0034425724001718

What it contains?

  • A python package rehn
  • A command line tool rehn
  • A sample point cloud data samples/HX_sample_with_ground.ply, from Guilin University of Technology, Fu Bolin's team.

You can simply use the command line tool for point cloud height normalization, or use the python package to integrate the height normalization into your own code.

Installation

Install from PyPI

If you have the ground point information of the point cloud, you can install it directly by:

pip install rehn

If you don't have the ground point information of the point cloud, you need to install the CSF dependency together:

pip install rehn[csf]

Install from source

Windows or Linux

git clone https://github.com/DLW3D/ReHN.git
cd ReHN
pip install -e .
# pip install -e . -i https://pypi.mirrors.ustc.edu.cn/simple

Usage

Use as a command line tool

Add the python bin path to PATH

Make sure you have add the python bin path to the system environment variable PATH. you can find it by:

  • Windows: where.exe python
  • Linux: which python

The python bin path may look like:

  • Windows: C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts
  • Linux: /etc/miniconda3/envs/env_name/bin

Run the following command to temporarily add the python bin path to PATH:

  • Windows: set PATH=%PATH%;C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts
  • Linux: export PATH=$PATH:/etc/miniconda3/envs/env_name/bin

Replace the path according to your actual situation

Run the rehn command

Run the following command to normalize the point cloud:

rehn -i samples/HX_sample_with_ground.ply -o samples/outputs/HXs_ReHN.ply -n samples/outputs/HXs_ReHN.npy

Optional arguments

  • -i or --pc_path: Required: Path to the input point cloud (PLY format)
  • -o or --save_path: Required: Path to save the output point cloud (PLY format)
  • -m or --dem_save_path: Path to save the DEM (npy format), default=None
  • -mr or --dem_resolution: Resolution of the DEM, default=0.2 meters
  • -f or --ground_feature_name: Name of the ground point feature in the point cloud, default=scalar_is_ground
  • See more options by rehn -h

Use as a Python package

from rehn import height_norm_f
height_norm_f('samples/HX_sample_with_ground.ply', 
              'samples/outputs/HXs_ReHN.ply', 
              'samples/outputs/HXs_ReHN.npy',)

or

from rehn import height_norm, count_dem
xyz = ...  # Load point cloud data
ground_mask = ...  # Load basic ground mask
norm_z, ground_mask = height_norm(xyz, ground_mask)
dem = count_dem(xyz, ground_mask)

Requirements

  • pykdtree
  • cloth-simulation-filter (Optional: CSF algorithm. You need it if you don't have potential ground labels)
  • numpy (If you need CSF, numpy < 2 is required)

Citation

If you find this work useful, please consider citing the following paper:

@article{FU2024114160,
author = {Bolin Fu and Liwei Deng and Weiwei Sun and Hongchang He and Huajian Li and Yong Wang and Yeqiao Wang},
title = {Quantifying vegetation species functional traits along hydrologic gradients in karst wetland based on 3D mapping with UAV hyperspectral point cloud},
journal = {Remote Sensing of Environment},
year = {2024},
}

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

rehn-1.0.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

ReHN-1.0.2-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file rehn-1.0.2.tar.gz.

File metadata

  • Download URL: rehn-1.0.2.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for rehn-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f759cd65a510c1af6bc7eb97152ddff3469341ddaaaa6a25dde652c4d6c5a2a5
MD5 a78b5132b23eae0143a2ef1e2dac649d
BLAKE2b-256 811bfced97347950e0e7753b78963eaef9e78eec245d5175219fd91a72271f2e

See more details on using hashes here.

File details

Details for the file ReHN-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ReHN-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for ReHN-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96b3ad075dcf13d228c88641e97b51d41112a308377025162ad5a1067d5f09aa
MD5 46acd105d5ffa4e07558c60037db9bcb
BLAKE2b-256 a80ecee30bbe8a2444e7aafa8b9b35d48477e4812bf6c8962a1dea30e1a76ea9

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