title: Object detection within image using cv2 and Python
body: <p>I have this image <a href="https://i.stack.imgur.com/6R5fj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6R5fj.jpg" alt="image" /></a></p>
  <p>and I am interested to find the object (i.e., points) within this image and draw a rectangle around each object. I came to know that with <code>cv2</code> and found out this can be done easily. So I have written so far following codes by some quick google search:</p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import cv2 
  
  print( cv2.__version__ )
  
  # source data
  img_file= &quot;data1.png&quot;
  
  # create an OpenCV image
  img= cv2.imread(img_file)
  
  plt.imshow(img, cmap='gray')
  
  # Define the classifiers
  
  # pre-trained classifiers 
  Point_classifier=&quot;haarcascade_eye.xml&quot;   
  
  # convert color image to grey image
  
  gray_img=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  
  # CREATE TRACKER
  
  point_tracker=cv2.CascadeClassifier(Point_classifier)
  
  # detect points
  points= point_tracker.detectMultiScale(gray_img)
  print(points)
  
  Here I used `haarcascade_eye.xml` it looks similar to the point feature of the image, Is this correct? or do I need to use another classifier for this object?
  </code></pre>
  <p>But the result is not as expected. I am expecting figure something like this where each point should be marked with a rectangular shape individually.</p>
  <p>Any help on this or where I am making mistake in my codes. Thanks in advance.</p>
  <p><a href="https://i.stack.imgur.com/R5D4o.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5D4o.jpg" alt="this" /></a></p>