OpenCV中Qt后端的高级GUI功能使用指南
1. 基础示例与功能概述
在开始介绍Qt后端的高级GUI功能之前,先来看一个简单的示例代码,它展示了如何创建一个滑动条并实现基本的视频显示控制:
// Create the trackbar. We give it a name,
// and tell it the name of the parent window.
//
cv::createTrackbar(
"Switch",
"Example",
&g_switch_value,
1,
switch_callback
);
// This will cause OpenCV to idle until
// someone hits the Esc key.
//
for(;;) {
if( g_switch_value ) {
g_capture >> frame;
if( frame.empty() ) break;
cv::imshow( "Example", frame);
}
if( cv::waitKey(10)==27 ) break;
}
return 0;
这个示例中的滑动条就像一个电灯开关,当滑动条“开关”设置为0时,回调函数执行 switch_off_function() ;当开关打开时,执行 switch_on_function() 。
超级会员免费看
订阅专栏 解锁全文
9

被折叠的 条评论
为什么被折叠?



