maxmatteo

AVPRG - 1 - Rechteck Zeichnen

Sep 23rd, 2011
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <opencv2/opencv.hpp>
  2.  
  3. using namespace cv;
  4.  
  5. int main(){
  6.    
  7.     //Zeichenfläche
  8.     Mat image(240, 320,CV_8UC3, Scalar(255,255,255));
  9.  
  10.     //Rechteck zeichnen
  11.     Scalar color (255,0,0); //Rahmenfarbe
  12.     int thickness = 3;//Stiftstärke
  13.  
  14.  
  15.  
  16.  
  17.     Point upperLeft (100,100);
  18.     Point lowerRight (120,200);
  19.  
  20.     Point upperLeft2 (160,100);
  21.     Point lowerRight2 (180,200);
  22.  
  23.     rectangle(image, upperLeft, lowerRight, color, CV_FILLED);//Rechteck einfügen
  24.  
  25.     rectangle(image, upperLeft2, lowerRight2, color, CV_FILLED);//Rechteck einfügen
  26.  
  27.  
  28.     //Fenster erzeugen
  29.     namedWindow("opencv");
  30.    
  31.     //Bild im Fenster darstellen
  32.     imshow("opencv", image);
  33.  
  34.     waitKey(0);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment