Module Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice Slice Num Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice Slice Num Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice Slice Num Num Assign NameStore BinOpAdd BinOpAdd BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Return NameLoad decorator_list
N/A N/A  Mathematical expressions related to image processing.  color_to_gray N/A N/A color N/A N/A N/A 
    .. todo::

        WRITEME properly

    Standard conversion from color to luma

    Y' = W_R * red_channel + W_G * green_channel + W_B * blue_channel

    with
    W_R = 0.299
    W_G = 0.587
    W_B = 0.114

    Parameters
    ----------
    color : numpy or theano 4-tensor
        The channel index must be last

    Returns
    -------
    tensor
        Has the same number of dimensions, but with the final dimension
        changed to 1.

    References
    ----------
    http://en.wikipedia.org/wiki/YUV#Conversion_to.2Ffrom_RGB
     N/A W_R 0.299 N/A W_B 0.114 N/A W_G 0.587 N/A red_channel N/A color N/A N/A N/A N/A N/A 0 1 N/A blue_channel N/A color N/A N/A N/A N/A N/A 2 3 N/A green_channel N/A color N/A N/A N/A N/A N/A 1 2 N/A Y_prime N/A N/A N/A W_R red_channel N/A W_G green_channel N/A W_B blue_channel N/A Y_prime N/A