Rotation information for OCR-detected text.
Represents the rotation angle of text as detected by OCR, including the confidence of the angle detection.
Fields
:angle_degrees- Rotation angle in degrees (-180 to 180), or nil:confidence- Confidence score for rotation detection (0.0-1.0), or nil
Examples
iex> rotation = %Kreuzberg.OcrRotation{
...> angle_degrees: 15.5,
...> confidence: 0.88
...> }
iex> rotation.angle_degrees
15.5
Summary
Types
Functions
Creates an OcrRotation struct from a map.
Parameters
data- A map containing rotation fields
Returns
An OcrRotation struct with properly typed fields.
Examples
iex> rotation_map = %{"angle_degrees" => 15.5, "confidence" => 0.88}
iex> rotation = Kreuzberg.OcrRotation.from_map(rotation_map)
iex> rotation.angle_degrees
15.5
Converts an OcrRotation struct to a map.
Parameters
rotation- AnOcrRotationstruct
Returns
A map with string keys representing all fields.
Examples
iex> rotation = %Kreuzberg.OcrRotation{
...> angle_degrees: 15.5,
...> confidence: 0.88
...> }
iex> Kreuzberg.OcrRotation.to_map(rotation)
%{"angle_degrees" => 15.5, "confidence" => 0.88}