473,412 Members | 4,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Rotate, crop and extract from image

Thekid
145 100+
Hi, I have an image similar to a clock, with numbers and letters going around in a circle. I need to extract the numbers and letters from the image and have them print out in a straight line and in order from inner circle working out. Here is an example of the image:
http://img296.imageshack.us/my.php?image=screenimageqk9.jpg
Since the characters in the image will be different each time I am starting with a screenshot, then I think I should probably crop at the "12 O'clock" position and extract those figures, then rotate the image about 10 degrees and do the same thing, etc until the image has rotated 360 degrees and I have all of the characters.
I did try a portion of this by cropping the top 2 chars in paint and saving the image and:

Expand|Select|Wrap|Line Numbers
  1. import Image
  2. from pytesser import *
  3.  
  4. image = Image.open("image.jpg")
  5. print image_to_string(image)
  6.  
  7.  
That worked great but I need to rotate as well. The following code doesn't work right but it has some aspects I need:

Expand|Select|Wrap|Line Numbers
  1. import Image
  2. import ImageGrab
  3. from pytesser import *
  4.  
  5.  # take screenshot 
  6. image = ImageGrab.grab()
  7.  #haven't found the exact coordinates yet for box, just an example
  8. box = (100,100,400,400) :
  9. im = image.crop(box)
  10. # rotate image 10 degrees
  11. im1 = im.rotate(10)
  12.  
  13.  
Well, you can see I don't know what to do from there, or how to keep cropping and rotating, I know I need a loop, just not sure how to implement it.
Oct 30 '08 #1
1 9426
Thekid
145 100+
I should also mention that the crop is an up and down rectangle so I can capture 2 chars at once similar to this:
http://img112.imageshack.us/my.php?image=screenimage2tw7.jpg
Oct 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Kevin Smith | last post by:
Is there a way to "auto-crop" an image in PIL? I have some PNG images with white backgrounds that I want cropped to show only the non-white portion in the center, but I don't see how I can do...
6
by: Leo Koolsbergen | last post by:
Hallo, Maybe a very simpel problem, but I cannot find a solution. From a webcam I can retreive pictures, but as the cam is positioned upside down I have to rotate the (jpeg) pictures. I've...
7
by: Showjumper | last post by:
Hi, I have developed an upload server controls to be reused over a number of projects. One of the tasks it needs to handle is to rotate an image. I want to accoplish this by checking the checkbox...
3
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to crop a peice of an ASP.Net Image, allowing the user to zoom in on only a section of the picture?? any help would be appreciated!! thanks --...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
1
by: iwdu15 | last post by:
hi, im trying to rotate a gdi drawn object on my form with a keypress....forinstance when i push the down arrow, for it to rotate the object drawn until the top is down, or if i push the right...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
0
by: harryusa | last post by:
I am experimenting with the rotate function and so far I can't get my code to return anything but the URL of my script. Here it is: <?php // The file you are rotating $image =...
3
by: fuchsia555 | last post by:
hi is there a code to crop bottom border from an image when creating thumbnail for this image without crop the original image , but just crop 15px bottom border for creating the thumbnails for the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.