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

The camera permission authorization window cannot pop up on macOS #858

Open
cavivie opened this issue Dec 22, 2024 · 3 comments
Open

The camera permission authorization window cannot pop up on macOS #858

cavivie opened this issue Dec 22, 2024 · 3 comments

Comments

@cavivie
Copy link

cavivie commented Dec 22, 2024

I'm trying a simple opencv demo of reading the camera on macOS Sequoia 15.1. Strangely, it doesn't pop up any authorization windows. I confirmed that I can pop up the authorization window in other terminals (built-in terminal/warp/iterm2). Even though I reset the camera service with tccutil it didn't help (tccutil reset Camera).

I'm using rioterm 0.2.1 (also 0.2.2) from homebrew, macOS version is Sequoia 15.1, .

import numpy as np
import cv2 as cv

cap = cv.VideoCapture(0)
if not cap.isOpened():
    print("Cannot open camera")
    exit()
while True:
    # Capture frame-by-frame
    ret, frame = cap.read()

    # if frame is read correctly ret is True
    if not ret:
        print("Can't receive frame (stream end?). Exiting ...")
        break
    # Our operations on the frame come here
    gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    # Display the resulting frame
    cv.imshow('frame', gray)
    if cv.waitKey(1) == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv.destroyAllWindows()

To run this example you need to pip install opencv-python and numpy libraries.

@cavivie
Copy link
Author

cavivie commented Dec 22, 2024

As a supplement, I tested accessing special folders such as Desktop/Documents/Downloads on macOS (these folders require authorization), and rio was able to issue authorization normally.
Screenshot 2024-12-22 at 19 44 45

@raphamorim
Copy link
Owner

Hey @cavivie thanks for the issue!

Hmmm, very interesting. It's a bit weird because Rio does request camera access

<key>NSCameraUsageDescription</key>
<string>An application in Rio would like to access the camera.</string>
i wonder if there's anything missing

@cavivie
Copy link
Author

cavivie commented Dec 23, 2024

Ah, yes, at first I thought Rio won't request the camera permission, but now it seems that this may require further debugging. I want to know if you can reproduce it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants