MayaFlux
0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Features.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
MayaFlux/Kinesis/Spatial/Bounds.hpp
"
4
5
namespace
MayaFlux::Kinesis::Vision
{
6
7
/**
8
* @brief Axis-aligned bounding box in normalised image coordinates.
9
*
10
* Origin is top-left, x and y in [0, 1], +Y down. Distinct from
11
* Kinesis::AABB2D which is NDC with center origin and +Y up.
12
*
13
* Use to_ndc() to convert to AABB2D for Forma hit testing.
14
*/
15
struct
BoundingBox
{
16
float
x
{};
17
float
y
{};
18
float
w
{};
19
float
h
{};
20
float
confidence
{ 1.0F };
21
uint32_t
label_id
{};
22
23
/**
24
* @brief Convert to NDC AABB2D for use with Portal::Forma::Element.
25
*
26
* Maps [0, 1] image space to [-1, 1] NDC, flipping Y axis.
27
*/
28
[[nodiscard]]
Kinesis::AABB2D
to_ndc
() const noexcept
29
{
30
return
{
31
.
min
= {
x
* 2.0F - 1.0F, 1.0F - (
y
+
h
) * 2.0F },
32
.max = { (
x
+
w
) * 2.0F - 1.0F, 1.0F -
y
* 2.0F },
33
};
34
}
35
};
36
37
/**
38
* @brief Closed contour extracted from a binary mask.
39
*
40
* Points are in normalised image coordinates [0, 1], top-left origin.
41
*/
42
struct
Contour
{
43
std::vector<glm::vec2>
points
;
44
float
area
;
45
float
perimeter
;
46
47
/**
48
* @brief 0 for an outer contour. For a hole contour, the label id
49
* (1-based) of the foreground component this hole is
50
* enclosed by.
51
*/
52
uint32_t
parent_label
{ 0U };
53
};
54
55
/**
56
* @brief Single interest point produced by a corner or blob detector.
57
*
58
* Position is in normalised image coordinates [0, 1], top-left origin.
59
*/
60
struct
Keypoint
{
61
glm::vec2
position
;
62
float
response
;
63
float
scale
;
64
float
angle
;
65
};
66
67
/**
68
* @brief Pixel buffer captured mid-pipeline by a Snapshot step.
69
*
70
* pixels is a normalised float buffer in the format active at the snapshot
71
* point. channels distinguishes single-channel (grayscale, Harris response)
72
* from three-channel (HSV) and four-channel (RGBA).
73
*/
74
struct
SnapshotEntry
{
75
std::vector<float>
pixels
;
76
uint32_t
w
{ 0 };
77
uint32_t
h
{ 0 };
78
uint32_t
channels
{ 0 };
79
};
80
81
}
// namespace MayaFlux::Kinesis::Vision
Bounds.hpp
MayaFlux::Kinesis::Vision
Definition
ConnectedComponents.cpp:3
MayaFlux::Kinesis::AABB2D::min
glm::vec2 min
Definition
Bounds.hpp:22
MayaFlux::Kinesis::AABB2D
Axis-aligned bounding rectangle in a 2D coordinate space.
Definition
Bounds.hpp:21
MayaFlux::Kinesis::Vision::BoundingBox::y
float y
Definition
Features.hpp:17
MayaFlux::Kinesis::Vision::BoundingBox::h
float h
Definition
Features.hpp:19
MayaFlux::Kinesis::Vision::BoundingBox::w
float w
Definition
Features.hpp:18
MayaFlux::Kinesis::Vision::BoundingBox::confidence
float confidence
Definition
Features.hpp:20
MayaFlux::Kinesis::Vision::BoundingBox::x
float x
Definition
Features.hpp:16
MayaFlux::Kinesis::Vision::BoundingBox::to_ndc
Kinesis::AABB2D to_ndc() const noexcept
Convert to NDC AABB2D for use with Portal::Forma::Element.
Definition
Features.hpp:28
MayaFlux::Kinesis::Vision::BoundingBox::label_id
uint32_t label_id
Definition
Features.hpp:21
MayaFlux::Kinesis::Vision::BoundingBox
Axis-aligned bounding box in normalised image coordinates.
Definition
Features.hpp:15
MayaFlux::Kinesis::Vision::Contour::perimeter
float perimeter
Definition
Features.hpp:45
MayaFlux::Kinesis::Vision::Contour::area
float area
Definition
Features.hpp:44
MayaFlux::Kinesis::Vision::Contour::parent_label
uint32_t parent_label
0 for an outer contour.
Definition
Features.hpp:52
MayaFlux::Kinesis::Vision::Contour::points
std::vector< glm::vec2 > points
Definition
Features.hpp:43
MayaFlux::Kinesis::Vision::Contour
Closed contour extracted from a binary mask.
Definition
Features.hpp:42
MayaFlux::Kinesis::Vision::Keypoint::angle
float angle
Definition
Features.hpp:64
MayaFlux::Kinesis::Vision::Keypoint::position
glm::vec2 position
Definition
Features.hpp:61
MayaFlux::Kinesis::Vision::Keypoint::scale
float scale
Definition
Features.hpp:63
MayaFlux::Kinesis::Vision::Keypoint::response
float response
Definition
Features.hpp:62
MayaFlux::Kinesis::Vision::Keypoint
Single interest point produced by a corner or blob detector.
Definition
Features.hpp:60
MayaFlux::Kinesis::Vision::SnapshotEntry::pixels
std::vector< float > pixels
Definition
Features.hpp:75
MayaFlux::Kinesis::Vision::SnapshotEntry::h
uint32_t h
Definition
Features.hpp:77
MayaFlux::Kinesis::Vision::SnapshotEntry::channels
uint32_t channels
Definition
Features.hpp:78
MayaFlux::Kinesis::Vision::SnapshotEntry::w
uint32_t w
Definition
Features.hpp:76
MayaFlux::Kinesis::Vision::SnapshotEntry
Pixel buffer captured mid-pipeline by a Snapshot step.
Definition
Features.hpp:74
src
MayaFlux
Kinesis
Vision
Features.hpp
Generated by
1.9.8