English | 中文
A library for cropping image in a smart way that can identify the border and correct the cropped image. Applicable to ID cards, business cards, documents and other photos of the crop. If you like, welcome start, fork or follow me.
- Crop image in a smart way that can identify the border.
- Support drag anchors, magnifying glass effect to enhance the positioning experience.
- Use the perspective transform to crop and correct the selection to restore the front image.
- Support rich UI settings, such as auxiliary lines, mask, anchor, magnifying glass and so on.
Sample(link)
You can clone the project,and import smartcropperlib as a Android moudle to your project. Or import aar files.(JCenter address will be provided later)
note:
-keep class me.pqpo.smartcropperlib.**{*;}
<me.pqpo.smartcropperlib.view.CropImageView
android:id="@+id/iv_crop"
android:layout_width="match_parent"
android:layout_height="match_parent" />
note: CropImageView extends from ImageView,and ScaleType must be center type,If you set ScaleType to fit_end,fit_start,matrix will throws an error。
ivCrop.setImageToCrop(selectedBitmap);
It will identify the border by native(c/c++), and show Image.
Bitmap crop = ivCrop.crop();
- Optimization point sorting algorithm
- CropImageView selection magnifying effect
- CropImageView xml settings
- Optimization of intelligent selection algorithm
- Please submit ISSUEs
- Email: [email protected]
- GitHub: pqpo
- Blog: pqpo's notes
- Twitter: Pqponet
- WeChat: pqpo_me
Copyright 2017 pqpo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.