wytech
Posts: 11
Joined: Thu May 28, 2020 8:55 pm

Correct way to focus HQ camera

Sat Jun 06, 2020 9:11 pm

Dear forum :)

I just started working with HQ camera. I basically have very less prior experience in computer vision and phtography.

And also I think my question is not raspberry pi/HQ camera specific, it should be a general question regarding manual focus. But I want to get help making it clear.

Although I now can take still pictures with raspistill (and wrote an Apache Airflow DAG to schedule periodical photo shooting and uploading to the cloud), I ask myself, what is the correct way to focus the HQ camera, since the lens is manully adjusted (until now I have only worked with auto-focusing camera like that on my smart phone).

What I have done for focusing is as following:
- I need a streaming tool to observe the image quality, for this I found picamera-streaming-demo (https://snapcraft.io/install/picamera-s ... o/raspbian). It offers a webstreaming so that I can view live stream from my HQ camera in a webbrowser.
- Then I adjust the lens manully and obeserve the image quality in webbrowser, to find the best quality via my eyes.
- My goal is to take still images of the material surface, for this I use raspistill. picamera-streaming-demo occupies the camera continuously, after having focused the camera, I just remove picamera-streaming-demo to be able to use raspistill. And every time I change the distance of the object or height of the camera, which means the shooting condition, I need to install picamera-streaming-demo again to focus the camera. It is a bit tedious, but I can live with this.

But what I am really unsure with is, is this the correct way to manully focus the camera?
How do I make sure that I have perfectly focussed the camera with my eyes, there is no blur?
Is there methods to measure or evaluate the focusing?
Also, is there another tool instead of this picamera-streaming-demo, so that I do not need always to install and remove it?

Many thanks in advance!

Best regards

User avatar
HermannSW
Posts: 3456
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Correct way to focus HQ camera

Sat Jun 06, 2020 10:58 pm

Use naushir's new "--focus" raspistill option for focusing:
viewtopic.php?f=43&t=273804
Image

Code: Select all

git clone https://github.com/raspberrypi/userland
cd userland
time ./buildme dummy
cd ..
userland/build/bin/raspistill -t 0 --focus
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/working_with_FPGAs

aBUGSworstnightmare
Posts: 2440
Joined: Tue Jun 30, 2015 1:35 pm

Re: Correct way to focus HQ camera

Sun Jun 07, 2020 7:23 am

why not speed up make process by using some more cores?

Code: Select all

time ./buildme dummy -j4

wytech
Posts: 11
Joined: Thu May 28, 2020 8:55 pm

Re: Correct way to focus HQ camera

Sun Jun 07, 2020 7:45 am

HermannSW wrote:
Sat Jun 06, 2020 10:58 pm
Use naushir's new "--focus" raspistill option for focusing:
viewtopic.php?f=43&t=273804
Image

Code: Select all

git clone https://github.com/raspberrypi/userland
cd userland
time ./buildme dummy
cd ..
userland/build/bin/raspistill -t 0 --focus
Thank you so much, I will try this

wytech
Posts: 11
Joined: Thu May 28, 2020 8:55 pm

Re: Correct way to focus HQ camera

Sun Jun 07, 2020 7:47 am

aBUGSworstnightmare wrote:
Sun Jun 07, 2020 7:23 am
why not speed up make process by using some more cores?

Code: Select all

time ./buildme dummy -j4
Thanks, but what do you mean by this?

I didn't build/compile anything, I just used the raspistill command and made a Bash script for capturing, which again triggered by Apache Airflow for automation.


====

Sorry, it is related to the last post. Thanks.

User avatar
HermannSW
Posts: 3456
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Correct way to focus HQ camera

Sun Jun 07, 2020 8:44 am

aBUGSworstnightmare wrote:
Sun Jun 07, 2020 7:23 am
why not speed up make process by using some more cores?

Code: Select all

time ./buildme dummy -j4
Because buildme does "make -j4" based on architecture from alone for my Pi4B:
https://github.com/raspberrypi/userland ... uildme#L28

Code: Select all

🍓 uname -m
armv7l
🍓 
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/working_with_FPGAs

RoboRob
Posts: 86
Joined: Tue Nov 05, 2013 8:43 pm
Location: Limmen, The Netherlands
Contact: Website Skype

Re: Correct way to focus HQ camera

Tue Jun 09, 2020 11:06 am

Is there a way to set the focus manually to a fix value so you could control the focus purely by the attached hardware (e.g. the focuser on a lens of telescope)? So effectively disable the auto focuser?

Return to “Camera board”