iterate_cascade(self, cascade, image, [threshold]) -> prediction, bounding_box

    Iterates over the given image and computes the cascade of classifiers.
    This function will compute the cascaded classification result for the given ``image`` using the given ``cascade``.
    It yields a tuple of prediction value and the according bounding box.
    If a ``threshold`` is specified, only those ``prediction``\s are returned, which exceed the given ``threshold``.

    .. note::
       The ``threshold`` does not overwrite the cascade thresholds `:py:attr:`Cascade.thresholds`, but only threshold the final prediction.
       Specifying the ``threshold`` here is just slightly faster than thresholding the yielded prediction.

    **Parameters:**

    ``cascade`` : :py:class:`Cascade`
      The cascade that performs the predictions

    ``image`` : array_like(2D)
      The image for which the predictions should be computed

    ``threshold`` : float
      The threshold, which limits the number of predictions

    **Yields:**

    ``prediction`` : float
      The prediction value for the current bounding box

    ``bounding_box`` : :py:class:`BoundingBox`
      An iterator over all possible sampled bounding boxes (which exceed the prediction ``threshold``, if given)

def iterate_cascade(self, cascade, image, threshold = None):
    """iterate_cascade(self, cascade, image, [threshold]) -> prediction, bounding_box

    Iterates over the given image and computes the cascade of classifiers.
    This function will compute the cascaded classification result for the given ``image`` using the given ``cascade``.
    It yields a tuple of prediction value and the according bounding box.
    If a ``threshold`` is specified, only those ``prediction``\s are returned, which exceed the given ``threshold``.

    .. note::
       The ``threshold`` does not overwrite the cascade thresholds `:py:attr:`Cascade.thresholds`, but only threshold the final prediction.
       Specifying the ``threshold`` here is just slightly faster than thresholding the yielded prediction.

    **Parameters:**

    ``cascade`` : :py:class:`Cascade`
      The cascade that performs the predictions

    ``image`` : array_like(2D)
      The image for which the predictions should be computed

    ``threshold`` : float
      The threshold, which limits the number of predictions

    **Yields:**

    ``prediction`` : float
      The prediction value for the current bounding box

    ``bounding_box`` : :py:class:`BoundingBox`
      An iterator over all possible sampled bounding boxes (which exceed the prediction ``threshold``, if given)
    """

    for scale, scaled_image_shape in self.scales(image):
      # prepare the feature extractor to extract features from the given image
      cascade.prepare(image, scale)
      for bb in self.sample_scaled(scaled_image_shape):
        # return the prediction and the bounding box, if the prediction is over threshold
        prediction = cascade(bb)
        if threshold is None or prediction > threshold:
          yield prediction, bb.scale(1./scale)