preprocess

package
v0.0.0-...-2c0f3e6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resizer

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

Resizer defines the struct used for handling image resizing

func NewResizer

func NewResizer(srcWidth, srcHeight, destWidth, destHeight int) *Resizer

NewResizer returns a resizer used for scaling an image to the needed dimensions for input tensor size

func (*Resizer) Close

func (r *Resizer) Close() error

Close frees memory allocated during resize process

func (*Resizer) LetterBoxResize

func (r *Resizer) LetterBoxResize(src gocv.Mat, dest *gocv.Mat, color color.RGBA)

LetterBoxResize resizes the input image to the dimensions needed for the input tensor size whilst maintaining image aspect. Color is that used for letter box padding. this code is the conversion of C code function convert_image_with_letterbox()

func (*Resizer) ScaleFactor

func (r *Resizer) ScaleFactor() float32

ScaleFactor returns the scale factor used in letterbox resize

func (*Resizer) SrcHeight

func (r *Resizer) SrcHeight() int

SrcHeight returns the height of the source image

func (*Resizer) SrcWidth

func (r *Resizer) SrcWidth() int

SrcWidth returns the width of the source image

func (*Resizer) XPad

func (r *Resizer) XPad() int

XPad returns the x padding used in letterbox resize

func (*Resizer) YPad

func (r *Resizer) YPad() int

YPad returns the y padding used in letterbox resize

Jump to

Keyboard shortcuts

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