In [2]:
%matplotlib inline
from matplotlib import pyplot as plt, cm
import numpy as np
import cv2

In [3]:
# Hu Moments shape descriptor will only be computed over the white pixels.
# Hu Moments are used to characterize the outline or “silhouette” of an object in an image.

In [4]:
image = cv2.imread("./data/coins.JPG")
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
print cv2.HuMoments(cv2.moments(image)).flatten()


[  1.29254235e-03   1.39968543e-07   2.64154996e-12   9.60948555e-13
   9.95578993e-25  -1.19217000e-17   1.16311276e-24]