Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以增加传输opencv图像cv::Mat格式的数据吗? #11

Open
SccotMu opened this issue Oct 24, 2022 · 2 comments
Open

可以增加传输opencv图像cv::Mat格式的数据吗? #11

SccotMu opened this issue Oct 24, 2022 · 2 comments

Comments

@SccotMu
Copy link

SccotMu commented Oct 24, 2022

我自己根据demo中传输struct结构数据的方式,修改传输cv::Mat 或std::vector类型的数据,发现是数据是减少,并且不可以用的。可以增加以下几种数据类型的使用吗?
1)cv::Mat (opencv图像库中图像信息存储的变量类型)
2)std::vector,及std::array, std::map等STL 数据类型的传输;
3)自定义存储数据是变长度的带有构造函数的数据类型吗?

非常感谢!!!

@button-chen
Copy link
Owner

我自己根据demo中传输struct结构数据的方式,修改传输cv::Mat 或std::vector类型的数据,发现是数据是减少,并且不可以用的。可以增加以下几种数据类型的使用吗? 1)cv::Mat (opencv图像库中图像信息存储的变量类型) 2)std::vector,及std::array, std::map等STL 数据类型的传输; 3)自定义存储数据是变长度的带有构造函数的数据类型吗?

非常感谢!!!

用一个种变通的方式: 需要传std::vector 的话(其他数据结构类似),先使用比如 msgpack之类的比较专业的系列化库把std::vector --> 二进制数据 --> 放到std::string 中, 另一端在使用msgpack反系列化回来。 这样的话你的rpc函数的参数就是std:string 就好了。

@SccotMu
Copy link
Author

SccotMu commented Oct 25, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants