Camera2 Ultra-Wide lens image distortion correction

Using camera2 API on my Samsung S10 and S20, I can access the Ultra-Wide camera with camera ID 2, but the preview appears as distorted or “fish-eyed” around the edges, as well as in the final captured image. This makes sense due to the lens, but it’s possible to correct this partially on some phones like Pixels. If I use the native Samsung system camera, it will still distort in the wide angle in the view finder, but the final image will be auto post-processed to straighten out the distortion. You notice this effect most heavily if you align anything with a straight line near the edge of the cameras view.

I’d like to be able to replicate that same effect with camera2 as we can’t use the “fish-eye” look in our image analysis. My Pixel 6 with Camera2 has a logical camera that will handle distortion correction automatically when setting CaptureRequest.CONTROL_ZOOM_RATIO to a value less than 1 (which auto switches to the wide angle). Same within the Pixel 6 system camera, even in the viewfinder, not just a captured image.

My Samsung S10 and S20 do not do this by default though with camera2 API. I’ve tried CaptureRequest.DISTORTION_CORRECTION_MODE, but seems that it’s not supported. Is there another way for us to un-distort the image like the native Samsung Camera app is doing, using camera2? Generally speaking, are there any Samsung phones that support DISTORTION_CORRECTION_MODE for wide angle cameras?

1 Like

Is this scenario reproduces always when you try to access Camera ID=2 or only in some specific use cases?