Ask Your Question

steven's profile - activity

2020-05-24 05:50:41 -0600 received badge  Popular Question (source)
2012-12-29 01:01:00 -0600 commented answer detect object only at the center of the screen

Thanks guys for the reply ! i am sorry for replying late, got sick for the past few days after the Christmas feast :X.

I am actually currently trying detect center of a circle, the object is black colour. Thru a wireless web camera. But however, i still cant find any solution to it . i tried detecting circle, but i couldnt get the center of the circle. :/

2012-12-23 23:42:28 -0600 commented answer detect object only at the center of the screen

thanks man ! but this method only works with image? meaning picture?

2012-12-23 23:40:28 -0600 received badge  Supporter (source)
2012-12-23 07:23:38 -0600 commented answer detect object only at the center of the screen

thanks man for replying, could you give me more ideas of how to do it?

2012-12-23 03:31:19 -0600 asked a question detect object only at the center of the screen

Hi people, i am new to image processing, and here i am asking a novice question. can we detect object only when it is at the center of the camera view? meaning i only want to detect it if is at the center of the camera view.

2012-12-23 00:57:48 -0600 commented question wireless web cam thru ip

help help

2012-12-22 22:03:11 -0600 asked a question wireless web cam thru ip

Hi there, i am a novice towards opencv. i need some help.

i am trying to connect to a wireless webcam d-link dcs-930. But the screen didnt shows up. The code is just a simple code to detect circle. The code works fine when i use my laptop webcam.

My background on opencv, 3 weeks ago i tried to follow the 2.4.3 tutorial and install cmake,cuda,python etc etc but in the end, during the visual studio build, i encounter problems. Then i was told that i dont have to do all that unless i created new library. so now i am just using opencv 2.4.3.

Hope i can get help in this forum. thanks.

************CODE*****************

include <c:\opencv243\include\opencv\cv.h>

include <c:\opencv243\include\opencv\highgui.h>

include <math.h>

int main( int argc, char **argv ) { CvCapture *capture = 0; IplImage *img = 0; int key = 0; CvFont font; cvInitFont(&font, CV_FONT_HERSHEY_PLAIN,1.0,1.0,0,1,CV_AA);

//capture = cvCreateFileCapture("rtsp://192.168.0.20/img/video.sav");

//capture = cvCreateFileCapture("http://192.168.0.20/image/jpeg.cgi"); capture = cvCreateFileCapture("http://192.168.0.20/image/mjpeg.cgi"); //capture = cvCreateFileCapture("rtsp://192.168.0.20/img/media.sav");

//capture = cvCaptureFromFile("http://192.168.0.20/video/mjpg.cgi"); //capture = cvCaptureFromCAM( 0 );

if ( !capture ) {
    fprintf( stderr, "Cannot open initialize webcam!\n" );
    return 1;
}

cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );

img = cvQueryFrame( capture );
if (!img)
    exit(1);
IplImage* gray = cvCreateImage( cvGetSize(img), 8, 1 );
CvMemStorage* storage = cvCreateMemStorage(0);

while( key != 'q' ) {
    img = cvQueryFrame( capture );
    if( !img ) break; 


    cvCvtColor( img, gray, CV_BGR2GRAY );
    cvSmooth( gray, gray, CV_GAUSSIAN, 9, 9 );
    CvSeq* circles = cvHoughCircles( gray, storage, CV_HOUGH_GRADIENT, 2, gray->height/4, 200, 100, 20, 100 );
    int i;
    for( i = 0; i < circles->total; i++ )
    {
        float* p = (float*)cvGetSeqElem( circles, i );
        //cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), 2, CV_RGB(0,255,0), -1, 8, 0 );
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(0,255,0), 2, 8, 0 );
        cvLine (img, cvPoint(cvRound(p[0]+40),cvRound(p[1])), cvPoint(cvRound(p[0]),cvRound(p[1])), CV_RGB(0,255,0), 1, CV_AA,0);
        cvLine (img, cvPoint(cvRound(p[0]),cvRound(p[1]+40)), cvPoint(cvRound(p[0]),cvRound(p[1])), CV_RGB(0,255,0), 1, CV_AA,0);
        cvLine (img, cvPoint(cvRound(p[0]-40),cvRound(p[1])), cvPoint(cvRound(p[0]),cvRound(p[1])), CV_RGB(0,255,0), 1, CV_AA,0);
        cvLine (img, cvPoint(cvRound(p[0]),cvRound(p[1]-40)), cvPoint(cvRound(p[0]),cvRound(p[1])), CV_RGB(0,255,0), 1, CV_AA,0);
        cvPutText(img, "Meow",cvPoint(cvRound(p[0]+45),cvRound(p[1]+45)), &font, CV_RGB(0,0,255));

    }

    cvShowImage( "result", img );
    key = cvWaitKey( 1 );

}

cvDestroyWindow( "result" );
cvReleaseCapture( &capture );   

return 0;

}

**********output***************** 'mynewproject.exe': Loaded 'C:\Users\Steven\Documents\Visual Studio 2010\Projects\mynewproject\x64\Debug\mynewproject.exe', Symbols loaded. 'mynewproject.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'mynewproject.exe': Loaded 'C:\Windows\System32\kernel32 ... (more)