ComputerVision
in package
Class used to encapsulate various methods related to computer vision that might be useful for indexing documents. These include recognizing text in images
Table of Contents
- ocrEnabled() : bool
- Returns whether or not this Yioop system can recognize text in images Currently, this is down using the tesseract external program, so this method checks if a path to that program has been defined.
- recognizeText() : string
- Given a file path to a image file and set of target languages, returns the text in those languages that the image contained
Methods
ocrEnabled()
Returns whether or not this Yioop system can recognize text in images Currently, this is down using the tesseract external program, so this method checks if a path to that program has been defined.
public
static ocrEnabled() : bool
Return values
bool —whether a path to tesseract has been defined.
recognizeText()
Given a file path to a image file and set of target languages, returns the text in those languages that the image contained
public
static recognizeText(string $image_path[, array<string|int, mixed> $langs = [CDEFAULT_LOCALE] ]) : string
Parameters
- $image_path : string
-
a filepath to an image
- $langs : array<string|int, mixed> = [CDEFAULT_LOCALE]
-
locale_tags of languages we want to extract text for
Return values
string —text extracted from image