Skip to content

Generates salient contours for images based on local differences in color intensity. Implements a modified version of the marching squares algorithm.

Notifications You must be signed in to change notification settings

joshuahahn/ImageContour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Contour Generator

This implements a twist on the standard procedure of contour generation using marching squares. The algorithm generates contours of images based on differences between neighboring tiles, as opposed to a universal value threshold.

Example

This is an example of the contour generator using a range of thresholds.

Algorithm

Standard implementations of contour generation using marching squares uses a universal threshold to determine wheter a tile is "inside" or "outside" of the contour. While this approach is appropriate for generating contours of implicit expressions, generating contours (namely, salient contours) is difficult with this approach, since contours from real images are not defined by global thresholds, but rather, local changes in color. Thus, I implemented this contour generator that determines borders between tiles based on whether two corners on a "square" have a differnece in color intensity greater than a relative threshold value. As such, the lookup-table contour lines greatly differ from standard implementations of the marching squares algorithm.

Image Processing

To make the algorithm run in a reasonable amount of time, there is a resizing option that allows the user to resize the image into a lower resolution. Next, the image is turned into a black-and-white image with increased contrast. This makes the algorithm more robust to noise, and makes it easier to identify where contours should be.

About

Generates salient contours for images based on local differences in color intensity. Implements a modified version of the marching squares algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages