HighMap library (C++)
Loading...
Searching...
No Matches
features.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
13#pragma once
14
15#include "highmap/array.hpp"
16
40#define HMAP_PACK8(a, b, c, d, e, f, g, h) \
41 ((a << 15) + (b << 13) + (c << 11) + (d << 9) + (e << 7) + (f << 5) + \
42 (g << 3) + (h << 1))
43
44namespace hmap
45{
46
82Array connected_components(const Array &array,
83 float surface_threshold = 0.f,
84 float background_value = 0.f);
85
117Array geomorphons(const Array &array, int irmin, int irmax, float epsilon);
118
169Array kmeans_clustering2(const Array &array1,
170 const Array &array2,
171 int nclusters,
172 std::vector<Array> *p_scoring = nullptr,
173 Array *p_aggregate_scoring = nullptr,
174 Vec2<float> weights = {1.f, 1.f},
175 uint seed = 1);
176
220Array kmeans_clustering3(const Array &array1,
221 const Array &array2,
222 const Array &array3,
223 int nclusters,
224 std::vector<Array> *p_scoring = nullptr,
225 Array *p_aggregate_scoring = nullptr,
226 Vec3<float> weights = {1.f, 1.f, 1.f},
227 uint seed = 1);
228
256Array local_median_deviation(const Array &array, int ir);
257
281Array mean_local(const Array &array, int ir);
282
308Array relative_elevation(const Array &array, int ir);
309
331Array ruggedness(const Array &array, int ir);
332
357Array rugosity(const Array &z, int ir, bool convex = true);
358
382Array std_local(const Array &array, int ir);
383
418Array valley_width(const Array &z, int ir = 0, bool ridge_select = false);
419
420Array z_score(const Array &array, int ir);
421
422} // namespace hmap
423
424namespace hmap::gpu
425{
426
428Array local_median_deviation(const Array &array, int ir);
429
431Array mean_local(const Array &array, int ir);
432
434Array relative_elevation(const Array &array, int ir);
435
437Array ruggedness(const Array &array, int ir);
438
440Array rugosity(const Array &z, int ir, bool convex = true);
441
443Array std_local(const Array &array, int ir);
444
446Array z_score(const Array &array, int ir);
447
448} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
unsigned int uint
Definition array.hpp:14
Definition blending.hpp:151
Array local_median_deviation(const Array &array, int ir)
See hmap::local_median_deviation.
Definition features_gpu.cpp:12
Array relative_elevation(const Array &array, int ir)
See hmap::relative_elevation.
Definition features_gpu.cpp:41
Array ruggedness(const Array &array, int ir)
See hmap::ruggedness.
Definition features_gpu.cpp:52
Array z_score(const Array &array, int ir)
See hmap::z_score.
Definition features_gpu.cpp:121
Array rugosity(const Array &z, int ir, bool convex=true)
See hmap::rugosity.
Definition features_gpu.cpp:72
Array std_local(const Array &array, int ir)
See hmap::std_local.
Definition features_gpu.cpp:106
Array mean_local(const Array &array, int ir)
See hmap::mean_local.
Definition features_gpu.cpp:19
Definition algebra.hpp:28
Array std_local(const Array &array, int ir)
Computes the local standard deviation of a 2D array.
Definition features.cpp:118
Array mean_local(const Array &array, int ir)
Return the local mean based on a mean filter with a square kernel.
Definition features.cpp:23
Array z_score(const Array &array, int ir)
Definition features.cpp:146
Array rugosity(const Array &z, int ir, bool convex=true)
Estimates the rugosity of a surface by analyzing the skewness of the elevation data,...
Definition features.cpp:75
Array relative_elevation(const Array &array, int ir)
Calculates the relative elevation within a specified radius, helping to identify local highs and lows...
Definition features.cpp:37
Array local_median_deviation(const Array &array, int ir)
Computes the local median deviation of a 2D array.
Definition features.cpp:16
Array connected_components(const Array &array, float surface_threshold=0.f, float background_value=0.f)
Identifies and labels connected components within a binary or labeled array, with optional filtering ...
Definition connected_components.cpp:14
Array geomorphons(const Array &array, int irmin, int irmax, float epsilon)
Classifies terrain into geomorphological features based on the geomorphons method.
Definition geomorphons.cpp:14
Array valley_width(const Array &z, int ir=0, bool ridge_select=false)
Measures the valley width by calculating the distance from each point in a concave region to the fron...
Definition features.cpp:133
Array kmeans_clustering3(const Array &array1, const Array &array2, const Array &array3, int nclusters, std::vector< Array > *p_scoring=nullptr, Array *p_aggregate_scoring=nullptr, Vec3< float > weights={1.f, 1.f, 1.f}, uint seed=1)
Performs k-means clustering on three input arrays, providing more detailed cluster analysis by consid...
Definition kmeans_clustering.cpp:133
Array kmeans_clustering2(const Array &array1, const Array &array2, int nclusters, std::vector< Array > *p_scoring=nullptr, Array *p_aggregate_scoring=nullptr, Vec2< float > weights={1.f, 1.f}, uint seed=1)
Performs k-means clustering on two input arrays, grouping similar data points into clusters.
Definition kmeans_clustering.cpp:13
Array ruggedness(const Array &array, int ir)
Computes the ruggedness of each element in the input array.
Definition features.cpp:48