Skip to content

getFontScaleFromHeight

Image processingfunctionOpenCV 5.0.0
import { getFontScaleFromHeight } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSfontFace, pixelHeight, thickness
FUNCTIONgetFontScaleFromHeight
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Calculates the font-specific size to use to achieve a given height in pixels.

See: cv::putText

getFontScaleFromHeight(fontFace: number, pixelHeight: number, thickness: number): number;
2 available overloads
getFontScaleFromHeight(fontFace: number, pixelHeight: number): number;
getFontScaleFromHeight(fontFace: number, pixelHeight: number, thickness: number): number;
fontFace

Font to use, see cv::HersheyFonts.

pixelHeight

Pixel height to compute the fontScale for

thickness

Thickness of lines used to render the text.See putText for details.

Returns

The fontSize to use for cv::putText

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.