Extract a bordered, skewed rectangle from an image

Paul Hemans darwin at nowhere.com
Thu May 6 21:03:55 EDT 2010


We have a scanned document on which a label has been attached. The label has 
been designed to have a border that makes it easy to determine the correct 
orientation and area of the label. The label portion of the scanned image 
needs to be extracted and deskewed as an image. The contents of the label 
will change, but the border won't
I originally posted this onto RentAcoder as a project, but I am not getting 
a lot of responses. It might be that I requested it be done in Python, its 
too hard or I am too stingy. You can see the project here:
http://www.RentACoder.com/RentACoder/misc/BidRequests/ShowBidRequest.asp?lngBidRequestId=1402446

It may not be feasible to do this project without the use of an image 
processing engine such as openCV. There is a routine in openCV called 
cvMinAreaRect2() that may do the job of returning a matching rectangle that 
is inclined. There is a Python to openCV interface available. So I think all 
the pieces are there, but this is out of my league as I have had very little 
experience with image processing.

I am wondering whether there are any people here that have experience with 
openCV and Python. If so, could you either give me some pointers on how to 
approach this, or if you feel so inclined, bid on the project. There are 2 
problems:
How do I get openCV to ignore the contents of the label and just focus on 
the border?
How to do this through Python into openCV? I am a newbie to Python, not 
strong in Maths and ignorant of the usage of openCV.

Thanks.





More information about the Python-list mailing list