]> git.treefish.org Git - stickletrack.git/commitdiff
improved font display.
authorAlex Schmidt <alex@treefish.org>
Wed, 9 Oct 2013 14:57:14 +0000 (16:57 +0200)
committerAlex Schmidt <alex@treefish.org>
Wed, 9 Oct 2013 14:57:14 +0000 (16:57 +0200)
stickletrack.cpp

index e872ebd4111d665fa3e78cf58f3c85b293dbc346..c5c8504dc0889dac29b4fcde422a6e1a9c256aef 100755 (executable)
@@ -123,19 +123,19 @@ void drawTimes(Mat& mContours) {
   alles << framenum << " : " << fixed << (framenum)/(double)Props.fps << "s : +" << (double)moresleep/Props.fps << "ms";
 
   string text = alles.str();
-  int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
+  int fontFace = FONT_HERSHEY_DUPLEX;
 
-  double fontScale = Props.diagonal/1000.0;
-  int thickness = 3;
+  double fontScale = Props.width / 600.0;
+  int thickness = Props.width / 250.0;
 
   int baseline=0;
   Size textSize = getTextSize(text, fontFace,
                              fontScale, thickness, &baseline);
 
-  Point textOrg(10, 10 + textSize.height);
+  Point textOrg(Props.width*0.01, Props.width*0.01 + textSize.height);
 
   rectangle(mContours, Point(0, 0),
-           Point(Props.width, 20+textSize.height),
+           Point(Props.width, Props.width*0.02 + textSize.height),
            Scalar(0,0,255), -1);
 
   putText(mContours, text, textOrg, fontFace, fontScale,