com.aspose.ocr

Class CorrectionFilters



  • 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 Detail

      • CorrectionFilters

        public CorrectionFilters()
    • Method Detail

      • add

        public void add(Filter value)

        Add new Filter object.

        Parameters:
        value - Filter item.
      • clear

        public void clear()

        Clear current Filters collection.

      • contains

        public boolean contains(Filter item)

        Checks if item is in collection.

        Parameters:
        item - Filter item.
        Returns:
        True is collection contains element.
      • copyTo

        public void copyTo(Filter[] array,
                  int arrayIndex)

        Copies collection to one-dimensional array.

        Parameters:
        array - Destination array.
        arrayIndex - Index to copy array from.
      • getCount

        public int getCount()

        Returns count of the filters.

      • getFilters

        public Filter[] getFilters()

        Gets all filters

      • getItem

        public Filter getItem(int index)

        Gets Filter object by index.

        Parameters:
        index - Index of object.
        Returns:
        Filter object
      • indexOf

        public int indexOf(Filter item)

        Find the index of an Filter item.

        Parameters:
        item - Filter item.
        Returns:
        The index of value if found in the list; otherwise, -1.
      • insert

        public void insert(int index,
                  Filter item)

        Insert an Filter item to the collection at the specified index.

        Parameters:
        index - Index to insert new Filter.
        item - Filter item.
      • isReadOnly

        public boolean isReadOnly()

        Returns true if collection is read-only.

      • remove

        public boolean remove(Filter item)

        Removes element from collection.

        Parameters:
        item - Filter item to remove
        Returns:
        True if object was removed.
      • removeAt

        public void removeAt(int index)

        Remove filter at specified index.

        Parameters:
        index - Index to remove filterOld from.
      • setItem

        public void setItem(int index,
                   Filter value)

        Sets Filter object by index.

        Parameters:
        index - Index of object.