See: Description
| Package | Description |
|---|---|
| com.pixelnetica.docimageproc |
Document Imaging SDK API (Version 1x) (deprecated).
|
| com.pixelnetica.imagesdk |
Please take a look at bundled sample application source code to see how to use DI SDK in real application.
|
Pixelnetica Document Scanning SDK (DSSDK) adds a lot of value to mobile applications and services by enabling high-quality document scanning and processing using a camera built into a smart-phone or tablet.
Pixelnetica DSSDK provides developers with an intelligent, highly efficient toolkit, which offers an easy way to add image processing features that are optimized for document photos that are taken by a mobile device or document camera to their applications.
To see API level support by each Android platform please visit Android Developers site.
For more details on previous updates please view full Change Log.
Please follow the steps below to add Pixelnetica Document Image SDK to custom Android project in Android Studio.
repositories{
maven {
url 'http://repo.pixelnetica.com:8081/artifactory/libs-release'
}
}
dependencies {
implementation 'com.pixelnetica.sdk:scanning-release:2.3.9'
.....
}
Please use most recent DSSDK version if you have active SMUA (Support Maintenance and Upgrade Assurance) subscription or version you've purchased if you don't have active SMUA.
If you are not sure feel free to contact Pixelnetica Support.
Take into consideration that from time to time DSSDK could be changed. Please check Change Log, Documentation and demo application source code for more details.
Currently DSSDK supports the following Application Binary Interface, or ABI: armeabi-v7a, arm64-v8a, x86 x86_64
To include necessary ABIs please adjust the abiFilters configuration in your build.gradle file.
android {
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
}
In sample application x86 architecture included by default to support development and testing under emulator.
⚠️ We strongly suggest to exclude not necessary ABIs (like x86) for production build to significantly reduce your release apk.
// Initialize SDK one time. Overriding Application.onLoad() is better choice.
// That supposes license key stored in the assets
ImageSdkLibrary.load(getApplication());
......
// Create SDK instance
ImageProcessing sdk = new ImageSdkLibrary().newProcessingInstance();
// Obtain your bitmap
Bitmap bitmap = ....;
// Create and setup MetaImage
MetaImage source = new MetaImage(bitmap, bitmapPath);
source.setStrongShadows(true); // if need
// Detect document corners
Bundle params = new Bundle();
Corners corners = sdk.detectDocumentCorners(source, params);
if (corners != null) {
// Corners detected!
// Get detection confidence
boolean isSmartCropMode = params.getBoolean("isSmartCropMode");
// Crop image
MetaImage cropped = sdk.correctDocument(source, corners);
// Binarize image
MetaImage target = sdk.imageBWBinarization(cropped);
// Use those result!
Bitmap result = target.getBitmap();
}
Please take a look at bundled sample application source code to see how to use DSSDK in real application.
DocImageProc with new SDK but new features will not be available.
We strongly recommend migration to the new SDK version.
com.pixelnetica.docimageproc to com.pixelnetica.imagesdkcom.pixelnetica.docimageproc.DocImageProc to com.pixelnetica.imagesdk.ImageProcessingcom.pixelnetica.docimageproc.Metaimage to com.pixelnetica.imagesdk.MetaImage. Don't forget capital I in MetaImagenew DocImageProc(...) to new ImageSdkLibrary(...).newProcessingInstance()DocImageProc.load(android.app.Application) to ImageSdkLibrary.load(android.app.Application)sdk.close() to sdk.destroy() or simply remove this call, since it doesn't needed anymore.DocImageProc.detectDocumentCorners(com.pixelnetica.docimageproc.Metaimage, boolean, com.pixelnetica.docimageproc.PxDocCorners) change
com.pixelnetica.docimageproc.PxDocCorners to android.os.Bundle. PxDocCorners.isSmartCropMode is now boolean key "isSmartCropMode" in the Bundle.ImageProcessing.detectDocumentCorners(com.pixelnetica.imagesdk.MetaImage, android.os.Bundle)
now returns Corners or null on failureCorners now supports Android's ParcelableFor reference see how it done in Demo Sample application (source code provided with SDK demo package).
SDK should be initialised only once - no need to send object-application on each SDK call.
You can choose one of three options to pass your license key to SDK
src/main/assets/pixelnetica/scanning/(file)Where (file) is described on ImageSdkLibrary.load()
ImageSdkLibrary.load(app)only with one Application argument.
ImageSdkLibrary.load(app, licenceKey)
public class CropDemoApp extends Application {
/*****/
@Override
public void onCreate() {
super.onCreate();
// Initialize Image SDK
ImageSdkLibrary.load(this);
// Where we suppose licence key stored in assets
}
// Create processing instance
ImageProcessing sdk = new ImageSdkLibrary().newProcessingInstance();
// You one use try-with-resources for image writer instance
try (ImageWriter writer = new ImageSdkLibrary().newImageWriterInstance(IMAGE_WRITER_PDF)) {
/*****/
}
catch(ImageWriterException e) {
/*****/
}
Document Scanning SDK demo libs features is identical to runtime except one thing - it puts watermark on resulted image in any application with package id other than "com.pixelnetica.cropdemo" (this is Demo application package id).
To demonstrate most of DSSDK features and the way how it should be used in real application demo package bundled with demo application source code.
In order to understand how its work please take a look at Demo Application brief manual.
Feel free to contact us in case of any inquires: Pixelnetica Support.