MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::Vision::VisionWorkflow Class Reference

Runs vision queries over video streams, image lists and texture containers, delivering what an extraction takes from each frame. More...

#include <VisionWorkflow.hpp>

+ Collaboration diagram for MayaFlux::Yantra::Vision::VisionWorkflow:

Public Member Functions

VisionWorkflow & operator= (const VisionWorkflow &)=delete
 
VisionWorkflow & operator= (VisionWorkflow &&)=delete
 
std::shared_ptr< Buffers::TextureBuffer > process_to_buffer (const std::shared_ptr< VisionMatrix > &matrix, const std::shared_ptr< Kakshya::VideoStreamContainer > &source, const Portal::Graphics::RenderConfig &render, const std::optional< LiveConfig > &live={})
 process_to_buffer() with a matrix the caller made and configured, such as its extractor's sizes, focus or limits.
 
std::shared_ptr< Buffers::TextureBuffer > process_to_buffer (const WorkflowBufferConfig &config)
 Run config's query on its source live and show what its extraction takes from each frame in a texture buffer.
 
std::shared_ptr< Kakshya::TextureCollection > process_to_live_container (const std::shared_ptr< VisionMatrix > &matrix, const std::shared_ptr< Kakshya::VideoStreamContainer > &source, Kakshya::TextureCollectionSpec spec={}, const std::optional< LiveConfig > &live={})
 process_to_live_container() with a matrix the caller made and configured.
 
std::shared_ptr< Kakshya::TextureCollection > process_to_live_container (const WorkflowContainerConfig &config)
 Run config's query on its source live and record what its extraction takes from each frame into a growing collection.
 
Kriya::ChimeraBuilder process_to_stream (const WorkflowStreamConfig &config)
 Run config's matrix on its source live and return a Chimera builder over a new layer array, for any image the run produces.
 
void stop_all ()
 Stop every live run this workflow started and release what they hold.
 
 VisionWorkflow (const std::shared_ptr< Vruta::TaskScheduler > &scheduler, const std::shared_ptr< Vruta::EventManager > &event_manager, const std::shared_ptr< IO::IOManager > &io_manager, const std::shared_ptr< Buffers::BufferManager > &buffer_manager)
 
 VisionWorkflow (const VisionWorkflow &)=delete
 
 VisionWorkflow (VisionWorkflow &&)=delete
 
 ~VisionWorkflow ()
 Stops every live run this workflow started.
 

Static Public Member Functions

static std::shared_ptr< Kakshya::TextureCollection > process_to_container (const std::shared_ptr< Kakshya::TextureContainer > &frames, Kinesis::Vision::VisionQuery query, VisionExtractMode extract, Kakshya::TextureCollectionSpec spec={})
 Run query over the layers of frames in order and record what extract takes from each into a collection.
 
static std::shared_ptr< Kakshya::TextureCollection > process_to_container (const std::vector< std::shared_ptr< Core::VKImage > > &frames, Kinesis::Vision::VisionQuery query, VisionExtractMode extract, Kakshya::TextureCollectionSpec spec={})
 Run query over frames in order and record what extract takes from each into a collection.
 

Private Member Functions

void keep (const std::string &name, const std::shared_ptr< Vruta::Event > &consumer)
 
std::shared_ptr< Buffers::TextureBuffer > source_frames (const std::shared_ptr< Kakshya::VideoStreamContainer > &source, std::string_view caller) const
 
void start (const std::shared_ptr< Kakshya::VideoStreamContainer > &source, const std::shared_ptr< Buffers::TextureBuffer > &frames, const LiveConfig &live, const std::shared_ptr< VisionMatrix > &matrix, const std::string &name, std::function< void(const VisionIO &)> consumer, std::function< bool()> stop_when={})
 Subscribe consumer and start the producer named name, which stops the run at source's end, or once stop_when reports true when it is given.
 

Private Attributes

std::weak_ptr< Buffers::BufferManager > m_buffer_manager
 
std::weak_ptr< Vruta::EventManager > m_event_manager
 
std::weak_ptr< IO::IOManager > m_io_manager
 
std::vector< std::pair< std::string, std::weak_ptr< Vruta::Event > > > m_runs
 Per live run: its producer task's name and its consumer.
 
std::weak_ptr< Vruta::TaskScheduler > m_scheduler
 

Detailed Description

Runs vision queries over video streams, image lists and texture containers, delivering what an extraction takes from each frame.

The live methods set a run going on the engine: an analysis producer on the scheduler and a delivering consumer on the event manager. They need a constructed workflow, and accept any video stream: a camera, a video file or a dynamic stream. A run keeps going until its stream reaches its end, stop_all(), the workflow's destruction, or engine shutdown. The managers are held weakly, so a workflow kept past shutdown keeps nothing alive and stops nothing.

The finite methods are static: they run to completion on the calling thread and need no engine, so call them where no other vision work is running.

In every method an intent set in the query without its parameters runs with the defaults, and tracking and motion carry from one frame to the next. The extraction mode must produce an image.

Definition at line 127 of file VisionWorkflow.hpp.


The documentation for this class was generated from the following files: