A few days before launching the Raspberry Pi Camera Module 3 with HDR and autofocus, Raspberry Pi Trading asked me whether I would be interested in reviewing the new modules, and sent me three samples: the standard module, the Raspberry Pi Camera Module 3 Wide, as well as the NoIR version that lacks an IR filter and is better suited for night shots.
It took a full week for DHL to send the package to my house, but I’ve now had time to review the new Raspberry Pi Camera Module 3, mostly with libcamera, but also Picamera2, focusing on the new features such as HDR, autofocus, and wide angle. I also had a quick try at the Raspberry Pi Camera Module 3 NoIR but without IR lights.
Regular readers know I had already made some DIY camera mounts using empty gum bottles, and I just replaced the Lotte XYLITOL stickers with some CNXSoft stickers for this review.
Getting started with Raspberry Pi Camera Module 3
The first time I used the camera I had some unnecessary problems because a web search sent me to outdated documentation on Raspberry Pi dot org where you are told to enable the camera in the settings and raspi-config. The place where you need to go to for the latest documentation is Raspberry Pi dot com. I still had issues because I downloaded Raspberry Pi OS last month, and when I used libcamera-hello application to check whether the camera was detected it would just report “no camera is available”. I just had to update my image with apt, and all good.
The good news is that the Raspberry Pi camera module 3 works out of the box without any configuration. Just make sure your install the latest Raspberry Pi OS or upgrade your installation, and make sure you use the correct documentation and you are good to go.
All my three modules could be detected properly as follows:
- Raspberry Pi Camera Module 3:
1234567$ libcamera-hello --list-cameraAvailable cameras-----------------0 : imx708 [4608x2592] (/base/soc/i2c0mux/i2c@1/imx708@1a)Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (0, 0)/4608x2592 crop]2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]4608x2592 [14.35 fps - (0, 0)/4608x2592 crop] - Raspberry Pi Camera Module 3 Wide:
1234567pi@raspberrypi:~ $ libcamera-hello --list-cameraAvailable cameras-----------------0 : imx708_wide [4608x2592] (/base/soc/i2c0mux/i2c@1/imx708@1a)Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (0, 0)/4608x2592 crop]2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]4608x2592 [14.35 fps - (0, 0)/4608x2592 crop] - Raspberry Pi Camera Module 3 NoIR:
1234567pi@raspberrypi:~ $ libcamera-hello --list-cameraAvailable cameras-----------------0 : imx708_noir [4608x2592] (/base/soc/i2c0mux/i2c@1/imx708@1a)Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (0, 0)/4608x2592 crop]2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]
Each has a different signature, so if you’re writing an application that needs to detect the camera variants that should not be a problem.
I already reported that when playing with the gum bottle mount, I had troubles with the Camera Module 3 Wide after a while as the system would return errors or show the camera is not available. I initially tried to check the FPC cable connection, but no luck, and I thought I had somehow damaged the module. But I eventually found on the camera was slightly dislodged from the connector (I took it out for the photo).
Once I inserted it and press on it again, the Wide camera module worked as expected.
HDR and autofocus testing with libcamera
Let’s take some photo samples with libcamera starting with a non-HDR photo with the standard module:
1 |
libcamera-jpeg --rotation 180 --hdr 0 -o rpi-cm3-no-hdr.jpg |
Note I have to rotate the image by 180 degrees because of the way the module is mounted. You can click on the photos to see the original size (but converted to WebP for most people)
Let’s now do that with HDR:
1 |
libcamera-jpeg --rotation 180 --hdr 1 -o rpi-cm3-hdr.jpg |
I took the photo a few hours before sunset and the difference is not dramatic, but we can better the left side of the background in the HDR photos. We do lose resolution with HDR, as while the first photo has a 4608 x 2592 resolution, the HDR one is 2304 x 2196.
The Camera Module 3 (and the NoIR) can focus from 10 cm to infinity, and I move a subject close to the camera. I looked clear on the small HDMI screen I used, but it was about 9cm from the lens so the logo is a little blurry. We can see the background is blurry because of the focus.
I also used libcamera-vid to test autofocus while shooting a video. That’s with HDR enabled.
It works reasonably fast in well-light environments even with HDR enabled. Autofocus feels a bit faster without HDR.
Let’s now switch the Raspberry Pi Camera Module 3 Wide placed in about the same position as the first module.
We have a greater field of view and in this particular scene the HDR comes to life as we can see some of the details under the roof of the gazebo.
I place the Linux Tux/CNXSoft logo in the same position as previously (~9cm from the lens) and we can see more of the bottle with the greater field of view, and it’s clearer since the Wide camera module can focus from 5cm to infinity.
Autofocus is working relatively well in the video below.
But I’d like to note something interesting which happens with both the standard and wide camera modules. In video mode, the field of view is greater when enabling HDR, while the captured zone is much smaller when HDR is disabled.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
pi@raspberrypi:~ $ libcamera-vid --rotation 180 --hdr 1 -o rpi-cm3-wide-auto-focus-hdr-tux.h264 -t 20000 Made X/EGL preview window [0:02:40.658604215] [1449] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+55-5df5b72c [0:02:40.797061097] [1450] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media4 and ISP device /dev/media2 [0:02:40.797718687] [1449] INFO Camera camera.cpp:1026 configuring streams: (0) 640x480-YUV420 [0:02:40.797961668] [1450] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 2304x1296-SRGGB10_1X10 - Selected unicam format: 2304x1296-pRAA Halting: reached timeout of 20000 milliseconds. pi@raspberrypi:~ $ libcamera-vid --rotation 180 --hdr 0 -o rpi-cm3-wide-auto-focus-no-hdr-tux.h264 -t 20000 Made X/EGL preview window [0:03:19.498184280] [1458] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+55-5df5b72c [0:03:19.637463889] [1459] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media4 and ISP device /dev/media2 [0:03:19.638200351] [1458] INFO Camera camera.cpp:1026 configuring streams: (0) 640x480-YUV420 [0:03:19.638514628] [1459] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 1536x864-SRGGB10_1X10 - Selected unicam format: 1536x864-pRAA Halting: reached timeout of 20000 milliseconds. |
That’s probably because the resolution is set to 2304×1296 with HDR, and 1536×864 without HDR. I tried to force the resolution to 4608×2592 or 2304×1296 in non-HDR mode:
1 2 3 4 5 6 7 |
pi@raspberrypi:~ $ libcamera-vid --rotation 180 --hdr 0 -o rpi-cm3-wide-auto-focus-no-hdr-tuxk-.h264 -t 20000 --width 4608 --height 2592 Made X/EGL preview window [0:06:48.468537458] [1497] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+55-5df5b72c [0:06:48.605601452] [1498] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media4 and ISP device /dev/media2 [0:06:48.606294581] [1497] INFO Camera camera.cpp:1026 configuring streams: (0) 4608x2592-YUV420 [0:06:48.606555655] [1498] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx708@1a - Selected sensor format: 4608x2592-SRGGB10_1X10 - Selected unicam format: 4608x2592-pRAA ERROR: *** failed to start output streaming *** |
The videos themselves are recorded at 640×480 resolution:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
pi@raspberrypi:~ $ mediainfo rpi-cm3-wide-auto-focus-hdr-tux.h264 General Complete name : rpi-cm3-wide-auto-focus-hdr-tux.h264 Format : AVC Format/Info : Advanced Video Codec File size : 4.41 MiB Overall bit rate mode : Constant Video Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 1 frame Format settings, GOP : M=1, N=60 Bit rate mode : Constant Bit rate : 10 000 kb/s Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate : 30.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 1.085 pi@raspberrypi:~ $ mediainfo rpi-cm3-wide-auto-focus-no-hdr-tux.h264 General Complete name : rpi-cm3-wide-auto-focus-no-hdr-tux.h264 Format : AVC Format/Info : Advanced Video Codec File size : 5.57 MiB Overall bit rate mode : Constant Video Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 1 frame Format settings, GOP : M=1, N=60 Bit rate mode : Constant Bit rate : 10 000 kb/s Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate : 30.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 1.085 |
The NoIR camera module should shine in dark scenes and at night, preferably with IR lights. I just tried it a night with a light on.
I was expecting some pinkish image, so I felt like something was wrong. Switching to the standard camera module does not actually make much difference for this specific scene.
I also tried the NoIR camera during the day to make sure the camera output was different, and indeed it is, with washed-out and pink colors as expected, although not quite as pronounced as samples from the NoiR v2 camera.
I also tried autofocus in HDR mode with the NoIR camera module at night, and it did not work very well, as in not at all.
I also had this issue during day time from time to time, and it depends on the scene and lighting conditions as well. I actually have similar issues with my DSLR camera, but I can always tap the display or switch to manual focus. It should also be possible to do so with the Camera Module 3, but it would require a touchscreen display, a rotary encoder, and implement the software to support those features.
Camera Module 3 and Picamera2
Finally, I gave a try at the Picamera2 Python camera library that was officially released last September. It relies on libcamera, so I only used it with the standard camera module to make sure the new features were properly implemented.
I used the Qt Picamera2 app, after getting it as follows
1 2 |
git clone https://github.com/raspberrypi/picamera2 python3 picamera2/apps/app_full.py |
It started and I could see the camera output for both the Still Capture…
and Video tabs.
The preview window is quite small because I’m using a 1280 x 800 HDMI display, and it would look much better on a Full HD display. You’ll also notice the message “HDR unavailable: install opencv to try it”.
Picamera2 is a Python library so so I tried to install Python OpenCV with pip:
1 2 |
pip install --upgrade pip setuptools wheel pip install opencv-python |
The last command took around 1h30 to complete, and it failed due to a missing file:
1 2 3 4 5 6 7 |
FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for opencv-python Failed to build opencv-python ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects |
I ended up spending four hours on this only to find out I should use apt instead:
1 |
sudo apt install python3-opencv |
It took around 2 to 3 minutes to install, and the HDR options are now showing up with the ability to select the number of HDR frames and gamma setting.
The app has plenty of other options with image tuning, pan/zoom, AEC/AWB, and I also notice I could adjust the focus manually by moving a slider. But when I clicked on the “Take photo” button, my Raspberry Pi 4 froze for several long seconds (Numlock would not turn on/off), and eventually, the Qt Picamera2 app crashed. I went to check out the kernel to find out the system had run out of memory:
1 2 |
[ 362.162878] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=python3,pid=1401,uid=1000 [ 362.162950] Out of memory: Killed process 1401 (python3) total-vm:1328976kB, anon-rss:662432kB, file-rss:0kB, shmem-rss:396kB, UID:1000 pgtables:2176kB oom_score_adj:0 |
So besides using a Full HD display, it might be better to run the Qt app on a board with more RAM, as I’m using a Raspberry Pi 4 SBC with 1GB RAM only. I had no such problem with the command line utilities based on libcamera.
I’d like to thank Raspberry Pi Trading for sending the Camera Module 3 for review. The standard versions sell for $25, and the wide-angle modules go for $35. You’ll find them at the usual Raspberry Pi distributors.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Very through.
Not bad for the money but they need to work on stock and price gouging far more than releasing new products at this time. Not saying stop developing them however.
I wish they had a model with a switchable IR-filter instead of just models with a permant one or no filter at all. Makes them far less useful.
Nobody keeps you from putting a filter wheel in front of a filterless camera. In fact, that is what many astrophotographers do.
Yes, but having it integrated would make for a much cleaner and possibly reliable product.
Looks quite decent. However at high resolution the JPEG compression artefacts are clearly visible on the concrete wall which looks too smoothed, and on the red helmet of the LEGO character. I used to have a low-quality digital camera based off a sensor and processor made exclusively for MJPEG, which was emitting photos with a number of simplifications which looked a bit like these (albeit at a much lower resolution). Capturing tiles on a roof was really cool, it would look like an aquarelle drawing 😉
I forgot to include the original photos: https://mega.nz/folder/PhwBkLRB#uhP4dkoXs4zrYeJdT3CA1A
My CDN reprocesses the images into WebP for smaller sizes and faster loading times.
Both JPEG and WebP images look similar to me, but maybe some people would notice some differences.
Thanks. So it might instead be that the camera is configured to strengthen sharpening. The concrete cylinder in the background should be blurred everywhere, but some areas such as the edge of the hat, are extremely sharp while other areas on the same device are almost flat.
Let the hunt begin for a Camera Module 3. I am surprised to see the regular version is available in Romania already (non-wide and without NoIR). I would love to see how a Pi Zero 2 W handles the new module.
As for the OOM issues… have you tried to fix Raspberry Pi OS in this area (ZRAM to the rescue)?
I never had any luck making proper night vision shots using either esp32 or RPi no-ir cams. Images looked so bad compared to commercial webcams,
So I ended up disassembling 20eur webcams instead of using these diy cams..
not sure I like move libcamera and away from MMAL. What the point of having a GPU if it is not used for much?
libcamera still uses the ISP. It’s just that now instead of being run on the GPU with closed source software, which you can’t change or adapt, it all runs entirely open source.
What about frame rates? I haven’t been able to find frame rates in any documentation for the module or for the sensor.
The advertised frame rates can be seen in libcamera-hello output:
But the actual ones should be lower than that especially in low-light environments.
Did you have to make any changes to get autofocus to work? I´m using libcamera-vid and have tried all the parameter I can think of (ens-position, autofocus-range etc.) but it just doesnt work.
No matter what I do, i just can´t get a sharp image but just a blurry mess at arount 25cm where my target is at. Running it on a Raspberry Pi 3B+ if that matters.
No, I did not change anything. It’s automatic. Which model do you have? It should not matter though as they have either a 5 or 10cm to infinity focus range, so at 25cm it should not matter.
Autofocus is harder to achieve with HDR and/or low-light conditions.
I have the regular module3, not the IR or anything. I´m running without an extra lens but that shouldn´t be necessary either if I´m correct? Right now I´m leaning more towards a faulty unit to be honest.
Try to move the target around to see if auto focus works. If not maybe you have faulty unit. You’ll get a better chance getting an answer that solve your issue on Raspberry Pi forums.
Thanks, will reach out to them and see what happens, but I have contacted the reseller as well 🙂