Documentation ¶
Overview ¶
package dog provides the Difference-of-Gaussians (DoG) filter for visual and other forms of signal processing
Index ¶
- func GaussDenSig(x, sig float32) float32
- type Filter
- func (gf *Filter) Defaults()
- func (gf *Filter) FilterTensor(tsr *tensor.Float32, filt Filters) *tensor.Float32
- func (gf *Filter) SetSize(sz, spc int)
- func (gf *Filter) ShouldDisplay(field string) bool
- func (gf *Filter) ToTable(tab *table.Table)
- func (gf *Filter) ToTensor(tsr *tensor.Float32)
- func (gf *Filter) Update()
- type Filters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GaussDenSig ¶
GaussDenSig returns gaussian density for given value and sigma
Types ¶
type Filter ¶
type Filter struct { // is this filter active? On bool // how much relative weight does this filter have when combined with other filters Wt float32 // overall gain multiplier applied after dog filtering -- only relevant if not using renormalization (otherwize it just gets renormed away) Gain float32 `default:"8"` // gain for the on component of filter, only relevant for color-opponent DoG's OnGain float32 `default:"1"` // size of the overall filter -- number of pixels wide and tall for a square matrix used to encode the filter -- filter is centered within this square -- typically an even number, min effective size ~6 Size int // how far apart to space the centers of the dog filters -- 1 = every pixel, 2 = every other pixel, etc -- high-res should be 1 or 2, lower res can be increments therefrom Spacing int // gaussian sigma for the narrower On gaussian, in normalized units relative to Size OnSig float32 `default:"0.125"` // gaussian sigma for the wider Off gaussian, in normalized units relative to Size OffSig float32 `default:"0.25"` // cut off the filter (to zero) outside a circle of diameter = Size -- makes the filter more radially symmetric CircleEdge bool `default:"true"` }
dog.Filter specifies a DoG Difference of Gaussians filter function.
func (*Filter) FilterTensor ¶
FilterTensor extracts the given filter subspace from set of 3 filters in input tensor 0 = On, 1 = Off, 2 = Net
func (*Filter) SetSize ¶
SetSize sets the size and spacing -- these are the main params that need to be varied for standard V1 dogs.
func (*Filter) ShouldDisplay ¶
func (*Filter) ToTable ¶
ToTable renders filters into the given table.Table setting a column named Version and a column named Filter to the filter for that version (on, off, net) This is useful for display and validation purposes.