OpenCV 5.0.0
Open Source Computer Vision
読み込み中...
検索中...
見つかりません
🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
cv::gapi::wip 名前空間

この名前空間は実験的な G-API 機能を含む。この名前空間内の関数や構造体は、将来のリリースで変更または削除される可能性がある。また、この名前空間には API がまだ安定化していない関数も含まれる。続きを読む...

名前空間

namespace  draw
 
namespace  gst
 
namespace  onevpl
 
namespace  ov
 

クラス

struct  Data
 この集約型は、G-API が(variant を介して)扱えるすべての型を表す。続き...
 
class  GAsyncCanceled
 
class  GAsyncContext
 非同期リクエストをグループ化し、一括でキャンセルするためのクラス。 続き...
 
class  GCaptureSource
 OpenCVのVideoCaptureベースのストリーミングソース。続きを読む...
 
class  IStreamSource
 抽象的なストリーミングパイプラインソース。 続きを読む...
 
class  QueueInput
 
class  QueueSource
 キューイングされたストリーミングパイプラインソース。 続き...
 
class  QueueSourceBase
 

型定義

using GStreamerPipeline = gst::GStreamerPipeline
 
using GStreamerSource = gst::GStreamerSource
 
using GVPLSource = onevpl::GSource
 

関数

std::future< void > async (GCompiled &gcmpld, GRunArgs &&ins, GRunArgsP &&outs)
 
std::future< void > async (GCompiled &gcmpld, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext &ctx)
 
void async (GCompiled &gcmpld, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs)
 
void async (GCompiled &gcmpld, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GAsyncContext &ctx)
 
std::future< void > async_apply (GComputation &gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext &ctx)
 
std::future< void > async_apply (GComputation &gcomp, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args={})
 
void async_apply (GComputation &gcomp, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args, GAsyncContext &ctx)
 
void async_apply (GComputation &gcomp, std::function< void(std::exception_ptr)> &&callback, GRunArgs &&ins, GRunArgsP &&outs, GCompileArgs &&args={})
 
cv::Ptr< IStreamSourceget_streaming_source (cv::Ptr< GStreamerPipeline > &pipeline, const std::string &appsinkName, const GStreamerSource::OutputType outputType=GStreamerSource::OutputType::MAT)
 
cv::Ptr< IStreamSourcemake_capture_src (const int id, const std::map< int, double > &properties={})
 
cv::Ptr< IStreamSourcemake_capture_src (const std::string &path, const std::map< int, double > &properties={})
 
cv::Ptr< IStreamSourcemake_gst_src (const std::string &pipeline, const GStreamerSource::OutputType outputType=GStreamerSource::OutputType::MAT)
 
template<class... Args>
cv::Ptr< IStreamSourcemake_onevpl_src (Args &&... args)
 
cv::Ptr< cv::gapi::wip::IStreamSourcemake_py_src (const cv::Ptr< cv::gapi::wip::IStreamSource > &src)
 Pythonで定義されたソースに委譲するG-API IStreamSource を作成する。
 
template<class T , class... Args>
IStreamSource::Ptr make_src (Args &&... args)
 

詳細説明

この名前空間は実験的な G-API 機能を含む。この名前空間内の関数や構造体は、将来のリリースで変更または削除される可能性がある。また、この名前空間には API がまだ安定化していない関数も含まれる。

型定義詳解

◆ GStreamerPipeline

◆ GStreamerSource

◆ GVPLSource

関数詳解

◆ async() [1/4]

std::future< void > cv::gapi::wip::async ( GCompiled & gcmpld,
GRunArgs && ins,
GRunArgsP && outs )

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
gcmpld非同期に実行するコンパイル済み計算(グラフ)
insgcmpld の入力引数
outsgcmpld の出力引数
戻り値
非同期処理の完了を待つための std::future<void> オブジェクト
参照
async

◆ async() [2/4]

std::future< void > cv::gapi::wip::async ( GCompiled & gcmpld,
GRunArgs && ins,
GRunArgsP && outs,
GAsyncContext & ctx )
引数
gcmpld非同期に実行するコンパイル済み計算(グラフ)
insgcmpld の入力引数
outsgcmpld の出力引数
ctxこのリクエストが属するコンテキスト
戻り値
非同期処理の完了を待つための std::future<void> オブジェクト
参照
async GAsyncContext

