Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align image of pages #2

Open
rishiraj opened this issue Dec 11, 2020 · 4 comments
Open

Align image of pages #2

rishiraj opened this issue Dec 11, 2020 · 4 comments

Comments

@rishiraj
Copy link
Member

Goal

Align image of pages that are in different orientations using keypoint matching and a homography matrix so that we can apply OCR to the texts in the page.

Considerations

We'll be developing a generalized document scanner so there won't be a special text filled template to extract keypoints for matching. A perfectly aligned empty page might be a good template. We can then compute a homography matrix, which allows us to apply a perspective warp to align the image of pages.

Deliverables

  • A Colab Notebook to demonstrate the idea.
  • A Python script (you can modularize code with multiple scripts too) for the end-to-end execution i.e. this script will take an image of a page as its input, align it in proper orientation, and display the aligned image on the screen.

Tools

You are free to use open-source pre-trained models. If you use someone else's please attribute it. If your code is plagiarized then you will be suspended (applicable only if you are a WoC participant).

This template was adapted from Deep Fusion AI's organization template: thank you Sayak Paul for writing it!

@carrycooldude
Copy link

I want to work on this issue and I am Selected for this repo

@Abhinav-2901
Copy link

My idea to overcome this issue is by reordering the the detected corner points of the greatest contour detected so that we can provide those corner points in the correct order for wraping.
I have created a reorder function in my python file.
I used simple numpy library and some basic maths to do that.
Sample output and python file is attached with the comment.
test

@rishiraj
Copy link
Member Author

My idea to overcome this issue is by reordering the the detected corner points of the greatest contour detected so that we can provide those corner points in the correct order for wraping.
I have created a reorder function in my python file.
I used simple numpy library and some basic maths to do that.
Sample output and python file is attached with the comment.
test

Hey @Abhinav-2901 I can't find the Python code you have mentioned here. Please upload it.

@Abhinav-2901
Copy link

Abhinav-2901 commented Dec 22, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants