calculate the metrics of recognized shapes