![]() |
OpenCV 4.12.0
开源计算机视觉
|
G-API 函数和类,用于序列化和反序列化。 更多...
G-API 函数和类,用于序列化和反序列化。
命名空间 | |
| 命名空间 | cv::gapi |
| 命名空间 | cv::gapi::s11n |
| 此命名空间包含 G-API 序列化和反序列化函数及数据结构。 | |
类 | |
| 结构体 | cv::gapi::s11n::detail::NotImplemented |
| 结构体 | cv::gapi::s11n::detail::S11N< T > |
| 此结构允许为自定义类型实现序列化例程。 更多... | |
函数 | |
| cv::GRunArg | cv::gapi::bind (cv::GRunArgP &out) |
| 将图执行期间可用的输出 GRunArgsP 包装为可以序列化的 GRunArgs。 | |
| cv::GRunArgsP | cv::gapi::bind (cv::GRunArgs &out_args) |
| 将反序列化的输出 GRunArgs 包装为 GCompiled 可以使用的 GRunArgsP。 | |
| template<> | |
| cv::GComputation | cv::gapi::deserialize (const std::vector< char > &bytes) |
| 从字节数组反序列化 GComputation。 | |
| template<typename T , typename... Types> | |
| std::enable_if< std::is_same< T, GCompileArgs >::value, GCompileArgs >::type | cv::gapi::deserialize (const std::vector< char > &bytes) |
| 从字节数组反序列化模板中指定类型的 GCompileArgs。 | |
| template<typename T , typename AtLeastOneAdapterT , typename... AdapterTypes> | |
| std::enable_if< std::is_same< T, GRunArgs >::value, GRunArgs >::type | cv::gapi::deserialize (const std::vector< char > &bytes) |
| 反序列化 GRunArgs,包括 RMat 和 MediaFrame 对象(如果有)从字节数组。 | |
| std::vector< char > | cv::gapi::serialize (const cv::GCompileArgs &ca) |
| std::vector< char > | cv::gapi::serialize (const cv::GComputation &c) |
| 将 GComputation 表示的图序列化为字节数组。 | |
| std::vector< char > | cv::gapi::serialize (const cv::GMetaArgs &ma) |
| std::vector< char > | cv::gapi::serialize (const cv::GRunArgs &ra) |
| std::vector< char > | cv::gapi::serialize (const std::vector< std::string > &vs) |
| cv::GRunArg cv::gapi::bind | ( | cv::GRunArgP & | 输出3D仿射变换矩阵,尺寸为\(3 \times 4\),形式如下 | ) |
#include <opencv2/gapi/garg.hpp>
将图执行期间可用的输出 GRunArgsP 包装为可以序列化的 GRunArgs。
GRunArgsP 是指向值的指针,因此要序列化它们,需要绑定到此函数执行的实际值。
使用示例
| 输出3D仿射变换矩阵,尺寸为\(3 \times 4\),形式如下 | 图执行期间可用的输出 GRunArgsP。 |
| cv::GRunArgsP cv::gapi::bind | ( | cv::GRunArgs & | out_args | ) |
#include <opencv2/gapi/garg.hpp>
将反序列化的输出 GRunArgs 包装为 GCompiled 可以使用的 GRunArgsP。
由于无法从反序列化中获取可修改的输出参数,因此需要由此函数包装。
使用示例
| out_args | 反序列化的 GRunArgs。 |
|
inline |
#include <opencv2/gapi/s11n.hpp>
从字节数组反序列化 GComputation。
检查不同的重载以获取更多示例。
| bytes | 序列化的字节向量。 |
|
inline |
#include <opencv2/gapi/s11n.hpp>
从字节数组反序列化模板中指定类型的 GCompileArgs。
| bytes | 用于从中反序列化 GCompileArgs 对象的字节向量。 |
|
inline |
#include <opencv2/gapi/s11n.hpp>
反序列化 GRunArgs,包括 RMat 和 MediaFrame 对象(如果有)从字节数组。
适配器类型在模板中指定。
| bytes | 用于从中反序列化 GRunArgs 对象的字节向量。 |
| std::vector< char > cv::gapi::serialize | ( | const cv::GCompileArgs & | ca | ) |
| std::vector< char > cv::gapi::serialize | ( | const cv::GComputation & | c | ) |
#include <opencv2/gapi/s11n.hpp>
将 GComputation 表示的图序列化为字节数组。
检查不同的重载以获取更多示例。
| c | 要序列化的 GComputation。 |
| std::vector< char > cv::gapi::serialize | ( | const cv::GMetaArgs & | ma | ) |
| std::vector< char > cv::gapi::serialize | ( | const cv::GRunArgs & | ra | ) |
| std::vector< char > cv::gapi::serialize | ( | const std::vector< std::string > & | vs | ) |
#include <opencv2/gapi/s11n.hpp>
这是一个重载的成员函数,为方便起见而提供。它与上述函数的不同之处仅在于它接受的参数。
| vs | 要序列化的 std::vector<std::string>。 |