QT开发中文网

frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera frame depth = data.get_depth_frame().apply_filter(color_map); const int w = depth.as().get_width();// 查询帧大小(宽度和高度) const int h = depth...

The code is written in C++ and uses the Intel RealSense SDK to capture frames from a camera.

The first line waits for the next set of frames from the camera. The second line gets the depth frame and applies a color map filter to it.

The third and fourth lines query the width and height of the depth frame, respectively.

The fifth line creates an OpenCV matrix of size (w, h) using the data from the depth frame and sets its type to CV_8UC3.

The sixth line converts the OpenCV matrix to a QImage object with RGB888 format, which can be displayed on a QLabel widget in Qt.

The seventh to ninth lines do similar operations for the color frame - getting its width and height, creating an OpenCV matrix, converting it to a QImage object, and displaying it on another QLabel widget in Qt.

Finally, there is an emit statement that sends the color image as a signal to some other part of the program.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://qt.0voice.com/?id=2093

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?