hikvision kamera kullanıyorum. İp ayarlarını bu şekilde yazıyorum.
# Kamera Açılması
# rtsp://<admin>:<pass>@ip:port/cam/realmonitor?channel=1&subtype=1
ip='rtsp://admin:@10.29.214.10:221'
cap = cv2.VideoCapture(ip)
try:
print(cap.shape)
except AttributeError:
print('AttributeError: value is', cap)daha sonra bana verdiği hata :
AttributeError: value is < cv2.VideoCapture 0000029F50112CD0>
Traceback (most recent call last):
File "C:\Users\tuna_\OneDrive\Masaüstü\Python-Yuz-Tanima-ve-Yoklama-Sistemi-main\opensavc\yoklama.py", line 112, in <module>
face_locations, face_names = sfr.detect_known_faces(frame)
File "C:\Users\tuna_\OneDrive\Masaüstü\Python-Yuz-Tanima-ve-Yoklama-Sistemi-main\opensavc\simple_facerec.py", line 40, in detect_known_faces
small_frame = cv2.resize(frame, (0, 0), fx=self.frame_resizing, fy=self.frame_resizing)
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4062: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'bu ip kameraya nasıl bağlanabilirim?
EDİT: SORUN ÇÖZÜLDÜ. İP YÖNLENDİRMESİNİ YANLIŞ YAPIYORMUŞUM.
CEVAP:
ip='rtsp://admin:@10.29.214.10/index.html?port=221'
cap = cv2.VideoCapture(ip)