Skip to content

satrobit/blobcounter.js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

blobcounter.js

A blob counter library written in pure javascript.

This library helps you find blobs in an image . Inspired by BlobCounter Class in AForge.NET Framework .

Installation

Just include the blobcounter.js anywhere you like :

<script type="text/javascript" src="blobcounter.js"></script>

Or the blobcounter.min.jswhich is minified :

<script type="text/javascript" src="blobcounter.min.js"></script>

Usage

NOTE: Input image must be black and white. ( black blobs with white background )

var blobs = new blobcounter(canvas); // Don't forget that input image must be all black and white ( black blobs with white background ) . Apply threshold filter to do that . 
var res = blobs.detect(1); // Radius area is one pixel . You can change it.

for (var i = 0; i < res.length; i++) {
	var cog = res[i].cog; // Center of gravity . res[i].cog.x and res[i].cog.y
	var mess = res[i].mess; // Number of pixels
}

See the example.html for a practical example .

Contributing

This library may be a poor written code as i'm not a javascript programmer so any contributing would be a huge help.

About

A blob counter library written in pure javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published