diff --git a/coderbot/cv/image.py b/coderbot/cv/image.py index 3c602379..5e095cb0 100644 --- a/coderbot/cv/image.py +++ b/coderbot/cv/image.py @@ -36,8 +36,9 @@ class Image(): r_from = np.float32([[0, 0], [640, 0], [640, 480], [0, 480]]) r_dest = np.float32([[0, -120], [640, -120], [380, 480], [260, 480]]) - _aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_ARUCO_ORIGINAL) - _aruco_parameters = cv2.aruco.DetectorParameters_create() + _aruco_detector = cv2.aruco.ArucoDetector( + cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_ARUCO_ORIGINAL), + cv2.aruco.DetectorParameters()) _face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') @@ -254,7 +255,7 @@ def find_qr_code(self): def find_ar_code(self): gray = cv2.cvtColor(self._data, cv2.COLOR_BGR2GRAY) - corners, ids, rejectedImgPoints = cv2.aruco.detectMarkers(gray, self._aruco_dict, parameters=self._aruco_parameters) + corners, ids, rejectedImgPoints = self._aruco_detector.detectMarkers(gray) codes = [] positions = [] if ids is not None: diff --git a/docker/Dockerfile b/docker/Dockerfile index 40a5fafa..fd36371f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,8 @@ ENV QEMU_CPU=max ENV DEBIAN_FRONTEND=noninteractive RUN install_packages \ + patch \ + build-essential \ libraspberrypi0 \ procps \ sudo \ @@ -14,6 +16,7 @@ RUN install_packages \ portaudio19-dev \ python3 \ python3-pip \ + python3-dev \ libopenjp2-7-dev \ libtiff5 \ libatlas-base-dev \ @@ -46,7 +49,8 @@ RUN install_packages \ ENV READTHEDOCS=True ADD requirements.txt /tmp/. -RUN pip install --no-cache-dir -r /tmp/requirements.txt +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r /tmp/requirements.txt RUN mkdir -p /coderbot && \ mkdir -p /coderbot/data && \ diff --git a/docker/stub/Dockerfile b/docker/stub/Dockerfile index 66281565..b262df75 100644 --- a/docker/stub/Dockerfile +++ b/docker/stub/Dockerfile @@ -3,6 +3,7 @@ FROM debian:bullseye-slim ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -y && apt-get install -y \ + patch \ procps \ sudo \ wget \ @@ -39,7 +40,8 @@ RUN apt-get update -y && apt-get install -y \ tesseract-ocr-deu ADD docker/stub/requirements.txt /tmp/. -RUN pip install --no-cache-dir -r /tmp/requirements.txt +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r /tmp/requirements.txt RUN mkdir -p /coderbot && \ mkdir -p /coderbot/data && \ diff --git a/docker/stub/requirements.txt b/docker/stub/requirements.txt index 70ff5c16..419b1eaf 100644 --- a/docker/stub/requirements.txt +++ b/docker/stub/requirements.txt @@ -20,7 +20,7 @@ grpcio==1.62.1 numpy==1.26.4 Pillow==10.2.0 protobuf==4.25.2 -opencv-contrib-python==4.5.5.62 -tflite-runtime==2.11.0 +opencv-contrib-python==4.9.0.80 +tflite-runtime pytesseract==0.3.10 pyzbar==0.1.9 diff --git a/requirements.txt b/requirements.txt index 139d980c..d5798a6d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,8 +24,8 @@ grpcio==1.62.1 numpy==1.26.4 Pillow==10.2.0 protobuf==4.25.2 -opencv-contrib-python==4.5.5.62 -tflite-runtime==2.11.0 +opencv-contrib-python==4.9.0.80 +tflite-runtime pytesseract==0.3.10 picamera==1.13 pyzbar==0.1.9