The C++ interface for loadimage. More...

array loadimage (const char *filename, bool iscolor=false)
 Load an image from disk. More...

Detailed Description

The C++ interface for loadimage.

Function Documentation

array af::loadimage ( const char *  filename,
bool  iscolor = false 

Load an image from disk.

// load a color image, where
img_in(span, span, 0) is red channel
img_in(span, span, 1) is green channel
img_in(span, span, 2) is blue channel
array img_in = loadimage("~/image.png", true);
// load an image and convert to grayscale
array img_in = loadimage("~/image.png", false);

This software uses the FreeImage open source image library. See for details. FreeImage is used under the (GNU GPL or FIPL), version (license version).

[in]filenamename of the image, including extension
[in]iscolor(false: MxNx1 for gray | true: MxNx3 for color RGB)
formats supported: jpeg, bmp, png, tiff, ppm
channels supported: 8 bit (Gray), 24 bit color (RGB), 32 bit (RGBA)
examples/image_processing/image_demo.cpp, examples/image_processing/optical_flow.cpp, and examples/machine_learning/kmeans.cpp.