Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HyperPoints10 = []image.Point{
{2, 5}, {3, 3}, {3, 8}, {4, 6}, {5, 2},
{6, 4}, {6, 7}, {8, 2}, {8, 5}, {8, 8}}
HyperPoints10 is a convenience 10-point predefined set with coordinates of icon values to become 10 dimensions needed for hash generation with package "hyper". The 10 points are the only pixels from an icon to be used for hash generation (unless you define your own set of hyper points with CustomPoints function, or manually. The 10 points have been modified manually a little to avoid texture-like symmetries.
Functions ¶
func CentralHash ¶
func CentralHash(icon images4.IconT, hyperPoints []image.Point, epsPercent float64, numBuckets int) uint64
CentralHash generates a central hash for a given icon by sampling luma values at well-distributed icon points (hyperPoints, HyperPoints10) and later using package "hyper". This hash can then be used for a record or a query. When used for a record, you will need a hash set made with func HashSet for a query. And vice versa. To better understand CentralHash, read the following doc: https://vitali-fedulov.github.io/algorithm-for-hashing-high-dimensional-float-vectors.html
func CustomPoints ¶
CustomPoints is a utility function to create hyper points similar to HyperPoints10. It is needed if you are planning to use the package with billions of images, and might need higher number of sample points (more dimensions). You may also decide to reduce number of dimensions in order to reduce number of hashes per image. In both cases CustomPoints will help generate point sets similar to HyperPoints10. The function chooses a set of points (pixels from Icon) placed apart as far as possible from each other to increase variable independence. Number of chosen points corresponds to the number of dimensions n. Brightness values at those points represent one coordinate each in n-dimensional space for hash generation with package "hyper". Final point patterns are somewhat irregular, which is good to avoid occasional mutual pixel dependence of textures in images. For cases of low n, to avoid texture-like symmetries and visible patterns, it is recommended to slightly modify point positions manually, and with that distribute points irregularly across the Icon.
func HashSet ¶
func HashSet(icon images4.IconT, hyperPoints []image.Point, epsPercent float64, numBuckets int) []uint64
HashSet generates a hash set for a given icon by sampling luma values of well-distributed icon points (hyperPoints, HyperPoints10) and later using package "hyper". This hash set can then be used for records or a query. When used for a query, you will need a hash made with func CentralHash as a record. And vice versa. To better understand HashSet, read the following doc: https://vitali-fedulov.github.io/algorithm-for-hashing-high-dimensional-float-vectors.html
Types ¶
This section is empty.