OpenCV:5-6-5中的帧缓冲区,如何加载到Mat中?
我正在尝试使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了一个很好的解决方案:选择 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!