OpenCV  4.10.0
Open Source Computer Vision
Loading...
Searching...
No Matches
cv::gapi::streaming Namespace Reference

This namespace contains G-API functions, structures, and symbols related to the Streaming execution mode. More...

Namespaces

namespace  detail
namespace  meta_tag

Classes

struct  queue_capacity
 Specify queue capacity for streaming execution. More...

Enumerations

enum class  sync_policy {
  dont_sync ,
  drop
}

Functions

cv::GMat BGR (const cv::GFrame &in)
 Gets bgr plane from input frame.
GFrame desync (const GFrame &f)
GMat desync (const GMat &g)
 Starts a desynchronized branch in the graph.
 G_API_OP (GUV,< GMat(GFrame)>, "org.opencv.streaming.UV")
 G_API_OP (GY,< GMat(GFrame)>, "org.opencv.streaming.Y")
 G_TYPED_KERNEL (GSize,< GOpaque< Size >(GMat)>, "org.opencv.streaming.size")
 G_TYPED_KERNEL (GSizeMF,< GOpaque< Size >(GFrame)>, "org.opencv.streaming.sizeMF")
 G_TYPED_KERNEL (GSizeR,< GOpaque< Size >(GOpaque< Rect >)>, "org.opencv.streaming.sizeR")
cv::GKernelPackage kernels ()
template<typename T, typename G>
cv::GOpaque< T > meta (G g, const std::string &tag)
std::tuple< GArray< Rect >, GArray< int > > parseSSD (const GMat &in, const GOpaque< Size > &inSz, const float confidenceThreshold=0.5f, const int filterLabel=-1)
 Parses output of SSD network.
std::tuple< GArray< Rect >, GArray< int > > parseYolo (const GMat &in, const GOpaque< Size > &inSz, const float confidenceThreshold=0.5f, const float nmsThreshold=0.5f, const std::vector< float > &anchors=nn::parsers::GParseYolo::defaultAnchors())
 Parses output of Yolo network.
template<typename G>
cv::GOpaque< int64_t > seq_id (G g)
template<typename G>
cv::GOpaque< int64_t > seqNo (G g)
GOpaque< Sizesize (const GFrame &src)
 Gets dimensions from MediaFrame.
GOpaque< Sizesize (const GMat &src)
 Gets dimensions from Mat.
GOpaque< Sizesize (const GOpaque< Rect > &r)
template<typename G>
cv::GOpaque< int64_t > timestamp (G g)
GMat UV (const cv::GFrame &frame)
 Extracts UV plane from media frame.
GMat Y (const cv::GFrame &frame)
 Extracts Y plane from media frame.

Detailed Description

This namespace contains G-API functions, structures, and symbols related to the Streaming execution mode.

Some of the operations defined in this namespace (e.g. size(), BGR(), etc.) can be used in the traditional execution mode too.

Enumeration Type Documentation

◆ sync_policy

Enumerator
dont_sync 
drop 

Function Documentation

◆ BGR()

cv::GMat cv::gapi::streaming::BGR ( const cv::GFrame & in)

Gets bgr plane from input frame.

Note
Function textual ID is "org.opencv.streaming.BGR"
Parameters
inInput frame
Returns
Image in BGR format

◆ desync() [1/2]

GFrame cv::gapi::streaming::desync ( const GFrame & f)

◆ desync() [2/2]

GMat cv::gapi::streaming::desync ( const GMat & g)

Starts a desynchronized branch in the graph.

This operation takes a single G-API data object and returns a graph-level "duplicate" of this object.

Operations which use this data object can be desynchronized from the rest of the graph.

This operation has no effect when a GComputation is compiled with regular cv::GComputation::compile(), since cv::GCompiled objects always produce their full output vectors.

This operation only makes sense when a GComputation is compiled in streaming mode with cv::GComputation::compileStreaming(). If this operation is used and there are desynchronized outputs, the user should use a special version of cv::GStreamingCompiled::pull() which produces an array of cv::util::optional<> objects.

Note
This feature is highly experimental now and is currently limited to a single GMat/GFrame argument only.

◆ G_API_OP() [1/2]

cv::gapi::streaming::G_API_OP ( GUV ,
< GMat(GFrame)> ,
"org.opencv.streaming.UV"  )

◆ G_API_OP() [2/2]

cv::gapi::streaming::G_API_OP ( GY ,
< GMat(GFrame)> ,
"org.opencv.streaming.Y"  )

◆ G_TYPED_KERNEL() [1/3]

cv::gapi::streaming::G_TYPED_KERNEL ( GSize ,
< GOpaque< Size >(GMat)> ,
"org.opencv.streaming.size"  )

◆ G_TYPED_KERNEL() [2/3]

