Hi.
I implemented the algorithm and the result is very good . for example

code:
public Point centerHand(final List points,final MatOfPoint contour) {
ExecutorService executor = Executors.newFixedThreadPool(10);
final double[] distance = new double[points.size()];
for(int j=0; j maxDistance)
{
maxDistance = distance[index];
maxIndex = index;
}
}
Core.circle(image, points.get(maxIndex), (int)maxDistance, new Scalar(0,0,255));
return points.get(maxIndex);
}
private double findMinDistance(List contourPoints, Point candidate)
{
double result = Double.MAX_VALUE;
for(Point p : contourPoints)
{
result = Math.min(lenght(p, candidate), result);
}
return result;
}
Unfortunately this algorithm is brutal and it works very slowly.
How can I do the same thing but faster?
↧