opencv_contrib icon indicating copy to clipboard operation
opencv_contrib copied to clipboard

[FR] Add convex_hull function based on run-length encoding

Open FantasqueX opened this issue 1 year ago • 0 comments

Currently, the complexity of convexHull() is O(N log(N)) (N is the number of points) because the first step is std::sort(). If we calculate convex hull based on run-length encoding like https://docs.opencv.org/4.x/df/def/group__ximgproc__run__length__morphology.html the first step sorting is unnecessary, and the complexity becomes O(N) (N is the number of run length).

FantasqueX avatar Nov 14 '24 09:11 FantasqueX