title: Distance calculation between the two points in an image using python
body: <p>Here is an image, I need to locate dogs mouth and its tail and i need to find  the distance between dog's tail and it's Mouth using image Procesing (Note: not minimum or spacial distance whole body should be considered).</p>
  
  <p><a href="https://i.stack.imgur.com/33rVQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/33rVQ.jpg" alt="enter image description here"></a></p>
  
  <pre><code>import cv2
  import numpy as np
  
  filename = 'Dog-catches-own-tail_1.jpg'
  
  img = cv2.imread(filename)
  
  gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  gray = np.float32(gray)
  
  dst = cv2.cornerHarris(gray,2,3,0.04)
  dst = cv2.dilate(dst,None)
  
  img[dst&gt;0.01*dst.max()]=[0,0,255]
  cv2.imwrite('Image.jpg',img)
  </code></pre>
  
  <p>After running the code snippet i am able to get the corner here:</p>
  
  <p><a href="https://i.stack.imgur.com/BYP17.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BYP17.jpg" alt="enter image description here"></a></p>