Published by thomsal on
- May 6, 2020 at 9:52 am #22310
Not sure if this is the place to post this since i don’t know if its a hardware or code issue but I figured I’d give it a go since I’m pretty lost.
I’m messing around with the autofocus.py code using B0121 camera and have successfully ran it and captured focused images. But now I’m trying to tweak the autofocus.py code such that it refocuses periodically whenever image clarity is reduced by X amount of frame. I thought this would be done by replacing the break in line 70 of the original autofocus.py code. But the camera won’t refocus after the initial autofocus.
Any insight or tips for this?
- May 6, 2020 at 5:53 pm #22314
The current focusing scheme is implemented by software, and the speed of repeated refocusing will be very slow.
- May 19, 2020 at 11:21 am #22824
Thanks for the reply. So can it speed up through software? or is the speed limited?
- May 20, 2020 at 3:13 am #22859
Because the speed of software image processing is relatively slow, it has a lot to do with CPU performance.
- May 21, 2020 at 5:33 pm #22922
Thanks for the reply!
Follow up questions which may be related;
I keep running into the issue where the camera cuts out after the initial autofocus and image capture. I have to manually unplug the camera to regain control and manually stop the script.
here is my setup:
the HDMI cables are needed for the end product
I’m not too sure what’s causing this issue but it’s only when I use the focusing functional. It doesn’t cut out when I do multiple image capture without it.
- May 21, 2020 at 6:34 pm #22937
Due to the sensor and the focus motor share the same i2c bus, which will exist occupied.
I advise you disable the camera’s auto exposure and auto awb functions and retry.
- May 22, 2020 at 5:12 am #22994
I tried this but I am still getting the same issue. I’m able to refocus at a set time period but when i add in the camera capture into the code if causes the freeze up/display cut out. Is there a way to reset the camera after taking the image?
- May 23, 2020 at 6:18 am #23005
Due to the the sensor’s driver is on GPU instead of CPU, so we can’t change the driver directly.
So, at present, we can’t reset the camera. I’ll discuss it with my team and see what the solution is.
- May 24, 2020 at 12:23 pm #23031
Is it possible to have the autofocus run over the CSI to HDMI Cable Extension and hdmi cable? Right now I just have the sda/scl on the camera connected directly to the raspberry pi but that won’t be possible in the end product i’m working on. Can I solder wires from the csi extension module to camara on one end and then do the same on the other csi module to the Pi? If so, would I just do pin A on the CSI module to SDA and B to SCL? And then pin a and b on the other csi module to the pi?
- May 24, 2020 at 6:15 pm #23040
Of course, In fact On the CSI to HDMI cable extension board, There is a i2c0 interface and which can driver the sensor and the motor, You can remove the i2c1 connect line. Just use the i2c0. Using this demo https://github.com/ArduCAM/RaspberryPi/blob/master/Motorized_Focus_Camera/Autofocus.py
Notice you should enable the i2c0 using https://github.com/ArduCAM/RaspberryPi/blob/master/Motorized_Focus_Camera/enable_i2c_vc.sh
Maybe using the same i2c0 can avoid your previous problems. You can try it.
Let me know if you need more help.
- May 25, 2020 at 7:39 am #23062
How exactly would i wire the module to the camera and the other module to the pi board? Which spots on the adapter board do I use for this?
- May 26, 2020 at 3:45 am #23085
Hello, Just need to connect the CSI cable to the camera CSI interface following here https://github.com/ArduCAM/RaspberryPi/blob/master/README.md
- May 28, 2020 at 1:25 pm #23209
Thank you for the reply. So no additional connections are needed from the camera or csi/hdmi extension to the pi (3b+) other than the csi connections ribbon to run the autofocus?
- May 28, 2020 at 6:02 pm #23223
Yes, In fact, the focus motor and the sensor use the same i2c bus.
- You must be logged in to reply to this topic.