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()