traceskeleton

package
v0.0.0-...-f5dd65e Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HORIZONTAL = 1
	VERTICAL   = 2
)

Variables

This section is empty.

Functions

func PolylinesToSvg

func PolylinesToSvg(q *polyline_t, w int, h int) string

func PrintPolyline

func PrintPolyline(q *polyline_t)

func PrintPolylines

func PrintPolylines(q *polyline_t)

func ThinningZS

func ThinningZS(im []uint8, w int, h int)

func TraceSkeleton

func TraceSkeleton(im []uint8, W int, H int, x int, y int, w int, h int, chunkSize int, maxIter int) *polyline_t

*Trace skeleton from thinning result.

  • Algorithm:
  • 1. if chunk size is small enough, reach recursive bottom and turn it into segments
  • 2. attempt to split the chunk into 2 smaller chunks, either horizontall or vertically;
  • find the best "seam" to carve along, and avoid possible degenerate cases
  • 3. recurse on each chunk, and merge their segments *
  • @param x left of chunk
  • @param y top of chunk
  • @param w width of chunk
  • @param h height of chunk
  • @param iter current iteration
  • @return an array of polylines

Types

This section is empty.

Jump to

Keyboard shortcuts

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