title: Detect and crop card in image with multiple objects using width and height or color of card
body: <p>I have a card with multiple objects in one image and I want to crop the card using width and height or color of the card.</p>
  <p>I can crop using code below:</p>
  <pre><code>import cv2
  img = cv2.imread('/Users/akram/Downloads/img.jpg', 1)
  x = 0
  y = 0
  width = 500
  height = 500
  cropped_img = img[y:y+height, x:x+width]
  cv2.imshow(&quot;cropped_images&quot;, cropped_img)
  cv2.waitKey(0)
  </code></pre>
  <p>But when I have other image width card <code>width = 500 and height = 500</code> and   <code>x = 200 y = 100</code></p>
  <p>I need to edit my code with <code>x = 200 and y = 100</code>.</p>
  <p>The problem is that I don't know the position of the card in all time, so I need to create a dynamic code to crop the card with any position x or y in image.</p>
  <p>I don't know how can I achieve this purpose, I'm new in OpenCV and computer vision in fact I'm new in this domain.</p>
  <p>Example image</p>
  <p><a href="https://i.stack.imgur.com/HXvu1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HXvu1.jpg" alt="enter image description here" /></a></p>
  <p>Anyone can help me to resolve this issue and thanks ?</p>