Assistance Required for Capturing RAW Images in Full Screen

50 views
Skip to first unread message

Kavan Gondalia

unread,
Oct 22, 2024, 1:07:18 AMOct 22
to Android CameraX Discussion Group

Dear Team,

I hope this message finds you well.

I am currently working on a project that involves capturing RAW images in full-screen mode. I am using the method .setBufferFormat(ImageFormat.RAW_SENSOR) to achieve RAW format. However, despite setting the target resolution with .setTargetResolution(Size(previewView.width, previewView.height)) and applying .setTargetAspectRatio, the captured images remain in a 4:3 aspect ratio.

Interestingly, when I switch the format to JPEG, the images are captured in full-screen size without any issues. Given that the Samsung S24 supports capturing RAW images in full-screen mode, I would like to implement a similar feature in our application.

Could you please provide guidance or insights on how to achieve this? Your expertise would be greatly appreciated.

Thank you for your assistance.

Best regards,
Kavan

Screenshot_20241021_154744_Camera.jpg

Eino-Ville Talvala

unread,
Oct 22, 2024, 2:47:51 PMOct 22
to Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan,

RAW images capture the full sensor pixel array, always.  Any cropping currently has to be handled by the application code, and it's somewhat complicated because all the DNG metadata (provided via capture results) necessary for interpreting the RAW sensor data is based on the full sensor coordinate system. So doing a crop requires also adjusting all the metadata accordingly. 

- Eddy

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/16d3464d-2332-41d1-934b-4f28ec5fcc8bn%40android.com.

Kailiang Chen

unread,
Oct 22, 2024, 3:02:57 PMOct 22
to Eino-Ville Talvala, Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan,

As Eddy mentioned, currently CameraX doesn't support RAW image cropping. That's why setTargetAspectRatio and setTargetResolution are working as expected.
Using Adobe DNG SDK might help you to access image data, modify the metadata and save DNG file accordingly.

In addition, CameraX next alpha release will provide new APIs to capture RAW and RAW + JPEG images (RAW cropping is not supported as well), 
we encourage you to try new official APIs and give us feedback.

Best,
Kailiang

Kavan Gondalia

unread,
Oct 22, 2024, 3:06:00 PMOct 22
to Kailiang Chen, Eino-Ville Talvala, Android CameraX Discussion Group
Hey team,

Thanks for quick reply. I will be glad to try the new official APIs.

Thanks for the information.

Best regards,
Kavan
Reply all
Reply to author
Forward
0 new messages