cv::createButton( "", NULL, NULL, cv::PUSH_BUTTON );
cv::createTrackbar( "Trackbar2", "", &mybar1, 255 );
cv::createButton( "Button3", NULL, NULL, cv::RADIOBOX, 1 );
cv::createButton( "Button4", NULL, NULL, cv::RADIOBOX, 0 );
cv::createButton( "Button5", NULL, NULL, cv::CHECKBOX, 0 );
You will notice that Trackbar0 and Trackbar1 are created in the window called “Image,” while Trackbar2
is created in an unnamed window (the Control Panel). The first three cv::createButton() calls are
not given a name for the button, and you can see in Figure 4-5 the automatically assigned names are placed
onto the buttons. You will also notice in Figure 4-5 that the first three buttons are in one row, while the
second group of three is on another. This is because of the trackbar.
Buttons are created one after another, each to the right of its predecessor, until (unless) a trackbar is
created. Because a trackbar consumes an entire row, it is given its own row below the buttons. If more
buttons are created, they will appear on a new row thereafter.
20
Text and Fonts
Just as the Qt interface allowed for much prettier trackbars and other elements, Qt also allows for much
prettier and more versatile text. To write text using the Qt interface, you must first create a CvFont
object,
21
which you then use whenever you want to put some text on the ...