OpenCV  3.4.4
Open Source Computer Vision
samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp

Check the corresponding tutorial for more details