cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function ‘cvtColor’

We Are Going To Discuss About cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function ‘cvtColor’. So lets Start this Python Article.

cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function ‘cvtColor’

  1. How to solve cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function 'cvtColor'

    You could try loading the image with cv2.imread() rather than the np.array() to see if that works since the examples use this method:
    img = cv2.imread(imagePath) gray = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

  2. cv2.error: OpenCV(4.5.2) 👎 error: (-5:Bad argument) in function 'cvtColor'

    You could try loading the image with cv2.imread() rather than the np.array() to see if that works since the examples use this method:
    img = cv2.imread(imagePath) gray = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

Solution 1

You could try loading the image with cv2.imread() rather than the np.array() to see if that works since the examples use this method:

img = cv2.imread(imagePath)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

Original Author Anders Elmgren Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment