Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

imread does not return null on failure, but an empty() Mat (without any pixels)

so please check: if(imgRGB.empty()) instead of if(imgRGB==null)

also, it cannot read files from the apk(zip). if you want to do that, please use loadResource

imread does not return null on failure, but an empty() Mat (without any pixels)

so please check: if(imgRGB.empty()) instead of if(imgRGB==null)

also, it cannot read files from the apk(zip). if you want to do that, please use loadResource

then, to load i flie from sdcard (using imread) please rater use Environment.getExternalStorageDirectory().getPath() + "/my.png"