Slow frame rate

asked 2014-12-02 17:25:08 -0600

Shadyk gravatar image

This is my first program.

I receive 1 image per second (very slow). How can i solve this problem? I think i have something bad with my code.... Why i must every cycle open stream and read it. If i remove .read or .open it give me error (assertion failed-maybe picture not ready )

-if i try this it give me only 1 picture then freeze because read=0 then forever

if(vcap.read(image)) imshow("Output Window", image);

WIN 7,64,opencv 2.4.10, visual studio 10, IP camera vivotek PT8133/33W

include <stdio.h>

include <opencv2 opencv.hpp="">

include <iostream>

using namespace cv; using namespace std;

int main() {

VideoCapture vcap;
Mat image;    
const string videoStreamAddress = "http://169.254.49.163/cgi-bin/viewer/video.jpg";
vcap.open(videoStreamAddress);

while (waitKey(10)!=27){
             vcap.read(image);
    imshow("Output Window", image);
    vcap.open(videoStreamAddress);
}}
edit retag flag offensive close merge delete