Hey :wave: currently need to crop an image at an a...
# android
i
Hey đź‘‹ currently need to crop an image at an angle (not sure what the actual name for this is.) Looked for a few libraries out there but they all seem to do rectangular cropping. To illustrate what I'm trying to do consider image
1)
below, assume you take a picture of a document at an angle. Assuming there's some kind of edge-detection mechanism, 4 corners appear on each corner of the paper page on the pic. The final result should be a cropped image that has been transformed, namely image
2)
. Any help/direction is appreciated 🙌
google 1
stackoverflow 3
c
I don’t know of any libraries for this, but what you’re looking to do is called a “perspective transformation”, which might turn up some better search results for you.
👍 1
i
Ok cool, appreciate the heads up
b
You need a function like opencv.warpPerspective. That does exactly what you need. You can find many tutorial online about how to use it. For reference, you can download on android the application CamScanner. It does that.