I was trying to make an ArUco detection app using opencv in Streamlit [Link]. However, the camera was not detected after deploying, although it worked perfectly fine in localhost.
The following error appeared:
[ WARN:0@0.089] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video0): can't open camera by index
[ERROR:0@0.090] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range
The code I used was:
@st.cache_resource
def init_camera():
return cv.VideoCapture(0)
cap = init_camera()
and can be found at GitHub - benab04/ArUco-Detection, along with the requirements.txt file in the streamlit_app folder.
I have used Windows 11 to code the entire app, not Ubuntu or Linux