Annotate.cpp
void Annotate::displayVideo()
{
    // check if we can open video
    if (!openVideo()) { return; }
    // set video to start at frame
    if (!cap.set(CV_CAP_PROP_POS_FRAMES, beginFrame))
    {
    	std::cout << "Error with beginFrame." << std::endl;
    	return;
    }
    // store video frame	
    cv::Mat frame;
    cv::namedWindow("Frame", cv::WINDOW_AUTOSIZE);
    // count frame index
    int fcount = beginFrame;
    // pause flag
    bool pause = false;
    while (fcount != stopFrame)
    {
    	// check if video is paused
    	if (!pause) {
    	    // read new frame
    	    if (!readFrame(frame)) { break; }
    	    // increase frame index
	    fcount++;
	    // check if we reached stopFrame
	    if (!checkFrame(fcount)) { break; }
	    // display frame
	    cv::imshow("Frame", frame);
	}
	// grab user's input
	if (!userVideoControls(pause)) { break; }
    }
    // release resources
    release();
}
/**
 * Displays selected range of video frames to user.
 *
 * @return  nothing
 */
Displays selected range of video frames to user.
@return  nothing
Displays selected range of video frames to user . @return nothing
void Annotate::displayVideo()
{
    if (!openVideo()) { return; }
    if (!cap.set(CV_CAP_PROP_POS_FRAMES, beginFrame))
    {
    	std::cout << "Error with beginFrame." << std::endl;
    	return;
    }
    cv::Mat frame;
    cv::namedWindow("Frame", cv::WINDOW_AUTOSIZE);
    int fcount = beginFrame;
    bool pause = false;
    while (fcount != stopFrame)
    {
    	if (!pause) {
    	    if (!readFrame(frame)) { break; }
	    fcount++;
	    if (!checkFrame(fcount)) { break; }
	    cv::imshow("Frame", frame);
	}
	if (!userVideoControls(pause)) { break; }
    }
    release();
}
void Annotate :: displayVideo ( ) { if ( ! openVideo ( ) ) { return ; } if ( ! cap . set ( CV_CAP_PROP_POS_FRAMES , beginFrame ) ) { std :: cout << " " << std :: endl ; return ; } cv :: Mat frame ; cv :: namedWindow ( " " , cv :: WINDOW_AUTOSIZE ) ; int fcount = beginFrame ; bool pause = false ; while ( fcount != stopFrame ) { if ( ! pause ) { if ( ! readFrame ( frame ) ) { break ; } fcount ++ ; if ( ! checkFrame ( fcount ) ) { break ; } cv :: imshow ( " " , frame ) ; } if ( ! userVideoControls ( pause ) ) { break ; } } release ( ) ; }
Displays selected range of video frames to user.
Displays selected range of video frames to user .
// check if we can open video // set video to start at frame // store video frame	 // count frame index // pause flag // check if video is paused // read new frame // increase frame index // check if we reached stopFrame // display frame // grab user's input // release resources