Search
 
SCRIPT & CODE EXAMPLE
 

CPP

opencv c++ hello world

#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"

using namespace cv;

int main(int argc, char** argv) {
    
    //create a gui window:
    namedWindow("Output",1);
    
    //initialize a 120X350 matrix of black pixels:
    Mat output = Mat::zeros( 120, 350, CV_8UC3 );
    
    //write text on the matrix:
    putText(output,
            "Hello World :)",
            cvPoint(15,70),
            FONT_HERSHEY_PLAIN,
            3,
            cvScalar(0,255,0),
            4);
    
    //display the image:
    imshow("Output", output);
    
    //wait for the user to press any key:
    waitKey(0);
    
    return 0;

}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ lock 
Cpp :: infinite loop c++ 
Cpp :: sum of vector elements c++ 
Cpp :: what is the short cut way to find the max and min element in an array in c++ 
Cpp :: min vector c++ 
Cpp :: pow in c++ 
Cpp :: default access modifier in c++ 
Cpp :: convert int to binary string c++ 
Cpp :: queue in c++ 
Cpp :: copy array c++ 
Cpp :: srand() c++ 
Cpp :: appending int to string in cpp 
Cpp :: sort using lambda c++ 
Cpp :: c++ printf char as hex 
Cpp :: bubble sort in c+ 
Cpp :: random number of 0 or 1 c++ 
Cpp :: how to declare a function in c++ 
Cpp :: vector fin element c++ 
Cpp :: sieve of eratosthenes algorithm in c++ 
Cpp :: c++ factorial 
Cpp :: aray of functions in c++ 
Cpp :: c++ reference 
Cpp :: c++ standard library source 
Cpp :: stoi cpp 
Cpp :: how to return char* from function in c++ 
Cpp :: cpp get last element of vector 
Cpp :: c++ function default argument 
Cpp :: comparator in sort c++ 
Cpp :: std vector random shuffle 
Cpp :: cpp getter as const 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =