[P] Rotating image about a pivot…pad_width must be of integral (type error)
I am developing an image to text conversion system using EAST text detector and pytesseract.
For tilted text portions in the image, I have found out the tilt angle and start point of the text bound and used the following code to rotate the image through the given angle about a given pivot point.
def rotateImage(img, angle, pivot): padX =[img.shape[1]- pivot[0], pivot[0]] padY =[img.shape[1]- pivot[0], pivot[0]] imgP =np.pad(img, [padX,padY], ‘constant’) imgR =scipy.ndimage.rotate(imgP, angle, reshape=False) return imgR[padY[0]: -padY[1], padX[0] : -padX[1]]
the angle and pivot are given as int values but even then at time im getting a typeerror saying pad_width must be of integral type
what is the problem here and how to solve it
submitted by /u/abbhn
[link] [comments]