gcputil

package
v0.0.0-...-7ea66cd Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectText

DetectText sends image to GCP Cloud Vision for processing and annotating

func RequestImageAnnotation

func RequestImageAnnotation(file string) (*visionpb.AnnotateImageResponse, error)

RequestImageAnnotation sends several options to GCP Cloud Vision for processing and annotating

Types

type Annotation

type Annotation struct {
	Description  string       `json:"description"`
	BoundingPoly BoundingPoly `json:"boundingPoly"`
}

Annotation stores Description and BoundingPoly of Description as 'text'

type BoundingPoly

type BoundingPoly struct {
	//using google's generated protobuf.. probably should do this for the other structs if this works
	Vertices []*visionpb.Vertex `json:"vertices"`
}

BoundingPoly stores array of 4 XY coordinates that make up a polygon

type ImageAnnotation

type ImageAnnotation struct {
	DirPath           string        `json:"dirPath"`
	FileName          string        `json:"filename"`
	FileExtension     string        `json:"fileExtension"`
	TextAnnotations   []*Annotation `json:"text"`
	ObjectAnnotations []*Annotation `json:"object"`
}

ImageAnnotation stores data returned from Cloud Vision along with image file metadata

func NewImageAnnotation

func NewImageAnnotation(filename string) *ImageAnnotation

NewImageAnnotation creates a new ImageAnnotation from filename and extension

type Vertex

type Vertex struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Vertex stores X, Y points

Jump to

Keyboard shortcuts

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