Ask Your Question

celsius's profile - activity

2014-10-13 09:18:06 -0600 asked a question Convert 16 bit image to R10 G11 B10

I have a 16 bit per sample image(48 bit per pixel) with three channels in a byte array, in OpenCV this is CV16UC3.

I want to convert this 16 bps image to R10 G11 B10, so 10 bits in red, 11 bits in green and 10 bits in blue. Is this possible in OpenCV?

I am using OpenCVAndroid SDK

2014-10-03 13:05:30 -0600 asked a question Display RAW image in Android

I am trying to display an DNG image in my Android app. I tried to convert it to Bitmap but the program crashes. It works when I convert from JPEG. Any ideas?

public void viewDNGfile() {
    // make a mat and draw something
    File root = Environment.getExternalStorageDirectory();
    File file = new File(root, "DCIM/RAW/test.dng");

   Mat img =  loadOpenCvImage(file.getAbsolutePath());

    // convert to bitmap:
    Bitmap bm = Bitmap.createBitmap(img.cols(), img.rows(),Bitmap.Config.ARGB_8888);
    Utils.matToBitmap(img, bm);

    // Draw
    ImageView iv = (ImageView) findViewById(R.id.imageView1);
    iv.setImageBitmap(bm);
}

public static Mat loadOpenCvImage(final String filePath) {
    Mat imgMat = Highgui.imread(filePath, Highgui.CV_LOAD_IMAGE_ANYDEPTH);
    if (imgMat == null) {
        Log.e("error", "error loading file: " + filePath);
    } else {
        Log.d("error", "Ht: " + imgMat.height() + " Width: " + imgMat.width());
      final String outPath = filePath + "_gray.jpg";
       // Log.d("error", outPath);
       // Highgui.imwrite(outPath, imgMat);
    }
    return imgMat;
}
2014-10-01 10:00:13 -0600 commented question DNG(RAW) image load and display in Android

is this possible?

2014-10-01 00:01:39 -0600 commented answer Some problem about displaying a raw image file

how is this done in Java?

2014-09-30 22:58:53 -0600 asked a question DNG(RAW) image load and display in Android

How can I load and display Raw-images(DNG-format)? I want to load it into a Mat.