here i have a code from pyimagesearch
with result like 
the question is, how to finding the distance from only one countur point to other tl,tr,bl,br in other objects 
i'm try to edit from the code to be like exact the image im provide, but didn't work out.