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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址