title: OpenCV cv2.moments returns all moments to zero
body: <p>For some reason that I cannot understand, the open cv function <code>cv2.moments</code> returns a dictionary with all zero values for the contour I am providing.
  Here is a MWE:</p>
  
  <pre><code>contour = [[[271, 67]],
              [[274, 67]],
              [[275, 68]],
              [[278, 68]],
              [[279, 69]],
              [[283, 69]],
              [[284, 70]],
              [[287, 70]],
              [[288, 71]],
              [[291, 71]],
              [[292, 72]],
              [[295, 72]],
              [[292, 72]],
              [[291, 71]],
              [[288, 71]],
              [[287, 70]],
              [[284, 70]],
              [[283, 69]],
              [[279, 69]],
              [[278, 68]],
              [[275, 68]],
              [[274, 67]]
            ]
  
  x=np.asarray(x)
  moments = cv2.moments(x)
  </code></pre>
  
  <p>with the result:</p>
  
  <pre><code>print(moments)
  
  {'m00': 0.0, 'm10': 0.0, 'm01': 0.0, 'm20': 0.0, 'm11': 0.0, 'm02': 0.0, 'm30': 0.0, 'm21': 0.0, 'm12': 0.0, 'm03': 0.0, 'mu20': 0.0, 'mu11': 0.0, 'mu02': 0.0, 'mu30': 0.0, 'mu21': 0.0, 'mu12': 0.0, 'mu03': 0.0, 'nu20': 0.0, 'nu11': 0.0, 'nu02': 0.0, 'nu30': 0.0, 'nu21': 0.0, 'nu12': 0.0, 'nu03': 0.0}
  </code></pre>
  
  <p>What is the meaning of this behaviour?
  I believe this is because the contour is open, but i am not sure.
  Is there a standard way to get rid of this behaviour by checking if the contour is open or closed beforehand?</p>