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.
> 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>
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
> 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