473,549 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotate, crop and extract from image

145 New Member
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.imagesha ck.us/my.php?image=sc reenimageqk9.jp g
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 *
  4. image = Image.open("image.jpg")
  5. print image_to_string(image)
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 *
  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)
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 9438
145 New Member
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.imagesha ck.us/my.php?image=sc reenimage2tw7.j pg
Oct 30 '08 #2

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

Similar topics

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 this. -- Kevin Smith Kevin.Smith@sas.com
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 searched about 50 javascripts sites, but I did not find what I am looking for. Can anyone help me with this? Greetings Leo Koolsbergen
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 that is next to the file field. Once i browse for the file, i check the box to rotate and then upload. However i am unable to get it to rotate when...
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 -- AdamPC@hotmail.com
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
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 arrow key, to rotate the object until its pointed to the right. i tried using a drawing matrix to accomplish this, but all it did was rotate my entire...
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
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 = 'halloween.jpg'; //How many degrees you wish to rotate $degrees = 180;
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 image ?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.