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
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 ¶
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
Click to show internal directories.
Click to hide internal directories.