MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Contours.hpp File Reference

Contour extraction from binary float masks. More...

#include "Features.hpp"
+ Include dependency graph for Contours.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Kinesis
 
namespace  MayaFlux::Kinesis::Vision
 

Functions

void MayaFlux::Kinesis::Vision::apply_contour_mask (std::span< float > pixels, uint32_t w, uint32_t h, uint32_t channels, const Contour &contour, float origin_x, float origin_y, float scale_x, float scale_y)
 Zero all pixels in pixels that fall outside contour.
 
std::vector< ContourMayaFlux::Kinesis::Vision::find_contours (std::span< const float > mask, uint32_t w, uint32_t h, float min_area=0.0F, uint32_t max_contours=0)
 Extract outer contours from a binary mask.
 

Detailed Description

Contour extraction from binary float masks.

Pure functions. No MayaFlux type dependencies.

Conventions

  • Input masks are single-channel float where >= 0.5f is foreground
  • Contour points are in normalised image coordinates [0, 1]
  • 8-connectivity is used for contour tracing
  • Area is normalised to [0, 1] relative to total image area (w * h)
  • Perimeter is normalised to [0, 1] relative to image diagonal

Definition in file Contours.hpp.