main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
// C++ program to demonstrate the // above approach #include <iostream> #include <opencv2/core/core.hpp> // Library to include for // drawing shapes #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc.hpp> using namespace cv; using namespace std; // Driver Code int main(int argc, char** argv) { // Create a blank image of size // (500 x 500) with white background // (B, G, R) : (255, 255, 255) Mat image(500, 500, CV_8UC3, Scalar(255, 255, 255)); // Check if the image is created // successfully. if (!image.data) { cout << "Could not open or" << " find the image" << endl; return 0; } // Writing over the Image Point org(30, 100); putText(image, "Text On Image", org, FONT_HERSHEY_SCRIPT_COMPLEX, 2.1, Scalar(0, 0, 255), 2, LINE_AA); // Show our image inside a window. imshow("Output", image); waitKey(0); return 0; } |