public class DocumentDetector
extends java.lang.Object
implements java.lang.AutoCloseable, java.io.Serializable
| Constructor and Description |
|---|
DocumentDetector()
Creates a new instance of the DocumentDetector class.
|
DocumentDetector(long handle)
Creates a new instance of the DocumentDetector class.
|
| Modifier and Type | Method and Description |
|---|---|
DocumentImage |
alignDocument(DocumentImage sourceImage,
DetectedDocument detectedDocument)
Aligns and crops the specified document on the specified image and returns a new DocumentImage.
|
void |
close()
Releases all resources used by this DocumentDetector.
|
DetectedDocument |
detectDocument(DocumentImage image,
Rectangle detectionZone)
Detects a document on a delimited area of the specified DocumentImage and returns a DetectedDocument.
|
DetectedDocument |
detectDocumentByName(DocumentImage image,
java.lang.String documentName,
Rectangle detectionZone)
Detects a document with specified name on a delimited area of the specified DocumentImage and returns a DetectedDocument.
|
protected void |
finalize()
Finalizer for this class.
|
int |
getConfidenceThreshold()
Gets the confidence threshold, from 0 to 100+.
|
float |
getDocumentWidthRatio()
Gets the ratio of the estimated width of the searched document in the image.
|
long |
getHandle()
Gets the native handle.
|
DocumentModel |
getModel()
Gets the model to be used for document detection.
|
ProcessingUnit |
getProcessingUnit()
Gets the processing unit where to run the detection process.
|
int |
getThreadCount()
Gets the number of threads to use for detection.
|
void |
setConfidenceThreshold(int confidenceThreshold)
Sets the confidence threshold, from 0 to 100+.
|
void |
setDocumentWidthRatio(float documentWidthRatio)
Sets the ratio of the estimated width of the searched document in the image.
|
void |
setModel(DocumentModel model)
Sets the model to be used for document detection.
|
void |
setProcessingUnit(ProcessingUnit processingUnit)
Sets the processing unit where to run the detection process.
|
void |
setThreadCount(int threadCount)
Sets the number of threads to use for detection.
|
public DocumentDetector()
throws DocumentException
DocumentException - An error has occurred during Document Library execution.public DocumentDetector(long handle)
throws DocumentException
handle - Handle to the DocumentDetector.DocumentException - An error has occurred during Document Library execution.public void close()
close in interface java.lang.AutoCloseableprotected void finalize()
finalize in class java.lang.Objectpublic long getHandle()
public int getConfidenceThreshold()
throws DocumentException
DocumentException - An error has occurred during Document Library execution.public void setConfidenceThreshold(int confidenceThreshold)
throws DocumentException
confidenceThreshold - Confidence threshold, from 0 to 100+.DocumentException - An error has occurred during Document Library execution.public float getDocumentWidthRatio()
throws DocumentException
DocumentException - An error has occurred during Document Library execution.public void setDocumentWidthRatio(float documentWidthRatio)
throws DocumentException
documentWidthRatio - Ratio of the estimated width of the searched document in the image.DocumentException - An error has occurred during Document Library execution.public DocumentModel getModel() throws DocumentException
DocumentException - An error has occurred during Document Library execution.public void setModel(DocumentModel model) throws DocumentException
model - Model to be used for document detection.DocumentException - An error has occurred during Document Library execution.public ProcessingUnit getProcessingUnit() throws DocumentException
DocumentException - An error has occurred during Document Library execution.public void setProcessingUnit(ProcessingUnit processingUnit) throws DocumentException
processingUnit - Processing unit where to run the detection process.DocumentException - An error has occurred during Document Library execution.public int getThreadCount()
throws DocumentException
DocumentException - An error has occurred during Document Library execution.public void setThreadCount(int threadCount)
throws DocumentException
threadCount - Number of threads to use for detection.DocumentException - An error has occurred during Document Library execution.public DocumentImage alignDocument(DocumentImage sourceImage, DetectedDocument detectedDocument) throws DocumentException
sourceImage - The source image containing the document.detectedDocument - The detected document in the image.DocumentException - An error has occurred during Document Library execution.public DetectedDocument detectDocument(DocumentImage image, Rectangle detectionZone) throws DocumentException
image - Source image to processdetectionZone - Crop in the image where to look for document. Default is the full image. Output corners are in the full image referential.DocumentException - An error has occurred during Document Library execution.public DetectedDocument detectDocumentByName(DocumentImage image, java.lang.String documentName, Rectangle detectionZone) throws DocumentException
image - The source image to process.documentName - The name of the document to be searched for. Must be a key loaded in DocumentLibrary.detectionZone - A delimited area in the image where to search for the document. Default is the full image. Output corners are in the full image referential.DocumentException - An error has occurred during Document Library execution.Copyright © 2020-2030, id3 Technologies. All rights reserved. eu.id3.document