![]() The third optional argument is used to set the bottom left position as origin if it’s true, but by default, it is set to false, and it will flip the text.įor example, let’s create a black colored 512-by-512 image using the zeros() function of the numpy library and then put some random text on it using the putText() function. The second optional argument is the line type or style, set to cv2.LINE_8 by default. The first optional argument is the thickness of the line, and its value should be an integer by default. Drag and drop a Heading Widget to a column or section and edit the text From the column Style Tab > Background use the image option. There are also three optional arguments that we can set, and if we don’t set the value of the optional argument, a default value will be used. The sixth argument is the text’s color, and its value should be an RGB triplet like (255,255,255) for white color.Īll the above arguments are required, and if one or more arguments are missing, there will be an error. The fifth argument is the font size or font scale, and its value should be of data type double. The fourth argument is the font family, which can be from the default font families of OpenCV like cv2.FONT_HERSHEY_SIMPLEX. The location’s value should be set using two integers in which the first integer defines the x-axis position and the second integer defines the y-axis position.įor example, if we set the location to (10,20), it will place the text 10 pixels away on the x-axis and 20 pixels away on the y-axis from the origin, which is at the image’s top-left. The third argument is the location on which we want to put the text, and by default, the location origin is the top-left of the image. The second argument is the text (string) we want to put on the image. The first argument of the putText() function is the image we want to put the text. We can use the putText() function of OpenCV to put text on an image with our desired color, font size, font family, and location. Use the putText() Function of Opencv to Put Text on Images in Python This tutorial will discuss putting text on images using the putText() function of OpenCV in Python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |