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#include <array>
15
16#include "highmap/array.hpp"
17
41#define HMAP_PACK8(a, b, c, d, e, f, g, h) \
42 ((a << 15) + (b << 13) + (c << 11) + (d << 9) + (e << 7) + (f << 5) + \
43 (g << 3) + (h << 1))
44
45namespace hmap
46{
47
86 const Array &array,
87 float surface_threshold = 0.f,
88 float background_value = 0.f,
89 std::map<float, float> *p_surfaces = nullptr,
90 std::map<float, std::array<float, 2>> *p_centroids = nullptr);
91
123Array geomorphons(const Array &array, int irmin, int irmax, float epsilon);
124
175Array kmeans_clustering2(const Array &array1,
176 const Array &array2,
177 int nclusters,
178 std::vector<Array> *p_scoring = nullptr,
179 Array *p_aggregate_scoring = nullptr,
180 glm::vec2 weights = {1.f, 1.f},
181 uint seed = 1);
182
226Array kmeans_clustering3(const Array &array1,
227 const Array &array2,
228 const Array &array3,
229 int nclusters,
230 std::vector<Array> *p_scoring = nullptr,
231 Array *p_aggregate_scoring = nullptr,
232 glm::vec3 weights = {1.f, 1.f, 1.f},
233 uint seed = 1);
234
235} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
unsigned int uint
Definition array.hpp:14
Definition algebra.hpp:23
Array connected_components(const Array &array, float surface_threshold=0.f, float background_value=0.f, std::map< float, float > *p_surfaces=nullptr, std::map< float, std::array< float, 2 > > *p_centroids=nullptr)
Identifies and labels connected components within a binary or labeled array, with optional filtering ...
Definition connected_components.cpp:15
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 kmeans_clustering3(const Array &array1, const Array &array2, const Array &array3, int nclusters, std::vector< Array > *p_scoring=nullptr, Array *p_aggregate_scoring=nullptr, glm::vec3 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, glm::vec2 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