Skip to main content

Blog

Learn About Our Meetup

5000+ Members

MEETUPS

LEARN, CONNECT, SHARE

Join our meetup, learn, connect, share, and get to know your Toronto AI community. 

JOB POSTINGS

INDEED POSTINGS

Browse through the latest deep learning, ai, machine learning postings from Indeed for the GTA.

CONTACT

CONNECT WITH US

Are you looking to sponsor space, be a speaker, or volunteer, feel free to give us a shout.

[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]