Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV function for Analog camera

Which OpenCV's function support the analog camera for live streaming?

Which OpenCV function for Analog camera

Which OpenCV's function support the analog camera for live streaming?

Which OpenCV function for Analog cameracamera?

Which OpenCV's function support the analog camera for live streaming?

click to hide/show revision 4
retagged

updated 2013-10-16 07:23:58 -0600

berak gravatar image

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

click to hide/show revision 5
retagged

updated 2013-10-16 07:24:26 -0600

berak gravatar image

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Please give me the answer. Thanks for your time.

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Please give me the answer. answer.

I tried CvCapture and VideoCapture functions of OpenCV. It works for USB camera but did not work for Analog camera.

I tried VideoInput function.It works well with analog camera but i want opencv inbuilt function. So please help me. Thanks for your time.

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Please give me the answer.

I tried CvCapture and VideoCapture functions of OpenCV. It works for USB camera but did not work for Analog camera.

I tried VideoInput function.It works well with analog camera but i want to use opencv inbuilt function. So please help me. Thanks for your time.

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Please give me the answer.

I tried CvCapture and VideoCapture functions of OpenCV. It works for USB camera but did not work for Analog camera.

I tried VideoInput function.It works well with analog camera but i want to use opencv inbuilt function. So please help me. Thanks for your time.

This is my code and I have used videoInput function and it works well.

#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include "videoInput.h"
#include <opencv2/imgproc/imgproc.hpp>


using namespace cv;
using namespace std;

int main(int, char**)
{
   videoInput VI;
    int numDevices = VI.listDevices();
    //int device1= 0;
    VI.setup(0);

    unsigned char* yourBuffer = new unsigned char[VI.getSize(0)];

    IplImage* colourImage = cvCreateImage(cvSize(320,240),8,3);

    while(1)
    {
        VI.grabFrame(0, yourBuffer);
        colourImage->imageData = (char*)yourBuffer;
        cvConvertImage(colourImage, colourImage, 3);

        cvShowImage("test",colourImage);

        if( cvWaitKey(10) == 27) 
            break;
    }
    return 0;
}

Which OpenCV function for Analog camera?

Which OpenCV's function support the analog camera for live streaming?

Please give me the answer.

I tried CvCapture and VideoCapture functions of OpenCV. It works for USB camera but did not work for Analog camera.

I tried VideoInput function.It works well with analog camera but i want to use opencv inbuilt function. So please help me. Thanks for your time.

Thanks for your reply.

This is my code and I have used videoInput function and it works well.

#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include "videoInput.h"
#include <opencv2/imgproc/imgproc.hpp>


using namespace cv;
using namespace std;

int main(int, char**)
{
   videoInput VI;
    int numDevices = VI.listDevices();
    //int device1= 0;
    VI.setup(0);

    unsigned char* yourBuffer = new unsigned char[VI.getSize(0)];

    IplImage* colourImage = cvCreateImage(cvSize(320,240),8,3);

    while(1)
    {
        VI.grabFrame(0, yourBuffer);
        colourImage->imageData = (char*)yourBuffer;
        cvConvertImage(colourImage, colourImage, 3);

        cvShowImage("test",colourImage);

        if( cvWaitKey(10) == 27) 
            break;
    }
    return 0;
}

End of code.

Next code using video capture function which is opencv function.But this function not support the analog camera.

start of code

int main() {
VideoCapture stream1(-1);   //0 is the id of video device.0 if you have only one camera.

    if (!stream1.isOpened()) { //check if video device has been initialised
        cout << "cannot open camera";
        return 0;
    }

//unconditional loop
    while (true) {
        Mat cameraFrame;
        stream1.read(cameraFrame);
        imshow("cam", cameraFrame);
        if (waitKey(30) >= 0)
        break;
    }
    return 0;
}

end of code

And last code using cvcapture and it is also opencv function and it is also not support analog camera.

start of code is

char key;
int main()
{
    cvNamedWindow("Camera_Output", 1);    //Create window
    CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY);  //Capture using any camera connected to your system
    while(1){ //Create infinte loop for live streaming

        IplImage* frame = cvQueryFrame(capture); //Create image frames from capture
        cvShowImage("Camera_Output", frame);   //Show image frames on created window
        key = cvWaitKey(10);     //Capture Keyboard stroke
        if (char(key) == 27){
            break;      //If you hit ESC key loop will break.
        }
    }
    cvReleaseCapture(&capture); //Release capture.
    cvDestroyWindow("Camera_Output"); //Destroy Window
    return 0;
}

End of code

Please help me.

Which OpenCV function for Analog camera?

image descriptionWhich OpenCV's function support the analog camera for live streaming?

Please give me the answer.

I tried CvCapture and VideoCapture functions of OpenCV. It works for USB camera but did not work for Analog camera.

I tried VideoInput function.It works well with analog camera but i want to use opencv inbuilt function. So please help me. Thanks for your time.

Thanks for your reply.

This is my code and I have used videoInput function and it works well.

#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include "videoInput.h"
#include <opencv2/imgproc/imgproc.hpp>


using namespace cv;
using namespace std;

int main(int, char**)
{
   videoInput VI;
    int numDevices = VI.listDevices();
    //int device1= 0;
    VI.setup(0);

    unsigned char* yourBuffer = new unsigned char[VI.getSize(0)];

    IplImage* colourImage = cvCreateImage(cvSize(320,240),8,3);

    while(1)
    {
        VI.grabFrame(0, yourBuffer);
        colourImage->imageData = (char*)yourBuffer;
        cvConvertImage(colourImage, colourImage, 3);

        cvShowImage("test",colourImage);

        if( cvWaitKey(10) == 27) 
            break;
    }
    return 0;
}

End of code.

Next code using video capture function which is opencv function.But this function not support the analog camera.

start of code

int main() {
VideoCapture stream1(-1);   //0 is the id of video device.0 if you have only one camera.

    if (!stream1.isOpened()) { //check if video device has been initialised
        cout << "cannot open camera";
        return 0;
    }

//unconditional loop
    while (true) {
        Mat cameraFrame;
        stream1.read(cameraFrame);
        imshow("cam", cameraFrame);
        if (waitKey(30) >= 0)
        break;
    }
    return 0;
}

end of code

And last code using cvcapture and it is also opencv function and it is also not support analog camera.

start of code is

char key;
int main()
{
    cvNamedWindow("Camera_Output", 1);    //Create window
    CvCapture* capture = cvCaptureFromCAM(CV_CAP_ANY);  //Capture using any camera connected to your system
    while(1){ //Create infinte loop for live streaming

        IplImage* frame = cvQueryFrame(capture); //Create image frames from capture
        cvShowImage("Camera_Output", frame);   //Show image frames on created window
        key = cvWaitKey(10);     //Capture Keyboard stroke
        if (char(key) == 27){
            break;      //If you hit ESC key loop will break.
        }
    }
    cvReleaseCapture(&capture); //Release capture.
    cvDestroyWindow("Camera_Output"); //Destroy Window
    return 0;
}

End of code

Please help me.