Camera Orientation issue: Android Pie default Camera application

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Camera Orientation issue: Android Pie default Camera application

Devendra Devadiga

Hi,
I am using an (Android Pie) AOSP Camera2  application. (packages/apps/Camera2)

I am working on NXP's i.MX8MMini board with Android Pie AOSP.

We are using Camera module OV5640 as back camera module. Able to preview and capture the image and video in reverse landscape mode.
But the mechanical enclosure fitting camera module rotated 90 degrees right physically.
And in camera application for preview, image is coming as 90 degree left.

Please can you help on this ? What changes I need to do in the Hardware layer?

I had posted complete issue details in this link with physical camera image sensor.

https://groups.google.com/g/android-platform/c/2XZ0zCp0pqg/m/Gm6OtE2yBgAJ

The camera sensor in the image is uased as back camera.

In init.rc file I changed below line :

device/fsl/imx8m/iwg34m_8mm/init.rc

setprop back_camera_orient 0 ==> setprop back_camera_orient 90

But still not working.

I traced where this values is parsing and got this:

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp:316:    property_get("back_camera_name", mSets[BACK_CAMERA_ID].mPropertyName, "0");

In NXP's libcamera3 layer parsing values happening but finally how it effect to camera orientation I didn't get.

Please can anyone check this and help me ?

Thanks and Regards,

Devendra




--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/b7604de1-77d9-4b0f-ae06-ff6611be6f72n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camera Orientation issue: Android Pie default Camera application

Riccardo Ierardi
Hi. I have working with basically the same configuration. Since the OV5640 has a flip logic at camera level, my suggestion is to edit the kernel driver in order to set the flip parameter at 90 (or 270, depending on the orientation) degree. If needed, it support also mirroring of the image. They should be flags on configuration registers. In this way there is no need to work at OS level or HAL level.

Il giorno venerdì 12 marzo 2021 alle 16:43:33 UTC+1 [hidden email] ha scritto:

Hi,
I am using an (Android Pie) AOSP Camera2  application. (packages/apps/Camera2)

I am working on NXP's i.MX8MMini board with Android Pie AOSP.

We are using Camera module OV5640 as back camera module. Able to preview and capture the image and video in reverse landscape mode.
But the mechanical enclosure fitting camera module rotated 90 degrees right physically.
And in camera application for preview, image is coming as 90 degree left.

Please can you help on this ? What changes I need to do in the Hardware layer?

I had posted complete issue details in this link with physical camera image sensor.

https://groups.google.com/g/android-platform/c/2XZ0zCp0pqg/m/Gm6OtE2yBgAJ

The camera sensor in the image is uased as back camera.

In init.rc file I changed below line :

device/fsl/imx8m/iwg34m_8mm/init.rc

setprop back_camera_orient 0 ==> setprop back_camera_orient 90

But still not working.

I traced where this values is parsing and got this:

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp:316:    property_get("back_camera_name", mSets[BACK_CAMERA_ID].mPropertyName, "0");

In NXP's libcamera3 layer parsing values happening but finally how it effect to camera orientation I didn't get.

Please can anyone check this and help me ?

Thanks and Regards,

Devendra




--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/98dd3c24-f29a-4296-ba68-560def5c33ban%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camera Orientation issue: Android Pie default Camera application

Devendra Devadiga
Hi,
Thank you for your reply.
I tried to change the "mirror and flip" registers in driver level previously. But OV5640 only supports 180 degrees flip and with register combination I am able to flip to 180 degrees.
90 degrees and 270 degrees I didn't able to rotate with any combination of "mirror and flip" register values. I checked in datasheet of ov5640 and got the information like it will support only 180 degrees rotation. I had attached the image.
imgpsh_fullsize_anim.png

If you are able to configure  for 90 degrees or 270 degrees, please can you share those register combinations ?

Thanks and Regards,
Devendra

On Thursday, March 18, 2021 at 4:41:16 AM UTC+5:30 [hidden email] wrote:
Hi. I have working with basically the same configuration. Since the OV5640 has a flip logic at camera level, my suggestion is to edit the kernel driver in order to set the flip parameter at 90 (or 270, depending on the orientation) degree. If needed, it support also mirroring of the image. They should be flags on configuration registers. In this way there is no need to work at OS level or HAL level.

