opencv::highgui

Function add_text_with_font_def

source
pub fn add_text_with_font_def(
    img: &impl MatTraitConst,
    text: &str,
    org: Point,
    name_font: &str,
) -> Result<()>
Expand description

Draws a text on the image.

§Parameters

  • img: 8-bit 3-channel image where the text should be drawn.
  • text: Text to write on an image.
  • org: Point(x,y) where the text should start on an image.
  • nameFont: Name of the font. The name should match the name of a system font (such as Times). If the font is not found, a default one is used.
  • pointSize: Size of the font. If not specified, equal zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points.
  • color: Color of the font in BGRA where A = 255 is fully transparent.
  • weight: Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control.
  • style: Font style. Available operation flags are : cv::QtFontStyles
  • spacing: Spacing between characters. It can be negative or positive.

§Note

This alternative version of add_text_with_font function uses the following default values for its arguments:

  • point_size: -1
  • color: Scalar::all(0)
  • weight: QT_FONT_NORMAL
  • style: QT_STYLE_NORMAL
  • spacing: 0