Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoSpots = errors.New("no spots found in image")
ErrNoSpots is returned when there are no spots in the image.
Functions ¶
This section is empty.
Types ¶
type BigSpot ¶
BigSpot is a monochromic spot with the largest area in the image.
func FindBiggestSpot ¶
FindBiggestSpot finds the spot with the largest area in the image.
The color parameter is the color of the spot. Colors are compared exactly, so the color of the spot must match exactly the color parameter.
type BoundaryImage ¶
type BoundaryImage struct {
// contains filtered or unexported fields
}
BoundaryImage is an image that marks some boundary by filling the boundary with a color and leaving the rest of the image in a different color.
func NewBoundaryImage ¶
func NewBoundaryImage(img image.Image, bc color.Color) *BoundaryImage
NewBoundaryImage creates a new BoundaryImage from the given image and boundary color.
func (*BoundaryImage) BoundaryBox ¶
func (bi *BoundaryImage) BoundaryBox() image.Rectangle
BoundaryBox returns the bounding box of the boundary. The bounding box is the smallest rectangle that contains the boundary.
func (*BoundaryImage) Count ¶
func (bi *BoundaryImage) Count() int
Count returns the number of points in the boundary.
type SpotFinder ¶
type SpotFinder struct {
// contains filtered or unexported fields
}
SpotFinder finds spots in an image.
func NewSpotFinder ¶
func NewSpotFinder(src image.Image) *SpotFinder
NewSpotFinder creates a new SpotFinder for the given image.
func (*SpotFinder) FindBiggestSpot ¶
func (b *SpotFinder) FindBiggestSpot(matchingColor color.Color) (BigSpot, error)
FindBiggestSpot finds the spot with the largest area.
The color parameter is the color of the spot. Colors are compared exactly, so the color of the spot must match exactly the color parameter.
func (*SpotFinder) Reset ¶
func (b *SpotFinder) Reset(src image.Image)
Reset resets the SpotFinder for the given image. This is useful if you want to reuse the SpotFinder for multiple images of the same size.