pointu

package
v0.0.0-...-5786e97 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToGray

func ImageToGray(img image.Image) *image.Gray

ImageToGray converts an image.Image into an image.Gray.

func LoadImage

func LoadImage(path string) (image.Image, error)

LoadImage reads and loads an image from a file path.

func RescaleFloat64s

func RescaleFloat64s(floats []float64, newMin, newMax float64) []float64

Types

type PDF

type PDF [][]float64

A PDF is a probability density function.

func MakePDF

func MakePDF(gray *image.Gray) PDF

makePDF generates a probability density function from an image.Gray.

type Point

type Point struct {
	X float64
	Y float64
}

A Point represents an (X, Y) pair.

func (Point) String

func (p Point) String() string

type Points

type Points []Point

func GetCentroids

func GetCentroids(sites Points, pdf PDF, bounds image.Rectangle, step float64) (Points, []float64)

func ImportanceSample

func ImportanceSample(n int, gray *image.Gray, threshold uint8, rng *rand.Rand) Points

Jump to

Keyboard shortcuts

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