Ask Your Question

Revision history [back]

cv.putText does not display text properly

Good day. Not so long time ago I started working with openCV for face recognition and was faced with the fact that the text does not want to be drawn normally. Most often, lines appear, sometimes the entire screen turns green and very rarely, the name is displayed as needed. I tried to change the position and style of the font, it did not help. What could be the problem?

            //Draw text
            for (Rect face : facesArray) {
                int posX = (int) Math.max(, 0);
                int posY = (int) Math.max(, 0);
                Imgproc.putText(aInputFrame, name, new Point(posX, posY),
                        Core.FONT_HERSHEY_DUPLEX, 2, new Scalar(0, 255, 0, 255));

image description