Documentation
¶
Overview ¶
Package vxform supports visual (image) transformations: translation, scaling, rotation.
Includes parameters for specifying random range to generate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScaleImage ¶
ScaleImage scales image by given number of degrees retaining the current image size, and filling border with current border if scaling to a smaller size.
func TransImage ¶
TransImage translates image in each axis by given proportion of image half-size i.e., 1 = move from center to edge
func XFormImage ¶
XFormImage transforms given image according to given parameters Transformations are performed as: rotation, scale, then translation. Scaling retain the current image size, filling border with current border if scaling to a smaller size.
Types ¶
type Rand ¶
type Rand struct {
// min -- max range of X-axis (horizontal) translations to generate (as proportion of image size)
TransX minmax.F32 `desc:"min -- max range of X-axis (horizontal) translations to generate (as proportion of image size)"`
// min -- max range of Y-axis (vertical) translations to generate (as proportion of image size)
TransY minmax.F32 `desc:"min -- max range of Y-axis (vertical) translations to generate (as proportion of image size)"`
// min -- max range of scales to generate
Scale minmax.F32 `desc:"min -- max range of scales to generate"`
// min -- max range of rotations to generate (in degrees)
Rot minmax.F32 `desc:"min -- max range of rotations to generate (in degrees)"`
}
Rand specifies random transforms
type XForm ¶
type XForm struct {
// current, prv X-axis (horizontal) translation value, as proportion of image half-size (i.e., 1 = move from center to edge)
TransX env.CurPrvF32 `` /* 128-byte string literal not displayed */
// current, prv Y-axis (horizontal) translation value, as proportion of image half-size (i.e., 1 = move from center to edge)
TransY env.CurPrvF32 `` /* 128-byte string literal not displayed */
// current, prv scale value
Scale env.CurPrvF32 `desc:"current, prv scale value"`
// current, prv rotation value, in degrees
Rot env.CurPrvF32 `desc:"current, prv rotation value, in degrees"`
}
XForm represents current and previous visual transformation values and can apply current values to transform an image. Transformations are performed as: rotation, scale, then translation. Scaling crops to retain the current image size.