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

◆ motion_mask()

std::shared_ptr< Core::VKImage > MayaFlux::Yantra::VisionExtractor::motion_mask ( const std::shared_ptr< Core::VKImage > &  source,
const Kinesis::Vision::VisionAnalysis &  analysis,
uint32_t  source_w,
uint32_t  source_h 
)

source kept where analysis.estimate_motion moves faster than the motion limits with enough confidence.

Null when no flow was computed or motion_activity is below the activity limit.

Definition at line 647 of file VisionExtractor.cpp.

651{
652 if (!analysis.estimate_motion)
653 return nullptr;
654 if (analysis.motion_activity && *analysis.motion_activity < m_min_activity)
655 return nullptr;
656
657 auto& ctx = image_context();
658 use_shader(ctx, "flow_mask.comp.spv", k_wg_image, sizeof(MotionPC));
659 ctx.stage_image(source);
660 ctx.stage_image_at(2, analysis.estimate_motion, ElementType::IMAGE_SAMPLED, default_sampler());
661 ctx.set_push_constants(MotionPC {
662 .min_speed = m_min_speed, .min_confidence = m_min_confidence,
663 .out_w = source_w, .out_h = source_h });
664 return dispatch_image(ctx, source_w, source_h);
665}
TextureExecutionContext & image_context()
The two contexts every method shares, one shader swapped in per call.

References MayaFlux::Kinesis::Vision::VisionAnalysis::estimate_motion, image_context(), m_min_activity, m_min_confidence, m_min_speed, and MayaFlux::Kinesis::Vision::VisionAnalysis::motion_activity.

Referenced by run_operation().

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