January 28, 2009 at 9:55 pm (Uncategorized) (, , )

	for akshar in alphabets:
		#print akshar

		draw.text((x, y), unicode(akshar,'UTF-8'), font=font)
		leftx=x-20 #the left end of the small bounding box
		box=(leftx,y,x+100,y+60) #the box in the big image within which the small image of interest lies
		bbox_sub=sub_im.getbbox() #get the bounding box of the black pixels in the sub image, not the big image
		bbox_im=(leftx+bbox_sub[0],y+bbox_sub[1],leftx+bbox_sub[2],y+bbox_sub[3]) #calculate relative to the big image
		print bbox_im

This block of code was instrumental in giving


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: