imagesearch

package
v0.0.0-...-cffb48d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashOfFile

func HashOfFile(file io.Reader) (string, error)

Types

type Bin

type Bin struct {
	CountAsDecimal float64
}

type Bins

type Bins []Bin

func NewBins

func NewBins(counts []uint) Bins

type HSVColor

type HSVColor struct {
	H float64 // 0 <= H <= 360
	S float64 // 0 <= S <= 1
	V float64 // 0 <= V <= 1
}

func NewHSVFromRGB

func NewHSVFromRGB(rgb color.RGBA) *HSVColor

type ImageDescriptor

type ImageDescriptor struct {
	Sha1  string
	HBins Bins
	SBins Bins
	VBins Bins
	QtyBins
}

func NewImageDescriptor

func NewImageDescriptor(sha1 string, picture image.Image, qtyBins QtyBins) *ImageDescriptor

func NewImageDescriptorFromFile

func NewImageDescriptorFromFile(reader io.Reader, qtyBins QtyBins) (*ImageDescriptor, error)

const (

hBinsQty = 8 // 0 - 44, 45 - 89, ... 315 - 360
sBinsQty = 12
vBinsQty = 3

)

type ImageScorer

type ImageScorer interface {
	Score(seedImage, imageBeingScored *ImageDescriptor) MatchScore
}

type LocalLocation

type LocalLocation struct {
	LocationOnDisk string
}

func NewLocalLocation

func NewLocalLocation(lastKnownLocation string) *LocalLocation

func (*LocalLocation) LastKnownLocation

func (d *LocalLocation) LastKnownLocation() string

func (*LocalLocation) Protocol

func (d *LocalLocation) Protocol() string

type Location

type Location interface {
	LastKnownLocation() string
	Protocol() string
}

Location is a representation of the last known location of the image (on disk, via http, etc) It doesn't really sit so well in the core image search code, but the results are not very useful without a location the top-ranked images can be found at

type MatchScore

type MatchScore float64

type PersistedDescriptorWithMatchScore

type PersistedDescriptorWithMatchScore struct {
	MatchScore MatchScore
	Descriptor *PersistedImageDescriptor
}

func NewPersistedDescriptorWithMatchScore

func NewPersistedDescriptorWithMatchScore(matchScore MatchScore, descriptor *PersistedImageDescriptor) *PersistedDescriptorWithMatchScore

type PersistedImageDescriptor

type PersistedImageDescriptor struct {
	*ImageDescriptor
	Location
}

func FileDescriptorFromFile

func FileDescriptorFromFile(file io.Reader, qtyBins QtyBins, location Location) (*PersistedImageDescriptor, error)

func NewPersistedImageDescriptor

func NewPersistedImageDescriptor(descriptor *ImageDescriptor, location Location) *PersistedImageDescriptor

type QtyBins

type QtyBins struct {
	HBins uint
	SBins uint
	VBins uint
}

func NewQtyBins

func NewQtyBins(hBins, sBins, vBins uint) QtyBins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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