Ask Your Question

mehdi's profile - activity

2017-03-29 02:31:07 -0600 received badge  Popular Question (source)
2013-04-27 06:04:18 -0600 commented answer Split video to images - OpenCV 2.4.5

i used the first solution

but i got another error when i try to compile

root@Hadoop:/usr/local/opencv/opencv-2.4.5/samples/c# g++ -O2 -Wall -o VideoToImages VideoToImages.cpp pkg-config --cflags --libs opencv

split.cpp: In function ‘int main(int, char**)’: split.cpp:42: error: ‘string’ was not declared in this scope split.cpp:42: error: expected ‘;’ before ‘filename’ split.cpp:43: error: ‘filename’ was not declared in this scope

and when i try the second solution i got another error

root@Hadoop:/usr/local/opencv/opencv-2.4.5/samples/c# g++ -O2 -Wall -o VideoToImages VideoToImages.cpp pkg-config --cflags --libs opencv

split.cpp: In function ‘int main(int, char**)’: split.cpp:42: error: ‘frame_id’ was not declared in this scope

le me know if i use the appropriate compilation

2013-04-26 10:04:20 -0600 commented answer Split video to images - OpenCV 2.4.5

Should i rplace

char frame_id[30];
itoa(frame_number, frame_id, 10);
strcat(filename, frame_id);
strcat(filename, ".png");

by

string filename = cv::format("frameSplit%d.png",frame_id);

2013-04-26 06:46:35 -0600 commented answer Split video to images - OpenCV 2.4.5

I got a new error when i tried to compile the source

VideoToImages.cpp: In function ‘int main(int, char**)’: VideoToImages.cpp:38:40: error: ‘itoa’ was not declared in this scope

2013-04-25 06:12:18 -0600 answered a question feature selection using adaboost

I'm interesting to face feature. Do you have any idea ? thanks

2013-04-25 05:46:59 -0600 received badge  Supporter (source)
2013-04-25 05:43:52 -0600 asked a question Split video to images - OpenCV 2.4.5
I try to split .avi video into frame of images using this code :

#include <stdio.h>
#include < string.h>
#include <stdlib.h>
#include "cv.h"
#include <highgui.h>
#include "cxcore.h" 
int main( int argc, char** argv )
{    

    CvCapture *capture = cvCaptureFromAVI("xyz.avi");
    if(!capture) 
    {
        printf("!!! cvCaptureFromAVI failed (file not found?)\n");
        return -1; 
    }

    int fps = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
    printf("* FPS: %d\n", fps);

    IplImage* frame = NULL;
    int frame_number = 0;
    char key = 0;   

    while (key != 'q') 
    {
        // get frame 
        frame = cvQueryFrame(capture);       
        if (!frame) 
        {
            printf("!!! cvQueryFrame failed: no frame\n");
            break;
        }       

        char filename[100];
        strcpy(filename, "frameSplit");

        char frame_id[30];
        itoa(frame_number, frame_id, 10);
        strcat(filename, frame_id);
        strcat(filename, ".png");

        printf("* Saving: %s\n", filename);

        if (!cvSaveImage(filename, frame,0))
        {
            printf("!!! cvSaveImage failed\n");
            break;
        }

        frame_number++;

        // quit when user press 'q'
        key = cvWaitKey(1000 / fps);
    }

    // free resources
    cvReleaseCapture(&capture);

    return 0;
}

when i try to compile this program using : g++ -O2 -Wall -o VideoToImages VideoToImages.cpp pkg-config --cflags --libs opencv

i got this error : fatal error: string.h:no such file or directory compilation terminated

Any idea please Thanks

2013-04-25 05:32:53 -0600 answered a question Simply count number of faces?

For Linux i found the XML Classifier under another directory /home/myname/opencv_version/data/lbpcascades

thanks

2013-04-25 03:12:47 -0600 answered a question Simply count number of faces?

i got this error when i run this example : Could not load face classifier i think this is duo to : std::string faceCascadeName = "/usr/share/OpenCV-2.3.1/OpenCV/lbpcascade/lbpcascade_frontalface.xml";

i cant find lbpcascade_frontalface.xml in my version 2.4.5 any help please! thanks

2013-04-23 07:23:05 -0600 answered a question Simply count number of faces?

thanks for this example, it's very intersting for me. the problem that i'm new in openCV i would like to know how to execute this example ? thanks