解决error: -215:Assertion failed !_src.empty in function 'cv::cvtColor'
problem lies in
In the OpenCV environment, when running the code, it appears:
error: -215:Assertion failed !_src.empty in function 'cv::cvtColor'
The reason is: No object resource in cv::cvtColor
solve
Locate the line where the code problem is located, and find that imgRGB is not passed in the image. The incoming image
of my code is passed in from the camera. Continue to locate the cap here, and change 1 to 0
( the built-in camera of the notebook is 0, and the USB external camera is 0). is 1 )
Summarize
The idea of solving the same error is also different. The essence of this error is that the cv2 resource is empty . I am here to define the problem of the camera, and the corresponding can have path pictures, video problems, etc.