Created
August 14, 2012 06:44
-
-
Save thorikawa/3346985 to your computer and use it in GitHub Desktop.
OpenCV Hello World
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
int main () { | |
cvNamedWindow( "My Window", 1 ); | |
IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 ); | |
CvFont font; | |
double hScale = 2.0; | |
double vScale = 2.0; | |
int lineWidth = 5; | |
cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, hScale, vScale, 0, lineWidth); | |
cvPutText(img, "Hello World!", cvPoint( 100, 200 ), &font, cvScalar( 255, 255, 0 ) ); | |
cvShowImage( "My Window", img ); | |
cvWaitKey(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment