title: Correctly detect corners in an image opencv python
body: <p>I have the following image from which I am detecting the corners using the following code</p>
  
  <pre><code>import cv2
  
  img = cv2.imread('image.jpg',cv2.IMREAD_COLOR)
  
  gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
  bilateral = cv2.bilateralFilter(gray, 9, 75, 75)
  canny = cv2.Canny(bilateral, 50, 150)
  
  corners    = cv2.goodFeaturesToTrack(canny,15,0.06,25)
  
  for i in range(len(corners)):
      cv2.circle(img, (corners[i][0][0], corners[i][0][1]), 5, 255, -1)
  
  cv2.imshow('dilated', img)
  cv2.waitKey(0)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mO0jp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mO0jp.jpg" alt="enter image description here"></a></p>
  
  <p>Not all corners are not correctly determined that is I was expecting that black corners should be determined as well as the box corners. Fortunately box corners are determined in this case but not all black corners are determined. How can I improve this result or even change my approach of getting the correct corners. Harris corners is not a good solution for this approach because I need one single point as corner but Harris corners approach return many close points as candidates for corners. Thanks in advance for your suggestions. </p>