Ask Your Question
0

line function is not recognized [closed]

asked 2017-05-01 08:04:33 -0600

updated 2017-05-01 08:20:50 -0600

LBerger gravatar image

i am working in visual studio 2015 and opencv 3.1. when i run typical code for drawing line ;

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include<iostream>
using namespace cv;

int main()
{
    // Create black empty images
    Mat image = Mat::zeros(400, 400, CV_8UC3);

    // Draw a line 

    line(image, Point(15, 20), Point(70, 50), Scalar(110, 220, 0), 2, 8);

    waitKey(0);
    return(0);
}

i get the build error: identifier "line" is undefined

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by LBerger
close date 2017-05-01 09:44:05.693266

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-01 08:19:56 -0600

LBerger gravatar image

line is in imgproc module. You have to use

#include "opencv2/imgproc.hpp"

or to include everything

#include <opencv2/opencv.h>
edit flag offensive delete link more

Comments

#include "opencv2/imgproc.hpp" is there. Thank you.

skvasistha gravatar imageskvasistha ( 2017-05-01 08:24:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-05-01 08:04:33 -0600

Seen: 767 times

Last updated: May 01 '17