colorToGreyscale.sml
CLASS Raster r, g, b, o;
GetInputRaster(r);
GetInputRaster(g);
GetInputRaster(b);
GetOutputRaster(o, r.$Info.NumLins, r.$Info.NumCols, "8-bit unsigned");
Numeric lin, col;
for each r[lin, col] {
o[lin, col] = .3 * r[lin, col] + .59 * g[lin, col] + .11 * b[lin, col];
}
©MicroImages, Inc. 2013 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010 USA
Business & Sales: (402)477-9554 Support: (402)477-9562 Fax: (402)477-9559
Business info@microimages.com
Support support@microimages.com
Web webmaster@microimages.com
|