imgo

package
v0.0.0-...-3d51187 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

* 图像处理库 *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Binaryzation

func Binaryzation(src [][][]uint8, reference int) [][][]uint8

二值化 将图片转成黑白

func ClipImg

func ClipImg(src [][][]uint8, x1, y1, x2, y2 int) [][][]uint8

剪裁图片

func DecodeImage

func DecodeImage(filePath string) (img image.Image, err error)

读入图片返回image.Image

func Dot

func Dot(x []uint8, y []uint8) float64

func GetXiangLiang

func GetXiangLiang(pngstr string) (re []uint8)

取向量值,base64字符串转向量值

func ImgMatrixToBytes

func ImgMatrixToBytes(imgMatrix [][][]uint8) ([]byte, error)

三维数组到png数据

func LoadImg

func LoadImg(filepath string) (imgMatrix [][][]uint8)

读入图片返回[][][]uint8数据

func Matrix2Vector

func Matrix2Vector(imgMatrix [][][]uint8) (vector []uint8)

矩阵到向量

func NaiveRemoveNoise

func NaiveRemoveNoise(img [][][]uint8, pNum int) [][][]uint8

去噪点

func NaiveRemoveNoise2

func NaiveRemoveNoise2(img [][][]uint8) [][][]uint8

去噪点方法2,中值滤波

func New3DSlice

func New3DSlice(x int, y int, z int) (theSlice [][][]uint8)

生成[][][]uint8的数组

func NewRGBAMatrix

func NewRGBAMatrix(height int, width int) (rgbaMatrix [][][]uint8)

生成图片数组,4为rgba

func QuiShx

func QuiShx(src [][][]uint8) [][][]uint8

去除上下空白

func RGB2Gray

func RGB2Gray(src [][][]uint8) [][][]uint8

灰度

func RemoveLine

func RemoveLine(img [][][]uint8) [][][]uint8

去干扰线,功能有限

func Resize

func Resize(src *image.NRGBA, width int, height int) *image.NRGBA

调整图片长宽

func Rotate

func Rotate(img [][][]uint8, ang float64) [][][]uint8

旋转图片算法 任意角度

func SaveAsJPEG

func SaveAsJPEG(filepath string, imgMatrix [][][]uint8, quality int) error

保存为jpg

func SaveAsPNG

func SaveAsPNG(filepath string, imgMatrix [][][]uint8) error

保存为png

func XiangSiDu

func XiangSiDu(myx, myy []uint8) float64

比较两个向量的相似度

func ZhxFg

func ZhxFg(img [][][]uint8, reference int) (re [][][][]uint8, ok bool)

纵向分割,reference为黑白分界值

Types

This section is empty.

Jump to

Keyboard shortcuts

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