imread function
read an image from a file into a Mat. The flags param is one of the IMReadFlag flags. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function returns an empty Mat.
For further details, please see: http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56
Implementation
Mat imread(String filename, {int flags = IMREAD_COLOR}) {
final dst = Mat.empty();
final cname = filename.toNativeUtf8().cast<ffi.Char>();
cvRun(() => cimgcodecs.cv_imread(cname, flags, dst.ptr, ffi.nullptr));
calloc.free(cname);
return dst;
}