cv::gapi::streaming::G_TYPED_KERNEL ( GSizeMF ,
< GOpaque< Size >(GFrame)> ,
"org.opencv.streaming.sizeMF"  )

◆ G_TYPED_KERNEL() [3/3]

cv::gapi::streaming::G_TYPED_KERNEL ( GSizeR ,
< GOpaque< Size >(GOpaque< Rect >)> ,
"org.opencv.streaming.sizeR"  )

◆ kernels()

cv::GKernelPackage cv::gapi::streaming::kernels ( )

◆ meta()

template<typename T, typename G>
cv::GOpaque< T > cv::gapi::streaming::meta ( G g,
const std::string & tag )

◆ parseSSD()

std::tuple< GArray< Rect >, GArray< int > > cv::gapi::parseSSD ( const GMat & in,
const GOpaque< Size > & inSz,
const float confidenceThreshold = 0.5f,
const int filterLabel = -1 )

Parses output of SSD network.

Extracts detection information (box, confidence, label) from SSD output and filters it by given confidence and label.

Note
Function textual ID is "org.opencv.nn.parsers.parseSSD_BL"
Parameters
inInput CV_32F tensor with {1,1,N,7} dimensions.
inSzSize to project detected boxes to (size of the input image).
confidenceThresholdIf confidence of the detection is smaller than confidence threshold, detection is rejected.
filterLabelIf provided (!= -1), only detections with given label will get to the output.
Returns
a tuple with a vector of detected boxes and a vector of appropriate labels.

◆ parseYolo()

std::tuple< GArray< Rect >, GArray< int > > cv::gapi::parseYolo ( const GMat & in,
const GOpaque< Size > & inSz,
const float confidenceThreshold = 0.5f,
const float nmsThreshold = 0.5f,
const std::vector< float > & anchors = nn::parsers::GParseYolo::defaultAnchors() )

Parses output of Yolo network.

Extracts detection information (box, confidence, label) from Yolo output, filters it by given confidence and performs non-maximum suppression for overlapping boxes.

Note
Function textual ID is "org.opencv.nn.parsers.parseYolo"
Parameters
inInput CV_32F tensor with {1,13,13,N} dimensions, N should satisfy:

\[\texttt{N} = (\texttt{num_classes} + \texttt{5}) * \texttt{5},\]

where num_classes - a number of classes Yolo network was trained with.
inSzSize to project detected boxes to (size of the input image).
confidenceThresholdIf confidence of the detection is smaller than confidence threshold, detection is rejected.
nmsThresholdNon-maximum suppression threshold which controls minimum relative box intersection area required for rejecting the box with a smaller confidence. If 1.f, nms is not performed and no boxes are rejected.
anchorsAnchors Yolo network was trained with.
Note
The default anchor values are specified for YOLO v2 Tiny as described in Intel Open Model Zoo documentation.
Returns
a tuple with a vector of detected boxes and a vector of appropriate labels.

◆ seq_id()

template<typename G>
cv::GOpaque< int64_t > cv::gapi::streaming::seq_id ( G g)

◆ seqNo()

template<typename G>
cv::GOpaque< int64_t > cv::gapi::streaming::seqNo ( G g)

◆ size() [1/3]

GOpaque< Size > cv::gapi::streaming::size ( const GFrame & src)

Gets dimensions from MediaFrame.

Note
Function textual ID is "org.opencv.streaming.sizeMF"
Parameters
srcInput frame
Returns
Size (frame dimensions).

◆ size() [2/3]

GOpaque< Size > cv::gapi::streaming::size ( const GMat & src)

Gets dimensions from Mat.

Note
Function textual ID is "org.opencv.streaming.size"
Parameters
srcInput tensor
Returns
Size (tensor dimensions).

◆ size() [3/3]

GOpaque< Size > cv::gapi::streaming::size ( const GOpaque< Rect > & r)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Gets dimensions from rectangle.

Note
Function textual ID is "org.opencv.streaming.sizeR"
Parameters
rInput rectangle.
Returns
Size (rectangle dimensions).

◆ timestamp()

template<typename G>
cv::GOpaque< int64_t > cv::gapi::streaming::timestamp ( G g)

◆ UV()

GMat cv::gapi::streaming::UV ( const cv::GFrame & frame)

Extracts UV plane from media frame.

Output image is 8-bit 2-channel image of CV_8UC2.

Note
Function textual ID is "org.opencv.streaming.UV"
Parameters
frameinput media frame.

◆ Y()

GMat cv::gapi::streaming::Y ( const cv::GFrame & frame)

Extracts Y plane from media frame.

Output image is 8-bit 1-channel image of CV_8UC1.

Note
Function textual ID is "org.opencv.streaming.Y"
Parameters
frameinput media frame.