Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ImageJ - removing white blobs of a certain size...

641 views
Skip to first unread message

alm...@altavista.com

unread,
Jul 2, 2009, 10:25:43 AM7/2/09
to
Hi,

Any know how to use the ImageJ API to remove objects of a certain
size (say white objects on a black background). I would greatly
appreciate any hints/comments/suggestions that you may have.

Thanks in advance,
Al.

John B. Matthews

unread,
Jul 2, 2009, 10:56:00 AM7/2/09
to
In article
<b3c05cb3-d86f-4bca...@18g2000yqa.googlegroups.com>,
"alm...@altavista.com" <alm...@altavista.com> wrote:

> Any know how to use the ImageJ API to remove objects of a certain
> size (say white objects on a black background). I would greatly
> appreciate any hints/comments/suggestions that you may have.

You might look at "ImageJ Tutorial (PPT) and Example Images," near the
end:

<http://rsb.info.nih.gov/ij/docs/examples/index.html>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

rossum

unread,
Jul 2, 2009, 11:04:52 AM7/2/09
to

Break the problem down into smaller parts:

- can you identify a pixel of the appropriate colour?
- can you identify all pixels of that colour that are attached
(directly or indirectly) to the original pixel? An outlining
algorithm may help here.
- can you determine whether the area is the correct size?
- can you replace all the appropriate pixels with another colour?

rossum

Roedy Green

unread,
Jul 2, 2009, 2:05:30 PM7/2/09
to
On Thu, 2 Jul 2009 07:25:43 -0700 (PDT), "alm...@altavista.com"
<alm...@altavista.com> wrote, quoted or indirectly quoted someone who
said :

> Any know how to use the ImageJ API to remove objects of a certain
>size (say white objects on a black background). I would greatly
>appreciate any hints/comments/suggestions that you may have.

Here is a way.

Impose a grid on your image fine enough so that any white blob of
interest would have to touch at least one grid point.

Test each grid point to see if it is white. If it is, examine
surrounding points in ever-expanding contours till you find the edges
of the white region. As you expand, track how many white pixels are in
the blob. If the number in is range change the colour of the blob,
perhaps by a reverse process of averaging surrounding pixel colours,
working inwards.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan

0 new messages