ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() 해결법

파이썬에서 이미지나 리스트 등 array 형태의 무언가를 다루다 보면 다음과 같은 에러가 발생합니다. ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() 에러의 뜻은 말 그대로 "하나 이상의 원소를 가진 array의 참값은 판정하기 모호하니까, 하나의 값으로 줘라~" 이겁니다. 예시를 들자면 다음과 같습니다. 어떤 이미지가 다른 이미지와 같다는 조건문을 넣고 싶을 때, img1 = cv2.imread("car.png") img2 = cv2.imread("car.png") if img1 == img2: print("같은 그림") -------------------------..