Class OcrInput
Namespace: Aspose.OCR
Assembly: Aspose.OCR.dll (25.8.0)
Container to collect all images / documents for preprocessing / recognition.
public class OcrInput : IEnumerable<imagedata>, IEnumerable, IDisposableInheritance
Implements
IEnumerable<imagedata> , IEnumerable , IDisposable
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
OcrInput(InputType, PreprocessingFilter)
Constructor to create container and set the type of images/documents and filters for further preprocessing / recognition.
public OcrInput(InputType type, PreprocessingFilter filters = null)Parameters
type InputType
Set the images/documents type will be added to container.
filters PreprocessingFilter
Set preprocessing filters will be applied for further processing or recognition.
Properties
this[int]
Returns information about processed / recognized image.
public ImageData this[int index] { get; set; }Property Value
Methods
Add(string)
Add the path or URI containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
public void Add(string fullPath)Parameters
fullPath string
Path to the image/ document / folder / archive.
Add(MemoryStream)
Add the memory stream containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
public void Add(MemoryStream stream)Parameters
stream MemoryStream
Memory stream containing the image or document.
Add(string, int, int)
Add the multipage images / documents for recognition / processing. The type of the image must correspond to the type specified in the constructor.
public void Add(string fullPath, int startPage, int pagesCount)Parameters
fullPath string
Path to the image/ document / folder / archive.
startPage int
The first page/image for processing / recognition. Use for documents, zip, folders.
pagesCount int
The total amount of pages/images for processing / recognition. Use for documents, zip, folders. Default = 1.
Add(MemoryStream, int, int)
Add the memory stream containing the multipage image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
public void Add(MemoryStream stream, int startPage, int pagesCount)Parameters
stream MemoryStream
Memory stream containing the multipage document.
startPage int
The first page/image for processing / recognition. Use for documents.
pagesCount int
The total amount of pages/images for processing / recognition. Use for documents. Default = 1.
Add(byte[], int, int, PixelType)
Add the decoded image to the list for recognition / processing. The type of the image must correspond to the type specified in the constructor (SingleImage).
public void Add(byte[] arr, int width, int height, PixelType pixelFormat)Parameters
arr byte
[]
Decoded image in Aspose.Drawing.Color array.
width int
Image width.
height int
Image height.
pixelFormat PixelType
Supports byte, rgb, bgr, rgba.
Add(Color[], int, int)
Add the decoded image to the list for recognition / processing. The type of the image must correspond to the type specified in the constructor (SingleImage).
public void Add(Color[] imageData, int width, int height)Parameters
imageData Color[]
Decoded image in Aspose.Drawing.Color array.
width int
Image width.
height int
Image height.
AddBase64(string)
Add the base64 string containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
public void AddBase64(string base64)Parameters
base64 string
Base64 string with single image.
Clear()
Set the amount of items for processing / recognition as 0. Clear the collection.
public void Clear()ClearFilters()
Remove all filters.
public void ClearFilters()Count()
Amount of items for processing / recognition.
public int Count()Returns
Amount of items.
Dispose()
Set the amount of items for processing / recognition as 0. Clear the collection.
public void Dispose()GetEnumerator()
Returns collection enumerator.
public IEnumerator<imagedata> GetEnumerator()Returns
IEnumerator < ImageData >
The collection of Aspose.OCR.ImageData.
GetInputType()
Type of allowed images for recognition.
public InputType GetInputType()Returns
InputType.
ReplaceFilters(PreprocessingFilter)
Remove old filters and set new.
public void ReplaceFilters(PreprocessingFilter filters)Parameters
filters PreprocessingFilter
Set preprocessing filters will be applied for further processing or recognition. </imagedata>