cognixir v0.4.0 Cognixir.ComputerVision

Provides functions for image analytics. Including OCR, image descriptions, tagging and face detection

Summary

Functions

Analyze an image specified by an image url. You can set AnalyzeOptions to configure the meta data extraction. Consulate the official api doc for allowed options

Describes an image in english sentences. You can set the maximum number of descriptions

Runs OCR on a specified image. You can set OCROptions to auto-detect the image orientation

Get tags for an specified image

Functions

analyze_image(image, options \\ %Cognixir.ComputerVision.AnalyzeOptions{})

Analyze an image specified by an image url. You can set AnalyzeOptions to configure the meta data extraction. Consulate the official api doc for allowed options.

Parameters

  • image: A string containing valid image url or binary file content of an image
  • options: AnalyzeOptions with additional parameters (optional)

Examples

iex> ComputerVision.analyze_image(“http://example.com/images/test.jpg”, %ComputerVision.AnalyzeOptions{language: “en”, visualFeatures: “Faces,Color”, details: “Celebrities”})

{ :ok, response_map }

describe_image(image, max_candidates \\ 1)

Describes an image in english sentences. You can set the maximum number of descriptions.

Parameters

  • image: A string containing valid image url or binary file content of an image
  • max_candidates: An integer larger then 0

Examples

iex> ComputerVision.analyze_image(“http://example.com/images/test.jpg”, 3)

{ :ok, response_map }

recognize_character(image, options \\ %Cognixir.ComputerVision.OCROptions{})

Runs OCR on a specified image. You can set OCROptions to auto-detect the image orientation

Parameters

  • image: A string containing valid image url or binary file content of an image
  • options: AnalyzeOptions with additional parameters (optional)

Examples

iex> ComputerVision.recognize_character(“http://example.com/images/test.jpg”, %ComputerVision.OCROptions{detectOrientation: true})

{ :ok, response_map }

tag_image(image)

Get tags for an specified image.

Parameters

  • image: A string containing valid image url or binary file content of an image

Examples

iex> ComputerVision.tag_image(“http://example.com/images/test.jpg”)

{ :ok, response_map }