Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you have to declare your callback function, before you use it in the code

(also, you need a different signature !). like this:

 // declaration:
 void bluecolor_callback(int position, void*);

 int main() {
          // you HAVE TO use c++, not the deprecated c-api calls !!!!!
          cv::createTrackbar("Blue", "Color", 0, 1, bluecolor_callback);

 // definition:
 void bluecolor_callback(int position, void*) {
         ... some code

please also have another look at the tutorial