Im trying to calculate the centroid and angle of an object. Right now, it takes me about ~7,8 seconds to generate the output for a given image.
To calculate the output for a given image, first of all i generate some features applying filters like Gaussian, Median and Variance. Then, feed it into an sklearn RandomForestClassifier previously trained model to generate a segmented image (ths is the part that takes most of the time). Let's assume that after this point, the post-process/calculations are already fully optimized. What could i do to speed up the process?
Example 1

Example 2

Is it possible to split the original image into minor images in order to parallelize the process? Are there better/faster alternatives to correctly segment the original image?
Any idea/recommendation is appreciated.