yaac_backend_imgproc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindTable

func FindTable(img gocv.Mat) gocv.Mat

Find the attendance list in an image It expects a white paper on white background with the attendance list being black It performs a reverse perspective transform to show the table from an orthogonal view. This modified image is returned from the function.

func ValidSignature

func ValidSignature(img PreparedImage) bool

Check whether the signature in `img` is valid. This is done by checking that there is only one signature.

It returns true if the signature is valid, false otherwise.

Types

type BackendImgproc

type BackendImgproc struct {
	MVVM mvvm
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(mvvm mvvm) *BackendImgproc

func (*BackendImgproc) NewTable

func (mvvm *BackendImgproc) NewTable(imgBuf []byte) (*Table, error)

Take in an image as a byte array in a valid format and parse it into a table which has information about the students and the validity of the signature.

type PreparedImage

type PreparedImage = gocv.Mat

An image that has been prepared with to PrepareImage

func PrepareImage

func PrepareImage(img gocv.Mat) (PreparedImage, error)

Prepare the image in a way that it can be used for further processing

type Table

type Table struct {
	Course            string
	Image             gocv.Mat
	ImageWithoutTable gocv.Mat
	Rows              []TableRow
}

func NewTable

func NewTable(img gocv.Mat, client *gosseract.Client) (*Table, error)

Parses `img` to return a new table

This extracts the students names from the image and validates the signatures.

func ParseTable

func ParseTable(img PreparedImage) *Table

Extract the table structure from an image of the attendance list table

func (*Table) Review

func (table *Table) Review(tesseractClient *gosseract.Client) error

Review table shown in the image returned by `FindTable`. The image has to be prepared by `PrepareImage`. If it fails, e.g. if some information is missing, it returns an error It also takes in a Gosseract client to allow for reusing the Gosseract client.

type TableRow

type TableRow struct {
	FirstName    string
	LastName     string
	RawName      string
	FullName     string
	Valid        bool
	NameROI      image.Rectangle
	SignatureROI image.Rectangle
	TotalROI     image.Rectangle
}

Jump to

Keyboard shortcuts

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