After performing watershed algorithm, it returned me a marker like this (not the rectangle). Right now, I want to find the max,min coordinate of the object boundary (not the rectangle). Is there any method that is capable of doing this without slowing down the system too much? The objective is to resize the rectangle dynamically to improve tracking. This is a real time object tracking + object segmentation so performance is a thing.
Any help is greatly appreciated !