Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
texture_classification.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
10#include <momentum/math/mesh.h>
11
12#include <cstdint>
13#include <vector>
14
15namespace momentum {
16
19 const uint8_t* data;
20 int64_t height;
21 int64_t width;
22 int64_t stride0;
23 int64_t stride1;
24 int64_t stride2;
25};
26
29 const uint8_t* data;
30 int32_t nRegions;
31 int64_t stride0;
32 int64_t stride1;
33};
34
49std::vector<std::vector<int32_t>> classifyTrianglesByTexture(
50 const Mesh& mesh,
51 const TextureView& texture,
52 const RegionColorsView& regionColors,
53 float threshold = 0.0f,
54 int32_t numSamples = 3);
55
71 const Mesh& mesh,
72 const TextureView& texture,
73 const RegionColorsView& regionColors,
74 int32_t numBinarySearchSteps = 8);
75
76} // namespace momentum
std::vector< std::vector< int32_t > > classifyTrianglesByTexture(const Mesh &mesh, const TextureView &texture, const RegionColorsView &regionColors, float threshold, int32_t numSamples)
Classify mesh triangles into regions based on texture colors.
MeshT< float > Mesh
Definition fwd.h:20
Mesh splitMeshByTextureRegion(const Mesh &mesh, const TextureView &texture, const RegionColorsView &regionColors, int32_t numBinarySearchSteps)
Split mesh triangles along texture region boundaries.
View into a contiguous array of RGB region colors (non-owning).
int64_t stride1
Stride between channels in bytes.
int64_t stride0
Stride between regions in bytes.
View into a contiguous RGB texture image (non-owning).
int64_t stride2
Channel stride in bytes.
int64_t stride1
Column stride in bytes.
int64_t stride0
Row stride in bytes.