what is the best way to detect document corners in android camerax Image analysis?

1.8k Views Asked by At

I want to detect the corners of a document in real time meaning that I want to draw a bounding quad around the document similar to how most doc-scanner app do. I also want to do this by scratch. I have already read a few corner detection algorithms such as the Harris corner detector, but I have a few concerns:

  1. How do I implement this in the image analysis part of the camerax library and draw a bounding quad (not box since it can be slanted) around it in real-time meaning it is updated each frame of the camera preview?
  2. Is there a more optimized approach since for the Harris corner detection, i will have to calculate the Ix, Iy, etc. each frame, and what if there isn't any significant movement in the image and the corners are relatively where they were before?
1

There are 1 best solutions below

2
On

For laying detection result over preview, the question has been asked before. See: How to draw on PreviewView?

I don't know if there is a best practice for documents scanning. Dropbox has a series of well written blog posts on the topic: https://dropbox.tech/tag-results.doc-scanner