def detect_faces(image, cascade, scale_factor, min_neighbours):
    """
    Detect faces visible on the image.
    :param cascade: cascade object used for detection
    :param image: analyzed image
    :param scale_factor: subsequent detections scaling coefficient
    :param min_neighbours: minimum detection neighbours
    :return: detected face rectangles
    """
    return cascade.detectMultiScale(image, scale_factor, min_neighbours)