Ask Your Question

diegoaguilar's profile - activity

2015-04-01 13:11:27 -0600 asked a question What algorithms or approaches apart from Haar cascades could be used for custom objects detection?

I need to do computer visions tasks in order to detect watter bottles or soda cans. I will obtain 'frontal' images of bottles, soda cans or any other random objects (one by one) and my algorithm should determine whether it's a bottle, a can or any of them.

Some details about object detecting scenario:

  • As mentioned, I will test one single object per image/video frame.
  • Not all watter bottles are the same. There could be color in plastic, lid or label variation. Maybe some could not get label or lid.
  • Same about variation goes for soda cans. No wrinkled soda cans are gonna be tested though.
  • There could be small size variation between objects.
  • I could have a green (or any custom color) background.
  • I will do any needed filters on image.
  • This will be run on a Raspberry Pi.

Just in case, an example of each:

enter image description here

enter image description here

I've tested a couple times OpenCV face detection algorithms and I know it works pretty good but I'd need to obtain an special Haar Cascades features XML file for detecting each custom object on this approach.

So, the distinct alternatives I have in mind are:

I'd like to get a simple algorithm and I think creating a custom Haar classifier could be even not needed. What would you suggest?

2013-09-06 16:13:08 -0600 received badge  Scholar (source)
2013-09-06 16:12:56 -0600 commented answer Accessing to webcam video?

It actually works, BUT I had to downgrade to 2.4.5 version, I know know it's a reported bug.

2013-09-05 22:40:20 -0600 commented answer Accessing to webcam video?

It's taking me to an exception

2013-09-05 15:55:09 -0600 commented question Accessing to webcam video?

I did, @berak, I simply did a bad copy paste of question from SO.

2013-09-05 15:53:34 -0600 received badge  Editor (source)
2013-09-05 15:37:12 -0600 received badge  Supporter (source)
2013-09-05 15:36:59 -0600 commented answer How can I get frames from my webcam ?

I tried this and frame is always empty.

2013-09-05 15:31:35 -0600 asked a question Accessing to webcam video?

I'm testing out some code I found to capture the web cam video stream, it's quite different from what I used to do for achieving the same but it's supposed to be the appropiate way for doing it.

This is the way I used to do:

CvCapture* capture;
IplImage* frame = 0;

while (true)
{
    //Read the video stream
    capture = cvCaptureFromCAM(1);
    if (! capture) break;
    frame = cvQueryFrame(capture);

    //Create a window to display 
    cvNamedWindow("Te estas viendo", CV_WINDOW_NORMAL|CV_WINDOW_KEEPRATIO);

    cvShowImage("Te estas viendo", frame);

    int c = cvWaitKey(10);
    if ( (char)c == 27 ) break;
}

//Clean and release resources
cvReleaseImage(&frame);
cvDestroyAllWindows();

This is the testing code:

VideoCapture camera;
camera.open(cameraNumber);
namedWindow("output");

if (!camera.isOpened()) {
    cerr << "ERROR: Could not access the camera or video!" <<endl;
    return -1;
}

while (true) {
    // Grab the next camera frame.
    cv::Mat cameraFrame;
    camera >> cameraFrame;
    if (cameraFrame.empty()) {
        std::cerr << "ERROR: Couldn't grab a camera frame." <<
            std::endl;
        return -1;
    }
    imshow("output", cameraFrame);
    waitKey(10);
}

I'm not getting the first error line, so it's supposed to be opening the camera, but always failing at grabbing camera frames.