In a program in the Learning OpenCV book:
void onTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture,CV_CAP_PROP_POS_FRAMES,pos);
}
And, in another location:
if(frames!=0)
{
cvCreateTrackbar("Position","Example3",&g_slider_position,frames,onTrackbarSlide);
}
If you see onTrackbarSlide, there is no parameter passed. In this case, what value will be passed to the onTrackSlide(int pos) method?
You are passing the address of function
as the last parameter in the function
cvCreateTrackbarThis doesn’t call the
onTrackbarSlide. ThecvCreateTrackbarmethod must be storing the address of the functiononTrackbarSlideand using it as an Callback to intimate of some asynchronous happening.