Ask Your Question

Revision history [back]

What is the best way to open and input a camera image? I am using opencv2.2 with windows vista. All I see is grey.

Best camera input method.

What is the best way to open and input a camera image? image?

I am using opencv2.2 with windows vista. All I see is grey.

Best a grey image when calling the camera input. Can someone suggest me the best camera input method.method?

include <opencv2\core\core.hpp>
include <opencv2\highgui\highgui.hpp>
include <opencv2/opencv.hpp>
include <opencv2/objdetect/objdetect.hpp>
include <opencv2/imgproc/imgproc.hpp>
include <iostream>
include <stdio.h>
include <windows.h>

using namespace cv; using namespace std; bool fg=1; bool cg=1;

int threshold_value = 70; int threshold_type = 0;; int const max_value = 255; int const max_type = 4; int const max_BINARY_value = 255; char* window_name = "Threshold Demo";

int main() { if(1){

//VideoCapture capture("2013.wmv"); 
//"2013.wmv" open the default camera (0)
//  VideoCapture  set(CV_CAP_PROP_CONVERT_RGB);

VideoCapture capture(0); VideoCapture set(CV_CAP_PROP_CONVERT_RGB);

waitKey(1000);

if(!capture.isOpened()) // check if we succeeded