RGB2GRAY function

translates an RGB image matrix to gray scale