Benny,

If your goal is to compute the area of non-connected areas (patches), I
think you can do:

library(raster)
im <- brick("P1020393.JPG")
plotRGB(im)

extract=(im[[1]]>50)&(im[[2]]>180)&(im[[3]]>220)
# see raster::: predict for an alternative approach

# create patches
clmp <- clump(extract)
plot(clmp)

# get patch sizes (number of cells)
f <- freq(clmp)


Robert


On Fri, Jun 1, 2012 at 6:29 AM, BennyB <benny.borremans@ua.ac.be> wrote:

> That works perfectly.
>
> Thanks so much Rafael, you are a true hero!
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/extract-by-attributes-from-raster-image-to-polygons-tp7576826p7580086.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

