pqpo/SmartCropper
🔥 A library for cropping image in a smart way that can identify the border and correct the cropped image. 智能图片裁剪框架。自动识别边框,手动调节选区,使用透视变换裁剪并矫正选区;适用于身份证,名片,文档等照片的裁剪。
What it solves
It provides a way to automatically detect and crop rectangular objects from photos—such as ID cards, business cards, and documents—and correct their perspective to produce a flat, front-facing image.
How it works
The library uses a combination of computer vision and machine learning. It initially relied on OpenCV-based algorithms to identify borders. In newer versions (V2.1.1+), it incorporates a TensorFlow-based HED (Holistically-Nested Edge Detection) network to replace the Canny edge detection algorithm, improving the recognition rate of image borders.
Who it’s for
Android developers who need to implement document scanning or smart cropping functionality within their mobile applications.
Highlights
- Intelligent Border Detection: Automatically identifies the edges of documents or cards using ML-enhanced algorithms.
- Perspective Correction: Uses perspective transformation to crop and straighten the selected area into a frontal view.
- Interactive UI: Includes a crop view with draggable anchor points and a magnifying glass effect for precise manual adjustment.
- Customizable Appearance: Offers various XML attributes to configure mask transparency, line colors, and guide lines.
Related
- Project
- Project
- Project
- Project
- Project