public class OmrEngine extends Object
The main entry point for the users of the library. It collects all data necessary for data extractions.
OmrImage image = OmrImage.load(imageFile); // image path OmrTemplate template = OmrTemplate.load("template.amr"); // template path OmrEngine engine = new OmrEngine(template); OmrProcessingResult result = engine.extractData(new OmrImage[]{image});
Constructor and Description |
---|
OmrEngine(OmrTemplate template)
Initializes a new instance of the
OmrEngine class. |
OmrEngine(OmrTemplate template,
ProcessingPipeline pipeline)
Initializes a new instance of the
OmrEngine class. |
Modifier and Type | Method and Description |
---|---|
void |
changeProcessingPipeline(ProcessingPipeline newPipeline)
Replaces the image processing pipeline with a new one.
|
OmrProcessingResult |
extractData(OmrImage[] documentImages)
Extracts data from a scanned OMR sheets.
|
OmrConfig |
getConfiguration()
Gets global configuration for OMR extraction algorithm.
|
ProcessingPipeline |
getProcessingPipeline()
Gets an instance of
ProcessingPipeline that contains image processing algorithms
used for preprocessing of a scanned image before data extraction. |
boolean |
getSkewCorrectionEnabled()
Gets a value indicating whether Skew Correction algorithm is enabled
|
double |
getSkewDegree(OmrImage image)
Calculates skew degree of an image without making any changes to it
|
OmrTemplate |
getTemplate()
Gets a data template that describes data structure of an OMR sheet.
|
OmrImage |
rotateImage(OmrImage image,
double degree)
Rotates an image for a specified degree
|
void |
runSkewCorrection(OmrImage[] image)
Processes an
OmrImage with skew correction algorithm. |
void |
setConfiguration(OmrConfig value)
Sets global configuration for OMR extraction algorithm.
|
void |
setSkewCorrectionEnabled(boolean value)
Sets a value indicating whether Skew Correction algorithm is enabled
|
void |
setTemplate(OmrTemplate value)
Sets a data template that describes data structure of an OMR sheet.
|
public OmrEngine(OmrTemplate template)
Initializes a new instance of the OmrEngine
class.
template
- An instance of OmrTemplate
to be used for data extraction.public OmrEngine(OmrTemplate template, ProcessingPipeline pipeline)
Initializes a new instance of the OmrEngine
class.
template
- An instance of OmrTemplate
to be used for data extraction.pipeline
- An instance of ProcessingPipeline
that contains image processing algorithms
used for preprocessing of a scanned image before data extraction.public void changeProcessingPipeline(ProcessingPipeline newPipeline)
Replaces the image processing pipeline with a new one.
newPipeline
- The new pipeline.public OmrProcessingResult extractData(OmrImage[] documentImages)
Extracts data from a scanned OMR sheets.
documentImages
- Collection of scanned pages, according to the template.OmrProcessingResult
that contains data extracted from the sheet.
OmrImage image = OmrImage.load(imageFile); // image path OmrTemplate template = OmrTemplate.load("template.amr"); // template path OmrEngine engine = new OmrEngine(template); OmrProcessingResult result = engine.extractData(new OmrImage[]{image});
public OmrConfig getConfiguration()
Gets global configuration for OMR extraction algorithm.
public ProcessingPipeline getProcessingPipeline()
Gets an instance of ProcessingPipeline
that contains image processing algorithms
used for preprocessing of a scanned image before data extraction.
public boolean getSkewCorrectionEnabled()
Gets a value indicating whether Skew Correction algorithm is enabled
public double getSkewDegree(OmrImage image)
Calculates skew degree of an image without making any changes to it
image
- Image to processpublic OmrTemplate getTemplate()
Gets a data template that describes data structure of an OMR sheet.
public OmrImage rotateImage(OmrImage image, double degree)
Rotates an image for a specified degree
image
- Image to processdegree
- Rotation degreepublic void runSkewCorrection(OmrImage[] image)
Processes an OmrImage
with skew correction algorithm.
image
- Image to processpublic void setConfiguration(OmrConfig value)
Sets global configuration for OMR extraction algorithm.
public void setSkewCorrectionEnabled(boolean value)
Sets a value indicating whether Skew Correction algorithm is enabled
public void setTemplate(OmrTemplate value)
Sets a data template that describes data structure of an OMR sheet.
Copyright © 2017. All Rights Reserved.