I would like to render a custom text on an image using opencv, while having a white outline around the text, with the inside of the text being black. Currently I am only able to print the text in a single static color (black in this case) like so:
cv2.putText(img, "My text", (x, y), font, font_size, (0, 0, 0), font_thickness, lineType = cv2.LINE_AA)
How can I achieve an effect like the one shown below, where the outline of the text is printed in white, and the inner part in black?
Note: The text is placed on an image, so the remaining space (the grey space in the example image) around the text should be transparent.