chess

package module
v0.0.0-...-728d003 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package chess implements computer vision algorithms useful in chess.

Index

Constants

View Source
const (
	SquareEmpty = 0
	SquareWhite = 1
	SquareBlack = 2
)

The set of square colors.

View Source
const EdgeThreshold = 100

EdgeThreshold TODO.

Variables

View Source
var (
	DepthCheckSizeRadius = 20
	MinPieceDepth        = 9.9999
)

TODO.

Functions

func FindChessCornersPinkCheat

func FindChessCornersPinkCheat(img *rimage.Image, logger golog.Logger) (image.Image, []image.Point, error)

FindChessCornersPinkCheat TODO.

func FindChessCornersPinkCheatInQuadrant

func FindChessCornersPinkCheatInQuadrant(
	img *rimage.Image,
	dc *gg.Context,
	cnts [][]image.Point,
	xQ, yQ int,
	logger golog.Logger,
) image.Point

FindChessCornersPinkCheatInQuadrant TODO.

Types

type Board

type Board struct {
	// contains filtered or unexported fields
}

Board TODO.

func FindAndWarpBoard

func FindAndWarpBoard(col *rimage.Image, dm *rimage.DepthMap, logger golog.Logger) (*Board, error)

FindAndWarpBoard TODO.

func FindAndWarpBoardFromFiles

func FindAndWarpBoardFromFiles(colorFN, depthFN string, aligned bool, logger golog.Logger) (*Board, error)

FindAndWarpBoardFromFiles TODO.

func FindAndWarpBoardFromFilesRoot

func FindAndWarpBoardFromFilesRoot(root string, aligned bool, logger golog.Logger) (*Board, error)

FindAndWarpBoardFromFilesRoot TODO.

func (*Board) Annotate

func (b *Board) Annotate() image.Image

Annotate TODO.

func (*Board) IsBoardBlocked

func (b *Board) IsBoardBlocked() bool

IsBoardBlocked TODO.

func (*Board) SquareCenterEdges

func (b *Board) SquareCenterEdges(square string) int

SquareCenterEdges TODO.

func (*Board) SquareCenterHeight

func (b *Board) SquareCenterHeight(square string, radius int) float64

SquareCenterHeight TODO.

func (*Board) SquareCenterHeight2

func (b *Board) SquareCenterHeight2(square string, radius int, matchColor bool) float64

SquareCenterHeight2 TODO return highes SquareCenterHeight2 TODOt delta, average floor height.

func (*Board) WriteDebugImages

func (b *Board) WriteDebugImages(prefix string) error

WriteDebugImages TODO.

type Game

type Game struct {
	// contains filtered or unexported fields
}

Game TODO.

func NewGame

func NewGame(initialBoard *Board) (*Game, error)

NewGame TODO.

func (*Game) GetPieceHeight

func (g *Game) GetPieceHeight(board *Board, square string) (float64, error)

GetPieceHeight TODO.

func (*Game) GetSquaresWithPieces

func (g *Game) GetSquaresWithPieces(b *Board) ([]string, error)

GetSquaresWithPieces TODO.

func (*Game) SquareColorStatus

func (g *Game) SquareColorStatus(board *Board, square string) (string, error)

SquareColorStatus TODO.

type SquareFunc

type SquareFunc func(b *Board, square string) error

SquareFunc TODO.

Jump to

Keyboard shortcuts

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