SensingLab3/hello_world.cpp

20 lines
404 B
C++

#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"
int main()
{
//initialize a matrix of black pixels
cv ::Mat img = cv::Mat::zeros(120,350,CV_8UC3);
//write text on image
putText(img, "Hello World", cv::Point(15,70), cv::FONT_HERSHEY_PLAIN, 3, cv::Scalar(0,255,0),4);;
//display the image
imshow("Win",img);
//wait for a key press to exit
cv::waitKey(0);
return 0;
}