You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the default implementation of find_contours() determines the integer point boundary and then calls simplify_polygon() with a default epsilon of 0, allowing for no interpolation outside of consecutive linearly interpolatable points (for example, (0,1) (0,2) (0,3) could be simplified to (0,1) (0,3)). In the case of ellipsoid contours, this could result in horribly complex borders with more roughness along the border than in reality.
Without diving into cublic spline fitting options, let me propose adding an epsilon parameter to find_contours() which can be passed into the final call of simplify_polygon(), changing
Proposing changes to find_contours.pyx line 73, 114
https://github.com/v7labs/upolygon/blob/master/upolygon/find_contours.pyx
It looks like the default implementation of find_contours() determines the integer point boundary and then calls simplify_polygon() with a default epsilon of 0, allowing for no interpolation outside of consecutive linearly interpolatable points (for example, (0,1) (0,2) (0,3) could be simplified to (0,1) (0,3)). In the case of ellipsoid contours, this could result in horribly complex borders with more roughness along the border than in reality.
Without diving into cublic spline fitting options, let me propose adding an epsilon parameter to find_contours() which can be passed into the final call of simplify_polygon(), changing
return labels, simplify_polygon(outer_paths, 0), simplify_polygon(inner_paths, 0)
to
return labels, simplify_polygon(outer_paths, epsilon), simplify_polygon(inner_paths, epsilon)
The text was updated successfully, but these errors were encountered: