Documentation
¶
Index ¶
- func AnyPointAnnotation(annots []Annotation) bool
- func AnyPolygonAnnotation(annots []Annotation) bool
- func AnyRectAnnotation(annots []Annotation) bool
- func Max(a, b int) int
- func Min(a, b int) int
- type Annotation
- type AnnotationCollection
- type Point
- type PointAnnotation
- type PolygonAnnotation
- type RectAnnotation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyPointAnnotation ¶
func AnyPointAnnotation(annots []Annotation) bool
func AnyPolygonAnnotation ¶ added in v1.1.0
func AnyPolygonAnnotation(annots []Annotation) bool
func AnyRectAnnotation ¶
func AnyRectAnnotation(annots []Annotation) bool
Types ¶
type Annotation ¶
type Annotation struct {
Id int `bson:"id" json:"id"`
Type string `bson:"type" json:"type"`
Label string `bson:"label" json:"label"`
CreatedBy string `bson:"createdBy,omitempty" json:"createdBy,omitempty"`
Color string `bson:"color,omitempty" json:"color,omitempty"`
Hotkey string `bson:"hotkey,omitempty" json:"hotkey,omitempty"`
// Exclusive fields
Rect *RectAnnotation `bson:"rect,omitempty" json:"rect,omitempty"`
Point *PointAnnotation `bson:"point,omitempty" json:"point,omitempty"`
Polygon *PolygonAnnotation `bson:"polygon,omitempty" json:"polygon,omitempty"`
}
func PointToAnnotation ¶
func PointToAnnotation(points []pts.Point) []Annotation
type AnnotationCollection ¶
type AnnotationCollection []Annotation
func (AnnotationCollection) PointAnnotations ¶
func (ac AnnotationCollection) PointAnnotations() []PointAnnotation
func (AnnotationCollection) PolygonAnnotations ¶ added in v1.2.1
func (ac AnnotationCollection) PolygonAnnotations() []PolygonAnnotation
func (AnnotationCollection) RectAnnotations ¶
func (ac AnnotationCollection) RectAnnotations() []RectAnnotation
type PointAnnotation ¶
type PolygonAnnotation ¶ added in v1.1.1
type RectAnnotation ¶
type RectAnnotation struct {
Label string `bson:"label" json:"label"`
X int `bson:"x" json:"x"`
Y int `bson:"y" json:"y"`
Width int `bson:"width" json:"width"`
Height int `bson:"height" json:"height"`
}
func FindPointAnnotationRect ¶
func FindPointAnnotationRect(label string, annots AnnotationCollection, padding int, image image.Image) RectAnnotation
func (RectAnnotation) Canon ¶
func (ra RectAnnotation) Canon() RectAnnotation
func (RectAnnotation) FixBounds ¶
func (ra RectAnnotation) FixBounds(size image.Point) RectAnnotation
FixBounds returns a new fixed rectangle annotation
func (RectAnnotation) Rectangle ¶
func (ra RectAnnotation) Rectangle() image.Rectangle
Click to show internal directories.
Click to hide internal directories.