# Blob coloring (or LABEL\_REGION in IDL)

**URL:** <https://www.ruby-forum.com/t/blob-coloring-or-label-region-in-idl/53877>\
**Category:** Ruby\
**Created:** [February 15, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/blob-coloring-or-label-region-in-idl/53877 "2006-02-15T21:19:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TrentDavey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@TrentDavey](https://www.ruby-forum.com/u/TrentDavey)\
**Post date:** [February 15, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/blob-coloring-or-label-region-in-idl/53877/1 "2006-02-15T21:19:17Z")

</div>

I thought I’d see if anyone has any canned functions/methods or “good  
ideas” before I wrote code to do this. Given a 2D bilevel (zero’s and  
non-zero values) array (image), a mask of the same size is returned  
where each element (pixel) is given a unique region/blob value. Each  
region/blob is a set of non-zero elements (pixels) surrounded by  
zeroes. This is done by the LABEL\_REGION function in IDL.

---

<div class="post-metadata">

**Author:** ![TrentDavey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@TrentDavey](https://www.ruby-forum.com/u/TrentDavey)\
**Post date:** [February 15, 2006, 11:48pm UTC](https://www.ruby-forum.com/t/blob-coloring-or-label-region-in-idl/53877/2 "2006-02-15T23:48:25Z")

</div>

On Thu, 16 Feb 2006, TrentDavey wrote:

> I thought I’d see if anyone has any canned functions/methods or “good  
> ideas” before I wrote code to do this. Given a 2D bilevel (zero’s and  
> non-zero values) array (image), a mask of the same size is returned  
> where each element (pixel) is given a unique region/blob value. Each  
> region/blob is a set of non-zero elements (pixels) surrounded by  
> zeroes. This is done by the LABEL\_REGION function in IDL.

i’m doing a lot of this stuff using the vigra toolkit

[http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/](http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/)

i’ve been trying to hook it into narray, but have not had time.

can i ask what your doing exactly?

-a
