Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hsv becomes empty in filter_blue #36

Open
SpeedrunnerG55 opened this issue Mar 13, 2020 · 0 comments
Open

hsv becomes empty in filter_blue #36

SpeedrunnerG55 opened this issue Mar 13, 2020 · 0 comments

Comments

@SpeedrunnerG55
Copy link
Collaborator

I printed hsv right before the cvtColor function call and found it is empty before I get the exception. however, it is not immediately empty. it becomes empty after a few times not being empty.

[]

Exception in thread EDAutopilot:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/speed/Desktop/EDAutopilot/dev_autopilot.py", line 1303, in autopilot
    align()
  File "/home/speed/Desktop/EDAutopilot/dev_autopilot.py", line 1048, in align
    off = get_navpoint_offset()
  File "/home/speed/Desktop/EDAutopilot/dev_autopilot.py", line 827, in get_navpoint_offset
    mask_blue = filter_blue(compass_image)
  File "/home/speed/Desktop/EDAutopilot/dev_autopilot.py", line 731, in filter_blue
    hsv = cv2.cvtColor(hsv, cv2.COLOR_BGR2HSV)
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

I don't see anything in the function that would cause it to become empty. so I don't know what is going on

jjmcdn added a commit to jjmcdn/EDAutopilot that referenced this issue May 25, 2020
…ound

get_compass_image sometimes ends up with empty data in the compass_image and the screen array following the calculation trying to locate the navigation dot.  The causes an exception in filter_blue() and results in the autopilot failing. This seems to be a result of a bad screen capture providing garbage data, so if we just try again when we notice compass_image is empty, we always end up returning valid data.

ref: skai2#36

Signed-off-by: Joe MacDonald <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant