I\'ve picked up \'Learning OpenCV\' and have been trying some of the code examples/exercises. In this code snippet, I want to get the slider to update its position with each
Hi I have simlar code and I did the following:
void onTrackbarSlide(int pos)
{
if(pos > g_lastPosition+1 || pos < g_lastPosition)
cvSetCaptureProperty(g_capture,CV_CAP_PROP_POS_FRAMES,pos);
g_lastPosition = pos;
}
.............
while(1)
{
frame = cvQueryFrame( g_capture );
if( !frame ) break;
cvShowImage( "Example3", frame );
cvSetTrackbarPos("Position", "Example3", g_slider_position+1);
char c = cvWaitKey(33);
if( c == 27 ) break;
}
So you can grab the slide bar to any direction , I hope this can help