'Process the image.'

def process_image(self, image):

    import cv2
    import numpy
    cv_image = cv2.imdecode(numpy.asarray(bytearray(image)), cv2.IMREAD_UNCHANGED)
    for (name, classifier) in self._classifiers.items():
        scale = DEFAULT_SCALE
        neighbors = DEFAULT_NEIGHBORS
        min_size = DEFAULT_MIN_SIZE
        if isinstance(classifier, dict):
            path = classifier[CONF_FILE]
            scale = classifier.get(CONF_SCALE, scale)
            neighbors = classifier.get(CONF_NEIGHBORS, neighbors)
            min_size = classifier.get(CONF_MIN_SIZE, min_size)
        else:
            path = classifier
        cascade = cv2.CascadeClassifier(path)
        detections = cascade.detectMultiScale(cv_image, scaleFactor=scale, minNeighbors=neighbors, minSize=min_size)
        matches = {}
        total_matches = 0
        regions = []
        for (x, y, w, h) in detections:
            regions.append((int(x), int(y), int(w), int(h)))
            total_matches += 1
        matches[name] = regions
    self._matches = matches
    self._total_matches = total_matches
