MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ extract()

void MayaFlux::Yantra::Vision::VisionMatrix::extract ( const Kinesis::Vision::VisionAnalysis &  analysis,
const std::shared_ptr< Core::VKImage > &  image 
)

Extract from image with analysis and keep all three until the next call.

analysis() and frame() return analysis and image, extraction() what the extractor produced. The analysis may come from another frame.

Definition at line 79 of file VisionMatrix.cpp.

80{
81 count_call();
83 m_frame = image;
84 m_extraction.reset();
85
86 if (!image || !extractor())
87 return;
88
90 input.metadata["vision_analysis"] = analysis;
91 input.metadata["vision_image"] = image;
92
93 const auto output = with(std::move(input)).then<VisionExtractor>("extract").to_io();
94 if (const auto extracted = Kakshya::get_metadata_value<std::shared_ptr<Core::VKImage>>(output.metadata, "vision_extraction"))
95 m_extraction = *extracted;
96}
Core::GlobalInputConfig input
Definition Config.cpp:42
IO::ImageData image
Definition Decoder.cpp:47
FluentExecutor< ComputeMatrix, StartType > with(const Datum< StartType > &input)
Create a fluent executor for chaining operations.
std::shared_ptr< VisionExtractor > extractor()
The matrix's "extract" operation, or null when the matrix was built without a mode.
Kinesis::Vision::VisionAnalysis m_analysis
std::shared_ptr< Core::VKImage > m_extraction
std::shared_ptr< Core::VKImage > m_frame
const Kinesis::Vision::VisionAnalysis & analysis() const
The analysis of the last execute() or extract(), empty before the first.
std::optional< T > get_metadata_value(const std::unordered_map< std::string, std::any > &metadata, const std::string &key)
Get a value from a metadata map by key.
Datum< std::shared_ptr< Kakshya::SignalSourceContainer > > ContainerIO
IO for signal containers.
Definition DataIO.hpp:384

References analysis(), count_call(), extractor(), MayaFlux::Kakshya::get_metadata_value(), image, input, m_analysis, m_extraction, m_frame, MayaFlux::Yantra::Datum< T >::metadata, and MayaFlux::Yantra::ComputeMatrix::with().

Referenced by create(), and VisionMatrix().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: