View Source TesseraxLive (TesseraxLive v0.1.3)

Creates a canvas component with functionality to read the image drawn in the canvas via Tesseract.

Summary

Functions

Sends an update telling the LiveComponent to read the currently drawn image in the canvas via Tesseract OCR.

Sends an update telling the LiveComponent to reset the canvas.

Sends an update to Tesserax LiveComponent by ID and with parameters for setting Tesserax command.

Functions

@spec read(id :: String.t()) :: :ok

Sends an update telling the LiveComponent to read the currently drawn image in the canvas via Tesseract OCR.

Examples

tesserax_canvas_id = "tesserax_canvas"
TesseraxLive.read(tesserax_canvas_id)
@spec read(id :: String.t(), path :: String.t()) :: :ok
@spec reset(id :: String.t()) :: :ok

Sends an update telling the LiveComponent to reset the canvas.

Examples

tesserax_canvas_id = "tesserax_canvas"
TesseraxLive.reset(tesserax_canvas_id)
@spec set_opts(id :: String.t(), opts :: keyword()) :: :ok

Sends an update to Tesserax LiveComponent by ID and with parameters for setting Tesserax command.

Examples

tesserax_canvas_id = "tesserax-canvas"
opts = [
  languages: "eng", 
  tessdata: "path/to/tessdata", 
  config: "path/to/config", 
  psm: 3, 
  oem: 3
]
TesseraxLive.set_opts(tesserax_canvas_id, opts)