title: Opencv findCountours function
body: <p>I'm trying to learn opencv. Online i found that, with opencv, I can obtain the contours of some image. So i tried that. Here is the script:</p>
  <pre><code>import cv2
  import numpy as np
  
  def getC(imagine):
      global imgContour
      c,h = cv2.findContours(imagine,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)
      for cnt in c:
          a = cv2.contourArea(cnt)
          print(area)
          if area&gt;500:
              cv2.drawContour(imgContour,cnt,-1,(255,0,0),3)
  
  img = cv2.imread(&quot;a3.jpg&quot;)
  imgContour = img.copy()
  imgG = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  imgB = cv2.GaussianBlur(imgG,(7,7),1)
  imgC = cv2.Canny(imgB,50,50)
  
  getC(imgContour)
  
  cv2.imshow(&quot;&quot;,img)
  cv2.imshow(&quot;g&quot;,imgG)
  cv2.imshow(&quot;b&quot;,imgB)
  cv2.imshow(&quot;l&quot;,imgContour)
  cv2.waitKey(0)
  </code></pre>
  <p>I think there is a problem with global variabiles, but also with the format. a3.jpg is that <a href="https://www.google.com/url?sa=i&amp;url=http%3A%2F%2Fwww.nonnainfabula.com%2Fwordpress%2Fprogetto-educativo-le-forme-rivolto-ai-genitori%2F&amp;psig=AOvVaw1Qj_H2KDHHKR-4KDw5x-rt&amp;ust=1593335887870000&amp;source=images&amp;cd=vfe&amp;ved=0CAIQjRxqFwoTCLi8jfHUoeoCFQAAAAAdAAAAABAD" rel="nofollow noreferrer">image</a>.</p>
  <p>I don't now what to do now, and how to resolve the issue.</p>
  <p>Thanks for the help</p>