A computational geometric approach to shape analysis in images