OpenCV  4.8.0
Open Source Computer Vision
Adding a Trackbar to our applications!

Next Tutorial: Reading Geospatial Raster files with GDAL

Original author Ana Huamán
Compatibility OpenCV >= 3.0

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