使用Emgu的文本轮廓图

时间:2015-09-30 05:42:23

标签: opencv emgucv

我想注释相机Feed。我目前正在使用这些API

Image<Bgr, byte>.Draw();

然而,根据灯光,文字不可读。所以我想用黑色边框和白色填充绘制文本。我如何使用Emgu做到这一点?

1 个答案:

答案 0 :(得分:1)

var labeledCameraFrame = new Image<Bgr, byte>(cameraFrame.Bitmap);

var border = new Rectangle(0, 0, 200, 40);
labeledCameraFrame.Draw(border, new Bgr(Color.White), -1);
labeledCameraFrame.Draw(border, new Bgr(Color.Black));

CvInvoke.PutText(labeledCameraFrame, "Hello, world", new Point(10, border.Height - 10), FontFace.HersheySimplex, 1.0, new Bgr(Color.Blue).MCvScalar);