rmObjects {EBImage} | R Documentation |
The rmObjects
functions deletes objects from an image
by setting their pixel intensity values to 0.
reenumerate
re-enumerates all objects in an image from 0 (background)
to the actual number of objects.
rmObjects(x, index) reenumerate(x)
x |
An |
index |
A numeric vector (or a list of vectors if |
An Image
object or an array, containing the new objects.
Oleg Sklyar, osklyar@ebi.ac.uk, 2006-2007
## make objects x = readImage(system.file('images', 'shapes.png', package='EBImage')) x = x[110:512,1:130] y = bwlabel(x) if (interactive()) display(normalize(y), title='Objects') ## remove and reenumerate y = rmObjects(y, 5) if (interactive()) display(normalize(y), title='Removal') y = reenumerate(y) if (interactive()) display(normalize(y), title='Reenumerated')