Hi
im quite new to Python and learned all by myself so far. Thats why i dont have much knowledge about data types yet
I wrote a code that finds contours in a picture and draws a minAreaRect() around them. Important for me is the width and height of these rectangles which are return values of minAreaRect(). I am able to print width and height in terminal but i cant manage to use them in puttext function to display them in image. I think the values width and heigth have a “false” data type, but im too new to fully understand the documentation of functions.
My current loop code:
Error:
Traceback (most recent call last):
File “d:\content_Main”, line 77, in
print(‘Funktion contour_areas vor sortieren:’, contour_areas(contours))
File “d:\content_Main”, line 74, in contour_areas
cv.putText(imgcontours_min_area, “w={},h={}”.format(w, h), (x,y - 10), cv.FONT_HERSHEY_SIMPLEX, 0.7, (0,0,255), 2)
cv2.error: OpenCV(4.5.5) error: (-5:Bad argument) in function ‘putText’
Overload resolution failed:
- Can’t parse ‘org’. Sequence item with index 0 has a wrong type
- Can’t parse ‘org’. Sequence item with index 0 has a wrong type