earthat/ROI-marking-for-traffic-surveillance-

Value Erro

Opened this issue · 1 comments

Traceback (most recent call last):
File "C:\ROI-Marking\ROI-marking-for-traffic-surveillance--master\main.py", line 178, in
cc = pipeline.run()
File "C:\ROI-Marking\ROI-marking-for-traffic-surveillance--master\pipeline.py", line 59, in run
self.context = p(self.context)
File "C:\ROI-Marking\ROI-marking-for-traffic-surveillance--master\pipeline.py", line 151, in call
context['objects'] = self.detect_vehicles(fg_mask, context)
File "C:\ROI-Marking\ROI-marking-for-traffic-surveillance--master\pipeline.py", line 122, in detect_vehicles
fg_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_TC89_L1)
ValueError: not enough values to unpack (expected 3, got 2)

i got that error when trying to run it with cv2.VideoCapture(0). any idea whats wrong?

replace im2 , contours, hierarchy = cv2.findContours( fg_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_TC89_L1)
with
contours, hierarchy = cv2.findContours( fg_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_TC89_L1)
you can check my pull request