1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #18493 from TolyaTalamanov:at/wrap-streaming

[G-API Wrap streaming

* Wrap streaming

* Fix build

* Add comments

* Remove comment

* Fix comments to review

* Add test for python pull overload
This commit is contained in:
Anatoliy Talamanov
2020-10-15 01:21:09 +03:00
committed by GitHub
parent 06a09d5991
commit 0d3e05f9b3
12 changed files with 274 additions and 11 deletions
@@ -436,7 +436,7 @@ public:
*
* @sa @ref gapi_compile_args
*/
GStreamingCompiled compileStreaming(GMetaArgs &&in_metas, GCompileArgs &&args = {});
GAPI_WRAP GStreamingCompiled compileStreaming(GMetaArgs &&in_metas, GCompileArgs &&args = {});
/**
* @brief Compile the computation for streaming mode.
@@ -457,7 +457,7 @@ public:
*
* @sa @ref gapi_compile_args
*/
GStreamingCompiled compileStreaming(GCompileArgs &&args = {});
GAPI_WRAP GStreamingCompiled compileStreaming(GCompileArgs &&args = {});
// 2. Direct metadata version
/**
+1 -1
View File
@@ -135,7 +135,7 @@ GRunArg value_of(const GOrigin &origin);
// Transform run-time computation arguments into a collection of metadata
// extracted from that arguments
GMetaArg GAPI_EXPORTS descr_of(const GRunArg &arg );
GMetaArgs GAPI_EXPORTS descr_of(const GRunArgs &args);
GMetaArgs GAPI_EXPORTS_W descr_of(const GRunArgs &args);
// Transform run-time operation result argument into metadata extracted from that argument
// Used to compare the metadata, which generated at compile time with the metadata result operation in run time
@@ -49,11 +49,11 @@ namespace cv {
*
* @sa GCompiled
*/
class GAPI_EXPORTS GStreamingCompiled
class GAPI_EXPORTS_W_SIMPLE GStreamingCompiled
{
public:
class GAPI_EXPORTS Priv;
GStreamingCompiled();
GAPI_WRAP GStreamingCompiled();
// FIXME: More overloads?
/**
@@ -96,7 +96,7 @@ public:
* @param ins vector of inputs to process.
* @sa gin
*/
void setSource(GRunArgs &&ins);
GAPI_WRAP void setSource(GRunArgs &&ins);
/**
* @brief Specify an input video stream for a single-input
@@ -109,7 +109,7 @@ public:
* @param s a shared pointer to IStreamSource representing the
* input video stream.
*/
void setSource(const gapi::wip::IStreamSource::Ptr& s);
GAPI_WRAP void setSource(const gapi::wip::IStreamSource::Ptr& s);
/**
* @brief Start the pipeline execution.
@@ -126,7 +126,7 @@ public:
* start()/stop()/setSource() may be called on the same object in
* multiple threads in your application.
*/
void start();
GAPI_WRAP void start();
/**
* @brief Get the next processed frame from the pipeline.
@@ -150,6 +150,9 @@ public:
*/
bool pull(cv::GRunArgsP &&outs);
// NB: Used from python
GAPI_WRAP std::tuple<bool, cv::GRunArgs> pull();
/**
* @brief Try to get the next processed frame from the pipeline.
*
@@ -172,7 +175,7 @@ public:
*
* Throws if the pipeline is not running.
*/
void stop();
GAPI_WRAP void stop();
/**
* @brief Test if the pipeline is running.
@@ -184,7 +187,7 @@ public:
*
* @return true if the current stream is not over yet.
*/
bool running() const;
GAPI_WRAP bool running() const;
/// @private
Priv& priv();
@@ -497,7 +497,7 @@ The median filter uses cv::BORDER_REPLICATE internally to cope with border pixel
@param ksize aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
@sa boxFilter, gaussianBlur
*/
GAPI_EXPORTS GMat medianBlur(const GMat& src, int ksize);
GAPI_EXPORTS_W GMat medianBlur(const GMat& src, int ksize);
/** @brief Erodes an image by using a specific structuring element.
@@ -103,6 +103,12 @@ protected:
}
};
// NB: Overload for using from python
GAPI_EXPORTS_W cv::Ptr<IStreamSource> inline make_capture_src(const std::string& path)
{
return make_src<GCaptureSource>(path);
}
} // namespace wip
} // namespace gapi
} // namespace cv