def intensity( rgb ):
    """ Returns the average value of the rgb pixel data.

    Inputs:
    -- rgb: rgb pixel array in the form [b,g,r]

    Returns: average of the three values
    """
    return int( (rgb[0] + rgb[1] + rgb[2])/3 )