arcLength | R Documentation |
arcLength
estimates a closed contour perimeter or a curve
length from a set of 2D coordinates.
arcLength(curve, closed = TRUE)
curve |
An m x 2 matrix of 2D coordinates. |
closed |
A boolean indicating whether the curve is closed (perimeter) or not (default: TRUE). |
A numerical value.
Simon Garnier, garnier@njit.edu
findContours
dots <- image(system.file("sample_img/dots.jpg", package = "Rvision"))
dots_gray <- changeColorSpace(dots, "GRAY")
dots_bin <- dots_gray < 200
contours <- findContours(dots_bin)
ix <- contours$contours[, 1] == 0
arcLength(contours$contours[ix, 2:3])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.