From baf09008869a1c74f759c72e03225a80ab0465d7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 30 Mar 2022 10:49:36 +0200 Subject: [PATCH] hello_world file --- hello_world.cpp | 21 +++++++++++++++++++++ main.cpp | 2 ++ makefile | 9 ++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 hello_world.cpp diff --git a/hello_world.cpp b/hello_world.cpp new file mode 100644 index 0000000..9c701fd --- /dev/null +++ b/hello_world.cpp @@ -0,0 +1,21 @@ +#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 the 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 the program +cv::waitKey(0); + + return 0; +} + diff --git a/main.cpp b/main.cpp index 3e3c2e7..bd68921 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,6 @@ #include #include "arithmetic.h" +#include "opencv/opencv.hpp" int main() { @@ -7,3 +8,4 @@ int main() std::cout<<"c: "<