imgsplit

package module
v0.0.0-...-a87993b Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: MIT Imports: 6 Imported by: 0

README

Image Split

Split images

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumeIterator

func ConsumeIterator(it ImageIterator) []image.Image

ConsumeIterator drains the iterator of images and returns them in a slice Note that consuming an entire iterator may cause heavy memory usage and usually is a bad idea

Types

type Config

type Config struct {
	// X and Y count how many images the parent image will be split to
	X, Y int
}

Config defines how to split a image

type ImageIterator

type ImageIterator interface {
	Next() bool
	Get() image.Image
}

ImageIterator is an iterators on a set of images

func QuadTreeIterator

func QuadTreeIterator(m image.Image, maxDepth int, maxDissimilarity float64) (ImageIterator, error)

QuadTreeIterator iterates over an image using a quadtree mesh m -> image to iterate over maxDepth -> max depth of quadtree maxDissimilarity -> max amount of dissimilarity allowed, anything above will trigger another tree level

func SplitImageWithIterator

func SplitImageWithIterator(img image.Image, cfg Config) (ImageIterator, error)

SplitImageWithIterator will split a given Image based on the given Config and return an iterator of the sub images This is more memory efficient then returning all images at once

Jump to

Keyboard shortcuts

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