OpenCV:5-6-5中的帧缓冲区,如何加载到Mat中?

发布于 2024-12-14 22:34:00 字数 367 浏览 3 评论 0原文

我正在尝试使用 OpenCV 对图像进行一些操作。

我收到 RGB 5-6-5 的图像流,我想将它们顺时针旋转 90 度和逆时针旋转 90 度。

我已经编写了代码将其从 RGB 5-6-5 转换为 ARGB 8-8-8-8(32 位),以便我可以加载到 CV_8UC4 的 Mat 中,但旋转后,它看起来有点不稳定。

有人有关于如何旋转 5-6-5 图像的好解决方案吗?我总是旋转 90 度或 -90 度(宽度变成高度,反之亦然),所以我应该保持相同的质量。

非常感谢。

编辑:

我想出了一个很好的解决方案:选择 CV_16UC1 效果很好。然后我可以执行 transpose(),然后执行 Flip()。效果就像一个魅力!

I am trying to do some manipulations on images using OpenCV.

I am receiving a stream of images in RGB 5-6-5 and I would like to rotate them 90 clockwise and 90 counter-clockwise.

I have written code to convert it from RGB 5-6-5 to ARGB 8-8-8-8 (32 bits) so that I can load into a Mat of CV_8UC4 but after the rotation, it looks a bit jerky.

Does anyone have a good solution on how I could rotate a 5-6-5 image please? I am always rotating by 90 degress or -90 (width becomes height and vice versa), so I should stay the same quality.

Thank you very much.

EDIT:

I figured out a nice solution: choosing CV_16UC1 works fine. I can then do a transpose() followed by a flip(). Works like a charm!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

辞慾 2024-12-21 22:34:00

我想出了一个很好的解决方案:选择 CV_16UC1 效果很好。然后我可以执行 transpose(),然后执行 Flip()。效果就像一个魅力!

I figured out a nice solution: choosing CV_16UC1 works fine. I can then do a transpose() followed by a flip(). Works like a charm!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文