hello world program works

This commit is contained in:
Aurelien LOHMANN 2022-03-30 10:13:48 +02:00
parent 76532efb1f
commit d322b58c76
3 changed files with 23 additions and 2 deletions

BIN
hello_world Executable file

Binary file not shown.

15
hello_world.cpp Normal file
View File

@ -0,0 +1,15 @@
#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("eeeeh bin non mec", img);
// wait for a key press to exit the program
cv::waitKey(0);
return 0;
}

View File

@ -1,9 +1,15 @@
all: main arithmetic
g++ arithmetic.o main.o -L/usr/lib/x86_64-linux-gnu -lopencv_core
all: hello_world
g++ hello_world.o -o hello_world -L/usr/lib/x86_64-linux-gnu -lopencv_core -lopencv_highgui -lopencv_imgproc
main: main.cpp
g++ -c main.cpp -I/usr/include/opencv4
arithmetic: arithmetic.cpp arithmetic.h
g++ -c arithmetic.cpp
hello_world: hello_world.cpp
g++ -c hello_world.cpp -I/usr/include/opencv4/opencv2 -I/usr/include/opencv4
clean:
rm *.o
rm a.out