◆ async() [3/4]

void cv::gapi::wip::async ( GCompiled & gcmpld,
std::function< void(std::exception_ptr)> && callback,
GRunArgs && ins,
GRunArgsP && outs )

これらの関数は、第一引数の GCompiled::operator() メンバ関数を、渡された残りの引数(コールバックを除く)のコピーとともに非同期的に(つまりおそらく別の実行スレッド上で)呼び出す。関数間の違いは完了通知の取得方法(コールバック経由か std::future オブジェクトでの待機か)にある。apply の実行中に例外が発生した場合、その例外は(関数パラメータ経由で)コールバックに転送されるか、future に渡される(そして std::future::get の呼び出し時にスローされる)。

注意:入力引数は非同期関数の呼び出し時(実際には cv::gin の呼び出し時)にコピーされるため、非同期処理の実際の完了より長く存在し続ける必要はない。一方、出力引数は参照(ポインタ)で「キャプチャ」されるため、非同期処理より長く存在し続けなければならない(つまり、少なくともコールバックが呼ばれるか future のブロックが解除されるまで生存している必要がある)。

引数
gcmpld非同期に開始するコンパイル済み計算(グラフ)
callbackgcmpld の実行が完了したときに呼び出されるコールバック
insgcmpld の入力引数
outsgcmpld の出力引数

◆ async() [4/4]

void cv::gapi::wip::async ( GCompiled & gcmpld,
std::function< void(std::exception_ptr)> && callback,
GRunArgs && ins,
GRunArgsP && outs,
GAsyncContext & ctx )

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
gcmpld非同期に実行するコンパイル済み計算(グラフ)
callbackgcmpld の実行が完了したときに呼び出されるコールバック
insgcmpld の入力引数
outsgcmpld の出力引数
ctxこのリクエストが属するコンテキスト
参照
async GAsyncContext

◆ async_apply() [1/4]

std::future< void > cv::gapi::wip::async_apply ( GComputation & gcomp,
GRunArgs && ins,
GRunArgsP && outs,
GCompileArgs && args,
GAsyncContext & ctx )

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
gcomp非同期に実行する計算(グラフ)
insgcomp の入力パラメータ
outsgcomp の出力パラメータ
argsGComputation::apply() に渡すコンパイル引数
ctxこのリクエストが属するコンテキスト
戻り値
非同期処理の完了を待つための std::future<void> オブジェクト
参照
async_apply async GAsyncContext

◆ async_apply() [2/4]

std::future< void > cv::gapi::wip::async_apply ( GComputation & gcomp,
GRunArgs && ins,
GRunArgsP && outs,
GCompileArgs && args = {} )

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
gcomp非同期に実行する計算(グラフ)
insgcomp の入力パラメータ
outsgcomp の出力パラメータ
argsGComputation::apply() に渡すコンパイル引数
戻り値
非同期処理の完了を待つための std::future<void> オブジェクト
参照
async_apply async

◆ async_apply() [3/4]

void cv::gapi::wip::async_apply ( GComputation & gcomp,
std::function< void(std::exception_ptr)> && callback,
GRunArgs && ins,
GRunArgsP && outs,
GCompileArgs && args,
GAsyncContext & ctx )

これは利便性のために提供されているオーバーロードされたメンバ関数である。上記の関数とは、受け取る引数のみが異なる。

引数
gcomp非同期に実行する計算(グラフ)
callbackgcomp の実行が完了したときに呼び出されるコールバック
insgcomp の入力パラメータ
outsgcomp の出力パラメータ
argsGComputation::apply() に渡すコンパイル引数
ctxこのリクエストが属するコンテキスト
参照
async_apply async GAsyncContext

◆ async_apply() [4/4]

void cv::gapi::wip::async_apply ( GComputation & gcomp,
std::function< void(std::exception_ptr)> && callback,
GRunArgs && ins,
GRunArgsP && outs,
GCompileArgs && args = {} )

async() 関数とは対照的に、これらは渡された GComputationGComputation::apply() メンバ関数を実際に呼び出す。

引数
gcomp非同期に実行する計算(グラフ)
callbackgcomp の実行が完了したときに呼び出されるコールバック
insgcomp の入力パラメータ
outsgcomp の出力パラメータ
argsGComputation::apply() に渡すコンパイル引数
参照
async

