thugly

package module
v0.0.0-...-b584da2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: MIT Imports: 6 Imported by: 0

README

thug.ly

Go Report Card

Thug life 24/7

Inspired by thuglify-node with some heuristic addition to calculate eyes region in case eyes not detected

Installation | Usage | Results | License

Thuglify your image

Installation

  • git clone
  • go get -v
  • make // it will create a bin folder and an executable called thugly

Usage

thugly --input <image path> --output=<output path, default to thuglify.jpg> --text <text to add at the bottom of image, like "Deal with it">
NAME:
   thugly - Thuglify your photos

USAGE:
   thuglify [global options] command [command options] [arguments...]

VERSION:
   1.0.0

AUTHOR:
   Adhitya Ramadhanus <adhitya.ramadhanus@gmail.com>

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --input value   Image input path
   --text value    Text to add at the bottom
   --output value  Image output path (default: "thuglify.jpg")
   --help, -h      show help
   --version, -v   print the version

Results

adit-thuglify lena-thuglify hitler-thuglify lenin-thuglify obama-thuglify

License

MIT © [Adhitya Ramadhanus]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawLabel

func DrawLabel(img *image.RGBA, label string, font string, rect image.Rectangle) error

func LoadImage

func LoadImage(file string) (image.Image, error)

LoadImage is a helper to load image file and returning image.Image and error

Types

type Detector

type Detector struct {
	FaceCascade *opencv.HaarCascade
	EyeCascade  *opencv.HaarCascade
}

Detector is struct which consist of FaceCascade and EyeCascade to detect face region and eyes region of picture, both of them are HaarClasifierCascade

func NewDetector

func NewDetector(faceCascadePath, eyeCascadePath string) *Detector

NewDetector is Detector constructor, it takes faceCascadePath and eyeCascadePath, path file to your LoadHaarClassifierCascade

func (*Detector) DetectPersons

func (d *Detector) DetectPersons(image *opencv.IplImage) []Person

DetectPersons is function that takes opencv IplImage and returning slice of Persons

type Person

type Person struct {
	Face opencv.Rect
	Eyes []opencv.Rect
}

Person is a struct which consist of Face and Eyes detected from Detector.DetectPersons

func (*Person) GetEyesRect

func (p *Person) GetEyesRect() image.Rectangle

GetEyesRect calculate a persons eyes rectangle,

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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