code: def centroid(im):
      
      # These calls point to Python version of moments function
      m00 = cdriz.arrmoments(im,0,0)
      m10 = cdriz.arrmoments(im, 1,0)
      m01 = cdriz.arrmoments(im,0,1)
  
      ycen = m10 / m00
      xcen = m01 / m00
      return xcen, ycen
docs: Computes the centroid of an image using the image moments:
  
      centroid = {m10/m00, m01/m00}
  
      These calls point to Python version of moments function
      m00 = immoments(im,0,0)
      m10 = immoments(im, 1,0)
      m01 = immoments(im,0,1)