public class CorrectionFilters extends Object
Represents filters for denoising of image before recognition.
OcrEngine ocr = new OcrEngine(); CorrectionFilters filters = new CorrectionFilters(); filters.add(new MedianFilter()); filters.add(new GaussBlurFilter(5, 1.4f)); ocr.getConfig().setCorrectionFilters(filters);
OcrEngine ocr = new OcrEngine(); ocr.getConfig().getCorrectionFilters().add(new GaussBlurFilter());
Constructor and Description |
---|
CorrectionFilters() |
Modifier and Type | Method and Description |
---|---|
void |
add(Filter value)
Add new
Filter object. |
void |
clear()
Clear current Filters collection.
|
boolean |
contains(Filter item)
Checks if item is in collection.
|
void |
copyTo(Filter[] array,
int arrayIndex)
Copies collection to one-dimensional array.
|
int |
getCount()
Returns count of the filters.
|
Filter[] |
getFilters()
Gets all filters
|
Filter |
getItem(int index)
Gets
Filter object by index. |
int |
indexOf(Filter item)
Find the index of an Filter item.
|
void |
insert(int index,
Filter item)
Insert an Filter item to the collection at the specified index.
|
boolean |
isReadOnly()
Returns true if collection is read-only.
|
boolean |
remove(Filter item)
Removes element from collection.
|
void |
removeAt(int index)
Remove filter at specified index.
|
void |
setItem(int index,
Filter value)
Sets
Filter object by index. |
public void clear()
Clear current Filters collection.
public boolean contains(Filter item)
Checks if item is in collection.
item
- Filter item.public void copyTo(Filter[] array, int arrayIndex)
Copies collection to one-dimensional array.
array
- Destination array.arrayIndex
- Index to copy array from.public int getCount()
Returns count of the filters.
public Filter[] getFilters()
Gets all filters
public Filter getItem(int index)
Gets Filter
object by index.
index
- Index of object.Filter
objectpublic int indexOf(Filter item)
Find the index of an Filter item.
item
- Filter item.public void insert(int index, Filter item)
Insert an Filter item to the collection at the specified index.
index
- Index to insert new Filter.item
- Filter item.public boolean isReadOnly()
Returns true if collection is read-only.
public boolean remove(Filter item)
Removes element from collection.
item
- Filter item to removepublic void removeAt(int index)
Remove filter at specified index.
index
- Index to remove filterOld from.Copyright © 2017. All Rights Reserved.