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

Add an API for camera access #2279

Closed
freakboy3742 opened this issue Dec 12, 2023 · 0 comments · Fixed by #2266
Closed

Add an API for camera access #2279

freakboy3742 opened this issue Dec 12, 2023 · 0 comments · Fixed by #2266
Labels
enhancement New features, or improvements to existing features.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

Most laptops and phones have one or more cameras attached. Toga should have a mechanism to capture still images and videos from those devices.

Describe the solution you'd like

Something like the following API should be possible:

if myapp.camera.has_permission:
    image = myapp.camera.take_photo()

Describe alternatives you've considered

Use an existing camera library, rather than writing a new one.

Unfortunately, the state of the art isn't very promising for re-use:

  • OpenCV convolve "camera access" with "performing analysis and transformation of the image". It also has its own windowing/UI layer, which would need to be integrated with Toga; and it has dependencies on scikit and numpy, which is a heavyweight requirement for a simple "just take a photo" app.
  • SimpleCV is a lightweight wrapper around CV2, but has many of the same problems.
  • Kivy has APIs for camera access, but they're tightly integrated into the Kivy
  • GStreamer might be usable as a base implementation on GTK, but won't be easily usable on other platforms.
  • PiCamera is specific to Raspberry Pi camera hardware
  • webcam is a wrapper around cv2
  • Pygame provides a camera API (with multiple backends), but it's not usable as a standalone package. The builtin backends might be useful as inspiration for Windows/Linux camera handling.

Additional context

There's also the issue of permissions to consider, which will likely need changes to Briefcase (see beeware/briefcase#547).

@freakboy3742 freakboy3742 added the enhancement New features, or improvements to existing features. label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant