Results 1 to 4 of 4

Thread: application doesn't run

  1. #1
    Join Date
    Jan 2013
    Beans
    7

    application doesn't run

    hi , i'm new in opencv applications programming . i want to play a movie with a simple code(second excercise of bradski & kaehler book) , but the application doesn't play the movie and doesn't show any windows. everything seem to be good. no error exists . but i don't exactly know what happens?did i forget something?

  2. #2
    Join Date
    Sep 2012
    Beans
    10

    Re: application doesn't run

    Can you post the code?

  3. #3
    Join Date
    Jan 2013
    Beans
    7

    Re: application doesn't run

    Code:
    #include "highgui.h"
    
    int main( int argc, char** argv )
    {
        cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
        //CvCapture* capture = cvCaptureFromAVI( argv[1] ); // either one will work
        CvCapture* capture =
                cvCreateFileCapture( "/home/ubuntu12/workspace-opencv/excC/excC/Debug/test.avi" );
        IplImage* frame;
        while(1) {
            frame = cvQueryFrame( capture );
            if( !frame ) break;
            cvShowImage( "Example2", frame );
            char c = cvWaitKey(33);
            if( c == 27 ) break;
        }
        cvReleaseCapture( &capture );
        cvDestroyWindow( "Example2" );
        return 0;
    }

  4. #4
    Join Date
    Sep 2012
    Beans
    10

    Re: application doesn't run

    On my computer it runs flawlessly.
    How do you compile?

    I use:
    Code:
    g++ cv.cpp -o cv `pkg-config --libs --cflags opencv`
    And execute with
    Code:
    ./cv
    Did you install the library?
    Do you have any compilation error?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •