convertCoordinates | R Documentation |
Function for converting box coordinates to/from min/max representation from/to centroids/width
convertCoordinates(boxes, type = c("minmax2centroids", "centroids2minmax"))
boxes |
A vector or 2-D array where each row corresponds to a single box consisting of the format (xmin,xmax,ymin,ymax) or (centerx,centery,width,height) for 2-D vs. (xmin,xmax,ymin,ymax,zmin,zmax) or (centerx,centery,centerz,width,height,depth) for 3-D. |
type |
either |
a vector or 2-D array with the converted coordinates
Tustison NJ
vec2d = c(1, 10, 1, 10)
convertCoordinates(vec2d)
convertCoordinates(vec2d, type = "centroids2minmax")
convertCoordinates(rbind( vec2d, vec2d, vec2d))
convertCoordinates(rbind( vec2d, vec2d, vec2d), "centroids2minmax")
vec3d = c(1, 10, 1, 10, 1, 10)
convertCoordinates(vec3d)
convertCoordinates(vec3d, type = "centroids2minmax")
convertCoordinates(rbind( vec3d, vec3d, vec3d))
convertCoordinates(rbind( vec3d, vec3d, vec3d), type = "centroids2minmax")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.