Open tutoduino opened 2 months ago
Hi, thanks for the report.
It's worth saying that the lens position is always somewhat approximate because there is variation between different modules. However, in this case it seems to be behaving in a significantly different manner from what we expect. By any chance, do you have any other modules to compare this one against?
It does seem to me like something is significantly wrong here, and you may have a faulty module which would need to be returned to the place where you bought it.
@njhollinghurst Anything else to add, do you think?
There is some variation, but this is well outside the expected range and should have been caught by factory test. Unfortunately this does suggest the camera may have been damaged during handling or shipping, and should be raised with the vendor.
If the camera otherwise works well and you want to keep it, it may be possible to edit the camera tuning file.
Other things to check: Do you have any other optics (lenses, mirrors, etc)? Is the camera tilted vertically upwards?
Thanks for your reply. No other optics. The camera is tilted 45°.
Tilting the camera will generally make a difference, though it's hard to say how much. Does it behave better when it's not tilted?
Tilting the camera seems to have an impact, but quite difficult to measure with my test conditions... Any official input from Raspberry would help.
The effect is intrinsic to the camera. But if it's permanently mounted in that orientation, it can be calibrated for.
Take a copy of the file /usr/share/libcamera/ipa/rpi/vc4/imx708_wide.json
and find the "map":
line which is near the bottom.
Edit it to something this (to increase focus by 4.0):
"map": [ 0.0, 475, 33.0, 950 ]
Test the modification using:
tuning = Picamera2.load_tuning_file("imx708_wide.json", dir=".")
picam2 = Picamera2(tuning=tuning)
If you're happy with it, you can put it back into the default directory.
Alternatively, you could edit "tuning" programmatically in Python:
tuning = Picamera2.load_tuning_file("imx708_wide.json")
Picamera2.find_tuning_algo(tuning, 'rpi.af')['map']=[0.0, 475, 33.0, 950]
picam2 = Picamera2(tuning=tuning)
The manual focus is not "Infinity" when LensPosition is set to 0.0. With LensPosition between 0 and 3, the horizon is blurred, it is clear when LensPosition = 4
My hardware is : Raspberry Pi Zero 2 W + Raspberry camera v3 (wide 120°)
Here is the test program: