[R] shapes of woodpeckers' cavities

Jim Lemon jim at bitwrit.com.au
Fri Mar 7 12:03:43 CET 2014


On 03/07/2014 08:51 AM, Violette BERTRAND wrote:
> Hi,
>
> I have pictures (.png) of the shape of many entrances of woodpeckers’ cavities, coloured in black. I want that R takes these pictures and stacks (superimposes) all the shapes to determine the tendency of the shape of cavities for each species of woodpecker.
>
> I currently use the package EBImage which determine the mean radius of the shape of entrances (the shape is divided in 8 parts, and the package measure the mean radius for each part). So this package uses only the mean radius for each part of the shape.
>
> But, I would like that R use the real shape of cavities. Is another package exists, which will use the real shape of my pictures ?
>
Hi Violette,
I think that this is more of a graphics manipulation. You can get the 
outline of the woodpecker hole by:

1) loading your image into the GIMP
2) duplicating it
3) scaling the duplicate down by about 2.5%
4) select the area using "similar colors"
5) bucket fill the selected area with white
6) copy the selected area
7) paste it onto the original image

You will then have the outline as in the image attached. I don't know 
whether the GIMP will do it, but there are image compositing functions 
that will produce an average of many images. There you have your average 
woodpecker hole.

Jim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: woodpecker_outline.png
Type: image/png
Size: 6528 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20140307/8be768a1/attachment-0002.png>


More information about the R-help mailing list