boxes_to_spatial_polygons: Convert xml crown annotations into projected bounding boxes....

View source: R/boxes_to_spatial_polygons.R

boxes_to_spatial_polygonsR Documentation

Convert xml crown annotations into projected bounding boxes. In order to plot the annotations, they need to be projected and overlayed on RGB boxes

Description

Convert xml crown annotations into projected bounding boxes. In order to plot the annotations, they need to be projected and overlayed on RGB boxes

Usage

boxes_to_spatial_polygons(boxes, raster_object, project_boxes = TRUE)

Arguments

boxes

A data frame with xmin, xmax, ymin, ymax columns. Each row is a crown bounding box.

raster_object

A RGB raster to overlay annotations

project_boxes

Whether boxes need to be projected to utm from image coordinates (origin 0,0 top left)

Value

SpatialPolygons object of annotations

Examples


xml<-get_data("SJER_052","annotations")
annotations<-xml_parse(xml)
rgb_path<-get_data("SJER_052","rgb")
rgb<-raster::stack(rgb_path)
ground_truth <- boxes_to_spatial_polygons(annotations,rgb)
plot(ground_truth)
s

weecology/NeonTreeEvaluation_package documentation built on Aug. 27, 2024, 10:53 a.m.