Ask Your Question

YOGENDRARP's profile - activity

2013-07-05 04:07:34 -0600 asked a question i get a solid grey color on my window if i open a image

Steve sir as u said i tried with new versions of opencv but problem still pertains.. please help me out this is the code

#include "stdafx.h"
#include "cv.h"      
#include "highgui.h"

int _tmain(int argc, _TCHAR* argv[])
{
 IplImage* img = cvLoadImage( "image" );
 cvNamedWindow( "MyJPG", CV_WINDOW_AUTOSIZE );
 cvShowImage("MyJPG", img);
 cvWaitKey(0);
 cvReleaseImage( &img );
 cvDestroyWindow( "MyJPG" );
 return 0;
}
2013-07-03 21:37:28 -0600 received badge  Editor (source)
2013-07-03 15:08:12 -0600 commented question A solid grey color appears when displaying a webcam image.

the same problem even if i try to load a image form project folder..

2013-07-03 14:59:25 -0600 asked a question A solid grey color appears when displaying a webcam image.

I get a solid grey color on my original image and a black screen as my processed image i use opencv 2.2 with VS2010

            CvSize size640X480= cvSize( 640 , 480);
    CvCapture * p_webcam;
    IplImage * p_imgOriginal;
    IplImage * p_processed;
    CvMemStorage * p_strstorage;
    CvSeq * p_circleseq;
    float * p_arrayXYRad;
    int i;
    char checesc;
    p_webcam=cvCaptureFromCAM(0);
    if(p_webcam==NULL)
    {
        printf("Capture is null: enter any key to cont");
        getchar();
        return(-1);
    }
    cvNamedWindow("Original",CV_WINDOW_AUTOSIZE);
    cvNamedWindow("Processed",CV_WINDOW_AUTOSIZE);
    p_processed=cvCreateImage(size640X480,IPL_DEPTH_8U,1);
    while(1)
    {
        p_imgOriginal=cvQueryFrame(p_webcam);
        if(p_imgOriginal==NULL)//in case failure to captuire
    {
        printf("Capture is null :: 404 image not found: enter any key to cont");
        getchar();
        break;
    }
        cvInRangeS(p_imgOriginal,CV_RGB(100,0,0),CV_RGB(255,100,100),p_processed);
        p_strstorage=cvCreateMemStorage(0);
        cvSmooth(p_processed,p_processed,CV_GAUSSIAN,9,9);
              p_circleseq=cvHoughCircles(p_processed,p_strstorage,CV_HOUGH_GRADIENT,2,p_processed->height/4,100,50,10,400);
    for(i=0;i<p_circleseq->total;i++)
    {

        p_arrayXYRad= (float *) cvGetSeqElem(p_circleseq,i);
        printf("Ball Position x=%f y=%f and rad=%f",p_arrayXYRad[0],p_arrayXYRad[1],p_arrayXYRad[2]);
        cvCircle(p_imgOriginal,cvPoint(cvRound((double)p_arrayXYRad[0]) , cvRound(p_arrayXYRad[1])),3,CV_RGB(0,255,0),CV_FILLED);
        cvCircle(p_imgOriginal,cvPoint(cvRound(p_arrayXYRad[0]) , cvRound(p_arrayXYRad[1])),cvRound(p_arrayXYRad[2]),CV_RGB(255,0,0),3);

    }
    cvShowImage("Original",p_imgOriginal);
    cvShowImage("Processed",p_processed);
    cvReleaseMemStorage(&p_strstorage);
    checesc=cvWaitKey(20);
    if(checesc==27)break;

} cvReleaseCapture(&p_webcam); cvDestroyWindow("Original"); cvDestroyWindow("Processed");


EDIT : merged from other topic

Extra code running on latest OpenCV version 2.4.6 but not working.

#include "stdafx.h"
#include "cv.h"      
#include "highgui.h"

int _tmain(int argc, _TCHAR* argv[])
{
 IplImage* img = cvLoadImage( "image" );
 cvNamedWindow( "MyJPG", CV_WINDOW_AUTOSIZE );
 cvShowImage("MyJPG", img);
 cvWaitKey(0);
 cvReleaseImage( &img );
 cvDestroyWindow( "MyJPG" );
 return 0;
}

Tip from @Guanta :

Guess your path is simply wrong, currently it searches after "image". Don't you mean "image.jpg" or "image.png" or sth else? You are using also the C-API, I can only recommend to switch to C++ , see e.g. http://docs.opencv.org/doc/tutorials/introduction/display_image/display_image.html#display-image .

2013-07-03 08:01:38 -0600 commented answer how to start a action on text detection??

m taking video tutorials on the same...thanks for the help :)

2013-07-03 07:58:53 -0600 commented answer how to start a action on text detection??

m just a beginner with cv.. Thank you very much :)

2013-07-02 23:49:37 -0600 asked a question how to start a action on text detection??

I want to play some sound on detection of particular text which is present in a rectangle box.