image

package
v0.0.0-...-4ed11cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter is a struct that provides methods for converting image payloads into enhanced images.

func NewConverter

func NewConverter(rotationDegrees float64) *Converter

NewConverter creates a new instance of the Converter struct, which can be used to convert image payloads into enhanced images. rotationDegrees: The counter-clockwise rotation, in degrees, applied to every incoming image (0 to disable).

func (*Converter) Encode

func (c *Converter) Encode(image image.Image) ([]byte, error)

Encode encodes an image.Image losslessly as PNG, so no second generation of JPEG compression artifacts is added on top of the camera's own. image: The image.Image object to be encoded.

func (*Converter) FromPayload

func (c *Converter) FromPayload(payload []byte) (image.Image, error)

FromPayload decodes an image payload and prepares it for the AI provider: it levels the image by the configured rotation, smooths out JPEG block artifacts, and stretches the image's own brightness range, which lifts dim frames without the posterization of a fixed gamma/contrast boost. If the digit strip can be located, an enlarged crop of it is stacked below the full image: the models read best with both the full meter for context and the enlarged digits for detail, while a crop alone loses that context whenever its detection is imperfect. payload: The byte slice containing the image data to be converted.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址