I am reading a video here:
VideoCap = cv2.VideoCapture("E:\Omar's Stuff\College related\Forth Year\Project\Kalman Filter
code\video_randomball.avi")
ret, frame = VideoCap.read()
and sending the frames to a detect function here:
# Detect object
centers = detect(frame,debugMode)
trying to convert here:
def detect(frame,debugMode): # Convert frame from BGR to GRAY #frame = frame.astype('uint8') gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
and getting this error:
OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struct cv::Set<3,4,-1>,struct cv::Set<1,-1,-1>,struct cv::Set<0,2,5>,2>::CvtHelper'
how to fix it?