Il giorno venerdì 12 marzo 2021 alle 16:43:33 UTC+1 [hidden email] ha scritto:

Hi,
I am using an (Android Pie) AOSP Camera2  application. (packages/apps/Camera2)

I am working on NXP's i.MX8MMini board with Android Pie AOSP.

We are using Camera module OV5640 as back camera module. Able to preview and capture the image and video in reverse landscape mode.
But the mechanical enclosure fitting camera module rotated 90 degrees right physically.
And in camera application for preview, image is coming as 90 degree left.

Please can you help on this ? What changes I need to do in the Hardware layer?

I had posted complete issue details in this link with physical camera image sensor.

https://groups.google.com/g/android-platform/c/2XZ0zCp0pqg/m/Gm6OtE2yBgAJ

The camera sensor in the image is uased as back camera.

In init.rc file I changed below line :

device/fsl/imx8m/iwg34m_8mm/init.rc

setprop back_camera_orient 0 ==> setprop back_camera_orient 90

But still not working.

I traced where this values is parsing and got this:

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp:316:    property_get("back_camera_name", mSets[BACK_CAMERA_ID].mPropertyName, "0");

In NXP's libcamera3 layer parsing values happening but finally how it effect to camera orientation I didn't get.

Please can anyone check this and help me ?

Thanks and Regards,

Devendra




--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/983acfbb-e35d-47bf-ab7d-18c01211ea04n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Camera Orientation issue: Android Pie default Camera application

aung ko win

On Thu, Mar 18, 2021, 10:45 PM Devendra Devadiga <[hidden email]> wrote:
Hi,
Thank you for your reply.
I tried to change the "mirror and flip" registers in driver level previously. But OV5640 only supports 180 degrees flip and with register combination I am able to flip to 180 degrees.
90 degrees and 270 degrees I didn't able to rotate with any combination of "mirror and flip" register values. I checked in datasheet of ov5640 and got the information like it will support only 180 degrees rotation. I had attached the image.
imgpsh_fullsize_anim.png

If you are able to configure  for 90 degrees or 270 degrees, please can you share those register combinations ?

Thanks and Regards,
Devendra

On Thursday, March 18, 2021 at 4:41:16 AM UTC+5:30 [hidden email] wrote:
Hi. I have working with basically the same configuration. Since the OV5640 has a flip logic at camera level, my suggestion is to edit the kernel driver in order to set the flip parameter at 90 (or 270, depending on the orientation) degree. If needed, it support also mirroring of the image. They should be flags on configuration registers. In this way there is no need to work at OS level or HAL level.

Il giorno venerdì 12 marzo 2021 alle 16:43:33 UTC+1 [hidden email] ha scritto:

Hi,
I am using an (Android Pie) AOSP Camera2  application. (packages/apps/Camera2)

I am working on NXP's i.MX8MMini board with Android Pie AOSP.

We are using Camera module OV5640 as back camera module. Able to preview and capture the image and video in reverse landscape mode.
But the mechanical enclosure fitting camera module rotated 90 degrees right physically.
And in camera application for preview, image is coming as 90 degree left.

Please can you help on this ? What changes I need to do in the Hardware layer?

I had posted complete issue details in this link with physical camera image sensor.

https://groups.google.com/g/android-platform/c/2XZ0zCp0pqg/m/Gm6OtE2yBgAJ

The camera sensor in the image is uased as back camera.

In init.rc file I changed below line :

device/fsl/imx8m/iwg34m_8mm/init.rc

setprop back_camera_orient 0 ==> setprop back_camera_orient 90

But still not working.

I traced where this values is parsing and got this:

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp:316:    property_get("back_camera_name", mSets[BACK_CAMERA_ID].mPropertyName, "0");

In NXP's libcamera3 layer parsing values happening but finally how it effect to camera orientation I didn't get.

Please can anyone check this and help me ?

Thanks and Regards,

Devendra




--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/983acfbb-e35d-47bf-ab7d-18c01211ea04n%40googlegroups.com.

--
--
unsubscribe: [hidden email]
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/CAERvX8K60ZUA8M9M2-JYTiF%3Dikb7CHR08u%3DfBPzJw0a2C77k_g%40mail.gmail.com.