Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control PTZ and Focus Natively #41

Open
whittenator opened this issue Sep 27, 2023 · 4 comments
Open

Control PTZ and Focus Natively #41

whittenator opened this issue Sep 27, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@whittenator
Copy link

Describe the feature

This feature(OpticsSDK) would give low-level access to controlling/listening to PTZ(Pan, Tilt, Zoom) and Focus of Cameras. We actively use 4 Axis Q6215-LE to look at objects in the sky and the embedded contrast-based autofocus doesn't do a very good job at focusing on such objects due to low contrast/noise. Thus, we would like to implement our own enhanced auto-focus plugin using the Native SDK. We have attempted to do this but the Native SDK doesn't expose mechanisms to change the focus or listen to the focus. Thus, we opted to use the VAPIX API to do an HTTP call to set the focus and poll the focus. However, we found that setting the focus and polling until the focus changed to the desired focus is too slow to implement a contrast enhanced auto-focus plugin.

@whittenator whittenator added the enhancement New feature or request label Sep 27, 2023
@pataxis
Copy link
Contributor

pataxis commented Sep 28, 2023

Hi @whittenator , thank you for your feature request!

Today there is no PTZ API in ACAP Native SDK and the one found in ACAP 3 SDK, axptz, will most likely not be migrated.

It's really good to have your use case and I will forward it as input to future APIs.

@whittenator
Copy link
Author

Thanks for the info! Does the ACAP3 axptz allow you to control or listen to focus?

@pataxis
Copy link
Contributor

pataxis commented Oct 11, 2023

It's handling pan-tilt-zoom operations and in that sense it could control focus by adjusting zoom.

I can mention that in the latest AXIS OS it's possible to call VAPIX from an ACAP application.

I think you posted in another thread that there might be latency problems calling VAPIX, but maybe that was from handling it from a server?

@whittenator
Copy link
Author

@pataxis Yeah, we are using the VAPIX API to adjust focus on the Axis Q6215-LE in a Native SDK plugin we developed but we are noticing that it takes ~500-700ms for the focus to settle "close" to the value we are sending it. Our recursive algorithm is similar to this:

  1. void setFocus(int focus)
  2. bool pollForFocusUntilSetteled()
  3. contrastEnhance(cv::Mat Img)
  4. measureSharpness(cv::Mat Img)
    Repeat until sharpness is at the optimal value.

In step 2, we have timed it multiple times with various sleeps() between polls and it still takes ~500-700ms to settle on the focus value we have set. With such a delay, it makes our autofocus algorithm really slow as we are missing a lot of frames in those 500-700ms. Not sure if this is how long it takes the PTZ camera's focus feedback system to really achieve the value or if the VAPIX is delayed?

It would be fantastic if the images themselves had metadata of the zoom/focus they were captured at. Is there a possibility to enable this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants