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

◆ focus_box_index()

std::optional< size_t > MayaFlux::Yantra::VisionExtractor::focus_box_index ( const Kinesis::Vision::VisionAnalysis &  analysis)
private

Box index of the element the single-element methods act on.

Definition at line 224 of file VisionExtractor.cpp.

225{
226 if (!analysis.find_elements)
227 return std::nullopt;
228
229 const auto& elements = *analysis.find_elements;
230
231 if (m_focus)
232 return select_element(analysis, *m_focus);
233
234 if (m_element_index < elements.contours.size()) {
235 const auto label = elements.contours[m_element_index].label_id;
236 if (label != 0 && label <= elements.boxes.size())
237 return static_cast<size_t>(label - 1U);
238 }
239
240 if (m_element_index < elements.boxes.size())
241 return m_element_index;
242
243 return std::nullopt;
244}
uint32_t label
Definition Contours.cpp:16
std::optional< ElementFocus > m_focus
std::optional< size_t > select_element(const Kinesis::Vision::VisionAnalysis &analysis, const ElementFocus &focus)
Index into find_elements boxes of the element ranked first by focus, chosen on the GPU from the analy...

References MayaFlux::Kinesis::Vision::VisionAnalysis::find_elements, label, m_element_index, m_focus, and select_element().

Referenced by region_for_analysis(), and silhouette().

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