grow_crowns: Outline Tree Crowns In Imagery

Description Usage Arguments Value

View source: R/region_growing_wrapper.r

Description

Given a an image and point shapefile with points ('seeds') placed at the center of crowns, estimate the tree crown around every seed, and write the results away as a polygon shapefile.

Usage

1
2
3
4
5
grow_crowns(r_file, seed_shpfile, seed_extent = rep(NA, 4),
  avoid_recalculation = T, prob_cut = 99, prob_step_down = 2,
  seed_nrs = NA, outp_crown_shp_filename, process_dir = NULL,
  max_crown_RADIUS_in_m = 4, min_crown_RADIUS_in_m = 0.6, plott = F,
  RGBseq = c(1, 2, 3), parallel = F, nWorkers = 4)

Arguments

r_file

Filename of raster brick to run crown delineation on. From tests with hyperspectral data, it appears r_file can have up to 6 bands, equally spaced in wavelength, before the colinearity crashes mahalanobis

seed_shpfile

Filename of point shapefile that has points at the center of trees.

seed_extent

A numerical vector of length four. It should contain raster::extent parameters to restrict the analysis only to the points in seed_shpfile that fall within a certain extent. To not trim the data in a certain direction, set that position in seed_extent to NA. Default is c(NA,NA,NA,NA), which means the seed_shpfile is not trimmed before seed_nrs are checked..

avoid_recalculation

Do you want to check if a run with these settings and same output filename was already done, and add outlines of new seeds to that output? Default is T.

prob_cut

The probability [in percent] cut off in the chi square distribution that determines the cut-off in Mahalanobis distance higher prob_cut values produce larger crowns. Default is 99 percent.

prob_step_down

As long as the region grows all the way to the max_crown_radius, prob_cut will be stepped down by prob_step_down and the region will be grown again. Default is 2 percent

seed_nrs

Seeds to be used for crown estimation. Starts counting at 1, for FID = 0. If set to NA, all seeds will be included. Default is NA.

outp_crown_shp_filename

Base for the output polygon shape filename. **_probcut.shp** will be added to create the final filename.

process_dir

An optional directory to write output to while processing. Can come in handy if network access is a bottleneck or i/o to the network causes crashes. Default is NULL in which case output is written to the final destination directory.

max_crown_RADIUS_in_m

The maximum radius a crown can have (in image units of **r_file**. Best to work in m). Default is 4.

min_crown_RADIUS_in_m

The minimum radius a crown should have (in image units of **r_file**. Best to work in m). Default is 0.6.

plott

Logical. Do you want to plot the results? Defaults to F.

RGBseq

3-element vectors given the band nummers for RGB plotting of crowns. Only considered is plott=T. Default is c(1,2,3).

parallel

Should the code be run in parallel using the doParallel package? Default is FALSE.

nWorkers

If running the ocde in parallel, how many workers should be used? Default is 4.

Value

Writes away a .shp polygon file of crowns. Attributes include npx_t_b = the number of pixels in the crown touching the edge of the disk of maximum crown size, nstrtcl = the number of pixels taken for granted as crown at the start of the region growing, probcut = the final prob_cut value for this crown. any attributes from the seeds .shp file will be saved in the output as well.


pieterbeck/CanHeMonR documentation built on May 25, 2019, 7:11 a.m.