Thank you for quick response.
2- I customize Camera2Raw sample and get two result ImageFormat.JPEG and second output ImageFormat.DEPTH16
In this test i take phone from 80 cm from floor but output attached as file values is different i also implement IOS version with IPhoneX but that output is completely correct.
Buffer decode is exactly same as Camera2 API ImageFormat.Depth16 also Logical camera support CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
I attached source code and output log file thank you for fast follow.
Regards,
James
case ImageFormat.DEPTH16: {
// Print Sample
// ############################################################################################
int bufW = mImage.getWidth();
int butH = mImage.getHeight();
Log.i("TestCam", "Depth Image Width:" + String.valueOf( bufW ) + " Depth Image Height: " + String.valueOf( butH ) );
ShortBuffer shortDepthBuffer = mImage.getPlanes()[0].getBuffer().asShortBuffer();
// Print sample depth values
for ( int i = 0 ; i < 10000 ; i++ ){
short tdepthSample = shortDepthBuffer.get();
short tdepthRange = (short) (tdepthSample & 0x1FFF);
short tdepthConfidence = (short) ((tdepthSample >> 13) & 0x7);
float tdepthPercentage = tdepthConfidence == 0 ? 1.f : (tdepthConfidence - 1) / 7.f;
if ( tdepthPercentage != 0 )
Log.i("TestCam", "Sample Depth[" + String.valueOf(i) + "] -> " + String.valueOf( tdepthRange ) );
}
OUTPUT >>>
2019-05-23 21:36:08.506 22338-22858/com.example.android.camera2raw I/TestCam: Depth Image Width:992 Depth Image Height: 744
2019-05-23 21:36:08.507 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[273] -> 63
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[274] -> 63
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[275] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[276] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[277] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[278] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[279] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[280] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[281] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[282] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[283] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[284] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[285] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[286] -> 64
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[287] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[288] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[289] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[290] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[291] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[292] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[293] -> 321
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[294] -> 322
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[295] -> 834
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[296] -> 835
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[297] -> 835
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[298] -> 835
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[299] -> 835
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[300] -> 835
2019-05-23 21:36:08.508 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[301] -> 1091
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[302] -> 1091
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[303] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[304] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[305] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[306] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[307] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[308] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[309] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[310] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[311] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[312] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[313] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[314] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[315] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[316] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[317] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[318] -> 1092
2019-05-23 21:36:08.509 22338-22858/com.example.android.camera2raw I/TestCam: Sample Depth[319] -> 1092