TLDR: Given a scan of a book (sometimes 1-page, sometimes 2-up page spread) your function returns bounding box info for each detected page, along with a confidence rating.
This project is for the creation of a python function, which we will incorporate into a larger python project. You do not need to deliver any UI, installer (other than providing an [login to view URL]), or other components – just the function described below.
Python Function Arguments/parameters:
- JPG or TIFF of a scanned book, open to a single page or a page-spread (as a file path)
- margin/padding (in pixels) to add around the page
- deskew priority preference (see below)
Python Function Returns
- List, of length equal to the number of pages detected. Each item in list to be a tuple containing:
--- bounding box center XY pixel coordinates, using TOP LEFT as [0,0]
--- bounding box width and height in pixels
--- rotation (clockwise = positive) in degrees of deskew
--- confidence rating (0-100) in the proper detection of the crop/rotation for this page
--- bounds violation as a boolean
- each page should be cropped to the minimum bounding box that contains all parts of that page (don't assume the page is properly rectangular) are included, plus the margin/padding passed as an argument
- in some cases, once rotation and margin/padding have been applied the stated crop will fall outside the image area; if this is the case "bounds violation" should be set to TRUE and the bounding box should be returned as-calculated
- pages WILL NOT BE EQUALLY SIZED AND THE GUTTER WILL NOT ALWAYS BE EXACTLY MIDWAY; the center of the gutter of the book should be considered the edge of either page. That is to say, part of your task is the appropriate CV to affirmatively detect the gutter location, and NOT just assume the gutter is half way between the outer edges of the page.
More information about deskew:
- Only allow up to 5º of deskew; anything beyond that should be assumed to be a false-positive
- Priority parameter should allow:
--- "content only" – look for lines of text, and deskew based on their angle
--- "content-then-average" – same as content, but if no suitable content is found with confidence, automatically uses average
--- "outer edge" – deskew based on the angle of the side of the page that is opposite the gutter
--- "top edge" – deskew based on the top edge of the page
--- "bottom edge" – deskew based on the bottom edge of the page
--- "average" – deskew based on the average of (outer edge, top edge, bottom edge)
– must run entirely locally (no internet); therefore no calls to online Google/Amazon/Microsoft APIs
– must run on python 3.7 or 3.8
Example corpus: we have many GB of example JPG files. I have attached 10 to this request, but you can message me for a link to dropbox containing several hundred.
Work would be done under NDA and as work-for hire. Function must be cleanly written, and commented where appropriate.
Delivery should include the python function, a [login to view URL] file, and a one-hour screen sharing session (English language) to walk me through the function's workings.
We understand scope creep and are glad to pay additional for any work we request that is not listed above. Please provide your hourly rate for any such additional work in your proposal/quote.
19 freelancers are bidding on average $568 for this job
I have acquired relevant skills and exp in the field of Artificial Intelligence and worked tirelessly on my skills, which I will put to use developing your project which will render good results.