◆ get_streaming_source()

cv::Ptr< IStreamSource > cv::gapi::wip::get_streaming_source ( cv::Ptr< GStreamerPipeline > & pipeline,
const std::string & appsinkName,
const GStreamerSource::OutputType outputType = GStreamerSource::OutputType::MAT )
inline
Python:
cv.gapi.wip.get_streaming_source(pipeline, appsinkName[, outputType]) -> retval

◆ make_capture_src() [1/2]

cv::Ptr< IStreamSource > cv::gapi::wip::make_capture_src ( const int id,
const std::map< int, double > & properties = {} )
inline
Python:
cv.gapi.wip.make_capture_src(path[, properties]) -> retval
cv.gapi.wip.make_capture_src(id[, properties]) -> retval

◆ make_capture_src() [2/2]

cv::Ptr< IStreamSource > cv::gapi::wip::make_capture_src ( const std::string & path,
const std::map< int, double > & properties = {} )
inline
Python:
cv.gapi.wip.make_capture_src(path[, properties]) -> retval
cv.gapi.wip.make_capture_src(id[, properties]) -> retval

◆ make_gst_src()

cv::Ptr< IStreamSource > cv::gapi::wip::make_gst_src ( const std::string & pipeline,
const GStreamerSource::OutputType outputType = GStreamerSource::OutputType::MAT )
inline
Python:
cv.gapi.wip.make_gst_src(pipeline[, outputType]) -> retval
この関数の呼び出しグラフ:

◆ make_onevpl_src()

template<class... Args>
cv::Ptr< IStreamSource > cv::gapi::wip::make_onevpl_src ( Args &&... args)
inline
この関数の呼び出しグラフ:

◆ make_py_src()

cv::Ptr< cv::gapi::wip::IStreamSource > cv::gapi::wip::make_py_src ( const cv::Ptr< cv::gapi::wip::IStreamSource > & src)
Python:
cv.gapi.wip.make_py_src(src) -> retval

Python で定義されたソースに委譲する G-API の IStreamSource を作成する。

このファクトリ関数は、Python オブジェクト(例えば pull() メソッドと descr_of() メソッドを実装するクラスのインスタンス)を cv::gapi::wip::IStreamSource にラップし、G-API 計算グラフ内で使用できるようにする。OpenCV の Python バインディングは PyObject を cv::Ptr<IStreamSource> へ自動的に変換する。

引数
src元の Python オブジェクトを内部に保持する cv::Ptr<IStreamSource>
戻り値
A cv::Ptr<IStreamSource> that wraps the provided Python object. On each frame pull, G-API will:
  • Python の GIL を取得する
  • Python オブジェクトの pull() メソッドを呼び出す
  • 結果として得られた NumPy 配列を cv::Mat に変換する
  • cv::Mat を G-API パイプラインに渡す
覚え書き
Python では、返された make_py_src を次のように使用できる:
class MyClass:
def __init__(self):
# Initialize your source
def pull(self):
# Return the next frame as a numpy.ndarray or None for end-of-stream
def descr_of(self):
# Return a numpy.ndarray that describes the format of the frames
# Create a G-API source from a Python class
py_src = cv.gapi.wip.make_py_src(MyClass())
# Define a simple graph: input → copy → output
g_in = cv.GMat()
g_out = cv.gapi.copy(g_in)
graph = cv.GComputation(g_in, g_out)
# Compile the pipeline for streaming and assign the source
pipeline = graph.compileStreaming()
pipeline.setSource([py_src])
pipeline.start()
GComputation class represents a captured computation graph. GComputation objects form boundaries for ...
Definition gcomputation.hpp:121
GMat class represents image or tensor data in the graph.
Definition gmat.hpp:68
GMat copy(const GMat &in)
Makes a copy of the input image. Note that this copy may be not real (no actual data copied)....
cv::Ptr< cv::gapi::wip::IStreamSource > make_py_src(const cv::Ptr< cv::gapi::wip::IStreamSource > &src)
Creates a G-API IStreamSource that delegates to a Python-defined source.

◆ make_src()

template<class T , class... Args>
IStreamSource::Ptr cv::gapi::wip::make_src ( Args &&... args)
inline