OpenCV tutorials--adding a Trackbar to our applications

Source: Internet
Author: User

int createtrackbar(const string& trackbarname, const string& winname, int * value, int count, trackbarcallbackonChange=0, void* userdata=0)

Parameters:

    • Trackbarname –name of the created TrackBar. Slide Bar Name
    • Winname –name of the window that would be used as a parent of the created TrackBar. Add the window name of the slider bar
    • value –optional pointer to an integer variable whose value reflects the position of the slider.  Upon creation, the slider position is defined by this variable. slider position, usually defined as global variable ~

    • Count –maximal position of the slider.  The minimal position is always 0. Maximum slider position
    • OnChange –pointer to the function to be called every time the slider changes position. This function should was prototyped as void Foo (int,void*); where the first parameter is the trackbar position a nd the second parameter is the user data (see the next parameter).  If The callback is the NULL pointer, no callbacks was called, but only value is updated. Pointer to the callback function (called each time the slider position changes)
    • userdata –user data, is passed as was to the callback. It can be used to handle TrackBar events without using global variables. Parameters passed to the callback function

Code

#include "stdafx.h" #include <cv.h> #include 
 

OpenCV tutorials--adding A Trackbar to our applications

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.