Computes two types of distance measures from an otolith contour: polar distances (radial distances from the centroid) and perimeter-based distances. These measures are crucial for subsequent wavelet analysis.
Arguments
- contour
A matrix of coordinates from
extract_contour().- n_points
Target number of points for resampling (default: 512).
Value
A list containing:
polar: Radii, coordinates, and normalized radii.perimeter: Distances, coordinates, and normalized distances.reordered_coords: The contour coordinates reordered from the rightmost point.
Examples
image_path <- system.file("extdata", "otolith.jpg", package = "aforoR")
binary_img <- preprocess_image(image_path)
contour <- extract_contour(binary_img)
dists <- calculate_distances(contour, n_points = 512)
plot(dists$polar$normalized, type = "l")
