OpenCV  4.1.2-pre
Open Source Computer Vision
Adding a Trackbar to our applications!

Goals

In this tutorial you will learn how to:

Code

Let's modify the program made in the tutorial Adding (blending) two images using OpenCV. We will let the user enter the \(\alpha\) value by using the Trackbar.

Explanation

We only analyze the code that is related to Trackbar:

Note the following (C++ code):

Finally, we have to define the callback function on_trackbar for C++ and Python code, using an anonymous inner class listener in Java

Note that (C++ code):

Result