'This method takes in an integral image and applies the haar-cascade
to the image, and returns the result.'

def apply(self, intImg):

    w = (intImg.shape[0] - 1)
    h = (intImg.shape[1] - 1)
    accumulator = 0
    for i in range(len(self.mRegions)):
        p = self.mRegions[i][0]
        q = self.mRegions[i][1]
        r = self.mRegions[i][2]
        s = self.mRegions[i][3]
        sign = self.mRegions[i][4]
        xA = int((w * r))
        yA = int((h * s))
        xB = int((w * r))
        yB = int((h * q))
        xC = int((w * p))
        yC = int((h * s))
        xD = int((w * p))
        yD = int((h * q))
        accumulator += (sign * (((intImg[(xA, yA)] - intImg[(xB, yB)]) - intImg[(xC, yC)]) + intImg[(xD, yD)]))
    return accumulator
