Ask Your Question
0

How to display text on the windows (webcam windows) openCV? [closed]

asked 2014-05-20 09:55:00 -0600

norzanbzura gravatar image

Actually I want to display a text on the popup windows but I have no idea how to code it. There's anyone can help me? Thanks for your consideration.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Martin Peris
close date 2014-05-21 01:54:24.413159

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-05-20 20:48:23 -0600

The functions that you need to check out are getTextSize and putText

You have a nice code example under the documentation of getTextSize

I hope this helps you.

edit flag offensive delete link more

Comments

Here is my code, but I've no idea where to put it and how to code it.

include "opencv/highgui.h"

include "opencv/cv.h"

include <opencv/cxcore.h>

include <iostream>

include <stdio.h>

include <stdlib.h>

using namespace cv; using namespace std;

int main(int, char**) { Mat src; Mat src_gray; int thresh = 100; int max_thresh = 255; RNG rng (12345);

cv::Mat frame;
VideoCapture capture;
capture.open(0);

while (true)
{
    capture.read(frame);
    Mat threshold_output;
    vector&lt;vector&lt;Point&gt;&gt; contours;
    vector&lt;Vec4i&gt; hierarchy;

    cvtColor(frame, src_gray, CV_BGR2GRAY); //produce out2, a one-channel image (CV_BUC1)
    blur(src_gray, src_gray, Size(5,5));

    threshold(src_gray, threshold_output, thresh, max_thresh, CV_THRESH_BINARY_INV);

    findContours(threshold_output, contour
norzanbzura gravatar imagenorzanbzura ( 2014-05-20 23:49:08 -0600 )edit

Hi norzanbzura, could you please update your question with the code that you just posted? The comment section has a limited number of characters, so we can not see it all. Thanks

Martin Peris gravatar imageMartin Peris ( 2014-05-20 23:58:28 -0600 )edit

Hi Martin, I have posted updated question with my full code. Kindly please take a look. Thanks for your consideration.

norzanbzura gravatar imagenorzanbzura ( 2014-05-21 01:41:05 -0600 )edit

Question Tools

Stats

Asked: 2014-05-20 09:55:00 -0600

Seen: 265 times

Last updated: May 20 '14