borders

command module
v0.0.0-...-68faeb9 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Borders

This is an implementation of the Suzuki + Abe "Topological Structural Analysis of Digitized Binary Images by Border Following" ( http://pdf.xuebalib.com:1262/xuebalib.com.17233.pdf )

This implementation is based off the original paper as well as being inspired by other papers/implementations/ideas from across the web.

Description

Borders generates a tree of contours/borders which are generated from a monochrome bitmap. The bitmap needs to be either black/0 for background and white/1 for content to be scanned for borders. The result is a tree of borders due to borders can contain inner borders (holes), which can in turn contain other borders etc.

Usage

Easiest approach is to have a black and white png file and execute:

img,_ := border.LoadImage("test.png")

// contour is root node
contour := border.FindContours(img)   

// this will save contours in contour.png
border.SaveContourSliceImage("contour.png", contour, img.Width, img.Height, false, 0) 

OpenCV Sanity Check

The directory opencv-sanity-check has a small test of test images and the contours generated by OpenCV. The code for this is at github.com/kpfaulkner/opencvtest

This is purely to compare results of Borders vs OpenCV.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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