mirror of
https://github.com/truebelief/cc-treeiso-plugin.git
synced 2026-08-29 08:34:29 +08:00
0e18ee5e2b
* Major upgrade of dependencies and running time 1. Removed the Boost dependency by adopting a newer cut-pursuit version from the authors (resulting in a 5–15× speed improvement). 2. Fixed an issue with the nearest neighbor search caused by an incorrect 2D array order input to the knn_cpp query function. 3. Enabled customization of the number of threads for knn-cpp, yielding a slight speed improvement. 4. Optimized array calculations through enhanced use of STL algorithms. * Change log added * Smoothened the progress bar and added ground detectioned - Improved progress bar increment - Added rapid detection of ground points based on quantile distribution - Added warning of ground points before continuing initial segmentation * Crash fix - Avoided crashes by adding error handling once the maximum component limit is reached - Improved the speed of unique and get_subset functions
56 lines
4.3 KiB
C++
56 lines
4.3 KiB
C++
#pragma once
|
||
|
||
//#######################################################################################
|
||
//# #
|
||
//# CLOUDCOMPARE PLUGIN: qTreeIso #
|
||
//# #
|
||
//# This program is free software; you can redistribute it and/or modify #
|
||
//# it under the terms of the GNU General Public License as published by #
|
||
//# the Free Software Foundation; version 2 or later of the License. #
|
||
//# #
|
||
//# This program is distributed in the hope that it will be useful, #
|
||
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||
//# GNU General Public License for more details. #
|
||
//# #
|
||
//# Please cite the following paper if you find this tool helpful #
|
||
//# #
|
||
//# Xi, Z.; Hopkinson, C. 3D Graph-Based Individual-Tree Isolation (Treeiso) #
|
||
//# from Terrestrial Laser Scanning Point Clouds. Remote Sens. 2022, 14, 6116. #
|
||
//# https://doi.org/10.3390/rs14236116 #
|
||
//# #
|
||
//# Our work relies on the cut-pursuit algorithm, please also consider citing: #
|
||
//# Landrieu, L.; Obozinski, G. Cut Pursuit: Fast Algorithms to Learn Piecewise #
|
||
//# Constant Functions on General Weighted Graphs. SIAM J. Imaging Sci. #
|
||
//# 2017, 10, 1724–1766. #
|
||
//# #
|
||
//# Copyright © #
|
||
//# Artemis Lab, Department of Geography & Environment #
|
||
//# University of Lethbridge, Canada #
|
||
//# #
|
||
//# #
|
||
//# Zhouxin Xi and Chris Hopkinson; #
|
||
//# truebelief2010@gmail.com; c.hopkinson@uleth.ca #
|
||
//# #
|
||
//#######################################################################################
|
||
|
||
// Matlab and python versions shared via:
|
||
// https://github.com/truebelief/artemis_treeiso
|
||
|
||
class ccMainAppInterface;
|
||
class ccPointCloud;
|
||
class QProgressDialog;
|
||
|
||
class TreeIso
|
||
{
|
||
public:
|
||
|
||
static bool Init_seg(const unsigned PR_MIN_NN1,const float PR_REG_STRENGTH1,const float PR_DECIMATE_RES1,const unsigned PR_THREADS1,ccMainAppInterface* app, std::function<void(int)> progressCallBack);
|
||
static bool Intermediate_seg(const unsigned PR_MIN_NN2, const float PR_REG_STRENGTH2, const float PR_DECIMATE_RES2, const float PR_MAX_GAP, const unsigned PR_THREADS2, ccMainAppInterface* app, std::function<void(int)> progressCallBack);
|
||
static bool Final_seg(const unsigned PR_MIN_NN3, const float PR_REL_HEIGHT_LENGTH_RATIO, const float PR_VERTICAL_WEIGHT, ccMainAppInterface* app, std::function<void(int)> progressCallBack);
|
||
|
||
static bool Init_seg_pcd(ccPointCloud* pc, const unsigned PR_MIN_NN1, const float PR_REG_STRENGTH1, const float PR_DECIMATE_RES1, const unsigned PR_THREADS1, std::function<void(int)> progressCallback);
|
||
static bool Intermediate_seg_pcd(ccPointCloud* pc, const unsigned PR_MIN_NN2, const float PR_REG_STRENGTH2, const float PR_DECIMATE_RES2, const float PR_MAX_GAP, const unsigned PR_THREADS2, std::function<void(int)> progressCallback);
|
||
static bool Final_seg_pcd(ccPointCloud* pc, const unsigned PR_MIN_NN3, const float PR_REL_HEIGHT_LENGTH_RATIO, const float PR_VERTICAL_WEIGHT, std::function<void(int)> progressCallback);
|
||
};
|