#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc.hpp>
using
namespace
cv;
using
namespace
std;
int
main(
int
argc,
char
** argv)
{
Mat image(500, 500, CV_8UC3,
Scalar(0, 0, 0));
if
(!image.data) {
cout <<
"Could not open or find"
<<
" the image"
;
return
0;
}
Point p1(0, 0), p2(100, 0);
Point p3(200, 0), p4(500, 500);
int
thickness = 2;
line(image, p1, p4, Scalar(255, 0, 0),
thickness, LINE_8);
line(image, p2, p4, Scalar(0, 255, 0),
thickness, LINE_4);
line(image, p3, p4, Scalar(0, 0, 255),
thickness, LINE_AA);
imshow(
"Output"
, image);
waitKey(0);
return
0;
}