huangkyle / ehci

Automatically exported from code.google.com/p/ehci
0 stars 0 forks source link

OpenCv - cvGet2D problem #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a problem with the cvGet2D  in opencv.
I captured video from webcam, and it work.
There is a code part, and i see the video in the opencv window, but the s 
Scalar always get 0 value. But there is an image in the "gray" iplimage.
What i missed in the code?

....
IplImage *frame;
IplImage *gray;
CvCapture* capture = cvCaptureFromCAM(2);
CvScalar s;

.....

frame = cvQueryFrame( capture );
gray = cvCreateImage( cvGetSize(frame), IPL_DEPTH_8U,1 );           
cvCvtColor(frame, gray, CV_RGB2GRAY);
s=cvGet2D(frame,100,100);
....
cvShowImage( "Cam", gray );

Please help me somebody! Thank you!

Original issue reported on code.google.com by sanis...@gmail.com on 7 Dec 2009 at 2:30

GoogleCodeExporter commented 9 years ago
i used it in the code, just writed wrong here:

s=cvGet2D(grey,100,100);

so problem is the same.

Original comment by sanis...@gmail.com on 7 Dec 2009 at 2:43