The code presents a workflow to extract forest gaps and edges from a canopy height model.
The whole workflow is exemplified on an pdf file workflow.gap.detection.pdf
The corresponding Rmarkdown file is: workflow.gap.detection.Rmd
Example files to run the code are available in a rda archive file: chm.rda