raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
891 stars 188 forks source link

[HOW-TO] Is there any possibility to use the IMX178M sensor together with picamera2 ? #725

Open felixwanitschke opened 1 year ago

felixwanitschke commented 1 year ago

Hello, I am currently using the Raspberry Pi HQ-camera with a Rasperry Pi 4b and picamera2, which works really nice.

I wanted to compare the HQ camera to another sensor, the IMX178M (from veye; https://www.veye.cc/en/product/mv-mipi-imx178m/). Just plug and play did not work for that camera module and while reading the instructions from veye (https://wiki.veye.cc/index.php/Raspberry_Pi_Application_Note_Index), I read about V4L2....

Seemingly there should be some compatibility between libcamera (which is the basis of picamera2 ???) and V4L2 --> https://libcamera.org/docs.html

So: Is there any possibility to use the IMX178M sensor together with picamera2 ?

davidplowman commented 1 year ago

Hi, the main requirement is an open source Linux driver for this sensor. If the vendor can supply one then it should be possible to make it work. A number of 3rd parties have successfully added support for the own sensors to the Raspberry Pi.

felixwanitschke commented 1 year ago

Hello, thanks for the quick response.

Is it something like this: https://github.com/veyeimaging/raspberrypi_v4l2

If so, what are the steps I have to do, to make it work?

  1. install the driver as described in the repository ....?

Should it then already work or are the further steps to do. Excuse my incompetence...

Regards Felix

davidplowman commented 1 year ago

Well, that might be a start but there's quite a lot going on here.

You need a driver that exports raw Bayer sensor modes, which is what the Pi expects. There's quite a lot of code there so it's hard to know if it's doing that. libcamera has a certain minimum standard that a driver has to reach (there are quite a few incomplete drivers out there), so that would have to be checked.

Finally, a few helper functions would need adding to libcamera for this specific camera that convert the camera's exposure/gain registers to standard values, plus finally a camera tuning.