Got some problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Got some problem

opencv-users mailing list
Hi everyone! Well i have got a problem here. I am pretty new to openCV and have been trying to learn it. But while writing a code for camera streaming, my camera's light gets on but I cannot get any streaming video. The code does not seem to have any errors as such. But still here it is.
 

 

 #include<opencv/cvaux.h>
 #include<opencv/highgui.h>
 #include<opencv/cxcore.h>
 

 #include<stdio.h>
 #include<stdlib.h>
 int main(int argc, char** argv)
 {
 cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
 CvCapture* capture= cvCaptureFromCAM(CV_CAP_ANY);
 while(1)
 {
 IplImage* frame= cvQueryFrame(capture);
 if(!frame)
 break;
 cvShowImage("Example2",frame);
 char c= cvWaitKey(33);
 if(c==27)
 break;
 }
 cvReleaseCapture(&capture);
 cvDestroyWindow("Example2");
 return 0;
 
 }
 

Reply | Threaded
Open this post in threaded view
|

Re: Got some problem

opencv-users mailing list
Hi,

are you using the C api for any specific reason? The current supported code
is the C++ one, maybe that's the problem. Besides, have you checked if the
camera is working? try with cheese and then check the opencv official
documentation.

for opencv2
http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture

for opencv3
http://docs.opencv.org/trunk/d5/dc4/tutorial_video_input_psnr_ssim.html



*EDGAR RIBA*

On 29 May 2015 at 10:23, [hidden email] [OpenCV] <
[hidden email]> wrote:

>
>
> Hi everyone! Well i have got a problem here. I am pretty new to openCV and
> have been trying to learn it. But while writing a code for camera
> streaming, my camera's light gets on but I cannot get any streaming video.
> The code does not seem to have any errors as such. But still here it is.
>
>
>
> #include<opencv/cvaux.h>
>
> #include<opencv/highgui.h>
>
> #include<opencv/cxcore.h>
>
>
> #include<stdio.h>
>
> #include<stdlib.h>
>
> int main(int argc, char** argv)
>
> {
>
> cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
>
> CvCapture* capture= cvCaptureFromCAM(CV_CAP_ANY);
>
> while(1)
>
> {
>
> IplImage* frame= cvQueryFrame(capture);
>
> if(!frame)
>
> break;
>
> cvShowImage("Example2",frame);
>
> char c= cvWaitKey(33);
>
> if(c==27)
>
> break;
>
> }
>
> cvReleaseCapture(&capture);
>
> cvDestroyWindow("Example2");
>
> return 0;
>
> }
>
>
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: Got some problem

opencv-users mailing list
In reply to this post by opencv-users mailing list
the problem is that in the output window, i get a continuous gray window. its just plain gray.
Reply | Threaded
Open this post in threaded view
|

Re: Got some problem

opencv-users mailing list
In reply to this post by opencv-users mailing list
 

Hi, do you have a cv::waitkey in your code?
It is not necessary to put a waitkey after every imshow, but you have to put at least one.
cv::imshow(... ,... );
cv::waitKey(1);


Enviado desde mi Huawei



-------- Mensaje original --------
Asunto: [OpenCV] Re: Got some problem
De: "[hidden email] [OpenCV]"
Para: [hidden email]
CC:


 

the problem is that in the output window, i get a continuous gray window. its just plain gray.

__._,_.___

Posted by: Paco Parada <[hidden email]>
Reply via web post [hidden email] [hidden email] Start a New Topic Messages in this topic (4)
Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
   Read on the web (read posts on the web only)Or Unsubscribe by mailing [hidden email]

.

__,_._,___
Reply | Threaded
Open this post in threaded view
|

Re: Got some problem

opencv-users mailing list
Try to play with waitKey value at the end of the loop


On Mon, Jun 1, 2015 at 12:16 PM, Paco Parada [hidden email] [OpenCV] <
[hidden email]> wrote:


>
>
> Hi, do you have a cv::waitkey in your code?
> It is not necessary to put a waitkey after every imshow, but you have to
> put at least one.
> cv::imshow(... ,... );
> cv::waitKey(1);
>
>
> Enviado desde mi Huawei
>
>
> -------- Mensaje original --------
> Asunto: [OpenCV] Re: Got some problem
> De: "[hidden email] [OpenCV]"
> Para: [hidden email]
> CC:
>
>
>
>
> the problem is that in the output window, i get a continuous gray window.
> its just plain gray.
>
>
>






--




--------------------
HSO