sift

package module
v0.0.0-...-fe52bd7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2017 License: MIT Imports: 6 Imported by: 2

README

opensift_gowrapper

a cgo wrapper for opensift

to run main/main.go

export LD_LIBRARY_PATH=$PROJECT_PATH/lib/ubuntu

Documentation

Index

Constants

View Source
const (
	DEFAULT_KDTREE_BBF_MAX_NN_CHKS = 200
	DEFAULT_NN_SQ_DIST_RATIO_THR   = 0.49
)

Variables

View Source
var DEFAULT_ON_EVICTED func(interface{}, interface{}) = func(key, value interface{}) {
	fmt.Printf("on evicted %+v\n", key)
	featData := value.(*featureData)
	free_featureData(featData)
}
View Source
var DEFAULT_THRESHOLDFUNC thresholdFunc = func(f1 int, f2 int, m int) bool {
	return float32(m)/float32(f2) >= float32(0.2) || float32(m)/float32(f1) >= float32(0.2) || m > 80
}

pai nao dai

Functions

func Match

func Match(ie1, ie2 *ImageEntity) bool

func MatchImpl

func MatchImpl(path1, path2 string) (int, int, int)

the test impl

Types

type ClassicLru

type ClassicLru struct {
	MaxLen int

	OnEvicted func(key interface{}, value interface{}) //evicted callback used for free memory
	// contains filtered or unexported fields
}

func (*ClassicLru) Add

func (cl *ClassicLru) Add(key, value interface{})

func (*ClassicLru) Get

func (cl *ClassicLru) Get(key interface{}) (value interface{}, ok bool)

func (*ClassicLru) RemoveOldest

func (cl *ClassicLru) RemoveOldest()

func (*ClassicLru) SetOnEvicted

func (cl *ClassicLru) SetOnEvicted(f func(interface{}, interface{}))

type Client

type Client interface {
	Load(*ImageEntity) error
	Match(*ImageEntity, *ImageEntity) bool
}

* -------interface----------

var DEFAULT_SIFT_CLIENT Client = NewSiftClient(&DEFAULT_SIFT_OPTION)

func NewSiftClient

func NewSiftClient(option *SiftClientOption) Client

type ImageEntity

type ImageEntity struct {
	FilePath string
	UniqueID interface{} //used for cache
}

*

type Lru

type Lru interface {
	Add(interface{}, interface{})
	Get(interface{}) (interface{}, bool)
	RemoveOldest()
	SetOnEvicted(func(interface{}, interface{}))
}

not thread safe

func NewClassicLru

func NewClassicLru(MaxLen int) Lru

type SiftClientOption

type SiftClientOption struct {
	Kdtree_bbf_max_nn_chks int     //not used
	Nn_sq_dist_ratio_thr   float32 //not used
	Tf                     thresholdFunc
	CacheSize              int //TODO
}
var DEFAULT_SIFT_OPTION SiftClientOption = SiftClientOption{
	Kdtree_bbf_max_nn_chks: DEFAULT_KDTREE_BBF_MAX_NN_CHKS,
	Nn_sq_dist_ratio_thr:   DEFAULT_NN_SQ_DIST_RATIO_THR,
	Tf:                     DEFAULT_THRESHOLDFUNC,
	CacheSize:              1024,
}

SiftClientOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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