Android opencv load grayscale png with 16bit depth
<p>I am very new to opencv4android and trying to load a grayscale png image with 16bit depth.</p>

<p>I tried:</p>

<pre><code>Mat mat2DImg = Utils.loadResource(getBaseContext(), R.drawable.image, Highgui.CV_LOAD_IMAGE_GRAYSCALE);
</code></pre>

<p>But the png is read as 8bit with values in [0,255]. I tried the CV_LOAD_IMAGE_ANYDEPTH flag but same. I tried to create an alpha channel or loading the image as raw but did not manage to have it work.</p>

<p>I also tried to copy the image on the device and read it with imread as follow hoping that imread could load the 16bit channel:</p>

<pre><code>java.lang.String filename = "/storage/emulated/0/image.png";
Mat mat2DImg = Highgui.imread(filename, 0);
</code></pre>

<p>When I check for <code>file.exists()</code> it does exist. The <code>Mat</code> returned is not null but it is empty.</p>

<p>Can anyone suggest a way to load the image properly?</p>