0

I have analysed tree core images through the raster package in an attempt to perform image analysis. In the image:

http://dx.doi.org/10.6084/m9.figshare.1555854

You can see the measured "vessels" (black and numbered) and also annual lines (red) which have been drawn using the locator function and represent each year of growth of the tree core.

By generating a list of the maximum y coordinates of each annual line I have been able to sort the vessels into years for this image. Which is what I am looking for. However, it has occurred to me that in reality things can get a little more difficult as seen in the next image:

http://figshare.com/articles/Complicated/1555855

The approach above will not work on this image as vessels from each year overrun so using the maximum y coordinates will not return the correct result.

So can anyone suggest another approach which may overcome this limitation? I have thought about using spatialpolygons but not sure this will achieve what I am looking for.

Darren468
  • 41
  • 1
  • 6

1 Answers1

0

If you are creating the lines by clicking on the plot, you can use raster function drawLine or, for polygons, drawPoly. You could rasterize the polygons and mask that with the original image to get the vessels grouped by polygon (year).

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63