Find specified number of points on curve with identical chord length (not arc length)
Hello!
I have the user draw a line and obtain the points on that line:
% Load example image
I = imread(‘peppers.png’);
imshow(I)
% Draw line
roi = drawassisted(‘Closed’, false);
% Obtain positions of points
points_input = roi.Position;
% Number of target points
num_points_target = 10;
% Find these
points_output
I want to find a specified number of points (num_points_target) along the described curve, so that the chord length between the outputs points (points_output) would be identical. I am specifically looking for chord length, not arc length. I have seen this but it uses arc length ( https://uk.mathworks.com/matlabcentral/fileexchange/34874-interparc/files/interparc.m ).
I assume some interpolation – linear would likely be okay – would be in order as, depending on the drawing speed, the points_input might not be spaced very evenly.
Code would obviously be great but if someone felt like just explaining the mathematical approach to this, that would already be very helpful. At the moment, I think I would be able to cobble something dreadful with many loops together myself but it seems to me that there must be an elegant solution to this problem surely.Hello!
I have the user draw a line and obtain the points on that line:
% Load example image
I = imread(‘peppers.png’);
imshow(I)
% Draw line
roi = drawassisted(‘Closed’, false);
% Obtain positions of points
points_input = roi.Position;
% Number of target points
num_points_target = 10;
% Find these
points_output
I want to find a specified number of points (num_points_target) along the described curve, so that the chord length between the outputs points (points_output) would be identical. I am specifically looking for chord length, not arc length. I have seen this but it uses arc length ( https://uk.mathworks.com/matlabcentral/fileexchange/34874-interparc/files/interparc.m ).
I assume some interpolation – linear would likely be okay – would be in order as, depending on the drawing speed, the points_input might not be spaced very evenly.
Code would obviously be great but if someone felt like just explaining the mathematical approach to this, that would already be very helpful. At the moment, I think I would be able to cobble something dreadful with many loops together myself but it seems to me that there must be an elegant solution to this problem surely. Hello!
I have the user draw a line and obtain the points on that line:
% Load example image
I = imread(‘peppers.png’);
imshow(I)
% Draw line
roi = drawassisted(‘Closed’, false);
% Obtain positions of points
points_input = roi.Position;
% Number of target points
num_points_target = 10;
% Find these
points_output
I want to find a specified number of points (num_points_target) along the described curve, so that the chord length between the outputs points (points_output) would be identical. I am specifically looking for chord length, not arc length. I have seen this but it uses arc length ( https://uk.mathworks.com/matlabcentral/fileexchange/34874-interparc/files/interparc.m ).
I assume some interpolation – linear would likely be okay – would be in order as, depending on the drawing speed, the points_input might not be spaced very evenly.
Code would obviously be great but if someone felt like just explaining the mathematical approach to this, that would already be very helpful. At the moment, I think I would be able to cobble something dreadful with many loops together myself but it seems to me that there must be an elegant solution to this problem surely. chord length, even spacing MATLAB Answers — New Questions









