Ask Your Question

NagarajHarakuni's profile - activity

2014-11-07 00:03:35 -0600 commented question The function cvCaptureFromFile(“tunnel.avi”); is not working in opencv 2.4.9.

means i should stop using the deprecated c-api from now on, and switch to the c++ api ? i m a teaching assistant under my associate professor. my guide has told me to use the c api. and what does "deprecated c-api" exactly mean ? @berak

2014-11-06 00:46:20 -0600 asked a question The function cvCaptureFromFile(“tunnel.avi”); is not working in opencv 2.4.9.

I have installed opencv 2.4.9 recently, but the function cvCaptureFromFile("tunnel.avi"); is not working. what are the headers to be included in opencv 2.4.9 to make run this function. plz help.

2014-09-17 02:52:30 -0600 received badge  Editor (source)
2014-09-17 02:48:57 -0600 asked a question OpenCV parallelization with OpenMP

I am getting Fatal error in this code. I want to display the frames parallely. Need help.I am newbee to OpenCV and OpenMP. Ur suggestions will be helpful for me. please :)

 #include <cv.h>
    #include <cvaux.h>
    #include <iostream>
    #include <cxcore.h>
    #include <highgui.h>
    #include <omp.h>

    using namespace cv;
    using namespace std;

    int main(int argc, char **argv)
    {
        int no_of_frames = 0,i,j;
        int fps = 0;
        int mid_frame = 0;
        CvCapture* capture = cvCaptureFromFile("/home/nagaraj/ImageVideo/tunnel.avi");
        CvCapture* captureNew = cvCaptureFromFile("/home/nagaraj/ImageVideo/tunnel.avi");
        if (capture == NULL)
        {
            printf("Error: Can't open video.\n");
            return -1;
        }
        if (captureNew == NULL)
        {
            printf("Error: Can't open video.\n");
            return -1;
        }
        fps = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FPS);
        no_of_frames = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT);
        mid_frame = no_of_frames/2;
        omp_set_num_threads(2);


    #pragma omp parallel sections
        {
    #pragma omp section
        {
            //cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES,0);
            IplImage* img = cvQueryFrame(capture);
            cvNamedWindow("Window1",CV_WINDOW_AUTOSIZE);
            cvShowImage("Window1",img);
            cvWaitKey(10000);
            cvReleaseImage(&img);
            cvDestroyWindow("Window1");
            cvReleaseCapture(&capture);
        }
    #pragma omp section
        {
            cvSetCaptureProperty(captureNew,CV_CAP_PROP_POS_FRAMES,(double)mid_frame-1);
            IplImage* img = cvQueryFrame(captureNew);
            cvNamedWindow("Window2",CV_WINDOW_AUTOSIZE);
            cvShowImage("Window2",img);
            cvWaitKey(10000);
            cvReleaseImage(&img);
            cvDestroyWindow("Window2");
            cvReleaseCapture(&captureNew);
        }
    }
    }
2014-09-15 03:15:32 -0600 received badge  Organizer (source)
2014-09-15 03:00:44 -0600 asked a question Lets say,I have a set of 1000 frames. and i have a dual core processor. can i process 500 frames on one core and another 500 on other core.?

I want to parallelize the motion estimation process using LK algorithm. And I m using OpenMP for it. Will i be able to divide the total number of frames into two subsets and process each subset of frames on each core ??? Please let me help in this regard. Ur help will be appreciated greatly.

2014-09-15 02:51:38 -0600 commented answer OpenCV and OpenMP

Thank you very much:)

2014-09-10 06:27:26 -0600 asked a question OpenCV and OpenMP

Does the latest version of OpenCV 2.4.9 support OpenMP ?? I m integrating OpenCV with OpenMP to process the videos parallel.. Will it work ? Is there any other better solution other than OpenMP ?