Ask Your Question

Revision history [back]

OpenCV, non specific text

CvSeq* circles = cvHoughCircles(tempFrame, storage, CV_HOUGH_GRADIENT, 1, tempFrame->height/4, 50, 50, 20, 75);
for (size_t i = 0; i < circles->total; i++)

{ // round the floats to an int float* p = (float*)cvGetSeqElem(circles, i); cv::Point center(cvRound(p[0]), cvRound(p[1]));

 int radius = cvRound(p[2]);
 cvCircle(pFrame, center, 3, CV_RGB(0,255,0), -1, 8, 0 );//Ζωγράφισε το κέντρο του κύκλου.
 cvCircle(pFrame, center, radius+1, CV_RGB(0,0,255), 2, 8, 0 );//Ζωγράφισε το περίγραμμα του κύκλου.

if (center.y == 240 ) {cvWaitKey(150);
t++; } else {} printf("x: %d y: %d r: %d t: %d\n",center.x,center.y, radius,t); }

CvFont font; cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 1.0, 1.0, 0, 1, CV_AA); cvPutText(pProcessedFrame, "blabla", cvPoint(10, 130), &font, cvScalar(255, 255, 255, 0));

cvShowImage("WebCam", pFrame);//Εμφάνισε τα κανονικά frame στο παράθυρο αυτό
cvShowImage("Processed WebCam", pProcessedFrame);//Δείξε τα επεξεργασμένα frame στο παράθυρο αυτό.

keypress = cvWaitKey(20);//Περίμενε 20 msec.
if (keypress == 27)//Άλλαξε το flag σε quit αν πατηθεί το πλήκτρο escape.
{
    quit = true;
}} //Τέλος του while

Hello guys, i believe this question isn't that hard but for some reason i cant seem to find any answers on the internet. Maybe i am not doing some good research.

I am having a counter(integer) on my program which is the one named t. It changes from time to time according to some camera interactions i am doing. I just want this to be shown in the video result, the one named pProcessedFrame.

Command cvPutText that i am including here, doesnt work for me because it can only show specific text. I want it to change from time to time like i mentioned before.

Any other command i am not aware of?

OpenCV, non specific text

 CvSeq* circles = cvHoughCircles(tempFrame, storage, CV_HOUGH_GRADIENT, 1, tempFrame->height/4, 50, 50, 20, 75);
 for (size_t i = 0; i < circles->total; i++)

{ // round the floats to an int float* p = (float*)cvGetSeqElem(circles, i); cv::Point center(cvRound(p[0]), cvRound(p[1]));

cvRound(p[1]));

     int radius = cvRound(p[2]);
  cvCircle(pFrame, center, 3, CV_RGB(0,255,0), -1, 8, 0 );//Ζωγράφισε το κέντρο του κύκλου.
  cvCircle(pFrame, center, radius+1, CV_RGB(0,0,255), 2, 8, 0 );//Ζωγράφισε το περίγραμμα του κύκλου.

if (center.y == 240 ) {cvWaitKey(150);
t++; } else {} printf("x: %d y: %d r: %d t: %d\n",center.x,center.y, radius,t); }

} CvFont font; cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 1.0, 1.0, 0, 1, CV_AA); cvPutText(pProcessedFrame, "blabla", cvPoint(10, 130), &font, cvScalar(255, 255, 255, 0));

0));

    cvShowImage("WebCam", pFrame);//Εμφάνισε τα κανονικά frame στο παράθυρο αυτό
 cvShowImage("Processed WebCam", pProcessedFrame);//Δείξε τα επεξεργασμένα frame στο παράθυρο αυτό.

 keypress = cvWaitKey(20);//Περίμενε 20 msec.
 if (keypress == 27)//Άλλαξε το flag σε quit αν πατηθεί το πλήκτρο escape.
 {
     quit = true;
 }} //Τέλος του while

Hello guys, i believe this question isn't that hard but for some reason i cant seem to find any answers on the internet. Maybe i am not doing some good research.

I am having a counter(integer) on my program which is the one named t. It changes from time to time according to some camera interactions i am doing. I just want this to be shown in the video result, the one named pProcessedFrame.

Command cvPutText that i am including here, doesnt work for me because it can only show specific text. I want it to change from time to time like i mentioned before.

Any other command i am not aware of?