Description
Problem or Possibility
Currently OpenCV is installed with the core of the SDK, but it appears to only be used by ImageFunctions.convert
Removing this dependency from the core would help to reduce install footprint for core functionality.
It is used in pitop.processing
and pitop.camera
, but - most importantly - it does the heavy lifting of the miniscreen's display_image
function.
Proposed Solution
An OpenCV image is unlikely to be passed in without the cv2
dependency being installed, so it shouldn't even be necessary to invoke the convert
function anyway.
Perhaps the display_image
function could try to convert if the image format is PIL and raises an exception if it's an OpenCV image without the dependency installed?
Alternative Solutions
According to this, this operation should also work:
x = x[...,::-1].copy()
However, this does not have OpenCV's speed benefit. Perhaps this can be used as a fallback option if OpenCV is not available?