Documentation ¶
Index ¶
- type Box
- type Image
- func NewImage(scope *op.Scope, tensor tf.Output) *Image
- func Read(scope *op.Scope, imagePath string, channels int64) *Image
- func ReadGIF(scope *op.Scope, imagePath string) *Image
- func ReadJPEG(scope *op.Scope, imagePath string, channels int64) *Image
- func ReadPNG(scope *op.Scope, imagePath string, channels int64) *Image
- func (image *Image) Add(tfout tf.Output) *Image
- func (image *Image) AdjustBrightness(delta float32) *Image
- func (image *Image) AdjustContrast(contrastFactor float32) *Image
- func (image *Image) AdjustGamma(gamma, gain float32) *Image
- func (image *Image) AdjustHue(delta float32) *Image
- func (image *Image) AdjustSaturation(saturationFactor float32) *Image
- func (image *Image) Cast(dtype tf.DataType) *Image
- func (image *Image) Center() *Image
- func (image *Image) CentralCrop(centralFraction float32) *Image
- func (image *Image) Clone() *Image
- func (image *Image) ConvertDtype(dtype tf.DataType, saturate bool) *Image
- func (image *Image) Convolve(filter tf.Output, stride Stride, padding padding.Padding) *Image
- func (image *Image) Correlate(filter tf.Output, stride Stride, padding padding.Padding) *Image
- func (image *Image) CropAndResize(box Box, size Size, optional ...op.CropAndResizeAttr) *Image
- func (image *Image) Dilate(filter tf.Output, stride, rate Stride, padding padding.Padding) *Image
- func (image *Image) DrawBoundingBoxes(boxes []Box) *Image
- func (image *Image) EncodeJPEG(optional ...op.EncodeJpegAttr) tf.Output
- func (image *Image) EncodePNG(optional ...op.EncodePngAttr) tf.Output
- func (image *Image) Erode(filter tf.Output, stride, rate Stride, padding padding.Padding) *Image
- func (image *Image) ExtractGlimpse(size Size, offset Point, optional ...op.ExtractGlimpseAttr) tf.Output
- func (image *Image) HSVToRGB() *Image
- func (image *Image) Mul(tfout tf.Output) *Image
- func (image *Image) Normalize() *Image
- func (image *Image) Pow(y tf.Output) *Image
- func (image *Image) RGBToGrayscale() *Image
- func (image *Image) RGBToHSV() *Image
- func (image *Image) ResizeArea(size Size, optional ...op.ResizeAreaAttr) *Image
- func (image *Image) ResizeBicubic(size Size, optional ...op.ResizeBicubicAttr) *Image
- func (image *Image) ResizeBilinear(size Size, optional ...op.ResizeBilinearAttr) *Image
- func (image *Image) ResizeNearestNeighbor(size Size, optional ...op.ResizeNearestNeighborAttr) *Image
- func (image *Image) SaturateCast(dtype tf.DataType) *Image
- func (image *Image) Scale(min, max float32) *Image
- func (image *Image) Sqrt() *Image
- func (image *Image) Square() *Image
- func (image *Image) Value() tf.Output
- type Point
- type Rectangle
- type Size
- type Stride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
Start, End Point
}
Box represents the coordinates of 2 points in the space
type Image ¶
Image is the type that abstracts a Tensorflow tensor representing an image. The image is always a float32 value unless manually casted.
func NewImage ¶
NewImage creates an *Image from a 3 or 4D input tensor Place the created image within the specified scope
func Read ¶
Read searches for the `imagePath` extensions and uses the Read<format> function to decode and load the right image. Panics if the format is unknown.
func ReadJPEG ¶
ReadJPEG reads the JPEG image whose path is `imagePath` that has `channels` channels it returns an Image
func ReadPNG ¶
ReadPNG reads the PNG image whose path is `imagePath` that has `channels` channels it returns an Image
func (*Image) Add ¶
Add defines the add operation between the image and tfout `tfout` dtype is converted to image.Dtype() before adding
func (*Image) AdjustBrightness ¶
AdjustBrightness adds delta to the image
func (*Image) AdjustContrast ¶
AdjustContrast changes the contrast by contrastFactor
func (*Image) AdjustGamma ¶
AdjustGamma performs gamma correction on the image
func (*Image) AdjustSaturation ¶
AdjustSaturation changes the saturation by saturationFactor
func (*Image) Center ¶
Center computes the mean value of the pixel values and subtracts this value from every pixel: this operation centers the data
func (*Image) CentralCrop ¶
CentralCrop extracts from the center of the image a portion of image with an area equals to the centralFraction
func (*Image) Clone ¶
Clone returns a copy of the current image in a new scope Clone must be used when one want to create a different image from the output of an operation.
func (*Image) ConvertDtype ¶
ConvertDtype converts the Image dtype to dtype, uses SaturatesCast if required
func (*Image) Convolve ¶
Convolve executes the convolution operation between the current image and the passed filter The strides parameter rules the stride along each dimension Padding is a padding type to specify the type of padding
func (*Image) Correlate ¶
Correlate executes the correlation operation between the current image and the passed filter The strides parameter rules the stride along each dimension Padding is a padding type to specify the type of padding
func (*Image) CropAndResize ¶
CropAndResize crops the image to the specified box and resizes the result to size
func (*Image) Dilate ¶
Dilate executes the dilatation operation between the current image and the padded filter The strides parameter rules the stride along each dimension, in output. The rate parameter rules the input stride for atrous morphological dilatation Padding is a padding type to specify the type of padding
func (*Image) DrawBoundingBoxes ¶
DrawBoundingBoxes draws the specified boxes to the image
func (*Image) EncodeJPEG ¶
func (image *Image) EncodeJPEG(optional ...op.EncodeJpegAttr) tf.Output
EncodeJPEG encodes the image in the JPEG format and returns an evaluable tensor
func (*Image) EncodePNG ¶
func (image *Image) EncodePNG(optional ...op.EncodePngAttr) tf.Output
EncodePNG encodes the image in the PNG format and returns an evaluable tensor
func (*Image) Erode ¶
Erode executes the erosion operation between the current image and the padded filter The strides parameter rules the stride along each dimension The rate parameter rules the input stride for atrous morphological dilatation Padding is a padding type to specify the type of padding
func (*Image) ExtractGlimpse ¶
func (image *Image) ExtractGlimpse(size Size, offset Point, optional ...op.ExtractGlimpseAttr) tf.Output
ExtractGlimpse extracts a glimpse with the specified size at the specified offset
func (*Image) Mul ¶
Mul defines the multiplication operation between the tensor and `tfout`. `tfout` dtype is converted to tensor.Dtype() before multiplying
func (*Image) Normalize ¶
Normalize computes the mean and the stddev of the pixel values and normalizes every pixel subtracting the mean (centering) and dividing by the stddev (scale)
func (*Image) Pow ¶
Pow defines the pow operation x^y, where x are the image values y dtype is converted to image.Dtype() before executing Pow
func (*Image) RGBToGrayscale ¶
RGBToGrayscale converts the image from RGB to Grayscale
func (*Image) ResizeArea ¶
func (image *Image) ResizeArea(size Size, optional ...op.ResizeAreaAttr) *Image
ResizeArea resizes the image to the specified size using the Area interpolation
func (*Image) ResizeBicubic ¶
func (image *Image) ResizeBicubic(size Size, optional ...op.ResizeBicubicAttr) *Image
ResizeBicubic resizes the image to the specified size using the Bicubic interpolation
func (*Image) ResizeBilinear ¶
func (image *Image) ResizeBilinear(size Size, optional ...op.ResizeBilinearAttr) *Image
ResizeBilinear resizes the image to the specified size using the Bilinear interpolation
func (*Image) ResizeNearestNeighbor ¶
func (image *Image) ResizeNearestNeighbor(size Size, optional ...op.ResizeNearestNeighborAttr) *Image
ResizeNearestNeighbor resizes the image to the specified size using the NN interpolation
func (*Image) SaturateCast ¶
SaturateCast casts the image to dtype handling overflow and underflow problems, saturate the exceeding values to to minimum/maximum accepted value of the dtype
type Rectangle ¶
Rectangle represents a rectangle in the 2D space. This rectangle starts from the Point Start and has a specified Extent