Ask Your Question

AlexGray's profile - activity

2013-06-11 18:07:52 -0600 commented answer Hitching and Smoothness problem with videocapture::read

I ended up implementing my own handler of the message pump, because I needed to do some specific stuff but this was exactly what I need to know thanks.

2013-06-11 18:05:55 -0600 received badge  Scholar (source)
2013-06-11 18:05:52 -0600 received badge  Supporter (source)
2013-05-28 21:15:05 -0600 asked a question Hitching and Smoothness problem with videocapture::read

So I'm having a problem with the VideoCapture::read function.

When I run this function:

void Camera::DoFrame( cv::Mat& im, vector<Location> &locations)
{
    if(!TheVideoCapturer.isOpened())
        return;

    TheVideoCapturer >> im;

    locations = processFrame(im);
    //imshow("video", im);
    //cv::waitKey(30);
}

The average time taken is 33 milliseconds, Most of that time is taken up by the TheVideoCapturer >> im; This is fine as that is a good frame rate, however it has periods where the time will spike up to 250ms. This obviously produces problems with the smoothness of my video, one which I wanted to fix. I think it also might be related to the video skipping occcasionly.

After suspecting my camera and another of other issues, I found that by uncommenting 2 lines in the above sample of code, I could get the video to out put much more consistantly, with the longest time the read function takes is 30ms, though the average is 2ms. This is more like what i would expect as a frame rate. It also seems to relieve my problem of the video being not smooth enough. The only problem with this is that I neither want to output a video from my camera, or wait 30ms if I can help it. Is there something I misunderstand about the read method? Has anyone expereienced something similar?

I am using opencv version 2.4.5, I experience the same bug in both visual studio and mingw, and get the same problem on both a logitech pro 9000 and a logitech pro c910

Thanks

2013-02-14 16:55:43 -0600 asked a question Error when trying to link to a library which references OpenCV

I have a static library which uses opencv on iOS which I want to be run by an app. At the moment it is a small test library which consists of:

in FirstLibrary.h

#include<stdio.h>

using namespace std;

class MyClass
{
public:
    int Hello();
    string Hi();

};

in FirstLibrary.cpp

#include <stdio.h>
#include " FirstLibrary.h"    
int MyClass::Hello()
{
     return 231;
}

string MyClass::Hi()
{
    cv::Mat mat = cv::Mat(3,3,CV_32F);
    if(mat.rows == 3)
        return "3";
    else
        return "not 3";
}

I have included the precompiled opencv framework and added it to the library project

Yet when I attempt to link it and build I get this error :

Undefined symbols for architecture i386:
  "cv::Mat::deallocate()", referenced from:
      cv::Mat::release() in libFirstLibrary.a(FirstLibrary-ED4ABFA0F7AAAB67.o)
  "cv::Mat::create(int, int const*, int)", referenced from:
      cv::Mat::create(int, int, int) in libFirstLibrary.a(FirstLibrary-ED4ABFA0F7AAAB67.o)
  "cv::fastFree(void*)", referenced from:
      cv::Mat::~Mat() in libFirstLibrary.a(FirstLibrary-ED4ABFA0F7AAAB67.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I know this library doesn't do anything, its a test case I made to try and fix a problem I'm having with a much larger library, I'm just trying to work out where I'm going wrong.

Thanks