[
  {
    "path": ".astylerc",
    "content": "--lineend=linux\n\n--style=google\n\n--indent=spaces=4\n--indent-col1-comments\n--convert-tabs\n\n--attach-return-type\n--attach-namespaces\n--attach-classes\n--attach-inlines\n\n--add-brackets\n--add-braces\n\n--align-pointer=type\n--align-reference=type\n\n--max-code-length=100\n--break-after-logical\n\n--pad-comma\n--pad-oper\n--unpad-paren\n\n--break-blocks\n--pad-header\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "patreon: deadprogram\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "<!--- Please provide a general summary of the issue in the Title above -->\n\n## Description\n<!--- Detailed information about the issue itself -->\n\n## Steps to Reproduce\n<!--- Provide a link to a live example, or an unambiguous set of steps to -->\n<!--- reproduce this bug. Include code to reproduce, if relevant -->\n1.\n2.\n3.\n4.\n\n## Your Environment\n<!--- Include as many relevant details about your environment -->\n\n* Operating System and version:\n* OpenCV version used:\n* How did you install OpenCV?\n* GoCV version used:\n* Go version:\n* Did you run the `env.sh` or `env.cmd` script before trying to `go run` or `go build`?\n"
  },
  {
    "path": ".github/workflows/docker-alpine-improved.yml",
    "content": "# This is the Github action to build and push the gocv/opencv Docker images.\n#\nname: Docker\non:\n  push:\n    branches: [build-opencv-alpine, alpine-static-improved]\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  gstreamer:\n    name: gstreamer\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/gstreamer:1.24-alpine\n            ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.gstreamer-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/gstreamer:1.24-alpine\n            ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  ffmpeg:\n    name: ffmpeg\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/ffmpeg:5.16-alpine\n            ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.ffmpeg-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/ffmpeg:5.16-alpine\n            ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv:\n    name: opencv\n    runs-on: ubuntu-latest\n    needs: [gstreamer, ffmpeg]\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-alpine\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-alpine\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-ffmpeg:\n    name: opencv\n    runs-on: ubuntu-latest\n    needs: [gstreamer, ffmpeg]\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-alpine-ffmpeg\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine-ffmpeg\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-static-alpine-ffmpeg\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-alpine-ffmpeg\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine-ffmpeg\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n"
  },
  {
    "path": ".github/workflows/docker-static-ffmpeg.yml",
    "content": "# This is the Github action to build and push the ffmpeg Docker images used for static builds.\n#\nname: ffmpeg\non:\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  ffmpeg:\n    name: ffmpeg\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/ffmpeg:5.16-alpine\n            ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.ffmpeg-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/ffmpeg:5.16-alpine\n            ghcr.io/${{ github.repository_owner }}/ffmpeg:5.16-alpine\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n"
  },
  {
    "path": ".github/workflows/docker-static-gstreamer.yml",
    "content": "# This is the Github action to build and push the GStreamer Docker images used for static builds.\n#\nname: GStreamer\non:\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  gstreamer:\n    name: gstreamer\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/gstreamer:1.24-alpine\n            ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.gstreamer-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/gstreamer:1.24-alpine\n            ghcr.io/${{ github.repository_owner }}/gstreamer:1.24-alpine\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n"
  },
  {
    "path": ".github/workflows/docker-static-opencv-cuda.yml",
    "content": "# This is the Github action to build and push the OpenCV Docker images used for static builds.\n#\nname: OpenCV\non:\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  opencv:\n    name: opencv\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.11.0-gpu-cuda-12-static\n            ghcr.io/${{ github.repository_owner }}/opencv:4.11.0-gpu-cuda-12-static\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-gpu-cuda-12-static\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.11.0-gpu-cuda-12-static\n            ghcr.io/${{ github.repository_owner }}/opencv:4.11.0-gpu-cuda-12-static\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n"
  },
  {
    "path": ".github/workflows/docker-static-opencv.yml",
    "content": "# This is the Github action to build and push the OpenCV Docker images used for static builds.\n#\nname: OpenCV\non:\n  push:\n    branches: [alpine-static-improved-2]\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  opencv:\n    name: opencv\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-alpine-ffmpeg-gstreamer\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine-ffmpeg-gstreamer\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-static-alpine\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-alpine-ffmpeg-gstreamer\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-alpine-ffmpeg-gstreamer\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n"
  },
  {
    "path": ".github/workflows/docker.yml",
    "content": "# This is the Github action to build and push the gocv/opencv Docker images.\n#\nname: Docker\non:\n  push:\n    branches: [build-opencv-images]\n  workflow_dispatch:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  opencv:\n    name: opencv\n    runs-on: ubuntu-24.04\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n        with:\n          image: tonistiigi/binfmt:latest\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:latest\n            gocv/opencv:4.13.0\n            ghcr.io/${{ github.repository_owner }}/opencv:latest\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-static:\n    name: opencv-static\n    runs-on: ubuntu-24.04\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n        with:\n          image: tonistiigi/binfmt:latest\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-static\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-static\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-static\n          platforms: linux/amd64,linux/arm64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-static\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-static\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-gpu-cuda-11:\n    name: opencv-gpu-cuda-11\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-gpu-cuda-11\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-11\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-gpu-cuda-11\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-gpu-cuda-11\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-11\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-gpu-cuda-11-2-2:\n    name: opencv-gpu-cuda-11-2-2\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-gpu-cuda-11.2.2\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-11.2.2\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-gpu-cuda-11.2.2\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-gpu-cuda-11.2.2\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-11.2.2\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-gpu-cuda-12:\n    name: opencv-gpu-cuda-12\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-gpu-cuda-12\n            ghcr.io/${{ github.repository_owner }}/opemcv:4.13.0-gpu-cuda-12\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-gpu-cuda-12\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-gpu-cuda-12\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-12\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-gpu-cuda-13:\n    name: opencv-gpu-cuda-13\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Check disk space\n        run: df . -h\n      - name: Free disk space\n        run: |\n          sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true\n          sudo rm -rf \\\n            /usr/share/dotnet /usr/local/lib/android /opt/ghc \\\n            /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \\\n            /usr/lib/jvm || true\n          echo \"extra directories deleted\"\n          sudo apt install aptitude -y >/dev/null 2>&1\n          sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \\\n            esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \\\n            google-cloud-sdk imagemagick \\\n            libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \\\n            mercurial apt-transport-https mono-complete libmysqlclient \\\n            unixodbc-dev yarn chrpath libssl-dev libxft-dev \\\n            libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \\\n            snmp pollinate libpq-dev postgresql-client powershell ruby-full \\\n            sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \\\n            -y -f >/dev/null 2>&1\n          sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1\n          sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true\n          sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1\n          sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1\n          sudo apt-get autoremove -y >/dev/null 2>&1\n          sudo apt-get autoclean -y >/dev/null 2>&1\n          echo \"extra packages purged\"\n      - name: Check disk space\n        run: df . -h\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-gpu-cuda-13\n            ghcr.io/${{ github.repository_owner }}/opemcv:4.13.0-gpu-cuda-13\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-gpu-cuda-13\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-gpu-cuda-13\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-gpu-cuda-13\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-ubuntu-18-04:\n    name: opencv-ubuntu-18-04\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-ubuntu-18.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-18.04\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.actor }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-ubuntu-18.04\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-ubuntu-18.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-18.04\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-ubuntu-20-04:\n    name: opencv-ubuntu-20-04\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-ubuntu-20.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-20.04\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.repository_owner }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-ubuntu-20.04\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-ubuntu-20.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-20.04\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-ubuntu-22-04:\n    name: opencv-ubuntu-22-04\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-ubuntu-22.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-22.04\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.repository_owner }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-ubuntu-22.04\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-ubuntu-22.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-22.04\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n\n  opencv-ubuntu-24-04:\n    name: opencv-ubuntu-24-04\n    runs-on: ubuntu-latest\n    permissions:\n      packages: write\n      contents: read\n    steps:\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Check out the repo\n        uses: actions/checkout@v6\n      - name: Docker meta\n        id: meta\n        uses: docker/metadata-action@v5\n        with:\n          images: |\n            gocv/opencv:4.13.0-ubuntu-24.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-24.04\n          tags: |\n            type=sha,format=long\n            type=raw,value=latest\n      - name: Log in to Docker Hub\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_HUB_USERNAME }}\n          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}\n      - name: Log in to Github Container Registry\n        uses: docker/login-action@v3\n        with:\n          registry: ghcr.io\n          username: ${{ github.repository_owner }}\n          password: ${{ secrets.GITHUB_TOKEN }}\n      - name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          file: Dockerfile.opencv-ubuntu-24.04\n          platforms: linux/amd64\n          context: .\n          push: true\n          tags: |\n            gocv/opencv:4.13.0-ubuntu-24.04\n            ghcr.io/${{ github.repository_owner }}/opencv:4.13.0-ubuntu-24.04\n          labels: ${{ steps.meta.outputs.labels }}\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n"
  },
  {
    "path": ".github/workflows/linux.yml",
    "content": "name: Linux\non:\n  pull_request:\n  push:\n    branches:\n      - dev\n      - release\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    container: ghcr.io/hybridgroup/opencv:4.13.0\n\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - name: Enforce Go formatted code\n        run: \"test -z $(gofmt -l .) || gofmt -d .\"\n      - name: Install dependencies\n        run: apt-get update -yqq && apt-get install xvfb unzip -y\n      - name: Install WeChat test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.caffemodel > ${GITHUB_WORKSPACE}/testdata/detect.caffemodel\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.prototxt > ${GITHUB_WORKSPACE}/testdata/detect.prototxt\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.caffemodel > ${GITHUB_WORKSPACE}/testdata/sr.caffemodel\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.prototxt > ${GITHUB_WORKSPACE}/testdata/sr.prototxt\n      - name: Install GOTURN test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://raw.githubusercontent.com/opencv/opencv_extra/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt > ${GITHUB_WORKSPACE}/testdata/goturn.prototxt\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.001\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.002\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.003\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.004\n          cat ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.001 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.002 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.003 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.004 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip\n          unzip -o ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip goturn.caffemodel -d ${GITHUB_WORKSPACE}/testdata\n      - name: Install Tensorflow test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip > ${GITHUB_WORKSPACE}/testdata/inception5h.zip\n          unzip -o ${GITHUB_WORKSPACE}/testdata/inception5h.zip tensorflow_inception_graph.pb -d ${GITHUB_WORKSPACE}/testdata\n      - name: Install ONNX test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://huggingface.co/onnxmodelzoo/legacy_models/resolve/main/validated/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx > ${GITHUB_WORKSPACE}/testdata/googlenet-9.onnx\n          curl -sL https://huggingface.co/opencv/face_recognition_sface/resolve/main/face_recognition_sface_2021dec.onnx > ${GITHUB_WORKSPACE}/testdata/face_recognition_sface_2021dec.onnx\n          curl -sL https://huggingface.co/opencv/face_detection_yunet/resolve/main/face_detection_yunet_2023mar.onnx > ${GITHUB_WORKSPACE}/testdata/face_detection_yunet_2023mar.onnx\n          curl -sL https://huggingface.co/opencv/object_tracking_vittrack/resolve/main/object_tracking_vittrack_2023sep.onnx > ${GITHUB_WORKSPACE}/testdata/object_tracking_vittrack_2023sep.onnx\n      - name: Run main tests\n        run: xvfb-run -a --error-file /var/log/xvfb_error.log --server-args=\"-screen 0 1024x768x24 +extension RANDR\" go test -v -coverprofile=/tmp/coverage.out -count=1 -tags matprofile .\n        env:\n          DISPLAY: 99.0\n          GOCV_TENSORFLOW_TEST_FILES: ${{ github.workspace }}/testdata\n          GOCV_ONNX_TEST_FILES: ${{ github.workspace }}/testdata\n          GOCV_TRACKER_GOTURN_TEST_FILES: ${{ github.workspace }}/testdata\n      - name: Run contrib tests\n        run: xvfb-run -a --error-file /var/log/xvfb_error.log --server-args=\"-screen 0 1024x768x24 +extension RANDR\" go test -v -coverprofile=/tmp/contrib.out -count=1 -tags matprofile ./contrib\n        env:\n          DISPLAY: 99.0\n      - name: Code coverage\n        run: |\n          go tool cover -html=/tmp/coverage.out -o /tmp/coverage.html\n          go tool cover -html=/tmp/contrib.out -o /tmp/contrib.html\n      - name: Archive code coverage results\n        uses: actions/upload-artifact@v4\n        with:\n          name: code-coverage-report\n          path: /tmp/*.html\n"
  },
  {
    "path": ".github/workflows/macos.yml",
    "content": "name: macOS\non:\n  pull_request:\n  push:\n    branches:\n      - dev\n      - release\n\njobs:\n  build:\n    strategy:\n        matrix:\n          os: [macos-14, macos-15]\n    runs-on: ${{ matrix.os }}\n    steps:\n      - name: Install OpenCV\n        run: |\n          brew update\n          brew install opencv\n      - name: Install Go\n        uses: actions/setup-go@v6\n        with:\n          go-version: '1.25.5'\n          cache: true\n      - name: Checkout\n        uses: actions/checkout@v6\n      - name: Install WeChat test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.caffemodel > ${GITHUB_WORKSPACE}/testdata/detect.caffemodel\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.prototxt > ${GITHUB_WORKSPACE}/testdata/detect.prototxt\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.caffemodel > ${GITHUB_WORKSPACE}/testdata/sr.caffemodel\n          curl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.prototxt > ${GITHUB_WORKSPACE}/testdata/sr.prototxt\n      - name: Install GOTURN test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://raw.githubusercontent.com/opencv/opencv_extra/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt > ${GITHUB_WORKSPACE}/testdata/goturn.prototxt\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.001\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.002\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.003\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.004\n          cat ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.001 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.002 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.003 ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip.004 > ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip\n          unzip -o ${GITHUB_WORKSPACE}/testdata/goturn.caffemodel.zip goturn.caffemodel -d ${GITHUB_WORKSPACE}/testdata\n      - name: Install Tensorflow test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip > ${GITHUB_WORKSPACE}/testdata/inception5h.zip\n          unzip -o ${GITHUB_WORKSPACE}/testdata/inception5h.zip tensorflow_inception_graph.pb -d ${GITHUB_WORKSPACE}/testdata\n      - name: Install ONNX test model\n        run: |\n          mkdir -p ${GITHUB_WORKSPACE}/testdata\n          curl -sL https://huggingface.co/onnxmodelzoo/legacy_models/resolve/main/validated/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx > ${GITHUB_WORKSPACE}/testdata/googlenet-9.onnx\n          curl -sL https://huggingface.co/opencv/face_recognition_sface/resolve/main/face_recognition_sface_2021dec.onnx > ${GITHUB_WORKSPACE}/testdata/face_recognition_sface_2021dec.onnx\n          curl -sL https://huggingface.co/opencv/face_detection_yunet/resolve/main/face_detection_yunet_2023mar.onnx > ${GITHUB_WORKSPACE}/testdata/face_detection_yunet_2023mar.onnx\n          curl -sL https://huggingface.co/opencv/object_tracking_vittrack/resolve/main/object_tracking_vittrack_2023sep.onnx > ${GITHUB_WORKSPACE}/testdata/object_tracking_vittrack_2023sep.onnx\n      - name: Run main tests\n        run: go test -v -tags matprofile .\n        env:\n          GOCV_TENSORFLOW_TEST_FILES: ${{ github.workspace }}/testdata\n          GOCV_ONNX_TEST_FILES: ${{ github.workspace }}/testdata\n          GOCV_TRACKER_GOTURN_TEST_FILES: ${{ github.workspace }}/testdata\n      - name: Run contrib tests\n        run: go test -v -tags matprofile ./contrib\n"
  },
  {
    "path": ".github/workflows/windows.yml",
    "content": "name: Windows\n\non:\n  pull_request:\n  push:\n    branches:\n      - dev\n      - release\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  build-windows:\n    runs-on: windows-2022\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - name: Install Go\n        uses: actions/setup-go@v5\n        with:\n          go-version: '1.25.5'\n          cache: true\n      - name: Restore cached OpenCV source\n        uses: actions/cache/restore@v4\n        id: cache-opencv-source\n        with:\n          key: opencv-source-4130-windows-v3\n          path: |\n            ./opencv/opencv-4.13.0\n            ./opencv/opencv_contrib-4.13.0\n      - name: Download OpenCV source\n        if: steps.cache-opencv-source.outputs.cache-hit != 'true'\n        shell: cmd\n        run: |\n          call .\\win_download_opencv.cmd \"%GITHUB_WORKSPACE%\\opencv\"\n      - name: Save cached OpenCV source\n        uses: actions/cache/save@v4\n        if: steps.cache-opencv-source.outputs.cache-hit != 'true'\n        with:\n          key: ${{ steps.cache-opencv-source.outputs.cache-primary-key }}\n          path: |\n            ./opencv/opencv-4.13.0\n            ./opencv/opencv_contrib-4.13.0\n      - name: Restore cached OpenCV build\n        uses: actions/cache/restore@v4\n        id: cache-opencv-build\n        with:\n          key: opencv-build-4130-windows-v4\n          path: |\n            ./opencv/build\n      - name: Build OpenCV\n        if: steps.cache-opencv-build.outputs.cache-hit != 'true'\n        shell: cmd\n        run: |\n          call .\\win_build_opencv.cmd \"%GITHUB_WORKSPACE%\\opencv\"\n      - name: Save cached OpenCV build\n        uses: actions/cache/save@v4\n        if: steps.cache-opencv-build.outputs.cache-hit != 'true'\n        with:\n          key: ${{ steps.cache-opencv-build.outputs.cache-primary-key }}\n          path: |\n            ./opencv/build\n      - name: Set GoCV env\n        run: |\n            go env\n            echo \"CGO_CXXFLAGS=--std=c++11 -DNDEBUG\" >> $env:GITHUB_ENV\n            echo \"CGO_CPPFLAGS=-I${env:GITHUB_WORKSPACE}\\opencv\\build\\install\\include\" >> $env:GITHUB_ENV\n            echo \"CGO_LDFLAGS=-L${env:GITHUB_WORKSPACE}\\opencv\\build\\install\\x64\\mingw\\lib -lopencv_core4130 -lopencv_face4130 -lopencv_videoio4130 -lopencv_imgproc4130 -lopencv_highgui4130 -lopencv_imgcodecs4130 -lopencv_objdetect4130 -lopencv_features2d4130 -lopencv_video4130 -lopencv_dnn4130 -lopencv_xfeatures2d4130 -lopencv_plot4130 -lopencv_tracking4130 -lopencv_img_hash4130 -lopencv_calib3d4130 -lopencv_bgsegm4130 -lopencv_photo4130 -lopencv_aruco4130 -lopencv_wechat_qrcode4130 -lopencv_ximgproc4130 -lopencv_xphoto4130 -lopencv_xobjdetect4130 -lopencv_mcc4130\" >> $env:GITHUB_ENV\n            echo \"${env:GITHUB_WORKSPACE}/opencv/build/install/x64/mingw/bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append\n      - name: Install Tensorflow test model\n        run: |\n            mkdir -p ./testdata\n            curl -sL https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip > ./testdata/inception5h.zip\n            unzip -o ./testdata/inception5h.zip tensorflow_inception_graph.pb -d ./testdata\n      - name: Install ONNX test model\n        run: |\n          curl -sL https://huggingface.co/onnxmodelzoo/legacy_models/resolve/main/validated/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx > ./testdata/googlenet-9.onnx\n          curl -sL https://huggingface.co/opencv/face_recognition_sface/resolve/main/face_recognition_sface_2021dec.onnx > ./testdata/face_recognition_sface_2021dec.onnx\n          curl -sL https://huggingface.co/opencv/face_detection_yunet/resolve/main/face_detection_yunet_2023mar.onnx > ./testdata/face_detection_yunet_2023mar.onnx\n          curl -sL https://huggingface.co/opencv/object_tracking_vittrack/resolve/main/object_tracking_vittrack_2023sep.onnx > ./testdata/object_tracking_vittrack_2023sep.onnx\n      - name: Install GOTURN test model\n        shell: bash\n        run: |\n          curl -sL https://raw.githubusercontent.com/opencv/opencv_extra/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt > ./testdata/goturn.prototxt\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001 > ./testdata/goturn.caffemodel.zip.001\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002 > ./testdata/goturn.caffemodel.zip.002\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003 > ./testdata/goturn.caffemodel.zip.003\n          curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004 > ./testdata/goturn.caffemodel.zip.004\n          cat ./testdata/goturn.caffemodel.zip.00*  > ./testdata/goturn.caffemodel.zip\n          unzip -o ./testdata/goturn.caffemodel.zip goturn.caffemodel -d ./testdata/\n      - name: Set GoCV model env\n        run: |\n            go env\n            echo \"GOCV_TENSORFLOW_TEST_FILES=${env:GITHUB_WORKSPACE}\\testdata\" >> $env:GITHUB_ENV\n            echo \"GOCV_ONNX_TEST_FILES=${env:GITHUB_WORKSPACE}\\testdata\" >> $env:GITHUB_ENV\n            echo \"GOCV_TRACKER_GOTURN_TEST_FILES=${env:GITHUB_WORKSPACE}\\testdata\" >> $env:GITHUB_ENV\n      - name: Test GoCV\n        run: |\n            go test -v -tags=\"matprofile,customenv\" .\n      - name: Test GoCV Contrib\n        run: |\n            go test -v -tags=\"matprofile,customenv\" ./contrib\n"
  },
  {
    "path": ".gitignore",
    "content": "profile.cov\ncount.out\n*.swp\n*.snap\n/parts\n/prime\n/stage\n.vscode/\n/build\n.idea/\ncontrib/data.yaml\ncontrib/testOilPainting.png\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "0.43.0\n---\n* **all**\n    - update to OpenCV 4.13\n* **core**\n    - add Copy method to Mat (#1346)\n    - improve implementation for NewPointVectorFromPoints\n* **cuda**\n    - add implmentations for more arith functions\n* **imgproc**\n    - added in missing colormaps\n    - paramters types in improc dilate and erode functions\n    - use same test values as OpenCV tests for TestMinAreaRect and TestMinAreaRect2f\n* **videoio**\n    - add RetrieveChannel function to make it possible to capture both video and audio\n* **examples**\n    - Fix bugs and memory leaks in yolov8 example (#1349)\n* **contrib**\n    - add support for Macbeth Chart module (MCC) (#1336)\n* **install**\n    - windows: split download and build scripts for easier usage/integration\n\n0.42.0\n---\n* **all**\n    - Update to OpenCV 4.12.0\n    - Expose GpuMat's underlying object pointer\n    - Add support for reduced size OpenCV builds using build tags for specific modules (cuda, contrib, etc.)\n- **cuda**\n    - Add LShift and RShift function implementations\n    - Add Compare function implementation\n    - Add implementations for Norm, CalcNorm, and CalcNormDiff functions\n    - Add Cuda Morphology Filter (#1311)\n- **core**\n    - Add ReshapeWithSize() to provide specific control over the reshape operation\n    - Add MeanStdDevWithMask for cv::meanStdDev with the optional mask\n- **video**\n    - Add video tracker implementation using Vit DNN\n    - Add cv::stereoRectify binding\n- **docker**\n    - Update OpenCV containers to 4.12.0\n- **docs**\n    - Update ROADMAP links and add missing tracker functions\n    - Update README with new features and usage\n- **build**\n    - Use build tags for reduced size OpenCV builds with specific modules\n- **bugfix**\n    - Fix bug where the package name was mismatched with contrib (#1293)\n\n0.41.0\n---\n* **all**\n    - opencv: patch for gstreamer cmake to handle static linking\n- **bugfix**\n    - correct ifndef for wrappers to avoid include conflcts\n    - temporary fix for https://github.com/docker/setup-qemu-action/issues/198\n- **core**\n    - add exception handling functions and try/catch blocks\n    - return error from calls to OpenCV functions that cause exceptions. The error shows the OpenCV exception description from the exception caught.\n- **features2d**\n    - Add BRISK with params support (#1280)\n    - Params for features2d (#1283)\n- **photo**\n    - add Decolor() function\n- **video**\n    - ApplyWithParams for MOG2 bg subtractor (#1284)\n- **build**\n    - add manually launched workflows to build ffmpeg, gstreamer, and opencv docker images\n    - add `Dockerfile.opencv-ubuntu-24.04` for Ubuntu 24.04 support\n    - add `opencv-ubuntu-24-04` step for build img workflow\n- **docker**\n    - add static image with opencv and ffmpeg without gstreamer\n    - gstreamer with a specific set of plugins\n    - use OpenCV patch to build fully static GStreamer with plugins included\n- **docs**\n    - update ROADMAP for some functions that were completed already\n    - Update wrong links in Readme for face detection from URL and find chessboard\n- **make**\n    - add install task for Ubuntu Manic Minotaur using @chewxy PR #1157\n    - update make tasks for jetson based on latest available info\n    - Update Makefile (#1276)\n\n0.40.0\n---\n* **all**\n    - Add support for OpenCV 4.11.0\n    - Update license year to 2025\n- **bugfix**\n    - Correct signature for FindHomography, since dst is actually target format for the operation, not something changed by the operation\n- **core**\n    - Added new Mat constructor and tests\n    - Added NewMatFromPoint2fVector function\n- **videoio**\n    - Change type of VideoCaptureProperties to int32\n    - Added VideoWriterFile with API and API Params\n- **docker**\n    - Alpine static improved (#1243)\n- **make**\n    - Improve Linux distro dtection code, and add specific dependendcies for Ubunutu 24.04\n- **examples**\n    - GStreamer VideoWriter example\n- **build**\n    - Update homebrew when running macOS tests\n    - Update GH actions in linux build to latest versions\n\n0.39.0\n---\n- **bugfix**\n  - Fixed MinGW link typo in README.md.\n  - Fixed function name typo (#1236).\n- **core**\n  - Added `FaceDetectorYN` example.\n  - Query I/O API backends registry (#1237).\n  - Face detector YN face recognizer SF (#1232).\n- **cuda**\n  - Added `createLookUpTable` and `split` functions.\n  - Added missing CUDA `imgproc` standalone functions.\n  - Added `XXXWithStream` standalone functions.\n- **docker**\n  - Added Dockerfile for container that can perform static builds of your own GoCV project (HighGUI not supported by static builds).\n  - Added Dockerfile example showing how to build using static linking.\n  - Added static build examples.\n  - Updated version for `gocv-static-builder` image.\n- **build**\n  - Updated workflow for Docker builds to latest versions.\n  - Used most recent NVIDIA CUDA base image.\n  - Used static FFmpeg build for static OpenCV build.\n  - Downgraded static build to Go 1.22 to avoid [Go issue #68976](https://github.com/golang/go/issues/68976).\n  - Modified Dockerfile used for static builds to build own versions for static linking.\n  - Corrected build options for OpenCV on arm64 for static builds.\n  - Separated build tags and linker flags for arm64 and amd64 targets.\n  - Modified LDFLAGS for correct static compilation.\n  - Removed extra file to clear space for static build/standard dev build images.\n  - Added options for Linux arm64 and separate Darwin builds.\n- **cgo**\n  - Changed tags for static OpenCV to `opencvstatic`.\n  - Added options for Linux arm64 and separate Darwin builds.\n  - Removed unneeded lib from link for Linux/arm64.\n  - Modified LDFLAGS for correct static compilation.\n- **docs**\n  - Added missing `videoio` functions to ROADMAP.\n  - Updated ROADMAP with missing `objdetect` functions for DNN faces, and moved `aruco` under `objdetect` module.\n  - Simplified the YOLO example.\n\n0.38.0\n---\n* **bugfix**\n    * aruco: correct test from latest OpenCV update\n    * exclude freetype.cpp file from being included in windows build\n    * feat(demosaicing): release mat when conversion to bayer encounters invalid pattern\n    * imgproc HomographyMethod const values typo fixed\n* **build**\n    * add macOS build for GH actions CI\n    * adjust make and docker build files to build freetype support\n    * correct ONNX DNN tests on Linux/macOS\n    * move download for GOTURN models into testdata subdirectory\n    * remove Caffe tests\n    * run DNN tests on Windows\n    * make: add task to run all cuda tests\n    * make: build non-free modules when building opencv with cuda support\n    * skip tests on macOS that are not passing due to OpenCV different results on macOS. See https://forum.opencv.org/t/match-template-different-results-on-mac-m1/10026 and other similar issues.\n    * update all generated docker images to Go 1.23.1\n* **examples**\n    * add asciicam video to ascii in your terminal\n    * add object detection example using YOLOv8\n* **core**\n    * add Closed() function to Mat\n    * add OpenCV types for half-float values\n    * add TransposeND() function\n    * persistance implement Filestorage roadmap (#1208)\n    * RotatedRect type constructors\n* **dnn**\n    * add BlobFromImageWithParams() and BlobFromImagesWithParams() functions\n    * add BlobRectToImageRect() and BlobRectsToImageRects() functions\n    * allow ReadNet() function to only pass model file, and remove tests for Caffe\n* **features2d**\n    * SIFT with params (#1186)\n* **highgui**\n    * added window pollkey function (#1198)\n    * added window WaitKeyEx support (#1195)\n    * Window set mouse callback (#1220)\n* **imgcodecs**\n    * added immultiread support\n* **imgproc**\n    * feat(imgproc): demosaicing wrapper\n    * add HomographyMethodRHO HomographyMethod added\n* **objdetect**\n    * change QRCodeDetector signature to avoid pointer to slice\n* **video**\n    * added TrackerGOTURN (see roadmap)\n* **videoio**\n    * Capture from device and file with HW acceleration\n* **cuda**\n    * add Closed() function to Mat/GpuMat\n    * add DeviceSupports function\n    * add implementations for AddWeighted and CopyMakeBorder functions\n    * add Merge and Transpose functions\n    * add support for convertFp16 function\n    * add tests for demosaicing\n    * feat(imgproc): demosaicing wrapper\n    * correct go fmt error\n* **contrib/face**\n    * added face recognizer interface (#1211)\n    * BasicFaceRecognizer + EigenFaceRecognizer + FisherFaceRecognizer (#1213)\n    * extra setters and getters for LBPHFaceRecognizer (#1194)\n* **contrib/freetype**\n    * imported freetype code by lz1998 from PR 873\n\n0.37.0\n---\n* **all**\n    * Add support for OpenCV 4.10.0\n\n0.36.1\n---\n* **bugfix**\n    * Correct error in CUDA function signature\n* **test**\n    * correct CUDA tests\n* **docker**\n    * add test image for CUDA 12\n\n0.36.0\n---\n* **all**\n    * Add support for OpenCV 4.9.0\n    * update Go to version 1.22\n    * update minimum go version to 1.21\n* **bugfix**\n    * aruco: correct test from latest OpenCV update\n* **build**\n    * add GH action for Windows\n    * remove appveyor\n    * adjusted Makefile to build for debian bookworm\n* **core**\n    * Add additional signature for MinMaxLoc.\n    * add color conversion alias\n    * add Mahalanobis(), Inv(), Row(), amd Col() functions\n    * add MulTransposed() function\n    * add PCABackProject() and PCAProject() functions\n    * add PSNR() function\n    * add SVBackSubst() and SVDecomp() functions\n* **calib3d**\n    * add FisheyeCalibrate, FisheyeDistortPoints, and CheckChessboard functions\n    * Add func comments and update readme\n    * add Rodrigues function\n    * add SolvePnP function\n    * Add more smoke tests\n    * Initial commit of more stereo bindings\n* **feature2d**\n    * Add interface for `Feature2D` algorithms\n    * Asserting some algorithms conform to `Feature2D`\n    * Prepend \"Feature2D\" prefix to component interfaces of Feature2D\n* **imgproc**\n    * add CreateHanningWindow()\n    * add EMD()\n    * Add float version of BoxPoints and MinAreaRect\n    * Add new binding for cv::Erode.\n* **videoio**\n    * add Retrieve function\n* **contrib/xfeatures2d**\n    * Add BriefDescriptorExtractor to xfeatures2d (#1114)\n    * add NewSURFWithParams func\n    * Add separate \"Compute\" bindings for detection algorithms (#1117)\n* **cuda/core**\n    * ADD Cuda MultiplyWithStream (#1142)\n\n0.35.0\n---\n* **all**\n    * Add support for OpenCV 4.8.1\n    * correct Go formatting\n* **features2d**\n    * Add Match method for BFMatcher\n* **build**\n    * remove extra files from GH actions runner so GPU images builds have enough temp file space to run correctly\n* **make**\n    * for build_raspi added conditional cmake build for 64 and 32bit platforms\n    * remove ENABLE_VFPV3=ON and add WITH_TBB=ON from 64bit build.\n    * added sudo_pre_install_clean to raspberry pi and jetson installs\n    * change sudo_pre_install_clean to support cleanup on 64bit architechtures (arm and x86)\n\n0.34.0\n---\n* **all**\n    * Add support for OpenCV 4.8.0\n    * Add support for Go 1.21\n* **build**\n    * update all builds to use OpenCV 4.8.0\n* **core**\n    * Adds support for PCACompute\n* **docker**\n    * add dockerfile for OpenCV static build\n* **make**\n    * Leave one processor free instead of using all of them when building\n\n\n0.33.0\n---\n* **bugfix**\n    * Remove opencv2/aruco.hpp include\n* **all**\n    * build performance tests with all OpenCV builds\n* **build**\n    * build and push Ubuntu 22.04 base image with OpenCV 4.7.0\n    * docker images with opencv\n    * docker production images with opencv 4.7.0\n    * Docker push to GHCR\n* **core**\n    * Add ReduceArgMax and ReduceArgMin\n* **dnn**\n    * improved NMSBoxes code\n* **docker**\n    * add dockerfile for Ubuntu 22.04 OpenCV base image\n    * updates to migrate to GHCR\n* **examples**\n    * Deallocate Mats in feature-matching example.\n    * Fix G108 (CWE-200) and G114 (CWE-676)\n    * Fix G304 (CWE-22) and G307 (CWE-703)\n    * Fix G304 (CWE-22) and G307 (CWE-703)\n    * Missed #nosec tag\n* **make**\n    * Ubuntu Jammy (22) opencv build support.\n\n\n0.32.0\n---\n* **all**\n    * update to OpenCV 4.7.0\n* **core**\n    * Add the number of thread setter and getter\n* **calib3d**\n    * add EstimateAffinePartial2DWithParams()\n* **imgcodecs**\n    * Add IMDecodeIntoMat to reduce heap allocations (#1035)\n* **imgproc**\n    * add matchShapes function support\n* **objdetect**\n    * move aruco from contrib and also refactor/update to match current OpenCV API\n* **photo**\n    * add inpaint function\n* **video**\n    * cv::KalmanFilter bindings.\n* **cuda**\n    * add support for cuda::TemplateMatching\n* **docker**\n    * update all dockerfiles for OpenCV 4.7.0/GoCV 0.32.0\n    * multiplatform for both amd64 and arm64\n    * install libjpeg-turbo into docker image\n    * add Ubunutu 18.04 and 20.04 prebuilt OpenCV images\n    * add dockerfile for older version of CUDA for those who cannot upgrade\n* **ci**\n    * remove circleci\n    * correct actions that trigger build\n* **make**\n    * change download path for OpenCV release tag\n* **windows**\n    * Update win_build_opencv.cmd\n* **docs**\n    * correct docs on building docker\n    * update ROADMAP\n    * typo in comment\n    * update comments style with gofmt\n* **openvino**\n    * Add openvino Dockerfile\n    * Fix OpenvinoVersion dangling pointer\n    * Update env.sh and README.md for 2022.1\n\n0.31.0\n---\n* **all**\n    * update to OpenCV 4.6.0\n* **build**\n    * Switch to Github Actions for Linux CI build\n    * Use go -tags static when verifying static build\n* **core**\n    * Add Mat.ElemSize (#964)\n    * avoid index out of range panic in NewPointsVectorFromPoints\n* **video**\n    * add findTransformECC function\n* **contrib/ximgproc**\n    * add PeiLinNormalization() function\n    * add anisotropicDiffusion() function\n    * implement edgePreservingFilter()\n    * implement niBlackThreshold and thinning filters\n\n0.30.0\n---\n* **all**\n    * update to OpenCV 4.5.5\n* **build**\n    * add install_nonfree make task to build all opencv_contrib modules\n    * correct download location for onnx test file\n    * Update Makefile for missing version changes\n* **core**\n    * correct how memory is being allocated for Eye(), Zeros(), and Ones() to address issue #930\n* **calib3d** \n    * Adding support for estimateAffine2DWithParams (#924)\n* **imgproc**\n    * Add DrawContoursWithParams function\n* **photo**\n    * Add bindings for fastNlMeansDenoising and fastNlMeansDenoisingColored\n    * add detailEnhance function\n    * add EdgePreservingFilter function\n    * add PencilSketch function\n    * add stylization function\n* **docs**\n    * add godoc comments for FastNlMeansDenoising functions\n    * update README with info on latest mingw-w64 t use for Windows builds\n    * dnn pose detect examples correct the order of the argument variable name\n* **examples**\n    * Fixed memory leaks in the motion detection example\n* **openvino**\n    * Update env.sh and README.md\n* **windows**\n    * use mingw-w64 8.1.0 for protobuf compile\n* **contrib**\n    * add cv::wechat_qrcode::WeChatQRCode (#949)\n    * Update cgo_static.go\n\n0.29.0\n---\n* **all**\n    * update to OpenCV 4.5.4\n* **build**\n    * add static build ability on windows\n    * use tbb for all builds for CPU accelerated operations\n* **cuda**\n    * implement a bunch of per-element operations\n    * add get/set/reset device functions\n    * add NewGpuMatWithSize() to preallocate device memory\n    * Reshape() returns a new GpuMat with the changed data\n    * correct use of Stream by adding WaitForCompletion() and passing pre-allocated GpuMats\n* **docs**\n    * update ROADMAP from recent contributions\n* **videoio**\n    * Fix open video capture with api test (#895)\n* **calib3d**\n    * added EstimateAffine2D\n    * findChessboardCornersSB\n* **aruco**\n    * added many functions as part of initial implementation\n\n0.28.0\n---\n* **all**\n    * update to OpenCV 4.5.3\n    * make task and build tag for static build of OpenCV/GoCV on Linux\n    * add Makefile tasks for OpenCV install on Nvidia Jetson\n    * add gotest for more colorful test output running tests from containers\n* **build**\n    * correcting output format for code coverage report\n    * enforce rule that all Go code is correctly formatted\n    * remove codecov\n* **core**\n    * add NewPointVectorFromMat() and NewPoint2fVectorFromMat() functions\n    * Fix possible MatProfile race by ordering remove before free.\n* **cuda**\n    * add core functions for GpuMat like Cols(), Rows(), and Type()\n    * initial implementation for the Flip function\n* **docs**\n    * update ROADMAP from recent contributions\n* **examples**\n    * correct list of examples and fix comment\n* **features2d**\n    * Add NewORBWithParams\n* **tracking**\n    * change MOSSE to KCF\n* **highgui**\n    * Add function CreateTrackbarWithValue to Window type.\n* **imgcodec**\n    * optimize IMEncode avoiding multiple data copies.\n* **imgproc**\n    * Add CircleWithParams function\n    * Add DilateWithParams() function (#827)\n    * Add EllipseWithParams function\n    * Add FillPolyWithParams function\n    * Add PointPolygonTest function\n    * Add RectangleWithParams function\n* **photo**\n    * add MergeMertens, AlignMTB and Denoising function (#848)\n* **xphoto**\n    * Add Xphoto contrib (#844)\n\n0.27.0\n---\n* **all**\n    * update to OpenCV 4.5.2\n* **core**\n    * add Append() to PointsVector/PointVector\n    * add cv::RNG\n    * add implementation for Point2fVector\n    * add rand functions\n    * add test coverage for PointsVector\n    * create new PointsVector/PointVector wrappers to avoid repetitive memory copying for seeming innocent operations involving slices of image.Point\n    * test coverage for Point2f\n    * use PointVector for everything that we can to speed up pipeline when passing around Point vectors\n    * use enum instead of int for Invert Method\n* **cuda**\n    * adding HoughLinesDetector and HoughSegmentDetector\n    * adding tests for the CannyEdgeDetector\n    * some refactoring of the API\n    * adding dockerfiles for OpenCV 4.5.2 with CUDA 11.2\n    * add GaussianFilter\n    * correct signature and test for Threshold\n    * implement SobelFilter\n    * move arithm module functions into correct location\n    * rename files to get rid of so many cudas\n    * add abs function implementation\n* **dnn**\n    * increase test coverage\n* **docker**\n    * make all Dockerfiles names/tags more consistent\n* **docs**\n    * add CUDA functions that need implementation to ROADMAP\n    * remove invalid sections and add some missing functions from ROADMAP\n* **imgproc**\n    * Add FindContoursWithParams function\n    * Add ToImageYUV and ToImageYUVWithParams\n* **make**\n    * add make task to show changelog for next release\n* **wechat_qrcode**\n    * disable module in Windows due to linker error\n\n0.26.0\n---\n* **all**\n    * update to OpenCV 4.5.1\n* **core**\n    * add Matrix initializers: eye, ones, zeros (#758)\n    * add multidimensional mat creation\n    * add ndim mat constructor\n    * added accumulators\n    * added norm call with two mats (#600)\n    * keep a reference to a []byte that backs a Mat. (#755)\n    * remove guard for DataPtrUint8 since any Mat can be treated an Uint8\n    * add Mat IsContinuous() function, and ensure that any Mat data pointers used to create Go slices only apply to continuous Mats\n    * fix buffer size for Go strings for 32-bit operating systems\n* **build**\n    * bring back codecov.io\n* **calib3d**\n    * correctly close mat after test\n* **dnn**\n    * add ReadNetFromONNX and ReadNetFromONNXBytes (#760)\n    * increase test coverage\n* **docker**\n    * dockerfiles for opencv gpu builds\n* **docs**\n    * corrected links to CUDA and OpenVINO\n    * list all unimplemented functions in photo module\n    * replace GoDocs with pkg docs\n    * update ROADMAP from recent contributions\n* **imgproc**\n    * add test coverage for GetTextSizeWithBaseline()\n    * close all Mats even those based on memory slices\n    * close Mat to avoid memory leak in ToImage()\n    * refactoring of ToImage and ImageToMatXX functions\n* **openvino**\n    * fix dldt repo in makefile for openvino\n* **os**\n    * adding gcc-c++ package to rpm deps\n* **photo**\n    * add SeamlessClone function\n* **profile**\n    * add created mats in Split and ForwardLayers to profile (#780)\n\n0.25.0\n---\n* **all**\n    * update to opencv release 4.5.0\n* **build** \n    * add file dependencies needed for DNN tests\n    * add verbose output for tests on CircleCI\n    * also run unit tests on non-free algorithms. YMMV.\n    * fix build with cuda\n    * remove Travis and switch to CircleCI using Docker based builds\n    * update CI builds to Go 1.15\n* **core**\n    * add mixChannels() method to Mat (#746)\n    * Add toGoStrings helper\n    * support ConvertToWithParams method\n* **dnn**\n    * Add NMSBoxes function (#736)\n    * Added ability to load Torch file. Tested features for extracting 128d vectors\n    * fix using wrong type for unconnectedlayertype\n    * use default ddepth for conversions to blob from image as recommended by @berak\n* **docker** \n    * use separate dockerfile for opencv to avoid massive rebuild\n* **docs**\n    * add recent contributions to ROADMAP and also add cuda functions still in need of implementation\n    * display CircleCI badge in README\n    * minor improvements to CUDA docs in READMEs\n* **features2d**\n    * add FlannBasedMatcher\n    * add drawmatches (#720)\n    * fix memory leak in SIFT\n* **highgui**\n    * refactored ROI methods\n* **imgproc**\n    * Add option to return baseline with GetTextSizeWithBaseline\n* **objdetect** \n    * Add QRCode DetectAndDecodeMulti\n* **videoio**\n    * Add video capture properties and set preferred api backend (#739)\n    * fix needed as discussed in golang/go issue #32479\n\n0.24.0\n---\n* **all**\n    * update Makefile and READMEChange constants and corresponding function signatures to have the correct types (#689)\n    * replace master branch terminology with release\n    * update to OpenCV 4.4.0\n* **calib3d**\n    * add FindHomography()\n    * add function EstimateAffinePartial2D()\n    * add GetAffineTransform() and GetAffineTransform2f()\n    * add UndistortPoints(), FisheyeUndistortPoints() and EstimateNewCameraMatrixForUndistortRectify()\n* **core**\n    * add MultiplyWithParams\n* **docs**\n    * add recent contributions to ROADMAP\n    * create CODE_OF_CONDUCT.md\n    * update copyright year\n* **features2d**\n    * close returned Mat from SIFT algorithm\n    * fix issue 707 with DrawKeyPoints\n    * SIFT patent now expired so is part of main OpenCV modules\n* **imgproc**\n    * change struct to remove GNU old-style field designator extension warning\n\n0.23.0\n---\n* **build**\n    * update Makefile and README\n    * update to use go1.14\n* **calib3d**\n    * add draw chessboard\n* **core**\n    * fix memory leak in Mat.Size() and Mat.Split() (#580)\n* **cuda**\n    * add build support\n    * add cuda backend/target\n    * add support for:\n        * cv::cuda::CannyEdgeDetector\n        * cv::cuda::CascadeClassifier Class\n        * cv::cuda::HOG Class\n    * remove breaking case statement\n* **dnn**\n    * avoid parallel test runs\n    * remove attempt at providing grayscale image blog conversion that uses mean adjustment\n* **docker**\n    * docker file last command change (#505)\n* **docs**\n    * add recent contributions to ROADMAP\n* **imgproc**\n    * add ErodeWithParams function\n    * add getGaussianKernel function\n    * add Go Point2f type and update GetPerspectiveTransform() (#589)\n    * add PhaseCorrelate binding (#626)\n    * added Polylines feature\n    * do not free contours data until after we have drawn the needed contours\n    * Threshold() should return a value (#620)\n* **make**\n    * added raspberry pi zero support to the makefile\n* **opencv**\n    * update to OpenCV 4.3.0\n* **openvino**\n    * add build support\n* **windows**\n    * add cmake flag for allocator stats counter type to avoid opencv issue #16398\n\n0.22.0\n---\n* **bgsegm**\n    * Add BackgroundSubtractorCNT\n* **calib3d**\n    * Added undistort function (#520)\n* **core**\n    * add functions (singular value decomposition, multiply between matrices, transpose matrix) (#559)\n    * Add new funcs (#578)\n    * add setIdentity() method to Mat\n    * add String method (#552)\n    * MatType: add missing constants\n* **dnn**\n    * Adding GetLayerNames()\n    * respect the bit depth of the input image to set the expected output when converting an image to a blob\n* **doc**\n    * change opencv version 3.x to 4.x\n* **docker**\n    * use Go1.13.5 for image\n* **imgcodecs**\n    * Fix webp image decode error (#523)\nimgcodecs: optimize copy of data used for IMDecode method\n* **imgproc**\n    * Add GetRectSubPix\n    * Added ClipLine\n    * Added InvertAffineTransform\n    * Added LinearPolar function (#524)\n    * correct ksize param used for MedianBlur unit test\n    * Feature/put text with line type (#527)\n    * FitEllipse\n    * In FillPoly and DrawContours functions, remove func() wrap to avoid memory freed before calling opencv functions. (#543)\n* **objdetect**\n    * Add support QR codes\n* **opencv**\n    * update to OpenCV 4.2.0 release\n* **openvino**\n    * Add openvino async\n* **test**\n    * Tolerate imprecise result in SolvePoly\n    * Tolerate imprecision in TestHoughLines\n\n0.21.0\n---\n* **build**\n    * added go clean --cache to clean target, see issue 458\n* **core**\n    * Add KMeans function\n    * added MeanWithMask function for Mats (#487)\n    * Fix possible resource leak\n* **cuda**\n    * added cudaoptflow\n    * added NewGpuMatFromMat which creates a GpuMat from a Mat\n    * Support for CUDA Image Warping (#494)\n* **dnn**\n    * add BlobFromImages (#467)\n    * add ImagesFromBlob (#468)\n* **docs**\n    * update ROADMAP with all recent contributions. Thank you!\n* **examples**\n    * face detection from image url by using IMDecode (#499)\n    * better format\n* **imgproc**\n    * Add calcBackProject\n    * Add CompareHist\n    * Add DistanceTransform and Watershed\n    * Add GrabCut\n    * Add Integral\n    * Add MorphologyExWithParams\n* **opencv**\n    * update to version 4.1.2\n* **openvino**\n    * updates needed for 2019 R3\n* **videoio**\n    * Added ToCodec to convert FOURCC string to numeric representation (#485)\n\n0.20.0\n---\n* **build**\n    * Use Go 1.12.x for build\n    * Update to OpenCV 4.1.0\n* **cuda**\n    * Initial cuda implementation\n* **docs**\n    * Fix the command to install xquartz via brew/cask\n* **features2d**\n    * Add support for SimpleBlobDetectorParams (#434)\n    * Added FastFeatureDetectorWithParams\n* **imgproc**\n    * Added function call to cv::morphologyDefaultBorderValue\n* **test**\n    * Increase test coverage for FP16BlobFromImage()\n* **video**\n    * Added calcOpticalFlowPyrLKWithParams\n    * Addition of MOG2/KNN constructor with options\n\n0.19.0\n---\n* **build**\n    * Adds Dockerfile. Updates Makefile and README.\n    * make maintainer tag same as dockerhub organization name\n    * make sure to run tests for non-free contrib algorithms\n    * update Appveyor build to use Go 1.12\n* **calib3d**\n    * add func InitUndistortRectifyMap (#405)\n* **cmd**\n    * correct formatting of code in example\n* **core**\n    * Added Bitwise Operations With Masks\n    * update to OpenCV4.0.1\n* **dnn**\n    * add new backend and target types for NVIDIA and FPGA\n    * Added blobFromImages in ROADMAP.md (#403)\n    * Implement dnn methods for loading in-memory models.\n* **docker**\n    * update Dockerfile to use OpenCV 4.0.1\n* **docs**\n    * update ROADMAP from recent contributions\n* **examples**\n    * Fixing filename in caffe-classifier example\n* **imgproc**\n    * Add 'MinEnclosingCircle' function\n    * added BoxPoints function and BorderIsolated const\n    * Added Connected Components\n    * Added the HoughLinesPointSet function.\n    * Implement CLAHE to imgproc\n* **openvino**\n    * remove lib no longer included during non-FPGA installations\n* **test**\n    * Add len(kp) == 232 to TestMSER, seems this is necessary for MacOS for some reason.\n\n0.18.0\n---\n* **build**\n    * add OPENCV_GENERATE_PKGCONFIG flag to generate pkg-config file\n    * Add required curl package to the RPM and DEBS\n    * correct name for zip directory used for code download\n    * Removing linking against face contrib module\n    * update CI to use 4.0.0 release\n    * update Makefile and Windows build command file to OpenCV 4.0.0\n    * use opencv4 file for pkg-config\n* **core**\n    * add ScaleAdd() method to Mat\n* **docs**\n    * replace OpenCV 3.4.3 references with OpenCV 4\n    * update macOS installation info to refer to new OpenCV 4.0 brew\n    * Updated function documentation with information about errors.\n* **examples**\n    * Improve accuracy in hand gesture sample\n* **features2d**\n    * update drawKeypoints() to use new stricter enum\n* **openvino**\n    * changes to accommodate release 2018R4\n* **profile**\n    * add build tag matprofile to allow for conditional inclusion of custom profile\n    * Add Mat profile wrapper in other areas of the library.\n    * Add MatProfile.\n    * Add MatProfileTest.\n    * move MatProfile tests into separate test file so they only run when custom profiler active\n* **test**\n    * Close images in tests.\n    * More Closes in tests.\n    * test that we are using 4.0.x version now\n* **videoio**\n    * Return the right type and error when opening VideoCapture fails\n\n0.17.0\n---\n* **build** \n    * Update Makefile\n    * update version of OpenCV used to 3.4.3\n    * use link to OpenCV 3.4.3 for Windows builds\n* **core** \n    * add mulSpectrums wrapper\n    * add PolarToCart() method to Mat\n    * add Reduce() method to Mat\n    * add Repeat() method to Mat\n    * add Solve() method to Mat\n    * add SolveCubic() method to Mat\n    * add SolvePoly() method to Mat\n    * add Sort() method to Mat\n    * add SortIdx() method to Mat\n    * add Trace() method to Mat\n    * Added new MatType\n    * Added Phase function\n* **dnn** \n    * update test to match OpenCV 3.4.3 behavior\n* **docs**\n    * Add example of how to run individual test\n    * adding instructions for installing pkgconfig for macOS\n    * fixed GOPATH bug.\n    * update ROADMAP from recent contributions\n* **examples**\n    * add condition to handle no circle found in circle detection example\n* **imgcodecs**\n    * Added IMEncodeWithParams function\n* **imgproc**\n    * Added Filter2D function\n    * Added fitLine function\n    * Added logPolar function\n    * Added Remap function\n    * Added SepFilter2D function\n    * Added Sobel function\n    * Added SpatialGradient function\n* **xfeatures2d**\n    * do not run SIFT test unless OpenCV was built using OPENCV_ENABLE_NONFREE\n    * do not run SURF test unless OpenCV was built using OPENCV_ENABLE_NONFREE\n\n0.16.0\n---\n* **build**\n    * add make task for Raspbian install with ARM hardware optimizations\n    * use all available cores to compile OpenCV on Windows as discussed in issue #275\n    * download performance improvements for OpenCV installs on Windows\n    * correct various errors and issues with OpenCV installs on Fedora and CentOS\n* **core**\n    * correct spelling error in constant to fix issue #269\n    * implemented & added test for Mat.SetTo\n    * improve Multiply() GoDoc and test showing Scalar() multiplication\n    * mutator functions for Mat add, subtract, multiply, and divide for uint8 and float32 values.\n* **dnn**\n    * add FP16BlobFromImage() function to convert an image Mat to a half-float aka FP16 slice of bytes\n* **docs**\n    * fix a varible error in example code in README\n\n0.15.0\n---\n* **build**\n    * add max to make -j\n    * improve path for Windows to use currently configured GOPATH\n* **core**\n    * Add Mat.DataPtr methods for direct access to OpenCV data\n    * Avoid extra copy in Mat.ToBytes + code review feedback\n* **dnn**\n    * add test coverage for ParseNetBackend and ParseNetTarget\n    * complete test coverage\n* **docs**\n    * minor cleanup of language for install\n    * use chdir instead of cd in Windows instructions\n* **examples**\n    * add 'hello, video' example to repo\n    * add HoughLinesP example\n    * correct message on device close to match actual event\n    * small change in display message for when file is input source\n    * use DrawContours in motion detect example\n* **imgproc**\n    * Add MinAreaRect() function\n* **test**\n    * filling test coverage gaps\n* **videoio**\n    * add test coverage for OpenVideoCapture\n\n0.14.0\n---\n* **build**\n    * Add -lopencv_calib3d341 to the linker\n    * auto-confirm on package installs from make deps command\n    * display PowerShell download status for OpenCV files\n    * obtain caffe test config file from new location in Travis build\n    * remove VS only dependencies from OpenCV build, copy caffe test config file from new location\n    * return back to GoCV directory after OpenCV install\n    * update for release of OpenCV v3.4.2\n    * use PowerShell for scripted OpenCV install for Windows\n    * win32 version number has not changed yet\n* **calib3d**\n    * Add Calibrate for Fisheye model(WIP)\n* **core**\n    * add GetTickCount function\n    * add GetTickFrequency function\n    * add Size() and FromPtr() methods to Mat\n    * add Total method to Mat\n    * Added RotateFlag type\n    * correct CopyTo to use pointer to Mat as destination\n    * functions converting Image to Mat\n    * rename implementation to avoid conflicts with Windows\n    * stricter use of reflect.SliceHeader\n* **dnn**\n    * add backend/device options to caffe and tensorflow DNN examples\n    * add Close to Layer\n    * add first version of dnn-pose-detection example\n    * add further comments to object detection/tracking DNN example\n    * add GetPerfProfile function to Net\n    * add initial Layer implementation alongside enhancements to Net\n    * add InputNameToIndex to Layer\n    * add new functions allowing DNN backends such as OpenVINO\n    * additional refactoring and comments in dnn-pose-detection example\n    * cleanup DNN face detection example\n    * correct const for device targets to be called Target\n    * correct test that expected init slice with blank entries\n    * do not init slice with blank entries, since added via append\n    * further cleanup of DNN face detection example\n    * make dnn-pose-detection example use Go channels for async operation\n    * refactoring and additional comments for object detection/tracking DNN example\n    * refine comment in header for style transfer example\n    * working style transfer example\n    * added ForwardLayers() to accomodate models with multiple output layers\n* **docs**\n    * add scripted Windows install info to README\n    * Added a sample gocv workflow contributing guideline\n    * mention docker image in README.\n    * mention work in progress on Android\n    * simplify and add missing step in Linux installation in README\n    * update contributing instructions to match latest version\n    * update ROADMAP from recent calib3d module contribution\n    * update ROADMAP from recent imgproc histogram contribution\n* **examples**\n    * cleanup header for caffe dnn classifier\n    * show how to use either Caffe or Tensorflow for DNN object detection\n    * further improve dnn samples\n    * rearrange and add comments to dnn style transfer example\n    * remove old copy of pose detector\n    * remove unused example\n* **features2d**\n    * free memory allocation bug for C.KeyPoints as pointed out by @tzununbekov\n    * Adding opencv::drawKeypoints() support\n* **imgproc**\n    * add equalizeHist function\n    * Added opencv::calcHist implementation\n* **openvino**\n    * add needed environment config to execute examples\n    * further details in README explaining how to use\n    * remove opencv contrib references as they are not included in OpenVINO\n* **videoio**\n    * Add OpenVideoCapture\n    * Use gocv.VideoCaptureFile if string is specified for device.\n\n0.13.0\n---\n* **build**\n    * Add cgo directives to contrib\n    * contrib subpackage also needs cpp 11 or greater for a warning free build on Linux\n    * Deprecate env scripts and update README\n    * Don't set --std=c++1z on non-macOS\n    * Remove CGO vars from CI and correct Windows cgo directives\n    * Support pkg-config via cgo directives\n    * we actually do need cpp 11 or greater for a warning free build on Linux\n* **docs**\n    * add a Github issue template to project\n    * provide specific examples of using custom environment\n* **imgproc**\n    * add HoughLinesPWithParams() function\n* **openvino**\n    * add build tag specific to openvino\n    * add roadmap info\n    * add smoke test for ie\n\n0.12.0\n---\n* **build**\n    * convert to CRLF\n    * Enable verbosity for travisCI\n    * Further improvements to Makefile\n* **core**\n    * Add Rotate, VConcat\n    * Adding InScalarRange and NewMatFromScalarWithSize functions\n    * Changed NewMatFromScalarWithSize to NewMatWithSizeFromScalar\n    * implement CheckRange(), Determinant(), EigenNonSymmetric(), Min(), and MinMaxIdx() functions\n    * implement PerspectiveTransform() and Sqrt() functions\n    * implement Transform() and Transpose() functions\n    * Make toByteArray safe for empty byte slices\n    * Renamed InScalarRange to InRangeWithScalar\n* **docs**\n    * nicer error if we can't read haarcascade_frontalface_default\n    * correct some ROADMAP links\n    * Fix example command.\n    * Fix executable name in help text.\n    * update ROADMAP from recent contributions\n* **imgproc** \n    * add BoxFilter and SqBoxFilter functions\n    * Fix the hack to convert C arrays to Go slices.\n* **videoio** \n    * Add isColor to VideoWriterFile\n    * Check numerical parameters for gocv.VideoWriterFile\n    * CodecString()\n* **features2d** \n    * add BFMatcher\n* **img_hash** \n    * Add contrib/img_hash module\n    * add GoDocs for new img_hash module\n    * Add img-similarity as an example for img_hash\n* **openvino** \n    * adds support for Intel OpenVINO toolkit PVL\n    * starting experimental work on OpenVINO IE\n    * update README files for Intel OpenVINO toolkit support\n    * WIP on IE can load an IR network\n\n0.11.0\n---\n* **build**\n    * Add astyle config\n    * Astyle cpp/h files\n    * remove duplication in Makefile for astyle\n* **core**\n    * Add GetVecfAt() function to Mat\n    * Add GetVeciAt() function to Mat\n    * Add Mat.ToImage()\n    * add MeanStdDev() method to Mat\n    * add more functions\n    * Compare Mat Type directly\n    * further cleanup for GoDocs and enforce type for convariance operations\n    * Make borderType in CopyMakeBorder be type BorderType\n    * Mat Type() should return MatType\n    * remove unused convenience functions\n    * use Mat* to indicate when a Mat is mutable aka an output parameter\n* **dnn**\n    * add a ssd sample and a GetBlobChannel helper\n    * added another helper func and a pose detection demo\n* **docs**\n    * add some additional detail about adding OpenCV functions to GoCV\n    * updates to contribution guidelines\n    * fill out complete list of needed imgproc functions for sections that have work started\n    * indicate that missing imgproc functions need implementation\n    * mention the WithParams patterns to be used for functions with default params\n    * update README for the Mat* based API changes\n    * update ROADMAP for recent changes especially awesome recent core contributions from @berak\n* **examples**\n    * Fix tf-classifier example\n    * move new DNN advanced examples into separate folders\n    * Update doc for the face contrib package\n    * Update links in caffe-classifier demo\n    * WIP on hand gestures tracking example\n* **highgui**\n    * fix constant in NewWindow\n* **imgproc**\n    * Add Ellipse() and FillPoly() functions\n    * Add HoughCirclesWithParams() func\n    * correct output Mat to for ConvexHull()\n    * rename param being used for Mat image to be modified\n* **tracking**\n    * add support for TrackerMIL, TrackerBoosting, TrackerMedianFlow, TrackerTLD, TrackerKCF, TrackerMOSSE, TrackerCSRT trackers\n    * removed mutitracker, added Csrt, rebased\n    * update GoDocs and minor renaming based on gometalint output\n\n0.10.0\n---\n* **build** \n    * install unzip before build\n    * overwrite when unzipping file to install Tensorflow test model\n    * use -DCPU_DISPATCH= flag for build to avoid problem with disabled AVX on Windows\n    * update unzipped file when installing Tensorflow test model\n* **core** \n    * add Compare() and CountNonZero() functions\n    * add getter/setter using optional params for multi-dimensional Mat using row/col/channel\n    * Add mat subtract function\n    * add new toRectangle function to DRY up conversion from CRects to []image.Rectangle\n    * add split subtract sum wrappers\n    * Add toCPoints() helper function\n    * Added Mat.CopyToWithMask() per #47\n    * added Pow() method\n    * BatchDistance BorderInterpolate CalcCovarMatrix CartToPolar\n    * CompleteSymm ConvertScaleAbs CopyMakeBorder Dct\n    * divide, multiply\n    * Eigen Exp ExtractChannels\n    * operations on a 3d Mat are not same as a 2d multichannel Mat\n    * resolve merge conflict with duplicate Subtract() function\n    * run gofmt on core tests\n    * Updated type for Mat.GetUCharAt() and Mat.SetUCharAt() to reflect uint8 instead of int8\n* **docs** \n    * update ROADMAP of completed functions in core from recent contributions\n* **env** \n    * check loading resources\n    * Add distribution detection to deps rule\n    * Add needed environment variables for Linux\n* **highgui** \n    * add some missing test coverage on WaitKey()\n* **imgproc** \n    * Add adaptive threshold function\n    * Add pyrDown and pyrUp functions\n    * Expose DrawContours()\n    * Expose WarpPerspective and GetPerspectiveTransform\n    * implement ConvexHull() and ConvexityDefects() functions\n* **opencv** \n    * update to OpenCV version 3.4.1\n\n0.9.0\n---\n* **bugfix** \n    * correct several errors in size parameter ordering\n* **build**\n    * add missing opencv_face lib reference to env.sh\n    * Support for non-brew installs of opencv on Darwin\n* **core**\n    * add Channels() method to Mat\n    * add ConvertTo() and NewMatFromBytes() functions\n    * add Type() method to Mat\n    * implement ConvertFp16() function\n* **dnn** \n    * use correct size for blob used for Caffe/Tensorflow tests\n* **docs** \n    * Update copyright date and Apache 2.0 license to include full text\n* **examples** \n    * cleanup mjpeg streamer code\n    * cleanup motion detector comments\n    * correct use of defer in loop\n    * use correct size for blob used for Caffe/Tensorflow examples\n* **imgproc**\n    * Add cv::approxPolyDP() bindings.\n    * Add cv::arcLength() bindings.\n    * Add cv::matchTemplate() bindings.\n    * correct comment and link for Blur function\n    * correct docs for BilateralFilter()\n\n0.8.0\n---\n* **core**\n    * add ColorMapFunctions and their test\n    * add Mat ToBytes\n    * add Reshape and MinMaxLoc functions\n    * also delete points\n    * fix mistake in the norm function by taking NormType instead of int as parameter\n    * SetDoubleAt func and his test\n    * SetFloatAt func and his test\n    * SetIntAt func and his test\n    * SetSCharAt func and his test\n    * SetShortAt func and his test\n    * SetUCharAt fun and his test\n    * use correct delete operator for array of new, eliminates a bunch of memory leaks\n* **dnn**\n    * add support for loading Tensorflow models\n    * adjust test for Caffe now that we are auto-cropping blob\n    * first pass at adding Caffe support\n    * go back to older function signature to avoid version conflicts with Intel CV SDK\n    * properly close DNN Net class\n    * use approx. value from test result to account forr windows precision differences\n* **features2d**\n    * implement GFTTDetector, KAZE, and MSER algorithms\n    * modify MSER test for Windows results\n* **highgui**\n    * un-deprecate WaitKey function needed for CLI apps\n* **imgcodec**\n    * add fileExt type\n* **imgproc**\n    * add the norm wrapper and use it in test for WarpAffine and WarpAffineWithParams\n    * GetRotationMatrix2D, WarpAffine and WarpAffineWithParams\n    * use NormL2 in wrap affine\n* **pvl**\n    * add support for FaceRecognizer\n    * complete wrappers for all missing FaceDetector functions\n    * update instructions to match R3 of Intel CV SDK\n* **docs**\n    * add more detail about exactly which functions are not yet implememented in the modules that are marked as 'Work Started'\n    * add refernece to Tensorflow example, and also suggest brew upgrade for MacOS\n    * improve ROADMAP to help would-be contributors know where to get started\n    * in the readme, explain compiling to a static library\n    * remove many godoc warnings by improving function descriptions\n    * update all OpenCV 3.3.1 references to v3.4.0\n    * update CGO_LDFLAGS references to match latest requirements\n    * update contribution guidelines to try to make it more inviting\n* **examples**\n    * add Caffe classifier example\n    * add Tensorflow classifier example\n    * fixed closing window in examples in infinite loop\n    * fixed format of the examples with gofmt\n* **test**\n    * add helper function for test : floatEquals\n    * add some attiribution from test function\n    * display OpenCV version in case that test fails\n    * add round function to allow for floating point accuracy differences due to GPU usage.\n* **build**\n    * improve search for already installed OpenCV on MacOS\n    * update Appveyor build to Opencv 3.4.0\n    * update to Opencv 3.4.0\n\n0.7.0\n---\n* **core**\n    * correct Merge implementation\n* **docs**\n    * change wording and formatting for roadmap\n    * update roadmap for a more complete list of OpenCV functionality\n    * sequence docs in README in same way as the web site, aka by OS\n    * show in README that some work was done on contrib face module\n* **face**\n    * LBPH facerecognizer bindings\n* **highgui**\n    * complete implementation for remaining API functions\n* **imgcodecs**\n    * add IMDecode function\n* **imgproc**\n    * elaborate on HoughLines & HoughLinesP tests to fetch a few individual results\n* **objdetect**\n    * add GroupRectangles function\n* **xfeatures2d**\n    * add SIFT and SURF algorithms from OpenCV contrib\n    * improve description for OpenCV contrib\n    * run tests from OpenCV contrib\n\n0.6.0\n---\n* **core**\n    * Add cv::LUT binding\n* **examples** \n    * do not try to go fullscreen, since does not work on OSX\n* **features2d** \n    * add AKAZE algorithm\n    * add BRISK algorithm\n    * add FastFeatureDetector algorithm\n    * implement AgastFeatureDetector algorithm\n    * implement ORB algorithm\n    * implement SimpleBlobDetector algorithm\n* **osx**\n    * Fix to get the OpenCV path with \"brew info\".\n* **highgui** \n    * use new Window with thread lock, and deprecate WaitKey() in favor of Window.WaitKey()\n    * use Window.WaitKey() in tests\n* **imgproc** \n    * add tests for HoughCircles\n* **pvl**\n    * use correct Ptr referencing\n* **video** \n    * use smart Ptr for Algorithms thanks to @alalek\n    * use unsafe.Pointer for Algorithm    \n    * move tests to single file now that they all pass\n\n0.5.0\n---\n* **core**\n    * add TermCriteria for iterative algorithms\n* **imgproc**\n    * add CornerSubPix() and GoodFeaturesToTrack() for corner detection\n* **objdetect**\n    * add DetectMultiScaleWithParams() for HOGDescriptor\n    * add DetectMultiScaleWithParams() to allow override of defaults for CascadeClassifier\n* **video**\n    * add CalcOpticalFlowFarneback() for Farneback optical flow calculations\n    * add CalcOpticalFlowPyrLK() for Lucas-Kanade optical flow calculations\n* **videoio**\n    * use temp directory for Windows test compat.\n* **build**\n    * enable Appveyor build w/cache\n* **osx**\n    * update env path to always match installed OpenCV from Homebrew\n\n0.4.0\n---\n* **core**\n    * Added cv::mean binding with single argument\n    * fix the write-strings warning\n    * return temp pointer fix\n* **examples**\n    * add counter example\n    * add motion-detect command\n    * correct counter\n    * remove redundant cast and other small cleanup\n    * set motion detect example to fullscreen\n    * use MOG2 for continous motion detection, instead of simplistic first frame only\n* **highgui**\n    * ability to better control the fullscreen window\n* **imgproc**\n    * add BorderType param type for GaussianBlur\n    * add BoundingRect() function\n    * add ContourArea() function\n    * add FindContours() function along with associated data types\n    * add Laplacian and Scharr functions\n    * add Moments() function\n    * add Threshold function\n* **pvl**\n    * add needed lib for linker missing in README\n* **test**\n    * slightly more permissive version test\n* **videoio**\n    * Add image compression flags for gocv.IMWrite\n    * Fixed possible looping out of compression parameters length\n    * Make dedicated function to run cv::imwrite with compression parameters\n\n0.3.1\n---\n* **overall**\n    * Update to use OpenCV 3.3.1\n\n0.3.0\n---\n* **docs** \n    * Correct Windows build location from same @jpfarias fix to gocv-site\n* **core**\n    * Add Resize\n    * Add Mat merge and Discrete Fourier Transform\n    * Add CopyTo() and Normalize()\n    * Implement various important Mat logical operations\n* **video**\n    * BackgroundSubtractorMOG2 algorithm now working\n    * Add BackgroundSubtractorKNN algorithm from video module\n* **videoio**\n    * Add VideoCapture::get\n* **imgproc**\n    * Add BilateralFilter and MedianBlur\n    * Additional drawing functions implemented\n    * Add HoughCircles filter\n    * Implement various morphological operations\n* **highgui**\n    * Add Trackbar support\n* **objdetect**\n    * Add HOGDescriptor\n* **build** \n    * Remove race from test on Travis, since it causes CGo segfault in MOG2\n\n0.2.0\n---\n* Switchover to custom domain for package import\n* Yes, we have Windows\n\n0.1.0\n---\nInitial release!\n\n- [X] Video capture\n- [X] GUI Window to display video\n- [X] Image load/save\n- [X] CascadeClassifier for object detection/face tracking/etc.\n- [X] Installation instructions for Ubuntu\n- [X] Installation instructions for OS X\n- [X] Code example to use VideoWriter\n- [X] Intel CV SDK PVL FaceTracker support\n- [X] imgproc Image processing\n- [X] Travis CI build\n- [X] At least minimal test coverage for each OpenCV class\n- [X] Implement more of imgproc Image processing"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at info@hybridgroup.com. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# How to contribute\n\nThank you for your interest in improving GoCV.\n\nWe would like your help to make this project better, so we appreciate any contributions. See if one of the following descriptions matches your situation:\n\n### Newcomer to GoCV, to OpenCV, or to computer vision in general\n\nWe'd love to get your feedback on getting started with GoCV. Run into any difficulty, confusion, or anything else? You are not alone. We want to know about your experience, so we can help the next people. Please open a Github issue with your questions, or get in touch directly with us.\n\n### Something in GoCV is not working as you expect\n\nPlease open a Github issue with your problem, and we will be happy to assist.\n\n### Something you want/need from OpenCV does not appear to be in GoCV\n\nWe probably have not implemented it yet. Please take a look at our [ROADMAP.md](ROADMAP.md). Your pull request adding the functionality to GoCV would be greatly appreciated.\n\n### You found some Python code on the Internet that performs some computer vision task, and you want to do it using GoCV\n\nPlease open a Github issue with your needs, and we can see what we can do.\n\n## How to use our Github repository\n\nThe `release` branch of this repo will always have the latest released version of GoCV. All of the active development work for the next release will take place in the `dev` branch. GoCV will use semantic versioning and will create a tag/release for each release.\n\nHere is how to contribute back some code or documentation:\n\n- Fork repo\n- Create a feature branch off of the `dev` branch\n- Make some useful change\n- Submit a pull request against the `dev` branch.\n- Be kind\n\n## How to add a function from OpenCV to GoCV\n\nHere are a few basic guidelines on how to add a function from OpenCV to GoCV:\n\n- Please open a Github issue. We want to help, and also make sure that there is no duplications of efforts. Sometimes what you need is already being worked on by someone else.\n- Use the proper Go style naming `MissingFunction()` for the Go wrapper.\n- Make any output parameters `Mat*` to indicate to developers that the underlying OpenCV data will be changed by the function.\n- Use Go types when possible as parameters for example `image.Point` and then convert to the appropriate OpenCV struct. Also define a new type based on `int` and `const` values instead of just passing \"magic numbers\" as params. For example, the `VideoCaptureProperties` type used in `videoio.go`.\n- Always add the function to the GoCV file named the same as the OpenCV module to which the function belongs.\n- If the new function is in a module that is not yet implemented by GoCV, a new set of files for that module will need to be added.\n- Always add a \"smoke\" test for the new function being added. We are not testing OpenCV itself, but just the GoCV wrapper, so all that is needed generally is just exercising the new function.\n- If OpenCV has any default params for a function, we have been implementing 2 versions of the function since Go does not support overloading. For example, with a OpenCV function:\n\n```c\nopencv::xYZ(int p1, int p2, int p3=2, int p4=3);\n```\n\nWe would define 2 functions in GoCV:\n\n```go\n// uses default param values\nXYZ(p1, p2)\n\n// sets each param\nXYZWithParams(p2, p2, p3, p4)\n```\n\n## How to run tests\n\nTo run the tests:\n\n```\ngo test .\ngo test ./contrib/.\n```\n\nIf you want to run an individual test, you can provide a RegExp to the `-run` argument:\n```\ngo test -run TestMat\n```\n\nIf you are using Intel OpenVINO, you can run those tests using:\n\n```\ngo test ./openvino/...\n```\n\n## Contributing workflow\n\nThis section provides a short description of one of many possible workflows you can follow to contribute to `GoCV`. This workflow is based on multiple [git remotes](https://git-scm.com/docs/git-remote) and it's by no means the only workflow you can use to contribute to `GoCV`. However, it's an option that might help you get started quickly without too much hassle as this workflow lets you work off the `gocv` repo directory path!\n\nAssuming you have already forked the `gocv` repo, you need to add a new `git remote` which will point to your GitHub fork. Notice below that you **must** `cd` to `gocv` repo directory before you add the new `git remote`:\n\n```shell\ncd $GOPATH/src/gocv.io/x/gocv\ngit remote add gocv-fork https://github.com/YOUR_GH_HANDLE/gocv.git\n```\n\nNote, that in the command above we called our new `git remote`, **gocv-fork** for convenience so we can easily recognize it. You are free to choose any remote name of your liking.\n\nYou should now see your new `git remote` when running the command below:\n\n```shell\ngit remote -v\n\ngocv-fork\thttps://github.com/YOUR_GH_HANDLE/gocv.git (fetch)\ngocv-fork\thttps://github.com/YOUR_GH_HANDLE/gocv.git (push)\norigin\t        https://github.com/hybridgroup/gocv (fetch)\norigin\t        https://github.com/hybridgroup/gocv (push)\n```\n\nBefore you create a new branch from `dev` you should fetch the latests commits from the `dev` branch:\n\n```shell\ngit fetch origin dev\n```\n\nYou want the `dev` branch in your `gocv` fork to be in sync with the `dev` branch of `gocv`, so push the earlier fetched commits to your GitHub fork as shown below. Note, the `-f` force switch might not be needed:\n\n```shell\ngit push gocv-fork dev -f\n```\n\nCreate a new feature branch from `dev`:\n\n```shell\ngit checkout -b new-feature\n```\n\nAfter you've made your changes you can run the tests using the `make` command listed below. Note, you're still working off the `gocv` project root directory, hence running the command below does not require complicated `$GOPATH` rewrites or whatnot:\n\n```shell\nmake test\n```\n\nOnce the tests have passed, commit your new code to the `new-feature` branch and push it to your fork running the command below:\n\n```shell\ngit push gocv-fork new-feature\n```\n\nYou can now open a new PR from `new-feature` branch in your forked repo against the `dev` branch of `gocv`.\n"
  },
  {
    "path": "Dockerfile",
    "content": "# to build this docker image:\n#   docker build .\nFROM ghcr.io/hybridgroup/opencv:4.13.0\n\nENV GOPATH /go\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\nRUN go build -tags example -o /build/gocv_version ./cmd/version/\n\nCMD [\"/build/gocv_version\"]\n"
  },
  {
    "path": "Dockerfile-static",
    "content": "# to build this docker image:\n#   docker buildx build -f Dockerfile-static -t gocv-static --platform=linux/amd64,linux/arm64 .\n#\nFROM --platform=$BUILDPLATFORM ghcr.io/hybridgroup/opencv:4.13.0-static AS gocv-build\n\nENV GOPATH /go\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN --mount=target=. \\\n    --mount=type=cache,target=/root/.cache/go-build \\\n    --mount=type=cache,target=/go/pkg/mod \\\n    go build -tags static -o /build/gocv_version ./cmd/version/\n\nFROM debian:bullseye AS final\n\nCOPY --from=gocv-build /build/gocv_version /run/gocv_version\n\nCMD [\"/run/gocv_version\"]\n"
  },
  {
    "path": "Dockerfile-static-alpine",
    "content": "# syntax=docker/dockerfile:1.3\n\n# To build release:\n#   docker buildx build -f Dockerfile.static-alpine -t gocv-static-alpine --platform=linux/arm64,linux/amd64 --load .\n\nFROM --platform=$BUILDPLATFORM ghcr.io/hybridgroup/opencv:4.11-alpine AS builder-amd64\n\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    wget \\\n    unzip \\\n    pkgconfig\n\n# Install Go\nARG GO_VERSION=1.22.8\nRUN wget https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \\\n    tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \\\n    rm go${GO_VERSION}.linux-amd64.tar.gz\n\nENV PATH=\"/usr/local/go/bin:${PATH}\"\nENV GOPATH /go\n\n# Copy the GoCV source code\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nENV CGO_CXXFLAGS=\"--std=c++11\"\nENV CGO_CPPFLAGS=\"-I/usr/local/include/opencv4\" \nENV CGO_LDFLAGS=\"-static -L/usr/local/lib -lopencv_gapi -lopencv_stitching -lopencv_alphamat -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -L/usr/local/lib/opencv4/3rdparty -llibprotobuf -lade -littnotify -llibwebp -llibtiff -llibopenjp2 -lippiw -lippicv -llibjpeg-turbo -llibpng -L/lib -lzlib -lIlmImf -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lavcodec -lvpx -lx264 -lswresample -lm -latomic -lavutil -lbz2_static -llzma\"\n\n# Build the GoCV version command\nRUN --mount=target=. \\\n    --mount=type=cache,target=/root/.cache/go-build \\\n    --mount=type=cache,target=/go/pkg/mod \\\n    go build -tags customenv -o /build/gocv_version ./cmd/version/\n\n# Stage 3: Final image\n\nFROM alpine:3.20 AS final\n\n# Copy the GoCV version command\n\nCOPY --from=builder /build/gocv_version /run/gocv_version\n\n# Run the GoCV version command\n\nCMD [\"/run/gocv_version\"]\n"
  },
  {
    "path": "Dockerfile-static-builder",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile-static-builder -t gocv-static-builder .\n# or for multi-arch builds:\n#   docker buildx build -f Dockerfile-static-builder -t ghcr.io/hybridgroup/gocv-static-builder --platform=linux/amd64,linux/arm64 --push .\n#\n# to use this docker image:\n#   cd /path/to/my/project\n#   docker run --rm -e \"BINARYNAME=mjpeg-streamer\" -e \"SRCPATH=./cmd/mjpeg-streamer\" -v $(pwd):/src -v $(pwd)/build:/build -a stdout -a stderr --platform linux/amd64 gocv-static-builder\n#\n# NOTE that you cannot use highgui from the static build!\n#\nFROM --platform=$BUILDPLATFORM ghcr.io/hybridgroup/opencv:4.13.0-static AS gocv-static-builder\n\nWORKDIR /src\n\nENV BINARYNAME=gocv_static_binary\nENV SRCPATH=.\n\nCMD go build -tags static -o /build/$BINARYNAME -buildvcs=false $SRCPATH\n"
  },
  {
    "path": "Dockerfile-test",
    "content": "# To build:\n#   docker build -f Dockerfile-test -t gocv-test .\n#\n# To run tests:\n#   xhost +\n#   docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix gocv-test-4.x\n#   xhost -\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0 AS gocv-test-4.13\n\nENV GOPATH /go\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \".\", \"./contrib/...\"]\n"
  },
  {
    "path": "Dockerfile-test.gpu-cuda-10",
    "content": "# To build:\n#   docker build -f Dockerfile-test.gpu-cuda-10 -t gocv-test-gpu-cuda-10 .\n#\n# To run tests:\n#   docker run -it --rm --gpus all gocv-test-gpu-cuda-10\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-10 AS gocv-gpu-test-cuda-10\n\nENV GOPATH /go\nENV PATH=\"${PATH}:/go/bin\"\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \"./cuda/...\"]\n"
  },
  {
    "path": "Dockerfile-test.gpu-cuda-11",
    "content": "# To build:\n#   docker build -f Dockerfile-test.gpu-cuda-11 -t gocv-test-gpu-cuda-11 .\n#\n# To run tests:\n#   docker run -it --rm --gpus all gocv-test-gpu-cuda-11\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-11 AS gocv-gpu-test-cuda-11\n\nENV GOPATH /go\nENV PATH=\"${PATH}:/go/bin\"\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \"./cuda/...\"]\n"
  },
  {
    "path": "Dockerfile-test.gpu-cuda-11.2.2",
    "content": "# To build:\n#   docker build -f Dockerfile-test.gpu-cuda-11.2.2 -t gocv-test-gpu-cuda-11.2.2 .\n#\n# To run tests:\n#   docker run -it --rm --gpus all gocv-test-gpu-cuda-11.2.2\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-11.2.2 AS gocv-gpu-test-cuda-11\n\nENV GOPATH /go\nENV PATH=\"${PATH}:/go/bin\"\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \"./cuda/...\"]\n"
  },
  {
    "path": "Dockerfile-test.gpu-cuda-12",
    "content": "# To build:\n#   docker build -f Dockerfile-test.gpu-cuda-12 -t gocv-test-gpu-cuda-12 .\n#\n# To run tests:\n#   docker run -it --rm --gpus all gocv-test-gpu-cuda-12\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-12 AS gocv-gpu-test-cuda-12\n\nENV GOPATH /go\nENV PATH=\"${PATH}:/go/bin\"\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \"./cuda/...\"]\n"
  },
  {
    "path": "Dockerfile-test.gpu-cuda-13",
    "content": "# To build:\n#   docker build -f Dockerfile-test.gpu-cuda-13 -t gocv-test-gpu-cuda-13 .\n#\n# To run tests:\n#   docker run -it --rm --gpus all gocv-test-gpu-cuda-13\n#\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-13 AS gocv-gpu-test-cuda-13\n\nENV GOPATH /go\nENV PATH=\"${PATH}:/go/bin\"\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\n\nRUN go install github.com/rakyll/gotest@latest\n\nENTRYPOINT [\"gotest\", \"-v\", \"./cuda/...\"]\n"
  },
  {
    "path": "Dockerfile.ffmpeg-static-alpine",
    "content": "# syntax=docker/dockerfile:1.3\n\n# To build release:\n#   docker buildx build -f Dockerfile.ffmpeg-static-alpine -t ghcr.io/hybridgroup/ffmpeg:5.16-alpine --platform=linux/arm64,linux/amd64 --load .\n\n# linux/amd64 build\nFROM --platform=linux/amd64 alpine:3.20 AS builder-amd64\n\nWORKDIR /\n\nARG FFMPEG_VERSION=5.1.6\nARG XZ_VERSION=5.6.3\n\n# download xz\nRUN wget -O xz-${XZ_VERSION}.tar.bz2 \"https://github.com/tukaani-project/xz/releases/download/v${XZ_VERSION}/xz-${XZ_VERSION}.tar.bz2\" && \\\n        tar -xf xz-${XZ_VERSION}.tar.bz2\n\n# download bzip2\nRUN wget -O bzip2-master.tar.bz2 \"https://gitlab.com/bzip2/bzip2/-/archive/master/bzip2-master.tar.bz2\" && \\\n        tar -xf bzip2-master.tar.bz2\n\n# download ffmpeg source\nRUN wget -O ffmpeg-5.0.tar.bz2 \"https://www.ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2\" && \\\n        tar -xf ffmpeg-5.0.tar.bz2\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev python3\n\n# Build and install xz\nRUN cd xz-${XZ_VERSION} && \\\n        ./configure --disable-shared && \\\n        make && make install\n\n# Build and install bzip2\nRUN cd bzip2-master && \\\n        mkdir build && cd build && \\\n        cmake .. -DCMAKE_BUILD_TYPE=\"Release\" -DENABLE_STATIC_LIB=ON -DENABLE_LIB_ONLY=ON && \\\n        cmake --build . --target install\n\n# Build and install libvpx\nRUN cd ffmpeg-${FFMPEG_VERSION} && \\\n        git -C libvpx pull 2> /dev/null || git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \\\n        cd libvpx && \\\n        ./configure --enable-static --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm && \\\n        make -j $(nproc --all) && make install\n\n# Now finish building ffmpeg\nRUN cd ffmpeg-${FFMPEG_VERSION} && \\\n        ./configure --pkg-config-flags=\"--static\" \\\n        --enable-static --disable-shared --enable-gpl --enable-libx264 --enable-libvpx --enable-zlib \\\n        --disable-sdl2 --disable-vaapi --disable-vdpau --disable-v4l2-m2m --disable-doc && \\\n        make -j $(nproc --all) && make install\n\n\n# linux/arm64 build\nFROM --platform=linux/arm64 alpine:3.20 AS builder-arm64\n\nWORKDIR /\n\nARG FFMPEG_VERSION=5.1.6\nARG XZ_VERSION=5.6.3\n\n# download xz\nRUN wget -O xz-${XZ_VERSION}.tar.bz2 \"https://github.com/tukaani-project/xz/releases/download/v${XZ_VERSION}/xz-${XZ_VERSION}.tar.bz2\" && \\\n        tar -xf xz-${XZ_VERSION}.tar.bz2\n\n# download bzip2\nRUN wget -O bzip2-master.tar.bz2 \"https://gitlab.com/bzip2/bzip2/-/archive/master/bzip2-master.tar.bz2\" && \\\n        tar -xf bzip2-master.tar.bz2\n\n# download ffmpeg source\nRUN wget -O ffmpeg-5.0.tar.bz2 \"https://www.ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2\" && \\\n        tar -xf ffmpeg-5.0.tar.bz2\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev python3\n\n# Build and install xz\nRUN cd xz-${XZ_VERSION} && \\\n        ./configure --disable-shared && \\\n        make && make install\n\n# Build and install bzip2\nRUN cd bzip2-master && \\\n        mkdir build && cd build && \\\n        cmake .. -DCMAKE_BUILD_TYPE=\"Release\" -DENABLE_STATIC_LIB=ON -DENABLE_LIB_ONLY=ON && \\\n        cmake --build . --target install\n\n# Build and install libvpx\nRUN cd ffmpeg-${FFMPEG_VERSION} && \\\n        git -C libvpx pull 2> /dev/null || git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \\\n        cd libvpx && \\\n        ./configure --enable-static --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm && \\\n        make -j $(nproc --all) && make install\n\n# Now finish building ffmpeg\nRUN cd ffmpeg-${FFMPEG_VERSION} && \\\n        ./configure --pkg-config-flags=\"--static\" \\\n        --enable-static --disable-shared --enable-gpl --enable-libx264 --enable-libvpx --enable-zlib \\\n        --disable-sdl2 --disable-vaapi --disable-vdpau --disable-v4l2-m2m --disable-doc && \\\n        make -j $(nproc --all) && make install\n\n# Stage 2: Create final image\nFROM builder-${TARGETARCH} AS final\n\nCMD [\"ffmpeg\"]\n"
  },
  {
    "path": "Dockerfile.gpu",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.gpu .\nFROM ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-11 AS gocv-gpu\n\nENV GOPATH /go\n\nCOPY . /go/src/gocv.io/x/gocv/\n\nWORKDIR /go/src/gocv.io/x/gocv\nRUN go build -tags cuda -o /build/gocv_cuda_version ./cmd/cuda/\n\nCMD [\"/build/gocv_cuda_version\"]\n"
  },
  {
    "path": "Dockerfile.gstreamer-static-alpine",
    "content": "# To build release:\n#   docker buildx build -f Dockerfile.gstreamer-static-alpine -t ghcr.io/hybridgroup/gstreamer:1.24-alpine --platform=linux/arm64,linux/amd64 --progress plain  --load .\n\nFROM --platform=linux/amd64 alpine:3.20 AS builder-amd64\n\nWORKDIR /gstreamer\n\nARG GST_BUILD_VERSION=1.24\nRUN wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/${GST_BUILD_VERSION}/gstreamer-${GST_BUILD_VERSION}.tar.gz && \\\n\ttar -xzf gstreamer-${GST_BUILD_VERSION}.tar.gz \n\nWORKDIR /gstreamer/gstreamer-${GST_BUILD_VERSION}\n\nRUN apk update && apk add build-base \\\n\t\tlibxml2-dev \\\n\t\tbison \\\n\t\tflex \\\n\t\tglib-dev \\\n\t\tgobject-introspection-dev \\\n\t\tlibcap-dev \\\n\t\tlibcap-utils \\\n\t\tmeson \\\n\t\tperl \\\n\t\twget \\\n\t\tgit cmake \\\n\t\tnasm harfbuzz-static harfbuzz-dev fribidi-static fribidi-dev\n\nRUN\tmeson --default-library=static --prefix=/gstbin  \\\n\t-Dgst-full-target-type=static_library \\\n\t-Dgst-full=enabled \\\n\t-Dauto_features=disabled \\\n\t-Dgst-plugins-base:app=enabled \\\n\t-Dgst-plugins-base:playback=enabled \\\n\t-Dgst-plugins-base:rawparse=enabled \\\n\t-Dgst-plugins-base:tcp=enabled \\\n\t-Dgst-plugins-base:videoconvertscale=enabled \\\n\t-Dgst-plugins-base:videotestsrc=enabled \\\n\t-Dgst-plugins-good:isomp4=enabled \\\n\t-Dgst-plugins-good:rtp=enabled \\\n\t-Dgst-plugins-good:udp=enabled \\\n\t-Dgst-plugins-good:rtsp=enabled \\\n\t-Dgst-plugins-good:rtpmanager=enabled \\\n\t-Dgst-plugins-good:audioparsers=enabled \\\n\t-Dgst-plugins-bad:videoparsers=enabled \\\n\t-Dgst-plugins-bad:codectimestamper=enabled \\\n\t-Dgst-plugins-bad:openh264=enabled \\\n\t-Dtools=enabled \\\n\tbuild\n\nRUN meson compile -C build\n\nRUN meson install -C build\n\n\nFROM --platform=linux/arm64 alpine:3.20 AS builder-arm64\n\nWORKDIR /gstreamer\n\nARG GST_BUILD_VERSION=1.24\nRUN wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/${GST_BUILD_VERSION}/gstreamer-${GST_BUILD_VERSION}.tar.gz && \\\n\ttar -xzf gstreamer-${GST_BUILD_VERSION}.tar.gz \n\nWORKDIR /gstreamer/gstreamer-${GST_BUILD_VERSION}\n\nRUN apk update && apk add build-base \\\n\t\tlibxml2-dev \\\n\t\tbison \\\n\t\tflex \\\n\t\tglib-dev \\\n\t\tgobject-introspection-dev \\\n\t\tlibcap-dev \\\n\t\tlibcap-utils \\\n\t\tmeson \\\n\t\tperl \\\n\t\twget \\\n\t\tgit cmake \\\n\t\tnasm harfbuzz-static harfbuzz-dev fribidi-static fribidi-dev\n\nRUN\tmeson --default-library=static --prefix=/gstbin  \\\n\t-Dgst-full-target-type=static_library \\\n\t-Dgst-full=enabled \\\n\t-Dauto_features=disabled \\\n\t-Dgst-plugins-base:app=enabled \\\n\t-Dgst-plugins-base:playback=enabled \\\n\t-Dgst-plugins-base:tcp=enabled \\\n\t-Dgst-plugins-base:rawparse=enabled \\\n\t-Dgst-plugins-base:videoconvertscale=enabled \\\n\t-Dgst-plugins-base:videotestsrc=enabled \\\n\t-Dgst-plugins-good:isomp4=enabled \\\n\t-Dgst-plugins-good:rtp=enabled \\\n\t-Dgst-plugins-good:udp=enabled \\\n\t-Dgst-plugins-good:rtsp=enabled \\\n\t-Dgst-plugins-good:rtpmanager=enabled \\\n\t-Dgst-plugins-good:audioparsers=enabled \\\n\t-Dgst-plugins-bad:videoparsers=enabled \\\n\t-Dgst-plugins-bad:codectimestamper=enabled \\\n\t-Dgst-plugins-bad:openh264=enabled \\\n\t-Dtools=enabled \\\n\tbuild\n\nRUN meson compile -C build\n\nRUN meson install -C build\n\nARG TARGETARCH\n\nFROM builder-${TARGETARCH} AS final\n\nENV PATH=/gstbin/bin:${PATH}\nENV PKG_CONFIG_PATH=/gstbin/lib/pkgconfig\n"
  },
  {
    "path": "Dockerfile.opencv",
    "content": "# OpenCV 4 prebuilt multiarchitecture image\n#\n# To build release:\n#   docker buildx build -f Dockerfile.opencv -t ghcr.io/hybridgroup/opencv:4.13.0 -t ghcr.io/hybridgroup/opencv:latest --platform=linux/arm64,linux/amd64 --push .\n#\n# To build prerelease:\n#   docker buildx build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv -t ghcr.io/hybridgroup/opencv:4.13.0-dev --platform=linux/arm64,linux/amd64 --push .\n\n\n###################\n# amd64 build stage\n###################\n\nFROM --platform=linux/amd64 golang:1.25-bookworm AS opencv-base-amd64\nLABEL maintainer=\"hybridgroup\"\n\nRUN apt-get update && apt-get install -y \\\n      git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg62-turbo-dev libpng-dev libtiff-dev libdc1394-dev nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nFROM --platform=linux/amd64 opencv-base-amd64 AS opencv-build-amd64\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip\n\nRUN cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(( $(nproc) - 1 )) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\n\n###################\n# arm64 build stage\n###################\n\nFROM --platform=linux/arm64 golang:1.25-bookworm AS opencv-base-arm64\nLABEL maintainer=\"hybridgroup\"\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n      git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg62-turbo-dev libpng-dev libtiff-dev libdc1394-dev && \\\n      apt-get autoremove -y && apt-get autoclean -y\n\nFROM --platform=linux/arm64 opencv-base-arm64 AS opencv-build-arm64\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip\n\nRUN cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D ENABLE_NEON=ON \\\n      -D WITH_FFMPEG=ON \\\n      -D WITH_TBB=ON \\\n      -D BUILD_TBB=ON \\\n      -D BUILD_TESTS=OFF \\\n      -D WITH_EIGEN=OFF \\\n      -D WITH_GSTREAMER=OFF \\\n      -D WITH_V4L=ON \\\n      -D WITH_LIBV4L=ON \\\n      -D WITH_VTK=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D BUILD_JPEG=ON \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON \\\n      -D CMAKE_TOOLCHAIN_FILE=../platforms/linux/aarch64-gnu.toolchain.cmake .. && \\\n      make -j $(( $(nproc) - 1 )) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nARG TARGETARCH\n\n###################\n# multiarch build stage\n###################\n\nFROM opencv-build-${TARGETARCH} as opencv-final\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-gpu-cuda-10",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-gpu-cuda-10 -t ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-10 .\nFROM nvidia/cuda:10.2-cudnn8-devel AS opencv-gpu-base\nLABEL maintainer=\"hybridgroup\"\n\n# needed for cuda repo key rotation. see:\n# https://forums.developer.nvidia.com/t/notice-cuda-linux-repository-key-rotation/212771\n#\nRUN apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n    libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nRUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D WITH_CUDA=ON \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D CUDA_FAST_MATH=1 \\\n    -D WITH_CUBLAS=1 \\\n    -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \\\n    -D BUILD_opencv_cudacodec=OFF \\\n    -D WITH_CUDNN=ON \\\n    -D OPENCV_DNN_CUDA=ON \\\n    -D CUDA_GENERATION=Auto \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-gpu-base AS opencv-gpu-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\n\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-gpu-cuda-11",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-gpu-cuda-11 -t ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-11 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-gpu-cuda-11.2.2 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-gpu-cuda-11 .\nFROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 AS opencv-gpu-cuda-11-base\nLABEL maintainer=\"hybridgroup\"\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n    libharfbuzz-dev libfreetype6-dev \\\n    libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-22-dev nasm && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D WITH_FREETYPE=ON \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D BUILD_JPEG=ON \\\n    -D WITH_SIMD=ON \\\n    -D WITH_LIBJPEG_TURBO_SIMD=ON \\\n    -D WITH_CUDA=ON \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D CUDA_FAST_MATH=1 \\\n    -D WITH_CUBLAS=1 \\\n    -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \\\n    -D BUILD_opencv_cudacodec=OFF \\\n    -D WITH_CUDNN=ON \\\n    -D OPENCV_DNN_CUDA=ON \\\n    -D CUDA_ARCH_BIN=6.0,6.1,7.0,7.5,8.0,8.6 \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-gpu-cuda-11-base AS opencv-gpu-cuda-11-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\n\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-gpu-cuda-11.2.2",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-gpu-cuda-11 -t ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-11.2.2 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-gpu-cuda-11.2.2 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-gpu-cuda-11.2.2 .\nFROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04 AS opencv-gpu-cuda-11-base\nLABEL maintainer=\"hybridgroup\"\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n    libharfbuzz-dev libfreetype6-dev \\\n    libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-22-dev nasm && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D WITH_FREETYPE=ON \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D BUILD_JPEG=ON \\\n    -D WITH_SIMD=ON \\\n    -D WITH_LIBJPEG_TURBO_SIMD=ON \\\n    -D WITH_CUDA=ON \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D CUDA_FAST_MATH=1 \\\n    -D WITH_CUBLAS=1 \\\n    -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \\\n    -D BUILD_opencv_cudacodec=OFF \\\n    -D WITH_CUDNN=ON \\\n    -D OPENCV_DNN_CUDA=ON \\\n    -D CUDA_ARCH_BIN=6.0,6.1,7.0,7.5,8.0,8.6 \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-gpu-cuda-11-base AS opencv-gpu-cuda-11-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\n\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-gpu-cuda-12",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-gpu-cuda-12 -t ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-12 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-gpu-cuda-12 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-gpu-cuda-12 .\nFROM nvidia/cuda:12.6.1-cudnn-devel-ubuntu22.04 AS opencv-gpu-cuda-12-base\nLABEL maintainer=\"hybridgroup\"\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n    libharfbuzz-dev libfreetype6-dev \\\n    libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-dev nasm && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D WITH_FREETYPE=ON \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D BUILD_JPEG=ON \\\n    -D WITH_SIMD=ON \\\n    -D WITH_LIBJPEG_TURBO_SIMD=ON \\\n    -D WITH_CUDA=ON \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D CUDA_FAST_MATH=1 \\\n    -D WITH_CUBLAS=1 \\\n    -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \\\n    -D BUILD_opencv_cudacodec=OFF \\\n    -D WITH_CUDNN=ON \\\n    -D OPENCV_DNN_CUDA=ON \\\n    -D CUDA_ARCH_BIN=6.0,6.1,7.0,7.5,8.0,8.6,8.9,9.0 \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-gpu-cuda-12-base AS opencv-gpu-cuda-12-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\n\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-gpu-cuda-13",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-gpu-cuda-13 -t ghcr.io/hybridgroup/opencv:4.13.0-gpu-cuda-13 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-gpu-cuda-13 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-gpu-cuda-13 .\nFROM nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04 AS opencv-gpu-cuda-13-base\nLABEL maintainer=\"hybridgroup\"\nENV DEBIAN_FRONTEND=noninteractive\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev \\\n    libharfbuzz-dev libfreetype6-dev \\\n    libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-dev nasm && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D WITH_FREETYPE=ON \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D BUILD_JPEG=ON \\\n    -D WITH_SIMD=ON \\\n    -D WITH_LIBJPEG_TURBO_SIMD=ON \\\n    -D WITH_CUDA=ON \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D CUDA_FAST_MATH=1 \\\n    -D WITH_CUBLAS=1 \\\n    -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \\\n    -D BUILD_opencv_cudacodec=OFF \\\n    -D WITH_CUDNN=ON \\\n    -D OPENCV_DNN_CUDA=ON \\\n    -D CUDA_ARCH_BIN=7.5,8.0,8.6,8.9,9.0,10.0,10.3,11.0,12.0,12.1 \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-gpu-cuda-13-base AS opencv-gpu-cuda-13-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\n\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-openvino",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-openvino -t ghcr.io/hybridgroup/opencv:4.13.0-openvino\nFROM openvino/ubuntu20_dev:2022.1.0 AS opencv-openvino-base\nLABEL maintainer=\"hybridgroup\"\nENV DEBIAN_FRONTEND=noninteractive\nUSER root\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n    git build-essential cmake pkg-config unzip libgtk2.0-dev \\\n    wget curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n    libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n    libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev && \\\n    rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nRUN curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    rm opencv.zip opencv_contrib.zip && \\\n    cd opencv-${OPENCV_VERSION} && \\\n    mkdir build && cd build && \\\n    cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n    -D WITH_IPP=OFF \\\n    -D WITH_OPENGL=OFF \\\n    -D WITH_QT=OFF \\\n    -D CMAKE_INSTALL_PREFIX=/usr/local \\\n    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n    -D OPENCV_ENABLE_NONFREE=ON \\\n    -D WITH_JASPER=OFF \\\n    -D BUILD_DOCS=OFF \\\n    -D BUILD_EXAMPLES=OFF \\\n    -D BUILD_TESTS=OFF \\\n    -D BUILD_PERF_TESTS=ON \\\n    -D BUILD_opencv_java=NO \\\n    -D BUILD_opencv_python=NO \\\n    -D BUILD_opencv_python2=NO \\\n    -D BUILD_opencv_python3=NO \\\n    -D WITH_TBB=ON \\\n    -D WITH_OPENVINO=1 \\\n    -D ENABLE_FAST_MATH=1 \\\n    -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n    make -j $(nproc --all) && \\\n    make preinstall && make install && ldconfig && \\\n    cd / && rm -rf opencv*\n\n# install golang here\nFROM opencv-openvino-base AS opencv-openvino-golang\n\nENV GO_RELEASE=1.25.5\nRUN wget https://dl.google.com/go/go${GO_RELEASE}.linux-amd64.tar.gz && \\\n    tar xfv go${GO_RELEASE}.linux-amd64.tar.gz -C /usr/local && \\\n    rm go${GO_RELEASE}.linux-amd64.tar.gz\nENV PATH=\"${PATH}:/usr/local/go/bin\"\nUSER openvino\nCMD [\"go version\"]\n"
  },
  {
    "path": "Dockerfile.opencv-static",
    "content": "# OpenCV 4 prebuilt multiarchitecture image\n#\n# To build release:\n#   docker buildx build -f Dockerfile.opencv-static -t ghcr.io/hybridgroup/opencv:4.13.0-static --platform=linux/arm64,linux/amd64 --push .\n#\n# To build prerelease:\n#   docker buildx build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-static -t ghcr.io/hybridgroup/opencv:4.13.0-static-dev --platform=linux/arm64,linux/amd64 --push .\n\n\n###################\n# amd64 build stage\n###################\n\nFROM --platform=linux/amd64 golang:1.25-bookworm AS opencv-base-amd64\nLABEL maintainer=\"hybridgroup\"\nRUN apt-get update && apt-get -y install \\\n      autoconf automake libass-dev libgnutls28-dev \\\n      libmp3lame-dev libtool libvorbis-dev \\\n      meson ninja-build pkg-config \\\n      texinfo wget yasm \\\n      zlib1g-dev libx264-dev libvpx-dev \\\n      libopus-dev libdav1d-dev \\\n      git build-essential cmake pkg-config unzip \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nRUN wget -O ffmpeg-5.0.tar.bz2 \"https://www.ffmpeg.org/releases/ffmpeg-5.1.6.tar.bz2\" && \\\n      tar -xf ffmpeg-5.0.tar.bz2\n\nRUN cd ffmpeg-5.1.6 && \\\n      ./configure --pkg-config-flags=\"--static\" \\\n      --enable-static --disable-shared --enable-gpl --enable-libx264 --enable-libvpx --enable-zlib \\\n      --disable-sdl2 --disable-vaapi --disable-vdpau --disable-v4l2-m2m --disable-doc && \\\n      make -j $(nproc --all) && make install && ldconfig\n\nFROM --platform=linux/amd64 opencv-base-amd64 AS opencv-build-amd64\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip\n\nRUN cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=ON \\\n      -D BUILD_WITH_DYNAMIC_IPP=OFF \\\n      -D BUILD_IPP_IW=ON \\\n      -D WITH_OPENGL=ON \\\n      -D BUILD_OPENGL=ON \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D BUILD_SHARED_LIBS=OFF \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n      -D WITH_QUIRC=ON \\\n      -D WITH_GTK=OFF \\\n      -D WITH_FFMPEG=ON \\\n      -D WITH_1394=ON \\\n      -D BUILD_1394=ON \\\n      -D WITH_WEBP=ON \\\n      -D BUILD_WEBP=ON \\\n      -D WITH_OPENJPEG=ON \\\n      -D BUILD_OPENJPEG=ON \\\n      -D WITH_TIFF=ON \\\n      -D BUILD_TIFF=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=OFF \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(( $(nproc) - 1 )) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\n###################\n# arm64 build stage\n###################\n\nFROM --platform=linux/arm64 golang:1.25-bookworm AS opencv-base-arm64\nLABEL maintainer=\"hybridgroup\"\nRUN apt-get update && apt-get -y install \\\n      autoconf automake libass-dev libgnutls28-dev \\\n      libmp3lame-dev libtool libvorbis-dev \\\n      meson ninja-build pkg-config \\\n      texinfo wget yasm \\\n      zlib1g-dev libx264-dev libvpx-dev \\\n      libopus-dev libdav1d-dev \\\n      git build-essential cmake pkg-config unzip \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nRUN wget -O ffmpeg-5.0.tar.bz2 \"https://www.ffmpeg.org/releases/ffmpeg-5.1.6.tar.bz2\" && \\\n      tar -xf ffmpeg-5.0.tar.bz2\n\nRUN cd ffmpeg-5.1.6 && \\\n      ./configure --pkg-config-flags=\"--static\" \\\n      --enable-static --disable-shared --enable-gpl --enable-libx264 --enable-libvpx --enable-zlib \\\n      --disable-sdl2 --disable-vaapi --disable-vdpau --disable-v4l2-m2m --disable-doc && \\\n      make -j $(nproc --all) && make install && ldconfig\n\nFROM --platform=linux/arm64 opencv-base-arm64 AS opencv-build-arm64\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip\n\nRUN cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=ON \\\n      -D BUILD_OPENGL=ON \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D BUILD_SHARED_LIBS=OFF \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D ENABLE_NEON=ON \\\n      -D WITH_TBB=ON \\\n      -D BUILD_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n      -D WITH_QUIRC=ON \\\n      -D WITH_GTK=OFF \\\n      -D WITH_FFMPEG=ON \\\n      -D WITH_1394=ON \\\n      -D BUILD_1394=ON \\\n      -D WITH_WEBP=ON \\\n      -D BUILD_WEBP=ON \\\n      -D WITH_OPENJPEG=ON \\\n      -D BUILD_OPENJPEG=ON \\\n      -D WITH_TIFF=ON \\\n      -D BUILD_TIFF=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=OFF \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(( $(nproc) - 1 )) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nARG TARGETARCH\n\n###################\n# multiarch build stage\n###################\n\nFROM opencv-build-${TARGETARCH} AS opencv-final\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-static-alpine",
    "content": "# syntax=docker/dockerfile:1.3\n\n# To build release:\n#   docker buildx build -f Dockerfile.opencv-static-alpine -t ghcr.io/hybridgroup/opencv:4.11-alpine --platform=linux/arm64,linux/amd64 --load .\n\n# linux/amd64 build\n\nFROM --platform=linux/amd64 ghcr.io/hybridgroup/gstreamer:1.24-alpine AS gstreamer-amd64\n\n# Stage 1: Build OpenCV\nFROM --platform=linux/amd64 ghcr.io/hybridgroup/ffmpeg:5.16-alpine AS builder-amd64\n\n# Set OpenCV version\nARG OPENCV_VERSION=4.13.0\n\n# Download OpenCV source code\nWORKDIR /opencv\nRUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    mv opencv-${OPENCV_VERSION} opencv\n\nWORKDIR /opencv_contrib\nRUN wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    mv opencv_contrib-${OPENCV_VERSION} opencv_contrib\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev openssl \\\n    libxml2-dev \\\n    bison \\\n    flex \\\n    glib-dev glib-static \\\n    gobject-introspection-dev \\\n    libcap-dev \\\n    libcap-utils \\\n    meson\n\n# copy gstreamer\nCOPY --from=gstreamer-amd64 /gstbin/lib /usr/local/lib\nCOPY --from=gstreamer-amd64 /gstbin/include/gstreamer-1.0/gst /usr/local/include/gst\n\n# patch opencv for static gstreamer\nCOPY ./patches/gstreamer-full.patch /opencv/opencv\nRUN cd /opencv/opencv && \\\n    patch -p1 < gstreamer-full.patch\n\n# Build OpenCV\nENV PKG_CONFIG_PATH=/usr/local/lib/gstreamer-1.0/pkgconfig:/usr/local/lib/pkgconfig\nENV GSTREAMER_STATIC_LIB=/usr/local/lib/gstreamer-1.0\n\nWORKDIR /opencv/opencv/build\nRUN cmake -D CMAKE_BUILD_TYPE=Release \\\n          -D CMAKE_INSTALL_PREFIX=/usr/local \\\n          -D WITH_IPP=ON \\\n          -D BUILD_WITH_DYNAMIC_IPP=OFF \\\n          -D BUILD_IPP_IW=ON \\\n          -D WITH_OPENGL=ON \\\n          -D BUILD_OPENGL=ON \\\n          -D WITH_QT=OFF \\\n          -D WITH_FREETYPE=OFF \\\n          -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/opencv_contrib/modules \\\n          -D OPENCV_ENABLE_NONFREE=ON \\\n          -D BUILD_SHARED_LIBS=OFF \\\n          -D WITH_FFMPEG=ON \\\n          -D WITH_GSTREAMER=ON \\\n          -D WITH_TBB=ON \\\n          -D WITH_SIMD=ON \\\n          -D BUILD_EXAMPLES=OFF \\\n          -D BUILD_TESTS=OFF \\\n          -D BUILD_PERF_TESTS=OFF \\\n          -D OPENCV_GENERATE_PKGCONFIG=ON \\\n          -D WITH_WEBP=ON \\\n          -D BUILD_WEBP=ON \\\n          -D WITH_OPENJPEG=ON \\\n          -D BUILD_OPENJPEG=ON \\\n          -D BUILD_TIFF=ON \\\n          -D BUILD_PNG=ON \\\n          -D BUILD_ZLIB=ON \\\n          -D BUILD_JPEG=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_opencv_java=NO \\\n          -D BUILD_opencv_python=NO \\\n          -D BUILD_opencv_python2=NO \\\n          -D BUILD_opencv_python3=NO \\\n          .. && \\\n    make -j$(nproc) && \\\n    make install\n\n\n# linux/arm64 build\nFROM --platform=linux/arm64 ghcr.io/hybridgroup/gstreamer:1.24-alpine AS gstreamer-arm64\n\nFROM --platform=linux/arm64 ghcr.io/hybridgroup/ffmpeg:5.16-alpine AS builder-arm64\n\n# Set OpenCV version\nARG OPENCV_VERSION=4.13.0\n\n# Download OpenCV source code\nWORKDIR /opencv\nRUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    mv opencv-${OPENCV_VERSION} opencv\n\nWORKDIR /opencv_contrib\nRUN wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    mv opencv_contrib-${OPENCV_VERSION} opencv_contrib\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev openssl \\\n    libxml2-dev \\\n    bison \\\n    flex \\\n    glib-dev glib-static \\\n    gobject-introspection-dev \\\n    libcap-dev \\\n    libcap-utils \\\n    meson\n\n# copy gstreamer\nCOPY --from=gstreamer-arm64 /gstbin/lib /usr/local/lib\nCOPY --from=gstreamer-arm64 /gstbin/include/gstreamer-1.0/gst /usr/local/include/gst\n\n# patch opencv for static gstreamer\nCOPY ./patches/gstreamer-full.patch /opencv/opencv\nRUN cd /opencv/opencv && \\\n    patch -p1 < gstreamer-full.patch\n\n# Build OpenCV\nENV PKG_CONFIG_PATH=/usr/local/lib/gstreamer-1.0/pkgconfig:/usr/local/lib/pkgconfig\nENV GSTREAMER_STATIC_LIB=/usr/local/lib/gstreamer-1.0\n\nWORKDIR /opencv/opencv/build\nRUN cmake -D CMAKE_BUILD_TYPE=Release \\\n          -D CMAKE_INSTALL_PREFIX=/usr/local \\\n          -D WITH_IPP=OFF \\\n          -D ENABLE_NEON=ON \\\n          -D WITH_OPENGL=ON \\\n          -D BUILD_OPENGL=ON \\\n          -D WITH_QT=OFF \\\n          -D WITH_FREETYPE=OFF \\\n          -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/opencv_contrib/modules \\\n          -D OPENCV_ENABLE_NONFREE=ON \\\n          -D BUILD_SHARED_LIBS=OFF \\\n          -D WITH_FFMPEG=ON \\\n          -D WITH_GSTREAMER=ON \\\n          -D WITH_TBB=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_EXAMPLES=OFF \\\n          -D BUILD_TESTS=OFF \\\n          -D BUILD_PERF_TESTS=OFF \\\n          -D OPENCV_GENERATE_PKGCONFIG=ON \\\n          -D WITH_WEBP=ON \\\n          -D BUILD_WEBP=ON \\\n          -D WITH_OPENJPEG=ON \\\n          -D BUILD_OPENJPEG=ON \\\n          -D BUILD_TIFF=ON \\\n          -D BUILD_PNG=ON \\\n          -D BUILD_ZLIB=ON \\\n          -D BUILD_JPEG=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_opencv_java=NO \\\n          -D BUILD_opencv_python=NO \\\n          -D BUILD_opencv_python2=NO \\\n          -D BUILD_opencv_python3=NO \\\n          .. && \\\n    make -j$(nproc) && \\\n    make install\n\n# Stage 2: Create final image\nFROM builder-${TARGETARCH} AS final\n\n# Set environment variables\nENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/opencv4/3rdparty:${LD_LIBRARY_PATH}\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-static-alpine-ffmpeg",
    "content": "# syntax=docker/dockerfile:1.3\n\n# To build release:\n#   docker buildx build -f Dockerfile.opencv-static-alpine-ffmpeg -t ghcr.io/hybridgroup/opencv:4.10-alpine-ffmpeg --platform=linux/arm64,linux/amd64 --load .\n\n# linux/amd64 build\n\n# Stage 1: Build OpenCV\nFROM --platform=linux/amd64 ghcr.io/hybridgroup/ffmpeg:5.16-alpine AS builder-amd64\n\n# Set OpenCV version\nARG OPENCV_VERSION=4.13.0\n\n# Download OpenCV source code\nWORKDIR /opencv\nRUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    mv opencv-${OPENCV_VERSION} opencv\n\nWORKDIR /opencv_contrib\nRUN wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    mv opencv_contrib-${OPENCV_VERSION} opencv_contrib\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev openssl \\\n    libxml2-dev \\\n    bison \\\n    flex \\\n    glib-dev \\\n    gobject-introspection-dev \\\n    libcap-dev \\\n    libcap-utils \\\n    meson\n\n# Build OpenCV\nWORKDIR /opencv/opencv/build\nRUN cmake -D CMAKE_BUILD_TYPE=Release \\\n          -D CMAKE_INSTALL_PREFIX=/usr/local \\\n          -D WITH_IPP=ON \\\n          -D BUILD_WITH_DYNAMIC_IPP=OFF \\\n          -D BUILD_IPP_IW=ON \\\n          -D WITH_OPENGL=ON \\\n          -D BUILD_OPENGL=ON \\\n          -D WITH_QT=OFF \\\n          -D WITH_FREETYPE=OFF \\\n          -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/opencv_contrib/modules \\\n          -D OPENCV_ENABLE_NONFREE=ON \\\n          -D BUILD_SHARED_LIBS=OFF \\\n          -D WITH_FFMPEG=ON \\\n          -D WITH_GSTREAMER=OFF \\\n          -D WITH_TBB=ON \\\n          -D WITH_SIMD=ON \\\n          -D BUILD_EXAMPLES=OFF \\\n          -D BUILD_TESTS=OFF \\\n          -D BUILD_PERF_TESTS=OFF \\\n          -D OPENCV_GENERATE_PKGCONFIG=ON \\\n          -D WITH_WEBP=ON \\\n          -D BUILD_WEBP=ON \\\n          -D WITH_OPENJPEG=ON \\\n          -D BUILD_OPENJPEG=ON \\\n          -D BUILD_TIFF=ON \\\n          -D BUILD_PNG=ON \\\n          -D BUILD_ZLIB=ON \\\n          -D BUILD_JPEG=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_opencv_java=NO \\\n          -D BUILD_opencv_python=NO \\\n          -D BUILD_opencv_python2=NO \\\n          -D BUILD_opencv_python3=NO \\\n          .. && \\\n    make -j$(nproc) && \\\n    make install\n\n\n# linux/arm64 build\nFROM --platform=linux/arm64 ghcr.io/hybridgroup/ffmpeg:5.16-alpine AS builder-arm64\n\n# Set OpenCV version\nARG OPENCV_VERSION=4.13.0\n\n# Download OpenCV source code\nWORKDIR /opencv\nRUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv.zip && \\\n    mv opencv-${OPENCV_VERSION} opencv\n\nWORKDIR /opencv_contrib\nRUN wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \\\n    unzip -q opencv_contrib.zip && \\\n    mv opencv_contrib-${OPENCV_VERSION} opencv_contrib\n\n# Install dependencies\nRUN apk update && apk add --no-cache \\\n    build-base \\\n    cmake \\\n    git \\\n    diffutils \\\n    perl \\\n    wget \\\n    unzip \\\n    pkgconfig \\\n    libjpeg-turbo-dev \\\n    libpng-dev \\\n    libwebp-dev \\\n    eigen-dev \\\n    nasm yasm \\\n    bzip2 xz zlib-dev x264-dev libvpx-dev \\\n    opus-dev dav1d-dev openssl \\\n    libxml2-dev \\\n    bison \\\n    flex \\\n    glib-dev \\\n    gobject-introspection-dev \\\n    libcap-dev \\\n    libcap-utils \\\n    meson\n\n# Build OpenCV\nWORKDIR /opencv/opencv/build\nRUN cmake -D CMAKE_BUILD_TYPE=Release \\\n          -D CMAKE_INSTALL_PREFIX=/usr/local \\\n          -D WITH_IPP=OFF \\\n          -D ENABLE_NEON=ON \\\n          -D WITH_OPENGL=ON \\\n          -D BUILD_OPENGL=ON \\\n          -D WITH_QT=OFF \\\n          -D WITH_FREETYPE=OFF \\\n          -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/opencv_contrib/modules \\\n          -D OPENCV_ENABLE_NONFREE=ON \\\n          -D BUILD_SHARED_LIBS=OFF \\\n          -D WITH_FFMPEG=ON \\\n          -D WITH_GSTREAMER=OFF \\\n          -D WITH_TBB=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_EXAMPLES=OFF \\\n          -D BUILD_TESTS=OFF \\\n          -D BUILD_PERF_TESTS=OFF \\\n          -D OPENCV_GENERATE_PKGCONFIG=ON \\\n          -D WITH_WEBP=ON \\\n          -D BUILD_WEBP=ON \\\n          -D WITH_OPENJPEG=ON \\\n          -D BUILD_OPENJPEG=ON \\\n          -D BUILD_TIFF=ON \\\n          -D BUILD_PNG=ON \\\n          -D BUILD_ZLIB=ON \\\n          -D BUILD_JPEG=ON \\\n          -D WITH_SIMD=ON \\\n          -D ENABLE_LIBJPEG_TURBO_SIMD=OFF \\\n          -D BUILD_opencv_java=NO \\\n          -D BUILD_opencv_python=NO \\\n          -D BUILD_opencv_python2=NO \\\n          -D BUILD_opencv_python3=NO \\\n          .. && \\\n    make -j$(nproc) && \\\n    make install\n\n# Stage 2: Create final image\nFROM builder-${TARGETARCH} AS final\n\n# Set environment variables\nENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/opencv4/3rdparty:${LD_LIBRARY_PATH}\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-ubuntu-18.04",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-ubuntu-18.04 -t ghcr.io/hybridgroup/opencv:4.13.0-ubuntu-18.04 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-ubuntu-18.04 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-ubuntu-18.04 .\nFROM ubuntu:18.04 AS opencv-base\nLABEL maintainer=\"hybridgroup\"\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n      git build-essential cmake pkg-config wget unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-22-dev nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip && \\\n      cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(nproc --all) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-ubuntu-20.04",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-ubuntu-20.04 -t ghcr.io/hybridgroup/opencv:4.13.0-ubuntu-20.04 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-ubuntu-20.04 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-ubuntu-20.04 .\nFROM ubuntu:20.04 AS opencv-base\nLABEL maintainer=\"hybridgroup\"\n\nENV TZ=Europe/Madrid\nRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n      tzdata git build-essential cmake pkg-config wget unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-22-dev nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip && \\\n      cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(nproc --all) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-ubuntu-22.04",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-ubuntu-22.04 -t ghcr.io/hybridgroup/opencv:4.13.0-ubuntu-22.04 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-ubuntu-20.04 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-ubuntu-20.04 .\nFROM ubuntu:22.04 AS opencv-base\nLABEL maintainer=\"hybridgroup\"\n\nENV TZ=Europe/Madrid\nRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n      tzdata git build-essential cmake pkg-config wget unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-dev nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip && \\\n      cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(nproc --all) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "Dockerfile.opencv-ubuntu-24.04",
    "content": "# to build this docker image:\n#   docker build -f Dockerfile.opencv-ubuntu-24.04 -t ghcr.io/hybridgroup/opencv:4.13.0-ubuntu-24.04 .\n#   docker build --build-arg OPENCV_VERSION=\"4.x\" --build-arg OPENCV_FILE=\"https://github.com/opencv/opencv/archive/refs/heads/4.x.zip\" --build-arg OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/refs/heads/4.x.zip\" -f Dockerfile.opencv-ubuntu-20.04 -t ghcr.io/hybridgroup/opencv:4.13.0-dev-ubuntu-20.04 .\nFROM ubuntu:24.04 AS opencv-base\nLABEL maintainer=\"hybridgroup\"\n\nENV TZ=Europe/Madrid\nRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone\n\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n      tzdata git build-essential cmake pkg-config wget unzip libgtk2.0-dev \\\n      curl ca-certificates libcurl4-openssl-dev libssl-dev \\\n      libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev \\\n      libharfbuzz-dev libfreetype6-dev \\\n      libjpeg-turbo8-dev libpng-dev libtiff-dev libdc1394-dev nasm && \\\n      rm -rf /var/lib/apt/lists/*\n\nARG OPENCV_VERSION=\"4.13.0\"\nENV OPENCV_VERSION $OPENCV_VERSION\n\nARG OPENCV_FILE=\"https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_FILE $OPENCV_FILE\n\nARG OPENCV_CONTRIB_FILE=\"https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip\"\nENV OPENCV_CONTRIB_FILE $OPENCV_CONTRIB_FILE\n\nRUN curl -Lo opencv.zip ${OPENCV_FILE} && \\\n      unzip -q opencv.zip && \\\n      curl -Lo opencv_contrib.zip ${OPENCV_CONTRIB_FILE} && \\\n      unzip -q opencv_contrib.zip && \\\n      rm opencv.zip opencv_contrib.zip && \\\n      cd opencv-${OPENCV_VERSION} && \\\n      mkdir build && cd build && \\\n      cmake -D CMAKE_BUILD_TYPE=RELEASE \\\n      -D WITH_IPP=OFF \\\n      -D WITH_OPENGL=OFF \\\n      -D WITH_QT=OFF \\\n      -D WITH_FREETYPE=ON \\\n      -D CMAKE_INSTALL_PREFIX=/usr/local \\\n      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules \\\n      -D OPENCV_ENABLE_NONFREE=ON \\\n      -D WITH_JASPER=OFF \\\n      -D WITH_TBB=ON \\\n      -D BUILD_JPEG=ON \\\n      -D WITH_SIMD=ON \\\n      -D ENABLE_LIBJPEG_TURBO_SIMD=ON \\\n      -D BUILD_DOCS=OFF \\\n      -D BUILD_EXAMPLES=OFF \\\n      -D BUILD_TESTS=OFF \\\n      -D BUILD_PERF_TESTS=ON \\\n      -D BUILD_opencv_java=NO \\\n      -D BUILD_opencv_python=NO \\\n      -D BUILD_opencv_python2=NO \\\n      -D BUILD_opencv_python3=NO \\\n      -D OPENCV_GENERATE_PKGCONFIG=ON .. && \\\n      make -j $(nproc --all) && \\\n      make preinstall && make install && ldconfig && \\\n      cd / && rm -rf opencv*\n\nCMD [\"opencv_version\", \"-b\"]\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "Copyright (c) The Hybrid Group and friends\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "Makefile",
    "content": ".ONESHELL:\n.PHONY: test deps download build clean astyle cmds docker\n\n# GoCV version to use.\nGOCV_VERSION?=\"v0.43.0\"\n\n# OpenCV version to use.\nOPENCV_VERSION?=4.13.0\n\n# Go version to use when building Docker image\nGOVERSION?=1.25.5\n\n# Temporary directory to put files into.\nTMP_DIR?=/tmp/\n\n# Build shared or static library\nBUILD_SHARED_LIBS?=ON\n\n# Package list for each well-known Linux distribution\nRPMS=cmake curl wget git gtk2-devel libpng-devel libjpeg-devel libtiff-devel tbb tbb-devel libdc1394-devel unzip gcc-c++\nDEBS=unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev libharfbuzz-dev libfreetype6-dev\nDEBS_BOOKWORM=unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libharfbuzz-dev libfreetype6-dev\nDEBS_UBUNTU_JAMMY=unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev libharfbuzz-dev libfreetype6-dev\nDEBS_UBUNTU_MANTIC=unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbbmalloc2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev libharfbuzz-dev libfreetype6-dev\nDEBS_UBUNTU_NUMBAT=unzip wget build-essential cmake curl git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-dev libharfbuzz-dev libfreetype-dev\nJETSON=build-essential cmake git unzip pkg-config libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libgtk2.0-dev libcanberra-gtk* libxvidcore-dev libx264-dev libgtk-3-dev libtbb2 libtbb-dev libdc1394-dev libv4l-dev v4l-utils libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libavresample-dev libvorbis-dev libxine2-dev libfaac-dev libmp3lame-dev libtheora-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenblas-dev libatlas-base-dev libblas-dev liblapack-dev libeigen3-dev gfortran libhdf5-dev protobuf-compiler libprotobuf-dev libgoogle-glog-dev libgflags-dev\n\nexplain:\n\t@echo \"For quick install with typical defaults of both OpenCV and GoCV, run 'make install'\"\n\n# Detect Linux distribution\ndistro_deps=\nifneq ($(shell which dnf 2>/dev/null),)\n\tdistro_deps=deps_fedora\nendif\nifneq ($(shell which yum 2>/dev/null),)\n\tdistro_deps=deps_rh_centos\nendif\nifneq ($(shell which apt-get 2>/dev/null),)\nifneq ($(shell cat /etc/os-release 2>/dev/null | grep \"Jammy Jellyfish\"),)\n\tdistro_deps=deps_ubuntu_jammy\nendif\nifneq ($(shell cat /etc/os-release 2>/dev/null | grep \"Mantic Minotaur\"),)\n\tdistro_deps=deps_ubuntu_mantic\nendif\nifneq ($(shell cat /etc/os-release 2>/dev/null | grep \"Noble Numbat\"),)\n\tdistro_deps=deps_ubuntu_numbat\nendif\nifneq ($(shell cat /etc/debian_version 2>/dev/null | grep \"11.\"),)\n\tdistro_deps=deps_debian_bullseye\nendif\nifneq ($(shell cat /etc/debian_version 2>/dev/null | grep \"12.\"),)\n\tdistro_deps=deps_debian_bookworm\nendif\nendif\n\n# Install all necessary dependencies.\ndeps: $(distro_deps)\n\ndeps_rh_centos:\n\tsudo yum -y install pkgconfig $(RPMS)\n\ndeps_fedora:\n\tsudo dnf -y install pkgconf-pkg-config $(RPMS)\n\ndeps_debian_bookworm:\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(DEBS_BOOKWORM)\n\ndeps_debian_bullseye:\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(DEBS_BULLSEYE)\n\ndeps_ubuntu_jammy:\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(DEBS_UBUNTU_JAMMY)\n\ndeps_ubuntu_mantic:\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(DEBS_UBUNTU_MANTIC)\n\ndeps_ubuntu_numbat:\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(DEBS_UBUNTU_NUMBAT)\n\ndeps_jetson:\n\tsudo sh -c \"echo '/usr/local/cuda/lib64' >> /etc/ld.so.conf.d/nvidia-tegra.conf\"\n\tsudo ldconfig\n\tsudo apt-get -y update\n\tsudo apt-get -y install $(JETSON)\n\n# Download OpenCV source tarballs.\ndownload:\n\trm -rf $(TMP_DIR)opencv\n\tmkdir $(TMP_DIR)opencv\n\tcd $(TMP_DIR)opencv\n\tcurl -Lo opencv.zip https://github.com/opencv/opencv/archive/refs/tags/$(OPENCV_VERSION).zip\n\tunzip -q opencv.zip\n\tcurl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/refs/tags/$(OPENCV_VERSION).zip\n\tunzip -q opencv_contrib.zip\n\trm opencv.zip opencv_contrib.zip\n\tcd -\n\n# Download openvino source tarballs.\ndownload_openvino:\n\tsudo rm -rf /usr/local/dldt/\n\tsudo rm -rf /usr/local/openvino/\n\tsudo git clone https://github.com/openvinotoolkit/openvino -b 2019_R3.1 /usr/local/openvino/\n\n# Build openvino.\nbuild_openvino_package:\n\tcd /usr/local/openvino/inference-engine\n\tsudo git submodule init\n\tsudo git submodule update --recursive\n\tsudo ./install_dependencies.sh\n\tsudo mv -f thirdparty/clDNN/common/intel_ocl_icd/6.3/linux/Release thirdparty/clDNN/common/intel_ocl_icd/6.3/linux/RELEASE\n\tsudo mkdir build\n\tcd build\n\tsudo rm -rf *\n\tsudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D ENABLE_VPU=ON -D ENABLE_MKL_DNN=ON -D ENABLE_CLDNN=ON ..\n\tsudo $(MAKE) -j $(shell nproc --all --ignore 1)\n\tsudo touch VERSION\n\tsudo mkdir -p src/ngraph\n\tsudo cp thirdparty/ngraph/src/ngraph/version.hpp src/ngraph\n\tcd -\n\n# Build OpenCV.\nbuild:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV on Raspbian with ARM hardware optimizations.\nbuild_raspi:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\nifneq ($(shell uname -m | grep \"aarch64\"),)\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D ENABLE_NEON=ON -D WITH_JASPER=OFF -D WITH_TBB=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D WITH_FREETYPE=ON ..\nelse\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D ENABLE_NEON=ON -D ENABLE_VFPV3=ON -D WITH_JASPER=OFF -D OPENCV_GENERATE_PKGCONFIG=ON -D WITH_FREETYPE=ON ..\nendif\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV on Raspberry pi zero which has ARMv6.\nbuild_raspi_zero:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D ENABLE_VFPV2=ON -D WITH_JASPER=OFF -D OPENCV_GENERATE_PKGCONFIG=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV for NVidia Jetson with CUDA.\nbuild_jetson:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE \\\n\t\t-D CMAKE_INSTALL_PREFIX=/usr/local \\\n\t\t-D EIGEN_INCLUDE_PATH=/usr/include/eigen3 \\\n\t\t-D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \\\n\t\t-D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules \\\n\t\t-D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=OFF -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO \\\n\t\t-D WITH_OPENCL=OFF \\\n\t\t-D WITH_CUDA=ON \\\n\t\t-D CUDA_ARCH_BIN=5.3 \\\n\t\t-D CUDA_ARCH_PTX=\"\" \\\n\t\t-D WITH_CUDNN=ON \\\n\t\t-D WITH_CUBLAS=ON \\\n\t\t-D ENABLE_FAST_MATH=ON \\\n\t\t-D CUDA_FAST_MATH=ON \\\n\t\t-D OPENCV_DNN_CUDA=ON \\\n\t\t-D ENABLE_NEON=ON \\\n\t\t-D WITH_QT=OFF \\\n\t\t-D WITH_OPENMP=ON \\\n\t\t-D WITH_OPENGL=ON \\\n\t\t-D BUILD_TIFF=ON \\\n\t\t-D WITH_FFMPEG=ON \\\n\t\t-D WITH_GSTREAMER=ON \\\n\t\t-D WITH_TBB=ON \\\n\t\t-D BUILD_TBB=ON \\\n\t\t-D BUILD_TESTS=OFF \\\n\t\t-D WITH_EIGEN=ON \\\n\t\t-D WITH_V4L=ON \\\n\t\t-D WITH_LIBV4L=ON \\\n\t\t-D OPENCV_GENERATE_PKGCONFIG=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV with non-free contrib modules.\nbuild_nonfree:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV with openvino.\nbuild_openvino:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D ENABLE_CXX11=ON -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D WITH_INF_ENGINE=ON -D InferenceEngine_DIR=/usr/local/dldt/inference-engine/build -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_ENABLE_NONFREE=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV with cuda.\nbuild_cuda:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DBUILD_opencv_cudacodec=OFF -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D CUDA_GENERATION=Auto -DOPENCV_ENABLE_NONFREE=ON -D WITH_GSTREAMER=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV statically linked\nbuild_static:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=OFF -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -DWITH_JASPER=OFF -DWITH_QT=OFF -DWITH_GTK=OFF -DWITH_FFMPEG=OFF -DWITH_TIFF=OFF -DWITH_WEBP=OFF -DWITH_PNG=OFF -DWITH_1394=OFF -DWITH_OPENJPEG=OFF -DOPENCV_GENERATE_PKGCONFIG=ON ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Build OpenCV with cuda.\nbuild_all:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)\n\tmkdir build\n\tcd build\n\trm -rf *\n\tcmake -j $(shell nproc --all --ignore 1) -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -D ENABLE_CXX11=ON -D OPENCV_EXTRA_MODULES_PATH=$(TMP_DIR)opencv/opencv_contrib-$(OPENCV_VERSION)/modules -D WITH_INF_ENGINE=ON -D InferenceEngine_DIR=/usr/local/dldt/inference-engine/build -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=ON -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -D WITH_JASPER=OFF -D WITH_TBB=ON -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DBUILD_opencv_cudacodec=OFF -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D CUDA_GENERATION=Auto ..\n\t$(MAKE) -j $(shell nproc --all --ignore 1)\n\t$(MAKE) preinstall\n\tcd -\n\n# Cleanup temporary build files.\nclean:\n\tgo clean --cache\n\trm -rf $(TMP_DIR)opencv\n\n# Cleanup old library files.\nsudo_pre_install_clean:\nifneq (,$(wildcard /usr/local/lib/libopencv*))\n\tsudo rm -rf /usr/local/lib/cmake/opencv4/\n\tsudo rm -rf /usr/local/lib/libopencv*\n\tsudo rm -rf /usr/local/lib/pkgconfig/opencv*\n\tsudo rm -rf /usr/local/include/opencv*\nelse\nifneq (,$(wildcard /usr/local/lib64/libopencv*))\n\tsudo rm -rf /usr/local/lib64/cmake/opencv4/\n\tsudo rm -rf /usr/local/lib64/libopencv*\n\tsudo rm -rf /usr/local/lib64/pkgconfig/opencv*\n\tsudo rm -rf /usr/local/include/opencv*\nelse\nifneq (,$(wildcard /usr/local/lib/aarch64-linux-gnu/libopencv*))\n\tsudo rm -rf /usr/local/lib/aarch64-linux-gnu/cmake/opencv4/\n\tsudo rm -rf /usr/local/lib/aarch64-linux-gnu/libopencv*\n\tsudo rm -rf /usr/local/lib/aarch64-linux-gnu/pkgconfig/opencv*\n\tsudo rm -rf /usr/local/include/opencv*\nendif\nendif\nendif\n\n# Do everything.\ninstall:\nifeq ($(shell uname -s),Darwin)\n\t@echo \"Detected macOS. Installing dependencies...\"\n\tbrew install opencv\n\tbrew install pkgconfig\nendif\n\t@$(MAKE) deps download sudo_pre_install_clean build sudo_install clean verify\n\t@go run ./cmd/version/main.go\n\n# Do everything on Raspbian.\ninstall_raspi: deps download sudo_pre_install_clean build_raspi sudo_install clean verify\n\n# Do everything on the raspberry pi zero.\ninstall_raspi_zero: deps download sudo_pre_install_clean build_raspi_zero sudo_install clean verify\n\n# Do everything on Jetson.\ninstall_jetson: deps_jetson download sudo_pre_install_clean build_jetson sudo_install clean verify\n\n# Do everything with cuda.\ninstall_cuda: deps download sudo_pre_install_clean build_cuda sudo_install clean verify verify_cuda\n\n# Do everything with openvino.\ninstall_openvino: deps download download_openvino sudo_pre_install_clean build_openvino_package sudo_install_openvino build_openvino sudo_install clean verify_openvino\n\n# Do everything statically.\ninstall_static: deps download sudo_pre_install_clean build_static sudo_install clean verify_static\n\n# Do everything with non-free modules from cpencv_contrib.\ninstall_nonfree: deps download sudo_pre_install_clean build_nonfree sudo_install clean verify\n\n# Do everything with openvino and cuda.\ninstall_all: deps download download_openvino sudo_pre_install_clean build_openvino_package sudo_install_openvino build_all sudo_install clean verify_openvino verify_cuda\n\n# Install system wide.\nsudo_install:\n\tcd $(TMP_DIR)opencv/opencv-$(OPENCV_VERSION)/build\n\tsudo $(MAKE) install\n\tsudo ldconfig\n\tcd -\n\n# Install system wide.\nsudo_install_openvino:\n\tcd /usr/local/openvino/inference-engine/build\n\tsudo $(MAKE) install\n\tsudo ldconfig\n\tcd -\n\n# Build a minimal Go app to confirm gocv works.\nverify:\n\tgo run ./cmd/version/main.go\n\n# Build a minimal Go app to confirm gocv works with statically built OpenCV.\nverify_static:\n\tgo run -tags static ./cmd/version/main.go\n\n# Build a minimal Go app to confirm gocv cuda works.\nverify_cuda:\n\tgo run ./cmd/cuda/main.go\n\n# Build a minimal Go app to confirm gocv openvino works.\nverify_openvino:\n\tgo run -tags openvino ./cmd/version/main.go\n\n# testdata.\n.PHONY: create_testdata_dir download_wechat_testdata download_onnx_testdata download_goturn_testdata testdata\ncreate_testdata_dir:\n\tmkdir -p ./testdata\n\ndownload_wechat_testdata: create_testdata_dir\n\tcurl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.caffemodel > ./testdata/detect.caffemodel\n\tcurl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/detect.prototxt > ./testdata/detect.prototxt\n\tcurl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.caffemodel > ./testdata/sr.caffemodel\n\tcurl -sL https://raw.githubusercontent.com/WeChatCV/opencv_3rdparty/wechat_qrcode/sr.prototxt > ./testdata/sr.prototxt\n\ndownload_onnx_testdata: create_testdata_dir\n\tcurl -sL https://github.com/onnx/models/raw/main/validated/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx > ./testdata/googlenet-9.onnx\n\tcurl -sL https://github.com/opencv/opencv_zoo/raw/refs/heads/main/models/face_recognition_sface/face_recognition_sface_2021dec.onnx > ./testdata/face_recognition_sface_2021dec.onnx\n\tcurl -sL https://github.com/opencv/opencv_zoo/raw/refs/heads/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx > ./testdata/face_detection_yunet_2023mar.onnx\n\tcurl -sL https://github.com/opencv/opencv_zoo/raw/refs/heads/main/models/object_tracking_vittrack/object_tracking_vittrack_2023sep.onnx > ./testdata/object_tracking_vittrack_2023sep.onnx\n\ndownload_goturn_testdata: create_testdata_dir\n\tcurl -sL https://raw.githubusercontent.com/opencv/opencv_extra/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt > ./testdata/goturn.prototxt\n\tcurl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001 > ./testdata/goturn.caffemodel.zip.001\n\tcurl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002 > ./testdata/goturn.caffemodel.zip.002\n\tcurl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003 > ./testdata/goturn.caffemodel.zip.003\n\tcurl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004 > ./testdata/goturn.caffemodel.zip.004\n\tcat ./testdata/goturn.caffemodel.zip.001 ./testdata/goturn.caffemodel.zip.002 ./testdata/goturn.caffemodel.zip.003 ./testdata/goturn.caffemodel.zip.004 > ./testdata/goturn.caffemodel.zip\n\tunzip -o ./testdata/goturn.caffemodel.zip goturn.caffemodel -d ./testdata\n\ntestdata: create_testdata_dir download_wechat_testdata download_onnx_testdata download_goturn_testdata\n\n# Runs tests.\ntest:\n\tgo test -tags matprofile . ./contrib\n\ntest_cuda:\n\tgo test -tags matprofile ./cuda\n\ndocker:\n\tdocker build --build-arg OPENCV_VERSION=$(OPENCV_VERSION) --build-arg GOVERSION=$(GOVERSION) .\n\nastyle:\n\tastyle --project=.astylerc --recursive *.cpp,*.h\n\n\nreleaselog:\n\tgit log --pretty=format:\"%s\" $(GOCV_VERSION)..HEAD\n\nCMDS=basic-drawing caffe-classifier captest capwindow counter dnn-detection dnn-pose-detection dnn-style-transfer faceblur facedetect facedetect-from-url feature-matching find-chessboard find-circles find-lines hand-gestures hello img-similarity mjpeg-streamer motion-detect saveimage savevideo showimage ssd-facedetect tf-classifier tracking version xphoto\ncmds:\n\tfor cmd in $(CMDS) ; do \\\n\t\tgo build -o build/$$cmd cmd/$$cmd/main.go ;\n\tdone ; \\\n"
  },
  {
    "path": "README.md",
    "content": "# GoCV\n\n[![GoCV](https://raw.githubusercontent.com/hybridgroup/gocv/release/images/gocvlogo.jpg)](http://gocv.io/)\n\n[![Go Reference](https://pkg.go.dev/badge/gocv.io/x/gocv.svg)](https://pkg.go.dev/gocv.io/x/gocv)\n[![Linux](https://github.com/hybridgroup/gocv/actions/workflows/linux.yml/badge.svg?branch=dev)](https://github.com/hybridgroup/gocv/actions/workflows/linux.yml)\n[![macOS](https://github.com/hybridgroup/gocv/actions/workflows/macos.yml/badge.svg?branch=dev)](https://github.com/hybridgroup/gocv/actions/workflows/macos.yml)\n[![Windows](https://github.com/hybridgroup/gocv/actions/workflows/windows.yml/badge.svg?branch=dev)](https://github.com/hybridgroup/gocv/actions/workflows/windows.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hybridgroup/gocv)](https://goreportcard.com/report/github.com/hybridgroup/gocv)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/hybridgroup/gocv/blob/release/LICENSE.txt)\n\nThe GoCV package provides Go language bindings for the [OpenCV 4](http://opencv.org/) computer vision library.\n\nThe GoCV package supports the latest releases of Go and OpenCV (v4.12.0) on Linux, Docker, macOS, and Windows. Our ongoing mission is help the Go programming language be a \"first-class\" client compatible with the latest developments in the OpenCV ecosystem.\n\nGoCV supports [CUDA](https://en.wikipedia.org/wiki/CUDA) for hardware acceleration using Nvidia GPUs. Check out the [CUDA README](./cuda/README.md) for more info on how to use GoCV with OpenCV/CUDA.\n\nGoCV also supports [Intel OpenVINO](https://software.intel.com/en-us/openvino-toolkit). Check out the [OpenVINO README](./openvino/README.md) for more info on how to use GoCV with the Intel OpenVINO toolkit.\n\n## How to use\n\n### Hello, video\n\nThis example opens a video capture device using device \"0\", reads frames, and shows the video in a GUI window:\n\n```go\npackage main\n\nimport (\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\twebcam, _ := gocv.OpenVideoCapture(0)\n\twindow := gocv.NewWindow(\"Hello\")\n\timg := gocv.NewMat()\n\n\tfor {\n\t\twebcam.Read(&img)\n\t\twindow.IMShow(img)\n\t\twindow.WaitKey(1)\n\t}\n}\n```\n\n### Face detect\n\n![GoCV](https://raw.githubusercontent.com/hybridgroup/gocv/release/images/face-detect.jpg)\n\nThis is a more complete example that opens a video capture device using device \"0\". It also uses the CascadeClassifier class to load an external data file containing the classifier data. The program grabs each frame from the video, then uses the classifier to detect faces. If any faces are found, it draws a green rectangle around each one, then displays the video in an output window:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image/color\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n    // set to use a video capture device 0\n    deviceID := 0\n\n\t// open webcam\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// open display window\n\twindow := gocv.NewWindow(\"Face Detect\")\n\tdefer window.Close()\n\n\t// prepare image matrix\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// color for the rect when faces detected\n\tblue := color.RGBA{0, 0, 255, 0}\n\n\t// load classifier to recognize faces\n\tclassifier := gocv.NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tif !classifier.Load(\"data/haarcascade_frontalface_default.xml\") {\n\t\tfmt.Println(\"Error reading cascade file: data/haarcascade_frontalface_default.xml\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"start reading camera device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"cannot read device %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// detect faces\n\t\trects := classifier.DetectMultiScale(img)\n\t\tfmt.Printf(\"found %d faces\\n\", len(rects))\n\n\t\t// draw a rectangle around each face on the original image\n\t\tfor _, r := range rects {\n\t\t\tgocv.Rectangle(&img, r, blue, 3)\n\t\t}\n\n\t\t// show the image in the window, and wait 1 millisecond\n\t\twindow.IMShow(img)\n\t\twindow.WaitKey(1)\n\t}\n}\n```\n\n### More examples\n\nThere are examples in the [cmd directory](./cmd) of this repo in the form of various useful command line utilities, such as [capturing an image file](./cmd/saveimage), [streaming mjpeg video](./cmd/mjpeg-streamer), [counting objects that cross a line](./cmd/counter), and [using OpenCV with a DNN for face tracking](./cmd/facedetectYN).\n\n## How to install\n\nTo install GoCV, you must first have the matching version of OpenCV installed on your system. The current release of GoCV requires OpenCV 4.12.0.\n\nWe have instructions for Linux, macOS, Windows, and other platform options as well.\n\n### Linux\n\nPlease see our web site at https://gocv.io/getting-started/linux/\n\n### macOS\n\nPlease see our web site at https://gocv.io/getting-started/macos/\n\n### Windows\n\nPlease see our web site at https://gocv.io/getting-started/windows/\n\n### Docker\n\nPlease see our web site at https://gocv.io/getting-started/docker/\n\n### Android\n\nThere is some work in progress for running GoCV on Android using Gomobile. For information on how to install OpenCV/GoCV for Android, please see:\nhttps://gist.github.com/ogero/c19458cf64bd3e91faae85c3ac8874120\n\nSee original discussion here:\nhttps://github.com/hybridgroup/gocv/issues/235\n\n## Profiling\n\nSince memory allocations for images in GoCV are done through C based code, the go garbage collector will not clean all resources associated with a `Mat`. As a result, any `Mat` created _must_ be closed to avoid memory leaks.\n\nTo ease the detection and repair of the resource leaks, GoCV provides a `Mat` profiler that records when each `Mat` is created and closed. Each time a `Mat` is allocated, the stack trace is added to the profile. When it is closed, the stack trace is removed. See the [runtime/pprof documentation](https://golang.org/pkg/runtime/pprof/#Profile).\n\nIn order to include the MatProfile custom profiler, you MUST build or run your application or tests using the `-tags matprofile` build tag. For example:\n\n    go run -tags matprofile cmd/version/main.go\n\nYou can get the profile's count at any time using:\n\n```go\ngocv.MatProfile.Count()\n```\n\nYou can display the current entries (the stack traces) with:\n\n```go\nvar b bytes.Buffer\ngocv.MatProfile.WriteTo(&b, 1)\nfmt.Print(b.String())\n```\n\nThis can be very helpful to track down a leak. For example, suppose you have\nthe following nonsense program:\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc leak() {\n\tgocv.NewMat()\n}\n\nfunc main() {\n\tfmt.Printf(\"initial MatProfile count: %v\\n\", gocv.MatProfile.Count())\n\tleak()\n\n\tfmt.Printf(\"final MatProfile count: %v\\n\", gocv.MatProfile.Count())\n\tvar b bytes.Buffer\n\tgocv.MatProfile.WriteTo(&b, 1)\n\tfmt.Print(b.String())\n}\n```\n\nRunning this program produces the following output:\n\n```\ninitial MatProfile count: 0\nfinal MatProfile count: 1\ngocv.io/x/gocv.Mat profile: total 1\n1 @ 0x40b936c 0x40b93b7 0x40b94e2 0x40b95af 0x402cd87 0x40558e1\n#\t0x40b936b\tgocv.io/x/gocv.newMat+0x4b\t/go/src/gocv.io/x/gocv/core.go:153\n#\t0x40b93b6\tgocv.io/x/gocv.NewMat+0x26\t/go/src/gocv.io/x/gocv/core.go:159\n#\t0x40b94e1\tmain.leak+0x21\t\t\t/go/src/github.com/dougnd/gocvprofexample/main.go:11\n#\t0x40b95ae\tmain.main+0xae\t\t\t/go/src/github.com/dougnd/gocvprofexample/main.go:16\n#\t0x402cd86\truntime.main+0x206\t\t/usr/local/Cellar/go/1.11.1/libexec/src/runtime/proc.go:201\n```\n\nWe can see that this program would leak memory. As it exited, it had one `Mat` that was never closed. The stack trace points to exactly which line the allocation happened on (line 11, the `gocv.NewMat()`).\n\nFurthermore, if the program is a long running process or if GoCV is being used on a web server, it may be helpful to install the HTTP interface )). For example:\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t_ \"net/http/pprof\"\n\t\"time\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc leak() {\n\tgocv.NewMat()\n}\n\nfunc main() {\n\tgo func() {\n\t\tticker := time.NewTicker(time.Second)\n\t\tfor {\n\t\t\t<-ticker.C\n\t\t\tleak()\n\t\t}\n\t}()\n\n\thttp.ListenAndServe(\"localhost:6060\", nil)\n}\n\n```\n\nThis will leak a `Mat` once per second. You can see the current profile count and stack traces by going to the installed HTTP debug interface: [http://localhost:6060/debug/pprof/gocv.io/x/gocv.Mat](http://localhost:6060/debug/pprof/gocv.io/x/gocv.Mat?debug=1).\n\n## How to contribute\n\nPlease take a look at our [CONTRIBUTING.md](./CONTRIBUTING.md) document to understand our contribution guidelines.\n\nThen check out our [ROADMAP.md](./ROADMAP.md) document to know what to work on next.\n\n## Why this project exists\n\nThe [https://github.com/go-opencv/go-opencv](https://github.com/go-opencv/go-opencv) package for Go and OpenCV did not support any version above OpenCV 2.x, and work on adding support for OpenCV 3 had stalled for over a year, mostly due to the complexity of [SWIG](http://swig.org/). That is why we started this project.\n\nThe GoCV package uses a C-style wrapper around the OpenCV 4 C++ classes to avoid having to deal with applying SWIG to a huge existing codebase. The mappings are intended to match as closely as possible to the original OpenCV project structure, to make it easier to find things, and to be able to figure out where to add support to GoCV for additional OpenCV image filters, algorithms, and other features.\n\nFor example, the [OpenCV `videoio` module](https://github.com/opencv/opencv/tree/master/modules/videoio) wrappers can be found in the GoCV package in the `videoio.*` files.\n\nThis package was inspired by the original https://github.com/go-opencv/go-opencv project, the blog post https://medium.com/@peterleyssens/using-opencv-3-from-golang-5510c312a3c and the repo at https://github.com/sensorbee/opencv thank you all!\n\n## License\n\nLicensed under the Apache 2.0 license. Copyright (c) 2017-2026 The Hybrid Group.\n\nLogo generated by GopherizeMe - https://gopherize.me\n"
  },
  {
    "path": "ROADMAP.md",
    "content": "# Roadmap\n\nThis is a list of all of the functionality areas within OpenCV, and OpenCV Contrib.\n\nAny section listed with an \"X\" means that all of the relevant OpenCV functionality has been wrapped for use within GoCV.\n\nAny section listed with **WORK STARTED** indicates that some work has been done, but not all functionality in that module has been completed. If there are any functions listed under a section marked **WORK STARTED**, it indicates that that function still requires a wrapper implemented.\n\nAnd any section that is simply listed, indicates that so far, no work has been done on that module.\n\nYour pull requests will be greatly appreciated!\n\n## Modules list\n\n- [ ] **core. Core functionality - WORK STARTED**\n    - [X] **Basic structures**\n    - [X] **Operations on arrays**\n    - [X] **XML/YAML Persistence**\n\n    - [ ] **Clustering - WORK STARTED**. The following functions still need implementation:\n        - [ ] [partition](https://docs.opencv.org/4.x/d5/d38/group__core__cluster.html#ga2037c989e69b499c1aa271419f3a9b34)\n\n    - [ ] Optimization Algorithms\n        - [ ] [ConjGradSolver](https://docs.opencv.org/4.x/d0/d21/classcv_1_1ConjGradSolver.html)\n        - [ ] [DownhillSolver](https://docs.opencv.org/4.x/d4/d43/classcv_1_1DownhillSolver.html)\n        - [ ] [solveLP](https://docs.opencv.org/4.x/da/d01/group__core__optim.html#ga9a06d237a9d38ace891efa1ca1b5d00a)\n\n- [ ] **imgproc. Image processing - WORK STARTED**\n    - [ ] **Image Filtering - WORK STARTED** The following functions still need implementation:\n        - [ ] [buildPyramid](https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#gacfdda2bc1ac55e96de7e9f0bce7238c0)\n        - [ ] [getDerivKernels](https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea)\n        - [ ] [getGaborKernel](https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#gae84c92d248183bd92fa713ce51cc3599)\n        - [ ] [pyrMeanShiftFiltering](https://docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html#ga9fabdce9543bd602445f5db3827e4cc0)\n\n    - [ ] **Geometric Image Transformations - WORK STARTED** The following functions still need implementation:\n        - [ ] [convertMaps](https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga9156732fa8f01be9ebd1a194f2728b7f)\n        - [ ] [getDefaultNewCameraMatrix](https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga744529385e88ef7bc841cbe04b35bfbf)\n        - [ ] [initUndistortRectifyMap](https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga7dfb72c9cf9780a347fbe3d1c47e5d5a)\n        - [ ] [initWideAngleProjMap](https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#gaceb049ec48898d1dadd5b50c604429c8)\n        - [ ] [undistort](https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga69f2545a8b62a6b0fc2ee060dc30559d)\n\n    - [ ] **Miscellaneous Image Transformations - WORK STARTED** The following functions still need implementation:\n        - [ ] [blendLinear](https://docs.opencv.org/4.x/d7/d1b/group__imgproc__misc.html#ga5e76540a679333d7c6cd0617c452c23d)\n        - [ ] [cvtColorTwoPlane](https://docs.opencv.org/4.x/d8/d01/group__imgproc__color__conversions.html#ga8d4cb64f7c6f03cc2b1f2356734b909d)\n        - [ ] [floodFill](https://docs.opencv.org/4.x/d7/d1b/group__imgproc__misc.html#ga366aae45a6c1289b341d140839f18717)\n\n    - [ ] **Drawing Functions - WORK STARTED** The following functions still need implementation:\n        - [ ] [drawMarker](https://docs.opencv.org/4.x/d6/d6e/group__imgproc__draw.html#ga482fa7b0f578fcdd8a174904592a6250)\n        - [ ] [ellipse2Poly](https://docs.opencv.org/4.x/d6/d6e/group__imgproc__draw.html#ga727a72a3f6a625a2ae035f957c61051f)\n        - [ ] [fillConvexPoly](https://docs.opencv.org/4.x/d6/d6e/group__imgproc__draw.html#ga906aae1606ea4ed2f27bec1537f6c5c2)\n        - [ ] [getFontScaleFromHeight](https://docs.opencv.org/4.x/d6/d6e/group__imgproc__draw.html#ga442ff925c1a957794a1309e0ed3ba2c3)\n\n    - [X] **ColorMaps in OpenCV**\n\n    - [ ] Planar Subdivision\n        - [ ] [Subdiv2D](https://docs.opencv.org/4.10.0/df/dbf/classcv_1_1Subdiv2D.html)\n\n    - [X] **Histograms**\n    - [ ] **Structural Analysis and Shape Descriptors - WORK STARTED** The following functions still need implementation:\n        - [ ] [fitEllipseAMS](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga69e90cda55c4e192a8caa0b99c3e4550)\n        - [ ] [fitEllipseDirect](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga6421884fd411923a74891998bbe9e813)\n        - [ ] [HuMoments](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#gab001db45c1f1af6cbdbe64df04c4e944)\n        - [ ] [intersectConvexConvex](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga8e840f3f3695613d32c052bec89e782c)\n        - [ ] [isContourConvex](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga8abf8010377b58cbc16db6734d92941b)\n        - [ ] [minEnclosingTriangle](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga1513e72f6bbdfc370563664f71e0542f)\n        - [ ] [rotatedRectangleIntersection](https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#ga8740e7645628c59d238b0b22c2abe2d4)\n\n    - [X] **Motion Analysis and Object Tracking**\n    - [ ] **Feature Detection - WORK STARTED** The following functions still need implementation:\n        - [ ] [cornerEigenValsAndVecs](https://docs.opencv.org/4.x/dd/d1a/group__imgproc__feature.html#ga4055896d9ef77dd3cacf2c5f60e13f1c)\n        - [ ] [cornerHarris](https://docs.opencv.org/4.x/dd/d1a/group__imgproc__feature.html#gac1fc3598018010880e370e2f709b4345)\n        - [ ] [cornerMinEigenVal](https://docs.opencv.org/4.x/dd/d1a/group__imgproc__feature.html#ga3dbce297c1feb859ee36707e1003e0a8)\n        - [ ] [createLineSegmentDetector](https://docs.opencv.org/4.x/dd/d1a/group__imgproc__feature.html#ga6b2ad2353c337c42551b521a73eeae7d)\n        - [ ] [preCornerDetect](https://docs.opencv.org/4.x/dd/d1a/group__imgproc__feature.html#gaa819f39b5c994871774081803ae22586)\n\n    - [X] **Object Detection**\n\n- [X] **imgcodecs. Image file reading and writing.**\n- [X] **videoio. Video I/O**\n- [X] **highgui. High-level GUI**\n- [ ] **video. Video Analysis - WORK STARTED**\n    - [X] **Motion Analysis**\n    - [ ] **Object Tracking - WORK STARTED** The following functions still need implementation:\n        - [ ] [buildOpticalFlowPyramid](https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga86640c1c470f87b2660c096d2b22b2ce)\n        - [ ] [estimateRigidTransform](https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga762cbe5efd52cf078950196f3c616d48)\n        - [ ] [findTransformECC](https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga7ded46f9a55c0364c92ccd2019d43e3a)\n        - [ ] [meanShift](https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga7ded46f9a55c0364c92ccd2019d43e3a)\n        - [ ] [CamShift](https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#gaef2bd39c8356f423124f1fe7c44d54a1)\n        - [ ] [DualTVL1OpticalFlow](https://docs.opencv.org/4.x/dc/d47/classcv_1_1DualTVL1OpticalFlow.html)\n        - [ ] [FarnebackOpticalFlow](https://docs.opencv.org/4.x/de/d9e/classcv_1_1FarnebackOpticalFlow.html)\n        - [ ] [SparsePyrLKOpticalFlow](https://docs.opencv.org/4.x/d7/d08/classcv_1_1SparsePyrLKOpticalFlow.html)\n        - [ ] [TrackerDaSiamRPN](https://docs.opencv.org/4.x/de/d93/classcv_1_1TrackerDaSiamRPN.html)\n        - [ ] [TrackerNano](https://docs.opencv.org/4.x/d8/d69/classcv_1_1TrackerNano.html)\n\n- [ ] **calib3d. Camera Calibration and 3D Reconstruction - WORK STARTED**. The following functions still need implementation:\n    - [ ] **Camera Calibration - WORK STARTED** The following functions still need implementation:\n        - [ ] [calibrateCameraRO](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#gacb6b35670216b24b67c70fcd21519ead)\n        - [ ] [calibrateHandEye](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#gaebfc1c9f7434196a374c382abf43439b)\n        - [ ] [calibrateRobotWorldHandEye](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga41b1a8dd70eae371eba707d101729c36)\n        - [ ] [calibrationMatrixValues](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [composeRT](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [computeCorrespondEpilines](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [convertPointsHomogeneous](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [convertPointsToHomogeneous](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [correctMatches](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [decomposeEssentialMat](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [decomposeHomographyMat](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [decomposeProjectionMatrix](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [drawChessboardCorners](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [drawFrameAxes](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [estimateAffine3D](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [filterHomographyDecompByVisibleRefpoints](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [filterSpeckles](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [find4QuadCornerSubpix](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [findCirclesGrid](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [findEssentialMat](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [findFundamentalMat](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [getDefaultNewCameraMatrix](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [getOptimalNewCameraMatrix](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [getValidDisparityROI](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [initCameraMatrix2D](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [initUndistortRectifyMap](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [initWideAngleProjMap](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [matMulDeriv](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [projectPoints](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [recoverPose](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [rectify3Collinear](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [reprojectImageTo3D](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [RQDecomp3x3](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [sampsonDistance](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [solveP3P](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [solvePnPGeneric](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [solvePnPRansac](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [solvePnPRefineLM](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [solvePnPRefineVVS](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [stereoCalibrate](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [stereoRectifyUncalibrated](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n        - [ ] [validateDisparity](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)\n\n    - [ ] **Fisheye - WORK STARTED** The following functions still need implementation:\n        - [ ] [projectPoints](https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#gab1ad1dc30c42ee1a50ce570019baf2c4)\n        - [ ] [stereoCalibrate](https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#gadbb3a6ca6429528ef302c784df47949b)\n        - [ ] [stereoRectify](https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#gac1af58774006689056b0f2ef1db55ecc)\n\n- [ ] **features2d. 2D Features Framework - WORK STARTED**\n    - [X] **Feature Detection and Description**\n    - [X] **Descriptor Matchers**\n    - [X] **Drawing Function of Keypoints and Matches**\n    - [ ] Object Categorization\n        - [ ] [BOWImgDescriptorExtractor](https://docs.opencv.org/4.x/d2/d6b/classcv_1_1BOWImgDescriptorExtractor.html)\n        - [ ] [BOWKMeansTrainer](https://docs.opencv.org/4.x/d4/d72/classcv_1_1BOWKMeansTrainer.html)\n\n- [ ] **objdetect. Object Detection**\n    - [X] **Face Detection**\n    - [ ] **aruco. ArUco Marker Detection - WORK STARTED**\n        - [ ] [refineDetectedMarkers](https://docs.opencv.org/4.x/d2/d1a/classcv_1_1aruco_1_1ArucoDetector.html#ad806c9310cfc826a178b0aefdf09bab6)\n        - [ ] [refineDetectedMarkers](https://docs.opencv.org/4.x/d2/d1a/classcv_1_1aruco_1_1ArucoDetector.html#ad806c9310cfc826a178b0aefdf09bab6)\n        - [ ] [drawDetectedCornersCharuco](https://docs.opencv.org/4.x/de/d67/group__objdetect__aruco.html#ga7225eee644190f791e1583c499b7ab10)\n        - [ ] [drawDetectedDiamonds](https://docs.opencv.org/4.x/de/d67/group__objdetect__aruco.html#ga0dbf27203267fb8e9f282554cf0d3433)\n        - [ ] [extendDictionary](https://docs.opencv.org/4.x/de/d67/group__objdetect__aruco.html#ga928c031e9a782b18405af56c851d9549)\n        - [ ] [CharucoDetector](https://docs.opencv.org/4.x/d9/df5/classcv_1_1aruco_1_1CharucoDetector.html#ad7647d1c3d0e2db97bedc31f743e796b)\n        - [ ] [detectBoard](https://docs.opencv.org/4.x/d9/df5/classcv_1_1aruco_1_1CharucoDetector.html#aacbea601612a3a0feaa45ebb7fb255fd)\n        - [ ] [detectDiamonds](https://docs.opencv.org/4.x/d9/df5/classcv_1_1aruco_1_1CharucoDetector.html#a50342803f68deb1e6b0b79f61d4b1a73)\n\n- [X] **dnn. Deep Neural Network module**\n- [ ] ml. Machine Learning\n    - [ ] [ANN_MLP](https://docs.opencv.org/4.x/d0/dce/classcv_1_1ml_1_1ANN__MLP.html)\n    - [ ] [Boost](https://docs.opencv.org/4.x/d6/d7a/classcv_1_1ml_1_1Boost.html)\n    - [ ] [DTrees](https://docs.opencv.org/4.x/d8/d89/classcv_1_1ml_1_1DTrees.html)\n    - [ ] [EM](https://docs.opencv.org/4.x/d1/dfb/classcv_1_1ml_1_1EM.html)\n    - [ ] [KNearest](https://docs.opencv.org/4.x/dd/de1/classcv_1_1ml_1_1KNearest.html)\n    - [ ] [LogisticRegression](https://docs.opencv.org/4.x/d6/df9/classcv_1_1ml_1_1LogisticRegression.html)\n    - [ ] [NormalBayesClassifier](https://docs.opencv.org/4.x/d4/d8e/classcv_1_1ml_1_1NormalBayesClassifier.html)\n    - [ ] [ParamGrid](https://docs.opencv.org/4.x/d6/dca/classcv_1_1ml_1_1ParamGrid.html)\n    - [ ] [RTrees](https://docs.opencv.org/4.x/d0/d65/classcv_1_1ml_1_1RTrees.html)\n    - [ ] [SimulatedAnnealingSolverSystem](https://docs.opencv.org/4.x/dc/db4/structcv_1_1ml_1_1SimulatedAnnealingSolverSystem.html)\n    - [ ] [SVM](https://docs.opencv.org/4.x/d1/d2d/classcv_1_1ml_1_1SVM.html)\n    - [ ] [SVMSVG](https://docs.opencv.org/4.x/de/d54/classcv_1_1ml_1_1SVMSGD.html)\n    - [ ] [TrainData](https://docs.opencv.org/4.x/dc/d32/classcv_1_1ml_1_1TrainData.html)\n\n- [ ] flann. Clustering and Search in Multi-Dimensional Spaces\n    - [ ] [hierarchicalClustering](https://docs.opencv.org/4.x/dc/de5/group__flann.html#gaf89c8914eb439855c9a24c3de01bfd82)\n\n- [ ] **photo. Computational Photography - WORK STARTED** The following functions still need implementation:\n    - [ ] [denoise_TVL1](https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga7602ed5ae17b7de40152b922227c4e4f)\n    - [ ] [createCalibrateDebevec](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#ga7fed9707ad5f2cc0e633888867109f90)\n    - [ ] [createCalibrateRobertson](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#gae77813a21cd351a596619e5ff013be5d)\n    - [ ] [createMergeDebevec](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#gaa8eab36bc764abb2a225db7c945f87f9)\n    - [ ] [createMergeRobertson](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#ga460d4a1df1a7e8cdcf7445bb87a8fb78)\n    - [ ] [createTonemap](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#gabcbd653140b93a1fa87ccce94548cd0d)\n    - [ ] [createTonemapDrago](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#ga72bf92bb6b8653ee4be650ac01cf50b6)\n    - [ ] [createTonemapMantiuk](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#ga3b3f3bf083b7515802f039a6a70f2d21)\n    - [ ] [createTonemapReinhard](https://docs.opencv.org/4.x/d6/df5/group__photo__hdr.html#gadabe7f6bf1fa96ad0fd644df9182c2fb)\n\n- [ ] stitching. Images stitching\n    - [ ] [Stitcher](https://docs.opencv.org/4.x/d2/d8d/classcv_1_1Stitcher.html)\n\n## CUDA\n\n- [X] **core**\n\n- [ ] **cudaarithm. Operations on Matrices - WORK STARTED** The following functions still need implementation:\n    - [X] **core**\n    - [ ] **per-element operations - WORK STARTED** The following functions still need implementation:\n        - [ ] [cv::cuda::cartToPolar](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga82210c7d1c1d42e616e554bf75a53480)\n        - [ ] [cv::cuda::inRange](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#gaf611ab6b1d85e951feb6f485b1ed9672)\n        - [ ] [cv::cuda::magnitude](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga3d17f4fcd79d7c01fadd217969009463)\n        - [ ] [cv::cuda::magnitudeSqr](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga7613e382d257e150033d0ce4d6098f6a)\n        - [ ] [cv::cuda::phase](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga5b75ec01be06dcd6e27ada09a0d4656a)\n        - [ ] [cv::cuda::polarToCart](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga01516a286a329c303c2db746513dd9df)\n        - [ ] [cv::cuda::pow](https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga82d04ef4bcc4dfa9bfbe76488007c6c4)\n\n    - [ ] **matrix reductions - WORK STARTED** The following functions still need implementation:\n        - [ ] [cv::cuda::calcSqrSum](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#gac998c83597f6c206c78cee16aa87946f)\n        - [ ] [cv::cuda::calcSum](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga98a09144047f09f5cb1d6b6ea8e0856f)\n        - [ ] [cv::cuda::countNonZero](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga98a09144047f09f5cb1d6b6ea8e0856f)\n        - [ ] [cv::cuda::integral](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga07e5104eba4bf45212ac9dbc5bf72ba6)\n        - [ ] [cv::cuda::meanStdDev](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga990a4db4c6d7e8f0f3a6685ba48fbddc)\n        - [ ] [cv::cuda::rectStdDev](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#gac311484a4e57cab2ce2cfdc195fda7ee)\n        - [ ] [cv::cuda::reduce](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga21d57f661db7be093caf2c4378be2007)\n        - [ ] [cv::cuda::sqrIntegral](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga40c75196202706399a60bf6ba7a052ac)\n        - [ ] [cv::cuda::sqlSum](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga056c804ebf5d2eb9f6f35e3dcb01524c)\n        - [ ] [cv::cuda::sum](https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga1f582844670199281e8012733b50c582)\n\n    - [ ] **Operations on matrices - WORK STARTED** The following functions still need implementation:\n        - [ ] [cv::cuda::createConvolution](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#ga2695e05ef624bf3ce03cfbda383a821d)\n        - [ ] [cv::cuda::createDFT](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#ga0f72d063b73c8bb995678525eb076f10)\n        - [ ] [cv::cuda::dft](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#gadea99cb15a715c983bcc2870d65a2e78)\n        - [ ] [cv::cuda::gemm](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#ga42efe211d7a43bbc922da044c4f17130)\n        - [ ] [cv::cuda::mulAndScaleSpectrums](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#ga5704c25b8be4f19da812e6d98c8ee464)\n        - [ ] [cv::cuda::mulSpectrums](https://docs.opencv.org/4.5.0/d9/d88/group__cudaarithm__arithm.html#gab3e8900d67c4f59bdc137a0495206cd8)\n\n- [X] **cudabgsegm. Background Segmentation**\n\n- [ ] **cudacodec** Video Encoding/Decoding. The following functions still need implementation:\n    - [ ] [cv::cuda::VideoReader](https://docs.opencv.org/4.x/db/ded/classcv_1_1cudacodec_1_1VideoReader.html)\n    - [ ] [cv::cuda::VideoWriter](https://docs.opencv.org/4.x/df/dde/classcv_1_1cudacodec_1_1VideoWriter.html)\n\n- [ ] **cudafeatures2d** Feature Detection and Description. The following functions still need implementation:\n    - [ ] [cv::cuda::FastFeatureDetector](https://docs.opencv.org/4.x/d4/d6a/classcv_1_1cuda_1_1FastFeatureDetector.html)\n    - [ ] [cv::cuda::ORB](https://docs.opencv.org/4.x/da/d44/classcv_1_1cuda_1_1ORB.html)\n\n- [ ] **cudafilters. Image Filtering - WORK STARTED** The following functions still need implementation:\n    - [ ] [cv::cuda::createBoxFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga3113b66e289bad7caef412e6e13ec2be)\n    - [ ] [cv::cuda::createBoxMaxFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gaaf4740c51128d23a37f6f1b22cee49e8)\n    - [ ] [cv::cuda::createBoxMinFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga77fd36949bc8d92aabc120b4b1cfaafa)\n    - [ ] [cv::cuda::createColumnSumFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gac13bf7c41a34bfde2a7f33ad8caacfdf)\n    - [ ] [cv::cuda::createDerivFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga14d76dc6982ce739c67198f52bc16ee1)\n    - [ ] [cv::cuda::createLaplacianFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga53126e88bb7e6185dcd5628e28e42cd2)\n    - [ ] [cv::cuda::createLinearFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga57cb1804ad9d1280bf86433858daabf9)\n    - [ ] [cv::cuda::createMorphologyFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gae58694e07be6bdbae126f36c75c08ee6)\n    - [ ] [cv::cuda::createRowSumFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gaf735de273ccb5072f3c27816fb97a53a)\n    - [ ] [cv::cuda::createScharrFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#ga4ac8df158e5771ddb0bd5c9091188ce6)\n    - [ ] [cv::cuda::createSeparableLinearFilter](https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gaf7b79a9a92992044f328dad07a52c4bf)\n\n- [ ] **cudaimgproc. Image Processing - WORK STARTED** The following functions still need implementation:\n    - [ ] [cv::cuda::CLAHE](https://docs.opencv.org/4.x/db/d79/classcv_1_1cuda_1_1CLAHE.html)\n    - [ ] [cv::cuda::HoughCirclesDetector](https://docs.opencv.org/4.x/da/d80/classcv_1_1cuda_1_1HoughCirclesDetector.html)\n    - [ ] [cv::cuda::createGoodFeaturesToTrackDetector](https://docs.opencv.org/4.x/dc/d6d/group__cudaimgproc__feature.html#ga478b474a598ece101f7e706fee2c8e91)\n    - [ ] [cv::cuda::createHarrisCorner](https://docs.opencv.org/4.x/dc/d6d/group__cudaimgproc__feature.html#ga3e5878a803e9bba51added0c10101979)\n    - [ ] [cv::cuda::createMinEigenValCorner](https://docs.opencv.org/4.x/dc/d6d/group__cudaimgproc__feature.html#ga7457fd4b53b025f990b1c1dd1b749915)\n\n- [X] **cudaobjdetect. Object Detection**\n\n- [ ] **cudaoptflow. Optical Flow - WORK STARTED** The following functions still need implementation:\n    - [ ] [BroxOpticalFlow](https://docs.opencv.org/4.x/d7/d18/classcv_1_1cuda_1_1BroxOpticalFlow.html)\n    - [ ] [DenseOpticalFlow](https://docs.opencv.org/4.x/d6/d4a/classcv_1_1cuda_1_1DenseOpticalFlow.html)\n    - [ ] [DensePyrLKOpticalFlow](https://docs.opencv.org/4.x/d0/da4/classcv_1_1cuda_1_1DensePyrLKOpticalFlow.html)\n    - [ ] [FarnebackOpticalFlow](https://docs.opencv.org/4.x/d9/d30/classcv_1_1cuda_1_1FarnebackOpticalFlow.html)\n    - [ ] [NvidiaHWOpticalFlow](https://docs.opencv.org/4.x/d5/d26/classcv_1_1cuda_1_1NvidiaHWOpticalFlow.html)\n    - [ ] [NvidiaOpticalFlow_1_0](https://docs.opencv.org/4.x/dc/d9d/classcv_1_1cuda_1_1NvidiaOpticalFlow__1__0.html)\n    - [ ] [SparseOpticalFlow](https://docs.opencv.org/4.x/d5/dcf/classcv_1_1cuda_1_1SparseOpticalFlow.html)\n    - [ ] **[SparsePyrLKOpticalFlow](https://docs.opencv.org/4.x/d7/d05/classcv_1_1cuda_1_1SparsePyrLKOpticalFlow.html) - WORK STARTED**\n\n- [ ] **cudastereo** Stereo Correspondence\n    - [ ] [cv::cuda::createDisparityBilateralFilter](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#gaafb5f9902f7a9e74cb2cd4e680569590)\n    - [ ] [cv::cuda::createStereoBeliefPropagation](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#ga8d22dd80bdfb4e3d7d2ac09e8a07c22b)\n    - [ ] [cv::cuda::createStereoBM](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#ga77edc901350dd0a7f46ec5aca4138039)\n    - [ ] [cv::cuda::createStereoConstantSpaceBP](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#gaec3b49c7cf9f7701a6f549a227be4df2)\n    - [ ] [cv::cuda::createStereoSGM](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#gafb7e5284de5f488d664c3155acb12c93)\n    - [ ] [cv::cuda::drawColorDisp](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#ga469b23a77938dd7c06861e59cecc08c5)\n    - [ ] [cv::cuda::reprojectImageTo3D](https://docs.opencv.org/4.x/dd/d47/group__cudastereo.html#gaff851e3932da0f3e74d1be1d8855f094)\n\n- [X] **cudawarping. Image Warping**\n\n## Contrib modules list\n\n- [ ] alphamat. Alpha Matting\n- [ ] barcode. Barcode detecting and decoding methods\n- [ ] **bgsegm. Improved Background-Foreground Segmentation Methods - WORK STARTED**\n- [ ] bioinspired. Biologically inspired vision models and derivated tools\n- [ ] ccalib. Custom Calibration Pattern for 3D reconstruction\n- [ ] cnn_3dobj. 3D object recognition and pose estimation API\n- [ ] cvv. GUI for Interactive Visual Debugging of Computer Vision Programs\n- [ ] datasets. Framework for working with different datasets\n- [ ] dnn_modern. Deep Learning Modern Module\n- [ ] dnn_objdetect. DNN used for object detection\n- [ ] dnn_superres. DNN used for super resolution\n- [ ] dpm. Deformable Part-based Models\n- [ ] **face. Face Recognition - WORK STARTED**\n- [X] **freetype. Drawing UTF-8 strings with freetype/harfbuzz**\n- [ ] fuzzy. Image processing based on fuzzy mathematics\n- [ ] hdf. Hierarchical Data Format I/O routines\n- [ ] hfs. Hierarchical Feature Selection for Efficient Image Segmentation\n- [X] **img_hash. The module brings implementations of different image hashing algorithms.**\n- [ ] intensity_transform. The module brings implementations of intensity transformation algorithms to adjust image contrast.\n- [ ] line_descriptor. Binary descriptors for lines extracted from an image\n- [X] **mcc. Macbeth Chart module**\n- [ ] optflow. Optical Flow Algorithms\n- [ ] ovis. OGRE 3D Visualiser\n- [ ] phase_unwrapping. Phase Unwrapping API\n- [ ] plot. Plot function for Mat data\n- [ ] quality. Image Quality Analysis (IQA) API\n- [ ] rapid. silhouette based 3D object tracking\n- [ ] reg. Image Registration\n- [ ] rgbd. RGB-Depth Processing\n- [ ] saliency. Saliency API\n- [ ] sfm. Structure From Motion\n- [ ] shape. Shape Distance and Matching\n- [ ] signal. Signal Processing\n- [ ] stereo. Stereo Correspondance Algorithms\n- [ ] structured_light. Structured Light API\n- [ ] superres. Super Resolution\n- [ ] surface_matching. Surface Matching\n- [ ] text. Scene Text Detection and Recognition\n- [ ] **tracking. Tracking API - WORK STARTED**\n- [ ] videostab. Video Stabilization\n- [ ] viz. 3D Visualizer\n- [X] **wechat_qrcode. WeChat QR code detector for detecting and parsing QR code**\n- [ ] **xfeatures2d. Extra 2D Features Framework - WORK STARTED**\n- [ ] **ximgproc. Extended Image Processing - WORK STARTED**\n- [X] **xobjdetect. Extended object detection**\n- [X] **xphoto. Additional photo processing algorithms**\n"
  },
  {
    "path": "aruco.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_aruco)\n\n#include \"aruco.h\"\n\nArucoDetector ArucoDetector_New() {\n    try {\n        return new cv::aruco::ArucoDetector();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nArucoDetector ArucoDetector_NewWithParams(ArucoDictionary dictionary, ArucoDetectorParameters params) {\n    try {\n        return new cv::aruco::ArucoDetector(*dictionary, *params);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid ArucoDetector_Close(ArucoDetector ad) {\n    delete ad;\n}\n\nvoid ArucoDetector_DetectMarkers(ArucoDetector ad, Mat inputArr, Points2fVector markerCorners, IntVector *markerIds, Points2fVector rejectedCandidates) {\n    try {\n        std::vector<int> _markerIds;\n        ad->detectMarkers(*inputArr, *markerCorners, _markerIds, *rejectedCandidates);\n\n        int *ids = new int[_markerIds.size()];\n\n        for (size_t i = 0; i < _markerIds.size(); ++i)\n        {\n            ids[i] = _markerIds[i];\n        }\n\n        markerIds->length = _markerIds.size();\n        markerIds->val = ids;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nArucoDetectorParameters ArucoDetectorParameters_Create()\n{\n    try {\n        return new cv::aruco::DetectorParameters();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeMin(ArucoDetectorParameters ap, int adaptiveThreshWinSizeMin) {\n    ap->adaptiveThreshWinSizeMin = adaptiveThreshWinSizeMin;\n}\n\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeMin(ArucoDetectorParameters ap) {\n    return ap->adaptiveThreshWinSizeMin;\n}\n\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeMax(ArucoDetectorParameters ap, int adaptiveThreshWinSizeMax) {\n    ap->adaptiveThreshWinSizeMax = adaptiveThreshWinSizeMax;\n}\n\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeMax(ArucoDetectorParameters ap) {\n    return ap->adaptiveThreshWinSizeMax;\n}\n\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeStep(ArucoDetectorParameters ap, int adaptiveThreshWinSizeStep) {\n    ap->adaptiveThreshWinSizeStep = adaptiveThreshWinSizeStep;\n}\n\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeStep(ArucoDetectorParameters ap) {\n    return ap->adaptiveThreshWinSizeStep;\n}\n\nvoid ArucoDetectorParameters_SetAdaptiveThreshConstant(ArucoDetectorParameters ap, double adaptiveThreshConstant) {\n    ap->adaptiveThreshConstant = adaptiveThreshConstant;\n}\n\ndouble ArucoDetectorParameters_GetAdaptiveThreshConstant(ArucoDetectorParameters ap) {\n    return ap->adaptiveThreshConstant;\n}\n\nvoid ArucoDetectorParameters_SetMinMarkerPerimeterRate(ArucoDetectorParameters ap, double minMarkerPerimeterRate) {\n    ap->minMarkerPerimeterRate = minMarkerPerimeterRate;\n}\n\ndouble ArucoDetectorParameters_GetMinMarkerPerimeterRate(ArucoDetectorParameters ap){\n    return ap->minMarkerPerimeterRate;\n}\n\nvoid ArucoDetectorParameters_SetMaxMarkerPerimeterRate(ArucoDetectorParameters ap, double maxMarkerPerimeterRate) {\n    ap->maxMarkerPerimeterRate = maxMarkerPerimeterRate;\n}\n\ndouble ArucoDetectorParameters_GetMaxMarkerPerimeterRate(ArucoDetectorParameters ap){\n    return ap->maxMarkerPerimeterRate;\n}\n\nvoid ArucoDetectorParameters_SetPolygonalApproxAccuracyRate(ArucoDetectorParameters ap, double polygonalApproxAccuracyRate) {\n    ap->polygonalApproxAccuracyRate = polygonalApproxAccuracyRate;\n}\n\ndouble ArucoDetectorParameters_GetPolygonalApproxAccuracyRate(ArucoDetectorParameters ap){\n    return ap->polygonalApproxAccuracyRate;\n}\n\nvoid ArucoDetectorParameters_SetMinCornerDistanceRate(ArucoDetectorParameters ap, double minCornerDistanceRate) {\n    ap->minCornerDistanceRate = minCornerDistanceRate;\n}\n\ndouble ArucoDetectorParameters_GetMinCornerDistanceRate(ArucoDetectorParameters ap) {\n    return ap->minCornerDistanceRate;\n}\n\nvoid ArucoDetectorParameters_SetMinDistanceToBorder(ArucoDetectorParameters ap, int minDistanceToBorder) {\n    ap->minDistanceToBorder = minDistanceToBorder;\n}\n\nint ArucoDetectorParameters_GetMinDistanceToBorder(ArucoDetectorParameters ap) {\n    return ap->minDistanceToBorder;\n}\n\nvoid ArucoDetectorParameters_SetMinMarkerDistanceRate(ArucoDetectorParameters ap, double minMarkerDistanceRate) {\n    ap->minMarkerDistanceRate = minMarkerDistanceRate;\n}\n\ndouble ArucoDetectorParameters_GetMinMarkerDistanceRate(ArucoDetectorParameters ap) {\n    return ap->minMarkerDistanceRate;\n}\n\nvoid ArucoDetectorParameters_SetCornerRefinementMethod(ArucoDetectorParameters ap, int cornerRefinementMethod) {\n    ap->cornerRefinementMethod = cv::aruco::CornerRefineMethod(cornerRefinementMethod);\n}\n\nint ArucoDetectorParameters_GetCornerRefinementMethod(ArucoDetectorParameters ap) {\n    return ap->cornerRefinementMethod;\n}\n\nvoid ArucoDetectorParameters_SetCornerRefinementWinSize(ArucoDetectorParameters ap, int cornerRefinementWinSize) {\n    ap->cornerRefinementWinSize = cornerRefinementWinSize;   \n}\n\nint ArucoDetectorParameters_GetCornerRefinementWinSize(ArucoDetectorParameters ap) {\n    return ap->cornerRefinementWinSize;\n}\n\nvoid ArucoDetectorParameters_SetCornerRefinementMaxIterations(ArucoDetectorParameters ap, int cornerRefinementMaxIterations) {\n    ap->cornerRefinementMaxIterations = cornerRefinementMaxIterations;\n}\n\nint ArucoDetectorParameters_GetCornerRefinementMaxIterations(ArucoDetectorParameters ap) {\n    return ap->cornerRefinementMaxIterations;\n}\n\nvoid ArucoDetectorParameters_SetCornerRefinementMinAccuracy(ArucoDetectorParameters ap, double cornerRefinementMinAccuracy) {\n    ap->cornerRefinementMinAccuracy = cornerRefinementMinAccuracy;\n}\n\ndouble ArucoDetectorParameters_GetCornerRefinementMinAccuracy(ArucoDetectorParameters ap) {\n    return ap->cornerRefinementMinAccuracy;\n}\n\nvoid ArucoDetectorParameters_SetMarkerBorderBits(ArucoDetectorParameters ap, int markerBorderBits) {\n    ap->markerBorderBits = markerBorderBits;\n}\n\nint ArucoDetectorParameters_GetMarkerBorderBits(ArucoDetectorParameters ap) {\n    return ap->markerBorderBits;\n}\n\nvoid ArucoDetectorParameters_SetPerspectiveRemovePixelPerCell(ArucoDetectorParameters ap, int perspectiveRemovePixelPerCell) {\n    ap->perspectiveRemovePixelPerCell = perspectiveRemovePixelPerCell;\n}\n\nint ArucoDetectorParameters_GetPerspectiveRemovePixelPerCell(ArucoDetectorParameters ap) {\n    return ap->perspectiveRemovePixelPerCell;\n}\n\nvoid ArucoDetectorParameters_SetPerspectiveRemoveIgnoredMarginPerCell(ArucoDetectorParameters ap, double perspectiveRemoveIgnoredMarginPerCell) {\n    ap->perspectiveRemoveIgnoredMarginPerCell = perspectiveRemoveIgnoredMarginPerCell;\n}\n\ndouble ArucoDetectorParameters_GetPerspectiveRemoveIgnoredMarginPerCell(ArucoDetectorParameters ap) {\n    return ap->perspectiveRemoveIgnoredMarginPerCell;\n}\n\nvoid ArucoDetectorParameters_SetMaxErroneousBitsInBorderRate(ArucoDetectorParameters ap, double maxErroneousBitsInBorderRate) {\n    ap->maxErroneousBitsInBorderRate = maxErroneousBitsInBorderRate;\n}\n\ndouble ArucoDetectorParameters_GetMaxErroneousBitsInBorderRate(ArucoDetectorParameters ap) {\n    return ap->maxErroneousBitsInBorderRate;\n}\n\nvoid ArucoDetectorParameters_SetMinOtsuStdDev(ArucoDetectorParameters ap, double minOtsuStdDev) {\n    ap->minOtsuStdDev = minOtsuStdDev;\n}\n\ndouble ArucoDetectorParameters_GetMinOtsuStdDev(ArucoDetectorParameters ap) {\n    return ap->minOtsuStdDev;\n}\n\nvoid ArucoDetectorParameters_SetErrorCorrectionRate(ArucoDetectorParameters ap, double errorCorrectionRate) {\n    ap->errorCorrectionRate = errorCorrectionRate;\n}\n\ndouble ArucoDetectorParameters_GetErrorCorrectionRate(ArucoDetectorParameters ap) {\n    return ap->errorCorrectionRate;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagQuadDecimate(ArucoDetectorParameters ap, float aprilTagQuadDecimate) {\n    ap->aprilTagQuadDecimate = aprilTagQuadDecimate;\n}\n\nfloat ArucoDetectorParameters_GetAprilTagQuadDecimate(ArucoDetectorParameters ap) {\n    return ap->aprilTagQuadDecimate;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagQuadSigma(ArucoDetectorParameters ap, float aprilTagQuadSigma) {\n    ap->aprilTagQuadSigma = aprilTagQuadSigma;\n}\n\nfloat ArucoDetectorParameters_GetAprilTagQuadSigma(ArucoDetectorParameters ap) {\n    return ap->aprilTagQuadSigma;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagMinClusterPixels(ArucoDetectorParameters ap, int aprilTagMinClusterPixels) {\n    ap->aprilTagMinClusterPixels = aprilTagMinClusterPixels;\n}\n\nint ArucoDetectorParameters_GetAprilTagMinClusterPixels(ArucoDetectorParameters ap) {\n    return ap->aprilTagMinClusterPixels;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagMaxNmaxima(ArucoDetectorParameters ap, int aprilTagMaxNmaxima) {\n    ap->aprilTagMaxNmaxima = aprilTagMaxNmaxima;\n}\n\nint ArucoDetectorParameters_GetAprilTagMaxNmaxima(ArucoDetectorParameters ap) {\n    return ap->aprilTagMaxNmaxima;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagCriticalRad(ArucoDetectorParameters ap, float aprilTagCriticalRad) {\n    ap->aprilTagCriticalRad = aprilTagCriticalRad;\n}\n\nfloat ArucoDetectorParameters_GetAprilTagCriticalRad(ArucoDetectorParameters ap) {\n    return ap->aprilTagCriticalRad;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagMaxLineFitMse(ArucoDetectorParameters ap, float aprilTagMaxLineFitMse) {\n    ap->aprilTagMaxLineFitMse = aprilTagMaxLineFitMse;\n}\n\nfloat ArucoDetectorParameters_GetAprilTagMaxLineFitMse(ArucoDetectorParameters ap) {\n    return ap->aprilTagMaxLineFitMse;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagMinWhiteBlackDiff(ArucoDetectorParameters ap, int aprilTagMinWhiteBlackDiff) {\n    ap->aprilTagMinWhiteBlackDiff = aprilTagMinWhiteBlackDiff;\n}\n\nint ArucoDetectorParameters_GetAprilTagMinWhiteBlackDiff(ArucoDetectorParameters ap) {\n    return ap->aprilTagMinWhiteBlackDiff;\n}\n\nvoid ArucoDetectorParameters_SetAprilTagDeglitch(ArucoDetectorParameters ap, int aprilTagDeglitch) {\n    ap->aprilTagDeglitch = aprilTagDeglitch;\n}\n\nint ArucoDetectorParameters_GetAprilTagDeglitch(ArucoDetectorParameters ap) {\n    return ap->aprilTagDeglitch;\n}\n\nvoid ArucoDetectorParameters_SetDetectInvertedMarker(ArucoDetectorParameters ap, bool detectInvertedMarker) {\n    ap->detectInvertedMarker = detectInvertedMarker;\n}\n\nbool ArucoDetectorParameters_GetDetectInvertedMarker(ArucoDetectorParameters ap) {\n    return ap->detectInvertedMarker;\n}\n\nOpenCVResult ArucoDrawDetectedMarkers(Mat image, Points2fVector markerCorners, IntVector markerIds, Scalar borderColor)\n{\n    try {\n        std::vector<int> _markerIds;\n        for (int i = 0, *v = markerIds.val; i < markerIds.length; ++v, ++i)\n        {\n            _markerIds.push_back(*v);\n        }\n        cv::Scalar _borderColor = cv::Scalar(borderColor.val1, borderColor.val2, borderColor.val3);\n        cv::aruco::drawDetectedMarkers(*image, *markerCorners, _markerIds, _borderColor);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ArucoGenerateImageMarker(int dictionaryId, int id, int sidePixels, Mat img, int borderBits)\n{\n    try {\n        cv::aruco::Dictionary dict = cv::aruco::getPredefinedDictionary(dictionaryId);\n        cv::aruco::generateImageMarker(dict, id, sidePixels, *img, borderBits);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nArucoDictionary getPredefinedDictionary(int dictionaryId)\n{\n    try {\n        return new cv::aruco::Dictionary(cv::aruco::getPredefinedDictionary(dictionaryId));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}"
  },
  {
    "path": "aruco.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_aruco)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"aruco.h\"\n#include \"core.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\ntype ArucoDetector struct {\n\tp C.ArucoDetector\n}\n\n// NewArucoDetector returns a new ArucoDetector.\nfunc NewArucoDetector() ArucoDetector {\n\treturn ArucoDetector{p: C.ArucoDetector_New()}\n}\n\n// NewArucoDetectorWithParams returns a new ArucoDetector.\nfunc NewArucoDetectorWithParams(dictionary ArucoDictionary, params ArucoDetectorParameters) ArucoDetector {\n\treturn ArucoDetector{p: C.ArucoDetector_NewWithParams(dictionary.p, params.p)}\n}\n\n// Close deletes the ArucoDetector's pointer.\nfunc (a *ArucoDetector) Close() error {\n\tC.ArucoDetector_Close(a.p)\n\ta.p = nil\n\treturn nil\n}\n\n// DetectMarkers does basic marker detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d6a/group__aruco.html#gab9159aa69250d8d3642593e508cb6baa\nfunc (a *ArucoDetector) DetectMarkers(input Mat) (\n\tmarkerCorners [][]Point2f, markerIds []int, rejectedCandidates [][]Point2f,\n) {\n\n\tpvsCorners := NewPoints2fVector()\n\tdefer pvsCorners.Close()\n\tpvsRejected := NewPoints2fVector()\n\tdefer pvsRejected.Close()\n\tcmarkerIds := C.IntVector{}\n\tdefer C.free(unsafe.Pointer(cmarkerIds.val))\n\n\tC.ArucoDetector_DetectMarkers(a.p, C.Mat(input.Ptr()), C.Points2fVector(pvsCorners.P()),\n\t\t&cmarkerIds, C.Points2fVector(pvsRejected.P()))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cmarkerIds.val)),\n\t\tLen:  int(cmarkerIds.length),\n\t\tCap:  int(cmarkerIds.length),\n\t}\n\tpcids := *(*[]C.int)(unsafe.Pointer(h))\n\tmarkerIds = []int{}\n\tfor i := 0; i < int(cmarkerIds.length); i++ {\n\t\tmarkerIds = append(markerIds, int(pcids[i]))\n\t}\n\n\treturn pvsCorners.ToPoints(), markerIds, pvsRejected.ToPoints()\n}\n\nfunc ArucoDrawDetectedMarkers(img Mat, markerCorners [][]Point2f, markerIds []int, borderColor Scalar) error {\n\tcMarkerIds := make([]C.int, len(markerIds))\n\tfor i, s := range markerIds {\n\t\tcMarkerIds[i] = C.int(s)\n\t}\n\tmarkerIdsIntVec := C.IntVector{\n\t\tval:    (*C.int)(&cMarkerIds[0]),\n\t\tlength: C.int(len(cMarkerIds)),\n\t}\n\t_markerCorners := NewPoints2fVectorFromPoints(markerCorners)\n\n\tcBorderColor := C.struct_Scalar{\n\t\tval1: C.double(borderColor.Val1),\n\t\tval2: C.double(borderColor.Val2),\n\t\tval3: C.double(borderColor.Val3),\n\t\tval4: C.double(borderColor.Val4),\n\t}\n\n\treturn OpenCVResult(C.ArucoDrawDetectedMarkers(\n\t\tC.Mat(img.Ptr()),\n\t\tC.Points2fVector(_markerCorners.P()),\n\t\tmarkerIdsIntVec,\n\t\tcBorderColor,\n\t))\n}\n\nfunc ArucoGenerateImageMarker(dictionaryId ArucoDictionaryCode, id int, sidePixels int, img Mat, borderBits int) error {\n\treturn OpenCVResult(C.ArucoGenerateImageMarker(C.int(dictionaryId), C.int(id), C.int(sidePixels), C.Mat(img.Ptr()), C.int(borderBits)))\n}\n\ntype ArucoDetectorParameters struct {\n\tp C.ArucoDetectorParameters\n}\n\n// NewArucoDetectorParameters returns the default parameters for the SimpleBobDetector\nfunc NewArucoDetectorParameters() ArucoDetectorParameters {\n\treturn ArucoDetectorParameters{p: C.ArucoDetectorParameters_Create()}\n}\n\nfunc (ap *ArucoDetectorParameters) SetAdaptiveThreshWinSizeMin(adaptiveThreshWinSizeMin int) {\n\tC.ArucoDetectorParameters_SetAdaptiveThreshWinSizeMin(ap.p, C.int(adaptiveThreshWinSizeMin))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAdaptiveThreshWinSizeMin() int {\n\treturn int(C.ArucoDetectorParameters_GetAdaptiveThreshWinSizeMin(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAdaptiveThreshWinSizeMax(adaptiveThreshWinSizeMax int) {\n\tC.ArucoDetectorParameters_SetAdaptiveThreshWinSizeMax(ap.p, C.int(adaptiveThreshWinSizeMax))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAdaptiveThreshWinSizeMax() int {\n\treturn int(C.ArucoDetectorParameters_GetAdaptiveThreshWinSizeMax(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAdaptiveThreshWinSizeStep(adaptiveThreshWinSizeStep int) {\n\tC.ArucoDetectorParameters_SetAdaptiveThreshWinSizeStep(ap.p, C.int(adaptiveThreshWinSizeStep))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAdaptiveThreshWinSizeStep() int {\n\treturn int(C.ArucoDetectorParameters_GetAdaptiveThreshWinSizeStep(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAdaptiveThreshConstant(adaptiveThreshConstant float64) {\n\tC.ArucoDetectorParameters_SetAdaptiveThreshConstant(ap.p, C.double(adaptiveThreshConstant))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAdaptiveThreshConstant() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetAdaptiveThreshConstant(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMinMarkerPerimeterRate(minMarkerPerimeterRate float64) {\n\tC.ArucoDetectorParameters_SetMinMarkerPerimeterRate(ap.p, C.double(minMarkerPerimeterRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMinMarkerPerimeterRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMinMarkerPerimeterRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMaxMarkerPerimeterRate(maxMarkerPerimeterRate float64) {\n\tC.ArucoDetectorParameters_SetMaxMarkerPerimeterRate(ap.p, C.double(maxMarkerPerimeterRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMaxMarkerPerimeterRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMaxMarkerPerimeterRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetPolygonalApproxAccuracyRate(polygonalApproxAccuracyRate float64) {\n\tC.ArucoDetectorParameters_SetPolygonalApproxAccuracyRate(ap.p, C.double(polygonalApproxAccuracyRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetPolygonalApproxAccuracyRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetPolygonalApproxAccuracyRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMinCornerDistanceRate(minCornerDistanceRate float64) {\n\tC.ArucoDetectorParameters_SetMinCornerDistanceRate(ap.p, C.double(minCornerDistanceRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMinCornerDistanceRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMinCornerDistanceRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMinDistanceToBorder(minDistanceToBorder int) {\n\tC.ArucoDetectorParameters_SetMinDistanceToBorder(ap.p, C.int(minDistanceToBorder))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMinDistanceToBorder() int {\n\treturn int(C.ArucoDetectorParameters_GetMinDistanceToBorder(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMinMarkerDistanceRate(minMarkerDistanceRate float64) {\n\tC.ArucoDetectorParameters_SetMinMarkerDistanceRate(ap.p, C.double(minMarkerDistanceRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMinMarkerDistanceRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMinMarkerDistanceRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetCornerRefinementMethod(cornerRefinementMethod int) {\n\tC.ArucoDetectorParameters_SetCornerRefinementMethod(ap.p, C.int(cornerRefinementMethod))\n}\n\nfunc (ap *ArucoDetectorParameters) GetCornerRefinementMethod() int {\n\treturn int(C.ArucoDetectorParameters_GetCornerRefinementMethod(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetCornerRefinementWinSize(cornerRefinementWinSize int) {\n\tC.ArucoDetectorParameters_SetCornerRefinementWinSize(ap.p, C.int(cornerRefinementWinSize))\n}\n\nfunc (ap *ArucoDetectorParameters) GetCornerRefinementWinSize() int {\n\treturn int(C.ArucoDetectorParameters_GetCornerRefinementWinSize(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetCornerRefinementMaxIterations(cornerRefinementMaxIterations int) {\n\tC.ArucoDetectorParameters_SetCornerRefinementMaxIterations(ap.p, C.int(cornerRefinementMaxIterations))\n}\n\nfunc (ap *ArucoDetectorParameters) GetCornerRefinementMaxIterations() int {\n\treturn int(C.ArucoDetectorParameters_GetCornerRefinementMaxIterations(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetCornerRefinementMinAccuracy(cornerRefinementMinAccuracy float64) {\n\tC.ArucoDetectorParameters_SetCornerRefinementMinAccuracy(ap.p, C.double(cornerRefinementMinAccuracy))\n}\n\nfunc (ap *ArucoDetectorParameters) GetCornerRefinementMinAccuracy() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetCornerRefinementMinAccuracy(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMarkerBorderBits(markerBorderBits int) {\n\tC.ArucoDetectorParameters_SetMarkerBorderBits(ap.p, C.int(markerBorderBits))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMarkerBorderBits() int {\n\treturn int(C.ArucoDetectorParameters_GetMarkerBorderBits(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetPerspectiveRemovePixelPerCell(perspectiveRemovePixelPerCell int) {\n\tC.ArucoDetectorParameters_SetPerspectiveRemovePixelPerCell(ap.p, C.int(perspectiveRemovePixelPerCell))\n}\n\nfunc (ap *ArucoDetectorParameters) GetPerspectiveRemovePixelPerCell() int {\n\treturn int(C.ArucoDetectorParameters_GetPerspectiveRemovePixelPerCell(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetPerspectiveRemoveIgnoredMarginPerCell(perspectiveRemoveIgnoredMarginPerCell float64) {\n\tC.ArucoDetectorParameters_SetPerspectiveRemoveIgnoredMarginPerCell(ap.p, C.double(perspectiveRemoveIgnoredMarginPerCell))\n}\n\nfunc (ap *ArucoDetectorParameters) GetPerspectiveRemoveIgnoredMarginPerCell() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetPerspectiveRemoveIgnoredMarginPerCell(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMaxErroneousBitsInBorderRate(maxErroneousBitsInBorderRate float64) {\n\tC.ArucoDetectorParameters_SetMaxErroneousBitsInBorderRate(ap.p, C.double(maxErroneousBitsInBorderRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMaxErroneousBitsInBorderRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMaxErroneousBitsInBorderRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetMinOtsuStdDev(minOtsuStdDev float64) {\n\tC.ArucoDetectorParameters_SetMinOtsuStdDev(ap.p, C.double(minOtsuStdDev))\n}\n\nfunc (ap *ArucoDetectorParameters) GetMinOtsuStdDev() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetMinOtsuStdDev(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetErrorCorrectionRate(errorCorrectionRate float64) {\n\tC.ArucoDetectorParameters_SetErrorCorrectionRate(ap.p, C.double(errorCorrectionRate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetErrorCorrectionRate() float64 {\n\treturn float64(C.ArucoDetectorParameters_GetErrorCorrectionRate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagQuadDecimate(aprilTagQuadDecimate float32) {\n\tC.ArucoDetectorParameters_SetAprilTagQuadDecimate(ap.p, C.float(aprilTagQuadDecimate))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagQuadDecimate() float32 {\n\treturn float32(C.ArucoDetectorParameters_GetAprilTagQuadDecimate(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagQuadSigma(aprilTagQuadSigma float32) {\n\tC.ArucoDetectorParameters_SetAprilTagQuadSigma(ap.p, C.float(aprilTagQuadSigma))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagQuadSigma() float32 {\n\treturn float32(C.ArucoDetectorParameters_GetAprilTagQuadSigma(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagMinClusterPixels(aprilTagMinClusterPixels int) {\n\tC.ArucoDetectorParameters_SetAprilTagMinClusterPixels(ap.p, C.int(aprilTagMinClusterPixels))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagMinClusterPixels() int {\n\treturn int(C.ArucoDetectorParameters_GetAprilTagMinClusterPixels(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagMaxNmaxima(aprilTagMaxNmaxima int) {\n\tC.ArucoDetectorParameters_SetAprilTagMaxNmaxima(ap.p, C.int(aprilTagMaxNmaxima))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagMaxNmaxima() int {\n\treturn int(C.ArucoDetectorParameters_GetAprilTagMaxNmaxima(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagCriticalRad(aprilTagCriticalRad float32) {\n\tC.ArucoDetectorParameters_SetAprilTagCriticalRad(ap.p, C.float(aprilTagCriticalRad))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagCriticalRad() float32 {\n\treturn float32(C.ArucoDetectorParameters_GetAprilTagCriticalRad(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagMaxLineFitMse(aprilTagMaxLineFitMse float32) {\n\tC.ArucoDetectorParameters_SetAprilTagMaxLineFitMse(ap.p, C.float(aprilTagMaxLineFitMse))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagMaxLineFitMse() float32 {\n\treturn float32(C.ArucoDetectorParameters_GetAprilTagMaxLineFitMse(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagMinWhiteBlackDiff(aprilTagMinWhiteBlackDiff int) {\n\tC.ArucoDetectorParameters_SetAprilTagMinWhiteBlackDiff(ap.p, C.int(aprilTagMinWhiteBlackDiff))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagMinWhiteBlackDiff() int {\n\treturn int(C.ArucoDetectorParameters_GetAprilTagMinWhiteBlackDiff(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetAprilTagDeglitch(aprilTagDeglitch int) {\n\tC.ArucoDetectorParameters_SetAprilTagDeglitch(ap.p, C.int(aprilTagDeglitch))\n}\n\nfunc (ap *ArucoDetectorParameters) GetAprilTagDeglitch() int {\n\treturn int(C.ArucoDetectorParameters_GetAprilTagDeglitch(ap.p))\n}\n\nfunc (ap *ArucoDetectorParameters) SetDetectInvertedMarker(detectInvertedMarker bool) {\n\tC.ArucoDetectorParameters_SetDetectInvertedMarker(ap.p, C.bool(detectInvertedMarker))\n}\n\nfunc (ap *ArucoDetectorParameters) GetDetectInvertedMarker() bool {\n\treturn bool(C.ArucoDetectorParameters_GetDetectInvertedMarker(ap.p))\n}\n"
  },
  {
    "path": "aruco.h",
    "content": "#ifndef _OPENCV3_ARUCO_H_\n#define _OPENCV3_ARUCO_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::aruco::Dictionary* ArucoDictionary;\ntypedef cv::aruco::DetectorParameters* ArucoDetectorParameters; \ntypedef cv::aruco::ArucoDetector* ArucoDetector;\n#else\ntypedef void *ArucoDictionary;\ntypedef void *ArucoDetectorParameters;\ntypedef void *ArucoDetector;\n#endif\n\nArucoDetectorParameters ArucoDetectorParameters_Create();\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeMin(ArucoDetectorParameters ap, int adaptiveThreshWinSizeMin);\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeMin(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeMax(ArucoDetectorParameters ap, int adaptiveThreshWinSizeMax);\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeMax(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAdaptiveThreshWinSizeStep(ArucoDetectorParameters ap, int adaptiveThreshWinSizeStep);\nint ArucoDetectorParameters_GetAdaptiveThreshWinSizeStep(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAdaptiveThreshConstant(ArucoDetectorParameters ap, double adaptiveThreshConstant);\ndouble ArucoDetectorParameters_GetAdaptiveThreshConstant(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMinMarkerPerimeterRate(ArucoDetectorParameters ap, double minMarkerPerimeterRate);\ndouble ArucoDetectorParameters_GetMinMarkerPerimeterRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMaxMarkerPerimeterRate(ArucoDetectorParameters ap, double maxMarkerPerimeterRate);\ndouble ArucoDetectorParameters_GetMaxMarkerPerimeterRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetPolygonalApproxAccuracyRate(ArucoDetectorParameters ap, double polygonalApproxAccuracyRate);\ndouble ArucoDetectorParameters_GetPolygonalApproxAccuracyRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMinCornerDistanceRate(ArucoDetectorParameters ap, double minCornerDistanceRate);\ndouble ArucoDetectorParameters_GetMinCornerDistanceRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMinDistanceToBorder(ArucoDetectorParameters ap, int minDistanceToBorder);\nint ArucoDetectorParameters_GetMinDistanceToBorder(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMinMarkerDistanceRate(ArucoDetectorParameters ap, double minMarkerDistanceRate);\ndouble ArucoDetectorParameters_GetMinMarkerDistanceRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetCornerRefinementMethod(ArucoDetectorParameters ap, int cornerRefinementMethod);\nint ArucoDetectorParameters_GetCornerRefinementMethod(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetCornerRefinementWinSize(ArucoDetectorParameters ap, int cornerRefinementWinSize);\nint ArucoDetectorParameters_GetCornerRefinementWinSize(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetCornerRefinementMaxIterations(ArucoDetectorParameters ap, int cornerRefinementMaxIterations);\nint ArucoDetectorParameters_GetCornerRefinementMaxIterations(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetCornerRefinementMinAccuracy(ArucoDetectorParameters ap, double cornerRefinementMinAccuracy);\ndouble ArucoDetectorParameters_GetCornerRefinementMinAccuracy(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMarkerBorderBits(ArucoDetectorParameters ap, int markerBorderBits);\nint ArucoDetectorParameters_GetMarkerBorderBits(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetPerspectiveRemovePixelPerCell(ArucoDetectorParameters ap, int perspectiveRemovePixelPerCell);\nint ArucoDetectorParameters_GetPerspectiveRemovePixelPerCell(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetPerspectiveRemoveIgnoredMarginPerCell(ArucoDetectorParameters ap, double perspectiveRemoveIgnoredMarginPerCell);\ndouble ArucoDetectorParameters_GetPerspectiveRemoveIgnoredMarginPerCell(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMaxErroneousBitsInBorderRate(ArucoDetectorParameters ap, double maxErroneousBitsInBorderRate);\ndouble ArucoDetectorParameters_GetMaxErroneousBitsInBorderRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetMinOtsuStdDev(ArucoDetectorParameters ap, double minOtsuStdDev);\ndouble ArucoDetectorParameters_GetMinOtsuStdDev(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetErrorCorrectionRate(ArucoDetectorParameters ap, double errorCorrectionRate);\ndouble ArucoDetectorParameters_GetErrorCorrectionRate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagQuadDecimate(ArucoDetectorParameters ap, float aprilTagQuadDecimate);\nfloat ArucoDetectorParameters_GetAprilTagQuadDecimate(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagQuadSigma(ArucoDetectorParameters ap, float aprilTagQuadSigma);\nfloat ArucoDetectorParameters_GetAprilTagQuadSigma(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagMinClusterPixels(ArucoDetectorParameters ap, int aprilTagMinClusterPixels);\nint ArucoDetectorParameters_GetAprilTagMinClusterPixels(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagMaxNmaxima(ArucoDetectorParameters ap, int aprilTagMaxNmaxima);\nint ArucoDetectorParameters_GetAprilTagMaxNmaxima(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagCriticalRad(ArucoDetectorParameters ap, float aprilTagCriticalRad);\nfloat ArucoDetectorParameters_GetAprilTagCriticalRad(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagMaxLineFitMse(ArucoDetectorParameters ap, float aprilTagMaxLineFitMse);\nfloat ArucoDetectorParameters_GetAprilTagMaxLineFitMse(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagMinWhiteBlackDiff(ArucoDetectorParameters ap, int aprilTagMinWhiteBlackDiff);\nint ArucoDetectorParameters_GetAprilTagMinWhiteBlackDiff(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetAprilTagDeglitch(ArucoDetectorParameters ap, int aprilTagDeglitch);\nint ArucoDetectorParameters_GetAprilTagDeglitch(ArucoDetectorParameters ap);\nvoid ArucoDetectorParameters_SetDetectInvertedMarker(ArucoDetectorParameters ap, bool detectInvertedMarker);\nbool ArucoDetectorParameters_GetDetectInvertedMarker(ArucoDetectorParameters ap);\n\n\nArucoDictionary getPredefinedDictionary(int dictionaryId);\n\nArucoDetector ArucoDetector_New();\nArucoDetector ArucoDetector_NewWithParams(ArucoDictionary dictionary, ArucoDetectorParameters params);\nvoid ArucoDetector_Close(ArucoDetector ad);\nvoid ArucoDetector_DetectMarkers(ArucoDetector ad, Mat inputArr, Points2fVector markerCorners, IntVector *markerIds, Points2fVector rejectedCandidates);\n\nOpenCVResult ArucoDrawDetectedMarkers(Mat image, Points2fVector markerCorners, IntVector markerIds, Scalar borderColor);\nOpenCVResult ArucoGenerateImageMarker(int dictionaryId, int id, int sidePixels, Mat img, int borderBits);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_ARUCO_H_\n"
  },
  {
    "path": "aruco_dictionaries.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_aruco)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"aruco.h\"\n#include \"core.h\"\n*/\nimport \"C\"\n\ntype ArucoDictionaryCode int\n\nconst (\n\tArucoDict4x4_50         ArucoDictionaryCode = iota\n\tArucoDict4x4_100        ArucoDictionaryCode = iota\n\tArucoDict4x4_250        ArucoDictionaryCode = iota\n\tArucoDict4x4_1000       ArucoDictionaryCode = iota\n\tArucoDict5x5_50         ArucoDictionaryCode = iota\n\tArucoDict5x5_100        ArucoDictionaryCode = iota\n\tArucoDict5x5_250        ArucoDictionaryCode = iota\n\tArucoDict5x5_1000       ArucoDictionaryCode = iota\n\tArucoDict6x6_50         ArucoDictionaryCode = iota\n\tArucoDict6x6_100        ArucoDictionaryCode = iota\n\tArucoDict6x6_250        ArucoDictionaryCode = iota\n\tArucoDict6x6_1000       ArucoDictionaryCode = iota\n\tArucoDict7x7_50         ArucoDictionaryCode = iota\n\tArucoDict7x7_100        ArucoDictionaryCode = iota\n\tArucoDict7x7_250        ArucoDictionaryCode = iota\n\tArucoDict7x7_1000       ArucoDictionaryCode = iota\n\tArucoDictArucoOriginal  ArucoDictionaryCode = iota\n\tArucoDictAprilTag_16h5  ArucoDictionaryCode = iota ///< 4x4 bits, minimum hamming distance between any two codes = 5, 30 codes\n\tArucoDictAprilTag_25h9  ArucoDictionaryCode = iota ///< 5x5 bits, minimum hamming distance between any two codes = 9, 35 codes\n\tArucoDictAprilTag_36h10 ArucoDictionaryCode = iota ///< 6x6 bits, minimum hamming distance between any two codes = 10, 2320 codes\n\tArucoDictAprilTag_36h11 ArucoDictionaryCode = iota ///< 6x6 bits, minimum hamming distance between any two codes = 11, 587 codes\n)\n\ntype ArucoDictionary struct {\n\tp C.ArucoDictionary\n}\n\nfunc GetPredefinedDictionary(dictionaryId ArucoDictionaryCode) ArucoDictionary {\n\tvar p C.ArucoDictionary = C.getPredefinedDictionary(C.int(dictionaryId))\n\treturn ArucoDictionary{p: p}\n}\n"
  },
  {
    "path": "aruco_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_aruco)\n\npackage gocv\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nconst (\n\tarucoImage6X6_250         = \"./images/aruco_6X6_250_6.png\"\n\tarucoImage6X6_250_contour = \"./images/aruco_6X6_250_6_contour.png\"\n\tarucoImage6X6_250_1       = \"./images/aruco_6X6_250_1.png\"\n)\n\nfunc TestArucoDetectorParams(t *testing.T) {\n\n\tadaptiveThreshWinSizeMin := 4\n\tadaptiveThreshWinSizeMax := 22\n\tadaptiveThreshWinSizeStep := 1\n\tadaptiveThreshConstant := 1.0\n\tminMarkerPerimeterRate := 0.2\n\tmaxMarkerPerimeterRate := 0.5\n\tpolygonalApproxAccuracyRate := 1.0\n\tminCornerDistanceRate := 0.1\n\tminDistanceToBorder := 0\n\tminMarkerDistanceRate := 1.0\n\tcornerRefinementMethod := 1\n\tcornerRefinementWinSize := 1\n\tcornerRefinementMaxIterations := 1\n\tcornerRefinementMinAccuracy := 0.5\n\tmarkerBorderBits := 1\n\tperspectiveRemovePixelPerCell := 1\n\tperspectiveRemoveIgnoredMarginPerCell := 1.0\n\tmaxErroneousBitsInBorderRate := 0.5\n\tminOtsuStdDev := .5\n\terrorCorrectionRate := 0.2\n\taprilTagQuadDecimate := float32(0.5)\n\taprilTagQuadSigma := float32(1)\n\taprilTagMinClusterPixels := 1\n\taprilTagMaxNmaxima := 1\n\taprilTagCriticalRad := float32(0.2)\n\taprilTagMaxLineFitMse := float32(0.2)\n\taprilTagMinWhiteBlackDiff := 1\n\taprilTagDeglitch := 1\n\tdetectInvertedMarker := false\n\n\tparams := NewArucoDetectorParameters()\n\tparams.SetAdaptiveThreshWinSizeMin(adaptiveThreshWinSizeMin)\n\tparams.SetAdaptiveThreshWinSizeMax(adaptiveThreshWinSizeMax)\n\tparams.SetAdaptiveThreshWinSizeStep(adaptiveThreshWinSizeStep)\n\tparams.SetAdaptiveThreshConstant(adaptiveThreshConstant)\n\tparams.SetMinMarkerPerimeterRate(minMarkerPerimeterRate)\n\tparams.SetMaxMarkerPerimeterRate(maxMarkerPerimeterRate)\n\tparams.SetPolygonalApproxAccuracyRate(polygonalApproxAccuracyRate)\n\tparams.SetMinCornerDistanceRate(minCornerDistanceRate)\n\tparams.SetMinDistanceToBorder(minDistanceToBorder)\n\tparams.SetMinMarkerDistanceRate(minMarkerDistanceRate)\n\tparams.SetCornerRefinementMethod(cornerRefinementMethod)\n\tparams.SetCornerRefinementWinSize(cornerRefinementWinSize)\n\tparams.SetCornerRefinementMaxIterations(cornerRefinementMaxIterations)\n\tparams.SetCornerRefinementMinAccuracy(cornerRefinementMinAccuracy)\n\tparams.SetMarkerBorderBits(markerBorderBits)\n\tparams.SetPerspectiveRemovePixelPerCell(perspectiveRemovePixelPerCell)\n\tparams.SetPerspectiveRemoveIgnoredMarginPerCell(perspectiveRemoveIgnoredMarginPerCell)\n\tparams.SetMaxErroneousBitsInBorderRate(maxErroneousBitsInBorderRate)\n\tparams.SetMinOtsuStdDev(minOtsuStdDev)\n\tparams.SetErrorCorrectionRate(errorCorrectionRate)\n\tparams.SetAprilTagQuadDecimate(aprilTagQuadDecimate)\n\tparams.SetAprilTagQuadSigma(aprilTagQuadSigma)\n\tparams.SetAprilTagMinClusterPixels(aprilTagMinClusterPixels)\n\tparams.SetAprilTagMaxNmaxima(aprilTagMaxNmaxima)\n\tparams.SetAprilTagCriticalRad(aprilTagCriticalRad)\n\tparams.SetAprilTagMaxLineFitMse(aprilTagMaxLineFitMse)\n\tparams.SetAprilTagMinWhiteBlackDiff(aprilTagMinWhiteBlackDiff)\n\tparams.SetAprilTagDeglitch(aprilTagDeglitch)\n\tparams.SetDetectInvertedMarker(detectInvertedMarker)\n\tif params.GetAdaptiveThreshWinSizeMin() != adaptiveThreshWinSizeMin {\n\t\tt.Error(fmt.Sprintf(\"AdaptiveThreshWinSizeMin expected %v got %v\", adaptiveThreshWinSizeMin, params.GetAdaptiveThreshWinSizeMin()))\n\t}\n\tif params.GetAdaptiveThreshWinSizeMax() != adaptiveThreshWinSizeMax {\n\t\tt.Error(fmt.Sprintf(\"AdaptiveThreshWinSizeMax expected %v got %v\", adaptiveThreshWinSizeMax, params.GetAdaptiveThreshWinSizeMax()))\n\t}\n\tif params.GetAdaptiveThreshWinSizeStep() != adaptiveThreshWinSizeStep {\n\t\tt.Error(fmt.Sprintf(\"AdaptiveThreshWinSizeStep expected %v got %v\", adaptiveThreshWinSizeStep, params.GetAdaptiveThreshWinSizeStep()))\n\t}\n\tif params.GetAdaptiveThreshConstant() != adaptiveThreshConstant {\n\t\tt.Error(fmt.Sprintf(\"AdaptiveThreshConstant expected %v got %v\", adaptiveThreshConstant, params.GetAdaptiveThreshConstant()))\n\t}\n\tif params.GetMinMarkerPerimeterRate() != minMarkerPerimeterRate {\n\t\tt.Error(fmt.Sprintf(\"MinMarkerPerimeterRate expected %v got %v\", minMarkerPerimeterRate, params.GetMinMarkerPerimeterRate()))\n\t}\n\tif params.GetMaxMarkerPerimeterRate() != maxMarkerPerimeterRate {\n\t\tt.Error(fmt.Sprintf(\"MaxMarkerPerimeterRate expected %v got %v\", maxMarkerPerimeterRate, params.GetMaxMarkerPerimeterRate()))\n\t}\n\tif params.GetPolygonalApproxAccuracyRate() != polygonalApproxAccuracyRate {\n\t\tt.Error(fmt.Sprintf(\"PolygonalApproxAccuracyRate expected %v got %v\", polygonalApproxAccuracyRate, params.GetPolygonalApproxAccuracyRate()))\n\t}\n\tif params.GetMinCornerDistanceRate() != minCornerDistanceRate {\n\t\tt.Error(fmt.Sprintf(\"MinCornerDistanceRate expected %v got %v\", minCornerDistanceRate, params.GetMinCornerDistanceRate()))\n\t}\n\tif params.GetMinDistanceToBorder() != minDistanceToBorder {\n\t\tt.Error(fmt.Sprintf(\"MinDistanceToBorder expected %v got %v\", minDistanceToBorder, params.GetMinDistanceToBorder()))\n\t}\n\tif params.GetMinMarkerDistanceRate() != minMarkerDistanceRate {\n\t\tt.Error(fmt.Sprintf(\"MinMarkerDistanceRate expected %v got %v\", minMarkerDistanceRate, params.GetMinMarkerDistanceRate()))\n\t}\n\tif params.GetCornerRefinementMethod() != cornerRefinementMethod {\n\t\tt.Error(fmt.Sprintf(\"CornerRefinementMethod expected %v got %v\", cornerRefinementMethod, params.GetCornerRefinementMethod()))\n\t}\n\tif params.GetCornerRefinementWinSize() != cornerRefinementWinSize {\n\t\tt.Error(fmt.Sprintf(\"CornerRefinementWinSize expected %v got %v\", cornerRefinementWinSize, params.GetCornerRefinementWinSize()))\n\t}\n\tif params.GetCornerRefinementMaxIterations() != cornerRefinementMaxIterations {\n\t\tt.Error(fmt.Sprintf(\"CornerRefinementMaxIterations expected %v got %v\", cornerRefinementMaxIterations, params.GetCornerRefinementMaxIterations()))\n\t}\n\tif params.GetCornerRefinementMinAccuracy() != cornerRefinementMinAccuracy {\n\t\tt.Error(fmt.Sprintf(\"CornerRefinementMinAccuracy expected %v got %v\", cornerRefinementMinAccuracy, params.GetCornerRefinementMinAccuracy()))\n\t}\n\tif params.GetMarkerBorderBits() != markerBorderBits {\n\t\tt.Error(fmt.Sprintf(\"MarkerBorderBits expected %v got %v\", markerBorderBits, params.GetMarkerBorderBits()))\n\t}\n\tif params.GetPerspectiveRemovePixelPerCell() != perspectiveRemovePixelPerCell {\n\t\tt.Error(fmt.Sprintf(\"PerspectiveRemovePixelPerCell expected %v got %v\", perspectiveRemovePixelPerCell, params.GetPerspectiveRemovePixelPerCell()))\n\t}\n\tif params.GetPerspectiveRemoveIgnoredMarginPerCell() != perspectiveRemoveIgnoredMarginPerCell {\n\t\tt.Error(fmt.Sprintf(\"PerspectiveRemoveIgnoredMarginPerCell expected %v got %v\", perspectiveRemoveIgnoredMarginPerCell, params.GetPerspectiveRemoveIgnoredMarginPerCell()))\n\t}\n\tif params.GetMaxErroneousBitsInBorderRate() != maxErroneousBitsInBorderRate {\n\t\tt.Error(fmt.Sprintf(\"MaxErroneousBitsInBorderRate expected %v got %v\", maxErroneousBitsInBorderRate, params.GetMaxErroneousBitsInBorderRate()))\n\t}\n\tif params.GetMinOtsuStdDev() != minOtsuStdDev {\n\t\tt.Error(fmt.Sprintf(\"MinOtsuStdDev expected %v got %v\", minOtsuStdDev, params.GetMinOtsuStdDev()))\n\t}\n\tif params.GetErrorCorrectionRate() != errorCorrectionRate {\n\t\tt.Error(fmt.Sprintf(\"ErrorCorrectionRate expected %v got %v\", errorCorrectionRate, params.GetErrorCorrectionRate()))\n\t}\n\tif params.GetAprilTagQuadDecimate() != aprilTagQuadDecimate {\n\t\tt.Error(fmt.Sprintf(\"AprilTagQuadDecimate expected %v got %v\", aprilTagQuadDecimate, params.GetAprilTagQuadDecimate()))\n\t}\n\tif params.GetAprilTagQuadSigma() != aprilTagQuadSigma {\n\t\tt.Error(fmt.Sprintf(\"AprilTagQuadSigma expected %v got %v\", aprilTagQuadSigma, params.GetAprilTagQuadSigma()))\n\t}\n\tif params.GetAprilTagMinClusterPixels() != aprilTagMinClusterPixels {\n\t\tt.Error(fmt.Sprintf(\"AprilTagMinClusterPixels expected %v got %v\", aprilTagMinClusterPixels, params.GetAprilTagMinClusterPixels()))\n\t}\n\tif params.GetAprilTagMaxNmaxima() != aprilTagMaxNmaxima {\n\t\tt.Error(fmt.Sprintf(\"AprilTagMaxNmaxima expected %v got %v\", aprilTagMaxNmaxima, params.GetAprilTagMaxNmaxima()))\n\t}\n\tif params.GetAprilTagCriticalRad() != aprilTagCriticalRad {\n\t\tt.Error(fmt.Sprintf(\"AprilTagCriticalRad expected %v got %v\", aprilTagCriticalRad, params.GetAprilTagCriticalRad()))\n\t}\n\tif params.GetAprilTagMaxLineFitMse() != aprilTagMaxLineFitMse {\n\t\tt.Error(fmt.Sprintf(\"AprilTagMaxLineFitMse expected %v got %v\", aprilTagMaxLineFitMse, params.GetAprilTagMaxLineFitMse()))\n\t}\n\tif params.GetAprilTagMinWhiteBlackDiff() != aprilTagMinWhiteBlackDiff {\n\t\tt.Error(fmt.Sprintf(\"AprilTagMinWhiteBlackDiff expected %v got %v\", aprilTagMinWhiteBlackDiff, params.GetAprilTagMinWhiteBlackDiff()))\n\t}\n\tif params.GetAprilTagDeglitch() != aprilTagDeglitch {\n\t\tt.Error(fmt.Sprintf(\"AprilTagDeglitch expected %v got %v\", aprilTagDeglitch, params.GetAprilTagDeglitch()))\n\t}\n\tif params.GetDetectInvertedMarker() != detectInvertedMarker {\n\t\tt.Error(fmt.Sprintf(\"DetectInvertedMarker expected %v got %v\", detectInvertedMarker, params.GetDetectInvertedMarker()))\n\t}\n\n}\n\nfunc TestDetectMarkers(t *testing.T) {\n\tpath := arucoImage6X6_250\n\timg := IMRead(path, IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(errors.New(\"Invalid input\"))\n\t}\n\tdefer img.Close()\n\n\tdict := GetPredefinedDictionary(ArucoDict6x6_250)\n\tparams := NewArucoDetectorParameters()\n\tdetector := NewArucoDetectorWithParams(dict, params)\n\tdefer detector.Close()\n\n\t_, markerIds, _ := detector.DetectMarkers(img)\n\texpected := []int{40, 98, 62, 23, 124, 203}\n\tif !reflect.DeepEqual(markerIds, expected) {\n\t\tt.Error(fmt.Sprintf(\"Marker id expected %v got %v\", expected, markerIds))\n\t}\n}\n\nfunc TestDrawDetectedMarkers(t *testing.T) {\n\tborderColor := NewScalar(200, 0, 0, 0)\n\n\timg := IMRead(arucoImage6X6_250, IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(errors.New(\"Invalid input\"))\n\t}\n\tdefer img.Close()\n\timgExpected := IMRead(arucoImage6X6_250_contour, IMReadColor)\n\tif imgExpected.Empty() {\n\t\tt.Error(errors.New(\"Invalid input\"))\n\t}\n\tdefer imgExpected.Close()\n\n\tdict := GetPredefinedDictionary(ArucoDict6x6_250)\n\tparams := NewArucoDetectorParameters()\n\tdetector := NewArucoDetectorWithParams(dict, params)\n\tdefer detector.Close()\n\n\tmarkerCorners, markerIds, _ := detector.DetectMarkers(img)\n\n\tArucoDrawDetectedMarkers(img, markerCorners, markerIds, borderColor)\n\tdiff := NewMat()\n\tdefer diff.Close()\n\tAbsDiff(img, imgExpected, &diff)\n\n\tgray := NewMat()\n\tdefer gray.Close()\n\tCvtColor(diff, &gray, ColorBGRToGray)\n\tif CountNonZero(gray) > 0 {\n\t\tt.Errorf(\"expected output to match %s\", arucoImage6X6_250_contour)\n\t}\n}\n\nfunc TestArucoGenerateImageMarker(t *testing.T) {\n\timgExpected := IMRead(arucoImage6X6_250_1, IMReadGrayScale)\n\tif imgExpected.Empty() {\n\t\tt.Error(fmt.Errorf(\"Invalid marker image '%s'\", arucoImage6X6_250_1))\n\t}\n\tdefer imgExpected.Close()\n\n\timg := NewMat()\n\tdefer img.Close()\n\tArucoGenerateImageMarker(ArucoDict6x6_250, 1, 200, img, 1)\n\n\tdiff := NewMat()\n\tdefer diff.Close()\n\tAbsDiff(img, imgExpected, &diff)\n\n\tif CountNonZero(diff) > 0 {\n\t\tt.Errorf(\"expected output to match %s\", arucoImage6X6_250_1)\n\t}\n}\n"
  },
  {
    "path": "asyncarray.cpp",
    "content": "// +build openvino\n\n#include <string.h>\n#include \"asyncarray.h\"\n\n\n// AsyncArray_New creates a new empty AsyncArray\nAsyncArray AsyncArray_New() {\n    try {\n        return new cv::AsyncArray();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\n// AsyncArray_Close deletes an existing AsyncArray\nvoid AsyncArray_Close(AsyncArray a) {\n    delete a;\n}\n\nconst char* AsyncArray_GetAsync(AsyncArray async_out,Mat out) {\n    try {\n       async_out->get(*out);\n    } catch(const cv::Exception& ex) {\n        return ex.what();\n    }\n    return \"\";\n}\n\nAsyncArray Net_forwardAsync(Net net, const char* outputName) {\n    try {\n        return new cv::AsyncArray(net->forwardAsync(outputName));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n"
  },
  {
    "path": "asyncarray.go",
    "content": "//go:build openvino\n// +build openvino\n\npackage gocv\n\nimport (\n\t\"errors\"\n)\n\n/*\n#include <stdlib.h>\n#include \"dnn.h\"\n#include \"asyncarray.h\"\n#include \"core.h\"\n*/\nimport \"C\"\n\ntype AsyncArray struct {\n\tp C.AsyncArray\n}\n\n// NewAsyncArray returns a new empty AsyncArray.\nfunc NewAsyncArray() AsyncArray {\n\treturn newAsyncArray(C.AsyncArray_New())\n}\n\n// Ptr returns the AsyncArray's underlying object pointer.\nfunc (a *AsyncArray) Ptr() C.AsyncArray {\n\treturn a.p\n}\n\n// Get async returns the Mat\nfunc (m *AsyncArray) Get(mat *Mat) error {\n\tresult := C.AsyncArray_GetAsync(m.p, mat.p)\n\terr := C.GoString(result)\n\n\tif len(err) > 0 {\n\t\treturn errors.New(err)\n\t}\n\treturn nil\n}\n\n// newAsyncArray returns a new AsyncArray from a C AsyncArray\nfunc newAsyncArray(p C.AsyncArray) AsyncArray {\n\treturn AsyncArray{p: p}\n}\n\n// Close the AsyncArray object.\nfunc (a *AsyncArray) Close() error {\n\tC.AsyncArray_Close(a.p)\n\ta.p = nil\n\treturn nil\n}\n"
  },
  {
    "path": "asyncarray.h",
    "content": "#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n#include \"dnn.h\"\n\n#ifdef __cplusplus\ntypedef cv::AsyncArray* AsyncArray;\n#else\ntypedef void* AsyncArray;\n#endif\n\nAsyncArray AsyncArray_New();\nconst char* AsyncArray_GetAsync(AsyncArray async_out,Mat out);\nvoid AsyncArray_Close(AsyncArray a);\nAsyncArray Net_forwardAsync(Net net, const char* outputName);\n\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "asyncarray_test.go",
    "content": "//go:build openvino\n// +build openvino\n\npackage gocv\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAsyncArray(t *testing.T) {\n\tasyncarray := NewAsyncArray()\n\tdefer asyncarray.Close()\n\n\tif asyncarray.Ptr() == nil {\n\t\tt.Error(\"New AsyncArray should not be nil\")\n\t}\n}\n"
  },
  {
    "path": "calib3d.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_calib3d)\n\n#include \"calib3d.h\"\n\ndouble Fisheye_Calibrate(Points3fVector objectPoints, Points2fVector imagePoints, Size size, Mat k, Mat d, Mat rvecs, Mat tvecs, int flags) {\n    try {\n        cv::Size sz(size.width, size.height);\n        return cv::fisheye::calibrate(*objectPoints, *imagePoints, sz, *k, *d, *rvecs, *tvecs, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Fisheye_DistortPoints(Mat undistorted, Mat distorted, Mat k, Mat d) {\n    try {\n        cv::fisheye::distortPoints(*undistorted, *distorted, *k, *d);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Fisheye_UndistortImage(Mat distorted, Mat undistorted, Mat k, Mat d) {\n    try {\n        cv::fisheye::undistortImage(*distorted, *undistorted, *k, *d);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Fisheye_UndistortImageWithParams(Mat distorted, Mat undistorted, Mat k, Mat d, Mat knew, Size size) {\n    try {\n        cv::Size sz(size.width, size.height);\n        cv::fisheye::undistortImage(*distorted, *undistorted, *k, *d, *knew, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Fisheye_UndistortPoints(Mat distorted, Mat undistorted, Mat k, Mat d, Mat r, Mat p) {\n    try {\n        cv::fisheye::undistortPoints(*distorted, *undistorted, *k, *d, *r, *p);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Fisheye_EstimateNewCameraMatrixForUndistortRectify(Mat k, Mat d, Size imgSize, Mat r, Mat p, double balance, Size newSize, double fovScale) {\n    try {\n        cv::Size newSz(newSize.width, newSize.height);\n        cv::Size imgSz(imgSize.width, imgSize.height);\n        cv::fisheye::estimateNewCameraMatrixForUndistortRectify(*k, *d, imgSz, *r, *p, balance, newSz, fovScale);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult InitUndistortRectifyMap(Mat cameraMatrix,Mat distCoeffs,Mat r,Mat newCameraMatrix,Size size,int m1type,Mat map1,Mat map2) {\n    try {\n        cv::Size sz(size.width, size.height);\n        cv::initUndistortRectifyMap(*cameraMatrix,*distCoeffs,*r,*newCameraMatrix,sz,m1type,*map1,*map2);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat GetOptimalNewCameraMatrixWithParams(Mat cameraMatrix,Mat distCoeffs,Size size,double alpha,Size newImgSize,Rect* validPixROI,bool centerPrincipalPoint) {\n    try {\n        cv::Size sz(size.width, size.height);\n        cv::Size newSize(newImgSize.width, newImgSize.height);\n        cv::Rect rect(validPixROI->x,validPixROI->y,validPixROI->width,validPixROI->height);\n        cv::Mat* mat = new cv::Mat(cv::getOptimalNewCameraMatrix(*cameraMatrix,*distCoeffs,sz,alpha,newSize,&rect,centerPrincipalPoint));\n        validPixROI->x = rect.x;\n        validPixROI->y = rect.y;\n        validPixROI->width = rect.width;\n        validPixROI->height = rect.height;\n        return mat;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\ndouble CalibrateCamera(Points3fVector objectPoints, Points2fVector imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs, int flag) {\n    try {\n        return cv::calibrateCamera(*objectPoints, *imagePoints, cv::Size(imageSize.width, imageSize.height), *cameraMatrix, *distCoeffs, *rvecs, *tvecs, flag);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix) {\n    try {\n        cv::undistort(*src, *dst, *cameraMatrix, *distCoeffs, *newCameraMatrix);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult UndistortPoints(Mat distorted, Mat undistorted, Mat k, Mat d, Mat r, Mat p) {\n    try {\n        cv::undistortPoints(*distorted, *undistorted, *k, *d, *r, *p);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool CheckChessboard(Mat image, Size size) {\n    try {\n        cv::Size sz(size.width, size.height);\n        return cv::checkChessboard(*image, sz);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool FindChessboardCorners(Mat image, Size patternSize, Mat corners, int flags) {\n    try {\n        cv::Size sz(patternSize.width, patternSize.height);\n        return cv::findChessboardCorners(*image, sz, *corners, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool FindChessboardCornersSB(Mat image, Size patternSize, Mat corners, int flags) {\n    try {\n        cv::Size sz(patternSize.width, patternSize.height);\n        return cv::findChessboardCornersSB(*image, sz, *corners, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool FindChessboardCornersSBWithMeta(Mat image, Size patternSize, Mat corners, int flags, Mat meta) {\n    try {\n        cv::Size sz(patternSize.width, patternSize.height);\n        return cv::findChessboardCornersSB(*image, sz, *corners, flags, *meta);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult DrawChessboardCorners(Mat image, Size patternSize, Mat corners, bool patternWasFound) {\n    try {\n        cv::Size sz(patternSize.width, patternSize.height);\n        cv::drawChessboardCorners(*image, sz, *corners, patternWasFound);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat EstimateAffinePartial2D(Point2fVector from, Point2fVector to) {\n    try {\n        return new cv::Mat(cv::estimateAffinePartial2D(*from, *to));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat EstimateAffinePartial2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters) {\n    try {\n        return new cv::Mat(cv::estimateAffinePartial2D(*from, *to, *inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat EstimateAffine2D(Point2fVector from, Point2fVector to) {\n    try {\n        return new cv::Mat(cv::estimateAffine2D(*from, *to));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters) {\n    try {\n        return new cv::Mat(cv::estimateAffine2D(*from, *to, *inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult TriangulatePoints(Mat projMatr1, Mat projMatr2, Point2fVector projPoints1, Point2fVector projPoints2, Mat points4D) {\n    try {\n        cv::triangulatePoints(*projMatr1, *projMatr2, *projPoints1, *projPoints2, *points4D);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ConvertPointsFromHomogeneous(Mat src, Mat dst) {\n    try {\n        cv::convertPointsFromHomogeneous(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Rodrigues(Mat src, Mat dst) {\n    try {\n        cv::Rodrigues(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool SolvePnP(Point3fVector objectPoints, Point2fVector imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, bool useExtrinsicGuess, int flags) {\n    try {\n        return cv::solvePnP(*objectPoints, *imagePoints, *cameraMatrix, *distCoeffs, *rvec, *tvec, useExtrinsicGuess, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult StereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat r, Mat t, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags) {\n    try {\n        cv::stereoRectify(*cameraMatrix1, *distCoeffs1, *cameraMatrix2, *distCoeffs2, cv::Size(imageSize.width, imageSize.height), *r, *t, *R1, *R2, *P1, *P2, *Q, flags);\n        return successResult();\n    } catch(const cv::Exception& e){\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat FindHomography(Mat src, Mat dst, int method, double ransacReprojThreshold, Mat mask, const int maxIters, const double confidence) {\n    try {\n        return new cv::Mat(cv::findHomography(*src, *dst, method, ransacReprojThreshold, *mask, maxIters, confidence));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n"
  },
  {
    "path": "calib3d.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_calib3d)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"calib3d.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n)\n\n// Calib is a wrapper around OpenCV's \"Camera Calibration and 3D Reconstruction\" of\n// Fisheye Camera model\n//\n// For more details, please see:\n// https://docs.opencv.org/trunk/db/d58/group__calib3d__fisheye.html\n\n// CalibFlag value for calibration\ntype CalibFlag int32\n\nconst (\n\t// CalibUseIntrinsicGuess indicates that cameraMatrix contains valid initial values\n\t// of fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially\n\t// set to the image center ( imageSize is used), and focal distances are computed\n\t// in a least-squares fashion.\n\tCalibUseIntrinsicGuess CalibFlag = 1 << iota\n\n\t// CalibRecomputeExtrinsic indicates that extrinsic will be recomputed after each\n\t// iteration of intrinsic optimization.\n\tCalibRecomputeExtrinsic\n\n\t// CalibCheckCond indicates that the functions will check validity of condition number\n\tCalibCheckCond\n\n\t// CalibFixSkew indicates that skew coefficient (alpha) is set to zero and stay zero\n\tCalibFixSkew\n\n\t// CalibFixK1 indicates that selected distortion coefficients are set to zeros and stay zero\n\tCalibFixK1\n\n\t// CalibFixK2 indicates that selected distortion coefficients are set to zeros and stay zero\n\tCalibFixK2\n\n\t// CalibFixK3 indicates that selected distortion coefficients are set to zeros and stay zero\n\tCalibFixK3\n\n\t// CalibFixK4 indicates that selected distortion coefficients are set to zeros and stay zero\n\tCalibFixK4\n\n\t// CalibFixIntrinsic indicates that fix K1, K2? and D1, D2? so that only R, T matrices are estimated\n\tCalibFixIntrinsic\n\n\t// CalibFixPrincipalPoint indicates that the principal point is not changed during the global optimization.\n\t// It stays at the center or at a different location specified when CalibUseIntrinsicGuess is set too.\n\tCalibFixPrincipalPoint\n)\n\n// CalibFlagPinhole defines the enumeration values for calibration flags when using the so-called pinhole camera model.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#enum-members\ntype CalibFlagPinhole int\n\nconst (\n\tCalibFlagPinholeNIntrinsic        CalibFlagPinhole = 18\n\tCalibFlagPinholeUseIntrinsicGuess CalibFlagPinhole = 0x00001\n\tCalibFlagPinholeFixAspectRatio    CalibFlagPinhole = 0x00002\n\tCalibFlagPinholeFixPrincipalPoint CalibFlagPinhole = 0x00004\n\tCalibFlagPinholeZeroTangentDist   CalibFlagPinhole = 0x00008\n\tCalibFlagPinholeFixFocalLength    CalibFlagPinhole = 0x00010\n\tCalibFlagPinholeFixK1             CalibFlagPinhole = 0x00020\n\tCalibFlagPinholeFixK2             CalibFlagPinhole = 0x00040\n\tCalibFlagPinholeFixK3             CalibFlagPinhole = 0x00080\n\tCalibFlagPinholeFixK4             CalibFlagPinhole = 0x00800\n\tCalibFlagPinholeFixK5             CalibFlagPinhole = 0x01000\n\tCalibFlagPinholeFixK6             CalibFlagPinhole = 0x02000\n\tCalibFlagPinholeRationalModel     CalibFlagPinhole = 0x04000\n\tCalibFlagPinholeThinPrismModel    CalibFlagPinhole = 0x08000\n\tCalibFlagPinholeFixS1S2S3S4       CalibFlagPinhole = 0x10000\n\tCalibFlagPinholeTiltedModel       CalibFlagPinhole = 0x40000\n\tCalibFlagPinholeFixTauxTauy       CalibFlagPinhole = 0x80000\n\tCalibFlagPinholeUseQR             CalibFlagPinhole = 0x100000\n\tCalibFlagPinholeFixTangentDist    CalibFlagPinhole = 0x200000\n\tCalibFlagPinholeFixIntrinsic      CalibFlagPinhole = 0x00100\n\tCalibFlagPinholeSameFocalLength   CalibFlagPinhole = 0x00200\n\tCalibFlagPinholeZeroDisparity     CalibFlagPinhole = 0x00400\n\tCalibFlagPinholeUseLU             CalibFlagPinhole = (1 << 17)\n\tCalibFlagPinholeUseExtrinsicGuess CalibFlagPinhole = (1 << 22)\n)\n\n// FisheyeCalibrate performs camera calibration.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d58/group__calib3d__fisheye.html#gad626a78de2b1dae7489e152a5a5a89e1\nfunc FisheyeCalibrate(objectPoints Points3fVector, imagePoints Points2fVector, size image.Point, k, d, rvecs, tvecs *Mat, flags CalibFlag) float64 {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn float64(C.Fisheye_Calibrate(objectPoints.p, imagePoints.p, sz, k.p, d.p, rvecs.p, tvecs.p, C.int(flags)))\n}\n\n// FisheyeDistortPoints distorts 2D points using fisheye model.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gab738cdf90ceee97b2b52b0d0e7511541\nfunc FisheyeDistortPoints(undistorted Mat, distorted *Mat, k, d Mat) error {\n\treturn OpenCVResult(C.Fisheye_DistortPoints(undistorted.Ptr(), distorted.Ptr(), k.Ptr(), d.Ptr()))\n}\n\n// FisheyeUndistortImage transforms an image to compensate for fisheye lens distortion\nfunc FisheyeUndistortImage(distorted Mat, undistorted *Mat, k, d Mat) error {\n\treturn OpenCVResult(C.Fisheye_UndistortImage(distorted.Ptr(), undistorted.Ptr(), k.Ptr(), d.Ptr()))\n}\n\n// FisheyeUndistortImageWithParams transforms an image to compensate for fisheye lens distortion with Knew matrix\nfunc FisheyeUndistortImageWithParams(distorted Mat, undistorted *Mat, k, d, knew Mat, size image.Point) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\treturn OpenCVResult(C.Fisheye_UndistortImageWithParams(distorted.Ptr(), undistorted.Ptr(), k.Ptr(), d.Ptr(), knew.Ptr(), sz))\n}\n\n// FisheyeUndistortPoints transforms points to compensate for fisheye lens distortion\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#gab738cdf90ceee97b2b52b0d0e7511541\nfunc FisheyeUndistortPoints(distorted Mat, undistorted *Mat, k, d, r, p Mat) error {\n\treturn OpenCVResult(C.Fisheye_UndistortPoints(distorted.Ptr(), undistorted.Ptr(), k.Ptr(), d.Ptr(), r.Ptr(), p.Ptr()))\n}\n\n// EstimateNewCameraMatrixForUndistortRectify estimates new camera matrix for undistortion or rectification.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d58/group__calib3d__fisheye.html#ga384940fdf04c03e362e94b6eb9b673c9\nfunc EstimateNewCameraMatrixForUndistortRectify(k, d Mat, imgSize image.Point, r Mat, p *Mat, balance float64, newSize image.Point, fovScale float64) error {\n\timgSz := C.struct_Size{\n\t\twidth:  C.int(imgSize.X),\n\t\theight: C.int(imgSize.Y),\n\t}\n\tnewSz := C.struct_Size{\n\t\twidth:  C.int(newSize.X),\n\t\theight: C.int(newSize.Y),\n\t}\n\treturn OpenCVResult(C.Fisheye_EstimateNewCameraMatrixForUndistortRectify(k.Ptr(), d.Ptr(), imgSz, r.Ptr(), p.Ptr(), C.double(balance), newSz, C.double(fovScale)))\n}\n\n// InitUndistortRectifyMap computes the joint undistortion and rectification transformation and represents the result in the form of maps for remap\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga7dfb72c9cf9780a347fbe3d1c47e5d5a\nfunc InitUndistortRectifyMap(cameraMatrix Mat, distCoeffs Mat, r Mat, newCameraMatrix Mat, size image.Point, m1type int, map1 Mat, map2 Mat) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\treturn OpenCVResult(C.InitUndistortRectifyMap(cameraMatrix.Ptr(), distCoeffs.Ptr(), r.Ptr(), newCameraMatrix.Ptr(), sz, C.int(m1type), map1.Ptr(), map2.Ptr()))\n}\n\n// GetOptimalNewCameraMatrixWithParams computes and returns the optimal new camera matrix based on the free scaling parameter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga7a6c4e032c97f03ba747966e6ad862b1\nfunc GetOptimalNewCameraMatrixWithParams(cameraMatrix Mat, distCoeffs Mat, imageSize image.Point, alpha float64, newImgSize image.Point, centerPrincipalPoint bool) (Mat, image.Rectangle) {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(imageSize.X),\n\t\theight: C.int(imageSize.Y),\n\t}\n\tnewSize := C.struct_Size{\n\t\twidth:  C.int(newImgSize.X),\n\t\theight: C.int(newImgSize.Y),\n\t}\n\trt := C.struct_Rect{}\n\treturn newMat(C.GetOptimalNewCameraMatrixWithParams(cameraMatrix.Ptr(), distCoeffs.Ptr(), sz, C.double(alpha), newSize, &rt, C.bool(centerPrincipalPoint))), toRect(rt)\n}\n\n// CalibrateCamera finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga3207604e4b1a1758aa66acb6ed5aa65d\nfunc CalibrateCamera(objectPoints Points3fVector, imagePoints Points2fVector, imageSize image.Point,\n\tcameraMatrix *Mat, distCoeffs *Mat, rvecs *Mat, tvecs *Mat, calibFlag CalibFlag) float64 {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(imageSize.X),\n\t\theight: C.int(imageSize.Y),\n\t}\n\n\tres := C.CalibrateCamera(objectPoints.p, imagePoints.p, sz, cameraMatrix.p, distCoeffs.p, rvecs.p, tvecs.p, C.int(calibFlag))\n\treturn float64(res)\n}\n\n// Undistort transforms an image to compensate for lens distortion.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga69f2545a8b62a6b0fc2ee060dc30559d\nfunc Undistort(src Mat, dst *Mat, cameraMatrix Mat, distCoeffs Mat, newCameraMatrix Mat) error {\n\treturn OpenCVResult(C.Undistort(src.Ptr(), dst.Ptr(), cameraMatrix.Ptr(), distCoeffs.Ptr(), newCameraMatrix.Ptr()))\n}\n\n// UndistortPoints transforms points to compensate for lens distortion\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga55c716492470bfe86b0ee9bf3a1f0f7e\nfunc UndistortPoints(src Mat, dst *Mat, cameraMatrix, distCoeffs, rectificationTransform, newCameraMatrix Mat) error {\n\treturn OpenCVResult(C.UndistortPoints(src.Ptr(), dst.Ptr(), cameraMatrix.Ptr(), distCoeffs.Ptr(), rectificationTransform.Ptr(), newCameraMatrix.Ptr()))\n}\n\n// CheckChessboard renders the detected chessboard corners.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga6a10b0bb120c4907e5eabbcd22319022\nfunc CheckChessboard(image Mat, size image.Point) bool {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\treturn bool(C.CheckChessboard(image.Ptr(), sz))\n}\n\n// CalibCBFlag value for chessboard calibration\n// For more details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a\ntype CalibCBFlag int\n\nconst (\n\t// Various operation flags that can be zero or a combination of the following values:\n\t//  Use adaptive thresholding to convert the image to black and white, rather than a fixed threshold level (computed from the average image brightness).\n\tCalibCBAdaptiveThresh CalibCBFlag = 1 << iota\n\t//  Normalize the image gamma with equalizeHist before applying fixed or adaptive thresholding.\n\tCalibCBNormalizeImage\n\t//  Use additional criteria (like contour area, perimeter, square-like shape) to filter out false quads extracted at the contour retrieval stage.\n\tCalibCBFilterQuads\n\t//  Run a fast check on the image that looks for chessboard corners, and shortcut the call if none is found. This can drastically speed up the call in the degenerate condition when no chessboard is observed.\n\tCalibCBFastCheck\n\t//  Run an exhaustive search to improve detection rate.\n\tCalibCBExhaustive\n\t//  Up sample input image to improve sub-pixel accuracy due to aliasing effects.\n\tCalibCBAccuracy\n\t//  The detected pattern is allowed to be larger than patternSize (see description).\n\tCalibCBLarger\n\t//  The detected pattern must have a marker (see description). This should be used if an accurate camera calibration is required.\n\tCalibCBMarker\n)\n\n// FindChessboardCorners finds the positions of internal corners of the chessboard.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a\nfunc FindChessboardCorners(image Mat, patternSize image.Point, corners *Mat, flags CalibCBFlag) bool {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(patternSize.X),\n\t\theight: C.int(patternSize.Y),\n\t}\n\treturn bool(C.FindChessboardCorners(image.Ptr(), sz, corners.Ptr(), C.int(flags)))\n}\n\n// FindChessboardCorners finds the positions of internal corners of the chessboard using a sector based approach.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#gadc5bcb05cb21cf1e50963df26986d7c9\nfunc FindChessboardCornersSB(image Mat, patternSize image.Point, corners *Mat, flags CalibCBFlag) bool {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(patternSize.X),\n\t\theight: C.int(patternSize.Y),\n\t}\n\treturn bool(C.FindChessboardCornersSB(image.Ptr(), sz, corners.Ptr(), C.int(flags)))\n}\n\n// FindChessboardCornersSBWithMeta finds the positions of internal corners of the chessboard using a sector based approach.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga93efa9b0aa890de240ca32b11253dd4a\nfunc FindChessboardCornersSBWithMeta(image Mat, patternSize image.Point, corners *Mat, flags CalibCBFlag, meta *Mat) bool {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(patternSize.X),\n\t\theight: C.int(patternSize.Y),\n\t}\n\treturn bool(C.FindChessboardCornersSBWithMeta(image.Ptr(), sz, corners.Ptr(), C.int(flags), meta.Ptr()))\n}\n\n// DrawChessboardCorners renders the detected chessboard corners.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga6a10b0bb120c4907e5eabbcd22319022\nfunc DrawChessboardCorners(image *Mat, patternSize image.Point, corners Mat, patternWasFound bool) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(patternSize.X),\n\t\theight: C.int(patternSize.Y),\n\t}\n\treturn OpenCVResult(C.DrawChessboardCorners(image.Ptr(), sz, corners.Ptr(), C.bool(patternWasFound)))\n}\n\n// EstimateAffinePartial2D computes an optimal limited affine transformation\n// with 4 degrees of freedom between two 2D point sets.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#gad767faff73e9cbd8b9d92b955b50062d\nfunc EstimateAffinePartial2D(from, to Point2fVector) Mat {\n\treturn newMat(C.EstimateAffinePartial2D(from.p, to.p))\n}\n\n// EstimateAffinePartial2DWithParams computes an optimal limited affine transformation\n// with 4 degrees of freedom between two 2D point sets\n// with additional optional parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#gad767faff73e9cbd8b9d92b955b50062d\nfunc EstimateAffinePartial2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ransacReprojThreshold float64, maxIters uint, confidence float64, refineIters uint) Mat {\n\treturn newMat(C.EstimateAffinePartial2DWithParams(from.p, to.p, inliers.p, C.int(method), C.double(ransacReprojThreshold), C.size_t(maxIters), C.double(confidence), C.size_t(refineIters)))\n}\n\n// EstimateAffine2D Computes an optimal affine transformation between two 2D point sets.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga27865b1d26bac9ce91efaee83e94d4dd\nfunc EstimateAffine2D(from, to Point2fVector) Mat {\n\treturn newMat(C.EstimateAffine2D(from.p, to.p))\n}\n\n// EstimateAffine2DWithParams Computes an optimal affine transformation between two 2D point sets\n// with additional optional parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga27865b1d26bac9ce91efaee83e94d4dd\nfunc EstimateAffine2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ransacReprojThreshold float64, maxIters uint, confidence float64, refineIters uint) Mat {\n\treturn newMat(C.EstimateAffine2DWithParams(from.p, to.p, inliers.p, C.int(method), C.double(ransacReprojThreshold), C.size_t(maxIters), C.double(confidence), C.size_t(refineIters)))\n}\n\n// TriangulatePoints reconstructs 3-dimensional points (in homogeneous coordinates)\n// by using their observations with a stereo camera.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#gad3fc9a0c82b08df034234979960b778c\nfunc TriangulatePoints(projMatr1, projMatr2 Mat, projPoints1, projPoints2 Point2fVector, points4D *Mat) error {\n\treturn OpenCVResult(C.TriangulatePoints(projMatr1.Ptr(), projMatr2.Ptr(), projPoints1.p, projPoints2.p, points4D.Ptr()))\n}\n\n// ConvertPointsFromHomogeneous converts points from homogeneous to Euclidean space.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#gac42edda3a3a0f717979589fcd6ac0035\nfunc ConvertPointsFromHomogeneous(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.ConvertPointsFromHomogeneous(src.Ptr(), dst.Ptr()))\n}\n\n// Rodrigues converts a rotation matrix to a rotation vector or vice versa.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga61585db663d9da06b68e70cfbf6a1eac\nfunc Rodrigues(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Rodrigues(src.p, dst.p))\n}\n\n// SolvePnP finds an object pose from 3D-2D point correspondences.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.0.0/d9/d0c/group__calib3d.html#ga549c2075fac14829ff4a58bc931c033d\nfunc SolvePnP(objectPoints Point3fVector, imagePoints Point2fVector, cameraMatrix, distCoeffs Mat, rvec, tvec *Mat, useExtrinsicGuess bool, flags int) bool {\n\treturn bool(C.SolvePnP(objectPoints.p, imagePoints.p, cameraMatrix.p, distCoeffs.p, rvec.p, tvec.p, C.bool(useExtrinsicGuess), C.int(flags)))\n}\n\n// StereoRectify computes rectification transforms for each head of a calibrated stereo camera.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga617b1685d4059c6040827800e72ad2b6\nfunc StereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2 Mat, imageSize image.Point, r Mat, t Mat, R1, R2, P1, P2, Q *Mat, flags CalibFlagPinhole) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(imageSize.X),\n\t\theight: C.int(imageSize.Y),\n\t}\n\treturn OpenCVResult(C.StereoRectify(cameraMatrix1.Ptr(), distCoeffs1.Ptr(), cameraMatrix2.Ptr(), distCoeffs2.Ptr(), sz, r.Ptr(), t.Ptr(), R1.Ptr(), R2.Ptr(), P1.Ptr(), P2.Ptr(), Q.Ptr(), C.int(flags)))\n}\n\ntype HomographyMethod int\n\nconst (\n\tHomographyMethodAllPoints HomographyMethod = 0\n\tHomographyMethodLMEDS     HomographyMethod = 4\n\tHomographyMethodRANSAC    HomographyMethod = 8\n\tHomographyMethodRHO       HomographyMethod = 16\n)\n\n// FindHomography finds an optimal homography matrix using 4 or more point pairs (as opposed to GetPerspectiveTransform, which uses exactly 4)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d0c/group__calib3d.html#ga4abc2ece9fab9398f2e560d53c8c9780\nfunc FindHomography(srcPoints Mat, targetPoints Mat, method HomographyMethod, ransacReprojThreshold float64, mask *Mat, maxIters int, confidence float64) Mat {\n\treturn newMat(C.FindHomography(srcPoints.Ptr(), targetPoints.Ptr(), C.int(method), C.double(ransacReprojThreshold), mask.Ptr(), C.int(maxIters), C.double(confidence)))\n}\n"
  },
  {
    "path": "calib3d.h",
    "content": "#ifndef _OPENCV3_CALIB_H_\n#define _OPENCV3_CALIB_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/calib3d.hpp>\n\n\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n//Calib\ndouble Fisheye_Calibrate(Points3fVector objectPoints, Points2fVector imagePoints, Size size, Mat k, Mat d, Mat rvecs, Mat tvecs, int flags);\nOpenCVResult Fisheye_DistortPoints(Mat undistorted, Mat distorted, Mat k, Mat d);\nOpenCVResult Fisheye_UndistortImage(Mat distorted, Mat undistorted, Mat k, Mat d);\nOpenCVResult Fisheye_UndistortImageWithParams(Mat distorted, Mat undistorted, Mat k, Mat d, Mat knew, Size size);\nOpenCVResult Fisheye_UndistortPoints(Mat distorted, Mat undistorted, Mat k, Mat d, Mat R, Mat P);\nOpenCVResult Fisheye_EstimateNewCameraMatrixForUndistortRectify(Mat k, Mat d, Size imgSize, Mat r, Mat p, double balance, Size newSize, double fovScale);\n\nOpenCVResult InitUndistortRectifyMap(Mat cameraMatrix,Mat distCoeffs,Mat r,Mat newCameraMatrix,Size size,int m1type,Mat map1,Mat map2);\nMat GetOptimalNewCameraMatrixWithParams(Mat cameraMatrix,Mat distCoeffs,Size size,double alpha,Size newImgSize,Rect* validPixROI,bool centerPrincipalPoint);\ndouble CalibrateCamera(Points3fVector objectPoints, Points2fVector imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs, int flag);\nOpenCVResult Undistort(Mat src, Mat dst, Mat cameraMatrix, Mat distCoeffs, Mat newCameraMatrix);\nOpenCVResult UndistortPoints(Mat distorted, Mat undistorted, Mat k, Mat d, Mat r, Mat p);\nbool CheckChessboard(Mat image, Size sz);\nbool FindChessboardCorners(Mat image, Size patternSize, Mat corners, int flags);\nbool FindChessboardCornersSB(Mat image, Size patternSize, Mat corners, int flags);\nbool FindChessboardCornersSBWithMeta(Mat image, Size patternSize, Mat corners, int flags, Mat meta);\nOpenCVResult DrawChessboardCorners(Mat image, Size patternSize, Mat corners, bool patternWasFound);\nMat EstimateAffinePartial2D(Point2fVector from, Point2fVector to);\nMat EstimateAffinePartial2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters);\nMat EstimateAffine2D(Point2fVector from, Point2fVector to);\nMat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters);\nOpenCVResult TriangulatePoints(Mat projMatr1, Mat projMatr2, Point2fVector projPoints1, Point2fVector projPoints2, Mat points4D);\nOpenCVResult ConvertPointsFromHomogeneous(Mat src, Mat dst);\nOpenCVResult Rodrigues(Mat src, Mat dst);\nbool SolvePnP(Point3fVector objectPoints, Point2fVector imagePoints, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, bool useExtrinsicGuess, int flags);\nOpenCVResult StereoRectify(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat r, Mat t, Mat R1, Mat R2, Mat P1, Mat P2, Mat Q, int flags);\nMat FindHomography(Mat src, Mat dst, int method, double ransacReprojThreshold, Mat mask, const int maxIters, const double confidence);\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CALIB_H\n"
  },
  {
    "path": "calib3d_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_calib3d)\n\npackage gocv\n\nfunc (c CalibFlag) String() string {\n\tswitch c {\n\tcase CalibUseIntrinsicGuess:\n\t\treturn \"calib-use-intrinsec-guess\"\n\tcase CalibRecomputeExtrinsic:\n\t\treturn \"calib-recompute-extrinsic\"\n\tcase CalibCheckCond:\n\t\treturn \"calib-check-cond\"\n\tcase CalibFixSkew:\n\t\treturn \"calib-fix-skew\"\n\tcase CalibFixK1:\n\t\treturn \"calib-fix-k1\"\n\tcase CalibFixK2:\n\t\treturn \"calib-fix-k2\"\n\tcase CalibFixK3:\n\t\treturn \"calib-fix-k3\"\n\tcase CalibFixK4:\n\t\treturn \"calib-fix-k4\"\n\tcase CalibFixIntrinsic:\n\t\treturn \"calib-fix-intrinsic\"\n\tcase CalibFixPrincipalPoint:\n\t\treturn \"calib-fix-principal-point\"\n\t}\n\treturn \"\"\n}\n\nfunc (c CalibCBFlag) String() string {\n\tswitch c {\n\tcase CalibCBAdaptiveThresh:\n\t\treturn \"calib-cb-adaptive-thresh\"\n\tcase CalibCBNormalizeImage:\n\t\treturn \"calib-cb-normalize-image\"\n\tcase CalibCBFilterQuads:\n\t\treturn \"calib-cb-filter-quads\"\n\tcase CalibCBFastCheck:\n\t\treturn \"calib-cb-fast-check\"\n\tcase CalibCBExhaustive:\n\t\treturn \"calib-cb-exhaustive\"\n\tcase CalibCBAccuracy:\n\t\treturn \"calib-cb-accuracy\"\n\tcase CalibCBLarger:\n\t\treturn \"calib-cb-larger\"\n\tcase CalibCBMarker:\n\t\treturn \"calib-cb-marker\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "calib3d_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_calib3d)\n\npackage gocv\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\t\"testing\"\n)\n\nfunc TestFisheyeCalibrate(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6_distort.png\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tsize := image.Pt(4, 6)\n\tfound := FindChessboardCorners(img, size, &corners, 0)\n\tif !found {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\n\timagePoints := NewPoint2fVectorFromMat(corners)\n\tdefer imagePoints.Close()\n\n\tobjectPoints := NewPoint3fVector()\n\tdefer objectPoints.Close()\n\n\tfor j := 0; j < size.Y; j++ {\n\t\tfor i := 0; i < size.X; i++ {\n\t\t\tobjectPoints.Append(Point3f{\n\t\t\t\tX: float32(100 * i),\n\t\t\t\tY: float32(100 * j),\n\t\t\t\tZ: 0,\n\t\t\t})\n\t\t}\n\t}\n\n\tk := NewMat()\n\tdefer k.Close()\n\td := NewMat()\n\tdefer d.Close()\n\trvecs := NewMat()\n\tdefer rvecs.Close()\n\ttvecs := NewMat()\n\tdefer tvecs.Close()\n\n\tobjectPointsVector := NewPoints3fVector()\n\tobjectPointsVector.Append(objectPoints)\n\tdefer objectPointsVector.Close()\n\n\timagePointsVector := NewPoints2fVector()\n\timagePointsVector.Append(imagePoints)\n\tdefer imagePointsVector.Close()\n\n\tFisheyeCalibrate(\n\t\tobjectPointsVector, imagePointsVector, image.Pt(img.Cols(), img.Rows()),\n\t\t&k, &d, &rvecs, &tvecs, 0,\n\t)\n\n\tif rvecs.Empty() {\n\t\tt.Error(\"rvecs result is empty\")\n\t\treturn\n\t}\n\n\tif tvecs.Empty() {\n\t\tt.Error(\"tvecs result is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestFisheyeDistortPoints(t *testing.T) {\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 1094.7249578198823)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 959.4907612030962)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 1094.9945708128778)\n\tk.SetDoubleAt(1, 2, 536.4566143451868)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, -0.05207412392075069)\n\td.SetDoubleAt(0, 1, -0.089168300192224)\n\td.SetDoubleAt(0, 2, 0.10465607695792184)\n\td.SetDoubleAt(0, 3, -0.045693446831115585)\n\n\t// transform 3 points in one go (X and Y values of points go in each channel)\n\tsrc := NewMatWithSize(3, 1, MatTypeCV64FC2)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\t// This camera matrix is 1920x1080. Points where x < 960 and y < 540 should move toward the top left (x and y get smaller)\n\t// The centre point should be mostly unchanged\n\t// Points where x > 960 and y > 540 should move toward the bottom right (x and y get bigger)\n\n\t// The index being used for col here is actually the channel (i.e. the point's x/y dimensions)\n\t// (since there's only 1 column so the formula: (colNumber * numChannels + channelNumber) reduces to\n\t// (0 * 2) + channelNumber\n\t// so col = 0 is the x coordinate and col = 1 is the y coordinate\n\n\tsrc.SetDoubleAt(0, 0, 480)\n\tsrc.SetDoubleAt(0, 1, 270)\n\n\tsrc.SetDoubleAt(1, 0, 960)\n\tsrc.SetDoubleAt(1, 1, 540)\n\n\tsrc.SetDoubleAt(2, 0, 1440)\n\tsrc.SetDoubleAt(2, 1, 810)\n\n\tFisheyeDistortPoints(src, &dst, k, d)\n\n\tif dst.Empty() {\n\t\tt.Error(\"final image is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestFisheyeUndistorImage(t *testing.T) {\n\timg := IMRead(\"images/fisheye_sample.jpg\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat test\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 689.21)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 1295.56)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 690.48)\n\tk.SetDoubleAt(1, 2, 942.17)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, 0)\n\td.SetDoubleAt(0, 1, 0)\n\td.SetDoubleAt(0, 2, 0)\n\td.SetDoubleAt(0, 3, 0)\n\n\tFisheyeUndistortImage(img, &dest, k, d)\n\n\tif dest.Empty() {\n\t\tt.Error(\"final image is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestFisheyeUndistorImageWithParams(t *testing.T) {\n\timg := IMRead(\"images/fisheye_sample.jpg\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat test\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 689.21)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 1295.56)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 690.48)\n\tk.SetDoubleAt(1, 2, 942.17)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, 0)\n\td.SetDoubleAt(0, 1, 0)\n\td.SetDoubleAt(0, 2, 0)\n\td.SetDoubleAt(0, 3, 0)\n\n\tknew := NewMat()\n\tdefer knew.Close()\n\n\tk.CopyTo(&knew)\n\n\tknew.SetDoubleAt(0, 0, 0.4*k.GetDoubleAt(0, 0))\n\tknew.SetDoubleAt(1, 1, 0.4*k.GetDoubleAt(1, 1))\n\n\tsize := image.Point{dest.Rows(), dest.Cols()}\n\tFisheyeUndistortImageWithParams(img, &dest, k, d, knew, size)\n\n\tif dest.Empty() {\n\t\tt.Error(\"final image is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestInitUndistortRectifyMap(t *testing.T) {\n\timg := IMRead(\"images/distortion.jpg\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat test\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 842.0261028)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 667.7569792)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 707.3668897)\n\tk.SetDoubleAt(1, 2, 385.56476464)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 5, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, -3.65584802e-01)\n\td.SetDoubleAt(0, 1, 1.41555815e-01)\n\td.SetDoubleAt(0, 2, -2.62985819e-03)\n\td.SetDoubleAt(0, 3, 2.05841873e-04)\n\td.SetDoubleAt(0, 4, -2.35021914e-02)\n\n\tnewC, roi := GetOptimalNewCameraMatrixWithParams(k, d, image.Point{X: img.Cols(), Y: img.Rows()}, (float64)(1), image.Point{X: img.Cols(), Y: img.Rows()}, false)\n\tif newC.Empty() {\n\t\tt.Error(\"final image is empty\")\n\t\treturn\n\t}\n\tfmt.Printf(\"roi:%+v\\n\", roi)\n\tdefer newC.Close()\n\tr := NewMat()\n\tdefer r.Close()\n\tmapx := NewMat()\n\tdefer mapx.Close()\n\tmapy := NewMat()\n\tdefer mapy.Close()\n\n\tInitUndistortRectifyMap(k, d, r, newC, image.Point{X: img.Cols(), Y: img.Rows()}, 5, mapx, mapy)\n\n\tRemap(img, &dest, &mapx, &mapy, InterpolationDefault, BorderConstant, color.RGBA{0, 0, 0, 0})\n\tflg := IMWrite(\"images/distortion-correct.jpg\", dest)\n\tif !flg {\n\t\tt.Error(\"IMWrite failed\")\n\t}\n}\n\nfunc TestUndistort(t *testing.T) {\n\timg := IMRead(\"images/distortion.jpg\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat test\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tdest := img.Clone()\n\tdefer dest.Close()\n\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 689.21)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 1295.56)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 690.48)\n\tk.SetDoubleAt(1, 2, 942.17)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, 0)\n\td.SetDoubleAt(0, 1, 0)\n\td.SetDoubleAt(0, 2, 0)\n\td.SetDoubleAt(0, 3, 0)\n\n\tknew := NewMat()\n\tdefer knew.Close()\n\n\tk.CopyTo(&knew)\n\n\tknew.SetDoubleAt(0, 0, 0.5*k.GetDoubleAt(0, 0))\n\tknew.SetDoubleAt(1, 1, 0.5*k.GetDoubleAt(1, 1))\n\n\tUndistort(img, &dest, k, d, knew)\n\n\tif dest.Empty() {\n\t\tt.Error(\"final image is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestUndistortPoint(t *testing.T) {\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 1094.7249578198823)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 959.4907612030962)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 1094.9945708128778)\n\tk.SetDoubleAt(1, 2, 536.4566143451868)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, -0.05207412392075069)\n\td.SetDoubleAt(0, 1, -0.089168300192224)\n\td.SetDoubleAt(0, 2, 0.10465607695792184)\n\td.SetDoubleAt(0, 3, -0.045693446831115585)\n\n\tr := NewMat()\n\tdefer r.Close()\n\n\t// transform 3 points in one go\n\tsrc := NewMatWithSize(3, 1, MatTypeCV64FC2)\n\tdefer src.Close()\n\tdst := NewMatWithSize(3, 1, MatTypeCV64FC2)\n\tdefer dst.Close()\n\n\t// This camera matrix is 1920x1080. Points where x < 960 and y < 540 should move toward the top left (x and y get smaller)\n\t// The centre point should be mostly unchanged\n\t// Points where x > 960 and y > 540 should move toward the bottom right (x and y get bigger)\n\n\t// The index being used for col here is actually the channel (i.e. the point's x/y dimensions)\n\t// (since there's only 1 column so the formula: (colNumber * numChannels + channelNumber) reduces to\n\t// (0 * 2) + channelNumber\n\t// so col = 0 is the x coordinate and col = 1 is the y coordinate\n\n\tsrc.SetDoubleAt(0, 0, 480)\n\tsrc.SetDoubleAt(0, 1, 270)\n\n\tsrc.SetDoubleAt(1, 0, 960)\n\tsrc.SetDoubleAt(1, 1, 540)\n\n\tsrc.SetDoubleAt(2, 0, 1920)\n\tsrc.SetDoubleAt(2, 1, 1080)\n\n\tUndistortPoints(src, &dst, k, d, r, k)\n\n\tif dst.GetDoubleAt(0, 0) >= 480 || dst.GetDoubleAt(0, 1) >= 270 {\n\t\tt.Error(\"undistortion expected top left point to move further up and left\")\n\t\treturn\n\t}\n\n\tif math.Round(dst.GetDoubleAt(1, 0)) != 960 || math.Round(dst.GetDoubleAt(1, 1)) != 540 {\n\t\tt.Error(\"undistortion expected centre point to be nearly unchanged\")\n\t\treturn\n\t}\n\n\tif dst.GetDoubleAt(2, 0) != 1920 || dst.GetDoubleAt(2, 1) != 1080 {\n\t\tt.Error(\"undistortion expected bottom right corner to be unchanged\")\n\t\treturn\n\t}\n\n}\n\nfunc TestFisheyeUndistortPoint(t *testing.T) {\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 1094.7249578198823)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 959.4907612030962)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 1094.9945708128778)\n\tk.SetDoubleAt(1, 2, 536.4566143451868)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\td := NewMatWithSize(1, 4, MatTypeCV64F)\n\tdefer d.Close()\n\n\td.SetDoubleAt(0, 0, -0.05207412392075069)\n\td.SetDoubleAt(0, 1, -0.089168300192224)\n\td.SetDoubleAt(0, 2, 0.10465607695792184)\n\td.SetDoubleAt(0, 3, -0.045693446831115585)\n\n\tr := NewMat()\n\tdefer r.Close()\n\n\t// transform 3 points in one go (X and Y values of points go in each channel)\n\tsrc := NewMatWithSize(3, 1, MatTypeCV64FC2)\n\tdefer src.Close()\n\tdst := NewMatWithSize(3, 1, MatTypeCV64FC2)\n\tdefer dst.Close()\n\n\t// This camera matrix is 1920x1080. Points where x < 960 and y < 540 should move toward the top left (x and y get smaller)\n\t// The centre point should be mostly unchanged\n\t// Points where x > 960 and y > 540 should move toward the bottom right (x and y get bigger)\n\n\t// The index being used for col here is actually the channel (i.e. the point's x/y dimensions)\n\t// (since there's only 1 column so the formula: (colNumber * numChannels + channelNumber) reduces to\n\t// (0 * 2) + channelNumber\n\t// so col = 0 is the x coordinate and col = 1 is the y coordinate\n\n\tsrc.SetDoubleAt(0, 0, 480)\n\tsrc.SetDoubleAt(0, 1, 270)\n\n\tsrc.SetDoubleAt(1, 0, 960)\n\tsrc.SetDoubleAt(1, 1, 540)\n\n\tsrc.SetDoubleAt(2, 0, 1440)\n\tsrc.SetDoubleAt(2, 1, 810)\n\n\tkNew := NewMat()\n\tdefer kNew.Close()\n\n\tk.CopyTo(&kNew)\n\n\tkNew.SetDoubleAt(0, 0, 0.4*k.GetDoubleAt(0, 0))\n\tkNew.SetDoubleAt(1, 1, 0.4*k.GetDoubleAt(1, 1))\n\n\timgSize := image.Point{X: 1920, Y: 1080}\n\n\tEstimateNewCameraMatrixForUndistortRectify(k, d, imgSize, r, &kNew, 1, imgSize, 1)\n\n\tFisheyeUndistortPoints(src, &dst, k, d, r, kNew)\n\n\tif dst.GetDoubleAt(0, 0) == 0 {\n\t\tt.Error(\"expected destination Mat to be populated\")\n\t}\n}\n\nfunc TestCheckChessboard(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6.png\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tif !CheckChessboard(img, image.Point{X: 4, Y: 6}) {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n}\n\nfunc TestFindAndDrawChessboard(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6.png\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tfound := FindChessboardCorners(img, image.Point{X: 4, Y: 6}, &corners, 0)\n\tif found == false {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\n\timg2 := NewMatWithSize(150, 150, MatTypeCV8U)\n\tdefer img2.Close()\n\n\tDrawChessboardCorners(&img2, image.Pt(4, 6), corners, true)\n\tif img2.Empty() {\n\t\tt.Error(\"Error in DrawChessboardCorners test\")\n\t}\n}\n\nfunc TestFindAndDrawChessboardSB(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6.png\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tfound := FindChessboardCornersSB(img, image.Point{X: 4, Y: 6}, &corners, 0)\n\tif found == false {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\n\timg2 := NewMatWithSize(150, 150, MatTypeCV8U)\n\tdefer img2.Close()\n\n\tDrawChessboardCorners(&img2, image.Pt(4, 6), corners, true)\n\tif img2.Empty() {\n\t\tt.Error(\"Error in DrawChessboardCorners test\")\n\t}\n}\n\nfunc TestFindChessboardCornersSBWithMeta(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6.png\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tmeta := NewMat()\n\tdefer meta.Close()\n\n\tfound := FindChessboardCornersSBWithMeta(img, image.Point{X: 4, Y: 6}, &corners, 0, &meta)\n\tif found == false {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\n\timg2 := NewMatWithSize(150, 150, MatTypeCV8U)\n\tdefer img2.Close()\n\n\tDrawChessboardCorners(&img2, image.Pt(4, 6), corners, true)\n\tif img2.Empty() {\n\t\tt.Error(\"Error in DrawChessboardCorners test\")\n\t}\n}\n\nfunc TestCalibrateCamera(t *testing.T) {\n\timg := IMRead(\"images/chessboard_4x6_distort.png\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tsize := image.Pt(4, 6)\n\tfound := FindChessboardCorners(img, size, &corners, 0)\n\tif !found {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tt.Error(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\n\timagePoints := NewPoint2fVectorFromMat(corners)\n\tdefer imagePoints.Close()\n\n\tobjectPoints := NewPoint3fVector()\n\tdefer objectPoints.Close()\n\n\tfor j := 0; j < size.Y; j++ {\n\t\tfor i := 0; i < size.X; i++ {\n\t\t\tobjectPoints.Append(Point3f{\n\t\t\t\tX: float32(100 * i),\n\t\t\t\tY: float32(100 * j),\n\t\t\t\tZ: 0,\n\t\t\t})\n\t\t}\n\t}\n\n\tcameraMatrix := NewMat()\n\tdefer cameraMatrix.Close()\n\tdistCoeffs := NewMat()\n\tdefer distCoeffs.Close()\n\trvecs := NewMat()\n\tdefer rvecs.Close()\n\ttvecs := NewMat()\n\tdefer tvecs.Close()\n\n\tobjectPointsVector := NewPoints3fVector()\n\tobjectPointsVector.Append(objectPoints)\n\tdefer objectPointsVector.Close()\n\n\timagePointsVector := NewPoints2fVector()\n\timagePointsVector.Append(imagePoints)\n\tdefer imagePointsVector.Close()\n\n\tCalibrateCamera(\n\t\tobjectPointsVector, imagePointsVector, image.Pt(img.Cols(), img.Rows()),\n\t\t&cameraMatrix, &distCoeffs, &rvecs, &tvecs, 0,\n\t)\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\tUndistort(img, &dest, cameraMatrix, distCoeffs, cameraMatrix)\n\n\ttarget := IMRead(\"images/chessboard_4x6_distort_correct.png\", IMReadGrayScale)\n\tdefer target.Close()\n\n\txor := NewMat()\n\tdefer xor.Close()\n\n\t// The method for compare is ugly : different pix number < 0.5%\n\tBitwiseXor(dest, target, &xor)\n\tdifferentPixelsNumber := xor.Sum().Val1\n\tmaxDifferentPixelsNumber := float64(img.Cols()*img.Rows()) * 0.005\n\tif differentPixelsNumber > maxDifferentPixelsNumber {\n\t\tt.Error(\"the undisorted image not equal the target one:\", differentPixelsNumber, \"bigger than\", maxDifferentPixelsNumber)\n\t}\n}\n\nfunc TestEstimateAffinePartial2D(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10, 5},\n\t\t{10, 10},\n\t\t{5, 10},\n\t}\n\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{10, 0},\n\t\t{10, 10},\n\t\t{0, 10},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := EstimateAffinePartial2D(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestEstimateAffinePartial2D(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestEstimateAffinePartial2D(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestEstimateAffinePartial2DWithParams(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10, 5},\n\t\t{10, 10},\n\t\t{5, 10},\n\t}\n\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{10, 0},\n\t\t{10, 10},\n\t\t{0, 10},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tinliers := NewMat()\n\tdefer inliers.Close()\n\tmethod := 8\n\transacProjThreshold := 3.0\n\tmaxiters := uint(2000)\n\tconfidence := 0.99\n\trefineIters := uint(10)\n\n\tm := EstimateAffinePartial2DWithParams(pvsrc, pvdst, inliers, method, ransacProjThreshold, maxiters, confidence, refineIters)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestEstimateAffinePartial2D(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestEstimateAffinePartial2D(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestEstimateAffine2D(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10, 5},\n\t\t{10, 10},\n\t\t{5, 10},\n\t}\n\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{10, 0},\n\t\t{10, 10},\n\t\t{0, 10},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := EstimateAffine2D(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestEstimateAffine2D(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestEstimateAffine2D(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestEstimateAffine2DWithParams(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10, 5},\n\t\t{10, 10},\n\t\t{5, 10},\n\t}\n\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{10, 0},\n\t\t{10, 10},\n\t\t{0, 10},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tinliers := NewMat()\n\tdefer inliers.Close()\n\tmethod := 8\n\transacProjThreshold := 3.0\n\tmaxiters := uint(2000)\n\tconfidence := 0.99\n\trefineIters := uint(10)\n\n\tm := EstimateAffine2DWithParams(pvsrc, pvdst, inliers, method, ransacProjThreshold, maxiters, confidence, refineIters)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestEstimateAffine2DWithParams(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestEstimateAffine2DWithParams(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestTriangulatePoints(t *testing.T) {\n\tprojMat1, projMat2 := NewMatWithSize(3, 4, MatTypeCV64F), NewMatWithSize(3, 4, MatTypeCV64F)\n\tdefer projMat1.Close()\n\tdefer projMat2.Close()\n\tprojPoints1, projPoints2 := NewPoint2fVectorFromPoints([]Point2f{{Y: 1.0, X: 2.0}}), NewPoint2fVectorFromPoints([]Point2f{{Y: 3.0, X: 4.0}})\n\tdefer projPoints1.Close()\n\tdefer projPoints2.Close()\n\thomogeneous := NewMat()\n\tdefer homogeneous.Close()\n\tTriangulatePoints(projMat1, projMat2, projPoints1, projPoints2, &homogeneous)\n\tif homogeneous.Empty() {\n\t\tt.Errorf(\"TriangulatePoints(): output homogeneous mat is empty\")\n\t}\n}\n\nfunc TestConvertPointsFromHomogeneous(t *testing.T) {\n\thomogeneous := NewMatWithSize(1, 4, MatTypeCV32F)\n\tdefer homogeneous.Close()\n\thomogeneous.SetFloatAt(0, 0, 1)\n\thomogeneous.SetFloatAt(0, 1, 2)\n\thomogeneous.SetFloatAt(0, 2, 4)\n\thomogeneous.SetFloatAt(0, 3, 2)\n\teuclidean := NewMat()\n\tdefer euclidean.Close()\n\tConvertPointsFromHomogeneous(homogeneous, &euclidean)\n\tif euclidean.Empty() {\n\t\tt.Fatalf(\"ConvertPointsFromHomogeneous(): output euclidean mat is empty\")\n\t}\n\tptsVector := NewPoint3fVectorFromMat(euclidean)\n\tdefer ptsVector.Close()\n\tpts := ptsVector.ToPoints()\n\tif len(pts) != 1 {\n\t\tt.Fatalf(\"ConvertPointsFromHomogeneous(): euclidean mat converted to points is empty\")\n\t}\n\tif pts[0].X != 0.5 {\n\t\tt.Errorf(\"ConvertPointsFromHomogeneous(): euclidean X - got %v, want %v\", pts[0].X, 0.5)\n\t}\n\tif pts[0].Y != 1 {\n\t\tt.Errorf(\"ConvertPointsFromHomogeneous(): euclidean Y - got %v, want %v\", pts[0].Y, 1)\n\t}\n\tif pts[0].Z != 2 {\n\t\tt.Errorf(\"ConvertPointsFromHomogeneous(): euclidean Z - got %v, want %v\", pts[0].Z, 2)\n\t}\n}\n\nfunc TestRodrigues(t *testing.T) {\n\tk := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer k.Close()\n\n\tk.SetDoubleAt(0, 0, 689.21)\n\tk.SetDoubleAt(0, 1, 0)\n\tk.SetDoubleAt(0, 2, 1295.56)\n\n\tk.SetDoubleAt(1, 0, 0)\n\tk.SetDoubleAt(1, 1, 690.48)\n\tk.SetDoubleAt(1, 2, 942.17)\n\n\tk.SetDoubleAt(2, 0, 0)\n\tk.SetDoubleAt(2, 1, 0)\n\tk.SetDoubleAt(2, 2, 1)\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tRodrigues(k, &dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"final result is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestSolvePnP(t *testing.T) {\n\tpts := []Point3f{\n\t\t{10.0, 10.0, 0.1},\n\t\t{10.0, 20.0, 1.0},\n\t\t{20.5, 21.5, 2.0},\n\t\t{10.0, 20.0, 1.0},\n\t}\n\n\tobjectPointsVector := NewPoint3fVectorFromPoints(pts)\n\tdefer objectPointsVector.Close()\n\n\tpts2 := []Point2f{\n\t\t{10.0, 10.0},\n\t\t{10.0, 20.0},\n\t\t{20.5, 21.5},\n\t\t{25.5, 30.5},\n\t}\n\n\timagePointsVector := NewPoint2fVectorFromPoints(pts2)\n\tdefer imagePointsVector.Close()\n\n\tcameraMatrix := Eye(3, 3, MatTypeCV64F)\n\tdefer cameraMatrix.Close()\n\tdistCoeffs := NewMat()\n\tdefer distCoeffs.Close()\n\trvecs := NewMat()\n\tdefer rvecs.Close()\n\ttvecs := NewMat()\n\tdefer tvecs.Close()\n\n\tSolvePnP(objectPointsVector, imagePointsVector, cameraMatrix, distCoeffs,\n\t\t&rvecs, &tvecs, false, 0)\n\n\tif rvecs.Empty() {\n\t\tt.Error(\"rvecs result is empty\")\n\t\treturn\n\t}\n\n\tif tvecs.Empty() {\n\t\tt.Error(\"tvecs result is empty\")\n\t\treturn\n\t}\n}\n\nfunc TestStereoRectify(t *testing.T) {\n\tcameraMatrix1 := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer cameraMatrix1.Close()\n\tcameraMatrix1.SetDoubleAt(0, 0, 1679.861998224759)\n\tcameraMatrix1.SetDoubleAt(0, 1, 0)\n\tcameraMatrix1.SetDoubleAt(0, 2, 1231.158426771668)\n\tcameraMatrix1.SetDoubleAt(1, 0, 0)\n\tcameraMatrix1.SetDoubleAt(1, 1, 1679.6751024982132)\n\tcameraMatrix1.SetDoubleAt(1, 2, 998.4768157307255)\n\tcameraMatrix1.SetDoubleAt(2, 0, 0)\n\tcameraMatrix1.SetDoubleAt(2, 1, 0)\n\tcameraMatrix1.SetDoubleAt(2, 2, 1)\n\n\tdistCoeffs1 := NewMatWithSize(1, 5, MatTypeCV64F)\n\tdefer distCoeffs1.Close()\n\tdistCoeffs1.SetDoubleAt(0, 0, -0.13657891044008158)\n\tdistCoeffs1.SetDoubleAt(0, 1, 0.08861314898314139)\n\tdistCoeffs1.SetDoubleAt(0, 2, -0.0006100429198910993)\n\tdistCoeffs1.SetDoubleAt(0, 3, -0.000146035714553745)\n\tdistCoeffs1.SetDoubleAt(0, 4, -0.0223854079208295)\n\n\tcameraMatrix2 := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer cameraMatrix2.Close()\n\tcameraMatrix2.SetDoubleAt(0, 0, 1678.7797594660801)\n\tcameraMatrix2.SetDoubleAt(0, 1, 0)\n\tcameraMatrix2.SetDoubleAt(0, 2, 1233.9647439048256)\n\tcameraMatrix2.SetDoubleAt(1, 0, 0)\n\tcameraMatrix2.SetDoubleAt(1, 1, 1679.0176277206788)\n\tcameraMatrix2.SetDoubleAt(1, 2, 964.4565768594671)\n\tcameraMatrix2.SetDoubleAt(2, 0, 0)\n\tcameraMatrix2.SetDoubleAt(2, 1, 0)\n\tcameraMatrix2.SetDoubleAt(2, 2, 1)\n\n\tdistCoeffs2 := NewMatWithSize(1, 5, MatTypeCV64F)\n\tdefer distCoeffs2.Close()\n\tdistCoeffs2.SetDoubleAt(0, 0, -0.13690489442431938)\n\tdistCoeffs2.SetDoubleAt(0, 1, 0.08705821688253863)\n\tdistCoeffs2.SetDoubleAt(0, 2, 0.001288895752441417)\n\tdistCoeffs2.SetDoubleAt(0, 3, -5.508164903909865e-05)\n\tdistCoeffs2.SetDoubleAt(0, 4, -0.02092107478701842)\n\n\tR := NewMatWithSize(3, 3, MatTypeCV64F)\n\tdefer R.Close()\n\tR.SetDoubleAt(0, 0, 0.9978384271270464)\n\tR.SetDoubleAt(0, 1, 0.06567174227009016)\n\tR.SetDoubleAt(0, 2, -0.0023865489378896566)\n\tR.SetDoubleAt(1, 0, -0.06567842187628788)\n\tR.SetDoubleAt(1, 1, 0.9978368073955511)\n\tR.SetDoubleAt(1, 2, -0.002837376692327134)\n\tR.SetDoubleAt(2, 0, 0.0021950509020153912)\n\tR.SetDoubleAt(2, 1, 0.0029879882638097722)\n\tR.SetDoubleAt(2, 2, 0.9999931268152161)\n\n\tT := NewMatWithSize(3, 1, MatTypeCV64F)\n\tdefer T.Close()\n\tT.SetDoubleAt(0, 0, -0.1600062730246643)\n\tT.SetDoubleAt(1, 0, 0.007804854680409705)\n\tT.SetDoubleAt(2, 0, 9.242933249524358e-05)\n\n\tR1 := NewMat()\n\tdefer R1.Close()\n\tR2 := NewMat()\n\tdefer R2.Close()\n\tP1 := NewMat()\n\tdefer P1.Close()\n\tP2 := NewMat()\n\tdefer P2.Close()\n\tQ := NewMat()\n\tdefer Q.Close()\n\n\timageSize := image.Point{X: 2448, Y: 2048}\n\terr := StereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, &R1, &R2, &P1, &P2, &Q, CalibFlagPinholeZeroDisparity)\n\tif err != nil {\n\t\tt.Errorf(\"StereoRectify failed: %v\", err)\n\t}\n\n\tif R1.Empty() {\n\t\tt.Error(\"R1 result is empty\")\n\t}\n\tif R2.Empty() {\n\t\tt.Error(\"R2 result is empty\")\n\t}\n\tif P1.Empty() {\n\t\tt.Error(\"P1 result is empty\")\n\t}\n\tif P2.Empty() {\n\t\tt.Error(\"P2 result is empty\")\n\t}\n\tif Q.Empty() {\n\t\tt.Error(\"Q result is empty\")\n\t}\n}\n\nfunc TestFindHomography(t *testing.T) {\n\tsrc := NewMatWithSize(4, 1, MatTypeCV64FC2)\n\tdefer src.Close()\n\ttarget := NewMatWithSize(4, 1, MatTypeCV64FC2)\n\tdefer target.Close()\n\n\tsrcPoints := []Point2f{\n\t\t{193, 932},\n\t\t{191, 378},\n\t\t{1497, 183},\n\t\t{1889, 681},\n\t}\n\ttargetPoints := []Point2f{\n\t\t{51.51206544281359, -0.10425475260813055},\n\t\t{51.51211051314331, -0.10437947532732306},\n\t\t{51.512222354139325, -0.10437679311830816},\n\t\t{51.51214828037607, -0.1042212249954444},\n\t}\n\n\tfor i, point := range srcPoints {\n\t\tsrc.SetDoubleAt(i, 0, float64(point.X))\n\t\tsrc.SetDoubleAt(i, 1, float64(point.Y))\n\t}\n\n\tfor i, point := range targetPoints {\n\t\ttarget.SetDoubleAt(i, 0, float64(point.X))\n\t\ttarget.SetDoubleAt(i, 1, float64(point.Y))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tm := FindHomography(src, target, HomographyMethodAllPoints, 3, &mask, 2000, 0.995)\n\tdefer m.Close()\n\n\tpvsrc := NewPoint2fVectorFromPoints(srcPoints)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(targetPoints)\n\tdefer pvdst.Close()\n\n\tm2 := GetPerspectiveTransform2f(pvsrc, pvdst)\n\tdefer m2.Close()\n\n\tfor row := 0; row < 3; row++ {\n\t\tfor col := 0; col < 3; col++ {\n\t\t\tif math.Abs(m.GetDoubleAt(row, col)-m2.GetDoubleAt(row, col)) > 0.002 {\n\t\t\t\tt.Errorf(\"expected little difference between GetPerspectiveTransform2f and FindHomography results, got %f for row %d col %d\", math.Abs(m.GetDoubleAt(row, col)-m2.GetDoubleAt(row, col)), row, col)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cgo.go",
    "content": "//go:build !customenv && !opencvstatic\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo.go and cuda/cgo.go.\n\n/*\n#cgo !windows pkg-config: opencv4\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core4130 -lopencv_face4130 -lopencv_videoio4130 -lopencv_imgproc4130 -lopencv_highgui4130 -lopencv_imgcodecs4130 -lopencv_objdetect4130 -lopencv_features2d4130 -lopencv_video4130 -lopencv_dnn4130 -lopencv_xfeatures2d4130 -lopencv_plot4130 -lopencv_tracking4130 -lopencv_img_hash4130 -lopencv_calib3d4130 -lopencv_bgsegm4130 -lopencv_photo4130 -lopencv_aruco4130 -lopencv_wechat_qrcode4130 -lopencv_ximgproc4130 -lopencv_mcc4130\n*/\nimport \"C\"\n"
  },
  {
    "path": "cgo_static.go",
    "content": "//go:build !customenv && opencvstatic && linux\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static.go and cuda/cgo_static.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4\n#cgo amd64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -lippiw -lippicv -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n#cgo arm64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -ltegra_hal -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n*/\nimport \"C\"\n\n// # cgo amd64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -lippiw -lippicv -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lx265 -lswresample -lm -latomic -lavutil -pthread -lm -latomic -lnuma\n// # cgo arm64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -ltegra_hal -lpng -lz -lfreetype  -lgcc -lstdc++ -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lx265 -lswresample -lm -latomic -lavutil -pthread -lm -latomic -lnuma\n"
  },
  {
    "path": "cgo_static_darwin.go",
    "content": "//go:build !customenv && opencvstatic && darwin\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static_darwin.go and cuda/cgo_static_darwin.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo pkg-config: --static opencv4\n*/\nimport \"C\"\n"
  },
  {
    "path": "cgo_static_windows.go",
    "content": "//go:build !customenv && opencvstatic && windows\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static_windows.go and cuda/cgo_static_windows.go.\n\n/*\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo LDFLAGS:    -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo4130 -lopencv_tracking4130 -lopencv_superres4130 -lopencv_stitching4130 -lopencv_optflow4130 -lopencv_gapi4130 -lopencv_face4130 -lopencv_dpm4130 -lopencv_dnn_objdetect4130 -lopencv_ccalib4130 -lopencv_bioinspired4130 -lopencv_bgsegm4130 -lopencv_aruco4130 -lopencv_xobjdetect4130 -lopencv_ximgproc4130 -lopencv_xfeatures2d4130 -lopencv_videostab4130 -lopencv_video4130 -lopencv_structured_light4130 -lopencv_shape4130 -lopencv_rgbd4130 -lopencv_rapid4130 -lopencv_objdetect4130 -lopencv_mcc4130 -lopencv_highgui4130 -lopencv_datasets4130 -lopencv_calib3d4130 -lopencv_videoio4130 -lopencv_text4130 -lopencv_line_descriptor4130 -lopencv_imgcodecs4130 -lopencv_img_hash4130 -lopencv_hfs4130 -lopencv_fuzzy4130 -lopencv_features2d4130 -lopencv_dnn_superres4130 -lopencv_dnn4130 -lopencv_xphoto4130 -lopencv_wechat_qrcode4130 -lopencv_surface_matching4130 -lopencv_reg4130 -lopencv_quality4130 -lopencv_plot4130 -lopencv_photo4130 -lopencv_phase_unwrapping4130 -lopencv_ml4130 -lopencv_intensity_transform4130 -lopencv_imgproc4130 -lopencv_flann4130 -lopencv_core4130 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32\n*/\nimport \"C\"\n"
  },
  {
    "path": "cmd/README.md",
    "content": "# GoCV Commands\n\nGoCV comes with various useful command line utilities, that are also examples of how to use the package.\n\n## ASCIIcam\n\nCapture video from a connected webcam, and display it in the current terminal window in ASCII format.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/asciicam/main.go\n\n## Basic Drawing\n\nDemonstrates the basic drawing primitives available for drawing on images.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/basic-drawing/main.go\n\n## Caffe Classifier\n\nCapture video from a connected webcam, then use the Caffe deep learning framework to classify whatever is in front of the camera.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/caffe-classifier/main.go\n\n## Capture test\n\nTests to verify you can capture video from a connected webcam.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/captest/main.go\n\n## Capture window\n\nCapture video from a connected webcam and display the video in a Window.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/capwindow/main.go\n\n## Counter\n\nCapture video from a pre-recorded file, and then count the number of detected objects that cross a user-definable vertical or horizontal line.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/counter/main.go\n\n## DNN Detection\n\nUse a Deep Neural Network to detect and track objects or faces.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/dnn-detection/main.go\n\n## DNN Pose Detection\n\nUse a Deep Neural Network trained using OpenPose to detect and track human body poses.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/dnn-pose-detection/main.go\n\n## DNN Style Transfer\n\nUse a Deep Neural Network to perform real-time style transfer.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/dnn-style-transfer/main.go\n\n## Faceblur\n\nCaptures video from a connected camera, then uses the CascadeClassifier to detect faces, blurs them using a Gaussian blur, then displays the blurred video in a window.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/faceblur/main.go\n\n## Facedetect\n\nCaptures video from a connected camera, then uses the CascadeClassifier to detect faces, and draw a rectangle around each of them, before displaying them within a Window.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/facedetect/main.go\n\n## Facedetect from URL\n\nUsing a single image downloaded from a URL, it then uses the CascadeClassifier to detect faces, and draw a rectangle around each of them, before displaying them within a Window.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/facedetect-from-url/main.go\n\n## Feature Matching\n\nMatch features in an image using the SIFT algorithm.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/feature-matching/main.go\n\n## Find Chessboard\n\nFind chessboard in an image using FindChessboardCorners.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/find-chessboard/main.go\n\n## Find Circles\n\nFind circles in an image using the Hough transform.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/find-circles/main.go\n\n## Find Lines\n\nFind lines in an image using the Hough transform.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/find-lines/main.go\n\n## Hand Gestures\n\nCount the number of fingers being held up in front of the camera by looking for convexity defects.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/hand-gestures/main.go\n\n## Hello\n\nThe \"hello world\" of computer vision.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/hello/main.go\n\n## Image Similarity\n\nCompute and compare perceptual hashes for a pair of images, with a variety of algorithms.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/img-similarity/main.go\n\n## MJPEG Streamer\n\nOpens a video capture device, then streams MJPEG from it that you can view in any browser.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/mjpeg-streamer/main.go\n\n## Motion Detection\n\nOpens a video capture device, then processes it looking for motion, human or otherwise.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/motion-detect/main.go\n\n## Save Image\n\nCapture a single frame from a connected webcam, then save it to an image file on disk.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/saveimage/main.go\n\n## Save Video\n\nCapture video from a connected camera, and save 100 frames worth to a video file on disk.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/savevideo/main.go\n\n## Show Image\n\nOpen an image file from disk, then display it in a window.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/showimage/main.go\n\n## SSD Face Detection\n\nAdvanced Deep Neural Network example that uses SSD classifier to detect faces from a connected camera.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/ssd-facedetect/main.go\n\n## Tensorflow Classifier\n\nCapture video from a connected webcam, then use the Tensorflow machine learning framework to classify whatever is in front of the camera.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/tf-classifier/main.go\n\n## Tracking\n\nExample of using Tracker from OpenCV Contrib to track any region of interest selected by the user using the TrackerMOSSE algorithm using the connected camera.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/tracking/main.go\n\n## Version\n\nDisplays the current version of OpenCV that is being used by GoCV.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/version/main.go\n\n## XPhoto\n\nThis example demonstrates a couple different uses of the XPhoto module. It can use the GrayworldWB class with BalanceWhite image to save an image file on disk. It can also use the Inpaint functions with inpaint algorithms type to save an image file on disk.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/xphoto/main.go\n\n## YOLO DNN Detection\n\nUse the YOLOv8 Deep Neural Network to detect and track objects or faces.\n\nhttps://github.com/hybridgroup/gocv/blob/release/cmd/yolo-detection/main.go\n"
  },
  {
    "path": "cmd/asciicam/main.go",
    "content": "// What it does:\n//\n// This example uses the VideoCapture class to capture video\n// then displays the ASCII representation of the video frames.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/asciicam/main.go\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/subeshb1/wasm-go-image-to-ascii/convert\"\n\t\"gocv.io/x/gocv\"\n)\n\nconst (\n\t// FixedWidth is the fixed width of the ASCII image\n\tFixedWidth = 80\n\n\t// FixedHeight is the fixed height of the ASCII image\n\tFixedHeight = 40\n)\n\nvar buf gocv.Mat\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tcaptest [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// streaming, capture from webcam\n\tbuf = gocv.NewMat()\n\tdefer buf.Close()\n\n\tasciiConverter := convert.NewImageConverter()\n\topts := &convert.Options{FixedWidth: FixedWidth, FixedHeight: FixedHeight, Colored: true}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&buf); !ok {\n\t\t\tfmt.Printf(\"Device error: %v\\n\", deviceID)\n\t\t\tcontinue\n\t\t}\n\t\tif buf.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\timg, err := buf.ToImage()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error converting mat to image: %v\\n\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// clear screen\n\t\tfmt.Print(\"\\033[H\\033[2J\")\n\n\t\t// print the ASCII representation of the frame\n\t\tfmt.Println(asciiConverter.Image2ASCIIString(img, opts))\n\t}\n}\n"
  },
  {
    "path": "cmd/basic-drawing/main.go",
    "content": "// What it does:\n//\n// This example draws two examples, an atom and a rook, based on:\n// https://docs.opencv.org/2.4/doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.html.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/basic-drawing/main.go\n//\n\npackage main\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nvar w = 400\n\nfunc main() {\n\twindowA := gocv.NewWindow(\"basic drawing: atom\")\n\twindowR := gocv.NewWindow(\"basic drawing: rook\")\n\tdefer windowA.Close()\n\tdefer windowR.Close()\n\n\tatom := gocv.NewMatWithSize(w, w, gocv.MatTypeCV8UC3)\n\tdefer atom.Close()\n\n\trook := gocv.NewMatWithSize(w, w, gocv.MatTypeCV8UC3)\n\tdefer rook.Close()\n\n\tblack := color.RGBA{0, 0, 0, 0}\n\tblue := color.RGBA{0, 0, 255, 0}\n\tred := color.RGBA{255, 0, 0, 0}\n\twhite := color.RGBA{255, 255, 255, 0}\n\tyellow := color.RGBA{255, 255, 0, 0}\n\n\t// draw the atom\n\tgocv.Ellipse(&atom, image.Pt(w/2., w/2.), image.Pt(w/4.0, w/16.0), 90., 0, 360, blue, 2)\n\tgocv.Ellipse(&atom, image.Pt(w/2., w/2.), image.Pt(w/4.0, w/16.0), 0., 0, 360, blue, 2)\n\tgocv.Ellipse(&atom, image.Pt(w/2., w/2.), image.Pt(w/4.0, w/16.0), 45., 0, 360, blue, 2)\n\tgocv.Ellipse(&atom, image.Pt(w/2., w/2.), image.Pt(w/4.0, w/16.0), -45., 0, 360, blue, 2)\n\tgocv.Circle(&atom, image.Pt(w/2., w/2.), w/32., red, -1)\n\n\t// draw the rook\n\tpoints := [][]image.Point{\n\t\t{\n\t\t\timage.Pt(w/4., 7*w/8.),\n\t\t\timage.Pt(3*w/4., 7*w/8.),\n\t\t\timage.Pt(3*w/4., 13*w/16.),\n\t\t\timage.Pt(11*w/16., 13*w/16.),\n\t\t\timage.Pt(19*w/32., 3*w/8.),\n\t\t\timage.Pt(3*w/4., 3*w/8.),\n\t\t\timage.Pt(3*w/4., w/8.),\n\t\t\timage.Pt(26*w/40., w/8.),\n\t\t\timage.Pt(26*w/40., w/4.),\n\t\t\timage.Pt(22*w/40., w/4.),\n\t\t\timage.Pt(22*w/40., w/8.),\n\t\t\timage.Pt(18*w/40., w/8.),\n\t\t\timage.Pt(18*w/40., w/4.),\n\t\t\timage.Pt(14*w/40., w/4.),\n\t\t\timage.Pt(14*w/40., w/8.),\n\t\t\timage.Pt(w/4., w/8.),\n\t\t\timage.Pt(w/4., 3*w/8.),\n\t\t\timage.Pt(13*w/32., 3*w/8.),\n\t\t\timage.Pt(5*w/16., 13*w/16.),\n\t\t\timage.Pt(w/4., 13*w/16.),\n\t\t},\n\t}\n\n\tpv := gocv.NewPointsVectorFromPoints(points)\n\tdefer pv.Close()\n\n\tgocv.FillPoly(&rook, pv, white)\n\tgocv.Rectangle(&rook, image.Rect(0, 7*w/8.0, w, w), yellow, -1)\n\tgocv.Line(&rook, image.Pt(0, 15*w/16), image.Pt(w, 15*w/16), black, 2)\n\tgocv.Line(&rook, image.Pt(w/4, 7*w/8), image.Pt(w/4, w), black, 2)\n\tgocv.Line(&rook, image.Pt(w/2, 7*w/8), image.Pt(w/2, w), black, 2)\n\tgocv.Line(&rook, image.Pt(3*w/4, 7*w/8), image.Pt(3*w/4, w), black, 2)\n\n\tfor {\n\t\twindowA.IMShow(atom)\n\t\twindowR.IMShow(rook)\n\n\t\tif windowA.WaitKey(10) >= 0 || windowR.WaitKey(10) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/caffe-classifier/main.go",
    "content": "// What it does:\n//\n// This example uses the Caffe (http://caffe.berkeleyvision.org/) deep learning framework\n// to classify whatever is in front of the camera.\n//\n// Download the Caffe model file from:\n// http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel\n//\n// Also, you will need the prototxt file:\n// https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/bvlc_googlenet.prototxt\n//\n// And the words text file with the descriptions:\n// https://raw.githubusercontent.com/opencv/opencv/master/samples/data/dnn/classification_classes_ILSVRC2012.txt\n//\n// How to run:\n//\n// \t\tgo run ./cmd/caffe-classifier/main.go 0 ~/Downloads/bvlc_googlenet.caffemodel ~/Downloads/bvlc_googlenet.prototxt ~/Downloads/classification_classes_ILSVRC2012.txt\n//\n// You can also use this sample with the Intel OpenVINO Inference Engine, if you have it installed.\n//\n// \t\tgo run ./cmd/caffe-classifier/main.go 0 ~/Downloads/bvlc_googlenet.caffemodel ~/Downloads/bvlc_googlenet.prototxt ~/Downloads/classification_classes_ILSVRC2012.txt openvino fp16\n//\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 5 {\n\t\tfmt.Println(\"How to run:\\ncaffe-classifier [camera ID] [modelfile] [configfile] [descriptionsfile] ([backend] [device])\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tconfig := os.Args[3]\n\tdescr := os.Args[4]\n\tdescriptions, err := readDescriptions(descr)\n\tif err != nil {\n\t\tfmt.Printf(\"Error reading descriptions file: %v\\n\", descr)\n\t\treturn\n\t}\n\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 5 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[5])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 6 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[6])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"Caffe Classifier\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN classifier\n\tnet := gocv.ReadNet(model, config)\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v %v\\n\", model, config)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\tstatus := \"Ready\"\n\tstatusColor := color.RGBA{0, 255, 0, 0}\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// convert image Mat to 224x224 blob that the classifier can analyze\n\t\tblob := gocv.BlobFromImage(img, 1.0, image.Pt(224, 224), gocv.NewScalar(104, 117, 123, 0), false, false)\n\n\t\t// feed the blob into the classifier\n\t\tnet.SetInput(blob, \"\")\n\n\t\t// run a forward pass thru the network\n\t\tprob := net.Forward(\"\")\n\n\t\t// reshape the results into a 1x1000 matrix\n\t\tprobMat := prob.Reshape(1, 1)\n\n\t\t// determine the most probable classification\n\t\t_, maxVal, _, maxLoc := gocv.MinMaxLoc(probMat)\n\n\t\t// display classification\n\t\tstatus = fmt.Sprintf(\"description: %v, maxVal: %v\\n\", descriptions[maxLoc.X], maxVal)\n\t\tgocv.PutText(&img, status, image.Pt(10, 20), gocv.FontHersheyPlain, 1.2, statusColor, 2)\n\n\t\tblob.Close()\n\t\tprob.Close()\n\t\tprobMat.Close()\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// readDescriptions reads the descriptions from a file\n// and returns a slice of its lines.\nfunc readDescriptions(path string) ([]string, error) {\n\tfile, err := os.Open(filepath.Clean(path))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\t_ = file.Close()\n\t}()\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\treturn lines, scanner.Err()\n}\n"
  },
  {
    "path": "cmd/captest/main.go",
    "content": "// What it does:\n//\n// This example uses the VideoCapture class to test if you can capture video\n// from a connected webcam, by trying to read 100 frames.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/captest/main.go\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tcaptest [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// streaming, capture from webcam\n\tbuf := gocv.NewMat()\n\tdefer buf.Close()\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor i := 0; i < 100; i++ {\n\t\tif ok := webcam.Read(&buf); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif buf.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tfmt.Printf(\"Read frame %d\\n\", i+1)\n\t}\n\n\tfmt.Println(\"Done.\")\n}\n"
  },
  {
    "path": "cmd/capwindow/main.go",
    "content": "// What it does:\n//\n// This example uses the VideoCapture class to capture frames from a connected webcam,\n// and displays the video in a Window class.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/capwindow/main.go\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tcapwindow [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"Capture Window\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) == 27 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/counter/main.go",
    "content": "// What it does:\n//\n// This example tracks objects such as cars or people passing across\n// a horizontal or vertical line by using the Moments method.\n// The Moments algorithm is not that accurate for counting multiple objects,\n// however it is execution efficient.\n//\n// How to run:\n//\n// \t\tgo run ./counter/main.go /path/to/video.avi 400 y 10\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tcounter [filename] [line] [axis (x/y)] [width]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tfile := os.Args[1]\n\tline, _ := strconv.Atoi(os.Args[2])\n\taxis := os.Args[3]\n\twidth, _ := strconv.Atoi(os.Args[4])\n\n\tvideo, err := gocv.VideoCaptureFile(file)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture file: %s\\n\", file)\n\t\treturn\n\t}\n\tdefer video.Close()\n\n\twindow := gocv.NewWindow(\"Track Window\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\timgFG := gocv.NewMat()\n\tdefer imgFG.Close()\n\n\timgCleaned := gocv.NewMat()\n\tdefer imgCleaned.Close()\n\n\tmog2 := gocv.NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tcount := 0\n\tfor {\n\t\tif ok := video.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", file)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// clean frame by removing background & eroding to eliminate artifacts\n\t\tmog2.Apply(img, &imgFG)\n\t\tkernel := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(3, 3))\n\t\tgocv.Erode(imgFG, &imgCleaned, kernel)\n\t\tkernel.Close()\n\n\t\t// calculate the image moment based on the cleaned frame\n\t\tmoments := gocv.Moments(imgCleaned, true)\n\t\tarea := moments[\"m00\"]\n\t\tif area >= 1 {\n\t\t\tx := int(moments[\"m10\"] / area)\n\t\t\ty := int(moments[\"m01\"] / area)\n\n\t\t\tif axis == \"y\" {\n\t\t\t\tif x > 0 && x < img.Cols() && y > line && y < line+width {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tgocv.Line(&img, image.Pt(0, line), image.Pt(img.Cols(), line), color.RGBA{255, 0, 0, 0}, 2)\n\t\t\t}\n\t\t\tif axis == \"x\" {\n\t\t\t\tif y > 0 && y < img.Rows() && x > line && x < line+width {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tgocv.Line(&img, image.Pt(line, 0), image.Pt(line, img.Rows()), color.RGBA{255, 0, 0, 0}, 2)\n\t\t\t}\n\t\t}\n\n\t\tgocv.PutText(&img, fmt.Sprintf(\"Count: %d\", count), image.Pt(10, 20),\n\t\t\tgocv.FontHersheyPlain, 1.2, color.RGBA{0, 255, 0, 0}, 2)\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/cuda/main.go",
    "content": "// What it does:\n//\n// \tThis program outputs the current OpenCV library version and CUDA version the console.\n//\n// How to run:\n//\n// \t\tgo run --tags cuda ./cmd/cuda/main.go\n//\n// +build cuda\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"gocv.io/x/gocv\"\n\t\"gocv.io/x/gocv/cuda\"\n)\n\nfunc main() {\n\tfmt.Printf(\"gocv version: %s\\n\", gocv.Version())\n\tfmt.Println(\"cuda information:\")\n\tdevices := cuda.GetCudaEnabledDeviceCount()\n\tfor i := 0; i < devices; i++ {\n\t\tfmt.Print(\"  \")\n\t\tcuda.PrintShortCudaDeviceInfo(i)\n\t}\n}\n"
  },
  {
    "path": "cmd/dnn-detection/main.go",
    "content": "// What it does:\n//\n// This example uses a deep neural network to perform object detection.\n// It can be used with either the Caffe face tracking or Tensorflow object detection models that are\n// included with OpenCV 3.4\n//\n// To perform face tracking with the Caffe model:\n//\n// Download the model file from:\n// https://github.com/opencv/opencv_3rdparty/raw/dnn_samples_face_detector_20170830/res10_300x300_ssd_iter_140000.caffemodel\n//\n// You will also need the prototxt config file:\n// https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt\n//\n// To perform object tracking with the Tensorflow model:\n//\n// Download and extract the model file named \"frozen_inference_graph.pb\" from:\n// http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2017_11_17.tar.gz\n//\n// You will also need the pbtxt config file:\n// https://gist.githubusercontent.com/dkurt/45118a9c57c38677b65d6953ae62924a/raw/b0edd9e8c992c25fe1c804e77b06d20a89064871/ssd_mobilenet_v1_coco_2017_11_17.pbtxt\n//\n// How to run:\n//\n// \t\tgo run ./cmd/dnn-detection/main.go [videosource] [modelfile] [configfile] ([backend] [device])\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Println(\"How to run:\\ndnn-detection [videosource] [modelfile] [configfile] ([backend] [device])\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tconfig := os.Args[3]\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 4 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[4])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 5 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[5])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"DNN Detection\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN object tracking model\n\tnet := gocv.ReadNet(model, config)\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v %v\\n\", model, config)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\tvar ratio float64\n\tvar mean gocv.Scalar\n\tvar swapRGB bool\n\n\tif filepath.Ext(model) == \".caffemodel\" {\n\t\tratio = 1.0\n\t\tmean = gocv.NewScalar(104, 177, 123, 0)\n\t\tswapRGB = false\n\t} else {\n\t\tratio = 1.0 / 127.5\n\t\tmean = gocv.NewScalar(127.5, 127.5, 127.5, 0)\n\t\tswapRGB = true\n\t}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// convert image Mat to 300x300 blob that the object detector can analyze\n\t\tblob := gocv.BlobFromImage(img, ratio, image.Pt(300, 300), mean, swapRGB, false)\n\n\t\t// feed the blob into the detector\n\t\tnet.SetInput(blob, \"\")\n\n\t\t// run a forward pass thru the network\n\t\tprob := net.Forward(\"\")\n\n\t\tperformDetection(&img, prob)\n\n\t\tprob.Close()\n\t\tblob.Close()\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// performDetection analyzes the results from the detector network,\n// which produces an output blob with a shape 1x1xNx7\n// where N is the number of detections, and each detection\n// is a vector of float values\n// [batchId, classId, confidence, left, top, right, bottom]\nfunc performDetection(frame *gocv.Mat, results gocv.Mat) {\n\tfor i := 0; i < results.Total(); i += 7 {\n\t\tconfidence := results.GetFloatAt(0, i+2)\n\t\tif confidence > 0.5 {\n\t\t\tleft := int(results.GetFloatAt(0, i+3) * float32(frame.Cols()))\n\t\t\ttop := int(results.GetFloatAt(0, i+4) * float32(frame.Rows()))\n\t\t\tright := int(results.GetFloatAt(0, i+5) * float32(frame.Cols()))\n\t\t\tbottom := int(results.GetFloatAt(0, i+6) * float32(frame.Rows()))\n\t\t\tgocv.Rectangle(frame, image.Rect(left, top, right, bottom), color.RGBA{0, 255, 0, 0}, 2)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/dnn-pose-detection/main.go",
    "content": "// What it does:\n//\n// This example shows how to perform pose detection using models from OpenPose, an open source\n// human body, hand, and facial keypoint detector.\n//\n// For more information about OpenPose, please go to:\n// https://github.com/CMU-Perceptual-Computing-Lab/openpose\n//\n// Before using running this example, you'll need to download a pretrained Caffe model,\n// and the respective prototxt config file.\n//\n// http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel\n// https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/openpose_pose_coco.prototxt\n//\n// You can also try the hand pose model:\n// http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel\n// https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose/master/models/hand/pose_deploy.prototxt\n//\n//\n// How to run:\n//\n// go run ./cmd/dnn-pose-detection/main.go 0 ~/Downloads/pose_iter_440000.caffemodel ~/Downloads/openpose_pose_coco.prototxt openvino fp16\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nvar net *gocv.Net\nvar images chan *gocv.Mat\nvar poses chan [][]image.Point\nvar pose [][]image.Point\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Println(\"How to run:\\ndnn-pose-detection [videosource] [modelfile] [configfile] ([backend] [device])\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tproto := os.Args[3]\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 4 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[4])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 5 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[5])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"DNN Pose Detection\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open OpenPose model\n\tn := gocv.ReadNet(model, proto)\n\tnet = &n\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v %v\\n\", model, proto)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\timages = make(chan *gocv.Mat, 1)\n\tposes = make(chan [][]image.Point)\n\n\tif ok := webcam.Read(&img); !ok {\n\t\tfmt.Printf(\"Error cannot read device %v\\n\", deviceID)\n\t\treturn\n\t}\n\n\tprocessFrame(&img)\n\n\tgo performDetection()\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tselect {\n\t\tcase pose = <-poses:\n\t\t\t// we've received the next pose from channel, so send next image frame for detection\n\t\t\tprocessFrame(&img)\n\n\t\tdefault:\n\t\t\t// show current frame without blocking, so do nothing here\n\t\t}\n\n\t\tdrawPose(&img)\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc processFrame(i *gocv.Mat) {\n\tframe := gocv.NewMat()\n\ti.CopyTo(&frame)\n\timages <- &frame\n}\n\n// performDetection analyzes the results from the detector network.\n// the result is an array of \"heatmaps\" which are the probability\n// of a body part being in location x,y\nfunc performDetection() {\n\tfor {\n\t\t// get next frame from channel\n\t\tframe := <-images\n\n\t\t// convert image Mat to 368x368 blob that the pose detector can analyze\n\t\tblob := gocv.BlobFromImage(*frame, 1.0/255.0, image.Pt(368, 368), gocv.NewScalar(0, 0, 0, 0), false, false)\n\n\t\t// feed the blob into the detector\n\t\tnet.SetInput(blob, \"\")\n\n\t\t// run a forward pass thru the network\n\t\tprob := net.Forward(\"\")\n\n\t\tvar midx int\n\t\ts := prob.Size()\n\t\tnparts, h, w := s[1], s[2], s[3]\n\n\t\t// find out, which model we have\n\t\tswitch nparts {\n\t\tcase 19:\n\t\t\t// COCO body\n\t\t\tmidx = 0\n\t\t\tnparts = 18 // skip background\n\t\tcase 16:\n\t\t\t// MPI body\n\t\t\tmidx = 1\n\t\t\tnparts = 15 // skip background\n\t\tcase 22:\n\t\t\t// hand\n\t\t\tmidx = 2\n\t\tdefault:\n\t\t\tfmt.Println(\"there should be 19 parts for the COCO model, 16 for MPI, or 22 for the hand model\")\n\t\t\treturn\n\t\t}\n\n\t\t// find the most likely match for each part\n\t\tpts := make([]image.Point, 22)\n\t\tfor i := 0; i < nparts; i++ {\n\t\t\tpts[i] = image.Pt(-1, -1)\n\t\t\theatmap, _ := prob.FromPtr(h, w, gocv.MatTypeCV32F, 0, i)\n\n\t\t\t_, maxVal, _, maxLoc := gocv.MinMaxLoc(heatmap)\n\t\t\tif maxVal > 0.1 {\n\t\t\t\tpts[i] = maxLoc\n\t\t\t}\n\t\t\theatmap.Close()\n\t\t}\n\n\t\t// determine scale factor\n\t\tsX := int(float32(frame.Cols()) / float32(w))\n\t\tsY := int(float32(frame.Rows()) / float32(h))\n\n\t\t// create the results array of pairs of points with the lines that best fit\n\t\t// each body part, e.g.\n\t\t// [[point A for body part 1, point B for body part 1],\n\t\t//  [point A for body part 2, point B for body part 2], ...]\n\t\tresults := [][]image.Point{}\n\t\tfor _, p := range PosePairs[midx] {\n\t\t\ta := pts[p[0]]\n\t\t\tb := pts[p[1]]\n\n\t\t\t// high enough confidence in this pose?\n\t\t\tif a.X <= 0 || a.Y <= 0 || b.X <= 0 || b.Y <= 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// scale to image size\n\t\t\ta.X *= sX\n\t\t\ta.Y *= sY\n\t\t\tb.X *= sX\n\t\t\tb.Y *= sY\n\n\t\t\tresults = append(results, []image.Point{a, b})\n\t\t}\n\t\tprob.Close()\n\t\tblob.Close()\n\t\tframe.Close()\n\n\t\t// send pose results in channel\n\t\tposes <- results\n\t}\n}\n\nfunc drawPose(frame *gocv.Mat) {\n\tfor _, pts := range pose {\n\t\tgocv.Line(frame, pts[0], pts[1], color.RGBA{0, 255, 0, 0}, 2)\n\t\tgocv.Circle(frame, pts[0], 3, color.RGBA{0, 0, 200, 0}, -1)\n\t\tgocv.Circle(frame, pts[1], 3, color.RGBA{0, 0, 200, 0}, -1)\n\t}\n}\n\n// PosePairs is a table of the body part connections in the format [model_id][pair_id][from/to]\n// For details please see:\n// https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/output.md\nvar PosePairs = [3][20][2]int{\n\t{ // COCO body\n\t\t{1, 2}, {1, 5}, {2, 3},\n\t\t{3, 4}, {5, 6}, {6, 7},\n\t\t{1, 8}, {8, 9}, {9, 10},\n\t\t{1, 11}, {11, 12}, {12, 13},\n\t\t{1, 0}, {0, 14},\n\t\t{14, 16}, {0, 15}, {15, 17},\n\t},\n\t{ // MPI body\n\t\t{0, 1}, {1, 2}, {2, 3},\n\t\t{3, 4}, {1, 5}, {5, 6},\n\t\t{6, 7}, {1, 14}, {14, 8}, {8, 9},\n\t\t{9, 10}, {14, 11}, {11, 12}, {12, 13},\n\t},\n\t{ // hand\n\t\t{0, 1}, {1, 2}, {2, 3}, {3, 4}, // thumb\n\t\t{0, 5}, {5, 6}, {6, 7}, {7, 8}, // pinkie\n\t\t{0, 9}, {9, 10}, {10, 11}, {11, 12}, // middle\n\t\t{0, 13}, {13, 14}, {14, 15}, {15, 16}, // ring\n\t\t{0, 17}, {17, 18}, {18, 19}, {19, 20}, // small\n\t}}\n"
  },
  {
    "path": "cmd/dnn-style-transfer/main.go",
    "content": "// What it does:\n//\n// This example performs real-time style transfer using a deep neural network.\n//\n// For more information about the model used by this example, go to:\n// https://github.com/jcjohnson/fast-neural-style\n//\n// Download the model file from:\n// http://cs.stanford.edu/people/jcjohns/fast-neural-style/models/eccv16/starry_night.t7\n//\n// How to run:\n//\n// \t\tgo run ./cmd/dnn-style-transfer/main.go 0 ~/Downloads/starry_night.t7 openvino fp16\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\ndnn-style-transfer [videosource] [modelfile] ([backend] [device])\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 3 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[3])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 4 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[4])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"DNN Style Transfer\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN style transfer model\n\tnet := gocv.ReadNet(model, \"\")\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v\\n\", model)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// convert image Mat to 640x480 blob that the style transfer can analyze\n\t\tblob := gocv.BlobFromImage(img, 1.0, image.Pt(640, 480), gocv.NewScalar(103.939, 116.779, 123.68, 0), false, false)\n\n\t\t// feed the blob into the detector\n\t\tnet.SetInput(blob, \"\")\n\n\t\t// run a forward pass thru the network\n\t\tprobMat := net.Forward(\"\")\n\t\tsz := probMat.Size()\n\t\tdims := sz[2] * sz[3]\n\t\tout := gocv.NewMatWithSize(480, 640, gocv.MatTypeCV8UC3)\n\n\t\t// take blob and obtain displayable Mat image from it\n\t\tfor i := 0; i < dims; i++ {\n\t\t\tr := probMat.GetFloatAt(0, i)\n\t\t\tr += 103.939\n\n\t\t\tg := probMat.GetFloatAt(0, i+dims)\n\t\t\tg += 116.779\n\n\t\t\tb := probMat.GetFloatAt(0, i+dims*2)\n\t\t\tb += 123.68\n\n\t\t\tout.SetUCharAt(0, i*3, uint8(r))\n\t\t\tout.SetUCharAt(0, i*3+1, uint8(g))\n\t\t\tout.SetUCharAt(0, i*3+2, uint8(b))\n\t\t}\n\n\t\twindow.IMShow(out)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tprobMat.Close()\n\t\tblob.Close()\n\t\tout.Close()\n\t}\n}\n"
  },
  {
    "path": "cmd/faceblur/main.go",
    "content": "// What it does:\n//\n// This example captures video from a connected camera,\n// then uses the CascadeClassifier to detect faces, blurs them\n// using a Gaussian blur, then displays the blurred video in a window.\n//\n// How to run:\n//\n// faceblur [camera ID] [classifier XML file]\n//\n// \t\tgo run ./cmd/faceblur/main.go 0 data/haarcascade_frontalface_default.xml\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tfaceblur [camera ID] [classifier XML file]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\txmlFile := os.Args[2]\n\n\t// open webcam\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// open display window\n\twindow := gocv.NewWindow(\"Face Blur\")\n\tdefer window.Close()\n\n\t// prepare image matrix\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// load classifier to recognize faces\n\tclassifier := gocv.NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tif !classifier.Load(xmlFile) {\n\t\tfmt.Printf(\"Error reading cascade file: %v\\n\", xmlFile)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// detect faces\n\t\trects := classifier.DetectMultiScale(img)\n\t\tfmt.Printf(\"found %d faces\\n\", len(rects))\n\n\t\t// blur each face on the original image\n\t\tfor _, r := range rects {\n\t\t\timgFace := img.Region(r)\n\n\t\t\t// blur face\n\t\t\tgocv.GaussianBlur(imgFace, &imgFace, image.Pt(75, 75), 0, 0, gocv.BorderDefault)\n\t\t\timgFace.Close()\n\t\t}\n\n\t\t// show the image in the window, and wait 1 millisecond\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/facedetect/main.go",
    "content": "// What it does:\n//\n// This example uses the CascadeClassifier class to detect faces,\n// and draw a rectangle around each of them, before displaying them within a Window.\n//\n// How to run:\n//\n// facedetect [camera ID] [classifier XML file]\n//\n// \t\tgo run ./cmd/facedetect/main.go 0 data/haarcascade_frontalface_default.xml\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tfacedetect [camera ID] [classifier XML file]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\txmlFile := os.Args[2]\n\n\t// open webcam\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// open display window\n\twindow := gocv.NewWindow(\"Face Detect\")\n\tdefer window.Close()\n\n\t// prepare image matrix\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// color for the rect when faces detected\n\tblue := color.RGBA{0, 0, 255, 0}\n\n\t// load classifier to recognize faces\n\tclassifier := gocv.NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tif !classifier.Load(xmlFile) {\n\t\tfmt.Printf(\"Error reading cascade file: %v\\n\", xmlFile)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// detect faces\n\t\trects := classifier.DetectMultiScale(img)\n\t\tfmt.Printf(\"found %d faces\\n\", len(rects))\n\n\t\t// draw a rectangle around each face on the original image,\n\t\t// along with text identifing as \"Human\"\n\t\tfor _, r := range rects {\n\t\t\tgocv.Rectangle(&img, r, blue, 3)\n\n\t\t\tsize := gocv.GetTextSize(\"Human\", gocv.FontHersheyPlain, 1.2, 2)\n\t\t\tpt := image.Pt(r.Min.X+(r.Min.X/2)-(size.X/2), r.Min.Y-2)\n\t\t\tgocv.PutText(&img, \"Human\", pt, gocv.FontHersheyPlain, 1.2, blue, 2)\n\t\t}\n\n\t\t// show the image in the window, and wait 1 millisecond\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/facedetect-from-url/main.go",
    "content": "// What it does:\n//\n// This example uses the CascadeClassifier class to detect faces from url,\n// and draw a rectangle around each of them, before displaying them within a Window.\n//\n// How to run:\n//\n// facedetect-from-url [image URL] [classifier XML file] [image file]\n//\n// \t\tgo run ./cmd/facedetect-from-url/main.go https://raw.githubusercontent.com/hybridgroup/gocv/release/images/face.jpg data/haarcascade_frontalface_default.xml output.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Println(\"How to run:\\n\\tfacedetect-from-url [image URL] [classifier XML file] [image file]\")\n\t\treturn\n\t}\n\n\t// parse args\n\timageURL := os.Args[1]\n\txmlFile := os.Args[2]\n\tsaveFile := os.Args[3]\n\n\t// color for the rect when faces detected\n\tblue := color.RGBA{0, 0, 255, 0}\n\n\t// load classifier to recognize faces\n\tclassifier := gocv.NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tif !classifier.Load(xmlFile) {\n\t\tfmt.Printf(\"Error reading cascade file: %v\\n\", xmlFile)\n\t\treturn\n\t}\n\n\t// get image from URL\n\t// #nosec\n\tres, err := http.Get(imageURL)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tresByte, err := ioutil.ReadAll(res.Body)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\timg, err := gocv.IMDecode(resByte, 1)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trects := classifier.DetectMultiScale(img)\n\tfmt.Printf(\"found %d faces\\n\", len(rects))\n\t// draw a rectangle around each face on the original image,\n\t// along with text identifing as \"Human\"\n\tfor _, r := range rects {\n\t\tgocv.Rectangle(&img, r, blue, 3)\n\n\t\tsize := gocv.GetTextSize(\"Human\", gocv.FontHersheyPlain, 1.2, 2)\n\t\tpt := image.Pt(r.Min.X+(r.Min.X/2)-(size.X/2), r.Min.Y-2)\n\t\tgocv.PutText(&img, \"Human\", pt, gocv.FontHersheyPlain, 1.2, blue, 2)\n\t}\n\tgocv.IMWrite(saveFile, img)\n\tfmt.Printf(\"saved to %s\\n\", saveFile)\n}\n"
  },
  {
    "path": "cmd/facedetectYN/main.go",
    "content": "// What it does:\n//\n// This example uses the FaceDetectorYN class to detect faces,\n// and draw a rectangle around each of them, before displaying them within a Window.\n//\n// model files download link:\n// https://github.com/opencv/opencv_zoo/tree/main/models/face_detection_yunet\n//\n// How to run:\n//\n// facedetectYN [camera ID] [model file]\n//\n// \t\tgo run ./cmd/facedetectYN/main.go 0 face_detection_yunet_2023mar.onnx\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tfacedetectYN [camera ID] [model file]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodelFile := os.Args[2]\n\n\t// open webcam\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// open display window\n\twindow := gocv.NewWindow(\"Face Detect YN\")\n\tdefer window.Close()\n\n\t// prepare image matrix\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// prepare faces matrix\n\tfaces := gocv.NewMat()\n\tdefer faces.Close()\n\n\t// colors for the rect faces detected\n\tred := color.RGBA{255, 0, 0, 0}\n\tgreen := color.RGBA{0, 255, 0, 0}\n\tblue := color.RGBA{0, 0, 255, 0}\n\tyellow := color.RGBA{255, 255, 0, 1}\n\tpink := color.RGBA{255, 105, 180, 0}\n\n\tdetector := gocv.NewFaceDetectorYN(modelFile, \"\", image.Pt(200, 200))\n\tdefer detector.Close()\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tsz := img.Size()\n\t\tdetector.SetInputSize(image.Pt(sz[1], sz[0]))\n\n\t\tdetector.Detect(img, &faces)\n\n\t\tif faces.Rows() < 1 {\n\t\t\t// no faces detected\n\t\t\t// show the captured frame anyway\n\t\t\twindow.IMShow(img)\n\t\t\tif window.WaitKeyEx(1) >= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tfor r := 0; r < faces.Rows(); r++ {\n\n\t\t\tx0 := int(faces.GetFloatAt(r, 0))\n\t\t\ty0 := int(faces.GetFloatAt(r, 1))\n\t\t\tx1 := x0 + int(faces.GetFloatAt(r, 2))\n\t\t\ty1 := y0 + int(faces.GetFloatAt(r, 3))\n\n\t\t\tfaceRect := image.Rect(x0, y0, x1, y1)\n\n\t\t\trightEye := image.Pt(\n\t\t\t\tint(faces.GetFloatAt(r, 4)),\n\t\t\t\tint(faces.GetFloatAt(r, 5)),\n\t\t\t)\n\n\t\t\tleftEye := image.Pt(\n\t\t\t\tint(faces.GetFloatAt(r, 6)),\n\t\t\t\tint(faces.GetFloatAt(r, 7)),\n\t\t\t)\n\n\t\t\tnoseTip := image.Pt(\n\t\t\t\tint(faces.GetFloatAt(r, 8)),\n\t\t\t\tint(faces.GetFloatAt(r, 9)),\n\t\t\t)\n\n\t\t\trightMouthCorner := image.Pt(\n\t\t\t\tint(faces.GetFloatAt(r, 10)),\n\t\t\t\tint(faces.GetFloatAt(r, 11)),\n\t\t\t)\n\n\t\t\tleftMouthCorner := image.Pt(\n\t\t\t\tint(faces.GetFloatAt(r, 12)),\n\t\t\t\tint(faces.GetFloatAt(r, 13)),\n\t\t\t)\n\n\t\t\tgocv.Rectangle(&img, faceRect, green, 1)\n\t\t\tgocv.Circle(&img, rightEye, 1, blue, 1)\n\t\t\tgocv.Circle(&img, leftEye, 1, red, 1)\n\t\t\tgocv.Circle(&img, noseTip, 1, green, 1)\n\t\t\tgocv.Circle(&img, rightMouthCorner, 1, pink, 1)\n\t\t\tgocv.Circle(&img, leftMouthCorner, 1, yellow, 1)\n\n\t\t}\n\t\t// show the image in the window, and wait 1 millisecond\n\t\twindow.IMShow(img)\n\t\tif window.WaitKeyEx(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/feature-matching/main.go",
    "content": "// What it does:\n//\n// This example uses Brute-Force Matching\n// with SIFT Descriptors and Ratio Test\n//\n// How to run:\n//\n// feature-matching [query image] [training image]\n//\n// \t\tgo run ./cmd/feature-matching/main.go input.jpg training.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) != 3 {\n\t\tfmt.Println(\"Usage: feature-matching /path/to/query /path/to/train\")\n\t\tpanic(\"error: no files provided\")\n\t}\n\n\t// opening query image\n\tquery := gocv.IMRead(os.Args[1], gocv.IMReadGrayScale)\n\tdefer query.Close()\n\n\t// opening train image\n\ttrain := gocv.IMRead(os.Args[2], gocv.IMReadGrayScale)\n\tdefer train.Close()\n\n\t// creating new SIFT\n\tsift := gocv.NewSIFT()\n\tdefer sift.Close()\n\n\t// detecting and computing keypoints using SIFT method\n\tqueryMask := gocv.NewMat()\n\tdefer queryMask.Close()\n\tkp1, des1 := sift.DetectAndCompute(query, queryMask)\n\tdefer des1.Close()\n\n\ttrainMask := gocv.NewMat()\n\tdefer trainMask.Close()\n\tkp2, des2 := sift.DetectAndCompute(train, trainMask)\n\tdefer des2.Close()\n\n\t// finding K best matches for each descriptor\n\tbf := gocv.NewBFMatcher()\n\tmatches := bf.KnnMatch(des1, des2, 2)\n\n\t// application of ratio test\n\tvar good []gocv.DMatch\n\tfor _, m := range matches {\n\t\tif len(m) > 1 {\n\t\t\tif m[0].Distance < 0.75*m[1].Distance {\n\t\t\t\tgood = append(good, m[0])\n\t\t\t}\n\t\t}\n\t}\n\n\t// matches color\n\tc1 := color.RGBA{\n\t\tR: 0,\n\t\tG: 255,\n\t\tB: 0,\n\t\tA: 0,\n\t}\n\n\t// point color\n\tc2 := color.RGBA{\n\t\tR: 255,\n\t\tG: 0,\n\t\tB: 0,\n\t\tA: 0,\n\t}\n\n\t// creating empty mask\n\tmask := make([]byte, 0)\n\n\t// new matrix for output image\n\tout := gocv.NewMat()\n\tdefer out.Close()\n\t// drawing matches\n\tgocv.DrawMatches(query, kp1, train, kp2, good, &out, c1, c2, mask, gocv.DrawDefault)\n\n\t// creating output window with result\n\twindow := gocv.NewWindow(\"Output\")\n\twindow.IMShow(out)\n\tdefer window.Close()\n\n\twindow.WaitKey(0)\n}\n"
  },
  {
    "path": "cmd/find-chessboard/main.go",
    "content": "// What it does:\n//\n// This example shows how to find chessboard patterns in an image\n//\n// How to run:\n//\n// \t\tgo run ./cmd/find-chessboard/main.go ./images/chessboard_4x6.png\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tfind-chessboard [imgfile]\")\n\t\treturn\n\t}\n\n\tfilename := os.Args[1]\n\timg := gocv.IMRead(filename, gocv.IMReadColor)\n\n\tif img.Empty() {\n\t\tfmt.Printf(\"Error reading chessboard image\")\n\t\treturn\n\t}\n\tdefer img.Close()\n\n\tcorners := gocv.NewMat()\n\tdefer corners.Close()\n\tsz := image.Point{X: 4, Y: 6}\n\tfound := gocv.FindChessboardCorners(img, sz, &corners, 0)\n\tif found == false {\n\t\tfmt.Printf(\"chessboard pattern not found\")\n\t\treturn\n\t}\n\tif corners.Empty() {\n\t\tfmt.Printf(\"corners mat is empty\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Corners Found. Size: %+v Rows: %+v Cols: %+v\\n\", corners.Size(), corners.Rows(), corners.Cols())\n\tclone := img.Clone()\n\tdefer clone.Close()\n\tgocv.DrawChessboardCorners(&clone, sz, corners, found)\n\tif clone.Empty() {\n\t\tfmt.Printf(\"Error writing to chessboard image\")\n\t\treturn\n\t}\n\n\twindow := gocv.NewWindow(\"Chessboards\")\n\tdefer window.Close()\n\tfor {\n\t\twindow.IMShow(clone)\n\n\t\tif window.WaitKey(10) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/find-circles/main.go",
    "content": "// What it does:\n//\n// This example shows how to find circles in an image using Hough transform.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/find-circles/main.go ./images/circles.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tfind-circles [imgfile]\")\n\t\treturn\n\t}\n\n\tfilename := os.Args[1]\n\n\twindow := gocv.NewWindow(\"detected circles\")\n\tdefer window.Close()\n\n\timg := gocv.IMRead(filename, gocv.IMReadGrayScale)\n\tdefer img.Close()\n\n\tgocv.MedianBlur(img, &img, 5)\n\n\tcimg := gocv.NewMat()\n\tdefer cimg.Close()\n\n\tgocv.CvtColor(img, &cimg, gocv.ColorGrayToBGR)\n\n\tcircles := gocv.NewMat()\n\tdefer circles.Close()\n\n\tgocv.HoughCirclesWithParams(\n\t\timg,\n\t\t&circles,\n\t\tgocv.HoughGradient,\n\t\t1,                     // dp\n\t\tfloat64(img.Rows()/8), // minDist\n\t\t75,                    // param1\n\t\t20,                    // param2\n\t\t10,                    // minRadius\n\t\t0,                     // maxRadius\n\t)\n\n\tblue := color.RGBA{0, 0, 255, 0}\n\tred := color.RGBA{255, 0, 0, 0}\n\n\tfor i := 0; i < circles.Cols(); i++ {\n\t\tv := circles.GetVecfAt(0, i)\n\t\t// if circles are found\n\t\tif len(v) > 2 {\n\t\t\tx := int(v[0])\n\t\t\ty := int(v[1])\n\t\t\tr := int(v[2])\n\n\t\t\tgocv.Circle(&cimg, image.Pt(x, y), r, blue, 2)\n\t\t\tgocv.Circle(&cimg, image.Pt(x, y), 2, red, 3)\n\t\t}\n\t}\n\n\tfor {\n\t\twindow.IMShow(cimg)\n\n\t\tif window.WaitKey(10) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/find-lines/main.go",
    "content": "// What it does:\n//\n// This example shows how to find lines in an image using Hough transform.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/find-lines/main.go lines.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tfilename := os.Args[1]\n\n\tmat := gocv.IMRead(filename, gocv.IMReadColor)\n\n\tmatCanny := gocv.NewMat()\n\tmatLines := gocv.NewMat()\n\n\twindow := gocv.NewWindow(\"detected lines\")\n\n\tgocv.Canny(mat, &matCanny, 50, 200)\n\tgocv.HoughLinesP(matCanny, &matLines, 1, math.Pi/180, 80)\n\n\tfmt.Println(matLines.Cols())\n\tfmt.Println(matLines.Rows())\n\tfor i := 0; i < matLines.Rows(); i++ {\n\t\tpt1 := image.Pt(int(matLines.GetVeciAt(i, 0)[0]), int(matLines.GetVeciAt(i, 0)[1]))\n\t\tpt2 := image.Pt(int(matLines.GetVeciAt(i, 0)[2]), int(matLines.GetVeciAt(i, 0)[3]))\n\t\tgocv.Line(&mat, pt1, pt2, color.RGBA{0, 255, 0, 50}, 10)\n\t}\n\n\tfor {\n\t\twindow.IMShow(mat)\n\t\tif window.WaitKey(10) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/gstreamer-writer/main.go",
    "content": "/*\n\tGStreamer Video Writer\n\nWhat it does:\n\n\tCaptures video from webcam and outputs the frames to a gocv VideoWriter\n\nHow to run:\n\n\tgo run main.go\n\nTo receive the video feed run in a terminal:\n\n\tgst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=MJPG ! rtpjpegdepay ! jpegdec !  videoconvert ! xvimagesink\n*/\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nconst (\n\tgstreamerPipe = \"appsrc ! videoconvert ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5000\"\n)\n\nfunc main() {\n\n\tcap, err := gocv.VideoCaptureDevice(0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer cap.Close()\n\tcap.Set(gocv.VideoCaptureFrameWidth, 640.0)\n\tcap.Set(gocv.VideoCaptureFrameHeight, 480.0)\n\n\twrt, err := gocv.VideoWriterFileWithAPI(gstreamerPipe,\n\t\tgocv.VideoCaptureGstreamer, \"YUY2\", 30.0, 640, 480, true)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer wrt.Close()\n\n\tif !wrt.IsOpened() {\n\t\tpanic(\"wrt is not opened\")\n\t}\n\n\tframe := gocv.NewMat()\n\tdefer frame.Close()\n\n\tfor {\n\t\tcap.Read(&frame)\n\n\t\tif frame.Empty() {\n\t\t\tfmt.Println(\"empty frame\")\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := wrt.Write(frame); err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "cmd/hand-gestures/main.go",
    "content": "// What it does:\n//\n// This example detects how many fingers you hold up in front of the camera.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/hand-gestures/main.go 0\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nconst MinimumArea = 3000\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\thand-gestures [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"Hand Gestures\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\timgGrey := gocv.NewMat()\n\tdefer imgGrey.Close()\n\n\timgBlur := gocv.NewMat()\n\tdefer imgBlur.Close()\n\n\timgThresh := gocv.NewMat()\n\tdefer imgThresh.Close()\n\n\thull := gocv.NewMat()\n\tdefer hull.Close()\n\n\tdefects := gocv.NewMat()\n\tdefer defects.Close()\n\n\tgreen := color.RGBA{0, 255, 0, 0}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// cleaning up image\n\t\tgocv.CvtColor(img, &imgGrey, gocv.ColorBGRToGray)\n\t\tgocv.GaussianBlur(imgGrey, &imgBlur, image.Pt(35, 35), 0, 0, gocv.BorderDefault)\n\t\tgocv.Threshold(imgBlur, &imgThresh, 0, 255, gocv.ThresholdBinaryInv+gocv.ThresholdOtsu)\n\n\t\t// now find biggest contour\n\t\tcontours := gocv.FindContours(imgThresh, gocv.RetrievalExternal, gocv.ChainApproxSimple)\n\t\tc := getBiggestContour(contours)\n\n\t\tgocv.ConvexHull(c, &hull, true, false)\n\t\tgocv.ConvexityDefects(c, hull, &defects)\n\n\t\tvar angle float64\n\t\tdefectCount := 0\n\t\tfor i := 0; i < defects.Rows(); i++ {\n\t\t\tstart := c.At(int(defects.GetIntAt(i, 0)))\n\t\t\tend := c.At(int(defects.GetIntAt(i, 1)))\n\t\t\tfar := c.At(int(defects.GetIntAt(i, 2)))\n\n\t\t\ta := math.Sqrt(math.Pow(float64(end.X-start.X), 2) + math.Pow(float64(end.Y-start.Y), 2))\n\t\t\tb := math.Sqrt(math.Pow(float64(far.X-start.X), 2) + math.Pow(float64(far.Y-start.Y), 2))\n\t\t\tc := math.Sqrt(math.Pow(float64(end.X-far.X), 2) + math.Pow(float64(end.Y-far.Y), 2))\n\n\t\t\t// apply cosine rule here\n\t\t\tangle = math.Acos((math.Pow(b, 2)+math.Pow(c, 2)-math.Pow(a, 2))/(2*b*c)) * 57\n\n\t\t\t// ignore angles > 90 and highlight rest with dots\n\t\t\tif angle <= 90 {\n\t\t\t\tdefectCount++\n\t\t\t\tgocv.Circle(&img, far, 1, green, 2)\n\t\t\t}\n\t\t}\n\n\t\tstatus := fmt.Sprintf(\"defectCount: %d\", defectCount+1)\n\n\t\trect := gocv.BoundingRect(c)\n\t\tgocv.Rectangle(&img, rect, color.RGBA{255, 255, 255, 0}, 2)\n\n\t\tgocv.PutText(&img, status, image.Pt(10, 20), gocv.FontHersheyPlain, 1.2, green, 2)\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) == 27 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc getBiggestContour(contours gocv.PointsVector) gocv.PointVector {\n\tvar area float64\n\tindex := 0\n\tfor i := 0; i < contours.Size(); i++ {\n\t\tnewArea := gocv.ContourArea(contours.At(i))\n\t\tif newArea > area {\n\t\t\tarea = newArea\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn contours.At(index)\n}\n"
  },
  {
    "path": "cmd/hello/main.go",
    "content": "package main\n\nimport (\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\twebcam, _ := gocv.OpenVideoCapture(0)\n\twindow := gocv.NewWindow(\"Hello\")\n\timg := gocv.NewMat()\n\n\tfor {\n\t\twebcam.Read(&img)\n\t\twindow.IMShow(img)\n\t\twindow.WaitKey(1)\n\t}\n}\n"
  },
  {
    "path": "cmd/img-similarity/main.go",
    "content": "// What it does:\n//\n// This example calculates perceptual hashes for a pair of images,\n// and prints the hashes and calculated similarity between them.\n// A variety of algorithms are supported.\n//\n// How to run:\n//\n// img-similarity [-flags] [image1.jpg] [image2.jpg]\n//\n// \t\tgo run ./cmd/img-similarity/main.go -all images/space_shuttle.jpg images/toy.jpg\n//\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"gocv.io/x/gocv\"\n\t\"gocv.io/x/gocv/contrib\"\n)\n\nvar (\n\tuseAll            = flag.Bool(\"all\", false, \"Compute all hashes\")\n\tusePHash          = flag.Bool(\"phash\", false, \"Compute PHash\")\n\tuseAverage        = flag.Bool(\"average\", false, \"Compute AverageHash\")\n\tuseBlockMean0     = flag.Bool(\"blockmean0\", false, \"Compute BlockMeanHash mode 0\")\n\tuseBlockMean1     = flag.Bool(\"blockmean1\", false, \"Compute BlockMeanHash mode 1\")\n\tuseColorMoment    = flag.Bool(\"colormoment\", false, \"Compute ColorMomentHash\")\n\tuseMarrHildreth   = flag.Bool(\"marrhildreth\", false, \"Compute MarrHildrethHash\")\n\tuseRadialVariance = flag.Bool(\"radialvariance\", false, \"Compute RadialVarianceHash\")\n)\n\nfunc setupHashes() []contrib.ImgHashBase {\n\tvar hashes []contrib.ImgHashBase\n\n\tif *usePHash || *useAll {\n\t\thashes = append(hashes, contrib.PHash{})\n\t}\n\tif *useAverage || *useAll {\n\t\thashes = append(hashes, contrib.AverageHash{})\n\t}\n\tif *useBlockMean0 || *useAll {\n\t\thashes = append(hashes, contrib.BlockMeanHash{})\n\t}\n\tif *useBlockMean1 || *useAll {\n\t\thashes = append(hashes, contrib.BlockMeanHash{Mode: contrib.BlockMeanHashMode1})\n\t}\n\tif *useColorMoment || *useAll {\n\t\thashes = append(hashes, contrib.ColorMomentHash{})\n\t}\n\tif *useMarrHildreth || *useAll {\n\t\t// MarrHildreth has default parameters for alpha/scale\n\t\thashes = append(hashes, contrib.NewMarrHildrethHash())\n\t}\n\tif *useRadialVariance || *useAll {\n\t\t// RadialVariance has default parameters too\n\t\thashes = append(hashes, contrib.NewRadialVarianceHash())\n\t}\n\n\t// If no hashes were selected, behave as if all hashes were selected\n\tif len(hashes) == 0 {\n\t\t*useAll = true\n\t\treturn setupHashes()\n\t}\n\n\treturn hashes\n}\n\nfunc main() {\n\tflag.Usage = func() {\n\t\tfmt.Println(\"How to run:\\n\\timg-similarity [-flags] [image1.jpg] [image2.jpg]\")\n\t\tflag.PrintDefaults()\n\t}\n\n\tprintHashes := flag.Bool(\"print\", false, \"print hash values\")\n\tflag.Parse()\n\tif flag.NArg() < 2 {\n\t\tflag.Usage()\n\t\treturn\n\t}\n\n\t// read images\n\tinputs := flag.Args()\n\timages := make([]gocv.Mat, len(inputs))\n\n\tfor i := 0; i < 2; i++ {\n\t\timg := gocv.IMRead(inputs[i], gocv.IMReadColor)\n\t\tif img.Empty() {\n\t\t\tfmt.Printf(\"cannot read image %s\\n\", inputs[i])\n\t\t\treturn\n\t\t}\n\t\tdefer img.Close()\n\n\t\timages[i] = img\n\t}\n\n\t// construct all of the hash types in a list. normally, you'd only use one of these.\n\thashes := setupHashes()\n\n\t// compute and compare the images for each hash type\n\tfor _, hash := range hashes {\n\t\tresults := make([]gocv.Mat, len(images))\n\n\t\tfor i, img := range images {\n\t\t\tresults[i] = gocv.NewMat()\n\t\t\tdefer results[i].Close()\n\t\t\thash.Compute(img, &results[i])\n\t\t\tif results[i].Empty() {\n\t\t\t\tfmt.Printf(\"error computing hash for %s\\n\", inputs[i])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\t// compare for similarity; this returns a float64, but the meaning of values is\n\t\t// unique to each algorithm.\n\t\tsimilar := hash.Compare(results[0], results[1])\n\n\t\t// make a pretty name for the hash\n\t\tname := strings.TrimPrefix(fmt.Sprintf(\"%T\", hash), \"contrib.\")\n\t\tfmt.Printf(\"%s: similarity %g\\n\", name, similar)\n\n\t\tif *printHashes {\n\t\t\t// print hash result for each image\n\t\t\tfor i, path := range inputs {\n\t\t\t\tfmt.Printf(\"\\t%s = %x\\n\", path, results[i].ToBytes())\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/kalman-filter/main.go",
    "content": "// What it does:\n//\n// This example implements the kalman filter example from:\n//\n//\thttps://docs.opencv.org/4.6.0/de/d70/samples_2cpp_2kalman_8cpp-example.html#_a7\n//\n// Tracking of rotating point.\n// Point moves in a circle and is characterized by a 1D state.\n//\n// state_k+1 = state_k + speed + process_noise N(0, 1e-5)\n//\n// The speed is constant.\n// Both state and measurements vectors are 1D (a point angle).\n// Measurement is the real state + gaussian noise N(0, 1e-1).\n// The real and the measured points are connected with red line segment.\n// The real and the estimated points are connected with yellow line segment.\n// The real and the corrected estimated points are connected with green line segment.\n//\n// If Kalman filter works correctly, the yellow segment should be shorter than\n// the red one andthe green segment should be shorter than the yellow one).\n//\n// Pressing any key (except ESC) will reset the tracking.\n// Pressing ESC will stop the program.\n//\n// How to run:\n//\n//\tgo run ./cmd/kalman-filter/main.go\npackage main\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nvar (\n\tcolorCyan   = color.RGBA{0, 255, 255, 1}\n\tcolorYellow = color.RGBA{255, 255, 0, 1}\n\tcolorGreen  = color.RGBA{0, 255, 0, 1}\n\tcolorRed    = color.RGBA{255, 0, 0, 1}\n\tcolorWhite  = color.RGBA{255, 255, 255, 1}\n\tcalcPoint   = func(center gocv.Point2f, R, angle float32) gocv.Point2f {\n\t\tx := float32(math.Cos(float64(angle))) * R\n\t\ty := -float32(math.Sin(float64(angle))) * R\n\t\treturn gocv.Point2f{X: center.X + x, Y: center.Y + y}\n\t}\n)\n\nfunc main() {\n\tvar code int\n\twindow := gocv.NewWindow(\"Kalman\")\n\timg := gocv.NewMatWithSize(500, 500, gocv.MatTypeCV8UC3)\n\tkf := gocv.NewKalmanFilterWithParams(2, 1, 0, gocv.MatTypeCV32F)\n\tstate := gocv.NewMatWithSize(2, 1, gocv.MatTypeCV32F)\n\tprocessNoise := gocv.NewMatWithSize(2, 1, gocv.MatTypeCV32F)\n\tmeasurement := gocv.Zeros(1, 1, gocv.MatTypeCV32F)\n\tfor {\n\t\timg = gocv.Zeros(500, 500, gocv.MatTypeCV8UC3)\n\t\tstate.SetFloatAt(0, 0, 0)\n\t\tstate.SetFloatAt(0, 1, 2*math.Pi/6)\n\t\ttransitionMatrix := gocv.NewMatWithSize(2, 2, gocv.MatTypeCV32F)\n\t\ttransitionMatrix.SetFloatAt(0, 0, 1)\n\t\ttransitionMatrix.SetFloatAt(0, 1, 1)\n\t\ttransitionMatrix.SetFloatAt(1, 0, 0)\n\t\ttransitionMatrix.SetFloatAt(1, 1, 1)\n\t\tkf.SetTransitionMatrix(transitionMatrix)\n\n\t\tgocv.SetIdentity(kf.GetMeasurementMatrix(), 1)\n\t\tgocv.SetIdentity(kf.GetProcessNoiseCov(), 1e-5)\n\t\tgocv.SetIdentity(kf.GetMeasurementNoiseCov(), 1e-1)\n\t\tgocv.SetIdentity(kf.GetErrorCovPost(), 1)\n\n\t\tstatePost := kf.GetStatePost()\n\t\tgocv.RandN(&statePost, gocv.NewScalar(0, 0, 0, 0), gocv.NewScalar(0.1, 0.1, 0.1, 0.1))\n\n\t\tfor {\n\t\t\tcenter := gocv.Point2f{X: float32(img.Cols()) * 0.5, Y: float32(img.Rows()) * 0.5}\n\t\t\tR := float32(img.Cols() / 3)\n\t\t\tstateAngle := state.GetFloatAt(0, 0)\n\t\t\tstatePt := calcPoint(center, R, stateAngle)\n\n\t\t\tprediction := kf.Predict()\n\t\t\tpredictAngle := prediction.GetFloatAt(0, 0)\n\t\t\tpredictPt := calcPoint(center, R, predictAngle)\n\n\t\t\t// generate measurement\n\t\t\tmeasNoiseCov := kf.GetMeasurementNoiseCov()\n\t\t\tnoise := float64(measNoiseCov.GetFloatAt(0, 0))\n\t\t\tgocv.RandN(&measurement, gocv.NewScalar(0, 0, 0, 0), gocv.NewScalar(noise, noise, noise, noise))\n\t\t\tmeasMatrix := kf.GetMeasurementMatrix()\n\t\t\tgocv.Add(measurement, measMatrix.MultiplyMatrix(state), &measurement)\n\n\t\t\tmeasAngle := measurement.GetFloatAt(0, 0)\n\t\t\tmeasPt := calcPoint(center, R, measAngle)\n\n\t\t\t// correct the state estimates based on measurements\n\t\t\t// updates statePost & errorCovPost\n\t\t\tstatePost := kf.Correct(measurement)\n\t\t\timprovedAngle := statePost.GetFloatAt(0, 0)\n\t\t\timprovedPt := calcPoint(center, R, improvedAngle)\n\n\t\t\t// plot points\n\t\t\timg.MultiplyFloat(0.2)\n\t\t\tgocv.Circle(&img, image.Point{int(measPt.X), int(measPt.Y)}, 1, colorRed, 3)\n\t\t\tgocv.Circle(&img, image.Point{int(predictPt.X), int(predictPt.Y)}, 1, colorYellow, 3)\n\t\t\tgocv.Circle(&img, image.Point{int(improvedPt.X), int(improvedPt.Y)}, 1, colorGreen, 3)\n\t\t\tgocv.Circle(&img, image.Point{int(statePt.X), int(statePt.Y)}, 1, colorWhite, 4)\n\n\t\t\t// forecast one step\n\t\t\ttest := transitionMatrix.MultiplyMatrix(kf.GetStatePost())\n\t\t\tnewPt := calcPoint(center, R, test.GetFloatAt(0, 0))\n\t\t\tgocv.Circle(&img, image.Point{int(newPt.X), int(newPt.Y)}, 1, colorCyan, 6)\n\n\t\t\tgocv.Line(&img, image.Point{int(statePt.X), int(statePt.Y)}, image.Point{int(measPt.X), int(measPt.Y)}, colorRed, 1)\n\t\t\tgocv.Line(&img, image.Point{int(statePt.X), int(statePt.Y)}, image.Point{int(predictPt.X), int(predictPt.Y)}, colorYellow, 1)\n\t\t\tgocv.Line(&img, image.Point{int(statePt.X), int(statePt.Y)}, image.Point{int(improvedPt.X), int(improvedPt.Y)}, colorGreen, 1)\n\n\t\t\tnoiseCovMat := kf.GetProcessNoiseCov()\n\t\t\tnoiseCov := math.Sqrt(float64(noiseCovMat.GetFloatAt(0, 0)))\n\t\t\tgocv.RandN(&processNoise, gocv.Scalar{}, gocv.NewScalar(noiseCov, noiseCov, noiseCov, noiseCov))\n\t\t\ttxm := kf.GetTransitionMatrix()\n\t\t\tgocv.Add(txm.MultiplyMatrix(state), processNoise, &state)\n\n\t\t\twindow.IMShow(img)\n\t\t\tcode = window.WaitKey(1000)\n\t\t\tif code > 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif code == 27 || code == 'q' || code == 'Q' {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/mjpeg-streamer/main.go",
    "content": "// What it does:\n//\n// This example opens a video capture device, then streams MJPEG from it.\n// Once running point your browser to the hostname/port you passed in the\n// command line (for example http://localhost:8080) and you should see\n// the live video stream.\n//\n// How to run:\n//\n// mjpeg-streamer [camera ID] [host:port]\n//\n//\t\tgo get -u github.com/hybridgroup/mjpeg\n// \t\tgo run ./cmd/mjpeg-streamer/main.go 1 0.0.0.0:8080\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/hybridgroup/mjpeg\"\n\t\"gocv.io/x/gocv\"\n)\n\nvar (\n\tdeviceID int\n\terr      error\n\twebcam   *gocv.VideoCapture\n\tstream   *mjpeg.Stream\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tmjpeg-streamer [camera ID] [host:port]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\thost := os.Args[2]\n\n\t// open webcam\n\twebcam, err = gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// create the mjpeg stream\n\tstream = mjpeg.NewStream()\n\n\t// start capturing\n\tgo mjpegCapture()\n\n\tfmt.Println(\"Capturing. Point your browser to \" + host)\n\n\t// start http server\n\thttp.Handle(\"/\", stream)\n\n\tserver := &http.Server{\n\t\tAddr:         host,\n\t\tReadTimeout:  60 * time.Second,\n\t\tWriteTimeout: 60 * time.Second,\n\t}\n\n\tlog.Fatal(server.ListenAndServe())\n}\n\nfunc mjpegCapture() {\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tbuf, _ := gocv.IMEncode(\".jpg\", img)\n\t\tstream.UpdateJPEG(buf.GetBytes())\n\t\tbuf.Close()\n\t}\n}\n"
  },
  {
    "path": "cmd/motion-detect/main.go",
    "content": "// What it does:\n//\n// This example detects motion using a delta threshold from the first frame,\n// and then finds contours to determine where the object is located.\n//\n// Very loosely based on Adrian Rosebrock code located at:\n// http://www.pyimagesearch.com/2015/06/01/home-surveillance-and-motion-detection-with-the-raspberry-pi-python-and-opencv/\n//\n// How to run:\n//\n// \t\tgo run ./cmd/motion-detect/main.go 0\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nconst MinimumArea = 3000\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tmotion-detect [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"Motion Window\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\timgDelta := gocv.NewMat()\n\tdefer imgDelta.Close()\n\n\timgThresh := gocv.NewMat()\n\tdefer imgThresh.Close()\n\n\tmog2 := gocv.NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tstatus := \"Ready\"\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tstatus = \"Ready\"\n\t\tstatusColor := color.RGBA{0, 255, 0, 0}\n\n\t\t// first phase of cleaning up image, obtain foreground only\n\t\tmog2.Apply(img, &imgDelta)\n\n\t\t// remaining cleanup of the image to use for finding contours.\n\t\t// first use threshold\n\t\tgocv.Threshold(imgDelta, &imgThresh, 25, 255, gocv.ThresholdBinary)\n\n\t\t// then dilate\n\t\tkernel := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(3, 3))\n\t\tgocv.Dilate(imgThresh, &imgThresh, kernel)\n\t\tkernel.Close()\n\n\t\t// now find contours\n\t\tcontours := gocv.FindContours(imgThresh, gocv.RetrievalExternal, gocv.ChainApproxSimple)\n\n\t\tfor i := 0; i < contours.Size(); i++ {\n\t\t\tarea := gocv.ContourArea(contours.At(i))\n\t\t\tif area < MinimumArea {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tstatus = \"Motion detected\"\n\t\t\tstatusColor = color.RGBA{255, 0, 0, 0}\n\t\t\tgocv.DrawContours(&img, contours, i, statusColor, 2)\n\n\t\t\trect := gocv.BoundingRect(contours.At(i))\n\t\t\tgocv.Rectangle(&img, rect, color.RGBA{0, 0, 255, 0}, 2)\n\t\t}\n\n\t\tcontours.Close()\n\n\t\tgocv.PutText(&img, status, image.Pt(10, 20), gocv.FontHersheyPlain, 1.2, statusColor, 2)\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) == 27 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/openvino/ie/version/main.go",
    "content": "// What it does:\n//\n// \tThis program outputs the current OpenVINO IE library version to the console.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/openvino/ie/version/main.go\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"gocv.io/x/gocv\"\n\t\"gocv.io/x/gocv/openvino/ie\"\n)\n\nfunc main() {\n\tfmt.Printf(\"gocv version: %s\\n\", gocv.Version())\n\tfmt.Printf(\"OpenVINO Inference Engine version: %s\\n\", ie.Version())\n}\n"
  },
  {
    "path": "cmd/saveimage/main.go",
    "content": "// What it does:\n//\n// This example uses the VideoCapture class to capture a frame from a connected webcam,\n// then save it to an image file on disk.\n//\n// How to run:\n//\n// saveimage [camera ID] [image file]\n//\n// \t\tgo run ./cmd/saveimage/main.go 0 filename.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tsaveimage [camera ID] [image file]\")\n\t\treturn\n\t}\n\n\tdeviceID := os.Args[1]\n\tsaveFile := os.Args[2]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\tif ok := webcam.Read(&img); !ok {\n\t\tfmt.Printf(\"cannot read device %v\\n\", deviceID)\n\t\treturn\n\t}\n\tif img.Empty() {\n\t\tfmt.Printf(\"no image on device %v\\n\", deviceID)\n\t\treturn\n\t}\n\n\tgocv.IMWrite(saveFile, img)\n}\n"
  },
  {
    "path": "cmd/savevideo/main.go",
    "content": "// What it does:\n//\n// This example uses the VideoCapture class to capture AVI video from a connected webcam,\n// then saves 100 frames to a video file on disk.\n//\n// How to run:\n//\n// savevideo [camera ID] [video file]\n//\n// \t\tgo run ./cmd/savevideo/main.go 0 testvideo.avi\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\n\\tsavevideo [camera ID] [video file]\")\n\t\treturn\n\t}\n\n\tdeviceID := os.Args[1]\n\tsaveFile := os.Args[2]\n\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\tif ok := webcam.Read(&img); !ok {\n\t\tfmt.Printf(\"Cannot read device %v\\n\", deviceID)\n\t\treturn\n\t}\n\n\twriter, err := gocv.VideoWriterFile(saveFile, \"MJPG\", 25, img.Cols(), img.Rows(), true)\n\tif err != nil {\n\t\tfmt.Printf(\"error opening video writer device: %v\\n\", saveFile)\n\t\treturn\n\t}\n\tdefer writer.Close()\n\n\tfor i := 0; i < 100; i++ {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\twriter.Write(img)\n\t}\n}\n"
  },
  {
    "path": "cmd/showimage/main.go",
    "content": "// What it does:\n//\n// This example uses the Window class to open an image file, and then display\n// the image in a Window class.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/showimage/main.go /home/ron/Pictures/mcp23017.jpg\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tshowimage [imgfile]\")\n\t\treturn\n\t}\n\n\tfilename := os.Args[1]\n\twindow := gocv.NewWindow(\"Hello\")\n\timg := gocv.IMRead(filename, gocv.IMReadColor)\n\tif img.Empty() {\n\t\tfmt.Printf(\"Error reading image from: %v\\n\", filename)\n\t\treturn\n\t}\n\tfor {\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/ssd-facedetect/main.go",
    "content": "// What it does:\n//\n// This example shows, how to use pretrained SSD (Single Shot Detection) detection networks in gocv.\n// Here, we detect human faces from the camera, but the setup is similar for any other kind of object detection.\n//\n// Download the (small, 5.1mb) Caffe model file from:\n// https://raw.githubusercontent.com/opencv/opencv_3rdparty/dnn_samples_face_detector_20180205_fp16/res10_300x300_ssd_iter_140000_fp16.caffemodel\n//\n// Also, you will need the prototxt file:\n// https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt\n//\n// How to run:\n//\n// \t\tgo run ./cmd/ssd-facedetect/main.go 0 [protofile] [modelfile]\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc min(a, b float32) float32 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b float32) float32 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Println(\"How to run:\\nssd-facedetect [camera ID] [protofile] [modelfile]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tproto := os.Args[2]\n\tmodel := os.Args[3]\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"SSD Face Detection\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN classifier\n\tnet := gocv.ReadNetFromCaffe(proto, model)\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v %v\\n\", proto, model)\n\t\treturn\n\t}\n\tdefer net.Close()\n\n\tgreen := color.RGBA{0, 255, 0, 0}\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tW := float32(img.Cols())\n\t\tH := float32(img.Rows())\n\n\t\t// convert image Mat to 300x300 blob that the detector can analyze\n\t\tblob := gocv.BlobFromImage(img, 1.0, image.Pt(300, 300), gocv.NewScalar(104.0, 177.0, 123.0, 0), false, false)\n\t\tdefer blob.Close()\n\n\t\t// feed the blob into the classifier\n\t\tnet.SetInput(blob, \"data\")\n\n\t\t// run a forward pass through the network\n\t\tdetBlob := net.Forward(\"detection_out\")\n\t\tdefer detBlob.Close()\n\n\t\t// extract the detections.\n\t\t// for each object detected, there will be 7 float features:\n\t\t// objid, classid, confidence, left, top, right, bottom.\n\t\tdetections := gocv.GetBlobChannel(detBlob, 0, 0)\n\t\tdefer detections.Close()\n\n\t\tfor r := 0; r < detections.Rows(); r++ {\n\t\t\t// you would want the classid for general object detection,\n\t\t\t// but we do not need it here.\n\t\t\t// classid := detections.GetFloatAt(r, 1)\n\n\t\t\tconfidence := detections.GetFloatAt(r, 2)\n\t\t\tif confidence < 0.5 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tleft := detections.GetFloatAt(r, 3) * W\n\t\t\ttop := detections.GetFloatAt(r, 4) * H\n\t\t\tright := detections.GetFloatAt(r, 5) * W\n\t\t\tbottom := detections.GetFloatAt(r, 6) * H\n\n\t\t\t// scale to video size:\n\t\t\tleft = min(max(0, left), W-1)\n\t\t\tright = min(max(0, right), W-1)\n\t\t\tbottom = min(max(0, bottom), H-1)\n\t\t\ttop = min(max(0, top), H-1)\n\n\t\t\t// draw it\n\t\t\trect := image.Rect(int(left), int(top), int(right), int(bottom))\n\t\t\tgocv.Rectangle(&img, rect, green, 3)\n\t\t}\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/tf-classifier/main.go",
    "content": "// What it does:\n//\n// This example uses the Tensorflow (https://www.tensorflow.org/) deep learning framework\n// to classify whatever is in front of the camera.\n//\n// Download the Tensorflow \"Inception\" model and descriptions file from:\n// https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip\n//\n// Extract the tensorflow_inception_graph.pb model file from the .zip file.\n//\n// Also extract the imagenet_comp_graph_label_strings.txt file with the descriptions.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/tf-classifier/main.go 0 ~/Downloads/tensorflow_inception_graph.pb ~/Downloads/imagenet_comp_graph_label_strings.txt opencv cpu\n//\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tif len(os.Args) < 4 {\n\t\tfmt.Println(\"How to run:\\ntf-classifier [camera ID] [modelfile] [descriptionsfile]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tdescr := os.Args[3]\n\tdescriptions, err := readDescriptions(descr)\n\tif err != nil {\n\t\tfmt.Printf(\"Error reading descriptions file: %v\\n\", descr)\n\t\treturn\n\t}\n\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 4 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[4])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 5 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[5])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"Tensorflow Classifier\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN classifier\n\tnet := gocv.ReadNet(model, \"\")\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model : %v\\n\", model)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\tstatus := \"Ready\"\n\tstatusColor := color.RGBA{0, 255, 0, 0}\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// convert image Mat to 224x224 blob that the classifier can analyze\n\t\tblob := gocv.BlobFromImage(img, 1.0, image.Pt(224, 224), gocv.NewScalar(0, 0, 0, 0), true, false)\n\n\t\t// feed the blob into the classifier\n\t\tnet.SetInput(blob, \"input\")\n\n\t\t// run a forward pass thru the network\n\t\tprob := net.Forward(\"softmax2\")\n\n\t\t// reshape the results into a 1x1000 matrix\n\t\tprobMat := prob.Reshape(1, 1)\n\n\t\t// determine the most probable classification\n\t\t_, maxVal, _, maxLoc := gocv.MinMaxLoc(probMat)\n\n\t\t// display classification\n\t\tdesc := \"Unknown\"\n\t\tif maxLoc.X < 1000 {\n\t\t\tdesc = descriptions[maxLoc.X]\n\t\t}\n\t\tstatus = fmt.Sprintf(\"description: %v, maxVal: %v\\n\", desc, maxVal)\n\t\tgocv.PutText(&img, status, image.Pt(10, 20), gocv.FontHersheyPlain, 1.2, statusColor, 2)\n\n\t\tblob.Close()\n\t\tprob.Close()\n\t\tprobMat.Close()\n\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// readDescriptions reads the descriptions from a file\n// and returns a slice of its lines.\nfunc readDescriptions(path string) ([]string, error) {\n\tfile, err := os.Open(filepath.Clean(path))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\t_ = file.Close()\n\t}()\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\treturn lines, scanner.Err()\n}\n"
  },
  {
    "path": "cmd/tracking/main.go",
    "content": "// What it does:\n//\n// This example uses one of the Tracker classes from opencv_contrib to track a region of interest (e.g. a face)\n// and draws a rectangle around it, before displaying it within a Window.\n//\n// in this example, users have to select an initial roi with the mouse, and press enter, to start the tracking\n// (but the roi could also come from e.g. a previous cascade based detection)\n//\n// also see https://docs.opencv.org/master/d2/d0a/tutorial_introduction_to_tracker.html for a tutorial\n//\n// How to run:\n//\n// tracking [camera ID]\n//\n// \t\tgo run ./cmd/tracking/main.go 0\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n\t\"gocv.io/x/gocv/contrib\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\ttracking [camera ID]\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\n\t// open webcam\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\t// open display window\n\twindow := gocv.NewWindow(\"Tracking\")\n\tdefer window.Close()\n\n\t// create a tracker instance\n\t// (one of MIL, KCF, TLD, MedianFlow, Boosting, MOSSE or CSRT)\n\ttracker := contrib.NewTrackerKCF()\n\tdefer tracker.Close()\n\n\t// prepare image matrix\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// read an initial image\n\tif ok := webcam.Read(&img); !ok {\n\t\tfmt.Printf(\"cannot read device %v\\n\", deviceID)\n\t\treturn\n\t}\n\n\t// let the user mark a ROI to track\n\trect := gocv.SelectROI(\"Tracking\", img)\n\tif rect.Max.X == 0 {\n\t\tfmt.Printf(\"user cancelled roi selection\\n\")\n\t\treturn\n\t}\n\n\t// initialize the tracker with the image & the selected roi\n\tinit := tracker.Init(img, rect)\n\tif !init {\n\t\tfmt.Printf(\"Could not initialize the Tracker\")\n\t\treturn\n\t}\n\n\t// color for the rect to draw\n\tblue := color.RGBA{0, 0, 255, 0}\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// update the roi\n\t\trect, _ := tracker.Update(img)\n\n\t\t// draw it.\n\t\tgocv.Rectangle(&img, rect, blue, 3)\n\n\t\t// show the image in the window, and wait 10 millisecond\n\t\twindow.IMShow(img)\n\t\tif window.WaitKey(10) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/version/main.go",
    "content": "// What it does:\n//\n// \tThis program outputs the current OpenCV library version to the console.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/version/main.go\n//\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc main() {\n\tfmt.Printf(\"gocv version: %s\\n\", gocv.Version())\n\tfmt.Printf(\"opencv lib version: %s\\n\", gocv.OpenCVVersion())\n}\n"
  },
  {
    "path": "cmd/xphoto/main.go",
    "content": "// What it does:\n//\n// This example demonstrates a couple of uses of the XPhoto module.\n// It can use the GrayworldWB class with BalanceWhite image\n// to save an image file on disk.\n//\n// This example can also use the Inpaint functions with inpaint algorithms type\n// to save an image file on disk.\n//\n// How to run:\n//\n// \t\tgo run ./cmd/xphoto/main.go -i -g\n//\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n\t\"gocv.io/x/gocv/contrib\"\n)\n\nfunc Inpaint() {\n\n\tjpgImage := gocv.IMRead(\"./images/space_shuttle.jpg\", gocv.IMReadColor)\n\n\tif jpgImage.Empty() {\n\t\tfmt.Printf(\"Invalid read of Source Mat in TestInpaint test\\n\")\n\t\treturn\n\t}\n\n\tsrc := gocv.NewMat()\n\tdefer src.Close()\n\tsizeImage := jpgImage.Size()\n\tjpgImage.ConvertTo(&src, gocv.MatTypeCV8UC3)\n\n\tmaskFsrFast := gocv.NewMatWithSizes(sizeImage, gocv.MatTypeCV8UC1)\n\tdefer maskFsrFast.Close()\n\n\tdstShitMap := gocv.NewMat()\n\tdefer dstShitMap.Close()\n\tcontrib.Inpaint(&src, &maskFsrFast, &dstShitMap, contrib.FsrFast)\n\n\tdstFsrFast := gocv.NewMat()\n\tdefer dstFsrFast.Close()\n\tcontrib.Inpaint(&src, &maskFsrFast, &dstFsrFast, contrib.FsrFast)\n\n\tdstFsrBest := gocv.NewMat()\n\tdefer dstFsrBest.Close()\n\tcontrib.Inpaint(&src, &maskFsrFast, &dstFsrBest, contrib.FsrFast)\n\n\tif dstShitMap.Empty() || dstShitMap.Rows() != src.Rows() || dstShitMap.Cols() != src.Cols() || dstShitMap.Type() != src.Type() {\n\t\tfmt.Printf(\"Invlalid TestInpaint ShitMap test\\n\")\n\t\treturn\n\t}\n\tfmt.Printf(\"ShitMap : MAT %d <> %d : %d\\n\", dstShitMap.Rows(), src.Rows(), dstShitMap.Type())\n\tgocv.IMWrite(\"ShitMap_inpaint.png\", dstShitMap)\n\n\tif dstFsrFast.Empty() || dstFsrFast.Rows() != src.Rows() || dstFsrFast.Cols() != src.Cols() || dstFsrFast.Type() != src.Type() {\n\t\tfmt.Printf(\"Invlalid TestInpaint FsrFast test\\n\")\n\t\treturn\n\t}\n\tfmt.Printf(\"FsrFast : MAT %d <> %d : %d\\n\", dstFsrFast.Rows(), src.Rows(), dstFsrFast.Type())\n\tgocv.IMWrite(\"FsrFast_inpaint.png\", dstFsrFast)\n\n\tif dstFsrBest.Empty() || dstFsrBest.Rows() != src.Rows() || dstFsrBest.Cols() != src.Cols() || dstFsrBest.Type() != src.Type() {\n\t\tfmt.Printf(\"Invlalid TestInpaint FsrBest test\\n\")\n\t\treturn\n\t}\n\tfmt.Printf(\"FsrBest : MAT %d <> %d : %d\\n\", dstFsrBest.Rows(), src.Rows(), dstFsrBest.Type())\n\tgocv.IMWrite(\"FsrBest_inpaint.png\", dstFsrBest)\n\n}\n\nfunc BalanceWhite() {\n\n\tfileGrayWorld := \"grayworld_space_shuttle.png\"\n\tsrc := gocv.IMRead(\"./images/space_shuttle.jpg\", gocv.IMReadColor)\n\n\tif src.Empty() {\n\t\tfmt.Printf(\"Invalid read of Source Mat in TestInpaint test\\n\")\n\t\treturn\n\t}\n\tdefer src.Close()\n\n\tfmt.Println(\"using GrayworldWB with white balance function\")\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tgrayworldwb := contrib.NewGrayworldWB()\n\tdefer grayworldwb.Close()\n\n\tgrayworldwb.SetSaturationThreshold(0.7)\n\tgrayworldwb.BalanceWhite(src, &dst)\n\n\tgocv.IMWrite(fileGrayWorld, dst)\n}\n\nfunc main() {\n\n\tif len(os.Args) < 2 {\n\t\tfmt.Println(\"How to run:\\n\\tmain [-i] [-b]\")\n\t\treturn\n\t}\n\tbalanceWhitePtr := flag.Bool(\"b\", false, \"GrayworldWB functions\")\n\tinpaintPtr := flag.Bool(\"i\", false, \"Inpaint functions\")\n\tflag.Parse()\n\n\tif *balanceWhitePtr {\n\t\tBalanceWhite()\n\t}\n\n\tif *inpaintPtr {\n\t\tInpaint()\n\t}\n\n}\n"
  },
  {
    "path": "cmd/yolo-detection/main.go",
    "content": "// What it does:\n//\n// This example uses the YOLOv8 deep neural network to perform object detection.\n//\n// Download the ONNX model file from the following notebook:\n//\n// https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb\n//\n// How to run:\n//\n//\tgo run ./cmd/yolo-detection/ [videosource] [modelfile] ([backend] [device])\npackage main\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// COCONet class names\nvar classes = []string{\n\t\"person\", \"bicycle\", \"car\", \"motorcycle\", \"airplane\", \"bus\", \"train\", \"truck\", \"boat\",\n\t\"traffic light\", \"fire hydrant\", \"stop sign\", \"parking meter\", \"bench\", \"bird\", \"cat\", \"dog\", \"horse\",\n\t\"sheep\", \"cow\", \"elephant\", \"bear\", \"zebra\", \"giraffe\", \"backpack\", \"umbrella\", \"handbag\", \"tie\",\n\t\"suitcase\", \"frisbee\", \"skis\", \"snowboard\", \"sports ball\", \"kite\", \"baseball bat\", \"baseball glove\",\n\t\"skateboard\", \"surfboard\", \"tennis racket\", \"bottle\", \"wine glass\", \"cup\", \"fork\", \"knife\", \"spoon\",\n\t\"bowl\", \"banana\", \"apple\", \"sandwich\", \"orange\", \"broccoli\", \"carrot\", \"hot dog\", \"pizza\", \"donut\",\n\t\"cake\", \"chair\", \"couch\", \"potted plant\", \"bed\", \"dining table\", \"toilet\", \"tv\", \"laptop\", \"mouse\",\n\t\"remote\", \"keyboard\", \"cell phone\", \"microwave\", \"oven\", \"toaster\", \"sink\", \"refrigerator\", \"book\",\n\t\"clock\", \"vase\", \"scissors\", \"teddy bear\", \"hair drier\", \"toothbrush\",\n}\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Println(\"How to run:\\nyolo-detection [videosource] [modelfile] ([backend] [device])\")\n\t\treturn\n\t}\n\n\t// parse args\n\tdeviceID := os.Args[1]\n\tmodel := os.Args[2]\n\tbackend := gocv.NetBackendDefault\n\tif len(os.Args) > 3 {\n\t\tbackend = gocv.ParseNetBackend(os.Args[3])\n\t}\n\n\ttarget := gocv.NetTargetCPU\n\tif len(os.Args) > 4 {\n\t\ttarget = gocv.ParseNetTarget(os.Args[4])\n\t}\n\n\t// open capture device\n\twebcam, err := gocv.OpenVideoCapture(deviceID)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening video capture device: %v\\n\", deviceID)\n\t\treturn\n\t}\n\tdefer webcam.Close()\n\n\twindow := gocv.NewWindow(\"YOLO Detection\")\n\tdefer window.Close()\n\n\timg := gocv.NewMat()\n\tdefer img.Close()\n\n\t// open DNN object tracking model\n\tnet := gocv.ReadNetFromONNX(model)\n\tif net.Empty() {\n\t\tfmt.Printf(\"Error reading network model from : %v\\n\", model)\n\t\treturn\n\t}\n\tdefer net.Close()\n\tnet.SetPreferableBackend(gocv.NetBackendType(backend))\n\tnet.SetPreferableTarget(gocv.NetTargetType(target))\n\n\toutputNames := getOutputNames(&net)\n\tif len(outputNames) == 0 {\n\t\tfmt.Println(\"Error reading output layer names\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Start reading device: %v\\n\", deviceID)\n\n\tfor {\n\t\tif ok := webcam.Read(&img); !ok {\n\t\t\tfmt.Printf(\"Device closed: %v\\n\", deviceID)\n\t\t\treturn\n\t\t}\n\t\tif img.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tdetect(&net, &img, outputNames)\n\n\t\twindow.IMShow(img)\n\n\t\tif window.WaitKey(1) >= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nvar (\n\tratio    = 0.003921568627\n\tmean     = gocv.NewScalar(0, 0, 0, 0)\n\tswapRGB  = false\n\tpadValue = gocv.NewScalar(144.0, 0, 0, 0)\n\n\tscoreThreshold float32 = 0.5\n\tnmsThreshold   float32 = 0.4\n)\n\nfunc detect(net *gocv.Net, src *gocv.Mat, outputNames []string) {\n\tparams := gocv.NewImageToBlobParams(ratio, image.Pt(640, 640), mean, swapRGB, gocv.MatTypeCV32F, gocv.DataLayoutNCHW, gocv.PaddingModeLetterbox, padValue)\n\tblob := gocv.BlobFromImageWithParams(*src, params)\n\tdefer blob.Close()\n\n\t// feed the blob into the detector\n\tnet.SetInput(blob, \"\")\n\n\t// run a forward pass thru the network\n\tprobs := net.ForwardLayers(outputNames)\n\tdefer func() {\n\t\tfor _, prob := range probs {\n\t\t\tprob.Close()\n\t\t}\n\t}()\n\n\tboxes, confidences, classIds := performDetection(probs)\n\tif len(boxes) == 0 {\n\t\tfmt.Println(\"No classes detected\")\n\t\treturn\n\t}\n\n\tiboxes := params.BlobRectsToImageRects(boxes, image.Pt(src.Cols(), src.Rows()))\n\tindices := gocv.NMSBoxes(iboxes, confidences, scoreThreshold, nmsThreshold)\n\tdrawRects(src, iboxes, classes, classIds, indices)\n}\n\nfunc getOutputNames(net *gocv.Net) []string {\n\tvar outputLayers []string\n\tfor _, i := range net.GetUnconnectedOutLayers() {\n\t\tlayer := net.GetLayer(i)\n\t\tlayerName := layer.GetName()\n\t\tif layerName != \"_input\" {\n\t\t\toutputLayers = append(outputLayers, layerName)\n\t\t}\n\t}\n\n\treturn outputLayers\n}\n\nfunc performDetection(outs []gocv.Mat) ([]image.Rectangle, []float32, []int) {\n\tvar classIds []int\n\tvar confidences []float32\n\tvar boxes []image.Rectangle\n\n\tif len(outs) == 0 || outs[0].Empty() {\n\t\treturn boxes, confidences, classIds\n\t}\n\n\t// transpose outs[0] safely, don't overwrite it in-place without closing the old one to avoid memory leak\n\ttmp := gocv.NewMat()\n\t// needed for yolov8: transpose (1, 84, N) -> (1, N, 84)\n\tgocv.TransposeND(outs[0], []int{0, 2, 1}, &tmp)\n\n\touts[0].Close() // free the old underlying cv::Mat\n\touts[0] = tmp   // take ownership of the new transposed Mat\n\n\tfor _, out := range outs {\n\t\tif out.Empty() {\n\t\t\tcontinue\n\t\t}\n\n\t\tout = out.Reshape(1, out.Size()[1])\n\n\t\tfor i := 0; i < out.Rows(); i++ {\n\t\t\tcols := out.Cols()\n\t\t\tscoresCol := out.RowRange(i, i+1)\n\n\t\t\tscores := scoresCol.ColRange(4, cols)\n\t\t\t_, confidence, _, classIDPoint := gocv.MinMaxLoc(scores)\n\n\t\t\tscores.Close()\n\t\t\tscoresCol.Close()\n\n\t\t\tif confidence > 0.5 {\n\t\t\t\t// get cx,cy,w,h at columns 0..3\n\t\t\t\tcenterX := out.GetFloatAt(i, 0)\n\t\t\t\tcenterY := out.GetFloatAt(i, 1)\n\t\t\t\twidth := out.GetFloatAt(i, 2)\n\t\t\t\theight := out.GetFloatAt(i, 3)\n\n\t\t\t\tleft := centerX - width/2\n\t\t\t\ttop := centerY - height/2\n\t\t\t\tright := centerX + width/2\n\t\t\t\tbottom := centerY + height/2\n\t\t\t\tclassIds = append(classIds, classIDPoint.X)\n\t\t\t\tconfidences = append(confidences, float32(confidence))\n\n\t\t\t\tboxes = append(boxes, image.Rect(int(left), int(top), int(right), int(bottom)))\n\t\t\t}\n\t\t}\n\n\t\tout.Close()\n\t}\n\n\treturn boxes, confidences, classIds\n}\n\nfunc drawRects(img *gocv.Mat, boxes []image.Rectangle, classes []string, classIds []int, indices []int) []string {\n\tvar detectClass []string\n\tfor _, idx := range indices {\n\t\t// Don't skip idx==0; it's a valid index from NMSBoxes\n\t\tif idx < 0 || idx >= len(boxes) || idx >= len(classIds) {\n\t\t\tcontinue\n\t\t}\n\t\tgocv.Rectangle(img, image.Rect(boxes[idx].Min.X, boxes[idx].Min.Y, boxes[idx].Max.X, boxes[idx].Max.Y), color.RGBA{0, 255, 0, 0}, 2)\n\t\tgocv.PutText(img, classes[classIds[idx]], image.Point{boxes[idx].Min.X, boxes[idx].Min.Y - 10}, gocv.FontHersheyPlain, 0.6, color.RGBA{0, 255, 0, 0}, 1)\n\t\tdetectClass = append(detectClass, classes[classIds[idx]])\n\t}\n\n\treturn detectClass\n}\n"
  },
  {
    "path": "codecov.yml",
    "content": "ignore:\n  - \"*_string.go\"\n  - \"*/*_string.go\"\n"
  },
  {
    "path": "contrib/README.md",
    "content": "# Using OpenCV Contrib\n\nThe OpenCV Contrib library contains experimental or non-free (aka patented) algorithms.\n\nGoCV support for OpenCV Contrib can be found here in the \"gocv.io/x/gocv/contrib\" package.\n\nFor more information about OpenCV Contrib, please go to:\n\nhttps://github.com/opencv/opencv_contrib\n\n## How to use\n\nIf you have followed the installation instructions from the main README, then the OpenCV contrib modules have already been compiled and installed.\n\nFirst, you must include the `contrib` subpackage:\n\n```go\nimport (\n    \"gocv.io/x/gocv\"\n    \"gocv.io/x/gocv/contrib\"\n)\n```\n\nThen you will be able to use the functions within the `contrib` subpackage. For example, this uses the `SIFT` feature identitification algorithm that is within the `xfeatures2d` module of OpenCV:\n\n```go\nsi := contrib.NewSIFT()\nkp := si.Detect(img)\n```\n\nNote that some of the features in this package require building OpenCV with the `OPENCV_ENABLE_NONFREE=ON` option. You can run `make build_nonfree` to build with this option.\n"
  },
  {
    "path": "contrib/att_faces/README",
    "content": "The ORL face database\n---------------------\n\nThis directory contains a set of faces taken between April 1992 and\nApril 1994 at the Olivetti Research Laboratory in Cambridge, UK.\n\nThere are 10 different images of 40 distinct subjects. For some of the\nsubjects, the images were taken at different times, varying lighting\nslightly, facial expressions (open/closed eyes, smiling/non-smiling)\nand facial details (glasses/no-glasses).  All the images are taken\nagainst a dark homogeneous background and the subjects are in\nup-right, frontal position (with tolerance for some side movement).\n\nThe files are in PGM format and can be conveniently viewed using the 'xv'\nprogram. The size of each image is 92x112, 8-bit grey levels. The images\nare organised in 40 directories (one for each subject) named as:\n\n\t\tsX\n\nwhere X indicates the subject number (between 1 and 40). In each directory\nthere are 10 different images of the selected subject named as:\n\n\t\tY.pgm\n\nwhere Y indicates which image for the specific subject (between 1 and 10).\n\nWhen using these images, please give credit to Olivetti Research Laboratory.\nA convenient reference is the face recognition work which uses some of\nthese images:\n\n F. Samaria and A. Harter \n  \"Parameterisation of a stochastic model for human face identification\"\n  2nd IEEE Workshop on Applications of Computer Vision\n  December 1994, Sarasota (Florida).\n\nThe paper is available via anonymous ftp from quince.cam-orl.co.uk and is\nstored in pub/users/fs/IEEE_workshop.ps.Z\n\nIf you have any question, please email Ferdinando Samaria: fs@cam-orl.co.uk\n"
  },
  {
    "path": "contrib/att_faces/s1/1.pgm",
    "content": "P5\n92 112\n255\n01-/19'*515<L[c_PKB6/12+.5=FTin^Qk_P97BVPJAG>T4JGC@XDGKB9=>4/2:<@B9.6BPPDGW@MBSM:.)+873886-4'.8-'/0('2,EFCH;343045@KQUbnkmeP]^L:QNSNHM<J=KOJ@]CEF532;73///==>/,@KN:BRQVIFD9/&''35423-2*33-(0,%$%,14+83/,.=HMOUdkozv{qoUPPSE>IdSVPILCEPWOUDH87/+-1+49@G;7/->PLPP[X^RF?64/)!130521.//2/*-(,==1A>=6CM=579@D>GapYqqgQ^JIKK@K_`][POIDSRVVCK:5178557:A9:502>ZWY_\\XZ[TOH9.'#\u001f++23../00,+,<62EHB?>0A96';JE@MTRXa\\Z{_SDMEGHGM_ei\\OXORVR\\TNI:8=DLQU]S<.1/08=`VUZWRSFQQH@+.\u001f\"&)50/-03,#)18>8GDAC2$7+,6CGGGVZ]FCPRTtKQEQDOMSbpsXQfbTeXc^VL<AJ]\\]^chZKA3;9<UTP@QHLEAE<5/'\"!'+35-0.2!%*3<=D=<8:)\"$'?UQ>:ELSHE9EUNZ^VEIPO\\Xqyj`_sd\\fYo[TF>J_ce]_a\\aUGDG;?MWMDOH7:BDB5-.$# .50/1/7(\u001f64A<G;,+5$'+GQF?4<XSVKC9C\\ZKb`VTVTeXrfcjpde]ju[QMEJUhshe]YSSVTNF;H]THG@;<A;1565*!%\"310029%3>.07@2)$+\"%.MaTBDV[SG\\MDNIkVSgVaYfbikumpvnpa_pledZXQT`eehc[\\\\VPOG?DTFBC?>8>1<4<4@,$'-15.27)9.;G4<,,)%#(9U\\GLNTOONRl_`agc][h[_efkprsvvnq||wrh_VNR\\ecc]SX[XIC?AQOH=8-85/2@<33=0'234017'.8Y17-3$#),66FH?FBOVbcbiqzzrnnbfmkpy}~}|ykj`\\Xd`m[UU`YTNRLQSLI@=6,-68:0/.1'-2216.$29((<26+))*3M\\QLN^dgny|{yx{}{xxmja`dQPY]_RSMUVOK>DA.%+16=/(0$4,5/:%-01463>88+35=W`UU`nt}~xtjdTRRabPSKONMDJ;8=+/9&4C1.#.041;'1/,G63:8<>:GOe[Zkr|{vZW]_d]OJHTJC<=4<9@=1*<63\")27/@*10259=;9>FLVhf]tw~qZgd_]THXJD>>15>8N@5*:*3\u001f,0.53/;-3(@OB7=MYeqjq}{ii_\\QXNYBDI6201BR;:)4( +*/188JII-'+850GOS_rz}ükYT^_bNQUEHE3DEBAG(%'\u001c--/3EA@+Q9+1264:NWk}~}_QXea]PQA8DE>?=7@&&\"\u001c-102>25.N??3:6BUhr÷wfmlmn^WK=DD:D*8C+!'\u001b,236.40*O:A@@4Mhw~{{xjYXGJ^3'-*H;/\u001e&.00643.(=4BGBIGf{}yi\\QMEN*&%1;1\u001a,210>51'**59EBJKgzi]LDFB6'(#-7\u001f22/0<6(#&%9;MHNXluZVDDH<+0)!7\u001e/231D1/\"#038GFYXk|yaYCLO>362$,#,5-1<-)\u001f*6>8@RT[mylZHIHA2;5*\"'-4,2;) &:2A9M[]bpyafJH@:9/0'9(*,/0=*$',-CAF^Zcqte[QCVA;.*$A1$3-.12/)$/3BPQTcp{c^GHMVO5''(/-,0/32@#)-FBJR]fo~gZD>IPF08&%!./2/.22#85JLJSX_m}h\\INBE3-01\u001f\u001d,/-/&3&*=6CCUX`bsymaSMM<*,*)$\"/1-/*8!+22;DV^clmXRJB5)*&(&#*20076\u001d053??RXgj}zl_QVJ7).$)&#220.<;0+);ICY^jnj_VLBH3&**\"%2//2C7*)%38J_hmvv^ZN555%8(*'22/-E/&%-*BLXkn}_^UM;1'*'*#620.=2\"+F)5@Pjt¿w`XFj9C)&&$\u001f.01-9?\u0017>R%2FXktžÿeQRM663($&\"/1.,.?\u001f-J 9MJeqÿſgF_@1,+-,'.-1../7&!=*6TJ`mNW92%.'2-,5-2124)\u001f)43LD\\nTZ73),-/0-4+0/57%\u001e2E4@8\\laG/44%5-/11*1117.\u0017CNA6@SxO>-%2,45/1714034+!0_C)GKxxzyy\\0&&2D,06235.1525\u001e+_='LL~}ulkpwqw}d0$#>C:2@412044/7!*X9-LP~yuty|~u|bH#-?676.M-11362:&%D@,ITmV415828.D8,/1641<#H=\u001fTSP<A7617VVB)/16QdK%K.!RU}}~qallAVCIOWv]5JA1C}B-+qQ@-+Qdļy\\cYMJ`^l~tsqzV{)I-vgT~k5E<H{,-LAGJljwYY?UbGxdhrkoUQ_3sCcNqxH@Oq_#YkLyke~JQ6Z[Mw]vyztsbfG|id|KKc M}SaN\\Zkyatxsxl[|wuX\\}PTzgcam}y}p}}||w|{yh|~uyyps}wzrƕ°~x|Ėõ~x|þPZ}}yq^~Uzpv{tiRr}vup{{yyp~y}}lz{u~nwbm<ūo~w(}9-z^$.\u0016{%/0'?ͷr9(..,#>R:(,.,13$&rüǴ{>)0.+,,5,/-'mĎwz^vT<-,--++//10++'?zyH;9/-))/+-*+/0(.+0(+=H_s(,*-)+*-++--*+-+++-(-, U +,*,-+,--*.--)-*.,+.+\u0011ÿÿ<$(+,,,(*,+,/0*,,+,-+/(\u001cL½z&'-*&*/'.*,*,.,++,(,+(/-&X#'+*-'-'.&*.+1++.-+)+)-.\u000e:$+**).%(,)++&./-+,&+++*0\u0014j})\",+(-+%))/'.)/.-,)+'.,*,#H` &)'()+*%*-,,)2,++,*,.+*0,\u001d¾B#($*%%+(((%+0(/,0/+(,+--).\u0016z}, &#,''(($()),)11/,0(--(*,. Dh\u001e'(*%$'*#**'(,*/1/,+.*0&,*--\u0014]\u001f$&&,$+(*$')&,(120./,,+(--+-\u001faÿ{ysk_bqponu~wxrrsqw}X (%*$-%%,$'&',*1.20)/+-,++-/+\u001bĸtnuupihg`geb^UU]VTUQX^\\[glr{T\u001e(''&*((''&')*,-251.0,).-)+.(\u001eeózx|vtrjpmmcg`cjddlrwU!&'%((($+')&'++.3/3(3),*/()0,'\u001dĵy{{xvu|w{}V!%%((($'&*$)()(212./0+0-,-+.))\u0017[\\\u001d!()&.('(-'((',15/0300//+*,)-(,\u001a\\\u001c$(''0%.+)-#-(,24//52-/0)-.)*-*\u0018Ƽ`\u001d#)\"*%(+)+)),*-23.1-6-0//-,0+*.\u0015¼c '&&)%'*)%)'2&/00/8+8.20021+-&/\u001dþk\u001c&$)')&((*)),).212225012,022-./\u0016qü}h###$&'$*+&-',1*042040342-13//1-\u001crŻj\u001c\"'\"&&'&.',)-3+14411514..5/13.,\u0018m{i\u001c#&%'((-'(.(.1(040433/2./2/+01.\u001aize\u001a&('+'(*&+(*..01414.6-1131//3/3\u001dd~i\u001b&$)(-(-&',+//-02127,52304/05.5\u0013he\u0018%%%&+))*,)(0.-150332700630904*\u0011lh\u001a%!*%('&.**-+0/34105/4.0024505\u001e\frd\u001b$&'$%.#+'.+0+,014/21322005/7(\u0018\u0011{{c\u001a&%$&&()'++/0-/-1/2215-1/4010\u001d\u001b\u000b{^\u0017'&%#'&+)..0/)4.62/30341062.,\u001a\u0013\r{b\u0018\u001f'\"('&&**/-.,01/1/4203/133'&\u001b\u0015\u0016zd\u0010!)$%%*&--*2)01-4+40134./3+&%\u0019\u0010\u000e}c\u000e\u001d*&$#'++/*0-0-202.2/320.4#'\u001f\u0019\u0012\u0011óY\u0010\u001c#)#()')..,-..-61.22/.2/-\"'\u001f\u0019\u0013\u001d`üJ\u000f\u001c\u001d.%%)'*+2-.//333-42/0.4\"#'\u001f\u0019\u0014/'¾9\u0013\u001a\u001f*\"',()1*,/.."
  },
  {
    "path": "contrib/att_faces/s1/2.pgm",
    "content": "P5\n92 112\n255\n<<>503=<GDNHGJNXXMS\\_drzw~}toihgfN@@N[<2=VKJ7$(5.:I6?>E==EEGUY[TVPLQanzqphon^HIKXN-<FM0A(\"23DMPC9BBAMQX_X`\\fU_kx}sppokYS@[O25JQ028$21OL8>@@=JPT\\afnefjs~ȽwrnojYG_X67Z?06N'-31ED?OQRIKMgkpmmv}ŽvppijMQQ0?P>$/[0.1+AYODPWWX[forz}ĿzqoiX:V.LND'-V21+4>CGRYadmzy}{sniED:LQ;48@80147HNT]iitz~|poXG<FE;777/1-8?GDX[bklx|qdTP=MI3+A,12HABQW^bgupwdKIV7\"E<73D=FTT]jpzuWFS=*;A0.MHDNY^jf}cGN>'05.0IECR\\c_pywXAU/06/.DAIPYVgtyfGVF2//.CQS[[glnz{fWLG>01,KW^fe_lkn|vRQL/23/GMOZca`hs~~XT]934/QOVSYW^hnr|cKTR+:/DTGIQZWgmzpzuTIH35.PCDNU]^iinwy~]TD56-LJVM\\^^\\djyeM_5-1WMNQ]\\`fpnhRP7(6@MMSU_ikoy}qQa6'1SWN\\Z_hnov~}Q]B++]YX\\g`dkoz}{^SJ(5\\Yaknifnt{YTB0,Ragpfryz~XWF/-S\\jkly}]UB0/RZ`kvu}|aY:2-USYj|{t¾TT31/VU[qowWC4-1OSalgje412.VS``lwf7-.0LSR^na+112LRP]}{+-4+SKJe}zxxxzvD*..VJNj{y{||zupipuvnv|yk'.1VONzuuoqw|{xwujruz||w~{l4+0bO]z}{|zl3*/OK^X4(-QRjwrifomzN&/.TVoqmdX[`[qx|zzq]<LPJKC(fcVYs=(+/\\Yu{fdURS3NwhPN^_Xiqqorľyn~OcK4`*nh0Fz}5(./]g{ý~qMH>Qu3`1]gRci_hvrrö|x|APoR&\\2md4L,'1/cjjeoQBV 17\\8jbgcpntveRHb_B?>qbHs5!02uyyeRiSTUDUUM}uxpaywX`^xTaS:yxkps0&1/¥}zzpߑL^dN[wownmimwŮtgjs}wib`{zho9\"1/~{vuspqsupvziq{{~ww{y}wcv>',,x{zystrz{z|°vps{~|}}tvyM$-)vwuzz}|jnsyb%,,~~~prtx}\u001e,1qu~&&1vx5!1|~.%+1&1*,*~'(3%(*\u001f+/y%*-g'(1]&).K&*.<',)/$,.u''+/ʫj &--ƳI!(),Ƴɚ7\"&,(qxµuwz,!(-.jue!((.+rv~kzM\u001c&,,+~ej@\u001c%*&.sgn- ',).yuvn*!))(&^\u001b$,-*'B!$&*-'5\u001e$%'))! %)')$ýv\u001a\u001f%''*&þ[\u0016&&)(&&B\u0016&(')&(/\u001a&)'&&#ÿk\u001f#$&&'\")~W\u0019\"&*!&%'{zvrqlu{wnmoorqrptrru>\u001b($(#)$(ľsld]XSVTXXY]VMRVRSOPY`acgxz)\u001d&*('$)&ne_ffkfeb^dcnkuonjccXf^^ZSUSVTU_ix]\u0018\")\"(+$'(zĿ|vuoqnxvxyx}{~yvwqxxiigmcogelpw5\u001a#(\"&%#&+`ƿ{xpx|x{{y{s!\u0018( &$%$#'H}~~J\u0016\"!$#$&%%%2v)\u0019'  #$&%$(7Ļ¼M\u001c\u001e$#\u001d&\"\"'&):n+\u001d\"\"!#\"&\"(&&(ľ=\u001b\" # % '%$%&'q`\u001f\u001d% &&$%$'&''\u001f`{1\u001b%\u001d#$!&'&(&%#\u0016VM\u001e!!#\u001e\"##\"$%&&%\u0014Ic*\u001f# \u001e$\u001f'#!#' $#\u001dCw5\u001e$%!\u001f\u001f!\"!\u001f!'\"#$\u001a2g$# '\u001d\"!\"\u001f$$\u001e&%%\"\"-r!!\"\"# \"\"\" \"\"$$%%\u0010)\u001e\u001e$$#\"\u001e  \" &#\"%%\u0016.{\u001c\"!&%\u001f!\u001f!\u001d!!%$$(\u000b8¾|$\u0015#&&!\u001e!\u001d! \"!$#$\nL}1\u0014\u001c'##\u001f\u001d!  $$\"\" \u0002a~z=\r\u001a'##! \u001c# \"#!%!\u0006|v@\u000e\u0015%(\u001f\"\u001d%\u001f\u001f#% $%\u0015w:\n\u0016#'&\u001e! ! $' #$\u0018v2\u000e\u0013 )!\u001e\u001f\u001e\u001e\u001d (\"!!\u0012|{{.\u0005\u001d\u001d'&\u001d\u001e!\u001d \"\"$$\u001f\to»}{~a \u0011\u0015\u001f\"+\u001b#\u001c!\u001f\u001f% \"\""
  },
  {
    "path": "contrib/att_faces/s1/3.pgm",
    "content": "P5\n92 112\n255\n',5%=0=-#(('7Tn`IHVgVXRMKXZ{[^gieamlox}}xppjdkolmSLTb\\^[RRPROA;(,779H=<&#\"././0/,,=3<2A+((,59LiWRRT^b_gjmqrypchihhllq{~u}nkcSLWcb__WPPIK@2-2H?I@<*%$000/-.;'981>=9.*2>C`\\MPYalrptwvlmrmkx~mR[Yfea]bLOAMEHHEK>5G;1.$*.0..,6,E,/B6>?;=CLhdW[lrvuu|}cWihXVXaSLEE69DA:80*>63/)0,-+*>4%89;8LMGHVZqbfv{]je\\[bb[OHF><H=.%'.267+.3/,/*E4)4?C4GMRXYnnpl\\[b]iaZNOCEKO,&),8-7-+2-,/,JE(/145?PY_]vo^OXdkmh]QGKHD=-*-0%5.&11,.,=UJ338/:Naabr`dnszymXPFF>:3(4--)(&.0.,.,B>A?8:DDWdw~|x~wdWP>E<5,/29#)+10/+./0@E<::[nu}t]\\KGJC@)>73,9-+/./*)3=>R>FVuiXNAPG>.77,=J,-10+/#21;FNJQrr`PEDD?49-/KL+-10,/ ,1?CUEWsogRJG<<8,-.5<,10./.,10FNOT\\nĸn_bLHUFA0-))(,11-./,77@IP`[mv`XQ=VTK205&!/01//,-2>??RV_o¶pkYHDIJC(<8'$2.1...*6==JY^dpźth`G:EJ<&;6$)221/.0\u001c0>;Ukikq{g`DKJJ)+*0*#/5-/.3$*7<PbdcsŽm]JUIQ3**2'&,5..00+/6GW[UhrȾ~pbURJ67541(/)21/.082GJQS^ls˾ľ{p^SOD;172)0'0/10.0-AJNMUein~ǽs_RTL:=%<50/.-2000.75NMZ_ao~øteYOG<;,5025./.0/.2(>>[V`gly˶tgaVA5>3(-222.0/.2)-BOO]msv˿ƹ~f]TK<50)+740-0./.(9GEEYau¼|n]ZHT(,*-741.0.0-?35=Ubgn|¾zv\\]JH#,-:3/02113.7**CUhktĿo\\VR4.%0<4021/.3/(,/AZhsxŻu[OV,6,18-G/1/1//!-$DMapzž~[SM%1,8<7;G-11/2 %/5M\\vzǿĿö`L<%*:B=8-F91//0\u001b46:K\\o{ļžŻcH2$2MB?/8DF11/.(*KCCO^zlE.*0JA9Hu@/02/\u001c\\Q7IbyL(/DH7:n500+\u001aYL*=TT<1FC/Rq&/0#;A+9A[S7K8Fv,-5*3@41JzhR6KF`|i\"oC-O:'Q{M37Sz&n=<++R}^8;d|dZ7$.S{}vyzvvjCM|G67\\pspiiqsswy|Gln~bBYp~{rts~Xzz{ _Xu{~~|uwrzy{|NzzsmpozzqZllDp9H4juRvz}yǲQ}zn^yKF|\u0012X4sIdVN^z}d|ijktybwXf`8LrfnCn~k{Ú{cwN\\5gcUUqǶegf=tC~}zvsDR.KUHrx]okƹoxy}]z}^lV^}V`IDcUu|{tCpxR{[͏Y_`\\g{v||0qyukwוxrz}q~t!u|zŴpȫnz|R'y||21yp_+0{}Ƕz5-1~ƾT+/-gŊǾt//1-ɳs<,,,2{|a4)--/2i2.,(*,/ip@.-0)*0-\u001e}]:13*-*,(0/&að\\9210//.,+/.2.\"cı6',0-0,0+++01,,%Ƶ&0,-+4)/-+*1-1/+/pȨ´q!,,,..0*.-(,0./,()OX&.(-/.-.1,.*//-,,''33?#0+-/,.,+,,*+,+),,*,\u001bk0)*.).-+.*/+/,-+)+.*+*:z'(,.+)2*0*,+0/,,(---.,\u001f`#+,,,*/(+.)-+.*,,,,/-0\u0018rηG\"/++,-.*,-,*--.,)++*/*$Dͳ2)-*0+).).+-*-,+.)+*++(,\u001b&,*-(-*)(/+.,,,,.*-)+)*.\u0011Үwf\u001f-+,+)-+,+--+-..,+-',,)/\u001bP{ørorsM\"*+(*-'/,,.+,/-.*,*),)+*,+x6#*)+)&0+++)*.-,-*+***(,*-\u0010}#()(*)(,,*++-,/+.,*/*+,+,.\u0015f~]!*-'-(++**.+,--*.-+.,**,&&)9~B!)'))&/*)(-.+++-,-,*.+*.+&0\u0015Ľ+#('()'--%*)1()..*.,.*.),-)'\u001ebþc '%)&'$*)*)),.-)-..--,-*+,(*,&ž?\u001f+%%&+&&()'(**,-3..,,*,++-)+-\u0013|ſ)$%'#)&)$()(%++)*1.,*,-(,,-+.('=žW#%'(\"('&)'+&(*+.'000,+-+-.+,,(-\u001cĿ¹6 &&'&%&)')*&(**,(2.1--,-,-,'+0'\u001b¿ƻ¿w!\"&(%(%'*()&&(&*'-.0..1(+//,*-).\u001cûg\u0019$%%'#&('&((&)&*+.2./01,,,-+,,*+\u0017ƽyoq{yn][W\\n{xsf_ZabquntY\u001c#$'$$$')%&)%(%'--012.3,,.+)0-+/\u0017ɹ|xuhd^\\]^Z_VTYXOVRPURZ]nvW\u0012&# &#$&'''''''*&.102//-+.,-,.-1\u0013ƹxtnoxruumpsmfg^jfksE\u0018%!!#$&&*('-$'**(*23200*2.'/+.+.\u0018ȿ~~}tosuy<\u0019\"$!\u001f$$#()(+(*(*(-321/2,3,,/,+.-\u0014}{~|y6\u001d!#\u001f!##\"(%&('((*(,122020,,/,.*/-\u0013¿ž}$!#$! % $%$'$%)$(&-23/133///0-//%\u0010ƻ\u0015&!# !##!&$%'$(&&&.231104/01+,3)\u0018\u0011\u000f\u001f'\"$\u001f\" \"$#''%(%(&)3-4-32.2./27\u001c\u0019\u0015\u0010\u0019-\u001f\u001f!\u001e\"\u001f\"%%$&$)&'-21022-40014&\u0019\u0012\u001a\u000e\u0015*$\u001e !!&!#&&!%&&)&10213210323\u001e\u001a\u0014,\n\u001b%- \u001e'!$!%%$\"&#(*)210332/140,\u001b\u0018\u000e;\t\u001f!0!\u001f$ &#&\"#$%$%))42/6320016\"\u0019\u0018\u000bDo\u0007\u001f!-)!\"\"#$%\"$$\"\"'()01.410/2.2\u001d\u0019\u0015\nB~S\u000e\u001b&%+&&\u001a\"\"#%%%&$&''//42131///\u001c\u0017\u0018\u000b1=\u000f\u001d##)'+\u001f!%##!$(&&%'1/3.01/-/)\u001a\u0017\u0013\u000e(}x+\u000f\u001f\"\u001f)(($!#&\"\u001f$%\"&\u001d%2/4/--30+%\u001b\u0018\u000f\u001a(nb)\u0014\u001c&\u001d&(+!$%%\" !$$$ \"3311.10.)%\u0017\u0018\u000f\u001d8>}|R$\u0013\u001d \"%&*$\"''\"\u001f  \"!\"\u001f14202-/'*%\u0019\u0017\u000e%<3u¶_M \u0014\u001b# #(()!$( \"\u001d !\"  .3012*&#,#\u001a\u0017\u0013)>?@nRF \u0014\u001e\"# ))(#\"$$\u001c\"\u001f\u001f\"\u001f\".11-'!\u001e$+\"\u0019\u001b\r1=D=`ÿûñ{ZQ<#\u0017\u001d\u001f#\u001e'*%&##\"\u001f \u001f\u001f\u001c\"\u001c1.*$\u001c   +#\u001b\u0015\u00152>AC9¿^OO5#\u001a\u001c!!\u001e(($% \" \u001e\u001f\u001f\u001f\u001e \u001c.#\"\u001c\u001d &\u001f*#\u001a\u0016\u0016/BDB@Ný¿{eXOH3!\u0019\u001e\u001f  $'')\u001c\u001f\u001f \u001c \u001b\u001e\u001d\u001b %\u001b\u001c!(\"!)$\u001b\u0017\u001a/?BFBFeĽüyf[TMA0#\u001a\u001f  !#'%,\u0017\u001e$ \u001c \u001f\u001d\u001a\u001d"
  },
  {
    "path": "contrib/att_faces/s1/4.pgm",
    "content": "P5\n92 112\n255\n)//.,10:=1:AV7TXH28<MQKD;-8@@:@JIINSYbfkmy{}rspksjbYOQCC?HDQ`o\\BMJLH@G7HWV\\TYWT;-61.204-04.1,+++5.%#+12BH0OXA4;ELHGCE95>GOVW[]gdn{xpfVQQKB?;Rgl_MOTFA<<BNS[MBKT2,0+-023/021.0/..2-\"'009=1)QW@,<Q;597NMP[cglmqoquqkd^WFJA[hjSLQW?79FIPSOHPSJ;-)'014/020/,.-0-,(59771#-ZT)6M@@?JPV]dnuv~~~xmd_YNMc]]IWIFD@DGDOKCJMTQ9+#)24213112031.-#6?7-+%3L03ED@ELQ`gpu{~vog\\QhRTPMWOC7?IHLDBLBPT=8%\"+322215.2,3.,2=54\u001e(-@3?A>:EM[jku|xpgdXPLLLRI37OFQ7@E6DA7;1($+13122.0-5*9:9))%&.=U=@<@[dgt{wrgMZQJKSAATIJ>H==@91+''!\"02221,/3+2C::4' '4PNC?LXfksƼ{y\\`T_KGKRYFKGPD@HD?3*$\"\u0018!4715.0)2DC=2//#0>QJGIZfowп}u_`]TF?UHFMKAE?AE:9</+\u001d\u001f*2302-'BC=622+03WQME[fn|ǾƷ~nc^VJFBIVR>UH<5>G7=>-'#+2213/*9A?/>45@0QZKQkm{ǽwra\\PDAJTSTENH>2N53C>2$/354/473N;628C6PeaTeq}ļ{nmcVIMPHR]>PD9V55./-.16030/138:H<7.E\\mVfvxĿ¹ǽƻxmmULMYEXXGDF>?/-1&0):4-24&4GFW?&?UNcfxǿƱxlYVc`ARL@><8363-.:-8220%CRL`A=@;Oi{ľǼ{n\\i_AAL?7>70211/-A-70.+=AC1C07Jk|ýþüwnok;;;?8/=7,-/1\"?5//--113*99FauĺsnmV8E=492K(/12'-612093+*-:;Ofzǿüzycb@IW3D*@A)1-0(2139U9$10<AMm}Ŀ¼Ŀqi\\H=IM401><0+10/0,NT9&<>ABTl½¼¿qfcSB?I3'*@00/.5-13QA=6HDBBYnüra`WLJK>.#7? *06-/5F>ABMBKBUnĻb^[LFLE7+&H(%)501@N9>?NJ>Ebp}ĽiZ[EDGK52\"70\".//4KD305ONAO`k{q^N??<HR5+%,\u001c24/0H;+-8RFFNbmyleXC1UC?=)'& ,9./N+1AJM@DPYtwv[XG=2d?;.#.(+7-,G'HNF@<DOgxm`ODE6Q?A8(..*6.-1+?KFF@SVpyseQEGN@@57-10/40-209OPHTPZl{xjQLMM685$8(;*4-)3'OQNRFK_lwlTI\\MA.,+,)243*/%.S?LNCMbrznNPIBL>&&+8-:0.(56@7SRKUhtiTMUC/C'/$C+4./*C?7ESZZ^f}~zrx|~rQLY[=-11'B/51*.KFDHWV]gp{ops}uuqKOXSP0-;(;?400*G;B9GL]gy~~xv~oVAVZJ,7;,61=.-*6;119T[gyuustx|uU?QNG+=00-)51/-9A&=<G_f|}S9eB<,?5'<)/4(,6L,;ICWaTAa9C(B:!I=(1+-AC13RCTW^Gb=?\"L2)6C/1//I:2+IOTXĵiLW:B'8B-80.3/1X2>/JUMTŲxrmuxtgqvpvKP3C-+F11-&010W5K:<SEK~y}wmoihvn<hJ;CPiOL<2<*8;6$#0-0Q=UH1NE;}lloikmtzikrSls\u0015L1^Y~]K73634/7* 1)/E@FD2SK3|xaYRWMPjcfntqŪsve|Q]F'g<Git>:20>846/\",-.=J>@2bT-|tIV&MaCecj~ɯ~eoxjbWfHwZRoEB,9;>?7:(+/.>D=:.eW*|xZKI-`<b?mp_zѲmvw~sXL`|vtZxY;7/B0:9>-.0-H;7A2KZ+p[yOY/L\\O|}oepϱz|pl}{{~mmylJ4:8161L./-+?2)O/=Z-rLo]MSU\\j|}o}Ͳv}Y2;5:8/R2,-,?01K0;a6kpqn]m˵OC2?8@0D9--,22HZ8;ZF{~sxx{ŷTE3B;=89@)0+/2>h67HTȶhM9HCE35W(1.-1,\\=2EhϿ<ELP?%9FC*-1:%]F7Csı9GYD\u001b-^cV0,/8-CH=;}ϿRFT\u001c7\\%2/:9RF8vXCQ?1'I/eO=ĳti;DT3RXRɼwz^E_ZkdlϹžiw~zǺe~x~xFw|F7}uȦŒT%_|vG=PchBS}play|xq~g{z`bh}kpawm|ts~svj}v}y~^ļ}Q~{~E1ulgjowu{|~~eJ3),pgc`\\TOSTSYV_hpuymopZS@/-,)(/wrf_bfijfbab_\\\\[V^bjkv5,.,/*&*)+($5wujjtu{sf\\afq|'&&)'*&'*))0,+=c}svow~vqoze\u001b)'('%'$)((.-/+)4BVeP|pny>\"((%'(&((')+0(,*-.+1!E,#)''(&%'%'&/+.**-).*,\u0019\u001d%-(&&*$&)&$-1+*,)+',/\t\u001f'((''%%(#'#0+*&/,()*&\u001dO%'('%&'#+!'&*0+(,)',(&-$}%\u001f()%%&$'#&*/++)+)')(,)\u0015|($))&'%$(%%$.)*+*+'+**+$?{|'%(.%')&%%%$*((,)))*-)*'\u0016¿{},\"'+$*'*#'%$+-%,*%(('(*&\u001dD¼~z1 *$(%('$(\"'.)()((&+%')'.\u0011ƿ|}:\u001d&&'#&#$$\"%,()*'*&*('(')%;ý~~~:\u001d&&&#%#&##\"/())&*%)+&'&)*\u0018pŽ{~<\u001d&%%%$#&##%+)*)(+%)&(($)'*!|~F\u001b%%%$(#&'!&,)')*(*(((&'')+\u001cAx}W\u0018(&$(%#&$%$+*&+''(''$)&%)'*\u0013rz~X\u001b)\")$\"\"$#( *)-((+('''&*'*$+\u0019`|e\u001d&'&'&#$\u001e(!+/+())*(&*&,'(*)\"D{~p\u0019*($%&##!$&-2,'+),&+&+))',+$0z\u001c\"&$$'#\"&$\"0)-')(*('('',((*&%{}{\u001b#$%#$'\"#$%,.*(*&*'%)%'((*+#\u001b~y!\u001d&%\"#'#%##-+))''+(('&&)&'*&\u001a|zz)\u001d%&$&\u001f%%$&--'*&'(%,%%&+&*(&\u0013ɼ}|w{8\u001a'#%$$%%$%/-**+())))&(/&+((\u0014z}|u{}?\u001c#####%&%#*,,(+&('$,$)((+*(\u0013t{vy|<\u0018$&\"$$&\"&\"+,,)')*&)+&'&))*'\u0016jzx{~<\u001b#%!%'$$%#-,-+*)-$,)*)(*()*\u0016g{{~@\u0017'#\"$%#%'!.)/,,,,)((((*)*(-\u0017]}D\u001b\"#\"$\"'#%&"
  },
  {
    "path": "contrib/att_faces/s2/1.pgm",
    "content": "P5\n92 112\n255\n~||{|{{uuruozttyqj[e^MNGI=7*4:AC<>DMUTOE>DFINMVLXW[X\\WTGJVQIEGB=?Ugmsxsz{xzzzz}w{zywyyyvwypuorpuuwvsrsma]ZVF>7-,(-18=::;9DMLD=9@BEKFIFHPPVTWLHEIKFCCC=<MXdootytzzyzyy|zywyxx~{sohlruutttvrmphdWRQL=.&&+$:5?C=798:69??;?@GEG@?DHGLKMOMICIIGA?<>?P]kqvtwzyyx|zyywxzx~||tqmlrxwvuoqrkigd\\YRQD4%$)%&58:B?>763*):<4>CH?BB;FDCAEEHNJKUMKGAAA5?QWepnus|zywwyvzyw{~~~{|wrpppwwrpojkgb_\\ZYQJH=.,%$$*<8::@A<52(+57;>D>?@;;??<=9@@EFLKJIGECB5=<IRehixxwuvvvwyy{}{|zztywxwwusnjge``XVUPNGB74,*&(9;=8<?7:6213248;989::;48:5;@=DDIDGFJMKE=?9?KPVafmqxwvxww{yyyyz{y}tutssiie^ZWWZRMKB?7<50-16:<<9<;:2981,/020/4-/244689@=AGFFDLGLKKB>=?EKXUYdnqt|u~}z}~{{|{{|z{rupgbeUTYYXWRNEDCD?:93515<7A;=810//$0*.)---+14315<<=E=F??GLJJG@=>9@LZ^]\\dkruw~}|{}|{wyy}{}zwmjaXYTRUWVTSNHFKDBBA=>87<@>9:6321-)/-+'&*.*2-2/.37<=EBC@>FMIIK>884BGUfij`gqp|~{|{|zvwv|z{zuuie_TYYXWW[UUOLIPMJJKKGCH@F?@68111-//1+0).3*-723,41/<<ADCABIKRPM;;8;:CUkohdgq}{zzx{yxwu}xwunjf`ZWZ]WUV`[[TYM_ZUW[ZUZSQMKA=:82,)*/3//,,/00062857657=?CDHJRRORK9;8<7BVdiich|zzuzyyuywvvtpfe`]WZTPPT[fklgh\\aqbkrjiflg_TNF<?:5*((54,..04798:9<@FFB>;AHDJRWTKP;<:C:6@S[iaez{tyrurtuturog__[[RKKQS_ft|}xocxyp~vtw|kdYNFCB;6*+)43+/,4053>;9<HFJJMKPKKTPZMQG@?DA;5ET\\`XrzwttptyutqmibbVWKIDRW`jzq|~xyyjfXJKIBA711.93*53-308:=<;?DDJISVNTPVSNHHGBE@77CJVLytsqvru|spjlf`XQH>@P^amu}vq`UNQOF>D?67=5271-3,32:105;?BINKPQLNMHLHEID=67KDDprpuvwwvhkgd^XOC94NZ`nzwtiXXTWPMEEB;>;>=>22/6237(0726@EGCGFEGGLGFGAC@4>G8loxztyojc`^XSJ@:1ETZo¼yyq`^]V^WEKCB?B>GEA22/4232,9743<DCC@DFCEIGKDBA84A@ru{utkhb_^TQF@;.;PSj½yuwxjgc[_]RIKC=@HBDF>/31-7/0.;5).8<B@C?B?CHCG=C<63?totohb^[VVMEF:51LSd}øvsxnhni]][MIDB>HE?HH=781*760680,$01;>?>><B@B=811)+rrmg\\\\QQKHH@9/-4M^zĸxpz|vhon_]]OIF>DIKIBFH??84./438-+&**/4;;;9<><?;9400qmebXPKDAD<:.,.:Stö|sr{uqlpiW`UII<CBRMHFHFD;;//33>-+,&'*+69495;:;=85/3hhaSOLB=98922-$Nlĸuju~sxioka`ZOMH<DMVNLEKA>;8-.7<6(*4''+/713389>>5,*)kdTPIA<942<4/*6e¾~qsom{qjmk`\\VNFB@FJRSEEB@949/2?;.$31)'*/10568=@70((bVLD90../-33).Rodcmhffe]ZPMECBGRUMFCA=824+5?6*(3,'-,--196:A?10/XIA41*-%*//++Cruf^]]`^]ULKJHCDKKPI;B?:80'/<:-*(2)0,,*,39:?@:2-HC://,(.2/-+3a|mb^[[_YXTWKQHGEHJ>@@@:/0'973.&-.-,3)+.4+*37)+I>50'*(-64)+Iw|rlh]ZSUYVWWVOKJOE?CE:5223B310).,+/3)*/,!%2-0G91/&%*35/(9ZƿyyreTQOPPW[RSOUTLDID;<73?=0.0(0&*0.-00%$,64C56*((-32&,<gþ{vxjXQNJMUSWQUPXQJE>@;68=1,3-*)(/,.)81)2D;MC8.*0133.'Vxÿ{wukYRKFGILKEJIPQM?9>99>9($-0*&)*(+2/0.=?QC7203-1./0h}wnj[VKGAEAE>DEFNH>7538?2&!-'.*-.0/+!,9<JD7<32.10+?zƾzxre\\RS@BDA=@DAEHL;656:=2&)+(/(&3.+$%$6PG7:0+-0*+XļxqiZWPDDBD5<D>HHH>8;8857,,)(.$!**% !\u001dTB:6/22-$)hûý}rh`WRE@D?;;>9ICB>A@><7841)*$\u001b\u001f\u001e'\u001d\u0017\u001fKB735:6'\u001b8vùƾrn\\]QD=C<;:8?<=;9<<D=769..,#\u001d\u001a \u001e\u0016\u001aG@8556.%\u0016Krd[QL<?=;<=9;?7::6=B9@58/.,'#\u001d \u0016\u0017C<348/'\u001f\u001cUytz~uhYR@=@;7<9@>><=8==9>8DCB>50.0%#\"\u001a@=477,&\u001f\u0017c~~}{¿wsd`URH?9==:>6;A=BC;@A:8:<@BA;262/\u001f\u001d\u001fA97:,-\"\u001a\u001bu{oa^YTPJG@;>9CC?:=9;?>@AB;<;8A<=613+$ !@8<4/&!\u0015'}þſsjYW[UUURQOQUNQQH;6766>=GC@=:<=<551*(!)<><20&\u001f\f7»~~vmihhkhonsuusqkl_W??;81:?DA>?<8B57:1$&*D?61-\"$\u000bI¿}yzuxzxvw~}y{xtmfVOC>9488B?@=>@;78:0$,I8:)-\"!\u000e]~~{|wyzxxw{||{vxtspic_SJC>;97;@==B;;8=;,0A;42*$\u0016\u0011pzxý|z{y|xyssqpnrnoplqkmlhgbWMH>>=9<><@::>:B85?@0/3\"\u000f\u001armkifvwwv}ƾyxvzxyuplffghjfg]^Z_ghgkd]VK?556785=:5759<?A9/00\"\t5tvsn^IHSgnrpuɿ{ustvxsoghnunqsmii_YNP_ffd_ZVD810-34362/215=<212.!\u0006P¹pcskP=5:_fkppyªwlsowoliltwuic^X][\\XQGH\\d__\\[L<6/((0/200--0491+8(!\u000bnȽqnҸV<863jslkv{¥|oljsoonoqoso^VJ9ACLD?HBG]a\\bXQH>0!#&,2*44/-/95)5,\u0014%ʸNC5?GmxujqǾohowvtqokubQ?423NP:8>CM``^^]LD:%\u001d#',0-417+5///,\u0012:[QLIaw~{|ƺulyskiu[>=33*LhS;-=CY_\\\\]VI?(\u001e\u001e***//7438,13-\u0010Uǿ}u~rrQ5;662SlgF7,:QU_[aXMF*\u001f\u001c+$(-14/4/2+3!\u001bh¶|ʾlFA@6D]lgH@5?DW^ac[WE/\u001f\u001d)'\"),./231.3 \u001evƾ}}z˺e_TRXdc[G;AEOP^`i`ZI2\u001d!#(\"#/0*23/33\u0019&}ɷ|}nmmjac\\NDAHMWV[dkdZL7\u001d\u001e#(&\u001f./..0//3\u001b(Ƴ}zsrlnhfc[XVY]]]`ipl_N7\"\u001e&')\u001a06,+7,10\u001c\u001eĭ}zxtvrollfjhbebjnrqfT9$\u001e#''#'2&*1010\u001a\u001f̾~}yyywsvqqoljnmuxwnT='\u001e\"&(%)*&(.3.2\u001c\u0012ȼ~{y~x{}z|ytvxyzu[=.\u001a%'+&'*&%/222\u001b\u0011ɷ~ub:-'((()&)*\"332,%\u0010vøxdD')%*'&'',$122.\u001e\u000bhķxhH,%))&\u001c'$.)122,\"\fZúynF-$%&&\u001e \"+'1/0.&\fL¿|nI) *'&\u001e\u001d!(%31/.)\t?ƻ}jG(\u001b&,$ \"\u001d)!4/0--\u000b0ƾû|j=$\u001d#*%\u001f#\u001f!&0+6.%\u0014#½ÿy[9$\u001d)($ &\u001f\u001c -.21'\u001a\u0015ƿĿwS,!!() (\"%\u0018\u001d)/,0)\u001f\u0013žmH,$\u001f+%\")$$\u001a\u001b/,2.( \u0007n½óý~}y]C/#$&%!\")\"\u001d\u001a'/0,*#\u0001aľɺrelpX?0#%$&#\u001d)$ \u001c+01*)$\u0004WŨs`SLpymX@.\"$'\"!\u001c&#\"\u001c-/2+&(\u0007R̿~phZS`y}zkTA&#,#\"\"\"\")\u001f\u001d4*5)'+\u0005R¼Ǻ{wpofdk{~wjN7+&(%#\u001d(#,\u001f\u001f1.2')&\fHÿyzyouv~r`J5.!&!\u001c%+)'\"\"31/(''\u000f<ƾ{n^B3)&#\u0016\u001a)+(#''32.,%%\u00117¾ʿvkZA0$) \u0014\u001d+(%%%%=22,&&\u0017/îzshWC-'&\u001f\u0015\u001a+%\")\u001f!89/-*#\u0015,ƷxpbU?1&\"\u0018\u0019\u001f$&#)!!<:2+, \u0018\u001c}znbV?0\"\u001e\u0019\u0015#!&$&\u001e(9@20%&\u0017\u0017ž~zk^T?-!\u001b\u0015\u0016%\u001d\"$% &<<1-$'\u001c\u0013xĿ~vy{}to]P@/\u001a\u001a\u0011\u0019% \u001e'#''>>.&&%\"\u000ffû~xwrrnoprrs}zsk_Q=(\u001f\u0015\u0016\u001b\"!\u001c+((*@8-\"$#&\rS»yokeyvrtqwqmlkfdlmsyyrl_L:+\u0015\u0013\u001e\u001c\u001f' !+.,?7*\"\"\"$\u00139ȿcN>Htwrlfe_bfhxzxsj`Q2#\u0019\u0016\u0019\u001d#&$\u001d+3->5)\u001e$\")\u001a\u001fmOF~Ǻoo`]VXX]lzoicK/\u001c\u0018\u0018\u001c%\u001d)$\u001f\u001e:.=5\"\u001e\" !\u001e\u000etȮltźv|q]VG96Rt}{ii^F(\u001b\u0018\u001b\"!# '\u001c\"4.53\u001e%\u001c\u001e\u001f%\fRôkpjSE?/7Nx}tmeV@%\u001c\u0018 \u001f!\u001f\u001e'\u001d!/.:&&!\u001c \u001e'\u0012)Ⱦ}rpwdY_OFLVdtypl`M5\"\u0019\u001e\" \u001a\u001e\u001a !\u001f223$%!\u001e!\u001f!\u001f\u0011iwwtrcfebdsypgZB-\u001c\u001e# \u001b\u0019\u0019\u001d  \u001f66.%'\"\u001f\u001d$$\"\t=ý|sqopv|umbQ9$\u001e\"!\u001c\u0014\u001f\u0018\u001c\u001f!\"2=0$.\u001c  !!$\u0016\fyž}yvu}}yqg[E+\u001d\u001f'!\u0012\u001b\u001b\u001d\u001f\"!!2?-/)  \u001f#\u001e*\u001d\u0007Büz}z||}{yxkcH7#\u001f!'\u001b\u0014\u001b\u001e\"\u001f&$!38/0'$\u001e\u001f#\")$\u0012\u0017w|wwx~}|{wrhX@(#!\u001e!!\u0013\u001b! #'#!39-/$ \u001e\u001e\"\",%\u001c\u0007B|uussv{}}|zsl^L2 & \u0019\u001d#\u0018\u001b!!#+$ 6:.('\u0019 !$!*%\u001e\u0014\u000bsſyvvswwy}|yxleJ>##&\u001e\u0015\u0018%\u001e\u001b$#+$$,0;1'%\u001a\u001f%!&'%\u001d\u001c\n0~|wqcVA+#% \u001e\u0014\u001a\u001d&\"('&%\"-371.\u001e \u0019\"$$-#\u001d\u001c\u0014\u0007LĽ}xqfZD2\")&\u001d\u001a\u0016\u0019\u001a%,)&\"+ .8023\"\u001d\u001c\u001f'&*&\u001d\u0017\u0019\u0012\fpzwsh]F3* *&\u001c\u0018\u0018\u001a\u001e\".(# ,%*4,*;)$\u0019 %(/$\u001d\u001a\u001b\u0017\u000f\u001bz¿~{wphZI81&&.#\u001c\u001b\u0017\u001a!&&)&$&,++(,00'\u001e\u001a%/.# \u001a\u0019\u001a\u0016\b5¼~}ytohXJ530+*,#\u001b\u001b\u0019\u001f!#%&)#$&*,(,'1(\u001d\u001d&1/%\u001f\u001c\u0019\u001c\u0016\u0010\u0016g¿}{vumdYE@031),/ \u001b\u001a !\u001f\")%%$!$)*(/\",/\u001c\u001c*+3\u001f\u001c \u0017\u001b\u001a\u000b\u0018Ysý~zxqojbOH=;233,..#\u0019!# !($$#) !+()(+\u001e*!\u001e&+0%\u001a\u001e\u001f\u0017\u0014\u0012\u0016Snz¾~wwpnifXNFB>:440/2)'\u001f%&\u001b'&$\"&&\u001b\"&(-&* !%\u001e&),!!\u001c\u001c\u0016\u0019\u0012\u0014Oow|}wuqmif\\XHGAC;9910.0+,(&\u001f %&!!!\u001e\u001a\u001f\"+&$*  '\u001c#+'(\u001b\u001f\u001c\u0017\u0019\u0018\u0010Hoyzzspoi`]XQKDFGD>9:51/*20%\u001d\u001c#(#\"# \u001c\u001c\u001a&('.''!%!')%(\u001f \u001b\u0019\u001e\u0018\u000eBix{~}{vnkf`[URMJKEIBC@;:43+303\u001c\u0019\u001e&&\u001f\"#$\"\u0019\u001f ')-*)#%#.%(%' \u001c\u001b\u001f\u001d\u00117hv{~|}vqjdbWZNRNLHKIGCC@=:14100-\u001b\u001d\u001e(#\u001f$(,\"\u001f $ +11&'!()+'(%! \u001b%\u001d\u00122cu||}}zxqli^[YRXNQNLLJHHCB@;6830-(&%\u0017!)!&,-('#\u001e #(5/+,\"+&/*%%!#\u001e# \r,]ry}|}|~{{z{wyuxz}{yyyuvqtmgf`\\XVUSXOUNOKMIHCD@8;632-\" #$\u001b+(/:((+'\u001d &./.0)((++')%&( $\u001c\u0010#Ylz|~{}}}yywurposqpmmmhlfc]^ZX[X[XWUUNLMLJEIG<8967-/!!$!()1,36'*-\u001d\",-0.,+*)0,*+&&'% \"\u0014\u0019Slx}}}~wxtnojlggfaf]`^_[^]__]YWVPRNMJIFE?6:;5--#\"!)%%((.2,/2\u001e(1)4.0,.*1--.&)$'##\u0013\u0019Ofs{}}~}yxrojjgbdc_bfabbaa`_YXWUNQMILGF?9@76-,$\"&!&!\"(./..7\"+30"
  },
  {
    "path": "contrib/att_faces/s2/2.pgm",
    "content": "P5\n92 112\n255\n~~~x{xuopnputvwnrnj]Y[LLDA6)'0-8?B?AINVUHI;BEFDFLITTVWNQBHLFA>??Mcgiqvyvxywyx{y{z{tzw|vzwwolqpvtstqtsnjff[UPSG=7-\"!.&-2;;<:=DEGC?:?A=AA>BGHJMNIHBEED><=BV^gnvvvx{xyxzxzyvyw|xuw~}|xqlpovxysrplpdgg^WJIF?:4#\u001e')57AAB=6;<:5;<<@>?<=<:>ADEGDKFEFI<=9>FW[glsrzvzwxywzxzxyzxw|~zzyvppqwzuplkhe``ZTOGKCA=)\u001e!#(6:<BE?6;7*.06:?>G<<::@<<==BEKJPJFA;<8BMVejqsx{vuvxvu{y{v{~{yyxuttuwtuliga__RQNTQJGDB4*+#%&2@6:=@;92)/)56<D6;:;6:8668:BBBLJAFAC=:BISXcipusztywuvyxx}}ywyyvzxwuqmhf]XNLLROPKGDE882,&$3;@:69;843/5*61504175507357><B<GAEHILA>:HUR[\\eluywu{xwwv~}~zxz{|yvuvqhg]_KOGPSWUULKE>@6;5,3589;76<14/62-.+0+*0..130276<>=A=>AJNGGB@BQT]\\`imvuyxwxx}}|yxzz{zz~|pheWXMNPLQUWVYPIBD?@;;65348<9<96412,),))'(2,(303236;=?<=<=HLKC=;?M\\hhaenrrxwvw~~zz~zyw{y|yzkdUWLPQQSERKXYVVGHHD@C??976>?893630/-+*+& .,.,300)174<B@@>?OGQ>:69H]lmeeotuxwx{}~x}xywyyxwylg\\YXX\\ZQSJTV^`[]WOUGNMPOJGKAB>775/-..2+.+&'/,0.44,,2*6>>?<CDNLN=<:::Sciegnruxvzyxy}wvxzwvtog`YZSYVPSRV\\`hjkchXaZZW_a^T\\NOCB=3:.(*.21)-*-0..35/752109:?@AOOLG>:<68Naaafopuvzwxvvurtvupnd_WWWSULNSU^fks}}xtjengkqmmhnhZQID;::/)'160*/.//:0645<@?:6;<?AIRKSA==B47S[Z`hmruuuwtqqqruqle\\YWWPKCHLZaktmuzr{{tt|i`SKDA?8.,'-3,,.0.0/8<49<ECDDGHGILSRFCAG>7:RPXcmppvtuqqqvwpna`^\\TOE>AP^gl{q~vzti^THMCE;90-33+06)/,-48765A?GFOIKNNOLFGGJC9<K@Qhpltoornsttg^a^\\VNA52Lbfs~}x|znlZOPOLH?A;696287/--,/03*399ACHDEHFKIHHHHB4B=;Lknopsqtnmf^Z[UMF:2/FYety}~ro_WSTRPGC>?779<D60.0,0/)*82/;@A?@CDBHFECC?9<3;Lgnrpmqge\\YTWID92-7T]qƾ}rzzol\\[XWTPCCE9:;>D?1./+1+,'38(35B>?@><DDGBDC<602=Hqqnme^ZZULKG>700M\\gvm{ukdccYXWCEAB5@A;D;00/&-..&9-,*77><<9;BFE=>A3/69=ojf`WUNQELC<3,/;Wjwļts}~shchbZYLBC?>@@>><?210%$3.06+(#,13<:8:<@?6;2*,49rk][OKBFB@;4+0.Fcwľ}ss}wndid[WUK@?;AHCA>B=622(,.19).'%&-74;77=86:81.23haSNIB;?7616./4WoŻvlq}rohfg`XXPC?=:BIJ>B@A=60%)5;+*/#'(0454489;49/*.0dVREF:=2.1<5/5Blźxhbm{tnocbf]WTJBB<?IMLCBF<75)*0:5%+/&%,12426;;53-%&2QR?@7,++-09418b¿vqchfmocbaXZLCE8@>KNJ?A>;2**/7:-'*-\"/-)/56:<>5+.-.L@42,($(,1.09U~qbWca`[XWNIE>8<@KQH?@<8',,,:4+$.,)-%.(88::=2+:6@551'*'/1/,5Jq|c]WTXSPRBB@A=?CHM9>::13()52.%+-'**,(322576)25=23)&&'75.1<ayncVVSUNNJHJBH>GGG:=756(,18*1&.)*-,-(4%#+2*/;65.$%#.73-6IqûrneVRLNMMSLPJGINA<;<61,*>512$*,(*,0,*\u001d(224986,)%)41,1;T|¼wxlhVFJGJPNSQJTPJCC>=853=4-1\"*)((.53#//?6?@9/++0.2.4DdzsolULHDFHNQOPQJNG?<<:699#.,)(&+*,./)4<=;B810/1*3/5QtytnhZLK;F@EDACEIII9?566@. *,),(,)/(&)8=5?>372,1/3;d¼ytnfZOHDA@99:<?>JF=33.9<.!*&*&'1/+$ +36F?81,),1,Jx{tpcXRKF=>986=:9EG:504790()&2$\",&##\u001f%4DA8.513-)Vþvme^PRA?:;7699BEA8;46946/0*%\"\u001c\u001c\"!\u001c\u001d3C>62980$(nĻÿ{sh`YPH9;863<6??=:;=?;853-+\"\u001b\u0016\u001e \u0017\u001e$A74651& :zƿÿtja\\VB887486697658;;>533.($\u001d\u001a \u001a\u001a @6162+$\u001aJ}zyreXVJ=6:59:88947737:=9630(,\u001c'!\u001b,=477,'\u001f\u001fZusmruxww|mfXKAC<9666;88=664=687;??862)&'%3:79/0!\u001c!h½|vxyxuux{sk`[RMB<==>>56598<=79<5748??@54,$%*+;;70'$\u0016*xý}z}xi_VOLLFA<7<@D?<354267;;>>59:98:4/&'-1@=5-(\u001e\u0010:½}pcWSOTSSNJOLTKPN>:=.3.48<<=:2:;594,%-0B>2-&\u001c\rO}vwtiifhgfkjpsqlmggYLD;33/33<>878<4692/(/@=.2$\u0017\u000ea||vxvsspuqptuxxuwtqnf]UM??74073C:9;73483/.A7.2$\u0010\u0014oxvĻ~xwuttqqsroqsvwurvlki`^XMG:>;85;8<98:5::60<4//!\u0010\u001e¿z}tqyƿ{squqtpomjikhjmihhgidde`ZQB38=9:47<8836:=8;.00\u001d\u000f2øygdTZ[_ltomv|·~rppprpmia`kelmkge[TWbcc^YXI;)1)02/598020897-//#\fK¼wr_UE6<:_apnjr{{Ÿxninmlj^eiophkgedb_TKJXa[YWND/,##*+.52//,*52,2.\u001d\u0015\\žtiphJ9237cjghoqwɹuhgljhcehpgZUCHEDOLOFDBW\\WUUJ>.\u001f\u001e$)).-05.**.21+!\u001br¸~x~pF?:7Kr{pgmzǸqcglngjhcpgNB;71,:I7><=JZYTXOD6 \u0017%&&).,224(/-5,\u00132ƾ~WLEAe|yrsǲvblqtkb^i~W643.(7\\L208@RXTVUJ; \u0017 )&!-(/35/*.2.\u0018<vqvw¯{oqzwoglyk0?<30LfeC-&6IXXWYL?\"\u0015#\"* &,*-12.//,\u0015Qĺ||x|~}y|}}MB;2B^icH214AO[][R?,\u0018\u001b#(!\"%.+.63-/+\u0014Z~|yyy̿m\\ZSXa`ZB72C@PZc`SC,\u001b\u001c$ (\u001e$+)+..-1$\u001c`½z~vwphbg_]YND@CIMT\\feVF)\u001d\u001d$ '\u001e'(,-*2+3#\u0018_ɿ̽yzvnlgmbcZPUUUV]^ej]D-\u001e\u001a%#\u001e$%'(*.,,6!\u0015]˹}zussqonhecda^bemkfH/!\u001d$\u001f\"&&\")'*/-3$\nY˷{xtwruropkmhjfmpsjQ/$\u001d\"#!$'%!+(132&\fNɶ~{yw{wxvwuroqwxrX/(#\"&!''&#%'-21&\nGķz|uz{s^2%#%(#&)&'#\u001f110&\r.Ƹ{|vc:%%!+!\u001f$),#\u001f12,#\r!y¸ug=&\u001f(&\"\u0019*!)- /1-$\u0015\u0015jĺwh>&\u001b,%\u001f\u001e\u001d)!+..3,'\u0018\u000e_żxk>$\u001a,+ \u001b\u001a'%\"%.3/)\u001e\fOžxe;\u001e\u001c%*\"\u001e\u0016#'$#,0.& \u000fJÿx^/\u001c!(\u001c,\u001e\u001b\u001d##(+4-(!\f?¹uU(\u001d\u001f(\u001f'&\u001b\u001c$ '.2,&$\u000f4ĻpF'\u001f!#%\u001f+\u001e\u0015$\u001c!00/(\u001b\u001b,ü`;'\u001c*##\u001e+$\u0016!\"\u001a21/$\"\u0019'ó|}pX9'!&&\"\u001b(#\u001c\u001c'#-3/)\u001c!+{ó|{fe}{jO8\u001e&& #\u001e\"%\u001d\u001c%(+1+)$\u001b0vɸzzjNEhufI0 $'!\u001e \"(\u001a\u001d(,,.,%#\u001f\u001bpƴphXO`w~|r_>+%$&\u001e $*(\u001e\u001c&,(0(%'\u001b\u0006b|rpggfwymS:'$#!\u001c\u001f/+$%!&.,/*&&!\bPƿ}|usot{}}tgK5%'\"\u001b\u0017)-)\u001f%!)*...&%#\nFõ~~|{o`I1#$ \u0015\u0017((#%%$'--/)(&$\u000e0¾ʲ{viXG.#\"\u001b\u0015\u001b#, '!&&)3.*) %\u0014(ƵzqdWB1! \u0015\u0015\u001e\u001f'\u001f'#$+*70#)!$\u0017\u001fį~zp`T>-\u001f\u001b\u000f\u0015!!\"#%$&+(:*#'$!\u001e\u0014yðup[O?)\u001a\u0016\u0012\u0014#\"\u001a)!$(($:,%#&\u001f#\u000fj~uh_J@ \u001d\u0016\u0015\u0015!$\u001e\")%,#\"5,!\"&\u001f \tRþ}pfZL4$\u0012\u0017\u0018\u001a\u001c#%\u0019,-+$\u001e5)\u001d\"%#!\n3żspns{|zpdYH1\u001e\u001c\u000e\u001b \u001d)$\u0019%8+!\u001e1! \u001f\u001f&\u001f\u0015\u0012ƿr||sjdbefdgituyyjbXD+\u0013\u0018\u001a\u0017$ &#\u001c\u001e:3\u001f\u001b-\" \u001b\u001c'\u001e\u001d\rjžwwywuoi`addf^b\\cafgtyuiaUA)\u0014\u0014\u001e\u001f% %!\u001d\u001c42&\u001c'$ !\u0018# \u001f\nFǿpiihgaYY\\\\Y]ZYYXURY_s|qg]P=\u001d\u001a\u001a\u001d#\u001c\u001f\u001c\"!\u001f/-)\u001e'\"!\u001d\u001b!\u001e\u001d\u0013!Ľwnlcc`^dce`\\ZVOQT_l}zqcXG/\u001b\u0019\u001e!\u001b\u001d\u001b\u0019! \"*0*'$$ \u001b\u001e#\u001a\u001b\u001b\bZytogcfgv{}|ykaTA$\u001d\u001d\u001d$\u0014\u001d\u0018\u001d\u001d  40'+'%\u001e\u001c! \"\u0018\u001b\u000e'ù|wrpmqqwytf\\K2\u001f\u001d$!\u001b\u0018\u001b\u001c\u001c\u001f  36\u001f0&% \u001c\u001f#\u001f\u001d\u0016\u0015\u000f_Ļ}yrwuyvxy}wneR>\"\u001d\u001e(\u001a\u0016\u0019\u001c\u0019\u001d$ $19\u001f)*$\u001e\u001e\u001e$&\u001e\u001a\u0016\u0010$Ÿ}xuu}{}v}}xrj\\J1\u001b!#$\u001a\u0016\u001b\u0019 \"$\"$1;\u001f$-\u001f\u001f! \u001f&\u001f\u001b\u0019\u001a\u0006Qyxxsuryxz||zqrdT:\u001e \u001f\u001c$\u001b\u0018\u001c \u001e%)\u001f$/9 \u001d'!\"\"\u001f\")#\u001e\u0018\u0017\f\u0015u¼ytsurxvx}}yvph\\D( \"\u0019\u0018!\"\u0014\u001f\"%''\"(.9!&$\u001f\u001e\"#!)\" \u0018\u0016\u0014\u00075¿{|}~~yyrleM4\u001f%\u001f\u0017\u0019\u001c$\u0018#&()\"#+1.#$'\u001c\u001e \"%#(\u001e\u0017\u0018\u0014\u0012\tv}|yzuqgV9*\u001c'\u0019\u0016\u001a\u0018 \")&($%$.5'%\"* \u0018#\"%\")\u001e\u001a\u0017\u0017\u000e\u0006N~}{|zxtpj[D,\u001e\"&\u0017\u0015\u001a\u001b\u001c)+'\u001f&(*,8!$'(#\u001b\u001b#'($\u001f\u0016\u0017\u0018\u0011\u0007Fh¿|}{yywsri`G1$#!!\u0013\u0012\u001b\u001a!&')!)%*01 #'1%\u001d\u001a%)('\u001e\u001c\u0015\u0015\u0014\u0007>dryzu{ttqjbL9%#%%\u001e\u0012\u0017\u001a\u001d ($($)%),(!%&4* \u001a$'/$\u001f\u0018\u001d\u0012\u0018\t;fmy|wxvunthdM>)(&#%\u001c\u0013\u001b\u001c\"\"\"%(&$%))+\u001f%\"+. \u001e *.$\u001e\u0019\u001c\u0014\u0014\u000e1hrtv¾wvptnph`P:2**''&\u0019\u0016\u001a%\u001e\"'!'$$\"%,*$\"\u001d%+$\u001e\u001e*/%\u001a\u001e\u001c\u0015\u0017\n2cywuy~vsonpkg[M;32))(+!\u001a\u001a! \u001f%%\"&&#\u001f#*)' \u001d\"$*\u001b#)+(\u001c\u001c\u001b\u0014\u0017\u0012-^uzxvvpnihiaXH?:24(/%('\u001e# \u001f\u001f($% #\u001e\u001b&#**\u001d\"#\"%\u001f#)&*\u001f\u001d\u0018\u0015\u0018\u0019#\\s}zsyqifgb[OKA;930,,%*+$$\u001c\u001e%#$#!\u001f\u0019  '()\u001d#& $\u001f('&%!\u001e\u0019\u0016\u001e\u0016\u001fXr}ytyynj__]UNF?D<:51.)').(\u0019\u001d\u001f%%!!!\u001f\u001c\u001c )'' #\" %$&(&%#\u001d\u001d\u001e\u001d\u001a\u001bLsvxvy~wmf`[UREIDCB=<6-.)*-)$\u001b\u001d%!\u001f\"!(!\u001d\u001d\u001d&((%\"'(#&)(&(#\" %#\u001a\u0014Ily~zyu~ysi^\\WTNJJIHBC>730..-* $\u001a!$# &+%#$\u001a\u001d!*,+\"+'\"$%')%%!&\u001e!\u001d\u0012@jyzyx}~|z~}~z|{zxwuskb]WSTLOKKFHF@;;032.((\u0018\u001f\u001f\u001f&($/1(!&\u001c\u001a$)00!/)*$'*&&)&& &\u0015\u0013;bv~~|z~yuxtpwpvsvsrormmla_[WTVUPOPILFD@@8341/'%\u0018 \u001f!.*+/4+,*\u001b\"&*.2*0,*''.(&)()#\"\u001d\r6ar|||ytsppjmkjkkdfb`^ZZXXYXWURILLDFA@7523.)\u001f\u001f!!(+&$.00,. $,(*8.0+-'*/-'.&)# \u001f\f/Yly~~z|rspihhfdb`_b\\_Y_\\^ZZQQLMKEDH=9534/)# \u001e#&$ %//,0/\u001f0.+'7236,)(21*+'&&\u001f!\u000b(Zgr~xzsplijfgahdcccba__[TQOLKGJEC9971.+&\u001c \"#$\u001e\u001f00(0,%35()//973*/02.)&'#% \u000f$Ufoz~|xvtkmjkijjihee`_[YUPOMKHKCB>7<5/)$\u001c\u001b!%%\u001e\u001e,4///&01*)+->93,0391(%$'%!\r&Nfsv{|wvpomllmimhhce\\]UXRPQJLLDA=9?6/+#\u001c\u001b!'$\u001e\u001b.19-0).-),)'9:71/99:'(!)' \u0011 Gcsxv}~~|zwrqlnnmmjhhd_]]WVRNPMNGDA?@>82($\u001e\u001c\u001e(%#\u0019,:8/)7+1-)(#"
  },
  {
    "path": "contrib/att_faces/s2/4.pgm",
    "content": "P5\n92 112\n255\n}}}pkinjkigkjja^YUPWY[\\URMKKQ<;831-().9FLWSUQOPL??73::;@BCCJT^ijjqwltwvzwxwyxuuuuxuvwutqssv}|{wqhiiebaie^YPTTWQYUMFJB>A?6+*'$%'(&'-9=DGGIFIGB87/5849><D?GV[gbmmhqvwuvxyxtwswystrwutvtt~}}zwmikddb\\]]WTPWXWPOE?@>>=55&$\"!',/+\u001e!-98:?BBB<;455554575@>;BPV_\\fijquqyvvwwxutzuvryuutws{yxpsnod_\\[VMPOPORPUJJF?A=@;//+## '18>)!(49EGAA<<562,4417534;99AEQX]gbgtotuvuyqyryrutwvsuru~}xxmogmfXPKMG@KJKQPNNED@=9:900.1),*.@AA)#+)39@<=:.0.3%0721440676;?IKVZ_goiqtvssvqvutuuwussr|zwvrgjfXLHQMROQTWXRRQMF;;688;507/(3,<BC;*,()0::4:4/4.1)//-15.68287;@DMW]hlemprsrvtvrutuvsutyxwqpjaSGEDEOMMXXQYPPIKD?;6<9D<69-(2:=HAG87,-+5:76364,3.++',/,06:668:>9GTWafbjnrrtttuvxqvwtuy}stq`OD=AFIMQX^\\WSOPHIBH:>?>>@::3,2D<LIUG781,.334475013++&+0+*-:5:57976CDSWbdnmourvtuvuwtttywusaPA>@BNZ^c_XZXPKKHE??==8;?AAA@:=FOHUUX=<86442-/908//1..-,''-,3/6235:59AIQUdpsrutvvsqurvszrneSG<ANPVYa[XWVTTMSHE=FBEEGMHKQORGQ[[XZ\\P@>;<:99-1740112,.+*(#)&)-/.05:8?BHMVbkpssvuvurwssvqkXH?DOOTZ\\UXZYZWVPOHGCJKLOUXYTb]b^aeng^X\\MDHBKDG;455400/-.+,)'$%%,$//*16;<BFNObiqspquwqvussrZLACFT[]ZURYaa[UMFDHHMUWV[`cforsuw{~}r`_YQQOQWNIB=<6431(.*.-*&',(++-2++48;E?CRhilsosvovsrueQ@ED[Y_WQTV`bdZJCDAEMQU\\eemuyuabZ\\^b^ZOLIB<650-*2*,.-'-(+))365,.9=AA=Wljlqrrsutrm\\GDLUUWRPSV^`b[OHCA@FP[ahnv|teabffji[^WMF:7922.*..*),&''/-/11656=;=;SdfipnsuppcXGISUPOPST]^`YQIA<=>PVgkrzoe[eglmd^\\YSG;::5:*,).((*)$%0+/-447::>@@N[^innrqrUILKKPMNNR\\aXUHB984>HXcoy~dcYZnsg]]X[RG8A9:83%-(\"1-%!%#/'-23479<BCNYVahlosQJFDHHKJPXYZK@9534<IP`mywd^VYjqi]ZYUM@D9>;9/+*++;*% !)-\u001b+2-*97A>ENVQR^dnF?EEKMRQVQKF>4479=DR\\ly¿wecTXjpc^eRPFCB<;794+/*092&#'&,\u001d0.$029?6CNOXTTJGFHGPPUOPH>8983<?CK^cuƿuf\\Z[fcb\\^QIFEA<962/2,-07('\"!,(\u001d9('.386=FOGOOGQJMJPRIDA;23154>>MUfmĽ|ibZa[[\\XUJHIDA977.803+43($\u001e\",\"+/$%/471AJJLGCKJKLOEA:4.-067<>FV_mng`ZXNZTNLKHD;=5216/3.63$#\u001f$,&1(&(1338=CA=CIMLLEA5/),/166=HV]e¿wgZTLQMLOGGF?<777/515.44+\u001f%#+03-)(0/:A=@=5OHIE94*)(&/56AJT]h{ÿmaMILGCIEEB;8651+;/8012.,')243!++/58CII;EI>5-)&#()49:CR^izgUL@B@ACCA@564.439:116/#(*44'','039KE=?;8,'\"%$(.17=O]k}ÿ¸nhXJ?<>BDC>6:/3085:123(#&-9/.&,&2.A?3:62&\"$\u001f'*32<H^lzÿ}tpa[I@=<?EC:114/67;,.4+#%50.).#'2*3672,#\u001e$\u001f(/26BTgqtkdbWK?;<?=;50345:80*2()*4-*(+*&2(7:-0# %('.3:K_q{¿yl``ZP?A::894756;:72116&35-)(.*/+>;4)*&$/)/8DUhnĿ{k`c_KB;:562776;??E;;73.8.%+.0/1;=45+-'$&5>H]htľ~kek_OA?73.3258:=CDE<::64+//(-,2A<40-*$0:FOapzvde`PE@2.+*1/39==B;=<;43(*+&),D;85()(38GVo½qh`\\RF:1(*,/).62:866;794,%('/E=9/*+.1?Icth_[QF;3.*+*),-.55.77:22(&\"(F@4/,089:Qt¾xka[OK>6.*(.'%-.36-5;08.(#&FA2-310/Dfod[XK?//&+)*$-411.:773++!D:6.0-,6Suɾvf]WPB4-&*-'&+.)/.78554)D;510&->aúzumopotwtzslbSOB6)&($(&,+1),7.-13D=43-)0Hlſsgd\\fajpglqxu~updTE@?1(#%*&&(/)/+0,--I9:6)%6VxúvlfbgjiilhmozukbPD6/52+'(!&)\"*)0((./'@<;5&(?dżz{oowqjpln{~tgYLD?72)-002\"'!&&&(*-.+/*C:;2$,Nmv~zxwwwy}zrfQI?>981)-/09+&$'!\"')&,,..F?7/\"1Wvľ}|~}uomg_KJFEGCFABD=C?.(&% '&+#/,/EF6/&6hýzxtpursptwx{{yqihf`]^[\\[]aa]_\\ZTD25\u001d\u001f#'$)+-+L?9+)Eozlh^iuw}~wjlegfeggcdafgbbb`[OB9(\u0013\u001a'$+&1)G@4\",QxüqogYdov|w~{pkiehaeda`]]^][^Y\\XUHD,\u0015\u0011\u001c#%(,-D>/#1^|wk_[YZY]Zbmuswyrjfbehe_]UTQUNNKJITXRNI2\u0015\u0011\u0015!\u001e#$+C9,(>e¾|fA8?7KK\\Vdnrsw}þmebafb_TUZVUWPJIA6>PLHH4\u0016\u0010\u0012\u0017\u001f\"\u001c'?8%-Ilv}h<.3'=KP\\^gqty}ĺ}i]b]_ZXW]`]REB<734.:GGI.\u001a\u000e\u0015\u0012\u001f\u001e\"!:6*,Mq¾x^4,(*>\\QXdlrz}Ⱦzb^]\\Y\\[Z[gbK0*%'/*'(?CI5\u0015\u000f\u0017\u0015\u0019$\u001d\u001f72..]yd>/4/Ta\\Qktè}ccba]^Ycp`3%!\u001a(7\"'5@F5\u0013\u0012\u0016\u0017\u0019!%#86)<_{ÿuJ:>EbiiivƮdkmfWZex[*$#\u001b&=,\u001d0<=5\u0016\u0011\u0018\u0016\u001d\u001c')54*AeĿmedknw|ǵilpd`^hzc.*& 0:0#-:A2\u0013\u000e\u001d\u0019\u001e  %25)Ek{}phmmluxqlomnhikvm>!)*;9-16BC3\u0015\u0015\u0017\u001d\u001d\u001f\u0017&321Erýzzrmoppu{ŤzopnllmhhmpgSF<?B6-5>IH7\u0014\u0019\u0015\u001b \u001e\u0015!22)Lv¼~wuqwy~Ƭsupojkmhgd`ZOIC>84?EIP8\u0018\u0012\u001b\u0019\u001f\u001b\u0016\u001a01$LwÿƲwz}uslkmifd^ZQQGFIFKSSA\u001a\u0011\u001b\u001b  \u0017\u00182/&NzĿȶw}}rqipjiic^_VZVSVYQM\u001c\u0011\u001a\"\u001d\u001c\u001a\u001f6/\"Kz¿ȷw{uqrlmiheebbbW`[[P'\r\u001c\u001e\"\u001c\u001c!8''G|ɻy|zvtsoklhlmijfdaT0\u000b \u001a! \u001f%4(%Nw{~xyswvxyvqpdZ3\u0014\u001b\u0019 !\u001b\"-))Krƿ|}zxm_:\u0014\u0019\u001d\u001e\u001f\u001c\u001c0'/Ktz{~qc>\u0013\u001b\u0019!#\"\u00192&1Opyve>\u0014\u001a\u0017\u001e$%\u001a3'5Pow}zk?\u0016\u0019\u001a\"$\u001f\u001d2-3Pnº¾y~l:\u0017\u001b\u0018!\"!\u001f0/3Pm¾¾y{j9\u0014\u001a\u001c\u001e\"!\u001d1+;Okſzxg0\u0013\u001b\u0018\"\u001d #/,:Niý|xzX+\u0011 \u001d!\u001c\u001a(314Lkÿ|v{qM\u001f\u0012\u001e !\u0015!*82-IgĿxswy{iA\u0017\u0014\u001d%\u001c\u001c\u001e#;9.Egvotymnu||y\\,\u0014\u0018\u001e&\u001b\u001e!\"5;-;d¿yz|ug`nu{|y|nL\u001d\u0014\u0019##\u001c\u001f\u001e*33&1aÿ}tgZgry~y{vh7\u0011\u0018\u0019'\u001f\u0018!%)0 \u0018'[|½Ż|rn_cp~}|{y~zpZ%\r\u001b\u001e#\u001e\u0017#(',#\u0013\u0015Twx{qnhmv|z{~~~xj?\u0017\u0013\u0016\u001e\u001d\u001b\u0018&)\u001e+%\u0010\u0010Duÿ{zyutxy~~~{}ws[.\r\u0016\u001c\u001d\u0016\u0014\u0019#%\u0018)'\u0014\f1n¾}{}~|~~~qoI\u0019\u0012\u0014\u001f\u001a\u0012\u0016\u001a\" \u001f,%\u0019\u0013\u001a]}~}}vqc0\u0011\u0016\u0017\u001a\u0017\u0011\u0014\u001d'\u0017\u001b&\" \u0012\u0017F~ytnS \u0010\u0016\u001c\u0016\u0014\u0015\u0013\u001d$\u001f\u0010'\" \u0016\u00150wÿÿ}~}wri>\u000f\u0014\u0017\u001a\u0013\u0016\u0018\u0014\u001f%\u001a\u0010 &\u001b\u001c\u0016\u001ff½u{|}~}|{rq\\-\r\u0017\u0019\u0017\u0014\u0015\u0019\u001b\u001b*\u0017\u0015\u001f%\"\u0015\u001d\u0019J{wxvvytjjeikit}}}z}yyznnN\u001f\r\u001c\u0016\u0014\u0011\u0016\u001c\u001b#$\u0019\u0018\u001e\u001f!\u001b\u001b\u001a3s{owtqttqlbfcc^\\\\]\\ZX^hu{|~~|z~yvnf=\u0013\u0010\u001a\u0011\u0019\u0010\u001c \u0018#! \u0015\u0019 \u001d\u001e\u001b!'_»{cWW\\giagntnuy~rhdghe[`XSKPNUdow~z~}urn_-\u0011\u0012\u0019\u0012\u0012\u0019\u001e\u001e!\u001f\u001e\u001f\u001a\u001b\u001a\u001b \u001d!#EkPHCZe^h~{~sng[R?DGGLao}}|{tqjO \u0010\u0017\u0014\u0016\u0016\u001d\u001d\u001d\u001e\u001a\u001c\"\u001e \u0018\u001b\u001b\u001c##9h»ioswjq}yvpaS;+/69Wk}}{rnc?\u0016\u0012\u0015\u0015\u0018\u001c\u001a\u001f\u001b\u001b\u0018\u001e\u001d\u001e\u001d\u0016\u001b\u0017\u0019!'4S|~yynaSA2%-8GZp{~~vth_)\u0012\u0017\u0018\u0013\u001b\u001c\u001b\u001a\u001e\u001a\u0019\u001c\u001e\u001e\u001a\u0017\u0017\u0016\u001a\u001a*6Ag}xpipmecRTLGJMTeqv|}~|rmhG\u001e\u000f\u001b\u0016\u001b\u001c\u001b\u0017\u001c\u001a\u001b\u0015#\u001c\u001d\u001e\u0016\u0018\u0012\u0019\u0019-5C[sÿ¿x|ytsgjfe``fuxz{uql_5\u0012\u0011\u0014\u001f\u001b\u001d\u0019\u0017\u001b\u001c\u0018\u001a \u001d\u001b\"\u001b\u0014\u0018\u0017\u001b*6GSe|¿{umhafpx~}{}}ysliN#\u0011\u000f\u0017#\u001c\u001a\u0018\u001c\u0019 \u0015\u001d\u001f\u001e\u001d'\u0019\u0019\u0016\u0016\u001a.8DWbk|pfbekr~{z}{sph]4\u0014\u0013\u0014\u001c%\u001d\u001a\u001a\u001a\u001f\u001d\u001b!\u001a\u001b\u001d(\u001b\u0019\u0011\u0015\u001a,BEZcen~y{wrvvtslbaefpy{|xvtlkbI\u001f\r\u0016\u001c\u001d\u001b!\u001b\u001c\u001c!\u001e\u001b \u001a\u0018#' \u0016\u0012\u0011\u001c-EJVegkr}wtrtpropki``bgms|}zuxxtqhjU5\u0012\u0011\u001a\"\u0018\u0017\u001d\"\u001a\u001c(\u001e!\u001c\u0018\u001c!$#\u0017\u0017\f\u001a/EOVchiit}sqnkkjfecb^bhmrwy|ttrwpjhaC\u001f\u0010\u0013\u001d\u001b\u0019\u0018\u001c \u001f\"+\u001f \u001a\u0017\u001e'%\"\u001a\u0012\u0010\u0014.ISUeekjiw{{rqmljgkijjjqntwyzttsrkidO'\u0011\u0016\u0016 \u0015\u0019\u0018\u001f\u001c#$* \u001e\u0019\u0019!,$\"\u0019\u0014\u0011\u000f1HU\\bdjllju|{zvrtqnrrqrqvrwzwxtsmkhS0\u0018\u0018\u0011\u001d\u0019\u001c\u0017\u001d\u001f\u001c\u001c)#$\u001e\u001b\u0017)/$\u001f\u0018\u0015\u0010\r-DY[bdjnmkjwľ{{xyyyyyxzzyzyzxqrif\\6\u001e\u0012\u0017\u0015 \u001a\u0012\u0019 \u001b\u0019 %\"\u001f\u001f\u0018 -)'\u001c\u001a\u0014\u0012\u0010-CZ`bgijnmkit}zxqlh[=\u001e\u001a\u0018\u0017\u0013\u001e\u001f\u0014\u0019\u001d\u001d\u001a$$#\u001c\u001d\u001b(%'$#\u0018\u0016\u0015\u001c(ETcakiknnkifszxkf`G\u001c\u0016\u001a\u0018\u0017\u0016\u001f\u001b\u001a\u001c\u001c\u001a\u001d$# \u001e\u001e\u001f#\"&'\"\u0017\u001c\"\u001c,?Uaggmjonkjihpysf^E#\r\u0019\u0019 \u0011\u0019!!\u0019\u001d\u0018\u0019%&\u001e  \u001c\u0019\u001c%$*\u001f\u001d$%\u0019-:U`gkmnpmniihgox¿}ug\\D#\u0012\u0014\u0018\u001c\u0019\u0017\u0019$\"\u001f\u0019\u0019\u001b&$\u001e\u001f\u001e\u001a\u0016\u0018& $ \"-#\u0016%:P`iisoqpnljljgjt|wj[D(\u0013\u0010\u0019\u0019\u001a\u001c\u0019\u001b%%\u0019\u0019\u0019\u001f$\" \u001d\u0017\u0014\u0019\u0018% \"\u001e)-\u001f\u0013 7J_hoptsqrommjigknyyoZD.\u0019\u0017\u0014\u001a\u0018\u001b\u001b\u001a (\u001f\u001a\u0015\u001c\u001f#\u001f\u001e\u001e\u0016\u0014\u0017\"!$#)*#\u001f\u0011\u001e8G\\hnntuxtsolmjjjhpszzqZ>2'\u0017\u0017\u0016\u001a\u001a\u001e\u001d\u001e\u001f\u001d&\u0014\u0019\u001d\"$\u001c !\u0013\u0013\u0019$ \u001d)+($\u001c\u0010!6EZfmpswx{vqrqppmmklpvx}~xuoZC2+!\u001f\u0012\u0018\u001a\u001b\u001d \u001d\u001c\u001d\u001e\u001e\u0014\u001e%\"\u001f$\u001f\u0019\u0013\u001f !\u001d\"/$%\u0019\u0011$9ESfnotyy|xwvstnqpnnpossv}~|xrumjVE73(!\u001b\u0017\u0017\u001b\u001a!\u001d\u001b\u0014\u001b!\u001d\u0016\u001e''$ ( \u001c\u001e\u001d! (,'%\u000f\u0016&8FQ`opruy|zz|wwrrsqqrqtlnsuz||xzyrxsvy{vvrnoie`VB<72)!\u0019\u001b\u0017\u0019\u001f\u001f\u001f\u0016\u0013\u001d!\u001f\u001c$%(! %+ \u001e #\u001e-') \u0015\u001d%:EN]joqvv|{|~ytrvqvuvrsqmnoptvzu{qsnshpljlmokjifbaUND@89/,\u001d\u001a\u0019\u0015\u001e\u001f \u0018\u0019\u0017\u001b\u001c\"# %\"% \u001a)%$\u001f\u001e\u001e/'+!\u0013\u001b/4DO\\cnptt}{{}{wtsuswyxwtrnknlkoljjgcfa_d``_c[][VTLKE>:6/( \u0016\u0016\u0019\u001f#\u001e\u001a\u001d\u0019 \u001e\u001a \u001f\"$% \u001e #+&\u0019\u001f/*%%\u0011 (:DOVaiorvzxz}|~{wvtvxx|z{upqmmjfheda^`[[[TYTX[U[RPNED@98/'\u001f\u0016\u0019\u0014&$ \u001c\u001d\u001e\u0019\u001b\u001b \u001e\"$%\u001e$\"!,+\u001b\u00130,#\u001e\u0018!)5FKW]cnrsvyy{}{{vvswv|}{ywqqqljicc_`]Z[VWXYY^\\UTMMJCC;35\"#\u0015\u0019\u0018#+# \u001a\u001f\u0016\u001c\u001b$\u001d!%!\"$!%*$$\u0014/+) \u0018\u001e)0IKX[^irpxtzx}z}{uswuz{{|yuuqnjkdec``Y_[[[]_[YYQPJJH@@72#$\u0015\u0016\u0015$,)\u001b\u001f\u0018\u001c\u0019\u0019%\u001c\u001b(!$*$('-\u001f\u001e"
  },
  {
    "path": "contrib/att_faces/s3/1.pgm",
    "content": "P5\n92 112\n255\ngihligjmnkimjojmopplaZVmssiiad_[]i_[WR]qcW_w}`Zdhikfgb^ZVU``YWF8773?D^hmmomqkmqonjnmojpklokjfjkhigkkkjgnjokmmokZHHLbmrmp^j]_biccYeke^[btwaUX[chpejougaXFF9,14'%4HbipinpjqjpmmnlpnmnknjjgjhjhiilghklkkllnsbV<OVahohfbc_atwqrrutjgdjgqwrjUOQa^mrfcUJB<<4-.+*%#5L_ihjklkmkonkkrhplkolkeiihjijiklolninkokYB>T`dfpnpfknetwwghljo{t_[`a]RPPD2589766/- %'5OYecklgfgjmnohlmmlljokfkekhkjikkollnmj^J5>Vdeltsj{u|{pb_^nopkc][\\RNE=7<4124:96-,($Kbb[himhchhhojmmonjjlhghiilhnkjpmo`a`eVG9DV`bcnsbrjO[Shb_iYUUTSLAF=B5@:?;0>2%%;^g^WVW^Y\\UYailhonhpjgihghkhikkopg`ORMNLD[]`Z`guu}~ri[YZidWa_UMI:9==>:=>583F@3-0KRcQC8HNU[WajmilimklghhhkjgjikpmXKFHCJPa]cbW^n~xz{||l^QW_`YYbYJ?7:38=@HBGQMC>>2EOfZE3;8Lf`bfmjknknijclhhmgkilm`RHE<CFU_Z\\adk}~~y{xw{}kYP[TOSWZVP>=38/:HLRJE><:.<bh\\F7:9HibfflkikjoihgkhkhkkikpeYT<=DJTa[Ybcu{vuuwqwtxsm^XXITVVV^TD>842<;A<7-26,EhdVH76KD^blelgohjnjgjjmkljlikimUQBEOIIZVZe_m|snqjf_eloyyzshcWSRTUZRXD73:452=71;:\\daOC;FNMSdijkllnjoifigjhlmegbj^ZSUM_LDMKOffiv~~{tqb`TXYcgnsx~vusi]TLKRU\\[D3<490421IaYYQLDOTUSbgmkjnrmmmgggdejgg_f_[ZORN^TN@DIddfhoquvzqnmmgebVKLHLT_fmpomooogWQIMX\\RB;<5<9:HWFJNTNCKUVfkljodrillhgg[XWVU]S^VM:XP[aMG7ATi]bZcjnrz{vjl^_X[TNHGEMR[ae`]`]`]\\[XZVSLFGE;CF@5;IP>=FSW^ihlkiommldgRONHBGMIWEC+XT]XMO5??RVU\\]_`Yghrqwvtdb]Y[TTMHFBBBINTPQQSTSSKLJKIIGKIDH7,5@LB@S[]`dkkmilllkkfKELLCAIFHGB3KP\\UIRKB?8DKU[dbZW[QXVabW]]YRPJJFKAA@DDLCMGGPOKFIJLMOMR[UOC1,9C@4?RbbddkojllkikaE=9JPOCH@DFABDENF[YOOA@ALU`Xb[bVVPQSFKKJEEGGFKHKUMPGLLLKQUSXW^c^fbggodWI74A:42>UjhjfnolhlmiU?682GJNJNACIQC=@;ISWVWA5?BTPXS\\ZWTLJFEBJ=DFAFGHJPKGQMTPSYajhnsyywzyvwxe\\I<6:131=JbkfgjlglkjZ6:7$1*59:=9:KF;?E?JWKSIAE1GCRNOWW[WVQVKLNGNJUTPOHMX[Zdafiq|~|~yi`G5@(+135AZjgghgiijW93/*)-83=669A@5:<B@NUPSKF85;EKRUQNUOX^]X\\[Ydfh^`\\`cfhopv~}{h\\B;-!'10<>ZjghljiaY3,,//.222<:6AF<9,8:?JUXZSMPMNHMMZY]Vd]hehfjnptqstqsw{ze[B/\"$(5?8EUihdkh\\F5&&+(!-?PMHAAGK;6683:HMMRYV]\\UY^cclipqqmomqwvfY/(!%48@5KXhdfjH2)\"\u001f\u001c\u0019#EdlaYTVUUQG><>97:>JMagjloiolz{qgM)%*'2=>;SYlek:\u001d\u0019\u001d\u001c\u0019\"EYehfltnc_ZYUIDEIOYfpv|{pj=&-*-:8=8Qcif!\u0019\u0013\u0019\u001d\u001c8T_ihw|wsurioszt]2'&/76<7ARhf\u001e\u0010\u001c\u0016\u001e/EIdcgx~xqI/'-/6198BSi\u0016\u0017\u0016!&;<JYdxu]2'/(.$:42@W\u001c\u0012\u001d&/5APizĿwk=10'-$)9-0E\r\u001c\u001d*07Je¾¿wqU40,/+\u001c.3$2\u0018\u001d%3+HYjhjl¿½zljC-5'3\u001b(,+'\u0015%#54EGLWWk{¾{nfO-071#\u001a#+!\u0018'*142<?I`grxÿĿ|oeJ>.0:*\u001c\u0019(\"\u001c)0.-24>P[[jn}yrbL89157\"\u0017\u001d\u001e -*(/1BJFUZalwĿyoaO77-&;-\u001b\u0013\u001d2-(.,76;CNT]huý~vk_T<5,\u001f,2\u001f\u0015\u001b*)#/.09?9EPWhxļ{uk`J=90(!3#\u0017\u0010)%+'+/6:9>MWis{sn_K;10,\"**\u0018\u0013\u001d)%'+123.:K\\auzypk[N85,1%.!\u001e\u0016'\"(*(.-,*<FYbsrnkZG9,1-)*#\u001b &!(#$/%.&6ISgo¿sjj\\G6(.(+#,\u001a\u001f$!\"%\u001d.#)#0DUmv~nkhZF/)&+(#$\u001f\u0017\u001e&\u001e!\"%%%\u001f.I[s}mlg_>/%) &\"+\u0018\u0016\u001c%\u001f! -#\" /Icv|phkU@* #$$'%\u0018\u0017\u001a\"$\u0017)1&\u001f*-Hh|rjjZ>\u001f$ '!\")\u001a\u0018\u001e\u001d\u001e\u001a50#*(0Ki|omg^?'\u001c\u001d%\"!%\u001f\u0015 \u001c\u001d\u001a(-(2(7Ao~|w|vuvy|qmg[;$\u001a $!! \u001e\u0019\u0013\u001f\u001c\u001b\u001e+*260Cs}|z|zuic]`]X\\_imx~{urqostvw}w~pki\\0&\u001c#' !\u001b\u001b\u0018\u0018\u001d\u0018\u001e\u0019!2-9,8{}olejqkjfcYUVULRQRYhfty}vmng^\\YW[\\_dnrrz}ywvlhnV0\u001c!\u001e/\"\"\u001a\u001a\u0015\u0018\u001a\u001c\u001a\u001a!0/2%Cy}yspsprtxqtohheYVUUU_^imvxsce]YOMHHCLNP\\fgmpfba`bjW(\u0016\u001e #+\u0012\u001f\u001d\u0017\u0019\u001a\u001c\u0017\u001a&).3)O{x~vrkiecb]b^]iqrh\\\\VSTJNNKOQPRZ\\^_\\Y^W_jF#\u000f!\u001e'\u001f\u001c\u0018\u001c\"! \u001e\u001b\u001b&(4.)Y|v||zvlgcfdidg\\bctzg_ZZ^Z^V^`chjigbc^\\\\`Y[U`D\u001a\u0018\u0019\u001c\"\u001a\u001c\u001a\u001f%*)*\u001e'('9!+`}t|vvsg`S_ffibcequ`]Zdcgbfcgjnw}{yvkgiiYWa=\u001b\u0015\u0017!!\u0018\u001c\u001b\u001e*,7724#09%-muefm|}|tqg^XY^VVVaccaesp\\[_ffb[``hijmnny~wsnmd]`?\u001d\u0013\u001a\u001d\u001c\u001b \u001e/=:BHF>6/@*7}t]Y_dhi]U=6/-7R]QO\\c_`jvhY]_`W_^]dfpo{si_eowoimhebA\u001a\u0018\u0014\u001d\u001d!#4N[AJIRLN'?2C}smlkmrvfYC5#.?^cSOTbeftk`^WXOZbZI@BIVcii`Ucilmioe;\u001d\u001f\u0019\u001e\u001f/'?[aRUSUSQ64-Pt`UESWoi_ZYkyxrs]YLT`u`=,$!(8WYaSReloqqj=\"!&$(G=Jb_ded^YS761Qu{{}ÿ{ug[YZjyiE( *#;LNVWOdpoorl>&*8-=TTVbblspdYR792WĿ|}umkpyr^L<DCQa[Z][etqpqk@*>B1PaX\\dew~yhVU696c~||~vwv{}|uupntponpjgeqorm=;_P6d\\\\[ad~}qTI8CIjy}yzy}~z~|{vs{}zvruxrjOaqPQeiUcaalT9?gbs~¾z~}zzrtvtuuzy|y{|rxiZmtN_i`bacdx]1_|{z{ƾž{x~xulrnps|{}~{zvk_pvXfg__aael5y}vxýźvxwxxsx}{x~ztndqzahY[bdcfzOx{Ƽw||z}to`yvne[bgcgaw|~yĿ½xz~~ywjcy}md^ef_earky|y¿y}|xydcwjccbeed`{wzyyŽv~wunnyzh^dcfce`v}x{{¼ż~wz}urp}uvdZeaecd_X|{u}¿ĺ}vst|umrsoqcY\\eccd^Lp{xz|wyjq{vlottu[Zdae`fc>T~{}z}snymksvtpy~vm]`ccccbbQ6j~|{zz{n`g}ee{zlsyui[adbdacbBC=qztxxx~uj`\\bz{i\\i~witzo`fb_ccbdbIJ,:Ynpnxwuz}ypc]ZcostzmU[k~{mnkxtk_ace^dab^MO4\u001e)7ENL\\hwysswxxwoaWY`q~wn_RUgu~rlilvjTQ`t|vljeile`d^e]bb`cXN-\"\"\u0017\u001c#\u00144gtuqmoontx~~xsogaUW\\k`L<5F\\_oqxyxk`VUYgh_OTcvz{xtnmeX```db_d\\e^_a_V3\u001f\u001b\u001a\u0016\u001b\u000e\u0014^otqkf`cgspwuwuokbbYPRUfyeRBB<?QPW^Ybd_UB;GSjkgURTfpt~{ztrpjhZSY^bYfab\\c`_c]b@(\u001f\u0017\u0018\u0018\u0013\rDjrkmg^`^jjppkkf^\\POPT^lv^QJEDADJFLPIM>CCRbjlhdMRXekkuouqmlhmfb[[]``e`ac\\c`_b\\bW>)\u0018\u001a\u0017\u001d\n3epmolbZ^cglia_ZUGRRR_i~saQLBCE>CDDDCRMW]]fijeXVNSX_fjihhffc]dZ^_c``a`d]`__]\\^`U?.!\u0018\u001f\u0014\u001danrnoeb`ahie^_NJFKYYr{ufYQGKGGBKNT[[[_[\\ikgbTVOIUX]c`a_]^[\\^_^ea``_a^^``]]__[WN9/(\u001d\u001dSjnrpjgefnkfaYKKKQ[g{ymbYOKLJRZ^]^]_^cinee\\_WIGOVY\\W[ZYZ^^^d_c]`b\\d^a_^]^\\\\[`RUB@EEdkqoprgjroleYNJRUY_jtyq^UOKHV[a\\^_`cdgmjidnaV?IQRUVVVY[Y^b_d\\d^a^^`]_^`ZaZ]aZ\\[YVUXdptrulntttjdSO]U]X[gt{xiZVOJW\\b]`cfa`dbihlqkgMDRXXYYW[Zab`^b_ca]b\\a]^d[][_]`\\^\\\\eVPbkquvvnqwuup]`_`^YTUbx{oga[UX^\\_bgee]]ZdahslkYOZa^XYUZ][\\b^c_a_a^a]a\\d\\]\\^[^[^_\\[cLVdoqttossxy~vllhieaNEN]jpz~vplb``]cdbc_\\WUUWZecgb^ch]]XaX[`\\b^b^\\b^^^\\a[a[Y]\\W]^]]]aWJI\\glrxolsv}xutzvraE9NVZamqv}}{vvhfcb`Z]QSHB@@LP[edmghb[\\[\\Z\\`]`___b]`_]`Zb[YZX]_W__[`^A?DW`jmqqmlnx\\VYJO\\YT]fkojj_XSIMHR74-7;LQ[`gfugjaXY][[^a_``]\\b\\_a]^]][T_W\\Z^^^^\\O&2^LTahmmrljn{~gSUe]Q^a_VX\\XSI84HE.4DX^\\bcggluldbW\\\\W]]^_b[b___^`_]]\\]XX\\[ZZZ\\^PA\u001f%l]KVailqlfnv}xejdQ`onfjkdXG5,7BCPehibebjlnuhc\\\\VV^^[d]`a]_[c[a_][_^^Y[Y[\\Z]VM5\u0013#moOKZ`ikihjppywtpgm`YPSLNL\\[jkklifhqmof]\\ZMM]`_^^`[cZ_^_`[^]]\\YYY\\X]XZSF/\u0010\u001frtdFUXhbhdgnp|}wwjfd^`knonmnimpd_\\[UA.Z\\^^___[a[a\\``]^[_XY[W[[ZUQ?%\u0011\u0016o|tROS_chehinzyrjcejqrqnpokm^\\XZG,#F]^^]]aZ^[`^Y_]]\\]YWYZXXPUL/&\u000b\u0017k|wdKKU_ckfeozznjfhkotrnqnlh][]N1($1[^]^[bX`][`\\^_Z_ZWUU]TUPPH(!\r\u001dh~srSKQZcgmhryz}}{zuoqtqsnomkddhmqrqormieZaX8!%!,J]^\\Z`Xb\\_Z`\\Z]_YUVVSUTLPA&\u001e\u000f\u001ch}{tbKL\\anlkpy||}{vxpqmmkefhjbgaedjitqrnpmd]_]K\u0017\u001d\u001c)#>]W__]a\\_Z^]_]\\[ZQRSWTSLO7%\u001d\u0015\"my~{iWHQckqjpu{{}nncdgkjgecca]affkjqmrpki_[]X.\u0015\u0014\u001f#.0AVZ[_\\Z^^ZbW]]]WNQMTPQKC6&\u001e\u000e/mw|~wcQFUcmrosz|wnhdeffcgd_bYceikjropkoc_VaN\u001d\u0010\u0013!\",+.1DQS\\U`Z\\^[]Y_YSMTQSOP<7$%\tHnuz}o_HJWirpuy{xqofa^\\`hf`^hkhhmoprkg^_]_\\\u001a\u0013\u0014\u001f'+)/()3=NQXZ\\]\\^XYaQPRNWPM83&$\u0011ctsx}{kXEMahqtz{utqmjf^babd`cijmipnpqhdXZ\\i^%\r\u001a! %1.0%,*-=FTUY[ZZY\\JMAKQTA:()\u0018!ouuw~sdR?Q\\ityxzvrnmfe`bdjdnnqrstonf^ZVdle(\u0010\u0015\u001f#(.0,*),'+*9>PZY_WZL?BLQS6:\u001e.\u000e,xyswlaR8QX`ttwsrekjlrrusu{oqgeZU^mm` \u000f\u0011\"%-,2+.*#0'+)+5<RTYXNHJSQF:+!.\rDyzo{{wl\\H5JVepw}|x~y{}ypkb^O`knnZ\"\u000e\u0019\u001e&--1,++&,(-(+)0-EIYFBJSOC6+%+\nVzyuy|}ue[F8ARfot~wqd^T[kliqU\u001b\u0012\u0018\"!1*3*)%\"-&)/)/+0*/FEQNRR:74%*\n]|wvu}~xpbSG9?U_kw{{|sm^X\\hkmjnN\u0019\u0010\u001a )*42. &'***+,).1*1)NLPRK>124'\u0004g|w{t|wg_OC6:L_jtv~~xzukgVZjnklklB\u0018\r\u001b\"(3.40\u001d'\"*(++,#3*/./FBOWE?420-\u0006l}~twxzvqd]F@5>A\\gt{~zppxxwneWT`nkkjib8\u0012\u0015%%+0240\"'\",)$0+.(./00FHUMM<8;0.\fr{zur{}si\\SFC<?C_cqnu~}~uwpqxurif]U\\jmpigfY+\u0010\u0016#..124* &)&+#*)+'145/MOTKC9646-\u0006x|qpxwl`ROCBB=BOT``jlsuwvpossouu}twpg`eTU^elplgecD\u0018\u0010\u001c',0.11-\u001f)++)&&+)/-//4PNYH@9443-\nq~~worxncYLKEDE><BGKZW\\jiegdjjjihoee`\\[QP^ilhmgee\\(\u0018\u0010$)-/03.'+%'#-'),$--+0/PRUGA3:/1,\t`|{}}qmz}ud_VLGFCC?:?<DCHVXSSVY\\Y`X_RWISIU[hkognchZC\u001b\u0017\u001a-'110.4)1%,\u001d)(**&,,,/+OWNM=;;402\u0010K}xy|wlw}zmc\\VIEAAABA>5:7F<CAGGFMJJJF?COReghlijfgaP+\u0011\u001d!,*-/101,+(,\u001f(\"$*&/\"0),LXRI=7<661\u0013:{x|yupnw}sm`ZOJCGCAB>:99:9996?5><C@IEV]dghjihibg[6\u0015\u0018 ),-)/3..)+()('\"\u001b,!,(,&+"
  },
  {
    "path": "contrib/att_faces/s3/10.pgm",
    "content": "P5\n92 112\n255\nhmgmkmmlmkpknpkqdH5<J\\`WX\\UXHTVcQbd^dXV_SX[\\X}fIQWHOCM@-<1728?5--4\u00114SXTXfdZ\\]ZSeolsnroononnnfjikjlkkkohplnlbK,8?IS[XQXUVRDm|qnhn`KS[U`ha^WPRJEH>:8746;=/=1 \"VTLTC8AMKZSVhmoopqomppmokkhmjlkmkknlnppV?,5GGJYXZ]dYnY\\rvuV]NHKVcUgjOQJ?AB<>4<83,:G@.\u001dD?LR?...Dib_ngknsmonpnnnmigpikpimknlkti;-%6EKMW^]Khou`]u~czR^QO:ie][b[O5./6@>@;24N@?@:/H@]D-02ChbcnjikopoqopmohjinklmljmojmmV.#(1BBFOPUZ]peypd[ovntel^XOIK^dUY[OD?,2(5GEND?)*5\u001e9[UB*.4OT`hnbnhnpqpskqmhmjkiklnhqefjjF.0*<G;9EKLsgbSehjhZ_x~zeaiVOSQERiFS\\J>/63,<:7*-)-)9aQ<.2F^F[jniolpnoonnmpjmkkmjlkmoN9EI;2-;IK?;?Fhdbp{Y\\bcgadhkvukcxr[ZSCITQNYX[406=0-6531(MZJ?-DUVWYlkkmkvmnqpopmmimjillopf=0432,8GG?IINVopenkvrtX\\\\gb^Uflutrvp^XHBDIEVYU=2;79(.+1MQ>I=UQT]]mkmpguknnpnnolhkljmkokJ//2,/07GJ:>MIawim}wkjqykZdcc`TVYiqpmq}str]WK>CBQZI=D4:<+?K@<?OGEBR`cmomlkpopmrkqkjmlnklqe?;6(*9/,CCABIHEq]\\fwvwkdllqlojbZPKOKRddoid^^ZXfaXXQTTRNCP?<=I\u001e7@NAAM[]fllnojqnporlqglilkjmmiN;:2/E51(@75NQKUaWb_btzn]_\\`camZ\\XDD4>?JR[_WWNLQTMGGCC>AGHN9:\u001e+<?RW[dbmkpoqkqoppqoqiljoihpeaAG=;B1J1/*56CJQKMP\\ccnpoxu{gh`XVUaZXNGC;><@E?>?FHDH@EGFN[SfQ='%*BU;UXhgcflmnkksqmqmjimjjfcNLB@D2=7FG/)) ?VPGIHDWANV^Zcjdgada[ZPLJNHNSAIHISIGYPV[beisqsqrbD-$9^71F[inghjljktplopiiihj`Y>KE@2*;F8C72$!\u001e:>BBFPTKEEGFFORPUPPQQKKMOISYVROP]PTbjpy|}{m;,;HB'?9Lacemjlgjqoqpg_QPKAA5=H.-#C@AA65=)\"$\"0:EMORKWXNRVGD??;AGGJFJILMTN^_fhix|f<:8B#696=\\fjfpommrpqRK9=--+<*<52!86<>92RG50\u001f)33<JJENXLPRMSPMQVONUWVYZV[itv{~aE(E))45H/]napomkmqn>>(4:.,%<&637*+23/.<IID3\u001e)'-:CEHMQWVXTSYWXZ`_moplq{}c334%(6G=@]oblookos?:($0FE?2<6*:='$030+<C<:553+'(<CHMMONY[_gfnpx|T63$*'@H@H]gjqrpml7/('\u001f(-095//)/, $-728DFB;771)<;>BPU`abbtnvsz{uY3.5-0AEDDdhpnnqk)-;*\u001b )$'&6(.4.*\"\"(-.1B=AOHHNWSPQ[lnjor~zT.494:>BEPfloppm(;7\u001c%$$/0$,&,354(!\"(#(.1585=MU^hnplq{xE8/<@B1GBVetkrl3/$\u001f(,,$65*/.46?9(,,,,2,-:JQjux}xu}gC?53G+9=BNoqnsE!\u001e#&$\u0016/PWR72;@B?:;;=@6CSap|¿G7>=52#>:3Rums-\u001a\u001f\u001d\u0019\u001c\u0015Ujf\\WSUVMIOUPOUgºÿe;AC9>\u0012C5+-auq\u001a\u001c\u0018\u001b\u0017\u001a=`^coXvwmgnwt|ž¾½mTCC<C+\u001f>\"-5lv\u0016\u0016\u0015\u001c\u001a,O\\`h_szv|}s`B<B>B\u00164'9 Kw\u0012\u0016\u0015\u001f :MQ[T_yúºxlJ66IE\"\"%/B q\u0014\u0013\u001c\u001c/C3UW`xmMD96I?\u0016 -X%>\u0017\u0015\u0016(33?Vj{ɿmT:945O.\u001e\u0019DN\u0014\u0016\u0016\u001f407Hozrqy¾|q\\6A1#6G\"\u0016!E-\u0014\u0017)3-CUlZS`tzzúxrZ>@;*'81\u0010\u001d&2\u0018\u0019/)5>EJBChnqqy{scB<:=\u001d7*\u001c\u0016\u0018$\u0015'#23569@Pdfhh{Ŀwqf?=5=1..\u0019\u0016\u0018\u0015\u0019))*;4*7KWN[]duĽuvcA2;56./\u001d\u0016*\u001d&'5+/62CHDQQ]aryrj>271321\u001b\u001e0/\"00#.9394FLNWbpzutkE6+/1./!\u00188O!3%()3689?BIRgm{wpoG3/&3(.%\u00151i#. 2/9/:85<ISbjw¿wqqH0)+-&1,\u0016\u0017^\"'&1$+3/238MT[i~|pqO)&)0&'3\u0016\u00102&&\",*345(39HJ]j}½ľmpY#!(-(&*\"\u0015\u0019%\"!*/42+,+1OK`oȿžtp\\( &*+\"'%\u001b\u0016\u001f\u001f%&/:20++0DMk|~{{x{ztm^ '#,0 #$\u001d\u001d\u001e\u001e*!(277+(3C[qst}nonir}nunlbkna\u0018'*27\u001b$\u001c$*\u001d!+\u001c(-64/%-Icu|~w{z|ofbYY^b^iltkaZSXtY!\u001f)6=\u001f\u001f\u001a%,\u001f\u001c,\u001b\"*H/,'5Gdq|tkl`e`ffgu|sd[WOQ\\\\_kcqfbfaUlR\u001d#\"89!\u0019\u001d J\u001d\u001e$\u001e\u001a/J:'72Ecuxyxjo{~{ujjaX^YWW^den~}xxplf^klu~rqU\\J\u001d\u001e$.8\u0019 \u00120_\u001e\u001d!\u001d\u001d#CG67BFZxz}yurkv~|vjbjhox{srtvwwz}bVI\u001d\u001f\u001c)(\u001d\u001a\u001b,e\u001b\u0018#\"\u001e\u001d2<?CG<V{z{ysy}y|p\\F\u001d\u001a\u001e&\u001d\u001d\u001b\u001c\u001fM\u0019\u0018\u001b\"\u001c\u001c%2BFM6R|~z~}~x{²uzzpcigp~xrrhA+\u0012\u001b$\u001c\u0018  -U\u001a\u0018\u001a!\u0016\u001f(\u001f8CC-S~zptoaRYZZ{k{ĳry\\QKOEnwZox[qlJ&\u0018\u0017\"\u001a\u001b+@_h\u001e\u0017\u0014\u001d\u0018\u001a*\u00163E=/ZqfdlgSw]wXuv|yz|~vV=Fi?Ok_p|ttL(\u0019\u001a#\"\u001f?^li\u001b\u0015\u0015\u001d\u0016\u0018)\u0018(D66^pi_]p[>W[Å{êssyR\"f5D>QckzuyT%\u001e\u001b\u00173\u001d\\jim\u0019\u0016\u001a\u0019 \u0015*\r-;0*hlh_rrs34ob͡yzū{̎QS)5XPoTrwr~`\u001f#*1J;hkli$%# &\u001c-\u001c\u001b9*0oojvjf|ȲưfbI[^yfy|wzj\u001c45?hMgkij#,/+/''%\u0015902u|zŷ~p|tv{}p\u001d>7M~[`mfl412FF:-4\u001c#M7t´ŵɻzy}t5WIb~Wkeem7:>KPWJB'&=={üȹuUoUyXijjmDKE\\b^XP+ 68qýȸts_zYjjik^_Ro|vfU3+68jɺnil^ijhlwv[tP1.@:cȾlsUbkihmgwR(3<>h|ŽkVljkhmm|O)9<Jiz¨da_ikiikpwE)PEUjsy}Ŀ½»ưe[dikjlkxqA8ygXjlh~ƵnTigkiin{BS[gjgsķpYikfkjhdNaaeigp|ǷnMghiihh8^Wgdhhf{ƿǻn~Ugfliih&{RncjkapŲżkvXkghgjg\u0012vwtr{dil_gź|sbieelchi.Bo{fhncapȾq`dheggig=,u}fmpf[kƼit_kgehhihD$Fvhmrj\\b{~fi\\iffghfl?-+^wbrlpdWpzym~pw|wd`ddhegggi<@4\u0015ydnnslTdv|vyyQ\u001f/hwuwYFUrqfxkaefdhhihh>A8\u00139hegpl\\flv{z\\bQ864L_gpu{kK9KZ~n]caeffediegkBC4)\fXmUilnaYgpy~xer\\QB?;ORXWRGKRn{shYbfagchffhhfF?0(\u0017\u0014Kx]Tfipk\\`irsxvm]OA@LICJ_nx~yi^`ddeddfhffgf<84!\u001c\u001c\u0015)=c[M8Hdgoia\\_ljsxgg_`bVZfr~zwl`\\]eaeeegfggig399)\u0011\u001c\"\u0010\u0016\u001a\u0015\u0012\f.Yfks]b`abbhrwuvs~~~{ozwthZX`bcehchfghhdA<<\u001a\u0018\u001a \u0014\u0018\u0011\u0015\u0010\f\tI[gki\\ddc]^fsw~~z}ms~wti\\X\\`c`chagdiefgH>B\u0019\u001d\u001a\u001c\u0017\u0018\u0013\u0014\u000e\r\u0005/T_nhe_kjca\\kp~tw~huztajT^bdaefedgegggFDK\u001e\u001d#\u001a\u0018\u0015\u0014\u0012\u0015\u000e\u0007'AXkrhgkoqkbdp}|os~~~v}zp`cVaaddeddgcfeffEDG=\u0019!#\u0017\u0018\u0016\u0013\u001a\u0012\u000e%5Lbmfpnpwrnmn|rx{zje]XbbdeeegeeificEAHE6$#\u001b\u001c\u000e\u001c\u0016\u0019\u0010-3:]hjlquz}uv|}|}{dnW]`c`gcegehfhefDFDCHE4,'\u001b\u0017\u001c\u001d-680Nbfsszzx}yojhN^`c`eddhdlcddeABEEBEDDA>168@1;.9Qbqs}zxjkgRa_dfbgedfgefcd@DDEDDECEF@AE;\u000f:64B[fqu|v}ww{nmmkcjx}thlWUb_ebdeaghchgdhCCCCEEEEBDFK<\u001f\u00047;;4H]mpz~}r]CBCFPPQV[[hraT=9?6/L\\n|~njcIa`cagcfcfeeffdeDBC@FEFBFEGF#\u0018\u00053:E67Temty~zcN<:<DNOUPPWY9OJ<Cju{yxpe]UaaaecdfdbfeffdbDAAE@EBAEGI7\u0015\u0014\u00024=EH-E[akr|}~_QltSpz\\k{hkrsyy}pdkPWe`aecdffgcgdcdfCCDC@BFBGFD/\u001a\u0014\u0003/@BW:1LUenwz~qykyzz|yp{wk__L^c`bfecfagbfcfbc=DABCDDADD<1\u0017\u0013\u0005+FJOG3=IWiqv}zyyr|ycfS5ed^bachcedcgaefcBCCBFDBD=@<)\u0019\u0011\u0007'JNSSC/:Qakpsxq{y}ywwypdh?%^_bacfbddhbfdddeCBGEJDC?:CA'\u0019\u0010\u000b&MSYUK>/DXfnmtxw}}u{uy}xv|x|xv~tqtxgd`++CQ^_e`gdccbcdcebLKMMKGF;@HD'\u0016\u0012\u0011\u001bTTYWJD<1GYejvwt{|xupwsmkadadfhllprvyw[gF.1:5BJ[_hbfdfddfacRMOMKIK>EDB&\u0019\u0017\u000b\u0015SYZTNDE23OYekww~|phnphgkkfhkglgy~k^V-0484793DP`cbgcddbcVRLMJHEEGI='\u001d\u0016\r PW`YSI@;,:N`mtwvwsnknkmqswppz|ba1\u001f465979468>HYafaeddRQRKHIGGLI13\u001b\u0016\t5SY^^WNC88.9Ugsstvqxtx~}|v^:\u001a(344?6:59818<AQ[`f`QQOKKLCLNE50\u001a\u0012\u0015OQV_]^RM><1/4Rdpvo}{~lU\u0011\u001c+56788;67:5:17;8KX_OPOGLCEOO99(\u001f\r&]NT[[aZRH?91.6Kcpk{xi?\t\u001d,247>5=69569535968BIRKID8JOK6:$'\n?eJXY\\dZ\\LC@5313M^fq}ztZ.\u001a\u001d.574?6>8677;94876:5LLLKL<RR@?*/+\rRnLSU^^f]]M?@47-3FP\\xzojT.\"\u001f0;68:6:770359777:6=JNEK<ANO=:-.+\u0010^oUPU]iia[QIB951238E]n}|}pZQ=\"%3:6695663176575586:@DLGGDTL6=3.*\u0017et[STahjibXOI<:303,2BTnq|x_ZOE\u001e$/@49;72426498736666QEXM@KSH<883*)g|`SZ\\kljj_ULI98565*56W`qwcP`Q?\"+4>5==:146775<56<6:8PFOH6MVDB580/2piW\\baomgh^OKC=:762/-7D^mwvgUSgR=#2;:39<5057:76:75<<?;GCE;:NT@>99029yqcZcihtrjeZOKG<783945,5Tcw}wyhTX]bO=&4A31A5539;:74:985<<@AFHHAMPA;;@2/=|qmaaemmpshaYOHC=989795.6Q]ippzzuk_WU^dWP9+:823;:8479454;65=;9:POOCFQJ@<7?8-?ypjc]lpporgbXQBE=:;8:7825=LS\\cln|~}~}~|~tsd_UPX_abPP-8?803?4:93549684;99<9OQMDKRH=A2C6)>ytii\\dluupnm[XMEB=;>8;;65515J>RO^v^anhkofc\\OOINY]`hUUD3:=2667;9287-7594888<9KOIEJTD?@9?8.9|{pkmdccpvrpmj`VIIB@<99>5845/44436M>?FJILILPGPQSY`bfMQ68990;85=;7656101;49588OLN?PT?E<C8A,=wtnkibajuvtsmj\\SLE=B>8@676731912.1135;@FHNORMPTYchTNA39:3/:6474955745002;98;"
  },
  {
    "path": "contrib/att_faces/s3/2.pgm",
    "content": "P5\n92 112\n255\ndclclfkhflhmgnkokmmmolphmgY_gmcb_a]ViaWW_jzljg[Ze|`ahbab_]UWPQMZX_TYjnrknopnonmnlllokoonmnohdifiblemgllijkinjmlmhjfiidfcmggc^XUYYo\\SSnslaWOexd_\\a^YPMYZXNFHDKGRjqnoonnoojlkkmmllnjpjmdfdghhihgmekimikmlljdWWbilphhc\\fl^ZTR`nsqgmtjpfS]jp{j\\\\\\]V]ZVQ=?;BD>?Ulnqlklopnlqnlmnhnmnknegejbjijijikkkmilkm[LIJZglmpobXQTOETDZjijfboxeffj[RD<8878=<BAekujhoinogpjmlmmopnnjfihfkifjjiliikkjlj_M<9AUaljnqfgZRO=Y`MdzfkgYgrxn`NQE<403452?>1UflqimjkkjkokooinmmqigejdiihdkikjgkhkpkMD2GEWlhjmnifj_\\nclse`[Zfahj`KH;;5803:78/3Ohggdhfgjgogqoiooljmfgeghcljehjmhklji^9>?9GL^_agngldoqsst~tc[PgucfhP?;6@9<29982>dk`WPdM[]^fnlllmklpahekckhhhjimladccVA?BA@H`da_dmjlyvzsypkq}{^DLSc_bdH=3@7;568MK=O`\\E>XDDPV^cnjolkmlhchfghldljlkiQKRWSKLOKG[^baagkupwysmggsu|qsxykJGHW^]]QI45:7<=MF>COTCEWO9CV^fiinimmlfjfhhfjfijjjSI?GHRRU`ZR`ga_flops|vtjZZXhkhkqw{ucMQNGTOWK=85I@<411?QFV^M;@McjjjkknlmgeghifhijjjWE?=E;HKQMPGUa^cadipvqkb^NQP]bhijw~zrbSFGGJX@GA1:+410:TaYJFDP^nghhpilohffhfihjhidLILTBE@OIO@GGXYY`bgly~xypmknj^YKMEKXV_ehpzuhaSRAGMLPB>/1106YZUMJQWZeihjnnlndhffhhmnkmQMTQYKMTWLJQJHIPOUW_gqrtrmrzyi`^\\^TUJLEA<CGQW]^_XXSXNICNKH=24,8S]YRSX\\`fjkiopjndiehfijijaNQ[SR\\VWZMJXUN@EGHN\\ciiffcgdktxyomb][SLIOSF@;:;@=FJHLKNMMLKNJKB>1:TU^QXXTbbhlknlkqdgidg`icb[WYd^ZYJJMUYXZXJL:@BFU][bb^cWZOTVYMQSQKROMQIFD><4=8>;;79?B<B;::9=;APEQNMST^`fmjljmjgib_PNRXZdcS[TWJA<JPYUVQQCIF6G:JPRWb_aZLHB?9=:?;LCDC<A?B@F;;;?>=F9=A<=61<@B:@BETV__bdekkjjomhe^DF5BTPU_OUPQEB1BOKMPKOOYY\\QO@KMGQRXRMNL@D6:3.43564;;89?>C=DFECJGLINHPMEGAB=7[Sa`hgkhkinmiigYC52<OUX[RKRHEA><AE<EDJQQZ[f\\NG<>:GMPIIJNIEF:986?>:@@<>@CCCLPLNT^bfikef_RBC;5JPZehkmhjgrlkkcS9106EXa\\XQPNCC9HL<<<EDGBLLV\\^VK;558?@CJCHIIHEDFGOONNPNGJOZUZ_ajltpwxztqiM<<39?LZbfmhejjmjg\\H3#*--<CQKPEED9<?JF?8:DSKMPYU^^YK;575:?AGIGEFGNLNV\\^`d^b\\beimnx}sm>420;@GPbjkfgjlolU>3+''+;DGGKD<<73=EED855><F?YSV^`_UYPP:@DMOYSU\\Yb^]cfqttupr{xzl7+/58ICEejgjkiklU:3'4/:CIU\\VG6\"029FHOC;54=;9FEGGYHSQZ`W]c]e_bfhljqntxa5$)1AIFMemikikkS8+)20<MOONL?7('3CMPSMAH>A<?=:8>MX]gt{}wtstr{~{Y#!,0<NHPggkmkfT/*)-03051O\\\\G99RXZVVVO[TRIN@OQVesx|A$%+,BTISejkl]H+(% (\u001b\"+Ibn[QIgwqfedmwimdcrg3,)-5?TGWkklR/%\u001c\u001c!\u001c!\u001eDssm\\YhþU&&/48HRH_oj>\"\u001a\u001d\u0017\u001d\u001c\u001a/b}xofhsſuB')3.9QRM`l)\u001c\u0017\u0013\u001b\u001d\u0017+D\\jodelx}c0,-+%ILMIg%\u0014\u0013\u001a\u001c\u0017\"<MSfnskq}þwH+.&%BLP<P\u0015\u0019\u0010\u0019\u001e\u001d3DG`eszn}ľ|d22$.0PKF4\u0015\u0019\u0016\u001a\u001c*>EPgzz{|ü~q=91/ BHC4\u0018\u0015\u0016\u0019\u001e4BESanssv}xD+36 ->O>\u0013\u0015\u0017\u001d15><NQSclu}{X1,4.%(NM\u0019\u0019\u0012(*78BCCQ_lu~|Ŀ{a4+,2-!=U\u0016\u0017\u001b(.661?E[fempr|~|g</&$,*-Q\u001e\u0016!*4.-2JJVT\\ltr{~|p;0!&\",\u001f5\u0016  *5+/5;<MXYdftrx¿|rC'1\u001e*\"\u001b$\u0016\u001e&,*0)60>CVY`cklxÿ~}rE,('*)\u0019\u001b\u001b \".$(,(7:JMJ[_impz{|pI2((+($%\u001d\u001c/\u001e&*,0DL@BCPXjfqz}wnM+(*$,-I\u001b')\u001c%&015?:=9EZb`tu¿zyqJ.!''%/Y\u001c%#\u001d((,/\"4.5/BUZhr~uqK(%%#-1_\u001e\"!\u001f'(\"($0/1->R[o{~zqE&#!%\"3Z\u001e$\u001a\"\"#!$&03$-?Q`s|{p?&\u001f\"# 0F\u0016\u001f\u0018\u001f\"! \u001c07,*(?Sfv{|~p@ \"\u001f\u001f%$1\u0019\u0018\u001d\u001b\u001d&\u001b\u001d752!0CSl{{rgf``\\^fknz}{tuopnplrqxy}pI$*\u001e%\u001f#0\u0018\u0019\u0018\u0018#! \u0019)6'+4IZi{utxvvnj`cVPTTQPQX_hmt}}qojd_\\W^R]\\cmkvonT(#\u001f$\u001f%;\u001c\u001a\u001a\u0015\u001b! \u001b%*+/:RQl{pmjlmpllge`_^XUQV]_corzmf_[QSHHALKLW`gcd^K+\u001e+#$3Q\u001e\u0018\u001a\u0018\u001b\u001f\u001a$ *#:>ITm{z~xoihe_c\\dfepx}sfaVSQLNJMGRKTPZXZSM1\u0019,\"$EZ#\u0017\u001e\u0018\u001b\u001c\u0017$\u001e#\u001f?8@Orzpnkljhfeepzxl^\\WYW\\\\ahjkg^^XRXYJ1$#&*Oc\u0013\"\u0015\u0017\u001b\u0018\u0017\u0017\"\u0014#:1?Rw~yjkgonimiin|qb^\\fenlnz{|wrbbeK-\u0017%%3Vb\u001e\u0018\u0017\u001c\u0012#\u001a\u001c\u001f\u0017\u0018;44Z}ubedjhijiun^ejokhlmosvwx~|{pkqS+\u001e\u001f\"8ag'!\u001f\u001c\u001d #\u001b\u001d\u0016\u001546,awq{wuqsk`\\fhfimwe_feeb`fovxvpdnssloO.\u0019#!:Zg12.((&$(\u0018\u001d\r516fueefqswhaOI:=Ofd_[aghew¿f\\\\Z^]_cfqz{~tg^cjjpR%\u001f\"5A\\f@6@@4).-!\u001d\u0015)E8myqfmhnprZO:+'4Pr]VT`qtmn^RPT^UH9@GQeil^TgirV'%5PUbgCIQQQ?9:1 \",B?qphQ=JMgvlchkxwYQI_qb2,\"!#;OW^S_nyS)>Ma\\ecJQSUXQIB?(+2:Bixxt~ÿ{rhajrjL:%(-EFPSYbsoY?G`dajbZWa[V^PKF1.3G@fvxvrwvtnh^\\[ach`dlh[GVa_ibbhhrgb\\XQI65CCXa}ývvxxx}z~wotrvqppll[Zcdcfedn|uh[OB?7=LIap½uzu|}{styuuuuvv|wst][jdbfdhx}gXI67DAWab}þñr~||xqmlknsxzz|ztc^dfbgbh}~eYE3MTSfrs|ľxzvxpvtvz{|{xddcahfed~dP7:nnu}w¿źuwvvjbcgchee~bL.O~zt~skegcebgimN2g}tzvocdddccevWAr}ÿqyumh`geddin`vþ±xu|zwjeghbhea~ſlw}tjh`dhcddys}okzzsjaiaibbe}qzyxeo~pgdcdgbedt{}}mj{s`qytafceg_i_<~~x}tg_h~u{b`wzpbd_iaacb\u0014S~~y|znfe_hz~|zktcPhz}ymcc_h`ede\u001e.b|~{{~|o^d`m}~vp^K>F_msv}|g]i[A]l|xpncag^bccd\u001e0-rw{x}|x~|tm`^eihXA?94>NZ`adcgoi[SSd]GMbm{|wqpecdacad`d!4\u00183iqyxzyyx|{{}urg^a`eytVCGAEED@OPOORWL>V`mgTASdqz|}wxqrijbdabcbe`#,'\u0011 F_t~zw|jtvz}yrusvmtquy|{trke[^UemnYUKHNDCEFJABJFK``lnTLJSglppsnmiiaad_abbae&#,\u001c\u0011\u0013\"7@;C^kfqw~~ysurpgjmouxvwtnmh_X^XYh|of[KJHGDE@DFSTW]ZfkgPHMS]ckjhdd_e\\ce_bd`c\u001b$(!\u001b\u0017\u0013\u0019\u001d\u001e%@g_krx|~{woqrldheomotnkf`\\VZbWhvzl^ZRMJKJOV^[Z[_bifVRLHSZa`c^d_\\b_h__a`a\u0017\u001b##\u001e\u0018\u0016\u0012\u0014\u001f%.YZdity}zxtoxnidgojrpigaSUU]cfu}sp[SPRPSa^\\_^adh`a]VFEUW^Z]]\\bba`b`dba\u0015 \u001e\u001d\u0019\u0015\u0014\u0011\u0013\u001a .I[\\djuz|wusvqnhjpntqleYQPS\\drzreYXTL\\`^_`^`fgh_kaO=RX[XY^\\`b`b__`d_\u001c\u0017\u001f\u0019\u0015\u0016\u000f\u0011\u0011\u0017\u001e7>ZQ[hnwt}t{ysppmrqxvkiSWTZ]hcsvsh_`L^\\e[bdfXbcddhf\\ERU`XV]bbd_`ad_a_ \u001b\u0018\u0017\u0018\u0014\u0014\u0015\u0018\u0019,88YKW]juqzsw{sssqv|z{tl[[X]Z_^co}|rombcc_bggc^a_agel^YY^_T]Yd`b_c^b^e_\"#\u001b\u001a\u0017\u0019\u0019\u001a\"17==JMK\\_moqyz{zuwwtyz}txb`c`^V[[ht|{zqlhch`c[ZZYUa`efZg`]\\\\_c`f_]c]aaa6*\"\u0014\u001c\u001c +9JICADRDU[ciswy|zyxwvy{~~qkiie\\]PNRVdgkntz|yrf`_SQKFHJQZ`ejij\\\\\\^^a_d^\\d^aa]HE9()%4CPOQAEA\\KDM`]kqvuuxuzvzu|zwqmmlaM67V[NYX^U^b_knnkeRMOP<*,1@PV]fgpieYW]a]a`aa]e]^`[[WYLJKNRTVPEHETY@ESXdjrttwvxqvtwyxu}hVcgRYnhX_`cT^X_\\MFYX4#>SZcfiimqk^ZY^_b`]d_`aab[_YZWYUVY[\\P.KFSZ^CDHXYenospuusqqow~|qYSkn[iq{qnqqoQ7JS5>\\caeekippdYZX^`^``[d^a^[`_X^WY]V\\YQ1\u000fLU^ecU?DPQadfootttnnup{~|lkoZ`ovztqsdZCDKKYaigmhkkqkaVW[]a]`^a`[b\\a_]X[ZX[]XP1\u001e\u0010Magjk\\P<GSW__gmrpsspnqwv}vuqrmibd[Y[Ydijnmkok_VZZb]b]a]a`^_]]dY]YXZ[[R<\"\u0017\u0014Zhspqi[B=IPV]bdnkqnkmovs|vjc_fmmponnjW[V^\\c^`_aZ`bZ_^[[[[VX`QH/)\u0014\u0015]ryvuoaS:8JMWa`jjrdpfqrry~zffjktnnrlgOWYZb^b^_]^]^^[b^]ZYW[ZL@,\u001f\f\u0014gu}|ymh\\J@:KVW\\fijkollts|zw~~|tsmeilqnrpf[VV\\^`_`[fW`_^a]^a^TWS]UH<'\u0017\f\u0017iy~~}xndYJ98QP]^dglomkss|}~zvkhfngjhkkieejqnoid\\S[_]c[]a^Z^\\]_[\\^ZWXWWRI5\u001d\u0019\u000b\u001fk|~|qlbVB6AO[_fghopnyt{~~|sxtlgjggcedbcdggkrjpf[[Y[bYc[^^^[a]a^\\[^\\YR[TOD/\u001c\u001a\b.m{zrofYH8<CQ\\aimrqqvw~|rmgcbhkgaf_^_aginkni^XZX\\_][_XaX\\bZ^]]\\]ZUSUMIH-\u001a\u0017\t6pz{smj[PG78FU\\jmtvruuw|}xmjfcd\\ceca]affjirji\\MY[[`^\\__\\\\_aX\\]Z^^\\XRQKU7!\u001e\u0011\nOvz~wuof[\\JH2<MPbhnvyvtz~zrseb\\]_fbahellopl_V8E\\[`^]^cX]\\\\^Wc[]Y^TTLML;&#\u0005$lxz{qhZ[QI<58GR^ftvwu~~}xqnfibc^`gekimnooi[J)6QW[_Z__Z][\\\\]]]\\[\\WVOGK7(\u001d\u000eSx}}{xmgZSQGA3>CR\\mrtyz~|zppjgbehjoqounmdT2&-4>HVVYZ][^^ZZ^_X^]TLQEG4,\u0013\"u}~|~zslcYUKF8=5BR^llsz~}|sptrrxrqvql[@(%*(,,7BNVYZ_]Y\\X\\YZ]SQMO>8/\u0011F}|~}zwkaWRJC<:6?L]ccmy{~z~{wqtcP* (++(+*+/9IT[[\\\\YZ]ZXPRMP96.\u000b[zy~ysmX[OP;?937BQ_dkwx|z}zyuoa:$\u001b$1+*+'-),$8>RS^Y]Y\\XPQNK59)\f^~zz}wqh_TRHA:?2==KS]krtz{{~|tjR(\u0019&%*0+)((.*,,'4@JUVY[WPRMD;2'\n`||zxlg_TQC=?=55><N[emux~|qyzum]<\u0014\u0016'#.-,'&$*,%1'(+,6ANTWPNQC9+(\u000ba|~~v|wlb_WNF@=8657;FPaeswyvlpvv~}{tqcN$\u0013\u001f\u001e*).&-#(-&)(.+&.&.3@IJRR=9.(\u0012dz~z{~xjebZSF?>7>484>F]bmuxwwyvsopxz||tqcdY:\u0010\u0018\u001d\u001c*/,*$$()**'/%1)+&1,5QOQ:50*\nb}|z{~}uih^[RGA@>;:933@RX]cbgorovtxnopqqnqtjhbW^N!\u0012\u0015\u0018((,3!+\"-%%\",**+0/+/(+MQP?/=-\u000b]zzzmjf[UTNG<D<?59/9DGQQU[Z]fgefffgggia^ZZQYJ\u001b\u0011\u0014 $0/+\u001f&-'&&&)())0..1,1NTP@<15\u000eV|{x|{~~}uki_[WPLHEDC:B2:2:7ABHIIY[OSWS\\YXXQLNOY_>\u0018\t\u001d\"))0.'\"'/'%#'(&(0,1*//JSJA:;8\u0013V}ywx{~uof__UYHLLGI=A<<48317<5;CF?EFIGPFQLIY^eW*\u0011\f\"$&1,1-!&$#'&\"-!0&10+-,ONL?9;<\u0015Wxrxwvoia]\\WUJKGDDCD@?;8888-536;?@GMN[]fgfeeL\u001e\u000b\u001d#+'/+-))'\u001a&#&!((+**-,*,"
  },
  {
    "path": "contrib/att_faces/s3/3.pgm",
    "content": "P5\n92 112\n255\nejfhhfllhleknjkllnleOKYcqsnlfbc_]Tmuy|xtqnhffroi`fg`TPG8;6;.30297:Vcminiifhilmlokrimllklehfjfhhlgjgljmjoik\\N=IZalvnoc^\\WWKcwqfk_lnxoc^XQI@:67:066977+6afdahfjafbhkmmknkjjlichfjffkekjinhkjmlhSC3HWddmpmqkk_nvgsqgd\\XeielgaZQCA>:<8<7?581*]odWWZSR][Z_llnjnkljodkbjiflhhnhnkpinl_A=9MUhionrtjk|~wh`]Xjw_egZSC=9:;@A6<@MH1<[bROQDFE\\`ZlhmjlnkkmggfjihhljklmhloidT849?R_aeirrwxtpwubOL\\a[^_`L7669;@B>JOCD<RTT]]C:DW^bhllllikolefghhgjgkklkkdfj`I=:;CZ`Z^dko{}~|pu{~}{_RMSUTg^\\VE<84DDLHC830AT\\_]A5KK]eiiilkkkojeckdhfjikglncQOXRIE@MT`ba`emu||wqopuzutyn\\QOQZYZR\\PD6<<9?84/4/L`dW<BLPVeiiflonklkdigfkdnijkoiZEBHMEIPW^dYedmp}oyqnh\\eejnppzxyqj]XJOLMS]IA?<095206Ga^QEKUNYailghnojkjcmbjhiiemil]BA>>BAFLK__`Zegrxpge\\UQO\\fehltyx|qh[YIEGRWXA=8,3.5L[[QQTT^YcgjleonlnlfcjgljgkiojZKQF;AGJ>FSZ[]cdov{}z{qqvql^]PKFMNQWckomkhbbcdRQKUMOD?=66IROYRQPU[bjkijkonlofghillkjjjd^WWHHNIVGAHMLRXdhtsutu|vkki`_XTVREH>BGJXW`X\\TTZVURNQLGJB?7AE@TPJFWW]gkikkiqklehjgholljja]UUYSXMNULGAIHQdfhjhinpq}}}zwpbaVNN\\NSCF@>BEEHH?JGGLDI>>>>CE7:/>DKSP__deghilmomjfffhhhjkf_d_WVWNOSR[\\Q?;5;Ua]e`d`eU_]^a_^^_YWXOSKLFFAA=CBEADBFFEGEBH@JJTF-,56NMX^`ejeilhmkngfhjdb`dg\\_]`^SK<FSYTUQHC874FHNUbaddXROJFEHJJKIFCF@CGAOGJJCKMELLTSW\\__aaaaC5/2EJPZ^dgmjmgkmjlej`aPMRRPRRMZL@0GNTYOTJRLD<97CKS\\^^^SXMDHB>;76>6E@@A?FCJHGLSNTWggoqttxqsl_@61?;EFUadejgkglimfbYLACIJFDGKKJ@;9NCOKMUSaUXKC?@DISUOOXTNRHMA>B@H@FDMIIDPMY\\[aehxyy}|zuV>068=?DK_eggkfjjlhf\\D:4DTRFA?D@CCC>>9F;CEMX[YM@>;9FFMIQKOQOSFOOLSVVX^X]P[adgoqx|sS24174A=?\\delgmklghR?6-:H[UTOGK<?@W=97AEBHSWZVRS=956=GGPPNLMPVUX^`iijknkmruz~tE3+1.4;CLXbjlhjjh`G9)-*22AA?>C98<F=:/8AHCRUVZWZQIIJGBFKUV\\X^dbgdjkst~{zqA**'.2CMC[clhkkhaB55-\".168>3;879DBA4/556?IPVTZYU]WWSX[gafgimrovu|b<%%%*9DJP[elnnkcB59++,6;AE71069=CFC332448:A?AKHY`gnomnov|}Z+*-'0;>NS\\mhogbI)0+.5D29@>@20=EPTH@==7?:88>SZctx~sN ,/6+5OMUdjnfZL)+%/,(&=SYS?@JYSVMSQNFECP\\epo5/)35+?MNPghiSA#' \u001e \u001e1Tl_\\Qgnmbdbnjdfcp}W-,.0'0JOCWjfC(& \u001b\u001c\u001d*Nljfgn|t;3$2)(;HFB\\R.\u001e\u0018\u001b\u0016\u001d\u001fBfosij~X70+0%.;H=8F\u001d\u001c\u0015\u0018\u001b\u001f0DXhcgr|jF302/\".G@00\u001c\u0018\u0017\u0018\u0018(:DOblrvĽuU519.(#5I;.\u001b\u0011\u0018\u0017\u001f19CSj{zX>075+!(FD1\u0012\u0015\u001a\u001c'82Te~½}d>:663$$5N+\u0017\u0014\u0015$-5>TgmmpxzfH22)61%\u001dB%\u0015\u0014\u0019+-6<HPV`c}zmK62&&4'\u001d\"\u001e\u0019\u0018\u001d+-37;BLViuu}ýwoM=4,#,&%\u0015\u001c\u0018\u0016 -25-9:O[dlgvx}vmU9.:''%#\u001a\u0014\u0019\u001d\".+1/9HRS^benu|nW:51,&&\u001e\u001f\u0015\u001a ,-*,2<?EMT]efv}½|nV;./++(\u001e!\u0012\" --\u001f/149CHLX[bp~Ŀxm\\;(2$+)%#\u0018\"#()'.-45DBKP^aosro^=*)),)%+\u001e\u001f$&'+(&898;EG[dft~ti];&,#(- -\u0016%\u001e\"$%+/3980>JW_ls}uj]<'*\"&)$# \u001e#\u001f&$0/'50/3DW]lquk[8'##%$'\u001f\u001c#'\u001c%+(%*+*.+@N_o|~uka3$\u001e$%%%&\u001a%\u001e\"$'\u001e\"(/)&/9Oftvnf;'\u001c\"'#%\u001f\u001c\u001e\"\u001c \"\"\"&.)).<Xf}}yvtxxsvtzwzvr^=\u001b##& !!$\u001c\"\u001c \"!\u001c2-) ->Sm}|ulmfdg`pt|wqoe`\\b`]`fippwmof\\6\u0017#+$#\"\"#\u001f\u0018\u001f\u001d%\u0019!34((1>Zjw|tphbSUYTSRW_ipu|{pih[YMNEMJPV\\hfi\\_WR3\u001b \"'$\u001e)%\u0017\u001e\u0016 \u001e \u001c+4#*5>Yj{umkkrlica_X\\TSMOTS`cftxzph\\VVLLHICLKNNYT][VWN)\u0011'\u001c)!$/!\u001a\u001a\u0013!\u001f \u001c()*2:?Kr}}qrlmssuuorkhfb[`V^^adjvticUWYTVV]\\e`_aZ^Waa_F*\u0012#\u001e'\u001b$5#\u001c\u0017\u001b\u001a\u001c \u001c\u001d+&99:Hw}|zwpmhfdgb`eeuq]]]abcdjswy}y|sohjldC(\u0011\u001d\u001c'\u0019'7\" \u0017\u0017\u001a\u001b\u0019\u001d\u001a\"*862Hvz}{ridjfldcahrgbahkonmotv}}{}ysmnlI#\u0018\u0019  \u001b#2*\u001d\u001f\u0013\u001d\u0016\u001b\u0017\u001c\u0019&940Nyyx||obbfdhfdesicfnkggkut{}vrp{qkonN$\u0015\u001e\u001e \u001b'=(!\u001f\u0015\u0017\u001a\u0016\u0014 \u0018\u001e808Ouu}zgY\\]de^grzf^hbdajiv{tgikijjP\u001f\u0019\u001b \"2BV&!\u001f\u0017\u0016\u001e\u001c\u0019 \u0015\u001f50-Yz{v~quyroihYVWbddlu{gb]]Z]jinqw|ulZ`cghT$\u001a\u001d$0EYf6&)  \u001f  #\u001d\u001310)\\zyqedkrr}of[B9<KXUQWhlkp§tcZWTVik[EEHS^ic_VhgrM+\u001e\"'DZ^j;7-6,+()%#\u0013';)k{oggaienm\\O=(0:Q]VO\\pvhUYQbssV:\u0019' =QUYXfmoV)'1>O_ed?:6<?D633+\u001f!B7e|}{ujXOAJWfomv}Ƴzurgfktvb:,$/@H[Z^fks[+7JIWbdhA<@DUQM@?4/!;:lwnikuwǶz~ywtzxs^UDQX`eneeiqe.8[[\\bdgG@ALQVVOGB.)29j}}¸zx}}|}}yzvihmkw{snnqlACa^`ccfXPQU\\\\WXUI75:=^ļzzwwywpxx|~xsunUOa_d`e```^dgd^_RM8<?Idÿy~}xrwux}zywoY^baefcbhdkswp_\\I>6>BPlľſ}y~~zwpdff`bdcfniq|~rcXA<0BL\\púv}vsifcc_fdf{ux|gOC3IJahu¼­ux}wqmma_hb`ay{}dK9=lppp|{~ĳyt}wtqffcegf_m}dI/[}x~zzzķtyvxtjkcccebfVnP.n{}||{¿¿ù~tsztkcaiddfc=zY?wz|{¿¿ûtsurl`bheaae#vo]n}}~¾»yqzuqj_dagbbd\u0019d}z{}{¿ƿotsoh\\ebecfa$D|u|x}{~Ľxq}}sqddb`edcc=(uxpvz~{zɾ~n|yooj`d`_h_aJ4L}~zy|}y}syk|vsicaebdbfcJ?:l}y~zx}ostlvgp}wlibdc``ccbHH;C}|}{}ww~{miu{pZ\\puu~q_hlae||{qkh_g\\^e_aaRFC\u001cVyv}||uylhnxsgV3/@\\bahemmshVL[c\\[s|~|unkccad\\g_baRDA&\u001ecur{{}uxx||kbld\\>99>?JUSWTYWLALama]fq}zusmi`bad^a`abVK9.\u00152ikrtz~xvwy}|obj~pUDBIDNGGPLMLLCD_msn^`nz}{zuorhc`aab``__]TB<(\u001f\u001b3Nm}ymfpsw{sttw{y}ymba{fVMMJKNGLJLMWQUfpttg\\dtz~~zxuopig^_e]f^aa_bHE2)#\u001f\u001a!+FMRAHTjsyxytpslrrpuz{|~|toa\\t|dfWRLQPJQTU\\baeqowta^gkzvvxnllhcba_aa_aaa[FH4&\u001b \u001d\u001d \u001c\u001a\u0019\u001d\u001dEZmzw|nrqknighopww||}zom^_l~reZWUU[X^ec]bfqrtpf]dqlwqlgh`d^_b^c_^a_bLJ1\"\u001e\u001f\u0016\u001d\u001d\u0013\u0014\u0011\u0014\u00190Oeuxwtmlsgfgegnrrwvtkf][p{la^[X]bbk^bdkoosua[bonombh^]``c`ca`a^bRJ.%#\u0013\u001f\u0018\u0017\u0013\u0012\r\u000e\u0017(?`luyupntjihaglqtttod][izi_YTZabjafekjomztV^cpigc]^]b^a_a^a]b_YR6$'\u001a\u001d\u0017\u0017\u0013\u0012\u0012\u0010\u0011+2Set|uqrsoskmlrt|{xl[_ezzkbTOZdcdchdkmilu~cU]kff]^Z[``a_bb[`c]Z`G-(#\u0019\u001d\u0013\u0019\u0018\u0013\u0017\u001725D^nuvswovsrqtx{vg\\hxznb\\U[cbcfkcdgnhrrsX_ii`Y]]^`cZa^^\\^^^X`U@02\u001a\"\u001a\u0017\u001b\u0019\"17?7Tisrvvvtuuwyxedxxvr~}omicbdfijge_dihmqqcbif`Y^Y`_e__^^_^\\aZ^ZUK;9)$\u001c \"4JAG8E`kpuzv|v{z|yms|vjcfp~|~vmldjkfcf`diikkhijecU`^`\\bba^___^_XZaU[TYLA59BIPIB>>U`lww{{|{}~qea]]h|~wqffad\\]VS`dekiqcg\\[\\]a^``]]`[a_]\\X]W\\Z[[WVVW]TCG?=NWflwuy|{~{ra_XNVZahceikjpq~|u`WWJNMOACMS]igpo_a\\S^[]``]]_^^_[^XZX^Z[[[Y]V^V@)B=O@QWmpquu|{{|ttnibXKF;8>B@>DEMQVTI851,05KGHMV^elmic^U[[a^c]Z^`Z`_[`UZZZY\\\\YVcX\\G'\u0019=GJNDTcmnrytyz}~}}j[EECH=GCHD?FC7A=B@P]c]Z_egnnga[XX^_a]`]]a^]`\\]XWZWYY[^Ya\\K2\u0014\u001b<EN^HM]clpqvvyyz}|wz}yqgfdbabdb[V`fhheeeikmfaUZZ^\\b_\\]^^Yc^Y][W_T\\ZZ\\[^W6#\u0014\u0012ALVh]GRZghqou{|w||wndfljnmibnijbZZX_[[`^[```^^_[aUXWWX]ZZ]ZK2\u001a\u0012\u0010GTXfgLKQ]cmmtvtvzx~smfjmmnlgnjd\\ZS`[`[^][]``[`Xa[WXVX[ZWWYXA/\u001a\u000f\u0013C\\`jpaKDUddlqsqoywwzz||vuunkllqnojjedWTYW]`]`^\\a^Z^[^^\\ZVYYYXXWTRA&\u0019\r\rK_ftvpYEPXfinmpktxv{}{tifdgddhgmlinkqkqlkdaZJW^W`^]Z]__Z_[[_WVYSYTUPTNL9\"\u0018\u000e\u0013F`ouupcMDN_ciismlsqyzuwnwjdbd]acccbeijomnrij_`S<P[]]]]Zd\\\\_[_V^\\QUUTVRPROK2\"\u001a\u0012\nIcnutodZ@LM]bfmkpotv|}xnfi^`_eg]c_^ajlklpmknd^_H/DZ]`X_\\`[][^_Z\\aSUWNRLSKLB.'\u0015\u0010\u0015EdrwskfXO@DV\\ginposxx}}ztjd`^[Ya^d^_ejjllpjmeb^S7-6P\\^\\\\^^Z^Z_[`WcZVPPKJQKM=) \u001b\u0011\u0013SdryvmgWWC<FW`nlorovxzy|xqlf`[U^\\_d^hikloljj_cVE-+3<LVV\\\\_Y\\\\\\]][\\SQPOMISLB7/\"\u001a\r(YdpwwplaZNC=ETdlpkoquw|}~wqmda`]\\^^deglkkqlng\\bE4\",/*.9OUX][^W^_X]XVPVKRNTN85)!\u0018\u0012FbkkuxvukcVKC6ARbnnprx}z{upkfcd\\demltorrpkg^P1\u001f\"0,2((,AHVZX[Z_Z[`QQOKOONE75!!\u0015\u001b\\hihqy|rl\\RO59AOeiorwx{yrrhnqpsvsxrngdV9\u001e!$+,5,&.'/9HUUZ[Y\\ZSONHHON?6%)$\u0012%omgkpz|nhST@>4CM]hnywz~}|}z|t{uid\\M\u001e\u001f\u001d(.../)/%'-.5HVYW^VSOQEQSE=2$%+\f<yol`txxj`RLC>9<NTbmrz}|uvefM5\u000e\u001c\u001a*+01+).'*(*+,7KWV[KMEKLND<+(&,\rIzzigo{}re]UJ>:2:AR\\jqyy{xmiZR\u001e\u0012\u001b$%)4.+()*%$/'-+'@GT=GEOPO?43)+\"\u0011Uzmfpx}}mdVOB?:64AHXhmt{v||si]`H\u001a\u0013\u001c%'..4)('- *'.'-),0;MHPOQJ<5.//%\u0010]zniiy|wh^WME?<959GSegwv}{puz~uk_\\XF\u001a\u0011\u001f')/01'&$)%$''-,(-)1JDMMTE;6.5*)\u0011^yuiiuwta_TOF>?:69<M^cowz~yosz}vumaX_X<\u0011\u0015!')0.7-\"&\"+%, 4!/'-);@CNO?<89-2\u001e\u001ehtgjl{sn\\_KK>DC;93:EU`ksqr||vvsypzwzyptbd\\T_W+\u000b\u001e\"*-1/1*'!\"#)')*+++/*@EKNJF47823&\u001du~yohmyyog\\YKHCGB@>96CNT_]bjliorqmjkopmomnbfXUTa`E\u001d\r!)*+305+#'\"'((%+'.*00JQUNJ>8552-!\"uzuhjosk`[OOAECFD>894AEJPUZQei]``abgce_]TWPTZdY/\u0011\u0016'*.)501(#\",(#&\".&(.0,MSTNI9B,41. $ozqodo{ymgaRPHABGAE98917?;@FDMXNLYLWVYRNHLIV[f_D\u001a\u0015\u001d&.+...0+#%,\u001e0$\"*'&.2-"
  },
  {
    "path": "contrib/att_faces/s3/4.pgm",
    "content": "P5\n92 112\n255\niflifmiihlkmmikqnnlnjolhqzrsuqiqjxipnjgcc\\ZZbpwjqmq\\XQOAB@<82)&%1-63:.F]aimiipknjkljjgijiegchihhkgllknllnmoiknokl~rum~ukopnkkge`ibfg[XTTMHDEDD@8:3)'!\"\u001d544C=F^ZljkjjlhkhlmijlhjekdhjikemhmknjlnnkjpjdW|ok{wjlkouphbhlffaWURME:9CONF?4*5++\"\u00193&6C;ES[kgjjikmilkngnkfejfhlhjgmjkmimkjolgxj]f|ujr|vg_uif]Z^b`e`\\YQQGC:;OPPHB@=5+&)(1>EC3AN`hegfkkilkkijigiejhlikihjlkmnlmmqn~vgf{vo}rtjcmY[QYOOOOUYTRKK>E?SZPECA300778<9=98IGbc`^dhjkkljhjifakkflimomimkmmm{xy~rzxngeoj__eTVWMEPQSSQIJFM]_]TMCG=DaKI:<5?457EJ\\^WU[gngmilidlekhliiglljikiom|~uuxw}sfb]dXbb\\NNKGCR=8@JTgrqg[LHCZpq_JH</4%%1:FakVMXkiihjijkfgghdnifniklhjmj}|}slhuk_Y_`agk\\TLBFNI1@IUFIKK;;Rvr`PGHD2*$\u001d\u001c%,ShYRWhejllhjkghgikhkfnikjgesjnptvjb\\aforlYIDGNIB9BAENHIbvvmGHHRK4'\u001f!\u001e\u0017 E_VPU_ihhjkmkhbmhgjkkkhiggroocs{|sstxwqiidjkjjcRKCJHJPRUK^vti[7HHXS1\u001c #\u001c\u0019\u001b6\\LUTcijekjmiegiijekdif`c^wuoddiu{~~twutwzxslsivnrurvssutriXMRUKPTTch`UC2MMPF0\u0013\u001b\u001e\u001a\u001a\u0017(LQGRhhhghkhheghjihhghkahZklggZZXdkw{ymoeg\\a]]gmnwwxyzoopmfUVTTTWWPCE35<GGD*\u0018\u0015\u001e\u001a\u001b\u001a\u001cCIGRhmilbkiejhhlkk_N\\beq`Y[PXbXUW[^ptz~vwuzklddcd]TVSZ^]]ZVSTVV]YXPSWZUJ?>B8:DBB)\u001e\u0018\u001c\u001d\u0019\u0017\u00177=LXfjjghjjhifgjffMEKimngUPEOOY`_agkeffgrrosplqpmi`YWNCIAMNONSPQJWX^ZYVYZ_XUQLLIEII6(\u001c\u001a \u001b\u0014\u001c\u001a'7MZijljejigfhfjg\\TLUengf^K@?LF_b_`bccejmjlejgic[\\VPJHPNOMNZ`he`bejihcjgqnhkgaZZZNH:7\u001f' \u001c\u0017\u0019\u0016!.K`fglfifmejehhdUMFY\\ggc]O>3;BLWabcgijjorsololfd[YUOVXV]X^glptsxy~}zsfee[P<D<1'\u001b\u0019\u001b\u0019\u001e5>MfhhgijliihifiUPH[`_\\ba\\B71=COR[denquv{}vwxwtnd^^]biillmx~zmncWHHJ>3\"\u001c#%\u001c/FBDje`fhmkhjhgfMFRNUMCI[_^KEH@LNY`bjpwxv{{t{ywvussqxv}zpjbLCUK;-\"\u001d! )HI@PikdigdijheT6.DHCA3+.IOKOUSPY\\^eov|~~~~qg_AQ\\O8#\u001c\u001f\u001e25^P[Uedmedlhm[5+\u001f*KQO<.)61DQ``d^bivy~oiQHddK(\u001c#\u001d$=L_^MLY`ieik]:*\u0019(3PLL<998E[jotlux|qeNchT7\"\u001b\u001f)5MPGC;SZUdjl?,\u0019)1=CMOKX]n{usbYp`F%%\u001b!=DXI:>@QTfl\\/\"\"31:CHXkynbekO<)%$;DLXE@?DOamR))+327FO_¾vsfsaD2+'.DLRX=MDIhkM0(0.7BL^v{ryoL63))ANJUHGPEiiF1+,3FXR]z|yZ661)=HAPO>LGkbH+27;DEKn}ye=854:G?:RI=FlX?11856<N}{|tI3,85D=,FNK;cM331*379WzuV9-9:F>,5DI@WE2-+,/79h½{z^D406F6'&:ABKB3)1//47t}}fE;:1B<\u001e!0;:H74/-100Fz¿yhO=6B@C$\u001d$93?>'2,0/0Iľ~{teSF3CHF,\u001a\u001b,0B40+0(/.X}wm^O>><NJ4\u001d\u0013\u001f+<-*('*3(Z~|{zuiWL:=4GV5\u001d\u001c\u0014!1*,#&&/(dĽ~yxuqgaD@783V>)\u0019\u0016\u0016-,%#%'\"&m~yylmbVS@>@1JC(\u001a\u0019\u0015.*#\u001d&'\u001f x}}wvoh^TKE@=9@@+\u001b\u001f\u00125(\u001e##!\u001a,½~~~wvrq^]`HCHC<88,\u0019\u001e\u00130&\u001d,$!\u001d)~y|ypkk`VQN8EI85.('\u0016\u001d5\u001f&&(%\u001aB|zx{xpmgdUJG@?;<*1##\u0018\u001a/)21.$'T{vzw}wngh\\WJ?=>64+$'\u001f\u001c\u00185*4-0*&^{z|wxt{{wxzzxnedVTD5;68-- (\u001b\u001c\u001c>-\"+/&7irtqo{}vof\\a\\]\\kpzxyzyutnfYSDE39322.\u001f$\u001d\u001a\u0019B+'%25<pnqh\\mmfh]YZYROT]dpy{}}z{}wuvqlUJD>000-7) \u001e\u001e\u0018\u0017B3#-2.;wpoqpnvuvurii]ZUS[_gv~zyvrgeeglqx|u}ywrurn]D=1.*.-3)\u001d\u001d\u0019\u001c\u0012X95'#,8utp}vle`\\\\aduvnigdZZNQORZeity~vxzsvosobJ92))+,)+\u001e\u0019\u001a\u0019\u001beT1!*\"H{qn|yqmee_`p{nd_`[ZQPHHNLQV`jo{x{}z}y|vxquoyrndL>1#0)*#$\u001a\u001a\u0016\u0017\u001ffb=',#Otlt}vokkb\\g|teb\\a^`ZXVX[VXZ\\]ajlikkkltv~sxvrsvwurdP77\"6--! \u001d\u0014\u0018\u0016\u0011dbF83\u0014c}qs{{rjkfi[b}lf]``c^d\\bdffnihgfggdbkhmlsqorrvtyuusdM50\u001a43&\u001f \u0018\u0015\u0014\u0019\u0011]`RS8\u000bwqbw{phgfk`_|i`]a`a`Xd_mr}{~|{wqoinrrmilgipwtyusqdM,#\u001e0-\u001e\u001c\u001c\u0018\u0012\u0018\u0017\u001d`cdb=\u001d~odq{vkf_hhjbzĿ|h[\\^_^Z_gn{wswvqkehdprrynumf@+\u001d\"-&\u001a\u001d\u0015\u0015\u0017\u0012\u001c\u000edcdl=G}~rcjgkcZRSYke^Z`kztwc_[WZWYbl||ttsvpoghnvtwosqd>\"\u001a $!\u0016\u0017\u0019\u0015\u0018\u0017\u0019\u0017d]i|8ji_QK:6?G]c\\_dnüufbc`XU]i|~rmrtsqkjruvvrusb>\u001e\u001c\u001e\u001b\u001e\u0018\u0017\u0010\u0017\u0013\u001d\u0019\"`^f}B~n^QOCO[bsľursmYVOUpy}wnlkoqrnossyuvvq`7'\u0017\u0017\u001b\u001c\u0017\u0017\u0011\u001c\u0011\u001f\u001c#ab`xSwjediqw¸{{s]RSVdjr~rpojofilrsqstwvxtxqb:(\u0017\u0013\u0014\u001e\u0016\u0015\u0019\u0018!\r$\u0018cdYxm|usu}Ŀ}~rroocRO_l{|wticbhinmrssryxxtwwt_<&\u0017\u0014\u0012\u0019\u0017\u0018\u001c\u001f\u001f#&)`c`n}nO@AN[^gdjc^__iprrrpzy{uwqwtbC#\u0016\u0014\u0015\u0018\u001d\u001a \"(/2/e`ZlźyZLGSVWX[Z`bbgmsosrw{xx{x{xh;!\u001c\u0014\u0019\u001f\"')/:;=;ba``úï{j``dchlnvx{rrnpuwy}x{yzwyl@\u001f\u0019\u001b%.67=LNLHCcbXh¾~zskrowzwz{|y{{zuxkB \"#&3FEPT[YK:_eYiļyutuz}~xywlK'#.*:DK^gjgN@acYjķwyxtxmR.4::<V`ox}pQ@`b\\e}~y{vtusrT2CCBD^hpoSB^dVgǽ|vzouopTBML7EWfqoLXa^Yf·|{xuposgVViH:>LbpkRea_]]yxvnoliZn~U4FM^d`^v^c]`ż||xusmkjdgub<KRZi]lna`]^yzw}trnijd_i{lBRP\\n{flNc\\_`r¾rz|xulmei__noTRX\\q{m`,c`a[k}}yn~vxqfige^ats[^[evvlF2^^`]lzypzy{}|o~~{suij`ga[j|wkebmw~z_2G[^dWcvxgjvrciv|sruw{skt{vnqfiba^an|spz|}zxxJ3K\\^^\\bhwxo]ofYXclxsiddcb`irzznblzuuljgbc_]cmwm|rurwn/:K_Z_]]aiqzzjcgWMJS[^g[YRKD<9H`hqkbgz~zxrrgjafc`[cux{y{{H\u001dKY^^]b^__iq|}xk^aiHDHKQTMHJJH=59K^kidir~|wupmgab`]]cetz}\\.&Jb]_^_\\bZ`fu}{zri]_wtVTBFHIIKJJKFD=L^iloot{{wqsnmfc`a[^_mmqxi6#3Qa\\Z^^\\_d]cmwwqf[WuseQJGJFOGRPOUP\\nqsywxv{zusnpkjbe`_[^bujiq|~j7\u001c/LX[]]^\\[]fcbrvum\\Yo{bNPQGQQ\\\\acfknwyz{~{uxxrttkoddcb\\Z^j}pafnsx{i=\u0011+COYd^X_]\\\\jifvywkYf}t^WNSQ]d^jiemhoq{xytzy{tqtorjhbbd`XW[huk\\]bfj^;\u000f\u001f6JVZ_][`Y_Uijpu}}f`wuk\\RNPZdfgkdhdklsxwsr||}zssqlorjkeafa`URQS\\YKLMQI*\u001a\u001b)=QS[^`Z\\]^Xenp{jr~j]TKE`_efhaflhnnv}sknx~~zwtqqlljkkhgde_]^SNA20/1./& \u001a &=LPW][\\Z]]^Ucnp}~tiw{na[JKZb^cbg`gjkmrx~rjkwwyvpnnmkghfgaabc_`YPE5$\u0016\u0012\u0017\u0018\u0019\u0015\u0018\u001a.@KOYW\\\\Y\\Y[\\Z\\gswwj_bqvidUWW[^^gggfdimpsxh_morsmmkkdeabc__]e]aXI?=\u001b\u0013\u0012\u0014\u0014\u0015\u0018\u0018.CPQTY\\Xb\\X]Z[]Zgrsxj]Wm}y{ib\\\\abhecj^cclos{Y`jmknjggbae``_caa^aMGH?\u0019\u000f\u0012\u0013\u001e\u0018\u001c'EUTSZZ]\\\\Y[\\Z\\`UblpsiZWccsyrjbeficega`dbjtukYegpgjee`a]`a_`^`]XIGR=\u0018\u0010\u0015 ,:7ARWWV[ZaX[^S`U\\_T_]ru|n\\E?@PYqyjhfe`ebcbbaZ^gqx{ucemkkfdb`Y__b`c]^YIJSb3\u0017\u000f\u00198MVNUW\\YYY`\\\\]\\YZZYbWUfkq~hI4055DZbWPNLOQOQUXX[POJV_gltzwnqopfkfc]\\____d`UQNUe`(\u0011\u0012\u0016*QWWX\\^V[U^\\\\]_V\\V[W_V]ipvsaSK:A==><:74.4258<9=56DQVbkoqxzumhfec^_aa`c]VNJ\\dpa\u001a\r\u0015\u0019\u001c=XX[YYY^Y[Y^YWY[X\\\\V\\W_krz}~uh[XSKPGEG@>:;=CC;AIO^insxukfccba^b`[]ZQGTiluV\u0014\u0012\u0010\u0015\u001f(M][\\\\ZZ\\X_\\YZZYYZ]V_T^anv~wrla]\\_cf`WSST]hmrz|qjid`b\\`b\\[WWOK]oorL\u0015\f\u0011\u0014\u001d$7Y\\Y^Y_Y[\\X^[VYZW\\\\[S\\acp~~zrqlsnrhge\\hnkpzyoigdb]b_]XYUJJQkprt;\u0010\r\u0012\u0012\u001d%(M^Z\\Z\\]Z]Wa[UY[VYZ\\WP]bmv~}z}|vroqxvrroijnqswwmgf`a]`\\Y[UU;R]njtm:\f\u0015\f\u0013\u001b%'9S]Y\\Y\\TbZ\\XTUTWQWPSJWair|~w{yrcgnnmss{zyyuqrwvuwwyrlkuusohefcd[^[\\ROMFbdppsj4\u0016\u000b\u0010\u0010 \",-KU`W`WV^X\\UNVQTURQSLR_iot|oroibjgabhhnpnpnqsryr}vyussppjj_bc^`__XYLIKSelpotf4\u001a\r\u0010\u0010$ 0)8LW[Y\\X[ZUMSKTLVNQTMNWfkn~~snc`celdiihddhkmkrtt{yy|utumokdad_^c\\_XREEW^foqrsg7\u001d\u000e\u0010\u0013#'.,29OYWX\\ZX[UPOPMPLKQOMKcir{}}rhfacgcgff`acimmpsuuxwwutrnjie_`^]Z]\\SLGN\\einuqrj:\u001a\u0014\u000f\u0019\u001f).,133CVVWYXXNQQLIOKJLPOKWkt}{vqjf_``ck__bchjnnvrutywtrqijfd__^\\Y[TQDTUdfmnsosk>\u001d\u0016\u000e\u001e#,+2/6'&6LRVYWOMSPHSJKJOKVNdnu~}vrcgd_`ab^edgpmqtqvswstnmmed_]_]bVTRLV]abkoosslmC\u001a\u0017\u0017\u001c#*3-5/.\u001f .:LVZQSWTPTPOVKQS@Kis~~xomcb``ffmnoqsuzwwyttojhcba]a[^TLIL`]^gmrsrspnC\u001e\u0017\u0010 ),40110\"\u001f$0.?JNQVLPNQLLGQQ72]pz}utmrqrusw|{}~xuvomfgabc`\\XRRMSX\\`fhpmvqrmpE\u001d\u0013\u001d\"*/,/63-$(&$+01NLWJQPLMNSNF5+>hx{yvwmlf_cb^[VQIKQTWabhjnvooqnpI\u0016\u0019!#.0+2232($/))-.SSVPPJQKQWJC30'Ujzwrpnge_`\\VROJJRXZ[edmiposmros?\u0015\u0019\u001f+..-0054'$/*.(.LEMDFHDESPH:77(9]p~skijc`aZSRDOHSWU`]gimklporrnl4\u0019\u001a*-.1./.4.*(-,/(.>9B=A@BGTFA4?72*=ht}xznjh`^ZXMKFFSJR\\Z_egimpknrmtp]-\u0016\"+0,/14-21-&1,,,*=<<IGROTMF86747&'Qht}{srz}onfb]XO?JGJQMORY[\\gcklmnpiqmpF \u001f$0+-,34423*%-+,(-DMHSOSRUB?=6/60-\u001c.J`ix~y{tw|ypljc_UXFI?OVPRRURX_^gfdimknjond.\u0019*)3-32.1032('),-'&NPYIMMXNC<=:032+\u001e\u001d,B]_jqtooyww{|w|poeeX[RKFANNUUSWRTX\\a`fghjkhhhofJ\u001d\u001c1./4-353140'%+&.&(TMMKEOWI;A8@276$\"%\u0018-NLZebegknoqtuurumijf_aVRLDCGOVSVTWVXW_^abfhhiiielgT/\u001d'2/11-271/3/*$&&)*%OJFIJPQ:6<958-5$%(\u001f\u001bgMITONVZ]bedeea_b^[YUPJBCDILQVTQVZXUW]`fddfefgfchZ8!'1,-105/44011*\u001f)%+$+IEIJSKK7843:7)0'#-\u0018)mmOQKFCHNJYMORKOMOMDD>>>@KNHMQQYUZXT_\\_bacadebce]<+\"10,+0171-/4+$+$*.%&)DIGNTL7;7.295+#\u001f%-\u001a*sr\\UUSI;;><=@9=A98?:<<@@EBGEKLXSUY[X]_`_d`dc`e`ZA+%0/10.-06/7-*0!()-+*#%"
  },
  {
    "path": "contrib/att_faces/s3/5.pgm",
    "content": "P5\n92 112\n255\nehhfgjfihkhjelgea}{{ksxrmpyrmhi]ilpjih[^PWKDG]`[TH=:DGH=;;?=59LJZa^WZekojnlonlmmnkmoleehdgiigihjgfklciut|r|nrpi__\\[TQ\\]b^VQRJQ[bdaaVRYpeV@F81+%+@JQdf\\Mfkhplknljloillmjfgcfickghhkihmo`bz~xxjywillc\\[XPUXWOFOPShrqs^XL\\tqhILCB2*\u001f\u001c+*F\\mcQYijiohqjmllnnlmmiedgbhhjdigehqtbcltnjnkfimiXYYKGMRB8ERTPOPIHUquhKRNRS: &!\u001e ,DccTW`jlhqkplknkljkldgdjdjjgmmnpvrzugihvro}wnfjckntseREGS\\CGDHJOUXZtugTDFPSS/#\u001e%\u001c\u001a\u001d3SZNNeifkkmmjlmjklklehbhgkffhkvusu~wwnk[b{rgheqvrm_VKQLPSOTZ]Ymvj_A;OQSO'\u001f\u001a\u001e\u001d\u0017\u001e$KWNFceimjhnikmjkkil`jeegeefifsytlq~wldnw|uiommutjhVQ_]QRWca_SK/9HCEF*\u0017\u0019\u001a\u001f\u0018\u001d 2UJGcfijilipjomkmkneffichkgfhkto|~s}~~yu{{xu|wt}|xwwti^]UURYPK?856/I7>.\u0018\u0014\"\u0019\u0019\u0019\u001d)IIC_nfimhmjmgmjmnfcfcgggjdfedaooy|~xuphbdifjkm`^]]X\\_Y[SUY]ULF=C75O=7(\u0019\u001a\u001d\u001c\u0014\u001a\u001a\u001f>AD_lgijklhmjmoinneggdhihaljc_`anu}|tsnXVJSQUOOMPFPOXV[ZU`[[TTPMGDPD6(#\u001a\u001b\u001b\u0014\u0019\u001a 0?Dcnfkjlpfoljoimljgiajg``mhddVOSYbfrs|{}}vy|~~{yvfXQMHFEELR\\[\\TZ`aafckpwolifd\\TZK?2.'$\u001c\u0016\u001d\u0014\u001d#&Xdijfjlonkojplmmhdfga_^X`a^_\\WWV\\`_\\__jiehmtkia`WMKOLMMPV^djilpx|z}|zrdhaZIAB6/'\u0015#\u001c\u001c\u001e=D\\jchjjpljmnljljeffcgagWUTMQX[YXZVUXU]Yabirokff^WUIUWX^Ydmx}tphdTAHD<3!\u001c!\u001c%AMHTbccgeljmkolljgh`_ecaXH<?IEMXUW\\_XZ]ehmnrpzsmW]Y[ahmkrywrjeDNUI<'\u001e\u001d\u0017*;\\H>BbbkflkllnlkmhjUOWa\\ND51+AEFJRPZX]jksrurlupngomq{x{jpUDT_L:\u001b\u001f\u0016(=PgGIVgnjjjlknjojfbLPY[SLG6-$.3EBLKSYZhiutsqrz|~trgESf]H)\"\u001a\"1Gd[V^X]ehhjklhnhhXQOVTABFB990859BGR^aosy|w~zl]S`jQ=\"\u001b\u00183=TdTJPJX^glfllklcWQMJC0(1=725<DHJO[mtxm_ZleG6 \u001f\u001eKF^]=G?EYXflkiqhf]OF?7'$\u001e&&&/AOO]gu½ÿzngejXF+('8JLdLCE<KVYgdljndZ90;3(\u001b\u001f$ 1HZcfx¿}vltfR/;.,GGZ[JNIEJO^b`gl_F#\"420$#(>kzytyxaD;?+ALRUONQUJHYYbbfF0\u001d 6A6!=[s}yrS?@;:NKCOLA[L@EURZ[/\u001d'#:91=k¿|zcDGF<EK7COFHJ>7BQIT(&*3.70crMCHCFG7-MU>;C=0B<H, 0-*5@Ŀ¾zcM?GIG3,9CMA;D1$9,0#*/59^Ŀh[J9KA2'1:AICAA&%&\"&,4F;oſʽjVQFCL6(\"8>;F7E6#\u001c),5;BBż~qYGDMNI$\u001d*662?2F$\u001c+02/2Rľ{m\\P=HOM1\"\u001490,.52?\u001b3+-)/Y½vbVH@AXQA\u001f\u0017\u001f*,$+\":+/$),,k{{j_X@B2SZF,\u001b\u0016\u001f,'\u001d'%,'+1)9u¿}wsnaOGB<9XR* \u001f\u0013\u001e\"\"\u001e\"&-+1*:}¿¾|tqhYTG=A8NP3#\u001c\u0015\u001a\u0018' \u001f\"))).<}ſ½zrmgYTJBEADL3$\u001d\u001a\u0019\u0010\u001e#! (&/\u001e?}~ysi\\aTFFJHBE4$#\u001c\u0015\u0017\u0012!\u001c\u001a$&-\u001fC½zssj_TSECFI<@1&  \u001a\u001a\u0011\u0017\u0019\u0019\u001d$*\u001cG¾}xsrgbVHHDFE<41'\u001f \u0018 \u0011\u0018\u0017\u0019$!(\u001cG¾}xsqi\\UG?FCC>&/$\u001d\u001e\u001a \u001a\u001a\u0016\u0017\u001b(!\u0012W}~xokh\\MD?>C?50&#\u001d \u001a\u001b\"\u001d\u0017\u0017\" \"\u0010[|}~zvpbcVM@9>8>7/\"$\u001c\u001a\u001d\u0019\u001f\u001f\u001f\u0015!&\u0018\u001cl}~~zwpkVUF>67896.\"\u0019 \u001b\u0016\u0018\u0018\u001a\u001c\u001f'$!3l{|vtrzvz|}vywm^EI8235.9,\u0019\u001c\u001c\u001f\u0015\u0019\u0016\u0014\u001b!1(\u001f=kyy{|pde]b]`hpy|zshcebern{}~~z|pw{naO@5/3/.1*\u001c\u0018\u001b\u0019\u001b\u0012\u0018\u0019\u0012\u001e.'\u001fCgkgevsicZTUVJQT^bqz}wnmd^VTROV[cjpyz|wwsxyphVA323-.-$\u0017 \u0011\u001a\u0018\u0018\u0019\u001c\u0015\u001b.-\u001eNgi^Wcjeegbe^XWOZZ^ktujbf]X^MNRLLXQcdlvsvpqts{}twxzwtk[C40<8(&&\u001b\u0018\u0018\u001a\u0011\u001d\u001a\u001c\u001a\u001c#1\u001bSaghkky{tia]_X_j}ri_aa\\`YZ_[_^`b]akgfkopruvwvx{vv}|wtm]B.,5;'\"\u001c\u001c\u0018\u0014\u0018\u0014\u0018\u0018\u001d\u001b %/*Oiex{wqfg`\\gutmbadef`deiixtsxqqrmklqvsoqplsxw|y|xrp\\=*%14#%\u0014\u001a\u0018\u0017\u0014\u001a\u0016\u0011\u001c\u0014\u001d$,'Gihvorlk`]mzfdgclbhckv|vwy{qrljlpzyyyusnX8($,0 \u001a\u0018\u001b\u0012\u001f\u0012\u001c\u0013\u0017\u0017\u001c\u001c!'\u001aMkfpy}rnkle_ducdeecddmw{{z{onglryyyvurpW5$!+\"!\u0015\u0018\u0012\u001a\u0018\u0018\u0018\u0017 \u0015\u001e\u0017$\u001e\u001eTqjnsv|rmhjh_a»wdabadbeq|~tyzwtjory~xvvuqW3$\u001c$\"\u0018\u001a\u0014\u0014\u0019\u001d\u0015\u001c\"\u001b\u001e\u001a%!&\u001aPuusddyrmejjhftege_abku{qtvuwqqrx{yvvutT<!\u001b\u001a\u001a\u0018\u001a\u0014\u0011\u001e\u0018\u001f\u001e #\u001f\u001d!0&\u001aQnzq`]s|~~nj`ljh`Zswļwrtncc^p}~{rsotuyuwty|x}wxp[<$\u0019\u0016\u001a\u001a\u001a\u0012\u001a\u0015\u001e\u0019\u001a\u001e\u0019\u001d \u001b<8\u0015_xzsd\\_f[YF=8DZf]]]s÷yudTXarz~{vmipqlqywvw{yy{zwxsa>%\u0018\u0019\u0013\u001a\u0018\u0017\u001c\u0016\u001e\u0018\u001c$($% CK\u0017r{y}{kbTH<1?B_k|mffbl[SPgox|nje^oowvsux{|xy{{yvaF'\u0018\u0010\u0017\u0018\u0018\u0019\u0019%\u001d('103/\u0016U[/xxhbU[\\mv¸v\\D6>RS__hd\\\\]dq{|xwu{{w|x|ykG)\u0014\u0017\u0018\u0017\u0016\u001d\"'*1;6.:D\u001a\\W?uprr{ƻrVHIVY[`degkmotrsyx||zz}~{{nH*\u0012\u001b\u0017! &+-;>H<4B[.cWK|wuxĶ{lcehlprz~~yx}z}{{{|pJ-\u0015\u001d\"(/59=QRQE>@e@`Y\\vutvz~y|rV+ \"#+8DGN]cdQEIiHaUfſvutwv{|v[;%!\"6>IP^oupYCLqK^YqƼ}{zz`F,1;7BVco}w_@VrI`Uqü}|tyygJ0AHAQfmuz]Jbp8ZWvŵ~txsuiJCMRJAbhux^Srk-X[ó}xsutiSUbQD>Wcw}Y[xb ^YżyxmsmmVhs`B9N^l{^mxI\u001fYaù~tvlqmffkn?BS_etbvh+,[\\~tsqinkdc{~MBYae~lnsH(;Ufüyukmjkgef{[L\\`ckug%4LX`ľ|~xslkkjffh~bU]\\gssH!:^[c}xytojijfe]nlbccjxe1'P\\X`uxx~tqmjhhgacwtmfit~||V&9Yc]Yyosyuxwyx~npzyrkkihdf\\hsrry|{z?%JZ^[]orbpj[[iwzrgigheot|~_ms}xkimhjdc_fztmy{uui25KZ]]Whwrg\\s|`ORY]hnke\\USI@<?Xesp]jrw~ysnghhd^a`exz~}~L*>[\\^bZbluwjZbWIANMWTUMFFH<96>Wighj|r}|{xrmgiee_c`iwo0#K`[e\\^\\biv}xkbR|hK<>CHEJGEJJDH=>Qckmx~{}wtvpkikc`_`]qpyvI\u0019$Kaa_\\]_XVlnxzzutl_UgxRJ>;CBFHFOKQSUUcnpyt~w~wytsnkjidccZfrqnw~M\u001f\"2Jd^b[^_WP]dqtuqi^VW|dWN<@BGGMTW`beiirtyzw~|wrusqnijhd_c]dy|gouvX!\u0019+GUa_bW\\[_RLZholhaQOpxm\\JHKMJO[^agfhimnuxttyzvrqsuqlijiab^^j|~hgjntu^*\u001b\"8N]]baW[_^\\QReklcUGdn[JVONS[_eigfbgjmtzqoz|vvruponqonhfhecYVZdkw__\\__P,\u0018\u0018\"AWZ]c_aX]ZaPWbrocRQsuhZTNIHXeffheekhor~{jnw|}rsnnohlkhljjigbaX]\\TWUQHBF2(\u0017\u0019\u0019-JY\\^ab^Z\\[_[WesuiSdwtaVSDHWcbebeejksr{imoxvvrrqoiifkgeeihdh\\Z\\VF*4,)$\"\u001f\u0014\u0019\u001c\u0019=S[[_^^XZ]][^^d|zt]sxu{{nZWJET]\\abhgfkur~]gnrnrkrenefhghhfegdYZUL7\u001b\u0017\u0016\u0015\u001a\u0016\u0016\u0014\u001e&1OUX_^c^_[X^X_ifvuyytfesyvgfSPS[ZbcgllhkmxxZfopmnjijcdkdhdcfbaZZPF5\u001e\u0015\u000f\u0013\u0018\u0015\u0015\u0017(;KUV\\^b`_WZ[[]\\ils}qeZfz}{rgZ\\]cbhggkggkot{g[ismnikhe`hgcai`eX`OMO7\u001e\u0011\u0011\u0016\u0016\u0018\u0015%=GXVYb^\\``ZY[]W\\hisxm][gnp|ylciegeidhdegjfptxapsrqimidbcgdcbd`Z^NJ]:\u0018\r\u0017\u0019\u0017!\"5PVZZ_b^[b]]V[[[Zbjn}}pbQKCLWXfs{rk]^\\__Z^]b\\`\\X\\`r{s|ywjpjbf_dfdfcc\\YQO[`;\u0014\u0013 )17<RV\\W\\]_^]_b[XZYZ\\]ghwvW</2C8DO[VNKIIHCEBGOMMHCBOXin|}yvmkhhchdgf`b\\UROWgc7%'?HMPS[]\\^\\a_`Zb[VY[\\\\^Tf`k}hD=593HMMOMNH:41#,26/@55AIWhvyyulhheeg_e^b\\YUIVan`KCJPVU^^]`]cY``_c][[YX^V^WXgdulg^ZPYWWSTYQCEG=JEOQb[TMOUhsvyxhfgcebdgY\\]YPDYllZKVXSVa\\^`_^^`_d_]^[YYX[X\\]Q__px~vxvomgjirwx|ulfeowyyzpjfhaed``\\[YSGPbrkG=PV]X]`_^_^]a]^_]_^T]ZV[\\ZXTZioxzzxyyyxldff^c__\\[VWEMUiok8\u0017<SaZ__[_Z^a^a[]__[[Y[VY\\YUWYUmu~}{uwqlgdac^aZ]ZUPCP_oqc,\u0011\u001c;V`]^`^`[b[b[]]_^UYWZV]Y^OWQ_p|~|zywu{~|~}{~~}}picgafca`Z]RTILUikt[\u001f\u0011\u001c\u001dC\\]]^`[\\`_\\_aZbVY[VYYZZXZMUWf|}tszqlinjnkpszxutw}ytmcb`ba`a[ZRSIKQ^ijsQ\u001d\r\u0016\u001d#N]\\^^]]^^]^\\^`[XWVZ[Z^W\\OWPcr{}qnpikjnhkjkpkmosr{}znicc^c\\_^bTU@II\\bjluF\u0019\u0010\u0012 \u001f+Y[\\_]]]__\\[\\]bXZS[WWY^XWK]\\pv{|zohadbmmlljlcdkstyvmheb_c^_\\^OO=NX\\hlqz9\u0017\u000f\u0016\u001c$!A[]`]_X`\\_\\[][TYTYWXYX[WT]\\ipx}}wpkbhcgikmeieksty|sihaafe[a_]LGHXZbkmrw6\u0011\u0010\u0016\u0016#\",W\\[_Z_\\_Z_^[^WWS^VWW\\UXPU[clu~}sulkdeghoidkoruy}{xoibe`id]bRXBLRX^eomtu/\u0013\u000e\u0011\u0017\u001f&%K\\Y`]^Z_Y[^[^TWTXWUUQTURLSdmr~yvslikinfkllrwzz}}vjiicddb^\\PFKPU`efrotq1\u0010\u0010\u0013\u0013%#.4[[[aX\\[`[\\[\\RVVRSTSUQVXG@_gu{wxsnnmosut~~wngijci`__PJFT]_bekosqs1\u000f\u000f\u0016\u0013\u001f#+1L[]]ZYZ\\\\^[^UXXUTOOURTRH*Oelz}~}z}~sldefcebVUGQJ[_d_kmtptj=\u0013\u0013\u000f\u0015 %-07NVV`Z][[]^\\YRYQSKLRRTRA,-Yhu|wohfa]f[aNHNSTbZgdnnwnqp=\u0019\u0014\u000e\u0014\u001d'*14)EKV[[][[]^RRKTPQJOTVJ74\u00178btw{vpjcc\\][UQJNO\\YZcdjontrpoA!\u0010\u0014\u0015\u001c((/0,%1DHWWV]VXPMQRMQLR[U@8/\u0019\u001eTfx~~wrle`^ZRSJFTVR^Z_hlkoqpupsM$\u0014\u0019\u0013!$+16,&+)2BGT[ZZKQOUMLJVWL=2(\u001d\u0014Y]rtyrmk[ZTUIGINV^V^_ajknnoqompZ)\u001c\u0010\u001e\u001e%+000'(.*,.@JTUOOROIHISUB<&*\u001d\u0016iYdo}{yvgccTIOCEHTZUU]cbkglqnooojjd0\u0016\u0014\u0019%%/-4#0\"1(,-(/:HPQQIKGLSO?2'$%\u0013hnXmt}{w~sykiaXQNF>CBWVZ\\Xbbckinqnmnlkgf9\u0016\u0016\u001b%(&2/0'%1),,+(4*KJILGJOUG</%'\u001d\u0015gtj]djw{{|vkncZZKI??APQXW[[\\]aehjmonnmlkgd3\u0017\u0017\u001d$+/.0/%&..%-..+-KECEICUWC65-'\u001a\u0017luybQZehuusqyyyy}}}pqrmfcXUIB<@MRYUb\\\\a\\\\`ghjinpiolied3\u0018\u0016 ),105.$'*+)++(3%DGHJPMRR<321)\u0018\u001emxqu]QULifeklprpnqrshhjbd\\ZUDI;@FP[\\^_\\c]ab_bijillllljje^,\u001b\u0015&\"1232*&(()*-'/--HNJIKOWDG750,\u0015*puosr\\MAPRRRX^efb`_]XXY^JNH@:>FLRW\\^a\\cca`ahiikhnnnhkfhdH,\u0013\u001d#+01030%%(('.&2-,GBH<GPSCB;632\u00133tuqrmr[L??K9JKLTSIMGIKEFAA;;@GVXYT^X`\\fbe``ghhjijkmhhhc_?'\u0012#(/.3232)$,'/'.*.+"
  },
  {
    "path": "contrib/att_faces/s3/6.pgm",
    "content": "P5\n92 112\n255\nnjmmkmnklpmnnooqmntmnqokz`R[WVZQO?DWSOOL_a`mkpi_cXTa[XOOWKAA>:,6-7T]qlsnprnpoopmmooloommolpmmknnknpkolqjrlornmpkjkidhWDRQYZOKG4DQLRPPPOcechbbYVJKLJQ?E?PD:9+3).HTlmqnlopnonpkpnkqiomnlnnlknnjlllnnlmpnnrqloSRX_f`ZG@JARb>1T>OL5x\\A99VW_b_TXXZPILKICK<1..(-)-6dgmmnnpnpmnmnonpmmknmnlkilokmlnmmplpmmppjR94IS\\URMG\\E;SM0URD7DvjUF@5>JXdnk_]jhgRH;9,%,(%\"\u001c!$?eekpnolonpnpooqmmonnlnkljpimlnnonoomops_<=;JKTHRIWcS=R>VUSM??ifaYKN;:>PR\\d]iYN@;:4),%%&\u001d\u001d\u0018\u0018$S[^fjllkjpoqmomonpmnloknlmmnmommmqompt[E6EDHQUSXQdydgpJOSRRL^DOV`aKGGIPNHG?A9/64=8557#$\u001b\u001c\u001d\u001b\u00180MCRfngffemmpmpopnmpkqmlnjmonnmpmpljogB&<GJKLJ`mdh3drIIdO\\Q`^NTMKKKIDIE<613318=69+\u001c \u001e,!6H9YipmhdeimoonplqnnqkmmolnmmonplZWWTB:=FAJH:\\xf}}p|j`]\\ARRbGTWcPCQIQKJFC?G98,4=89<5\u001f#&'0Q@?D```Y\\^STerpononlmkjmnjpnkqn[B9::BKB>8LXPQrzxyksynH\\SC>XfHKb^NP:;:8CD>E;;>3/+9C=8##+$JG.+,HGPSRJQcgpnnpkqokpjnnmolqd?414=KPB61VqZaFcfnp}ht^~FacCLVXSSaYWN?4(368ECCH:3FF66>:*&;U@4)()*=IX]a]jhklnonnnjokpnolkK;2/5IDIENCsel|f9_fegjzkVfZRTPPWeKU`YN=>842'-<?MUUOM943,'W]=923'!1GYl^chgjksmklnkmojnmkgJ@,9DPB:N\\bjrecqTX^_afunf|hT[OO<cWIT`MCE01=##8D=;)+:!%\u001eIgP666#\"\u001e*Ihe[gflkgpktmmmlmnlidO?C@86M?L8]ejqxbbpr^VSTaUVdux{~mlbQLPW`KZaPB0-<4332334;4(G`\\B-<:%\u001e\u001f0Ob[jkfirlkqnmjohkkYX]I>BN>.>7IN@c^fdvj`lpvzg^aSVVetqqfTDLRJWZdR=(2;>1:<8?77]ZM<3N2\u0019\u001e#;MPhnoimqminnjjgci_LLNA>;PG/21ROGNUb^Roqp\\``hknaZ\\NT_rm}zt~scWIDAMWbX>28GB7B?AGZI88;[,\u000f!&PF\\kmmlooljmqZZTFIEAFB,??DH6.,XNIJBOV[biwuicibenzjd[PGSZgpodZacmhf_[RPNYYXJFFJPJJQM2/.ES0\r\u001b\"3Q\\dfpnqjqgno@LK06(:>1%DAM2;&&?P@DBAIBVXert|rkd`f^_b`\\MSKOS]ZYZZUXX]TZSYSPSVMSTRORG71'BP?\u0016\u0015\"6IVjjhglludpp4:J4,3062-;CL-K4&*-9?<HOBCIBN\\bbdeefh`UTWVRKHEGKMIOIHONHFEJHMO`T^bb^YQPG.8KM\u001e \u001c%7;Sbmeelsflo7)5A6>/14?:4A$OL.0&,6;JJDJWJKRXQWNSVRSUK\\`XV\\RLNPRVQLOYXY]^fflovwvvysld^E6TT+ .!'19Khpjkhnik-+4,.=931G>.5%AD;A2%%.DA?FVMGPMCKHHMMQSVWXVT_eYYSV_YW\\fqqz{xf^JQQ?\u001d(&')3FLYkndlhf*24\"\u001d#1'4,5+.16J578-%'*@E=GPWRTZ[YWWQ[]Y]_^\\TUT^djotqth`NGC.!.#&1-BQImkfnb0(!$\u001f\"3,(:-*#4.<F=:2*'%'1HDDFMRW\\eb]cc`hmswklnrxy{eWS7:'* ).1,IVKfnfl(\u001e$#!\u001a'=.255,%,(1AKD752597DNPUW^agnpvwy~}cX@8:\u001d,/(7/=LWIgoc\u001f\u001b\u001e\u001a\u0015+ETJ5211)(.\u001f)9CBMNQNMKP_gbcszwyw|\\XKE-7*\u001c'??EIJ=ag\u0018\u0017\u0014\u0018)GUZQO>=A523/.-*3DP[cgfijihy{cfMF8,2\u001f7I;N?J<j\u0016\u0014\u001d/@LL[]aYM?GF?;8?Q\\fjxuzqr}ukxS1398-K@EU<7;\u0010\u001b*:<BQOeth\\adddstpwC52<9A<DX[11\u001c'547KEWtvvwmx¿¿¾½m_<<5@D,EJSK0%,00:K[r{vnu<5F2@43H7FC&**<Gbuxpx|ztS8;E==\u001bB60:#.7Mb]VYev½oaL@>DT\u00144<..(5?D?<FRgm¼l~tGL>BN0\u0018;1#-06/60F\\^k½|sxsY5@ICF\u0018)))-,+&6>BKXi}ý}q}kYN3:KD&\u0017!#'(*7?6>JOi}ſ~tsgUHC85W7\u0015\u0017\u001b.42+,3:ETj÷~sqfPN<1,DR\u001a\u0011\u0014'5-.209?Xe}|Ĺpme[?J;&&J3\u0012\u0014%-001-/CYixxsi[LW=F1%2?\u0017\u0013&)0,+)2EYfxz|thYIFED<,)8#\u0010$0/'&+7AVn|}|riXJFA>:3+-$\u001d+2*#&#3BZp¾zicZE9?:86*&!\u001b(4(&\u001e'1Edqv~}o_SK0:633*%#\u0017&--\"\u001f 2Mkvÿv{hbUC3008(** \u0014\u001f04!$ 5Wsy¿zxo]T@(4-/5$)\u001d\u0018'=+'&&6Y{~{þuyux`A?2!3.+,&\u0017\u001aA@4&5\"2_{|u{utfI1*\"+0\".(\u0017\u0019'8?0--*`}~y}ttrN/ ($.&#.\u0011\u001b\u0016*@3>4 b~{w~}v~vvvvrnv|zyspqM0%\u001e*3\"!$\u001e\u000e\u0013%@<E8\u0018b||sxydkhuwrmg__[d]]]dr~t|wtlwrP),#38\u001f \u001d \u0010\u0012./6F3\u001ch~xx}rifj{ssurnhc^VT]Yhu|rhfggbnmqv|~{zuptvoQ#(%<;\"\u001b\u001c\u001e\u0016\u00101\u001e3C9,u}}}}oib_ml~}se^]RNPX_ahr{}{pneddlprysnM\u001c!&5:\u001b\u001c\u0019\u0018\u0017\u00181\u00174>/;{x{~wsirqtmnc`cabedfbfhiqpeglfiiVu}pj?\u001d\u001d#*4\u0015\u001c\u0017\u0015\u0017\u00190\u001f3<\u0019M~{z|ynwvmrttwwouzoeOg{ll3\u001d\u001b\u001e.$\u001a\u0018\u001a\u0018\u001b&-,03\u0019Z~|uuwhrws~zbSiuqn.\u001f\u0015\"\"\u001c\u0019\u001a\u001a\u0017\u001e<26C&&n{wj\\j}jpîpz|kYotwh1\u001f\u0014\u0015 \u001a\u001c\u0015\u001c\u001c#AA9N*3wtVi}~|nŽuz}y|{t`qxyf-'\r\u001b\u0018$\u001c \u001d/+LII:1A{|~O]lZTMKPNhxpz}ǿz{rtyw|{zlwuxe)#\u0012\u001a\u001d\u001f#%\u001fJ-f[U5&R}ykjaTREXZ}t|tzsh_ksittxsvwxzuyh' \u001b\u0018#,(-6eLqfR<&S~z|rqyƿw}w{|5>)Ee~mkn~xyvl)\u0019*1>DD@E~\\xkR?!U~ļiU>%2HSimlthdhtyzx{t$\u00180BGNXQd~XmO?&W~Ʊ}dQKjqmde`rz|~zt)\"1Mfjj_}LkK1/`v̾~|vxy$EWwqsipX~W%_dlzľ˵|r-[y~r~e\\`2e_yûʳzjEtpJbuClZ{Ļ¹ȿǵt\\f~PFa_}j[tÿŷƵp]l{S_fdf]u¿ýµ`px^[gcj\\_oż¿þŶ~UxWegff^oƾĿĽño[`[baecadǿþ¹ɾ}[lAZcecf^mǽvTzF_bdch_fƾlVmSddbezjdaz¿ø~\\tQdbdbhIziZeszǻsTlVedddf7A[pu]Ybmz´^huWb`abbe@=\u001f*/1]dcswet}UuQ\\`abbbbIL%\u001b\u0016\rVeYfmxnqE(il|zx{uWhU^b`cbdcFK=\u0017\u001e\u0007FdY^`ft~x[M,(Uco~u_ZJEdt}{gey{wkS\\]_abcdcMDL.\u001a\f,a^[`U^n|yRE7<@NV`nn`KF<<OYf||`j{re^[N^Y`\\cbbcdFHGL-\u0014\u0012dZ^hXTcs{|iPE?8=DPC@N[`idm|{}vT'NHKOTWU^`^cabdcFGJGB6\u001cWc_joc_o}{x[PLLKLUar~wxx>!HMIQWW_[`_b_e^cGGEJGE7N\\dkqkmuttuorwqmwpvc9?QKNXU[[__bb`badHEEHIE?B_ahtok|~o{~tlolRIFOPOUS][ab^_cdbeFCHHIGF:Ydiuuj}}s{}~~vljlcJHRLTPSZZ]b^a__e`eEGDIEHI=J`ht|fx||u~}ihjw}ylcmlXHKMOWQZV]_`^e^bdccDEFGGFGI=Telvknqjeljxo}t|~em{xy|za~~tegshJNLSPVVZ[]_``baccbeGFGCGHHD*C^hojcxlc^Y^enrv{{}zy|qoztvw~}r}nwzpamk`FMQSSSX^[^]`babc_eeDCGCICG=\u001a0V_hmTmrmjgcUUU\\fkpxyzvpwu}rvwlut}~}}efwhJKLTQTVY]]^]b`cac`beCDIFGI@6\u0015\u0011JSalZZvxum]__dkusjlejckeikip}svbpsSHJPQUU[X^^b]`b_cbdbaEEDFGD;,\u0016\u00077GZk_Te{{|wwy}tge^[dd_UILms~lhhrk>)PUMRZV[\\`]`]caacfacDCCHF?7\"\u0010\b2BPbeMRk{~whcev}xjeonQ,'DVQWWX\\\\b]\\ebd`ebccECDG@>,\u0016\u0017\b?OF[hW@Wn}|{{jecmW<$-3SQVU_Z]`^b_adb`c`cCADBD7&\u0016\u0016\u00071q@P`h[E\\q~lgdehB!,3+FPS[Z]_]b_a`d`d`d_EDCAD4$\u0016\u0017\u0007-qd9ZbhRMep_cgfV\u001e\u001b/1376BJU]`_]h^addbdcbEAE?F0\u001d\u001d\u0016\u00063jrGFcmnT_xv}}z}}y}r^`Zf^8\f#+636:39=BSX``_ccaedecGBGA@($\u0019\u0014\bFhgg:Urxi\\w{zuxuxux~wywti[cc^Q.\u0007\u001a0664:4;55;9NR]ba_dab`>FKD8(# \r\u0013d`dhX9_uvekzwyzvqmw{t~ukafj]TZ?\u0012\u00162784>596:3849DJZ]ccb_@JQE--  \u00048i__aaO8a{ln~xzwtuyx~y~y}wre_piKV_K\u000f\u001e0463?4:575;35587DR[__<MRB--\u001d\"\u0002Tib^aa^GDgmn|{wxyvw}~pkihfZPdZT\u0015\u00196384;798<495475376=DQDRP=1\"#\u001e\rgj^Y`d_`:O^h}zwnhqkqQKccbG#\u001d2785;7:<9656987534885JRQ77\u001d$\u001f\u0013of\\\\^g`\\N=ISl{wkggbXOZggaG'\u001c27:87:6;;8.9748795;4<RRI81\u001c(\u0017\u001auc\\Wdai]TQ;>XsywvleZQLbainXN*$5:767:637635724485875STE55+$\u0012\u001fxcWY\\ic`[OM<<[pwz|uj^[GN\\^hnoRQ.%5<5;8?3354567<6467059SR=:42(\u0016\u001fvfZ^^_j_^UMM8;Zr}ssVIFRV^innhQR*-3;6:<B05287976:756985VJJ;35,\u0018&ug_[_`_i_[SIJ75\\htng=FRVaeppllLQ&6:;2>8;/49:59;096;=<=:WJE?;33\u00195ufe_]``aeZYSJI18\\xrk]CFRTahoonodNE,9;95=990;:8:5;69:5@==@WFA;A37\u0015B|igeZ[aa`^\\VLIC1:`os}{pZGDMZafqqrnoXS76::549:>74767:3:58;=:<=QGA6A71\u0019@~lhebU`]c][\\RKH<72IXlkuwstQEIRWbjntwpocTN07>551:8=95324=775:;8=88O@C8:<2\u001e?{og`i][]c_[ZWTIG>587QS_Zw{xw~wv|sd^KCEU\\_ltuzsqkYV;:;@047:8<288216682;59;73DG==7?7\"Btwi`g`\\Za`_X[TNIC=683<E<Ub_booo|turmlgag[AECON\\bjtzxwtrb[J1?6938:879538742,76=47;57HD<B>?='8q{nge_\\Y_\\aXYUUKI=;:@55158=EAJ[PXXRZNNF=G:FPS_^jrwwxxtmUZ:6<6557:6626588454//57965<DA<:9<:(:iypg`\\YY]^][WXQIF:<>89263104660:>58=9??@FLU[biv{{|yys^ZD7?92136<B'4:8<D63:27303155"
  },
  {
    "path": "contrib/att_faces/s3/7.pgm",
    "content": "P5\n92 112\n255\nmoljrmoonnqplopqorpqsnUDN\\][MFQWN>MAmU9HA;BT[ccZXX\\aUVD:O:=57138%.<\u0015JXbqomlmnnklnnkqmnlljnlmojnmolomoqopproqorprkfBGKODbGJANMKE8ubI>DJ54DXfrmgcligXHE>/4*'\u001e\"1,*2%Q]fpmnknnmnklmnomllnkkmololnmpmqnprqoopqqonfYEBFCV^IICJLYO3uP[NEHLA6:VdkevpdMI@5.,-$$\u001d\u001a\u001b!*0-.UTkpkpklmnlplommmlmnmokmpmompoopoqoqpppoo\\MOOLQUjjfOMK[JWAUUOXPIPIDMHKL=GF:9B>75=('%!\u001d\u0017\u0012\u001a0#70ONljinnmoononlonknlompmnnonpnnrpomrnsh`WXGJD?Zp~y[T`R=_PVHaWLSLHGKD@BD;1*0363H53#\u001f\u0019\u001c\u001e\u0014$ 7*5CRdicjlonmnplnokqlnmnlnolnqnonoooprgQ@BPQ=D6vLqWWDo]JL\\SaUNGRLOGLGH?9.*1<?<?0$)\u001e#\u001e\"F77<H`fhdbklmlqkplmoklnnommnnopkpnpprqNEDMEEFKI~ysvf\\]LI^`DJ^PQJHIFOKKRKGAB?76H1,H1(%\u001e&'H43,CIe]daMZoopkpkmkjoiklnnnoopnonnora;>MM;DrIK[qkerv^YULRZh@AcNHJH9;06BB@L=9?38B9><3%$+:3(*86/PY\\LFTbplnomopkplqnokqlnmoltopkP@TBTGglv\\L`ls|q\\tdVYHZT]P?^QSKL897;?AAFEADSB==A?(6TA04)&.!4M^B_Fijkmlonnlomnplonnnonmon]JLSTB\\Zp]lu_\\T_fyrei\\UTZF^aJcZTK?C8;2(2AHN`_QG?778aW@=4/!#\u001b\u0015GUFWSbmflnpnkmlnnpkmonmomiicEBLQEFfa|g]vu`NQX\\m{ybjcYITfYT`REBB:94%.;AA9>5.+#[iN46?$\u001b\"\u001f\u001a6LCeWchifnomkoknnnmnpnojhWN]>RGBFGb_bw`WowyYRVH\\{tzscVVd_ScZNH@6=<-26.6@848Uk_49:F\u001f\u0019\u001b\u001f\u001e-GEa]imiekrolmlmnmpmpdceUYFGAQM2ZNO`b`n`e[lxpi\\R^lpz~jVRR\\[`g]I=73??)ACKBAPnaH.7@B\u001a\u0017\u001b!\u0016&;LVhgrqjeqlojlplnnslNYH;L;@EAG?]LLE[WZilgZUemkaUY]gs~xwbUTNSoheN12?P@8LJSdgR<*IP:\u001f\u0015\u0017\u001f\u0019!4S`ijprofllpmonoomrfFHO@;;BL?/:_FGAIPZbmwktik{ej\\U]\\xzoignxwqfXRPdhcRGGTROPW\\L@89IGC\u0017\u001a\u0016\u001a\u001e  =iihgtofkmnnmmlopt\\G5@-9<?KL3+C?:@>;DQ\\irwsdgkiignhY[[dgehadimkjmjmeYa_XOZ\\ZRY>L@D8GI\u001f\u001e\u0019\u001d\u001d\u0015++ClnepkgjnknlmlnmqO6<E9/?:;PH/%77<F9BD@I^]hgulfb]aaXWSQSZSVVWZ[SXTPMOT]a[`dfa[\\ZWOCKI/%\u001e\u001a \u0016\u001c>#Ccglgiiogmlknnlq`6-3<2991EBB3'2>7EBOTNXRTQ]]WZWcjiebVP^\\ZTWOTRZ[Y]edptnyxvxvslf_RTAM2'\u001f %\u001e%D'@[lacllmlmmnnomd4 %01316H=2B+%1=4F?HCEDHJP[UX]`acbg`[TXZVWX[dnsyzop_[FRJ/%\u001d#\"\"<D><Obfiilkkknnr^I%\u001e!9-D.5BH::3&%4;=HRFQP[SUYV`_eeeeaW\\ZakmnltzfcFHc@3\u0019$$&-BF3BQ_h\\jkgpnqpA&\u001e!\u001743??/3=D@7'\u001e'4??=JKP][\\bbgipstorquut~ihT:]bE\u001b'$\"&7A*A[@kbdklkovS\u001f\u001d\u0016\u0019\u0016.KH<'-'6IN?4307@IOT_`eios{~{xmfCDqX=\u001e\u001e\"(:5>&STTg`jokv[$\u001a\u001b\u0016\u001c,8HJC800''7HKHLELSaW^mqww~qY8plM$\u001c\u001b/7DD?1P[Labllv6\u001a\u0019\u0013 /53:KD@395--BLXaa_c^anmMcu[9'\u001f\u001c??JD9=AXGa[mm%\u001c\u0012\u001a+3.1:Q]MGMGH^isqqokwtk[wlD9,\u001f3GHL3F*JNJ[_i\"\u0018 \"//./CNhaizxz}lrL=8+-GA\\;E:*D5TX]*\u0019\"++(7<R`peļytk8774<DDg>J8\u001c30X\\,\u001c#$-0GdR_urƿqwH?8@9C\"aVGF*\u001b$=^*##):=O@Ab}zuQ)C:I56<S?@C\u001a\u001b\"R'&'34218Aj~ra41GE1>%=H-J-\u0015\u001dK&&-/*)(7Ik~ĿyhF95V=1\u001c75:%:\u001b\u00126))-!$,19Do|wsLF4DZ!\u001e(1/$$.\u001210#'%+15/HqýwQ>?CV9\u0016\u001d.$-\u001e#\u001d<%))0+*-2Kr½n\\H:IGF\u0014\u001b\u001f&#$\u001b&/ $(-*'04Vu˸}yoVX7<RC\u001f\u0016\u0019# \u001d\u001f 1$*&/'-*5WqĽ{ve[>F8HX#\u0015\u0014\u0015!\u0018#\u00145&\"'*(,$9^o|ɽ|~x`LU815U6\u0019\u0016\u0011\u001b\u001c\u001b\u001c5\"&\"-$+&7]tĿzsqd\\DN<-AB!\u0012\u0016\u000f\u0019!\u0018'#&\",\u001c&!9fx¿~oiW\\TG@-3@%\u0015\u0016\u0011\u0010\u0018\u001d&!!&#\"#$<hz¼|n`]LOJD7+;'\u001a\u0015\u0014\u0011\u000f (!\u001f#$\"#\u001bBjý}zp^VXBID=,-'\u0019\u001a\u0017\u0014\u0010\u0014.\u001f\u001a),\u001e\"\u0010QsºxpjfPD@C?<,* \u001c\u0015\u0019\u0018\u0016\u000e-\"\u00184*##\u0015Vt{ocfX>@>68'1\u001b\u001d\u0017\u0018!\u0013\u0014,\u0014,5/%(\u0011\\tznlXY=0=1-)-\u001d\u001b\u0019\u0012\u001e\u0018\u0011-\u001b25..)\rcwj_\\N8447),\"\u001f\u0018\u001a\u0016\u0011\u001c\u001a( \u0016+7)6\u000edzýtTRH=)4-0)\u001f\u0019\u001a\u0012\u0017\u0012\u0010\u001f#\u001e\u0013'399\u0013azruz{wvx~~}zcAD7*,,,/\u001f\u0013\u001e\u0011\u0013\u0016\u000f\u0016)\u0012\u001f)-?;\u000e_~pnekixx{pknhdgdy|}s=;1/#3\u001e8\u0017\u0016\u0019\u0018\u0016\u0015\u0014\u0015@\u000f('!76\u0014mtgtfXgwlibSQ\\VYWcuyy~oN00$..!*\u001e\u0016\u0014\u0016\u001a\u001b\u0012\u0017G\u001b-\u001d';@\u001d{tmr~zwlZPVQbhvzlsw}}u~rP4.-/.\u001f&\u0019\u0016\u0013\u0013\u0019\u0017\u001e\u001aP.3\u001d+9.#rrx~~zwyulka]eez}vfn^[Ycmrx~y|uQ1*#B-\u001d\u001a\u001c\u000f\u0019\u0016\u0012\u0014\u0016\u0019MAA!*.%.yp}r_][g]FZ[wn{ysfi{||xqh_ZPQVV_fq{~ztrh~|zytM*#%8-\u0018\u001d\u0015\u0016\u0015\u001a\u0012\u0017\u0017\u001aI_X'8.\u001aJxzsWWL{nVDhPVlhqvyvyxrusptrlinitzmspngohrsmJ$\u001f!3$\u001d\u0015\u0015\u0019\u0013\u0013\u001a\u0019\u001a\u001dK\\_)H/\u0019bzpZRbpq!kaLjmyj|}}vttsgaxyrtA\u001e\u001e\u001f,\u001d\u0019\u0019\u0015\u001c\u0015\u001b \u001b\u001f\u001dJWd/E6\u001dr~qb|qP-^_ttmvĶ~{wrvrko{njckvzpE\u001d\u001a\u001d'\u0017\u0019\u0015\u001a\u001a\u001a\u001d\u001d \u001a\u001cPMl;B:/zzzvgxxuwuò|wp{p@8?2Djtp}kd}z~nC\u001d\u0016\u001c\u001c\u0019\u0018\u0019\u001a\u0019\u001b\u001b!\"\u001d\"OHvZC5=|}~vwwqU\u001b-,6hydy|uu}i?%\u000f\u001b\u0016\u001d\u001c\u001d\u001f\u001c')7*#$R>tmV6Mǿz}gX$9/BHbsXp~yi9$\u000f\u001b\u001b\u001b!\u001b\"'*0L\u001f\u00169O@kui<Xɽ}ƌYX<OTrnWt_|||{o;\u001b\u0015\u0016\u001c\"&#-86D_@/@ODlvtOYþźqhlo~pduv{p>\u0016\u0019$,>A9GI;mc8NZODot}b^óv~~t4\u0017\u001d06@ONSZSR9XcIFls}piĻȽ~{u8\u0019*31?`wjjj7?\\\\U?pwm{Žĳ}{1,D;Pguq;XY[KGdYv¾ʽ}|y~44HKbps=`aeNGTeLĿÿĸʵýx||3JLjy~45V_aMIGe¹Ʒ}y{uGhnqw-7GY_INDs|ƾŵýxxj`}OOYTbcMNDb±}tu\\|nL^```gPIC_ÿñ~wonWOW^caebMMD\\}ù¿ǿojc\\K]abdbaJKENpǻ÷kkXmh9^`bdcbMJNJak~ügaSEFW__eedKLKIF`t|½|d^V@S][bcdfLILLESoyyƿþrcVaNJa^cc_eaJJLLMJ]n{}ƻc_Xm},Za`c^bbaILILHJSVm~~x~{xv¶~{{cW[CN[daa^bb`JJKIMJRDYs~rsl:Kn}l¿u`T_T=^Z]c`bbaaGLJKIJUFFbvtes}D\"Jd~ln^T{APX^^^cc^bcJGLIMKKUDVnxxxua_w~zU:-F^|}lf_R>BYhwiulW[|wsSFL]_[^`cb`eJEKHJIE_FPqtor`YkxkK@1;J[ovfUIHBKNK]ohl}qnCg{ob]>GSO\\\\]]_`abaHHIFKICU[Lkwuybeokz~cN:61:DL?=BVdkwcmtxkjHLGMH9:>@NWR\\_]_\\c_a`IEKFILEMeLklonmn~eHC9<;DCZjoy||cd{zsnkie7\u0012\u000f\u0015\u001b\u001c<IHLWR\\^]`_`d`dJEHGKJHBkU\\rvuhbkwwf`MNRXkq|}~d[py}|uxuujiajb\u000e\r\u0013\u001b\u001b6JLHURW[`\\_a^`a_HCIFJHL>[\\S}xyj__z{}idshho~pOcntpqlonhcaejH\u0006\u0010#4:GLLNPYY^_\\a_a_`aEHKEGGGFHcLo~^Pru{tcz~{B[jghkln[h_gf(\u001b-GFJKNNPQ]^[^__]`abaHIHGGFKIB\\TXxKJgw~v{~iWlrjlq`]kciR7:CGMHNSNNXZ_\\_a]]d`c]IIFIIIHL@KY@rlBM^wx|vkntywzz|ytvjZlggh38BJGLJNLQSX^\\^\\_`aaac_GHFFJHFJJ;VK\\w|fVP]u}uupqh`[VU\\bfuwz{sx^ivfj\\! GKHMMLPPT[[`\\_^___cb_JDFGJFJEJDINBh~qkmr{vzltphg[_ckin|~||ypgasrcVS$\u001e<JKKPNQSUY[]Ya^_a]aaaGCCLEIJDKG=O3Pmv{}zi]vyoTMO\u0016,,IMMLSOWW]\\\\\\^__caba`EFFIFGIDEKB8R8Vtsm`lwr]<_C\u001003:NOPOSU\\Y_\\b^`b`_dabFEEEFG?=B<A1GC>avufhts_H6z-\u001018,KJPQPS[[Z[]a__a_``_GBCBDB?@;=@3<MBQqtqfftqkL4Zy\u0018\u0017/41;PRQQXY[][`]_a_aa``ABAAE@>:;=B0\u0019NWJfyw}kicmxjR7Cht\u0011\u0012.526KNRWYY[_[^a_ca_^_aC<BA>>;:;A9-\u000f4`VX{|mz{~w~}tjejqo];;Znp\u0011\u0013056/D9QTZ\\[_[`a]`ca`a_@<@>><=;??0$ \u000bNd[n~vuqnvy~{}z|{wnlltnaK2Sdwm(\u000e4644@1<BRY\\^\\```]c^a^a@?:?;>:>E;&)\u001a\n#cbpxyxxswnw}u{olowrdU7JaqsgF\u0010,784A1458>Q^_\\_`^b_``b@=B7@97D;1#&\u0014\u001a\rMel{zuywvy}}~tokt}lV:FZnxobR\u00150::4:;05526=O^`]dZa_]`A<@A=7@B9$'\u0019\u001e\u0019\fGQpz}x}}}}xyrvuqdBBPjyyk^V\u00193:668<1437516:R`a__c^a>;A<8;FA*)\u0019\u001e\u001c \rKHVu}}vuxo{t^F>Qax}wo[N\u001f;1=45@/36963075BR^`c__=?;8*@H8*%\u0019\u001f\u001f\u001a\u0010O[Edu~vurrugD@Ndq|~svXI)2;:08>03664816068=R`_`7@9:5HG0+$$\u0018\u001f\u0012\u0016[[RFl{~zqmmiG@Obs{zvt^;.8643872965827534527=OZEE<:>P?0#+#\u001e \u0010\u001ebRaFVt}xyrmiXI@ObuyzuwY10<7548747=0;2747471724:B=9-LR:8'&%\u001f$\b,bS[[<fuyxlhcS?BO]w{vzvL22;7485;55<3:16684754541>85-RN=54&(\u001b'\u0002HaPUbT;l|zwt[WQ;@KZl}wyrB-<;45:79706823/84373661;IB9<WG?06,)$\u001e\u0004WeTTZaBXw~w{pdNAA@KZr|~{x{e;58=48668<21901743472=673LDBNPE7;..)  \tdfVMW`]:^jvonYJ;CEN]jx|xw].6=845:9:92.5377863405252KGFRMB:;.2& \u001b\u000fibXQSZ_U<Pgkw{k]E@FJN^mz~v~jQ3<B647=8:9/52966968727275GHCXIB>?00, \u001e\u0014jcUVPY\\YQEGV_o}vxjNF@DIR\\fxzzt^D6?862:9584,8877893697=489HFOTIA>?:2.!\u001d\u0015keU[JWYZYMC=ANtfoyyz|s}xigYI<=FKSWnx~yvkQ;==545>57:11>:8658767=<;<3IFOOCA>>:-/\"\u001f\u0013ig\\YKST[[UJ=63FJQ\\`iqnlpgicfdQH?;?@KN^g|ywlb><<5325<78>53:968287785=984GGTJ@D9@?2+!#\u0013iiaXJKS[VWOD9761>78Q>SOMVKLAB:A7<AGN_rz~wtdFB::4242:;4<9822795379679470"
  },
  {
    "path": "contrib/att_faces/s3/8.pgm",
    "content": "P5\n92 112\n255\nkhmilnmmlmnlnompolnXKR`[WNCOZP<Q@knGFHD64K^ks{qlxyr^IB210,%\u001c\u001f\u0019 +-2/G_[nqmomnqonlpqnlnoonnnkmkjkimkmkklmolmonqpc=DNPFcPIFPQRF8l[`JIMNA5<T]nahi`PFH<07/%-!!\u0018\u0013\u0013'/)6;KYgkhhnpnnooooonmnmnmlnlkkmkknimnomlnnoofX>@J@QbRNAGTRUIOfK`XPLPHIMIKB:F958@7;=?3' \u001e\u001b\u001e\u001e\u001c\u001f/=.AF`hjcihslonnnolnnipmmlkjlljklmmmnkonmnaZNHHJJgjhUX=cPLYI^H_\\VQTMMLKFHHK@:32+99C@<;$ .\u001a+\u001f6K=2FJa`hcdZdqlpmolnolonnmiloipjkomnonopekTBJM=PjzqQjZRHtR[RZ\\Y_XNSUOUNLLIA?;43AF,@C+0\u001c/\u001fAH2-6BDZYaQH[jopmrnlqmpmmpilklmllnkomnqfRPUO>C,kmfbl[TNebILU\\VSKMKJLOMUKKF8E:19>>B87 ,7F5+(96'MZ\\OSOnkknnnnomomlokmlklkmmmlnpfH:EKDDL=g|qtth\\_OOWiU9Y\\MKLG7=.>D?CKF@6:Q?=AC@'<^G86,(*!\u001eSZ@^ZdoeoqjmpomolmljolnkmknmnqH=CQ@.dLLAutddsyjVbNR[\\_FN]XNRT5:@;698?KQfjYSG;5:hYF@>4\"(\u001d\u001b:MGaYbglfnppmknnnmjlkjpmklnjq^;@GT:Llq^MTapwxqZ~vWbK[TRkXMe\\SLCD:B2&*<BEGG@:./ ^iK66F#\u001c!\u001d\"1LFdYfmkhhnopmpmnkkllioklmjmlCCQAZNed`zcZTY`eyuo}k`_\\RKYhYU^SJFG;:>4'5=06@:56Yjb0;<F \u001a\u001c \u001d#@LXgiotkgoqnonmmpmlmkllgmlcLBONCUahr^jxlOPQS]g}}zkaRZf`X_fRT>5<<<7.6BLHCJpcO1;FF!\u0015\u001c\u0019\u001f#6OZkmi{mjisnnqnomjlminhljaK>HKCIMgZtlUhvtqWMUKUrx{j^UT_WagnZK@18FFC@HKMcfUA+FQD\u001e\u0018\u001b\u0013%$$HghgispijomnpoopmikmlgeNV@AU8BVB_]]okZh\\mspm\\^^enwxxl[YNRTangTDAIRGLSU[OCC.H>J#\u001d\u001b\u0016\"\u001b'0Pnljkojjjqkponlkkjal\\\\IG@=T0CUJGOcQgkojXXajre]_[[ekzuijot}{urld`jgedcURU\\\\XULCT>ABI4\"\u001d\u0016\"\u0018$F-GcjjniikpkpmpmjmYUU?DC;;FC1NYHD;O]\\jvunrifwybfhed`\\dhmjgebgkhebdc\\UVYa^Z`fdb^a_VKJGF*$\"\u001f$ )D&5_nkcdnlomknnknIIL9;4;AI8+8Q?D<F;FQ`nsyxhqq|njkj_[XSWXRYSPTXVQRSPR^bmhqxx{x~tkh[YNJJ+-\u001a#$(AG:>LahfijnjmknnlK?5<0:8D@L5,/;<>B=@CDO\\aaakjda_gojmf^VYd_VVXUY^dgls~{sjcRHW@1 \"#/-IPF8PUldhinmnnmbH59B.3:>4PI4#.7>?@FMVRUOQJV^]W\\cfggi`aVWaV\\\\Zhqql_FN`D/\u001e&!*7EG.OTPledpmookgB(5;:.<9/I9D3\"&5;5IDHDGBEHLYTU[_beff_Y[afonrrlkS9adC*\"!!3AB1<UO_fennkojmX%%)+5.15DE5;)\u001e&94?DKLNNWOPTV_dhknokokttz}rcHBw[;\u001c\u001c\u001e3:LE9>P\\Nfdmlpm`H$\u0017*22=)43J>:,\" \u001a7;@9HKMYZ`]agouy~}wZ>onL*%\u0015*A=PE8AKVGhZomjF,\u001b\u001e\u001c2295-'*GM>/)%+1:ELSY`Zkot{v^S{[F.)\u001c9GIO8J+NSD_`p]#\u001f\u0018\u0017\u0014,;A4\u001e,&'7FGCA><ED\\\\Tcqwuds{L<5*.ILTEI50>:RWg-\u001a\u0017\u0018\u0013&0@A80+/+$),ACSW\\^\\\\fyrvd7854;GDjFM9%25RY\u001b\u0017\u0015\u0016*2/4D?0556/7IZ]jjbnrzſqxL>:=7@<IbIG6\u0019)-Q\u0016\u0015\u0014%4).2@SFDKNTjq{zu]1><D<<-QN8L'\u001a .\u0014\u0018\u001f+1*)7@W_\\v}wj6-FA@6+=E<7D\u001b\u0016#\u0012 &-\"+5@Ubgi|{K67EW--.6:0-8\u0010\u001d\u0014!&$)4KUNfh}|XJ;5]<\"\u001c7-2!)!\u0016\u001f!$.3DQ6OjpdAC@IX\u001f\u001d$4%-\u001b'\u001c#\"+47133Ppu|fU;?PL7\u0012\u001d$\"*\u001e\u001e+!)-.-%)=LnzxjTM5HNB\u0015\u0013\u001e\u001f \"\u001d&$(+ %(/6JquĽriPG@;PQ\"\u0014\u0014\u0019\u001d!\u001c\u001e*'!$)3..Lqwút^RM>'B[/\u001a\u0012\u0013\u001c\u001b\u001e!$\u001e)-,)-.Poz¿{xtdPLN70K=!\u0014\u0014\u0010\u0018#\u001a!&)+$)*0Tn~ƿǽnmTcQK=49B(\u0017\u0014\u0011\u0013\u0014 \u001f%+-%',1Rmwľ}ta]MQJJ727-\u001f\u0017\u0013\u0014\u0011\u001b'$&&*'#8Qgvþ|seXVIBMD-.%!\u0018\u0016\u001a\u0010\u0014\u001d%#'%$(2QlsývriWFKA@F./ #\u0014\u001c\u001a\u0015\u0015# $'###+Vpxûomeb=F@==,2!\u001d\u001a\u0016\u001f\u001a\u0014#\"\"(\u001e$\u001f.Xpw¼so^_C67>2..%\u001a\u001a\u0018\u0015!\u0016\u001b# %\" \u001c+Xp{þnnaTE/969)$\"\u001b\u0016\u0018\u0016\u0011\u001f#\u001e\u001e+ \"\u0018.^qydWOI-4405#\u001c\u0019\u0016\u0016\u0015\u0016\u0014 \u0019..#!\u001b)et|pOL;8%5'8'\u001b\u0016 \u0011\u0016\u0016\u0014\u001e\u001551&\"#$ho¿Žz{W=81&.+%2\u0016\u0018\u001a\u0015\u001b\u0014\u0015\u0011*84*(  noƼ½yd=6,)0+#+\u0018\u0016\u0019\u0017\u001c\u001f\u0017\u001c ,0-+)\u0018psw~}~gI7(13*\u001e'\u001a\u0019\u0015\u0019\u0011\u001b\u001f$\u0018\u00145,40\ropjmqms~ylqpikgu}xy}uD3*1C(\u001b\"\u0018\u0014\u001a\u001a\u0013\u0016\u0018\u0017\u001b\u001752H-\u0010iufhe_[vvmjaV[Z`\\X^sz{jolhbrty~~{tB**&@'\u0018\u001e\u0016\u0017\u0016\u0015\u0018\u001b\u0015\u0017\u000f'**:/\u0012n|khia[esvy|yupdYVT]im{~yrhbXRXZ`]nx|xnrhv|wt@\"!%5%\u0019\u0017\u001a\u0018\u0011\u0018\u001c\u001b\u001c$\u0014%#%;6 r}olfvmdedixztphekfhkmgmoksypprporkn{vr=\u001f\u001e\u001f2\u001a\u001d\u0014\u0019\u0019\u0016\u001d \u001f\u001f2\u0018-\u001b(95\u001e|llm~rgn~x{x~uxyoneqwzv@\u001b\u001c\"(\u0019\u0018\u0019\u0018\u001c\u001b\u001e\u001d\u001f\u001c@%2\u001a-4%*xqo~z{~{jyunht{nI \u0017\u001b\u001e\u001b\u0017\u001b\u001a\u001c\u001a\")*\"BH4 2-\u001e8|wx^Voxsh«xoy~~t?'\u000f\u0018\u001c\u001c\u001c\"\u001d +/;*\u0019>j@'?.\u0019M}vUT{{t}{yy}eª}wt{|r@*\u0010\u001c\u0015\u001e\"\u001e$).5V+\u0013DaP\u001bA:\u0018V}}fTZ^FS2')Jc|vzyyqzvw~z~|xB%\u0014\u0018\u0018 )\u001d/>>@z>C?\\Z)8=$bvqnpZ^J%8^qhmsz|Ôzh]weMQcqntx~{N\u001e\u0016\u001b/=E?GSE`3UJIn:=;'jwzdjÚvisJ-\"!>Zo~{zm{}xI\u001c\u001d&<?P[^h^x+]P?sQI;)ueU.&:@gndjnv}~Q\u001e 22>d|wqiq1_O?ffTB2}Ĺ}wspR'<?Je}~pcN]M>aq^K7tɿ~Z+LDcy~EVeN>Yvh^;}Ƹ~{c3ORvw\u001cL^MBWwknD{ű|{]MhyzK3GOHCRdwVǿ»z~^v@\\\\`IHI\\npľì|tz[Y[ceeKK@rLaÿ¾~zqsZEaedgLL<j^RƿĿ½ý¿tqbgLbggeIJAP|hľɾŽpmTvcB`afdIKI?wvʽ±keQMJZcgcGJJ=hy¾ĹgbVMV]`feIHK?b}wúze^c`Q]hefdHHL>U{mû¿oa_b;U`ecfcIEGHHiwh~yĽh]]tVN^eaddhEIIJHG]fux|ɺ~~e_VyB\\_abefaEIJEGDEZi|~y{ǻuvhYgTM\\aabdfdEHFGHIGN[k}wsvew|xpsdVvpLQ\\b``ecgDGGFGGEQHUly{p||lE1^snq~mhIso\\B[V[cb`deeHEGBMGFLL@Rmwriy{}J/+Sm{nkYI:J^xgl{ym\\OlrmZJD>S\\Y^`bfbfaHEHGIIFJL@?Zlyz~|uggzw{{]:74F^iwhWMEHTU`t`muxon[9\u0018!\"\u001e\"GKS\\Y^bcbfacDFEHGIHCLM<Efnqwp]au}|sR>:14DMWVACI_j|zefvwrlknY\u0018\u000b\u0015\u0017\u001c>ROY^]]`aabacIEFGHGHJAQL>_rpse\\gnyhP?6616@?Gakxu}~n\\qv~~}wzzpkgikE\n\u0013\u0018+9OSTZ\\^_abccaeHFFHHHHEBPYAVrr}riilrr|lQCGAEQXky}~w]\\mrsropspbifjk'\f!<EMPVV[^`b`acbdcHDGDIHGIBI\\KPrspkq^pt{mhbY]mcnt}~_Mdmgkjqhalgla\u001d3<JPOPZWZ^_]cabbbbHCFDLFELFAWcDkm{whffx{|{hv~gexx}V^mtjopagiliK9CCKSLUYX^]\\c^cbcedABICDEFGF@LdI[w~vr][u|twn{~r~zyvj_thpe7JFJRMRRZX____adc`feCDDFAFEFGE@\\UIx}oLEdl|~ohjnpu~yzbo|klP JMLMQVS^Ya\\a_abaebe@EDEEEGEEK>I_H[eI>P\\p~~|vtskba[c^ns}tmc{pf^>\u00194OJRNTU[[\\^`b]bbcbeCDBGDGEEDKG8UQDkj[MOTd{yvrlf_Wefjs}~tbt}r\\S7\u001c*@PMTVYW`]a^a_adacgCEDAFHDFFGGA@WEXuxpothlglkszzunf}sfE\\* /+ORSXX[\\^`a_acaed`CBD@EFEEECJF=HO;aw{pho{hY6s \u001a4/9SXUV]Z^`_b`cad_hEAG@EEBCFFHDG5M9Efyºusllyt^=Tz\u001b\u001827+PVW\\X`__a`a`bdbeBCDFAGEBFBE>A87O6JiwokgyweG<pt\u0010\u0015541:ZZY[^[b^^`a`d^dCCDDDAF=C@??<6+AI7Sv|}}rnhlrrQ<Q~f\u000e\u00143391I^Z[]_ab_^c_acbECBACB?D@:<<<8 0LD@g~}yuz~~}wy|~z{plptqb@Cil\u0014\u0011058-@CP^^b]b``d_f_cA@?;A@@;>>8>>2\u001d\u0019@VFYwznl}twt}tu{{w{xzuluxtgW>_wyk;\t55;0@78?S^_eaaeabab@B=:C=>9>;;>;-\u001e\u0012\"SXOkz}{rmlopsxw~}wu|zrlyo^?Qo|yd^\u000463<3;</3:<N]`ab_bc_AD>?::8=::C=6!)\u0012\t;[\\av~uvutroo~}rsrw{jJCe{veg\u000f07=39B0/7588OY`dae_<@;@:;<;<9B>(% \u0015\u000b%Hd\\wy}uy|z}|yyw}pnRD[xrcf\u0019.:>58A7/46:35;H^ca`B;>=9?A:9B>4##\u001a\u001a\r)HW`sz{}|{xuv|tUAYk|vbX\u001a77=3;:445786167:HZa9<==7=;6<C>$+\u0016\u001b \u0011\u0012YFPoxzzuqtsd=Vi|zwhO$6;8:5>8378677624;9ED?B?:<55@B5&\u001e\u001b!\u001b\u0015\rVRAWp{}~rpnbCPfy~yxiF-4;:3887637857860:55HC::4536F@+$&\u001b\u001e\u001a\u0012\u0012TVQ?er~xvkkXDMdwy|c;*;=7677<58;793856863BH@9E;<BK7+%'\"\u0019 \f&UV[HAjt||mfeXFH]ry~Z148;675=92:;:56796955CR?>A65LK/9$$!\u001b$\u0006-WPY[@Lnz~}xiUT@GYl{}z}R16<8697;;54=92465975;CIB79,6PE8-1$\"\u001c\"\u0003>[HY\\X4Ul}zxoZCFDTj|||rM38B76<789745604735269><@@:/DW@:.5,\"&\u001b\u0007SXHO]XM5[t}qmQCCKYhw}{~k=1?<74=4::924353:66341MINGB8LN>=1,/&\u001f\u001b\n[^MJX]VD>hsw|kUFFKVdw~z~y_8;@;488?8=7.3878:;7874OKLICBTJ==23-&\u001d\u001b\u0015_ZUFT[US?>Xhnzz~fOCGOV`p}}{|mT:=<5797=87.759<7795<6>LKKFGHUDB<:+4&\u001d\u0016\u001adYYKOZZVN<:TThmzrm\\LBEPVbr}zqg?>?837=98=50>::797>3:9?GIHH?SPCE=@.6-\u001b\u0017\u001ai]URG[UXTF@9?LImqmx~{~zwwtgslZR@?HFX]q~wvhT8@:7/6:<8>847;5<66;69:<HKLLAUL@D:?60/\u001e\u001c\u0019hb[RHTSWXJG=563HRTWabimheg`_\\MS??@ANLdr{}xk^>:@4703?6<;<7476<6766:<8JNKFJPI@=;=<.,! \u0018hecTLIUWTPJ?937027;;@IALICHAC8=8?>DLct~{obI;?94627=8?=86:1/78248:89"
  },
  {
    "path": "contrib/att_faces/s3/9.pgm",
    "content": "P5\n92 112\n255\nhmhmjilljmlmmllimpi`]ab`LQOJAWNML>BXLDIHsofM@ABOV[f__QA<;92/-!+\u001e#!&WSfcnoghfjporopooopqplnomhljlkmjmklkpjnnmplS<8M_YYR]IO\\NK\\C`^PNQ[QfXmfJGUWNMLHG4578<0A-1!\u0019)!9;RY`mnl`angiqonqooopokpnjgjkjllkllionknpmT85;KPSMO[XZfvV{o^Xn_P\\V]claPWPSOGMD@>A26/AD64.#*#@XNSKKU_U`JT_roqqonnqmopkiikkmlljokmknpqj@3>BEOYWYagWuqbnf[FQMcYYhbMPSPJHLEE8=573.=F6$%4HQU.4,ANXS[`nkpopooonmokijhimklhnlmjqnqN.)DCCPXL_c|n_utw_Z^DMGk[Sj_VO:=/A>@@@C4-<@D?;)1@VS1+9$<Y`g[llimpspopnoljliklmnllnojopb= )@CAITHOlokn~enpueSfWIX[cX\\baNB45766A4HKXO>G>1$E[L8,5(:OpgandmkmrslpooeikkkkjlkmmmbfdU;,@>=:EIc^UXlhfbk~{ikf\\VTSMWY[Q\\SEC57(+<EDB31(3#&XZC521'8Qg_kghmkpnpnqnmkjjnimmlnmoaE;E;36Q@99;ZgbqYNgegb`o~kafXTVLDcQST^RF.69*>58,812,D\\V793,&USNhnlglplnqnopmjkhmhjmmlmpJ910,6CGL@OLqchovlbW_`ahhopqw|tiZSKNQVQ``R959>1/>62:.QUP5B@\u001d4_QOjnmmkoqiqmqlphhlimjklmq]932-,=D@;JNagqnnlltjWXYb^UR^oxwp{~lZDLHHP[b[;-?B:087>QK;>JD\u001b;VTYlinolgrnnnqnnlhlkkmgknqP=3(619FB>H9gi_jypnklzqvdih``S^kotuwqt{yuiaKEEIW[OGCEH@9FN138P=\u001e74RXakolrjronqpnqijimjkklneZ=50C4-@>8WCGe[f`a~ra[adjfng\\ZQL>MY^dik[^UYcb]`XXTUPLMPLDII\u001f#5DJ*5U^]cmloqlqnornorljlkkflkd`X<97G?.-2<QLIPRZb^nrqpnhhediaeg^YKKHJLZXRXINTSKIBBDEFONVUJE0&+7T'2J\\fjeepnpmkoponmlihjjhgYPWL?8==M8'#1UNHIBGVRfghuy|qkicf`__XSNMG@GJLHJCKSNLMQOXZdgfmgZR@\u001f2Y:$49_iggclerkmrppnnkhjgkjJJMD-4A>B;0 \u001f>K?ICGLFFNNNZ]\\a]aaVZQPZSZYUPNMSXIKZ]_fmuw{~~~|wjZ64MK&*,8TjmkgkomfsmsmmdfOVIE;>A7 6B@E-C(\"#'2=BMMOFSLGSUTLIHLINOTYUOVa]STZ[[[lw~pSI4X% 8&7>gklelnigrqpoTKE8-(5+88'/<@E+IQ.%$\".9BJLJa\\OOPGMLIRQVSPTPUQOR^dop{snUDH0&)%0>.\\khklmmlrjmL7;A.$41//?3099,<JH@1\u001b& 6@J@JTU]VX]XYU]X]bdkgcfky{~gTK;#'%6:.?TjngionopqS3,17C:6534E.)4.+=F>9),$+/8CHKJLTU\\hc^ffityz}{eRD)\"$23<8ILlkaqnomgF+3!*)495-6--!\"622ED>4*.#%0:EIPWU[dejtqvuy[[?!4'-.K<GNhjknpjkD&?1\u001d$\u001e%2-46%% &.-/=>G<<8>J?EEQcdeiuwv}vgb,09+4@H7LTkimlrsE+<\"\u001d#'#$6'02-#\u001f(!*'3<9<HMPXXcihkoxwsU)863<EF7[SnlojjN(%\u001f$'\u001e'626,.1-',#'+''.7DXerrmmt|yr@=.:D>4==U\\nmr]F\"\u001e\u001f\"\u001a\u001eAWPB83:?32244*8JZcquy}yx^;?85G'I0=NflsK&\u001c\u001c\u0017\u0018\u0017>[bUVLCFB:IG@D[q}½vw8=:=>(8@%>Qjo,\u0016\u001a\u0016\u0015\u00185PY[fZhg]^`cks~¼zwZ:BBE6\u001cG1&4Uq\u0012\u0017\u0013\u0016\u0017-AKNaYrtktssmLG>>R\u00122A#$-j\u0014\u0015\u0014\u0017#8D@PK]}}|~v|¸isX=7HI.\u001b<*$#4\u0016\u0011\u0019\u0019.75BL\\wls^H-FN;!&+ !'\u0017\u0014\u001a 2/7Ja{v~ſʻqsYN=:FS+\u001c!#!\u001b\u0013\u0010 (,2:ixigix|ÿɹsn^K@46PD\u001f\u0016 \u001d$\t\u001b\"))AM\\GLZmsoĿ{ncCD:-&Q/\u0017\u0019\u001f\"\u0010\u001c($7<<=8D_fiož~ym`NE@9%4B\u0015\u001a\u0018\u001f\u0014%'(53,46HTY_p~ż{xs`IE?B3)=$\u0012\u0017\u0018#&%02,,3HHITXn{¾{zq`GFA><(7%\u0019\u0012\u0018()0(,/6;7?FNYl~wxo]M;@5?22&\u0017\u0014\u0018#1)\",61.4@GG\\gv~szqWK92;453%\u0019\u001b\u001a\u001f/&$'54/48AAXfv}xſ¿uxs_K<,58-.*\u001b\u0016\u001f\"+#-.5034/:EYgp{¿uvv[K63,7,(-\u001c\u0016 \u001e)%,$*8$./9LRdzþwqv`J3(6.-/%\u001e\u0019\u0013#$'$*0/+%,=BSduruj>5+*4++3\u0019\u0019\u0012&% '+30')&>?Xi|yvrkO)+#1,(4\u001a\u0017\u0014$\"' -;,*$&6Cau|ľ¿ywqpV($$-,%&&\u0016\u0015#\u001f-\u001e./0.'&1Kk{{ž¿s}kqW(% 32#!\"\u001d\u0018\u001d!,\u001b(.6((!2Xkxzxxy{t}wvmtW\"'(43\u001c$ \u0013\u001e \u001d. \u0019:9)'+0To|}{wzqtw{ojjj`hnmr~zzund_gtptX\u001f$%>7\u001c\u001e\u001e\u0019\u0013\u001f\u001d)\u001d\u0018:?1-+/Ro{|w||mec`a`e`drpcbVPPVW[flrwhcf[[htwR\u001f\"+4:\u001e\u0019\u001f\u0017\u0015\u001a\u001e% \u00167E7307Ip}zuuszemi}}tkheY_WUUY_dow|xrlc[\\^_gpjpksulotp`SwuH\u001a\u001d,(7\u0019\u001a\u0019\u0019\u0016\u0015\u0018)\u0018\u001c 8C6?6?s~}yuyppv~sfeglquwrtwvty||dSlrA\u0019#\u001a0)\u0016\u001b\u0019 \u0018\u0015\u0014%\u0016\u001e\u001c)AAF18r}}vtzwzwy~tPiv=\u001f\u0019!%\u001e\u0017\u001c\u001a\u001c\u001d\u0019\u0019\u001f\u0015\u001a\u001f\"5AH+6uw}}xslgfmq~zy{uÿx|~}tkigpy}v~Znx;\"\u0015!\u001f\u0017\u0019\u001d\u0017\u001a\u001e\u0018\u0015\u001a\u001a\u0016\u001d#*<B-=zx}zthcltEk\\aWvxrv|òx}xXNFL>^fg}ar{apyA&\u0013\u0019!\u001b\u001a\u0019(+9\u001a\u0011\u0018\u001c\u0018\u001a&\"6>4G|}ibTm~iNpa`rs}|z|GM@\\S{XtVz{psxD+\u0019\u0010$\u001f *#6[\u001e\u001a\u0016\u001f\u001d\u0016!+37&KytbdNwtD+j_\\Ťq|¤yztw]\u0013m2GI__clyysxG-\u0015\u0018&\u001d\u001fH\u00189j0\"(\u001e\"\u001d&'63$U~~v]tr{tCawu˹}ţ}ЈWL+<TY|bcn~z{t{V% \u001e33+f*Ol9%'+/*% 91\u001fb}qyotyĴĨe]L]`tg|ww|_\u001d';B@?vQSnF.,7?;0.2@\"e~ì}w}z}}x|h\u00166FKNXZ\\l^689DIEA+=(n~·ƭ|~~g\u001d@b`^hRbgLK=RQQJ+0,o|Ħi2gnh~T`ldeLgi_O22'l}ƣfN~o{bbj{Wt}gP21.d}Þ~cosiecjxbxmR71*b|üġcScfjMmpP91/fvŽƧ{dxsPcji(ssF09Cdoy¿Žìyhh[gkf\bytL%ggaboþüƱvsYjghj\u000fcO8{]_h}¿¿ȴm}`cjfk&N~[DZ_ay¾þƴivYhiji)1uG__[tľÿ¿Ĺĵp{nXdihh?(tftcbYkǿƾøndZcihkM/oyi}gbZd|ĹxrZadgkeF:Nk|qbbYwſ¿­q[fdghgHC2xjbgVl½ñjsabggfgIE6JkggXh}ïj]deffigGEH\u001fqjida\\r{Ƶtoz]efhdfkKCF;4{cgiSlx~}fd~xzzhynWbegdffHD@M\"j__eZcrvrppP\u001a<pmyiWIRmzi|~t_fbffbfhFIFH/*yY[gZ^muzf[P008Uairzu\\F8DTkue{fc_acfccfehEJF?01!b}gQ\\dbXcrtidPE<@AMXYUKKQZgr|pa`[U`_bgdcgeheDGC596\u001d\u0018.FG21__dX[eop}~xl]OD=?HJLMjsz|opPGYY_dbcddffgfD@F<A5\u001b\u001f\u0017\u0014\u0017\u0014\u000eMceZUccgh}]Y[X]W`ry~}~sigGN\\[^bdaebhdfhBHDJ=9\u0015\u001f\u0014\u0018\u0019\u0012\n,]hZ[^_\\akv{srsyyw~ywne^LT]Y_bdedegaghCFEFED\u0018!\u0013\u0019\u0016\u0014\u000e\u0011Yc_Y_e\\Zcjv~~|n|vobgVNV]__cbdddcffhBCEGDL,\u001e\u001b\u0017\u0012\u0014\u0014\u0007<_hZdjj_ads~}ztwkvzysgdgNVYYa^dbddddgggCDFCHHD,\u001f\u0018\u0013\u0015\u0018\r\u001dYbaekqhoat~~~krxv|xr_l`QZZ`adadceechefG@DEHDFD3\"\u001a\u001a\u0015\u0014\u0010E[bclrvjpsow}z}wp^j^PZ^_`cdbcfeeggeCGAEEEFHE>7*$#\u00192Waipo{usy}{}ckoTX[a]c``cbcgedgeCCBHAGBEDHDBA8J&D\\koz~|z{|ptgqdRY^[]daadgeeicgdDBBBGBEFEKAGBK2\u0015;Mjkvz}w{}{mlp}{wkjr\\N]_^]c`cddcehcfhAECCG@FBFEFDJ@\u0019\u00137A^ioz{}|xrcZ\\Ykhmkuy}lkjc]^^]]mos|tjomOVZ_^_b_dcdfdffdgCCAH@FDDGBIGG,\u0016\r;2Raltzw|zdHB;6BEOSY^kZUF?CBHS_pvpim^JYZa^_c]ebddhfeeb>DBDDECHBEFG=!\u0019\f:AASenu}vu~xl`TQFDHBKRV^eqxtx{sqjjUF\\\\__c`bbgdfbgedf?DBACCBBCEFF1\u001a\u0013\b8T<FYdsvztzzvnlldE0_]`a]gbcdefcgde`A@CCCCE@BDD>,\u0019\u0012\u00056XK=F`lsrwt}}noblc5\u001fXa_a^bbcdaddfcdfB@BBCBEB@?=<,\u0016\u0013\u00056[Y;7XdjtmpypichN*&E`^_abc`haceffbgB>CECFEE@=?<&\u0013\u0011\u00044[^P3MYgbpkw{~}tyyyyy~}|nflb+*02V__a`bccf`chbdcIJIIMJCDB;F<%\u0015\u0014\u0005.^cNE4P_fpnlu~wovonuwxvx|}ufmkG\u0018236;BO[b_fbfdfdbfcMOJQLELF@G@;\u001c\u001b\u0013\u00030\\`RK:<Q[jqnw{zqttu}ywyyrsxyoao_\u001b\u001d090;1;=ESbc`ebgaf`RRPNFIKEEEG-'\u001a\u0015\u0004*ZfWNF/?Taqpt|yuvwut}|v|thdj9\u000b 367929579AO^cedefcQSNOGGJCGLF&)\u001a\u0013\u0006=[`ZXJ90D^okpyy}yzokeT/\u000e\"067:67<6457<GY]bdbTNRLMFLDMM>,&\u001b\u000e\u0015PY\\`XTA:-I_moq|~ugbYK;\u000e\"2576<7677471;6FQ\\`RQOMHHFEMO07\u001e\u001d\u000b'^UW_\\YHC53BaqmxnaRVJL\u000e$3545?58847454094>FSLPHK??IPH5. !\u0004>bSZ_^aOH<60C^hs{|wnPRc8Z\u0012$4947;:;9685:660:5;RNNHJH@NS=;'%'\u0004UdR[]aZ\\QC<63BPi|vzoWSXe@R\u0015'593:;5=74358877687JJKFL<DRL=7'*$\tcgSZ`id[XJA:419Ghq}wtcG]^h>Q\u001d,5<0;9785164956878:HDEHKEISI8:0+!\u000epkX]hfh`[QIA76.3HcqvwhQUbegAQ\u001d-7877=52632;6563685FHHWK@KRF::4-'\u0016to[^gildcWLI=6103C]h|}xlPTachfCO\u001f24<66A25/84:6<47:47QNGQE>QSE?934&\u001eyv]eehqdg[RJG=7;.1:SlxznWN_fglbGG\";9:5;<7167;:4:27><=JG@G8=PRE9<90*.~vgbhkjvec\\OFL89:107I`tto`N^gkljZP9,;:479</39:8:6993=9>BDBMDETHC:B29#Fwleimlqqf\\VMHA;:963,Pantr~uwp[K^copmkVO62:6167>194=749898=6@IMNPCGWFC8<:6\"S{nnhmnrln_[QJC=;:78.2@SWehqw~~rqm`NQ\\emwvncOM18<7/77;>2384:7868;8?HTRMDIUD?<9>9!Jxrrjimnlkd`VJGCA7=:;3569RH]Wv{lqyt|wwrkdaPRIO\\dlw{voYP=7;=2477:875209859:89<NMMMFIZ@??8=; H}snqmjjlmjcaWPHEF?;>;6:624:@8QbRTa``bXWVDDAETVbjwwziZI6<;73788=856:/3366:4;8"
  },
  {
    "path": "contrib/bgsegm.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_bgsegm)\n\n#include \"bgsegm.h\"\n\nBackgroundSubtractorCNT BackgroundSubtractorCNT_Create() {\n    try {\n        return new cv::Ptr<cv::bgsegm::BackgroundSubtractorCNT>(cv::bgsegm::createBackgroundSubtractorCNT());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid BackgroundSubtractorCNT_Close(BackgroundSubtractorCNT b) {\n    delete b;\n}\n\nOpenCVResult BackgroundSubtractorCNT_Apply(BackgroundSubtractorCNT b, Mat src, Mat dst) {\n    try {\n        (*b)->apply(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "contrib/bgsegm.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_bgsegm)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"bgsegm.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// BackgroundSubtractorCNT is a wrapper around the cv::BackgroundSubtractorCNT.\ntype BackgroundSubtractorCNT struct {\n\t// C.BackgroundSubtractorCNT\n\tp unsafe.Pointer\n}\n\n// NewBackgroundSubtractorCNT returns a new BackgroundSubtractor algorithm\n// of type CNT. CNT is Background subtraction algorithm based on counting.\n// About as fast as MOG2 on a high end system. More than twice faster than MOG2 on cheap hardware (benchmarked on Raspberry Pi3).\n// Algorithm by Sagi Zeevi\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/de/dca/classcv_1_1bgsegm_1_1BackgroundSubtractorCNT.html\nfunc NewBackgroundSubtractorCNT() BackgroundSubtractorCNT {\n\treturn BackgroundSubtractorCNT{p: unsafe.Pointer(C.BackgroundSubtractorCNT_Create())}\n}\n\n// Close BackgroundSubtractorCNT.\nfunc (b *BackgroundSubtractorCNT) Close() error {\n\tC.BackgroundSubtractorCNT_Close((C.BackgroundSubtractorCNT)(b.p))\n\tb.p = nil\n\n\treturn nil\n}\n\n// Apply computes a foreground mask using the current BackgroundSubtractorCNT.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/de/dca/classcv_1_1bgsegm_1_1BackgroundSubtractorCNT.html\nfunc (b *BackgroundSubtractorCNT) Apply(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.BackgroundSubtractorCNT_Apply((C.BackgroundSubtractorCNT)(b.p), (C.Mat)(src.Ptr()), (C.Mat)(dst.Ptr())))\n}\n"
  },
  {
    "path": "contrib/bgsegm.h",
    "content": "#ifndef _OPENCV3_BGSEGM_H_\n#define _OPENCV3_BGSEGM_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/bgsegm.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::bgsegm::BackgroundSubtractorCNT>* BackgroundSubtractorCNT;\n#else\ntypedef void* BackgroundSubtractorCNT;\n#endif\n\nBackgroundSubtractorCNT BackgroundSubtractorCNT_Create();\nvoid BackgroundSubtractorCNT_Close(BackgroundSubtractorCNT b);\nOpenCVResult BackgroundSubtractorCNT_Apply(BackgroundSubtractorCNT b, Mat src, Mat dst);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_BGSEGM_H_\n"
  },
  {
    "path": "contrib/bgsegm_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_bgsegm)\n\npackage contrib\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestCNT(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CNT test\")\n\t}\n\tdefer img.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tcnt := NewBackgroundSubtractorCNT()\n\tdefer cnt.Close()\n\n\tcnt.Apply(img, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestCNT test\")\n\t}\n}\n"
  },
  {
    "path": "contrib/cgo.go",
    "content": "//go:build !customenv && !opencvstatic\n\npackage contrib\n\n// Changes here should be mirrored in gocv/cgo.go and cuda/cgo.go\n\n/*\n#cgo !windows pkg-config: opencv4\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core4120 -lopencv_face4120 -lopencv_videoio4120 -lopencv_imgproc4120 -lopencv_highgui4120 -lopencv_imgcodecs4120 -lopencv_objdetect4120 -lopencv_features2d4120 -lopencv_video4120 -lopencv_dnn4120 -lopencv_xfeatures2d4120 -lopencv_plot4120 -lopencv_tracking4120 -lopencv_img_hash4120 -lopencv_calib3d4120 -lopencv_bgsegm4120 -lopencv_xphoto4120 -lopencv_aruco4120 -lopencv_wechat_qrcode4120 -lopencv_ximgproc4120 -lopencv_xobjdetect4120 -lopencv_mcc4120\n*/\nimport \"C\"\n"
  },
  {
    "path": "contrib/cgo_static.go",
    "content": "//go:build !customenv && opencvstatic && linux\n\npackage contrib\n\n// Changes here should be mirrored in contrib/cgo_static.go and cuda/cgo_static.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4\n#cgo amd64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -lippiw -lippicv -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n#cgo arm64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -ltegra_hal -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n*/\nimport \"C\"\n"
  },
  {
    "path": "contrib/cgo_static_darwin.go",
    "content": "//go:build !customenv && opencvstatic && darwin\n\npackage contrib\n\n// Changes here should be mirrored in contrib/cgo_static_darwin.go and cuda/cgo_static_darwin.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo pkg-config: --static opencv4\n*/\nimport \"C\"\n"
  },
  {
    "path": "contrib/cgo_static_windows.go",
    "content": "//go:build !customenv && opencvstatic && windows\n\npackage contrib\n\n// Changes here should be mirrored in contrib/cgo_static_windows.go and cuda/cgo_static_windows.go.\n\n/*\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo LDFLAGS:    -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo4120 -lopencv_tracking4120 -lopencv_superres4120 -lopencv_stitching4120 -lopencv_optflow4120 -lopencv_gapi4120 -lopencv_face4120 -lopencv_dpm4120 -lopencv_dnn_objdetect4120 -lopencv_ccalib4120 -lopencv_bioinspired4120 -lopencv_bgsegm4120 -lopencv_aruco4120 -lopencv_xobjdetect4120 -lopencv_ximgproc4120 -lopencv_xfeatures2d4120 -lopencv_videostab4120 -lopencv_video4120 -lopencv_structured_light4120 -lopencv_shape4120 -lopencv_rgbd4120 -lopencv_rapid4120 -lopencv_objdetect4120 -lopencv_mcc4120 -lopencv_highgui4120 -lopencv_datasets4120 -lopencv_calib3d4120 -lopencv_videoio4120 -lopencv_text4120 -lopencv_line_descriptor4120 -lopencv_imgcodecs4120 -lopencv_img_hash4120 -lopencv_hfs4120 -lopencv_fuzzy4120 -lopencv_features2d4120 -lopencv_dnn_superres4120 -lopencv_dnn4120 -lopencv_xphoto4120 -lopencv_wechat_qrcode4120 -lopencv_surface_matching4120 -lopencv_reg4120 -lopencv_quality4120 -lopencv_plot4120 -lopencv_photo4120 -lopencv_phase_unwrapping4120 -lopencv_ml4120 -lopencv_intensity_transform4120 -lopencv_imgproc4120 -lopencv_flann4120 -lopencv_core4120 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32\n*/\nimport \"C\"\n"
  },
  {
    "path": "contrib/contrib.go",
    "content": "// Package contrib is the GoCV wrapper around OpenCV Contrib.\n//\n// For further details, please see:\n// https://github.com/opencv/opencv_contrib\npackage contrib // import \"gocv.io/x/gocv/contrib\"\n"
  },
  {
    "path": "contrib/errors.go",
    "content": "package contrib\n\n/*\n#include \"../core.h\"\n*/\nimport \"C\"\nimport \"errors\"\n\n// Converts a OpenCVResult struct to an error.\nfunc OpenCVResult(result C.OpenCVResult) error {\n\tif result.Code == 0 {\n\t\treturn nil\n\t}\n\treturn errors.New(C.GoString(result.Message))\n}\n"
  },
  {
    "path": "contrib/face.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_face)\n\n#include \"face.h\"\n\nbool FaceRecognizer_Empty(FaceRecognizer fr) {\n    try {\n        return (*fr)->empty();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult FaceRecognizer_Train(FaceRecognizer fr, Mats mats, IntVector labels_in) {\n    try {\n        std::vector<int> labels;\n\n        for (int i = 0, *v = labels_in.val; i < labels_in.length; ++v, ++i) {\n            labels.push_back(*v);\n        }\n    \n        std::vector<cv::Mat> images;\n    \n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n    \n        (*fr)->train(images, labels);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FaceRecognizer_Update(FaceRecognizer fr, Mats mats, IntVector labels_in) {\n    try {\n        std::vector<int> labels;\n\n        for (int i = 0, *v = labels_in.val; i < labels_in.length; ++v, ++i) {\n            labels.push_back(*v);\n        }\n    \n        std::vector<cv::Mat> images;\n    \n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n    \n        (*fr)->update(images, labels);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint FaceRecognizer_Predict(FaceRecognizer fr, Mat sample) {\n    try {\n        int label;\n        label = (*fr)->predict(*sample);\n    \n        return label;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nstruct PredictResponse FaceRecognizer_PredictExtended(FaceRecognizer fr, Mat sample) {\n    try {\n        struct PredictResponse response;\n        int label;\n        double confidence;\n    \n        (*fr)->predict(*sample, label, confidence);\n        response.label = label;\n        response.confidence = confidence;\n    \n        return response;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        struct PredictResponse response;\n        return response;\n    }\n}\n\ndouble FaceRecognizer_GetThreshold(FaceRecognizer fr){\n    try {\n        return (*fr)->getThreshold();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid FaceRecognizer_SetThreshold(FaceRecognizer fr, double threshold) {\n    try {\n        (*fr)->setThreshold(threshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult FaceRecognizer_SaveFile(FaceRecognizer fr, const char*  filename) {\n    try {\n        (*fr)->write(filename);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FaceRecognizer_LoadFile(FaceRecognizer fr, const char*  filename) {\n    try {\n        (*fr)->read(filename);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BasicFaceRecognizer_Train(BasicFaceRecognizer fr, Mats mats, IntVector labels_in){\n    try {\n        std::vector<int> labels;\n\n        for (int i = 0, *v = labels_in.val; i < labels_in.length; ++v, ++i) {\n            labels.push_back(*v);\n        }\n    \n        std::vector<cv::Mat> images;\n    \n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n    \n        (*fr)->train(images, labels);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BasicFaceRecognizer_Update(BasicFaceRecognizer fr, Mats mats, IntVector labels_in){\n    try {\n        std::vector<int> labels;\n    \n        for (int i = 0, *v = labels_in.val; i < labels_in.length; ++v, ++i) {\n            labels.push_back(*v);\n        }\n    \n        std::vector<cv::Mat> images;\n    \n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n        (*fr)->update(images, labels);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat BasicFaceRecognizer_getEigenValues(BasicFaceRecognizer fr){\n    try {\n        return new cv::Mat((*fr)->getEigenValues());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat BasicFaceRecognizer_getEigenVectors(BasicFaceRecognizer fr){\n    try {\n        return new cv::Mat((*fr)->getEigenVectors());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat BasicFaceRecognizer_getLabels(BasicFaceRecognizer fr){\n    try {\n        return new cv::Mat((*fr)->getLabels());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat BasicFaceRecognizer_getMean(BasicFaceRecognizer fr){\n    try {\n        return new cv::Mat((*fr)->getMean());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nint BasicFaceRecognizer_getNumComponents(BasicFaceRecognizer fr) {\n    try {\n        return (*fr)->getNumComponents();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nMats BasicFaceRecognizer_getProjections(BasicFaceRecognizer fr) {\n    try {\n        Mats mats;\n\n        std::vector<cv::Mat> vec = (*fr)->getProjections();\n    \n        mats.length = (int)vec.size();\n        mats.mats = new Mat[vec.size()];\n    \n        for(size_t i = 0; i < vec.size(); i++) {\n            mats.mats[i] = new cv::Mat(vec[i]);\n        }\n        return mats;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Mats mats;\n        return mats;\n    }\n}\n\nvoid BasicFaceRecognizer_setNumComponents(BasicFaceRecognizer fr, int val){\n    try {\n        (*fr)->setNumComponents(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\t\n\nOpenCVResult BasicFaceRecognizer_SaveFile(BasicFaceRecognizer fr, const char*  filename){\n    try {\n        (*fr)->write(filename);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BasicFaceRecognizer_LoadFile(BasicFaceRecognizer fr, const char*  filename){\n    try {\n        (*fr)->read(filename);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nLBPHFaceRecognizer CreateLBPHFaceRecognizer() {\n    try {\n        return new cv::Ptr<cv::face::LBPHFaceRecognizer>(cv::face::LBPHFaceRecognizer::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid LBPHFaceRecognizer_SetRadius(LBPHFaceRecognizer fr, int radius) {\n    try {\n        (*fr)->setRadius(radius);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid LBPHFaceRecognizer_SetNeighbors(LBPHFaceRecognizer fr, int neighbors) {\n    try {\n        (*fr)->setNeighbors(neighbors);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint LBPHFaceRecognizer_GetNeighbors(LBPHFaceRecognizer fr) {\n    try {\n        return (*fr)->getNeighbors();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nvoid LBPHFaceRecognizer_SetGridX(LBPHFaceRecognizer fr, int x) {\n    try {\n        (*fr)->setGridX(x);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid LBPHFaceRecognizer_SetGridY(LBPHFaceRecognizer fr, int y) {\n    try {\n        (*fr)->setGridY(y);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint LBPHFaceRecognizer_GetGridX(LBPHFaceRecognizer fr) {\n    try {\n        return (*fr)->getGridX();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nint LBPHFaceRecognizer_GetGridY(LBPHFaceRecognizer fr) {\n    try {\n        return (*fr)->getGridY();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nvoid LBPHFaceRecognizer_Close(LBPHFaceRecognizer fr) {\n    delete fr;\n}\n\nFisherFaceRecognizer FisherFaceRecognizer_Create(void) {\n    try {\n        return new cv::Ptr<cv::face::FisherFaceRecognizer>(cv::face::FisherFaceRecognizer::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nFisherFaceRecognizer FisherFaceRecognizer_CreateWithParams(int num_components, float threshold) {\n    try {\n        return new cv::Ptr<cv::face::FisherFaceRecognizer>(cv::face::FisherFaceRecognizer::create(num_components, threshold));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FisherFaceRecognizer_Close(FisherFaceRecognizer fr) {\n    delete fr;\n}\n\nEigenFaceRecognizer EigenFaceRecognizer_Create(void) {\n    try {\n        return new cv::Ptr<cv::face::EigenFaceRecognizer>(cv::face::EigenFaceRecognizer::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nEigenFaceRecognizer EigenFaceRecognizer_CreateWithParams(int num_components, float threshold) {\n    try {\n        return new cv::Ptr<cv::face::EigenFaceRecognizer>(cv::face::EigenFaceRecognizer::create(num_components, threshold));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid EigenFaceRecognizer_Close(EigenFaceRecognizer fr) {\n    delete fr;\n}\n"
  },
  {
    "path": "contrib/face.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_face)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"face.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// PredictResponse represents a predicted label and associated confidence.\ntype PredictResponse struct {\n\tLabel      int32   `json:\"label\"`\n\tConfidence float32 `json:\"confidence\"`\n}\n\nvar _ FaceRecognizer = (*LBPHFaceRecognizer)(nil)\nvar _ FaceRecognizer = (*FisherFaceRecognizer)(nil)\nvar _ BasicFaceRecognizer = (*FisherFaceRecognizer)(nil)\nvar _ FaceRecognizer = (*EigenFaceRecognizer)(nil)\nvar _ BasicFaceRecognizer = (*EigenFaceRecognizer)(nil)\n\n// LBPHFaceRecognizer is a wrapper for the OpenCV Local Binary Patterns\n// Histograms face recognizer.\ntype LBPHFaceRecognizer struct {\n\tp C.LBPHFaceRecognizer\n}\n\n// Empty returns true if the model is empty.\nfunc (fr *LBPHFaceRecognizer) Empty() bool {\n\treturn faceRecognizer_Empty(C.FaceRecognizer(fr.p))\n}\n\n// NewLBPHFaceRecognizer creates a new LBPH Recognizer model.\n//\n// For further information, see:\n// https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html\nfunc NewLBPHFaceRecognizer() *LBPHFaceRecognizer {\n\treturn &LBPHFaceRecognizer{p: C.CreateLBPHFaceRecognizer()}\n}\n\n// Train loaded model with images and their labels\n//\n// see https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6\nfunc (fr *LBPHFaceRecognizer) Train(images []gocv.Mat, labels []int) error {\n\treturn faceRecognizer_Train(C.FaceRecognizer(fr.p), images, labels)\n}\n\n// Update updates the existing trained model with new images and labels.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a8a4e73ea878dcd0c235d0487189d25f3\nfunc (fr *LBPHFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int) error {\n\treturn faceRecognizer_Update(C.FaceRecognizer(fr.p), newImages, newLabels)\n}\n\n// Predict predicts a label for a given input image. It returns the label for\n// correctly predicted image or -1 if not found.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631\nfunc (fr *LBPHFaceRecognizer) Predict(sample gocv.Mat) int {\n\tlabel := faceRecognizer_Predict(C.FaceRecognizer(fr.p), sample)\n\n\treturn int(label)\n}\n\n// PredictExtendedResponse returns a label and associated confidence (e.g.\n// distance) for a given input image. It is the extended version of\n// `Predict()`.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251\nfunc (fr *LBPHFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictResponse {\n\tresp := faceRecognizer_PredictExtendedResponse(C.FaceRecognizer(fr.p), sample)\n\n\treturn resp\n}\n\n// GetThreshold gets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#acf2a6993eb4347b3f89009da693a3f70\nfunc (fr *LBPHFaceRecognizer) GetThreshold() float32 {\n\tt := faceRecognizer_GetThreshold(C.FaceRecognizer(fr.p))\n\treturn float32(t)\n}\n\n// SetThreshold sets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63\nfunc (fr *LBPHFaceRecognizer) SetThreshold(threshold float32) {\n\tfaceRecognizer_SetThreshold(C.FaceRecognizer(fr.p), threshold)\n}\n\n// SetNeighbors sets the neighbors value of the model, i.e. the number of\n// sample points to build a Circular Local Binary Pattern from. Note that wrong\n// neighbors can raise OpenCV exception!\n//\n// For further information, see:\n// https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ab225f7bf353ce8697a506eda10124a92\nfunc (fr *LBPHFaceRecognizer) SetNeighbors(neighbors int) {\n\tC.LBPHFaceRecognizer_SetNeighbors(fr.p, C.int(neighbors))\n}\n\n// GetNeighbors returns the neighbors value of the model.\n//\n// For further information, see:\n// https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a50a3e2ca6e8464166e153c9df84b0a77\nfunc (fr *LBPHFaceRecognizer) GetNeighbors() int {\n\n\tn := C.LBPHFaceRecognizer_GetNeighbors(fr.p)\n\n\treturn int(n)\n}\n\n// SetRadius sets the radius used for building the Circular Local Binary\n// Pattern.\n//\n// For further information, see:\n// https://docs.opencv.org/master/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a62d94c75cade902fd3b487b1ef9883fc\nfunc (fr *LBPHFaceRecognizer) SetRadius(radius int) {\n\tC.LBPHFaceRecognizer_SetRadius(fr.p, C.int(radius))\n}\n\n// SaveFile saves the trained model data to file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6\nfunc (fr *LBPHFaceRecognizer) SaveFile(fname string) error {\n\treturn faceRecognizer_SaveFile(C.FaceRecognizer(fr.p), fname)\n}\n\n// LoadFile loads a trained model data from file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3\nfunc (fr *LBPHFaceRecognizer) LoadFile(fname string) error {\n\treturn faceRecognizer_LoadFile(C.FaceRecognizer(fr.p), fname)\n}\n\n// SetGridX sets grid's X value\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ad65975baee31dbf3bd2a750feef74831\nfunc (fr *LBPHFaceRecognizer) SetGridX(x int) {\n\tC.LBPHFaceRecognizer_SetGridX(fr.p, C.int(x))\n}\n\n// SetGridY sets grid's Y value\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a9cebb0138dbb3553b27beb2df3924ae6\nfunc (fr *LBPHFaceRecognizer) SetGridY(y int) {\n\tC.LBPHFaceRecognizer_SetGridY(fr.p, C.int(y))\n}\n\n// GetGridX gets grid's X value\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#ada6839bed931a8f68c5127e1af7a8b83\nfunc (fr *LBPHFaceRecognizer) GetGridX() int {\n\tx := C.LBPHFaceRecognizer_GetGridX(fr.p)\n\treturn int(x)\n}\n\n// GetGridY gets grid's Y value\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#a22c68c0baf3eb9e852f47ae9241dbf15\nfunc (fr *LBPHFaceRecognizer) GetGridY() int {\n\ty := C.LBPHFaceRecognizer_GetGridY(fr.p)\n\treturn int(y)\n}\n\n// SetGrid helper for SetGrid* functions\nfunc (fr *LBPHFaceRecognizer) SetGrid(p image.Point) {\n\tfr.SetGridX(p.X)\n\tfr.SetGridY(p.Y)\n}\n\n// GetGrid helper for GetGrid* functions\nfunc (fr *LBPHFaceRecognizer) GetGrid() image.Point {\n\treturn image.Pt(fr.GetGridX(), fr.GetGridY())\n}\n\nfunc (fr *LBPHFaceRecognizer) Close() error {\n\tC.LBPHFaceRecognizer_Close(fr.p)\n\tfr.p = nil\n\treturn nil\n}\n\ntype FisherFaceRecognizer struct {\n\tp C.FisherFaceRecognizer\n}\n\n// NewFisherFaceRecognizer creates a new Fisher Recognizer model.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/d2/de9/classcv_1_1face_1_1FisherFaceRecognizer.html#ac6e204df6d7e526f4c77d3e0389dfbaa\nfunc NewFisherFaceRecognizer() *FisherFaceRecognizer {\n\treturn &FisherFaceRecognizer{p: C.FisherFaceRecognizer_Create()}\n}\n\n// NewFisherFaceRecognizerWithParams creates a new Fisher Recognizer model.\n//\n// [num_components]\tThe number of components (read: Fisherfaces) kept for this Linear Discriminant Analysis with the Fisherfaces criterion. It's useful to keep all components, that means the number of your classes c (read: subjects, persons you want to recognize). If you leave this at the default (0) or set it to a value less-equal 0 or greater (c-1), it will be set to the correct number (c-1) automatically.\n//\n// [threshold] The threshold applied in the prediction. If the distance to the nearest neighbor is larger than the threshold, this method returns -1.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/d2/de9/classcv_1_1face_1_1FisherFaceRecognizer.html#ac6e204df6d7e526f4c77d3e0389dfbaa\nfunc NewFisherFaceRecognizerWithParams(numComponents int, threshold float32) *FisherFaceRecognizer {\n\treturn &FisherFaceRecognizer{p: C.FisherFaceRecognizer_CreateWithParams(C.int(numComponents), C.float(threshold))}\n}\n\n// Empty returns true if the model is empty.\nfunc (fr *FisherFaceRecognizer) Empty() bool {\n\tb := faceRecognizer_Empty(C.FaceRecognizer(fr.p))\n\treturn bool(b)\n}\n\nfunc (fr *FisherFaceRecognizer) GetEigenValues() gocv.Mat {\n\treturn basicFaceRecognizer_GetEigenValues(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *FisherFaceRecognizer) GetEigenVectors() gocv.Mat {\n\treturn basicFaceRecognizer_GetEigenVectors(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *FisherFaceRecognizer) GetLabels() gocv.Mat {\n\treturn basicFaceRecognizer_GetLabels(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *FisherFaceRecognizer) GetMean() gocv.Mat {\n\treturn basicFaceRecognizer_GetMean(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *FisherFaceRecognizer) GetNumComponents() int {\n\treturn basicFaceRecognizer_GetNumComponents(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *FisherFaceRecognizer) SetNumComponents(val int) {\n\tbasicFaceRecognizer_SetNumComponents(C.BasicFaceRecognizer(fr.p), val)\n}\n\nfunc (fr *FisherFaceRecognizer) GetProjections() []gocv.Mat {\n\treturn basicFaceRecognizer_GetProjections(C.BasicFaceRecognizer(fr.p))\n}\n\n// GetThreshold gets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#acf2a6993eb4347b3f89009da693a3f70\nfunc (fr *FisherFaceRecognizer) GetThreshold() float32 {\n\treturn faceRecognizer_GetThreshold(C.FaceRecognizer(fr.p))\n}\n\n// SetThreshold sets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63\nfunc (fr *FisherFaceRecognizer) SetThreshold(threshold float32) {\n\tfaceRecognizer_SetThreshold(C.FaceRecognizer(fr.p), threshold)\n}\n\n// LoadFile loads a trained model data from file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3\nfunc (fr *FisherFaceRecognizer) LoadFile(filename string) error {\n\treturn basicFaceRecognizer_LoadFile(C.BasicFaceRecognizer(fr.p), filename)\n}\n\n// SaveFile saves the trained model data to file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6\nfunc (fr *FisherFaceRecognizer) SaveFile(filename string) error {\n\treturn basicFaceRecognizer_SaveFile(C.BasicFaceRecognizer(fr.p), filename)\n}\n\n// Predict predicts a label for a given input image. It returns the label for\n// correctly predicted image or -1 if not found.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631\nfunc (fr *FisherFaceRecognizer) Predict(sample gocv.Mat) int {\n\treturn faceRecognizer_Predict(C.FaceRecognizer(fr.p), sample)\n}\n\n// PredictExtendedResponse returns a label and associated confidence (e.g.\n// distance) for a given input image. It is the extended version of\n// `Predict()`.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251\nfunc (fr *FisherFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictResponse {\n\treturn faceRecognizer_PredictExtendedResponse(C.FaceRecognizer(fr.p), sample)\n}\n\n// Train loaded model with images and their labels\n//\n// see https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6\nfunc (fr *FisherFaceRecognizer) Train(images []gocv.Mat, labels []int) error {\n\treturn basicFaceRecognizer_Train(C.BasicFaceRecognizer(fr.p), images, labels)\n}\n\n// Update This model does not support updating.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/d2/de9/classcv_1_1face_1_1FisherFaceRecognizer.html#ac6e204df6d7e526f4c77d3e0389dfbaa\nfunc (fr *FisherFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int) error {\n\treturn faceRecognizer_Train(C.FaceRecognizer(fr.p), newImages, newLabels)\n\n}\n\nfunc (fr *FisherFaceRecognizer) Close() error {\n\tC.FisherFaceRecognizer_Close(fr.p)\n\tfr.p = nil\n\treturn nil\n}\n\ntype EigenFaceRecognizer struct {\n\tp C.EigenFaceRecognizer\n}\n\n// NewEigenFaceRecognizer creates a new Eigen Recognizer model.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/dd/d7c/classcv_1_1face_1_1EigenFaceRecognizer.html#a22c8392f27a20b24d04351b675e7b6db\nfunc NewEigenFaceRecognizer() *EigenFaceRecognizer {\n\treturn &EigenFaceRecognizer{p: C.EigenFaceRecognizer_Create()}\n}\n\n// NewEigenFaceRecognizerWithParams creates a new Eigen Recognizer model.\n//\n// [num_components]\tThe number of components (read: Eigenfaces) kept for this Principal Component Analysis.\n// [threshold]\tThe threshold applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/dd/d7c/classcv_1_1face_1_1EigenFaceRecognizer.html#a22c8392f27a20b24d04351b675e7b6db\nfunc NewEigenFaceRecognizerWithParams(numComponents int, threshold float32) *EigenFaceRecognizer {\n\treturn &EigenFaceRecognizer{p: C.EigenFaceRecognizer_CreateWithParams(C.int(numComponents), C.float(threshold))}\n}\n\n// Empty returns true if the model is empty.\nfunc (fr *EigenFaceRecognizer) Empty() bool {\n\tb := faceRecognizer_Empty(C.FaceRecognizer(fr.p))\n\treturn bool(b)\n}\n\nfunc (fr *EigenFaceRecognizer) GetEigenValues() gocv.Mat {\n\treturn basicFaceRecognizer_GetEigenValues(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *EigenFaceRecognizer) GetEigenVectors() gocv.Mat {\n\treturn basicFaceRecognizer_GetEigenVectors(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *EigenFaceRecognizer) GetLabels() gocv.Mat {\n\treturn basicFaceRecognizer_GetLabels(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *EigenFaceRecognizer) GetMean() gocv.Mat {\n\treturn basicFaceRecognizer_GetMean(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *EigenFaceRecognizer) GetNumComponents() int {\n\treturn basicFaceRecognizer_GetNumComponents(C.BasicFaceRecognizer(fr.p))\n}\n\nfunc (fr *EigenFaceRecognizer) SetNumComponents(val int) {\n\tbasicFaceRecognizer_SetNumComponents(C.BasicFaceRecognizer(fr.p), val)\n}\n\nfunc (fr *EigenFaceRecognizer) GetProjections() []gocv.Mat {\n\treturn basicFaceRecognizer_GetProjections(C.BasicFaceRecognizer(fr.p))\n}\n\n// GetThreshold gets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html#acf2a6993eb4347b3f89009da693a3f70\nfunc (fr *EigenFaceRecognizer) GetThreshold() float32 {\n\treturn faceRecognizer_GetThreshold(C.FaceRecognizer(fr.p))\n}\n\n// SetThreshold sets the threshold value of the model, i.e. the threshold\n// applied in the prediction.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a3182081e5f8023e658ad8ab96656dd63\nfunc (fr *EigenFaceRecognizer) SetThreshold(threshold float32) {\n\tfaceRecognizer_SetThreshold(C.FaceRecognizer(fr.p), threshold)\n}\n\n// LoadFile loads a trained model data from file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#acc42e5b04595dba71f0777c7179af8c3\nfunc (fr *EigenFaceRecognizer) LoadFile(filename string) error {\n\treturn basicFaceRecognizer_LoadFile(C.BasicFaceRecognizer(fr.p), filename)\n}\n\n// SaveFile saves the trained model data to file.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#a2adf2d555550194244b05c91fefcb4d6\nfunc (fr *EigenFaceRecognizer) SaveFile(filename string) error {\n\treturn basicFaceRecognizer_SaveFile(C.BasicFaceRecognizer(fr.p), filename)\n}\n\n// Predict predicts a label for a given input image. It returns the label for\n// correctly predicted image or -1 if not found.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#aa2d2f02faffab1bf01317ae6502fb631\nfunc (fr *EigenFaceRecognizer) Predict(sample gocv.Mat) int {\n\treturn faceRecognizer_Predict(C.FaceRecognizer(fr.p), sample)\n}\n\n// PredictExtendedResponse returns a label and associated confidence (e.g.\n// distance) for a given input image. It is the extended version of\n// `Predict()`.\n//\n// For further information, see:\n// https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ab0d593e53ebd9a0f350c989fcac7f251\nfunc (fr *EigenFaceRecognizer) PredictExtendedResponse(sample gocv.Mat) PredictResponse {\n\treturn faceRecognizer_PredictExtendedResponse(C.FaceRecognizer(fr.p), sample)\n}\n\n// Train loaded model with images and their labels\n//\n// see https://docs.opencv.org/master/dd/d65/classcv_1_1face_1_1FaceRecognizer.html#ac8680c2aa9649ad3f55e27761165c0d6\nfunc (fr *EigenFaceRecognizer) Train(images []gocv.Mat, labels []int) error {\n\treturn basicFaceRecognizer_Train(C.BasicFaceRecognizer(fr.p), images, labels)\n}\n\n// Update This model does not support updating.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/dd/d7c/classcv_1_1face_1_1EigenFaceRecognizer.html#a22c8392f27a20b24d04351b675e7b6db\nfunc (fr *EigenFaceRecognizer) Update(newImages []gocv.Mat, newLabels []int) error {\n\treturn basicFaceRecognizer_Train(C.BasicFaceRecognizer(fr.p), newImages, newLabels)\n}\n\nfunc (fr *EigenFaceRecognizer) Close() error {\n\tC.EigenFaceRecognizer_Close(fr.p)\n\tfr.p = nil\n\treturn nil\n}\n"
  },
  {
    "path": "contrib/face.h",
    "content": "#ifndef _OPENCV3_FACE_H_\n#define _OPENCV3_FACE_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/face.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::face::FaceRecognizer>* FaceRecognizer;\ntypedef cv::Ptr<cv::face::BasicFaceRecognizer>* BasicFaceRecognizer;\ntypedef cv::Ptr<cv::face::LBPHFaceRecognizer>* LBPHFaceRecognizer;\ntypedef cv::Ptr<cv::face::EigenFaceRecognizer>* EigenFaceRecognizer;\ntypedef cv::Ptr<cv::face::FisherFaceRecognizer>* FisherFaceRecognizer;\n#else\ntypedef void* FaceRecognizer;\ntypedef void* BasicFaceRecognizer;\ntypedef void* LBPHFaceRecognizer;\ntypedef void* EigenFaceRecognizer;\ntypedef void* FisherFaceRecognizer;\n#endif\n\nstruct PredictResponse {\n    int label;\n    double confidence;\n};\n\nbool FaceRecognizer_Empty(FaceRecognizer fr);\nOpenCVResult FaceRecognizer_Train(FaceRecognizer fr, Mats images, IntVector labels);\nOpenCVResult FaceRecognizer_Update(FaceRecognizer fr, Mats images, IntVector labels);\nint FaceRecognizer_Predict(FaceRecognizer fr, Mat sample);\nstruct PredictResponse FaceRecognizer_PredictExtended(FaceRecognizer fr, Mat sample);\ndouble FaceRecognizer_GetThreshold(FaceRecognizer fr);\nvoid FaceRecognizer_SetThreshold(FaceRecognizer fr, double threshold);\nOpenCVResult FaceRecognizer_SaveFile(FaceRecognizer fr, const char*  filename);\nOpenCVResult FaceRecognizer_LoadFile(FaceRecognizer fr, const char*  filename);\n\n\nOpenCVResult BasicFaceRecognizer_Train(BasicFaceRecognizer fr, Mats images, IntVector labels);\nOpenCVResult BasicFaceRecognizer_Update(BasicFaceRecognizer fr, Mats images, IntVector labels);\nMat BasicFaceRecognizer_getEigenValues(BasicFaceRecognizer fr);\nMat BasicFaceRecognizer_getEigenVectors(BasicFaceRecognizer fr);\nMat BasicFaceRecognizer_getLabels(BasicFaceRecognizer fr);\nMat BasicFaceRecognizer_getMean(BasicFaceRecognizer fr);\nint BasicFaceRecognizer_getNumComponents(BasicFaceRecognizer fr);\nMats BasicFaceRecognizer_getProjections(BasicFaceRecognizer fr);\nvoid BasicFaceRecognizer_setNumComponents(BasicFaceRecognizer fr, int val);\t\nOpenCVResult BasicFaceRecognizer_SaveFile(BasicFaceRecognizer fr, const char*  filename);\nOpenCVResult BasicFaceRecognizer_LoadFile(BasicFaceRecognizer fr, const char*  filename);\n\nLBPHFaceRecognizer CreateLBPHFaceRecognizer(void);\nvoid LBPHFaceRecognizer_SetRadius(LBPHFaceRecognizer fr, int radius);\nvoid LBPHFaceRecognizer_SetNeighbors(LBPHFaceRecognizer fr, int neighbors);\nint LBPHFaceRecognizer_GetNeighbors(LBPHFaceRecognizer fr);\nvoid LBPHFaceRecognizer_SetGridX(LBPHFaceRecognizer fr, int x);\nvoid LBPHFaceRecognizer_SetGridY(LBPHFaceRecognizer fr, int y);\nint LBPHFaceRecognizer_GetGridX(LBPHFaceRecognizer fr);\nint LBPHFaceRecognizer_GetGridY(LBPHFaceRecognizer fr);\nvoid LBPHFaceRecognizer_Close(LBPHFaceRecognizer fr);\n\n\nFisherFaceRecognizer FisherFaceRecognizer_Create(void);\nFisherFaceRecognizer FisherFaceRecognizer_CreateWithParams(int num_components, float threshold);\nvoid FisherFaceRecognizer_Close(FisherFaceRecognizer fr);\n\nEigenFaceRecognizer EigenFaceRecognizer_Create(void);\nEigenFaceRecognizer EigenFaceRecognizer_CreateWithParams(int num_components, float threshold);\nvoid EigenFaceRecognizer_Close(EigenFaceRecognizer fr);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_FACE_H_\n"
  },
  {
    "path": "contrib/face_recognizer.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_face)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"face.h\"\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\ntype FaceRecognizer interface {\n\tEmpty() bool\n\tTrain(images []gocv.Mat, labels []int) error\n\tUpdate(newImages []gocv.Mat, newLabels []int) error\n\tPredict(sample gocv.Mat) int\n\tPredictExtendedResponse(sample gocv.Mat) PredictResponse\n\tGetThreshold() float32\n\tSetThreshold(threshold float32)\n\tSaveFile(fname string) error\n\tLoadFile(fname string) error\n\tClose() error\n}\n\ntype BasicFaceRecognizer interface {\n\tGetEigenValues() gocv.Mat\n\tGetEigenVectors() gocv.Mat\n\tGetLabels() gocv.Mat\n\tGetMean() gocv.Mat\n\tGetNumComponents() int\n\tSetNumComponents(val int)\n\tGetProjections() []gocv.Mat\n\tSaveFile(fname string) error\n\tLoadFile(fname string) error\n}\n\nfunc faceRecognizer_Empty(fr C.FaceRecognizer) bool {\n\tb := C.FaceRecognizer_Empty(fr)\n\treturn bool(b)\n}\n\nfunc faceRecognizer_Train(fr C.FaceRecognizer, images []gocv.Mat, labels []int) error {\n\tcparams := []C.int{}\n\tfor _, v := range labels {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\tlabelsVector := C.struct_IntVector{}\n\tlabelsVector.val = (*C.int)(&cparams[0])\n\tlabelsVector.length = (C.int)(len(cparams))\n\n\tcMatArray := make([]C.Mat, len(images))\n\tfor i, r := range images {\n\t\tcMatArray[i] = (C.Mat)(r.Ptr())\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(images)),\n\t}\n\n\treturn OpenCVResult(C.FaceRecognizer_Train(fr, matsVector, labelsVector))\n}\n\nfunc faceRecognizer_Update(fr C.FaceRecognizer, newImages []gocv.Mat, newLabels []int) error {\n\tcparams := []C.int{}\n\tfor _, v := range newLabels {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\tlabelsVector := C.struct_IntVector{}\n\tlabelsVector.val = (*C.int)(&cparams[0])\n\tlabelsVector.length = (C.int)(len(cparams))\n\n\tcMatArray := make([]C.Mat, len(newImages))\n\tfor i, r := range newImages {\n\t\tcMatArray[i] = (C.Mat)(r.Ptr())\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(newImages)),\n\t}\n\n\treturn OpenCVResult(C.FaceRecognizer_Update(fr, matsVector, labelsVector))\n}\n\nfunc faceRecognizer_Predict(fr C.FaceRecognizer, sample gocv.Mat) int {\n\tlabel := C.FaceRecognizer_Predict(fr, (C.Mat)(sample.Ptr()))\n\n\treturn int(label)\n}\n\nfunc faceRecognizer_PredictExtendedResponse(fr C.FaceRecognizer, sample gocv.Mat) PredictResponse {\n\trespp := C.FaceRecognizer_PredictExtended(fr, (C.Mat)(sample.Ptr()))\n\tresp := PredictResponse{\n\t\tLabel:      int32(respp.label),\n\t\tConfidence: float32(respp.confidence),\n\t}\n\n\treturn resp\n}\n\nfunc faceRecognizer_GetThreshold(fr C.FaceRecognizer) float32 {\n\tt := C.FaceRecognizer_GetThreshold(fr)\n\treturn float32(t)\n}\n\nfunc faceRecognizer_SetThreshold(fr C.FaceRecognizer, threshold float32) {\n\tC.FaceRecognizer_SetThreshold(fr, (C.double)(threshold))\n}\n\nfunc faceRecognizer_SaveFile(fr C.FaceRecognizer, fname string) error {\n\tcName := C.CString(fname)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn OpenCVResult(C.FaceRecognizer_SaveFile(fr, cName))\n}\n\nfunc faceRecognizer_LoadFile(fr C.FaceRecognizer, fname string) error {\n\tcName := C.CString(fname)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn OpenCVResult(C.FaceRecognizer_LoadFile(fr, cName))\n}\n\nfunc basicFaceRecognizer_Train(fr C.BasicFaceRecognizer, images []gocv.Mat, labels []int) error {\n\tcparams := []C.int{}\n\tfor _, v := range labels {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\tlabelsVector := C.struct_IntVector{}\n\tlabelsVector.val = (*C.int)(&cparams[0])\n\tlabelsVector.length = (C.int)(len(cparams))\n\n\tcMatArray := make([]C.Mat, len(images))\n\tfor i, r := range images {\n\t\tcMatArray[i] = (C.Mat)(r.Ptr())\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(images)),\n\t}\n\n\treturn OpenCVResult(C.BasicFaceRecognizer_Train(fr, matsVector, labelsVector))\n}\n\nfunc basicFaceRecognizer_Update(fr C.BasicFaceRecognizer, newImages []gocv.Mat, newLabels []int) error {\n\tcparams := []C.int{}\n\tfor _, v := range newLabels {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\tlabelsVector := C.struct_IntVector{}\n\tlabelsVector.val = (*C.int)(&cparams[0])\n\tlabelsVector.length = (C.int)(len(cparams))\n\n\tcMatArray := make([]C.Mat, len(newImages))\n\tfor i, r := range newImages {\n\t\tcMatArray[i] = (C.Mat)(r.Ptr())\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(newImages)),\n\t}\n\n\treturn OpenCVResult(C.BasicFaceRecognizer_Update(fr, matsVector, labelsVector))\n}\n\nfunc basicFaceRecognizer_GetEigenValues(fr C.BasicFaceRecognizer) gocv.Mat {\n\tc_mat := C.BasicFaceRecognizer_getEigenValues(fr)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(c_mat))\n}\n\nfunc basicFaceRecognizer_GetEigenVectors(fr C.BasicFaceRecognizer) gocv.Mat {\n\tc_mat := C.BasicFaceRecognizer_getEigenVectors(fr)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(c_mat))\n}\n\nfunc basicFaceRecognizer_GetLabels(fr C.BasicFaceRecognizer) gocv.Mat {\n\tc_mat := C.BasicFaceRecognizer_getLabels(fr)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(c_mat))\n}\n\nfunc basicFaceRecognizer_GetMean(fr C.BasicFaceRecognizer) gocv.Mat {\n\tc_mat := C.BasicFaceRecognizer_getMean(fr)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(c_mat))\n}\n\nfunc basicFaceRecognizer_GetNumComponents(fr C.BasicFaceRecognizer) int {\n\ti := C.BasicFaceRecognizer_getNumComponents(fr)\n\treturn int(i)\n}\n\nfunc basicFaceRecognizer_SetNumComponents(fr C.BasicFaceRecognizer, val int) {\n\tC.BasicFaceRecognizer_setNumComponents(fr, C.int(val))\n}\n\nfunc basicFaceRecognizer_GetProjections(fr C.BasicFaceRecognizer) []gocv.Mat {\n\n\tc_mats := C.BasicFaceRecognizer_getProjections(fr)\n\tdefer C.Mats_Close(c_mats)\n\n\tmats := make([]gocv.Mat, 0, c_mats.length)\n\n\tfor i := 0; i < int(c_mats.length); i++ {\n\t\tc_mat := C.Mats_get(c_mats, C.int(i))\n\t\tmat := gocv.NewMatFromCMat(unsafe.Pointer(c_mat))\n\t\tmats = append(mats, mat)\n\t}\n\n\treturn mats\n}\n\nfunc basicFaceRecognizer_SaveFile(fr C.BasicFaceRecognizer, fname string) error {\n\tcName := C.CString(fname)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn OpenCVResult(C.BasicFaceRecognizer_SaveFile(fr, cName))\n}\n\nfunc basicFaceRecognizer_LoadFile(fr C.BasicFaceRecognizer, fname string) error {\n\tcName := C.CString(fname)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn OpenCVResult(C.BasicFaceRecognizer_LoadFile(fr, cName))\n}\n"
  },
  {
    "path": "contrib/face_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_face)\n\npackage contrib\n\nimport (\n\t\"image\"\n\t\"math\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestLBPHFaceRecognizer_Methods(t *testing.T) {\n\tmodel := NewLBPHFaceRecognizer()\n\tif model == nil {\n\t\tt.Errorf(\"Invalid NewLBPHFaceRecognizer call %v\", model)\n\t}\n\n\tmodel.Empty()\n\n\tlabels := []int{1, 1, 1, 1, 2, 2, 2, 2}\n\timages := []gocv.Mat{\n\t\tgocv.IMRead(\"./att_faces/s1/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/4.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/4.pgm\", gocv.IMReadGrayScale),\n\t}\n\tmodel.Train(images, labels)\n\n\tsample := gocv.IMRead(\"./att_faces/s2/5.pgm\", gocv.IMReadGrayScale)\n\tlabel := model.Predict(sample)\n\tif label != 2 {\n\t\tt.Errorf(\"Invalid simple predict! label: %d\", label)\n\t}\n\tresp := model.PredictExtendedResponse(sample)\n\tif resp.Label != 2 {\n\t\tt.Errorf(\"Invalid extended result predict! label: %d\", resp.Label)\n\t}\n\n\t// set wrong threshold\n\tmodel.SetThreshold(0.0)\n\tlabel = model.Predict(sample)\n\tif label != -1 {\n\t\tt.Errorf(\"Invalid set wrong threshold! label: %d\", label)\n\t}\n\n\t//// set good threshold\n\tmodel.SetThreshold(math.MaxFloat32)\n\t// set wrong radius\n\tmodel.SetRadius(0)\n\tlabel = model.Predict(sample)\n\tif label == 2 {\n\t\tt.Errorf(\"Invalid set wrong radius! label: %d\", label)\n\t}\n\n\tneighbors := model.GetNeighbors()\n\tif neighbors == 0 {\n\t\tt.Errorf(\"Invalid get neighbors! n: %d\", neighbors)\n\t}\n\n\tmodel.SetRadius(1)\n\tmodel.SetNeighbors(8)\n\tlabel = model.Predict(sample)\n\tif label != 2 {\n\t\tt.Errorf(\"Invalid set neighbors! label: %d\", label)\n\t}\n\n\t// add new data\n\tsample = gocv.IMRead(\"./att_faces/s3/10.pgm\", gocv.IMReadGrayScale)\n\tnewLabels := []int{3, 3, 3, 3, 3, 3}\n\tnewImages := []gocv.Mat{\n\t\tgocv.IMRead(\"./att_faces/s3/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/4.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/5.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/6.pgm\", gocv.IMReadGrayScale),\n\t}\n\tmodel.Update(newImages, newLabels)\n\tlabel = model.Predict(sample)\n\tif label != 3 {\n\t\tt.Errorf(\"Invalid new data update: %d\", label)\n\t}\n\n\t// test save and load\n\tfName := \"data.yaml\"\n\tmodel.SaveFile(fName)\n\tmodelNew := NewLBPHFaceRecognizer()\n\tmodelNew.LoadFile(fName)\n\tlabel = modelNew.Predict(sample)\n\tif label != 3 {\n\t\tt.Errorf(\"Invalid loaded data: %d\", label)\n\t}\n}\n\nfunc TestLBPHFaceRecognizer_SetGridY_GetGridY(t *testing.T) {\n\tfacer := NewLBPHFaceRecognizer()\n\tfacer.SetGridY(5)\n\n\tif v := facer.GetGridY(); v != 5 {\n\t\tt.Errorf(\"got %d want 5\", v)\n\t}\n}\n\nfunc TestLBPHFaceRecognizer_SetGrid_GetGrid(t *testing.T) {\n\tfacer := NewLBPHFaceRecognizer()\n\tdefer facer.Close()\n\tfacer.SetGrid(image.Point{7, 5})\n\n\tif p := facer.GetGrid(); p.X != 7 || p.Y != 5 {\n\t\tt.Errorf(\"got %+v want {7, 5}\", p)\n\t}\n}\n\nfunc TestEigenFaceRecognizer_Methods(t *testing.T) {\n\tmodel := NewEigenFaceRecognizer()\n\tif model == nil {\n\t\tt.Errorf(\"Invalid NewEigenFaceRecognizer call %v\", model)\n\t}\n\n\tmodel.Empty()\n\n\tm := model.GetEigenValues()\n\tdefer m.Close()\n\tm2 := model.GetEigenVectors()\n\tdefer m2.Close()\n\tm3 := model.GetMean()\n\tdefer m3.Close()\n\n\tnc := model.GetNumComponents()\n\tt.Logf(\"numComponents %d\\n\", nc)\n\n\tlabels := []int{1, 1, 1, 1, 2, 2, 2, 2}\n\timages := []gocv.Mat{\n\t\tgocv.IMRead(\"./att_faces/s1/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/4.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/4.pgm\", gocv.IMReadGrayScale),\n\t}\n\tmodel.Train(images, labels)\n\n\tsample := gocv.IMRead(\"./att_faces/s2/5.pgm\", gocv.IMReadGrayScale)\n\tlabel := model.Predict(sample)\n\tif label != 2 {\n\t\tt.Errorf(\"Invalid simple predict! label: %d\", label)\n\t}\n\tresp := model.PredictExtendedResponse(sample)\n\tif resp.Label != 2 {\n\t\tt.Errorf(\"Invalid extended result predict! label: %d\", resp.Label)\n\t}\n\n\t// set wrong threshold\n\tmodel.SetThreshold(0.0)\n\tlabel = model.Predict(sample)\n\tif label != -1 {\n\t\tt.Errorf(\"Invalid set wrong threshold! label: %d\", label)\n\t}\n\n\t// test save and load\n\tfName := \"data.yaml\"\n\tmodel.SaveFile(fName)\n\tmodelNew := NewEigenFaceRecognizer()\n\tmodelNew.LoadFile(fName)\n\tlabel = modelNew.Predict(sample)\n\tif label != 2 {\n\t\tt.Errorf(\"Invalid loaded data: %d\", label)\n\t}\n}\n\nfunc TestFisherFaceRecognizer_Methods(t *testing.T) {\n\tmodel := NewFisherFaceRecognizer()\n\tif model == nil {\n\t\tt.Errorf(\"Invalid NewFisherFaceRecognizer call %v\", model)\n\t}\n\n\tmodel.Empty()\n\n\tm := model.GetEigenValues()\n\tdefer m.Close()\n\tm2 := model.GetEigenVectors()\n\tdefer m2.Close()\n\tm3 := model.GetMean()\n\tdefer m3.Close()\n\n\tnc := model.GetNumComponents()\n\tt.Logf(\"numComponents %d\\n\", nc)\n\tlabels := []int{1, 1, 1, 1, 2, 2, 2, 2}\n\timages := []gocv.Mat{\n\t\tgocv.IMRead(\"./att_faces/s1/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s1/4.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s2/4.pgm\", gocv.IMReadGrayScale),\n\t}\n\tmodel.Train(images, labels)\n\n\tsample := gocv.IMRead(\"./att_faces/s2/5.pgm\", gocv.IMReadGrayScale)\n\tlabel := model.Predict(sample)\n\tif label != 2 {\n\t\tt.Errorf(\"Invalid simple predict! label: %d\", label)\n\t}\n\tresp := model.PredictExtendedResponse(sample)\n\tif resp.Label != 2 {\n\t\tt.Errorf(\"Invalid extended result predict! label: %d\", resp.Label)\n\t}\n\n\t// add new data\n\tsample = gocv.IMRead(\"./att_faces/s3/10.pgm\", gocv.IMReadGrayScale)\n\tnewLabels := []int{1, 3, 3, 3, 3, 3, 3}\n\tnewImages := []gocv.Mat{\n\t\tgocv.IMRead(\"./att_faces/s1/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/1.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/2.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/3.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/4.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/5.pgm\", gocv.IMReadGrayScale),\n\t\tgocv.IMRead(\"./att_faces/s3/6.pgm\", gocv.IMReadGrayScale),\n\t}\n\tmodel.Update(newImages, newLabels)\n\tlabel = model.Predict(sample)\n\tif label != 3 {\n\t\tt.Errorf(\"Invalid new data update: %d\", label)\n\t}\n\n\t// test save and load\n\tfName := \"data.yaml\"\n\tmodel.SaveFile(fName)\n\tmodelNew := NewFisherFaceRecognizer()\n\tmodelNew.LoadFile(fName)\n\tlabel = modelNew.Predict(sample)\n\tif label != 3 {\n\t\tt.Errorf(\"Invalid loaded data: %d\", label)\n\t}\n}\n"
  },
  {
    "path": "contrib/freetype.cpp",
    "content": "//go:build linux && (!gocv_specific_modules || (gocv_specific_modules && gocv_contrib_freetype))\n\n#ifndef _WIN32  // Exclude compiling on Windows platforms\n\n#include \"freetype.h\"\n\nFreeType2 FreeType2_CreateFreeType2() {\n    try {\n        return new cv::Ptr<cv::freetype::FreeType2>(cv::freetype::createFreeType2());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FreeType2_Close(FreeType2 f) {\n    delete f;\n}\n\nOpenCVResult FreeType2_LoadFontData(FreeType2 f, const char *fontFileName, int id) {\n    try {\n        (*f)->loadFontData(fontFileName, id);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nvoid FreeType2_SetSplitNumber(FreeType2 f, int num) {\n    try {\n        (*f)->setSplitNumber(num);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult FreeType2_PutText(FreeType2 f, Mat img, const char *text, Point org,\n                       int fontHeight, Scalar color,\n                       int thickness, int line_type, bool bottomLeftOrigin) {\n    try {\n        cv::Point pt(org.x, org.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        (*f)->putText(*img, text, pt, fontHeight, c, thickness, line_type, bottomLeftOrigin);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }                    \n}\n\nSize FreeType2_GetTextSize(FreeType2 f, const char *text, int fontHeight, int thickness, int *baseLine) {\n    try {\n        cv::Size sz = (*f)->getTextSize(text, fontHeight, thickness, baseLine);\n        return Size{sz.width, sz.height};\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Size sz = {0, 0};\n        return sz;\n    }                        \n}\n\n#endif // _WIN32"
  },
  {
    "path": "contrib/freetype.go",
    "content": "//go:build linux && (!gocv_specific_modules || (gocv_specific_modules && gocv_contrib_freetype))\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"freetype.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\ntype FreeType2 struct {\n\t// C.FreeType2\n\tp unsafe.Pointer\n}\n\n// NewFreeType2 create instance to draw UTF-8 strings.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/dfc/group__freetype.html#ga0fd8f9c0ae69bb4d95c41af79473a756\nfunc NewFreeType2() FreeType2 {\n\treturn FreeType2{p: unsafe.Pointer(C.FreeType2_CreateFreeType2())}\n}\n\n// Close FreeType2.\nfunc (f *FreeType2) Close() error {\n\tC.FreeType2_Close((C.FreeType2)(f.p))\n\tf.p = nil\n\treturn nil\n}\n\n// LoadFontData loads font data.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/dfa/classcv_1_1freetype_1_1FreeType2.html#af059d49b806b916ffdd6380b9eb2f59a\nfunc (f *FreeType2) LoadFontData(fontFileName string, id int) error {\n\tcFontFileName := C.CString(fontFileName)\n\tdefer C.free(unsafe.Pointer(cFontFileName))\n\treturn OpenCVResult(C.FreeType2_LoadFontData((C.FreeType2)(f.p), cFontFileName, C.int(id)))\n}\n\n// SetSplitNumber set the number of split points from bezier-curve to line.\n// If you want to draw large glyph, large is better.\n// If you want to draw small glyph, small is better.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/dfa/classcv_1_1freetype_1_1FreeType2.html#a572143e6c68eab181387d9f4b3366f8b\nfunc (f *FreeType2) SetSplitNumber(num int) {\n\tC.FreeType2_SetSplitNumber((C.FreeType2)(f.p), C.int(num))\n}\n\n// PutText draws a text string.\n// It renders the specified text string in the image.\n// Symbols that cannot be rendered using the specified font are replaced by \"Tofu\" or non-drawn.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/dfa/classcv_1_1freetype_1_1FreeType2.html#aba641f774c47a70eaeb76bf7aa865915\nfunc (f *FreeType2) PutText(img *gocv.Mat, text string, org image.Point,\n\tfontHeight int, c color.RGBA, thickness int, lineType gocv.LineType, bottomLeftOrigin bool) error {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\n\tsOrg := C.struct_Point{\n\t\tx: C.int(org.X),\n\t\ty: C.int(org.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.FreeType2_PutText((C.FreeType2)(f.p), (C.Mat)(img.Ptr()), cText, sOrg, C.int(fontHeight), sColor, C.int(thickness), C.int(lineType), C.bool(bottomLeftOrigin)))\n}\n\n// GetTextSize calculates the width and height of a text string.\n// The function getTextSize calculates and returns the approximate size of a box that contains the specified text.\n// That is, the following code renders some text, the tight box surrounding it, and the baseline.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/dfa/classcv_1_1freetype_1_1FreeType2.html#af135a132505125bdea74b378dda3bb5d\nfunc (f *FreeType2) GetTextSize(text string, fontHeight int, thickness int) (image.Point, int) {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\tcBaseLine := C.int(0)\n\n\tsz := C.FreeType2_GetTextSize((C.FreeType2)(f.p), cText, C.int(fontHeight), C.int(thickness), &cBaseLine)\n\treturn image.Point{\n\t\tX: int(sz.width),\n\t\tY: int(sz.height),\n\t}, int(cBaseLine)\n}\n"
  },
  {
    "path": "contrib/freetype.h",
    "content": "#ifndef _OPENCV3_FREETYPE2_H_\n#define _OPENCV3_FREETYPE2_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/freetype.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::freetype::FreeType2>* FreeType2;\n#else\ntypedef void* FreeType2;\n#endif\n\nFreeType2 FreeType2_CreateFreeType2();\nvoid FreeType2_Close(FreeType2 f);\nOpenCVResult FreeType2_LoadFontData(FreeType2 f, const char* fontFileName, int id);\nvoid FreeType2_SetSplitNumber(FreeType2 f, int num);\nOpenCVResult FreeType2_PutText(FreeType2 f, Mat img, const char* text, Point org,\n        int fontHeight, Scalar color,\n        int thickness, int line_type, bool bottomLeftOrigin\n    );\nSize FreeType2_GetTextSize(FreeType2 f, const char* text,\n                                int fontHeight, int thickness, int* baseLine);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_FREETYPE2_H_\n"
  },
  {
    "path": "contrib/freetype_test.go",
    "content": "//go:build linux && (!gocv_specific_modules || (gocv_specific_modules && gocv_contrib_freetype))\n\npackage contrib\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestFreeTypeLoadFontData(t *testing.T) {\n\tft := NewFreeType2()\n\tdefer ft.Close()\n\n\tft.LoadFontData(\"../data/JetBrainsMono-Regular.ttf\", 0)\n}\n\nfunc TestFreeTypeGetTextSize(t *testing.T) {\n\tft := NewFreeType2()\n\tdefer ft.Close()\n\n\tft.LoadFontData(\"../data/JetBrainsMono-Regular.ttf\", 0)\n\n\tsize, baseLine := ft.GetTextSize(\"test\", 60, 2)\n\n\tif size.X != 140 {\n\t\tt.Error(\"Invalid text size width\")\n\t}\n\n\tif size.Y != 46 {\n\t\tt.Error(\"Invalid text size height\")\n\t}\n\n\tif baseLine != 1 {\n\t\tt.Errorf(\"invalid base. expected %d, actual %d\", 1, baseLine)\n\t}\n}\n\nfunc TestFreeTypePutText(t *testing.T) {\n\tft := NewFreeType2()\n\tdefer ft.Close()\n\n\tft.LoadFontData(\"../data/JetBrainsMono-Regular.ttf\", 0)\n\n\timg := gocv.NewMatWithSize(150, 500, gocv.MatTypeCV8UC3)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat\")\n\t}\n\tdefer img.Close()\n\n\tpt := image.Pt(80, 80)\n\tft.PutText(&img, \"Testing\", pt, 60, color.RGBA{R: 255, G: 255, B: 255},\n\t\t-1, gocv.LineAA, true)\n\n\tif img.Empty() {\n\t\tt.Error(\"Error in PutText test\")\n\t}\n}\n\nfunc TestFreeTypeSetSplitNumber(t *testing.T) {\n\tft := NewFreeType2()\n\tdefer ft.Close()\n\n\tft.LoadFontData(\"../data/JetBrainsMono-Regular.ttf\", 0)\n\tft.SetSplitNumber(10)\n}\n"
  },
  {
    "path": "contrib/img_hash.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_img_hash)\n\n#include \"img_hash.h\"\n\nvoid pHashCompute(Mat inputArr, Mat outputArr) {\n    try {\n        cv::img_hash::pHash(*inputArr, *outputArr);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\ndouble pHashCompare(Mat a, Mat b) {\n    try {\n        return cv::img_hash::PHash::create()->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid averageHashCompute(Mat inputArr, Mat outputArr) {\n    try {\n        cv::img_hash::averageHash(*inputArr, *outputArr);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\ndouble averageHashCompare(Mat a, Mat b) {\n    try {\n        return cv::img_hash::AverageHash::create()->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid blockMeanHashCompute(Mat inputArr, Mat outputArr, int mode) {\n    try {\n        cv::img_hash::blockMeanHash(*inputArr, *outputArr, mode);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\ndouble blockMeanHashCompare(Mat a, Mat b, int mode) {\n    try {\n        return cv::img_hash::BlockMeanHash::create(mode)->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid colorMomentHashCompute(Mat inputArr, Mat outputArr) {\n    try {\n        cv::img_hash::colorMomentHash(*inputArr, *outputArr);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }    \n}\n\ndouble colorMomentHashCompare(Mat a, Mat b) {\n    try {\n        return cv::img_hash::ColorMomentHash::create()->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid marrHildrethHashCompute(Mat inputArr, Mat outputArr, float alpha, float scale) {\n    try {\n        cv::img_hash::marrHildrethHash(*inputArr, *outputArr, alpha, scale);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\ndouble marrHildrethHashCompare(Mat a, Mat b, float alpha, float scale) {\n    try {\n        return cv::img_hash::MarrHildrethHash::create(alpha, scale)->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid radialVarianceHashCompute(Mat inputArr, Mat outputArr, double sigma, int numOfAngleLine) {\n    try {\n        cv::img_hash::radialVarianceHash(*inputArr, *outputArr, sigma, numOfAngleLine);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\ndouble radialVarianceHashCompare(Mat a, Mat b, double sigma, int numOfAngleLine) {\n    try {\n        return cv::img_hash::RadialVarianceHash::create(sigma, numOfAngleLine)->compare(*a, *b);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n"
  },
  {
    "path": "contrib/img_hash.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_img_hash)\n\npackage contrib\n\n//#include <stdlib.h>\n//#include \"img_hash.h\"\nimport \"C\"\n\nimport (\n\t\"gocv.io/x/gocv\"\n)\n\n// ImgHashBase defines the interface used for all of the img_hash algorithms.\ntype ImgHashBase interface {\n\tCompare(a, b gocv.Mat) float64\n\tCompute(inputArr gocv.Mat, outputArr *gocv.Mat)\n}\n\n// PHash is implementation of the PHash algorithm.\ntype PHash struct{}\n\n// Compute computes hash of the input image using PHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash PHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.pHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()))\n}\n\n// Compare compares the hash value between a and b using PHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash PHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.pHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr())))\n}\n\n// AverageHash is implementation of the AverageHash algorithm.\ntype AverageHash struct{}\n\n// Compute computes hash of the input image using AverageHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash AverageHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.averageHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()))\n}\n\n// Compare compares the hash value between a and b using AverageHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash AverageHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.averageHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr())))\n}\n\n// BlockMeanHash is implementation of the BlockMeanHash algorithm.\ntype BlockMeanHash struct {\n\tMode BlockMeanHashMode\n}\n\ntype BlockMeanHashMode int\n\nconst (\n\tBlockMeanHashMode0 BlockMeanHashMode = iota\n\tBlockMeanHashMode1\n\tBlockMeanHashModeDefault = BlockMeanHashMode0\n)\n\n// Compute computes hash of the input image using BlockMeanHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash BlockMeanHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.blockMeanHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()), C.int(hash.Mode))\n}\n\n// Compare compares the hash value between a and b using BlockMeanHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash BlockMeanHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.blockMeanHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr()), C.int(hash.Mode)))\n}\n\n// TODO: BlockMeanHash.GetMean isn't implemented, because it requires state from the last\n// call to Compute, and there's no easy way to keep it.\n\n// ColorMomentHash is implementation of the ColorMomentHash algorithm.\ntype ColorMomentHash struct{}\n\n// Compute computes hash of the input image using ColorMomentHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash ColorMomentHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.colorMomentHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()))\n}\n\n// Compare compares the hash value between a and b using ColorMomentHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash ColorMomentHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.colorMomentHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr())))\n}\n\n// MarrHildrethHash is implementation of the MarrHildrethHash algorithm.\ntype MarrHildrethHash struct {\n\tAlpha float32\n\tScale float32\n}\n\nfunc NewMarrHildrethHash() MarrHildrethHash {\n\treturn MarrHildrethHash{2.0, 1.0}\n}\n\n// Compute computes hash of the input image using MarrHildrethHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash MarrHildrethHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.marrHildrethHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()),\n\t\tC.float(hash.Alpha), C.float(hash.Scale))\n}\n\n// Compare compares the hash value between a and b using MarrHildrethHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash MarrHildrethHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.marrHildrethHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr()),\n\t\tC.float(hash.Alpha), C.float(hash.Scale)))\n}\n\n// RadialVarianceHash is implementation of the RadialVarianceHash algorithm.\ntype RadialVarianceHash struct {\n\tSigma          float64\n\tNumOfAngleLine int\n}\n\nfunc NewRadialVarianceHash() RadialVarianceHash {\n\treturn RadialVarianceHash{1, 180}\n}\n\n// Compute computes hash of the input image using RadialVarianceHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#ae2d9288db370089dfd8aab85d5e0b0f3\nfunc (hash RadialVarianceHash) Compute(input gocv.Mat, output *gocv.Mat) {\n\tC.radialVarianceHashCompute(C.Mat(input.Ptr()), C.Mat(output.Ptr()),\n\t\tC.double(hash.Sigma), C.int(hash.NumOfAngleLine))\n}\n\n// Compare compares the hash value between a and b using RadialVarianceHash.\n//\n// For further information, see:\n// https://docs.opencv.org/master/de/d29/classcv_1_1img__hash_1_1ImgHashBase.html#a444a3e9ec792cf029385809393f84ad5\nfunc (hash RadialVarianceHash) Compare(a, b gocv.Mat) float64 {\n\treturn float64(C.radialVarianceHashCompare(C.Mat(a.Ptr()), C.Mat(b.Ptr()),\n\t\tC.double(hash.Sigma), C.int(hash.NumOfAngleLine)))\n}\n\n// TODO: RadialVariance getFeatures, getHash, getPixPerLine, getProjection are not\n// implemented here, because they're stateful.\n"
  },
  {
    "path": "contrib/img_hash.h",
    "content": "#ifndef _OPENCV3_IMG_HASH_H_\n#define _OPENCV3_IMG_HASH_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/img_hash.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\nvoid pHashCompute(Mat inputArr, Mat outputArr);\ndouble pHashCompare(Mat a, Mat b);\nvoid averageHashCompute(Mat inputArr, Mat outputArr);\ndouble averageHashCompare(Mat a, Mat b);\nvoid blockMeanHashCompute(Mat inputArr, Mat outputArr, int mode);\ndouble blockMeanHashCompare(Mat a, Mat b, int mode);\nvoid colorMomentHashCompute(Mat inputArr, Mat outputArr);\ndouble colorMomentHashCompare(Mat a, Mat b);\nvoid marrHildrethHashCompute(Mat inputArr, Mat outputArr, float alpha, float scale);\ndouble marrHildrethHashCompare(Mat a, Mat b, float alpha, float scale);\nvoid radialVarianceHashCompute(Mat inputArr, Mat outputArr, double sigma, int numOfAngleLine);\ndouble radialVarianceHashCompare(Mat a, Mat b, double sigma, int numOfAngleLine);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_IMG_HASH_H_\n"
  },
  {
    "path": "contrib/img_hash_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_img_hash)\n\npackage contrib\n\nfunc (c BlockMeanHashMode) String() string {\n\tswitch c {\n\tcase BlockMeanHashMode0:\n\t\treturn \"block-mean-hash-mode0\"\n\tcase BlockMeanHashMode1:\n\t\treturn \"block-mean-hash-mode1\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "contrib/img_hash_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_img_hash)\n\npackage contrib\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nconst (\n\ttestImage  = \"../images/space_shuttle.jpg\"\n\ttestImage2 = \"../images/toy.jpg\"\n)\n\nfunc compute(path string, hash ImgHashBase) (*gocv.Mat, error) {\n\timg := gocv.IMRead(path, gocv.IMReadColor)\n\tif img.Empty() {\n\t\treturn nil, errors.New(\"Invalid input\")\n\t}\n\tdefer img.Close()\n\n\tdst := gocv.NewMat()\n\thash.Compute(img, &dst)\n\tif dst.Empty() {\n\t\tdst.Close()\n\t\treturn nil, errors.New(\"Empty output\")\n\t}\n\n\treturn &dst, nil\n}\n\nfunc testHash(t *testing.T, hash ImgHashBase) {\n\tresult, err := compute(testImage, hash)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer result.Close()\n\n\tt.Logf(\"%T: %x\", hash, result.ToBytes())\n\n\t// Load second image and make sure it doesn't compare as identical\n\tresult2, err := compute(testImage2, hash)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer result2.Close()\n\n\tsimilar := hash.Compare(*result, *result2)\n\tt.Logf(\"%T: similarity %g\", hash, similar)\n\t// The range and meaning of this value varies between algorithms, and\n\t// there doesn't seem to be a well defined set of default thresholds, so\n\t// \"anything but zero\" is the minimum smoke test.\n\tif similar == 0 {\n\t\tt.Error(\"Image similarity is zero?\")\n\t}\n}\n\nfunc TestHashes(t *testing.T) {\n\tt.Run(\"PHash\", func(t *testing.T) { testHash(t, PHash{}) })\n\tt.Run(\"AverageHash\", func(t *testing.T) { testHash(t, AverageHash{}) })\n\tt.Run(\"BlockMeanHash\", func(t *testing.T) { testHash(t, BlockMeanHash{}) })\n\tt.Run(\"ColorMomentHash\", func(t *testing.T) { testHash(t, ColorMomentHash{}) })\n\tt.Run(\"MarrHidlrethHash\", func(t *testing.T) { testHash(t, NewMarrHildrethHash()) })\n\tt.Run(\"RadialVarianceHash\", func(t *testing.T) { testHash(t, NewRadialVarianceHash()) })\n}\n\nfunc BenchmarkCompute(b *testing.B) {\n\timg := gocv.IMRead(testImage, gocv.IMReadColor)\n\tif img.Empty() {\n\t\tb.Error(\"Invalid input\")\n\t}\n\tdefer img.Close()\n\tb.ResetTimer()\n\n\tcompute := func(b *testing.B, hash ImgHashBase) {\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\tdst := gocv.NewMat()\n\t\t\thash.Compute(img, &dst)\n\t\t\tif dst.Empty() {\n\t\t\t\tb.Error(\"Empty output\")\n\t\t\t\tdst.Close()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdst.Close()\n\t\t}\n\t}\n\n\tb.Run(\"PHash\", func(b *testing.B) { compute(b, PHash{}) })\n\tb.Run(\"AverageHash\", func(b *testing.B) { compute(b, AverageHash{}) })\n\tb.Run(\"BlockMeanHash\", func(b *testing.B) { compute(b, BlockMeanHash{}) })\n\tb.Run(\"ColorMomentHash\", func(b *testing.B) { compute(b, ColorMomentHash{}) })\n\tb.Run(\"MarrHidlrethHash\", func(b *testing.B) { compute(b, NewMarrHildrethHash()) })\n\tb.Run(\"RadialVarianceHash\", func(b *testing.B) { compute(b, NewRadialVarianceHash()) })\n}\n\nfunc BenchmarkCompare(b *testing.B) {\n\tcompare := func(b *testing.B, hash ImgHashBase) {\n\t\tresult1, err := compute(testImage, hash)\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t}\n\t\tdefer result1.Close()\n\n\t\tresult2, err := compute(testImage2, hash)\n\t\tif err != nil {\n\t\t\tb.Error(err)\n\t\t}\n\t\tdefer result2.Close()\n\n\t\tb.ResetTimer()\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\thash.Compare(*result1, *result2)\n\t\t}\n\t}\n\n\tb.Run(\"PHash\", func(b *testing.B) { compare(b, PHash{}) })\n\tb.Run(\"AverageHash\", func(b *testing.B) { compare(b, AverageHash{}) })\n\tb.Run(\"BlockMeanHash\", func(b *testing.B) { compare(b, BlockMeanHash{}) })\n\tb.Run(\"ColorMomentHash\", func(b *testing.B) { compare(b, ColorMomentHash{}) })\n\tb.Run(\"MarrHidlrethHash\", func(b *testing.B) { compare(b, NewMarrHildrethHash()) })\n\tb.Run(\"RadialVarianceHash\", func(b *testing.B) { compare(b, NewRadialVarianceHash()) })\n}\n"
  },
  {
    "path": "contrib/mcc.cpp",
    "content": "// go:build !gocv_specific_modules || (gocv_specific_modules && gocv_mcc)\n\n#include \"mcc.h\"\n\nMccCCheckerDetector MccCCheckerDetector_New()\n{\n    try\n    {\n        return new cv::Ptr<cv::mcc::CCheckerDetector>(cv::mcc::CCheckerDetector::create());\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid MccCCheckerDetector_Close(MccCCheckerDetector md)\n{\n    delete md;\n}\n\nMccCCheckerVector MccCCheckerDetector_GetListColorChecker(MccCCheckerDetector md)\n{\n    try\n    {\n        std::vector<cv::Ptr<cv::mcc::CChecker>> *result = new std::vector<cv::Ptr<cv::mcc::CChecker>>((*md)->getListColorChecker());\n        return result;\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid MccCCheckerVector_Close(MccCCheckerVector mv)\n{\n    delete mv;\n}\n\nint MccCCheckerVector_Size(MccCCheckerVector mv)\n{\n    return mv->size();\n}\n\nMccCChecker MccCCheckerVector_At(MccCCheckerVector mv, int idx)\n{\n    if (!mv || idx < 0 || idx >= mv->size())\n    {\n        return NULL;\n    }\n    return mv->at(idx);\n}\n\nMccCChecker MccCCheckerDetector_GetBestColorChecker(MccCCheckerDetector md)\n{\n    try\n    {\n        return (*md)->getBestColorChecker();\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nbool MccCCheckerDetector_Process(MccCCheckerDetector md, Mat inputArr, int chartType, int nc, bool useNet)\n{\n    try\n    {\n        return (*md)->process(*inputArr, cv::mcc::TYPECHART(chartType), nc);\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool MccCCheckerDetector_ProcessWithRegionsOfInterest(MccCCheckerDetector md, Mat inputArr, int chartType, const MccRectVector regionsOfInterest, int nc, bool useNet)\n{\n    try\n    {\n        return (*md)->process(*inputArr, cv::mcc::TYPECHART(chartType), *regionsOfInterest, nc, useNet);\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool MccCCheckerDetector_SetNet(MccCCheckerDetector md, MccDnnNet net)\n{\n    try\n    {\n        return (*md)->setNet(*static_cast<cv::dnn::Net *>(net));\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nPoints2f MccCChecker_GetBox(MccCChecker mc)\n{\n    Points2f out = {nullptr, 0};\n    try\n    {\n        std::vector<cv::Point2f> box = mc->getBox();\n        out.length = static_cast<int>(box.size());\n        if (out.length > 0)\n        {\n            out.points = new Point2f[out.length];\n            for (int i = 0; i < out.length; ++i)\n            {\n                out.points[i].x = box[i].x;\n                out.points[i].y = box[i].y;\n            }\n        }\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n    }\n    return out;\n}\n\nPoint2f MccCChecker_GetCenter(MccCChecker mc)\n{\n    try\n    {\n        cv::Point2f pt = mc->getCenter();\n        Point2f out;\n        out.x = pt.x;\n        out.y = pt.y;\n        return out;\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        Point2f out = {0, 0};\n        return out;\n    }\n}\n\nvoid MccCChecker_SetTarget(MccCChecker mc, int target)\n{\n    mc->setTarget(cv::mcc::TYPECHART(target));\n}\nvoid MccCChecker_SetBox(MccCChecker mc, Point2f *pts, int length)\n{\n    std::vector<cv::Point2f> box(length);\n    for (int i = 0; i < length; ++i)\n    {\n        box[i] = cv::Point2f(pts[i].x, pts[i].y);\n    }\n    mc->setBox(box);\n}\nvoid MccCChecker_SetChartsRGB(MccCChecker mc, Mat mat)\n{\n    mc->setChartsRGB(*mat);\n}\nvoid MccCChecker_SetChartsYCbCr(MccCChecker mc, Mat mat)\n{\n    mc->setChartsYCbCr(*mat);\n}\nvoid MccCChecker_SetCost(MccCChecker mc, float cost)\n{\n    mc->setCost(cost);\n}\nvoid MccCChecker_SetCenter(MccCChecker mc, Point2f pt)\n{\n    mc->setCenter(cv::Point2f(pt.x, pt.y));\n}\n\nint MccCChecker_GetTarget(MccCChecker mc)\n{\n    return int(mc->getTarget());\n}\n\nPoints2f MccCChecker_GetColorCharts(MccCChecker mc)\n{\n    Points2f out = {nullptr, 0};\n    try\n    {\n        std::vector<cv::Point2f> charts = mc->getColorCharts();\n        out.length = static_cast<int>(charts.size());\n        if (out.length > 0)\n        {\n            out.points = new Point2f[out.length];\n            for (int i = 0; i < out.length; ++i)\n            {\n                out.points[i].x = charts[i].x;\n                out.points[i].y = charts[i].y;\n            }\n        }\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n    }\n    return out;\n}\n\nMat MccCChecker_GetChartsRGB(MccCChecker mc)\n{\n    return new cv::Mat(mc->getChartsRGB());\n}\n\nMat MccCChecker_GetChartsYCbCr(MccCChecker mc)\n{\n    return new cv::Mat(mc->getChartsYCbCr());\n}\n\nfloat MccCChecker_GetCost(MccCChecker mc)\n{\n    return mc->getCost();\n}\n\nMccCCheckerDraw MccCCheckerDraw_Create(MccCChecker mc, double b, double g, double r, double a, int thickness)\n{\n    try\n    {\n        cv::Scalar color(b, g, r, a);\n        return new cv::Ptr<cv::mcc::CCheckerDraw>(cv::mcc::CCheckerDraw::create(cv::Ptr<cv::mcc::CChecker>(mc), color, thickness));\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return nullptr;\n    }\n}\n\nvoid MccCCheckerDraw_Draw(MccCCheckerDraw md, Mat img)\n{\n    try\n    {\n        (*md)->draw(*img);\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid MccCCheckerDraw_Close(MccCCheckerDraw md)\n{\n    delete md;\n}\n\nMccRectVector MccRectVector_New()\n{\n    return new std::vector<cv::Rect>();\n}\n\nvoid MccRectVector_PushBack(MccRectVector mv, int x, int y, int width, int height)\n{\n    mv->emplace_back(x, y, width, height);\n}\n\nvoid MccRectVector_Close(MccRectVector mv)\n{\n    delete mv;\n}\n\nMccDetectorParameters MccDetectorParameters_Create()\n{\n    try\n    {\n        return new cv::mcc::DetectorParameters();\n    }\n    catch (const cv::Exception &e)\n    {\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid MccDetectorParameters_Close(MccDetectorParameters mp)\n{\n    delete mp;\n}\n\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeMin(MccDetectorParameters mp, int adaptiveThreshWinSizeMin)\n{\n    mp->adaptiveThreshWinSizeMin = adaptiveThreshWinSizeMin;\n}\n\nint MccDetectorParameters_GetAdaptiveThreshWinSizeMin(MccDetectorParameters mp)\n{\n    return mp->adaptiveThreshWinSizeMin;\n}\n\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeMax(MccDetectorParameters mp, int adaptiveThreshWinSizeMax)\n{\n    mp->adaptiveThreshWinSizeMax = adaptiveThreshWinSizeMax;\n}\n\nint MccDetectorParameters_GetAdaptiveThreshWinSizeMax(MccDetectorParameters mp)\n{\n    return mp->adaptiveThreshWinSizeMax;\n}\n\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeStep(MccDetectorParameters mp, int adaptiveThreshWinSizeStep)\n{\n    mp->adaptiveThreshWinSizeStep = adaptiveThreshWinSizeStep;\n}\n\nint MccDetectorParameters_GetAdaptiveThreshWinSizeStep(MccDetectorParameters mp)\n{\n    return mp->adaptiveThreshWinSizeStep;\n}\n\nvoid MccDetectorParameters_SetBorderWidth(MccDetectorParameters mp, int borderWidth)\n{\n    mp->borderWidth = borderWidth;\n}\n\nint MccDetectorParameters_GetBorderWidth(MccDetectorParameters mp)\n{\n    return mp->borderWidth;\n}\n\nvoid MccDetectorParameters_SetMinContourLengthAllowed(MccDetectorParameters mp, int minContourLengthAllowed)\n{\n    mp->minContourLengthAllowed = minContourLengthAllowed;\n}\n\nint MccDetectorParameters_GetMinContourLengthAllowed(MccDetectorParameters mp)\n{\n    return mp->minContourLengthAllowed;\n}\n\nvoid MccDetectorParameters_SetMinContourPointsAllowed(MccDetectorParameters mp, int minContourPointsAllowed)\n{\n    mp->minContourPointsAllowed = minContourPointsAllowed;\n}\n\nint MccDetectorParameters_GetMinContourPointsAllowed(MccDetectorParameters mp)\n{\n    return mp->minContourPointsAllowed;\n}\n\nvoid MccDetectorParameters_SetMinImageSize(MccDetectorParameters mp, int minImageSize)\n{\n    mp->minImageSize = minImageSize;\n}\n\nint MccDetectorParameters_GetMinImageSize(MccDetectorParameters mp)\n{\n    return mp->minImageSize;\n}\n\nvoid MccDetectorParameters_SetMinInterCheckerDistance(MccDetectorParameters mp, int minInterCheckerDistance)\n{\n    mp->minInterCheckerDistance = minInterCheckerDistance;\n}\n\nint MccDetectorParameters_GetMinInterCheckerDistance(MccDetectorParameters mp)\n{\n    return mp->minInterCheckerDistance;\n}\n\nvoid MccDetectorParameters_SetMinInterContourDistance(MccDetectorParameters mp, int minInterContourDistance)\n{\n    mp->minInterContourDistance = minInterContourDistance;\n}\n\nint MccDetectorParameters_GetMinInterContourDistance(MccDetectorParameters mp)\n{\n    return mp->minInterContourDistance;\n}\n\nvoid MccDetectorParameters_SetAdaptiveThreshConstant(MccDetectorParameters mp, double adaptiveThreshConstant)\n{\n    mp->adaptiveThreshConstant = adaptiveThreshConstant;\n}\n\ndouble MccDetectorParameters_GetAdaptiveThreshConstant(MccDetectorParameters mp)\n{\n    return mp->adaptiveThreshConstant;\n}\n\nvoid MccDetectorParameters_SetConfidenceThreshold(MccDetectorParameters mp, double confidenceThreshold)\n{\n    mp->confidenceThreshold = confidenceThreshold;\n}\n\ndouble MccDetectorParameters_GetConfidenceThreshold(MccDetectorParameters mp)\n{\n    return mp->confidenceThreshold;\n}\n\nvoid MccDetectorParameters_SetFindCandidatesApproxPolyDPEpsMultiplier(MccDetectorParameters mp, double findCandidatesApproxPolyDPEpsMultiplier)\n{\n    mp->findCandidatesApproxPolyDPEpsMultiplier = findCandidatesApproxPolyDPEpsMultiplier;\n}\n\ndouble MccDetectorParameters_GetFindCandidatesApproxPolyDPEpsMultiplier(MccDetectorParameters mp)\n{\n    return mp->findCandidatesApproxPolyDPEpsMultiplier;\n}\n\nvoid MccDetectorParameters_SetMinContourSolidity(MccDetectorParameters mp, double minContourSolidity)\n{\n    mp->minContourSolidity = minContourSolidity;\n}\n\ndouble MccDetectorParameters_GetMinContourSolidity(MccDetectorParameters mp)\n{\n    return mp->minContourSolidity;\n}\n\nvoid MccDetectorParameters_SetMinContoursArea(MccDetectorParameters mp, double minContoursArea)\n{\n    mp->minContoursArea = minContoursArea;\n}\n\ndouble MccDetectorParameters_GetMinContoursArea(MccDetectorParameters mp)\n{\n    return mp->minContoursArea;\n}\n\nvoid MccDetectorParameters_SetMinContoursAreaRate(MccDetectorParameters mp, double minContoursAreaRate)\n{\n    mp->minContoursAreaRate = minContoursAreaRate;\n}\n\ndouble MccDetectorParameters_GetMinContoursAreaRate(MccDetectorParameters mp)\n{\n    return mp->minContoursAreaRate;\n}\n\nvoid MccDetectorParameters_SetB0factor(MccDetectorParameters mp, float B0factor)\n{\n    mp->B0factor = B0factor;\n}\n\nfloat MccDetectorParameters_GetB0factor(MccDetectorParameters mp)\n{\n    return mp->B0factor;\n}\n\nvoid MccDetectorParameters_SetMaxError(MccDetectorParameters mp, float maxError)\n{\n    mp->maxError = maxError;\n}\n\nfloat MccDetectorParameters_GetMaxError(MccDetectorParameters mp)\n{\n    return mp->maxError;\n}\n\nvoid MccDetectorParameters_SetMinGroupSize(MccDetectorParameters mp, unsigned minGroupSize)\n{\n    mp->minGroupSize = minGroupSize;\n}\n\nunsigned MccDetectorParameters_GetMinGroupSize(MccDetectorParameters mp)\n{\n    return mp->minGroupSize;\n}\n"
  },
  {
    "path": "contrib/mcc.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_mcc)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"mcc.h\"\n#include \"../core.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\ntype TYPECHART int\n\nconst (\n\tMCC24 TYPECHART = iota\n\tSG140\n\tVINYL18\n)\n\ntype MccCCheckerDetector struct {\n\tp C.MccCCheckerDetector\n}\n\ntype MccDnnNet struct {\n\tp C.MccDnnNet\n}\n\n// NewMccCCheckerDetector returns a new MccCCheckerDetector.\nfunc NewMccCCheckerDetector() MccCCheckerDetector {\n\treturn MccCCheckerDetector{p: C.MccCCheckerDetector_New()}\n}\n\n// Close deletes the MccCCheckerDetector's pointer.\nfunc (md *MccCCheckerDetector) Close() error {\n\tC.MccCCheckerDetector_Close(md.p)\n\tmd.p = nil\n\treturn nil\n}\n\n// Get the best color checker. By the best it means the one detected with the highest confidence.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#a4bb27724447e01b613f5bc8fb9bb3bfc\nfunc (md *MccCCheckerDetector) GetBestColorChecker() MccCChecker {\n\tres := C.MccCCheckerDetector_GetBestColorChecker(md.p)\n\treturn MccCChecker{p: res}\n}\n\n// Get the list of all detected colorcheckers.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#a67bd0b2271e93b550c0d4d058d438cb6\nfunc (md *MccCCheckerDetector) GetListColorChecker() []MccCChecker {\n\tlist := C.MccCCheckerDetector_GetListColorChecker(md.p)\n\tdefer C.MccCCheckerVector_Close(list)\n\tsize := int(C.MccCCheckerVector_Size(list))\n\tres := make([]MccCChecker, size)\n\tfor i := 0; i < size; i++ {\n\t\tres[i] = MccCChecker{p: C.MccCCheckerVector_At(list, C.int(i))}\n\t}\n\treturn res\n}\n\n// Process does basic macbeth chart detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#aa07092a6bc9f0a2b75738bc76f9b2d8b\nfunc (md *MccCCheckerDetector) Process(input gocv.Mat, chartType TYPECHART) bool {\n\tres := C.MccCCheckerDetector_Process(md.p, C.Mat(input.Ptr()), C.int(chartType), C.int(1), C.bool(false))\n\treturn bool(res)\n}\n\n// Process does basic macbeth chart detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#aa07092a6bc9f0a2b75738bc76f9b2d8b\nfunc (md *MccCCheckerDetector) ProcessWithRegionsOfInterest(input gocv.Mat, chartType TYPECHART, regionsOfInterest []image.Rectangle) bool {\n\tvec := NewMccRectVector(regionsOfInterest)\n\tdefer vec.Close()\n\tres := C.MccCCheckerDetector_ProcessWithRegionsOfInterest(md.p, C.Mat(input.Ptr()), C.int(chartType), vec.p, C.int(1), C.bool(false))\n\treturn bool(res)\n}\n\n// Process does basic macbeth chart detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#aa07092a6bc9f0a2b75738bc76f9b2d8b\nfunc (md *MccCCheckerDetector) ProcessWithParams(input gocv.Mat, chartType TYPECHART, nc int, useNet bool) bool {\n\tres := C.MccCCheckerDetector_Process(md.p, C.Mat(input.Ptr()), C.int(chartType), C.int(nc), C.bool(useNet))\n\treturn bool(res)\n}\n\n// Process does basic macbeth chart detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#aa07092a6bc9f0a2b75738bc76f9b2d8b\nfunc (md *MccCCheckerDetector) ProcessWithRegionsOfInterestWithParams(input gocv.Mat, chartType TYPECHART, regionsOfInterest []image.Rectangle, nc int, useNet bool) bool {\n\tvec := NewMccRectVector(regionsOfInterest)\n\tdefer vec.Close()\n\tres := C.MccCCheckerDetector_ProcessWithRegionsOfInterest(md.p, C.Mat(input.Ptr()), C.int(chartType), vec.p, C.int(nc), C.bool(useNet))\n\treturn bool(res)\n}\n\n// Set the net which will be used to find the approximate bounding boxes for the color charts.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d53/classcv_1_1mcc_1_1CCheckerDetector.html#a1ad73dda58c3a8c6cb822397e8ef76a1\nfunc (md *MccCCheckerDetector) SetNet(net MccDnnNet) bool {\n\tres := C.MccCCheckerDetector_SetNet(md.p, net.p)\n\treturn bool(res)\n}\n\ntype MccCChecker struct {\n\tp C.MccCChecker\n}\n\nfunc (mc *MccCChecker) SetTarget(target TYPECHART) {\n\tC.MccCChecker_SetTarget(mc.p, C.int(target))\n}\n\nfunc (mc *MccCChecker) GetTarget() TYPECHART {\n\treturn TYPECHART(C.MccCChecker_GetTarget(mc.p))\n}\n\nfunc (mc *MccCChecker) SetBox(box []gocv.Point2f) {\n\tn := len(box)\n\tif n == 0 {\n\t\treturn\n\t}\n\tcBox := make([]C.Point2f, n)\n\tfor i := range box {\n\t\tcBox[i] = C.Point2f{x: C.float(box[i].X), y: C.float(box[i].Y)}\n\t}\n\tC.MccCChecker_SetBox(mc.p, (*C.Point2f)(unsafe.Pointer(&cBox[0])), C.int(n))\n}\n\nfunc (mc *MccCChecker) GetBox() []gocv.Point2f {\n\tres := C.MccCChecker_GetBox(mc.p)\n\tdefer C.Points2f_Close(res)\n\tn := int(res.length)\n\tif n == 0 || res.points == nil {\n\t\treturn nil\n\t}\n\tpts := (*[1 << 28]C.Point2f)(unsafe.Pointer(res.points))[:n:n]\n\tout := make([]gocv.Point2f, n)\n\tfor i := 0; i < n; i++ {\n\t\tout[i] = gocv.Point2f{X: float32(pts[i].x), Y: float32(pts[i].y)}\n\t}\n\treturn out\n}\n\nfunc (mc *MccCChecker) SetChartsRGB(mat gocv.Mat) {\n\tC.MccCChecker_SetChartsRGB(mc.p, C.Mat(mat.Ptr()))\n}\n\nfunc (mc *MccCChecker) GetChartsRGB() gocv.Mat {\n\tcmat := C.MccCChecker_GetChartsRGB(mc.p)\n\tdefer C.Mat_Close(cmat)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(cmat))\n}\n\nfunc (mc *MccCChecker) SetChartsYCbCr(mat gocv.Mat) {\n\tC.MccCChecker_SetChartsYCbCr(mc.p, C.Mat(mat.Ptr()))\n}\n\nfunc (mc *MccCChecker) GetChartsYCbCr() gocv.Mat {\n\tcmat := C.MccCChecker_GetChartsYCbCr(mc.p)\n\tdefer C.Mat_Close(cmat)\n\treturn gocv.NewMatFromCMat(unsafe.Pointer(cmat))\n}\n\nfunc (mc *MccCChecker) SetCost(cost float32) {\n\tC.MccCChecker_SetCost(mc.p, C.float(cost))\n}\n\nfunc (mc *MccCChecker) GetCost() float32 {\n\treturn float32(C.MccCChecker_GetCost(mc.p))\n}\n\nfunc (mc *MccCChecker) SetCenter(center gocv.Point2f) {\n\tC.MccCChecker_SetCenter(mc.p, C.Point2f{x: C.float(center.X), y: C.float(center.Y)})\n}\n\nfunc (mc *MccCChecker) GetCenter() gocv.Point2f {\n\tres := C.MccCChecker_GetCenter(mc.p)\n\treturn gocv.Point2f{X: float32(res.x), Y: float32(res.y)}\n}\n\n// Computes and returns the coordinates of the central parts of the charts modules.\n//\n// This method computes transformation matrix from the checkers's coordinates (cv::mcc::CChecker::getBox()) and\n// find by this the coordinates of the central parts of the charts modules. It is used in cv::mcc::CCheckerDraw::draw()\n// and in ChartsRGB calculation.\nfunc (mc *MccCChecker) GetColorCharts() []gocv.Point2f {\n\tres := C.MccCChecker_GetColorCharts(mc.p)\n\tn := int(res.length)\n\tif n == 0 || res.points == nil {\n\t\treturn nil\n\t}\n\tpts := (*[1 << 28]C.Point2f)(unsafe.Pointer(res.points))[:n:n]\n\tout := make([]gocv.Point2f, n)\n\tfor i := 0; i < n; i++ {\n\t\tout[i] = gocv.Point2f{X: float32(pts[i].x), Y: float32(pts[i].y)}\n\t}\n\n\treturn out\n}\n\ntype MccDetectorParameters struct {\n\tp C.MccDetectorParameters\n}\n\n// NewMccDetectorParameters returns the default parameters for the MccDetector\nfunc NewMccDetectorParameters() MccDetectorParameters {\n\treturn MccDetectorParameters{p: C.MccDetectorParameters_Create()}\n}\n\nfunc (mp *MccDetectorParameters) SetAdaptiveThreshWinSizeMin(adaptiveThreshWinSizeMin int) {\n\tC.MccDetectorParameters_SetAdaptiveThreshWinSizeMin(mp.p, C.int(adaptiveThreshWinSizeMin))\n}\n\nfunc (mp *MccDetectorParameters) GetAdaptiveThreshWinSizeMin() int {\n\treturn int(C.MccDetectorParameters_GetAdaptiveThreshWinSizeMin(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetAdaptiveThreshWinSizeMax(adaptiveThreshWinSizeMax int) {\n\tC.MccDetectorParameters_SetAdaptiveThreshWinSizeMax(mp.p, C.int(adaptiveThreshWinSizeMax))\n}\n\nfunc (mp *MccDetectorParameters) GetAdaptiveThreshWinSizeMax() int {\n\treturn int(C.MccDetectorParameters_GetAdaptiveThreshWinSizeMax(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetAdaptiveThreshWinSizeStep(adaptiveThreshWinSizeStep int) {\n\tC.MccDetectorParameters_SetAdaptiveThreshWinSizeStep(mp.p, C.int(adaptiveThreshWinSizeStep))\n}\n\nfunc (mp *MccDetectorParameters) GetAdaptiveThreshWinSizeStep() int {\n\treturn int(C.MccDetectorParameters_GetAdaptiveThreshWinSizeStep(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetBorderWidth(borderWidth int) {\n\tC.MccDetectorParameters_SetBorderWidth(mp.p, C.int(borderWidth))\n}\n\nfunc (mp *MccDetectorParameters) GetBorderWidth() int {\n\treturn int(C.MccDetectorParameters_GetBorderWidth(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetMinContourLengthAllowed(minContourLengthAllowed int) {\n\tC.MccDetectorParameters_SetMinContourLengthAllowed(mp.p, C.int(minContourLengthAllowed))\n}\n\nfunc (mp *MccDetectorParameters) GetMinContourLengthAllowed() int {\n\treturn int(C.MccDetectorParameters_GetMinContourLengthAllowed(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetMinContourPointsAllowed(minContourPointsAllowed int) {\n\tC.MccDetectorParameters_SetMinContourPointsAllowed(mp.p, C.int(minContourPointsAllowed))\n}\nfunc (mp *MccDetectorParameters) GetMinContourPointsAllowed() int {\n\treturn int(C.MccDetectorParameters_GetMinContourPointsAllowed(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetMinImageSize(minImageSize int) {\n\tC.MccDetectorParameters_SetMinImageSize(mp.p, C.int(minImageSize))\n}\nfunc (mp *MccDetectorParameters) GetMinImageSize() int {\n\treturn int(C.MccDetectorParameters_GetMinImageSize(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinInterCheckerDistance(minInterCheckerDistance int) {\n\tC.MccDetectorParameters_SetMinInterCheckerDistance(mp.p, C.int(minInterCheckerDistance))\n}\nfunc (mp *MccDetectorParameters) GetMinInterCheckerDistance() int {\n\treturn int(C.MccDetectorParameters_GetMinInterCheckerDistance(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinInterContourDistance(minInterContourDistance int) {\n\tC.MccDetectorParameters_SetMinInterContourDistance(mp.p, C.int(minInterContourDistance))\n}\nfunc (mp *MccDetectorParameters) GetMinInterContourDistance() int {\n\treturn int(C.MccDetectorParameters_GetMinInterContourDistance(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetAdaptiveThreshConstant(adaptiveThreshConstant float64) {\n\tC.MccDetectorParameters_SetAdaptiveThreshConstant(mp.p, C.double(adaptiveThreshConstant))\n}\n\nfunc (mp *MccDetectorParameters) GetAdaptiveThreshConstant() float64 {\n\treturn float64(C.MccDetectorParameters_GetAdaptiveThreshConstant(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetConfidenceThreshold(confidenceThreshold float64) {\n\tC.MccDetectorParameters_SetConfidenceThreshold(mp.p, C.double(confidenceThreshold))\n}\nfunc (mp *MccDetectorParameters) GetConfidenceThreshold() float64 {\n\treturn float64(C.MccDetectorParameters_GetConfidenceThreshold(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetFindCandidatesApproxPolyDPEpsMultiplier(findCandidatesApproxPolyDPEpsMultiplier float64) {\n\tC.MccDetectorParameters_SetFindCandidatesApproxPolyDPEpsMultiplier(mp.p, C.double(findCandidatesApproxPolyDPEpsMultiplier))\n}\nfunc (mp *MccDetectorParameters) GetFindCandidatesApproxPolyDPEpsMultiplier() float64 {\n\treturn float64(C.MccDetectorParameters_GetFindCandidatesApproxPolyDPEpsMultiplier(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinContourSolidity(minContourSolidity float64) {\n\tC.MccDetectorParameters_SetMinContourSolidity(mp.p, C.double(minContourSolidity))\n}\nfunc (mp *MccDetectorParameters) GetMinContourSolidity() float64 {\n\treturn float64(C.MccDetectorParameters_GetMinContourSolidity(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinContoursArea(minContoursArea float64) {\n\tC.MccDetectorParameters_SetMinContoursArea(mp.p, C.double(minContoursArea))\n}\nfunc (mp *MccDetectorParameters) GetMinContoursArea() float64 {\n\treturn float64(C.MccDetectorParameters_GetMinContoursArea(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinContoursAreaRate(minContoursAreaRate float64) {\n\tC.MccDetectorParameters_SetMinContoursAreaRate(mp.p, C.double(minContoursAreaRate))\n}\nfunc (mp *MccDetectorParameters) GetMinContoursAreaRate() float64 {\n\treturn float64(C.MccDetectorParameters_GetMinContoursAreaRate(mp.p))\n}\n\nfunc (mp *MccDetectorParameters) SetB0factor(B0factor float32) {\n\tC.MccDetectorParameters_SetB0factor(mp.p, C.float(B0factor))\n}\nfunc (mp *MccDetectorParameters) GetB0factor() float32 {\n\treturn float32(C.MccDetectorParameters_GetB0factor(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMaxError(maxError float32) {\n\tC.MccDetectorParameters_SetMaxError(mp.p, C.float(maxError))\n}\nfunc (mp *MccDetectorParameters) GetMaxError() float32 {\n\treturn float32(C.MccDetectorParameters_GetMaxError(mp.p))\n}\nfunc (mp *MccDetectorParameters) SetMinGroupSize(minGroupSize uint) {\n\tC.MccDetectorParameters_SetMinGroupSize(mp.p, C.uint(minGroupSize))\n}\nfunc (mp *MccDetectorParameters) GetMinGroupSize() uint {\n\treturn uint(C.MccDetectorParameters_GetMinGroupSize(mp.p))\n}\n\ntype MccCCheckerDraw struct {\n\tp C.MccCCheckerDraw\n}\n\n// NewMccCCheckerDraw creates a new CCheckerDraw with the given color and thickness.\nfunc NewMccCCheckerDraw(cc MccCChecker, color gocv.Scalar, thickness int) MccCCheckerDraw {\n\tp := C.MccCCheckerDraw_Create(cc.p, C.double(color.Val1), C.double(color.Val2), C.double(color.Val3), C.double(color.Val4), C.int(thickness))\n\treturn MccCCheckerDraw{p: p}\n}\n\n// Draw draws the checker on the given image.\nfunc (md *MccCCheckerDraw) Draw(img gocv.Mat) {\n\tC.MccCCheckerDraw_Draw(md.p, C.Mat(img.Ptr()))\n}\n\nfunc (md *MccCCheckerDraw) Close() error {\n\tC.MccCCheckerDraw_Close(md.p)\n\tmd.p = nil\n\treturn nil\n}\n\ntype MccRectVector struct {\n\tp C.MccRectVector\n}\n\nfunc NewMccRectVector(rects []image.Rectangle) MccRectVector {\n\tvec := C.MccRectVector_New()\n\tfor _, r := range rects {\n\t\tC.MccRectVector_PushBack(vec, C.int(r.Min.X), C.int(r.Min.Y), C.int(r.Dx()), C.int(r.Dy()))\n\t}\n\treturn MccRectVector{p: vec}\n}\n\nfunc (mv *MccRectVector) Close() error {\n\tC.MccRectVector_Close(mv.p)\n\tmv.p = nil\n\treturn nil\n}\n"
  },
  {
    "path": "contrib/mcc.h",
    "content": "#ifndef _OPENCV3_MCC_H_\n#define _OPENCV3_MCC_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/mcc.hpp>\n#include <opencv2/dnn.hpp>\nextern \"C\" {\n    #endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::mcc::CChecker* MccCChecker;\ntypedef cv::Ptr<cv::mcc::CCheckerDetector>* MccCCheckerDetector;\ntypedef cv::Ptr<cv::mcc::CCheckerDraw>* MccCCheckerDraw;\ntypedef cv::mcc::DetectorParameters* MccDetectorParameters;\ntypedef cv::dnn::Net* MccDnnNet;\ntypedef std::vector<cv::Rect>* MccRectVector;\ntypedef std::vector<cv::Ptr<cv::mcc::CChecker>>* MccCCheckerVector;\n#else\ntypedef void *MccCChecker;\ntypedef void *MccCCheckerDetector;\ntypedef void *MccCCheckerDraw;\ntypedef void *MccDetectorParameters;\ntypedef void *MccDnnNet;\ntypedef void *MccRectVector;\ntypedef void *MccCCheckerVector;\n#endif\n\nMccDetectorParameters MccDetectorParameters_Create();\nvoid MccDetectorParameters_Close(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeMin(MccDetectorParameters mp, int adaptiveThreshWinSizeMin);\nint MccDetectorParameters_GetAdaptiveThreshWinSizeMin(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeMax(MccDetectorParameters mp, int adaptiveThreshWinSizeMax);\nint MccDetectorParameters_GetAdaptiveThreshWinSizeMax(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetAdaptiveThreshWinSizeStep(MccDetectorParameters mp, int adaptiveThreshWinSizeStep);\nint MccDetectorParameters_GetAdaptiveThreshWinSizeStep(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetBorderWidth(MccDetectorParameters mp, int borderWidth);\nint MccDetectorParameters_GetBorderWidth(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinContourLengthAllowed(MccDetectorParameters mp, int minContourLengthAllowed);\nint MccDetectorParameters_GetMinContourLengthAllowed(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinContourPointsAllowed(MccDetectorParameters mp, int minContourPointsAllowed);\nint MccDetectorParameters_GetMinContourPointsAllowed(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinImageSize(MccDetectorParameters mp, int minImageSize);\nint MccDetectorParameters_GetMinImageSize(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinInterCheckerDistance(MccDetectorParameters mp, int minInterCheckerDistance);\nint MccDetectorParameters_GetMinInterCheckerDistance(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinInterContourDistance(MccDetectorParameters mp, int minInterContourDistance);\nint MccDetectorParameters_GetMinInterContourDistance(MccDetectorParameters mp);\n\nvoid MccDetectorParameters_SetAdaptiveThreshConstant(MccDetectorParameters mp, double adaptiveThreshConstant);\ndouble MccDetectorParameters_GetAdaptiveThreshConstant(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetConfidenceThreshold(MccDetectorParameters mp, double confidenceThreshold);\ndouble MccDetectorParameters_GetConfidenceThreshold(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetFindCandidatesApproxPolyDPEpsMultiplier(MccDetectorParameters mp, double findCandidatesApproxPolyDPEpsMultiplier);\ndouble MccDetectorParameters_GetFindCandidatesApproxPolyDPEpsMultiplier(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinContourSolidity(MccDetectorParameters mp, double minContourSolidity);\ndouble MccDetectorParameters_GetMinContourSolidity(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinContoursArea(MccDetectorParameters mp, double minContoursArea);\ndouble MccDetectorParameters_GetMinContoursArea(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinContoursAreaRate(MccDetectorParameters mp, double minContoursAreaRate);\ndouble MccDetectorParameters_GetMinContoursAreaRate(MccDetectorParameters mp);\n\nvoid MccDetectorParameters_SetB0factor(MccDetectorParameters mp, float B0factor);\nfloat MccDetectorParameters_GetB0factor(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMaxError(MccDetectorParameters mp, float maxError);\nfloat MccDetectorParameters_GetMaxError(MccDetectorParameters mp);\nvoid MccDetectorParameters_SetMinGroupSize(MccDetectorParameters mp, unsigned minGroupSize);\nunsigned MccDetectorParameters_GetMinGroupSize(MccDetectorParameters mp);\n\nvoid MccCChecker_SetTarget(MccCChecker mc, int target);\nint MccCChecker_GetTarget(MccCChecker mc);\nvoid MccCChecker_SetBox(MccCChecker mc, Point2f* pts, int length);\nPoints2f MccCChecker_GetBox(MccCChecker mc);\nvoid MccCChecker_SetChartsRGB(MccCChecker mc, Mat mat);\nMat MccCChecker_GetChartsRGB(MccCChecker mc);\nvoid MccCChecker_SetChartsYCbCr(MccCChecker mc, Mat mat);\nMat MccCChecker_GetChartsYCbCr(MccCChecker mc);\nvoid MccCChecker_SetCost(MccCChecker mc, float cost);\nfloat MccCChecker_GetCost(MccCChecker mc);\nvoid MccCChecker_SetCenter(MccCChecker mc, Point2f pt);\nPoint2f MccCChecker_GetCenter(MccCChecker mc);\nPoints2f MccCChecker_GetColorCharts(MccCChecker mc);\n\n\nMccCCheckerDraw MccCCheckerDraw_Create(MccCChecker mc, double b, double g, double r, double a, int thickness);\nvoid MccCCheckerDraw_Draw(MccCCheckerDraw md, Mat img);\nvoid MccCCheckerDraw_Close(MccCCheckerDraw md);\n\nMccCCheckerDetector MccCCheckerDetector_New();\nvoid MccCCheckerDetector_Close(MccCCheckerDetector md);\nMccCCheckerVector MccCCheckerDetector_GetListColorChecker(MccCCheckerDetector md);\nMccCChecker MccCCheckerDetector_GetBestColorChecker(MccCCheckerDetector md);\nbool MccCCheckerDetector_Process(MccCCheckerDetector md, Mat inputArr, int chartType, int nc, bool useNet);\nbool MccCCheckerDetector_ProcessWithRegionsOfInterest(MccCCheckerDetector md, Mat inputArr, int chartType, const MccRectVector regionsOfInterest, int nc, bool useNet);\nbool MccCCheckerDetector_SetNet(MccCCheckerDetector md, MccDnnNet net);\n\nint MccCCheckerVector_Size(MccCCheckerVector mv);\nMccCChecker MccCCheckerVector_At(MccCCheckerVector mv, int idx);\nvoid MccCCheckerVector_Close(MccCCheckerVector mv);\n\nMccRectVector MccRectVector_New();\nvoid MccRectVector_PushBack(MccRectVector mv, int x, int y, int width, int height);\nvoid MccRectVector_Close(MccRectVector mv);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_MCC_H_\n"
  },
  {
    "path": "contrib/mcc_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_mcc)\n\npackage contrib\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nconst (\n\tmacbethImage = \"../images/macbeth.png\"\n)\n\nfunc TestMccDetectorParams(t *testing.T) {\n\n\tadaptiveThreshWinSizeMin := 23\n\tadaptiveThreshWinSizeMax := 153\n\tadaptiveThreshWinSizeStep := 16\n\tadaptiveThreshConstant := 7.0\n\tborderWidth := 0\n\tminContourLengthAllowed := 100\n\tminContourPointsAllowed := 4\n\tminImageSize := 1000\n\tminInterCheckerDistance := 10000\n\tminInterContourDistance := 100\n\tconfidenceThreshold := 0.1\n\tfindCandidatesApproxPolyDPEpsMultiplier := 0.05\n\tminContourSolidity := 0.9\n\tminContoursArea := 100.0\n\tminContoursAreaRate := 0.003\n\tB0factor := float32(1.25)\n\tmaxError := float32(0.1)\n\tminGroupSize := uint(4)\n\n\tparams := NewMccDetectorParameters()\n\tparams.SetAdaptiveThreshWinSizeMin(adaptiveThreshWinSizeMin)\n\tparams.SetAdaptiveThreshWinSizeMax(adaptiveThreshWinSizeMax)\n\tparams.SetAdaptiveThreshWinSizeStep(adaptiveThreshWinSizeStep)\n\tparams.SetAdaptiveThreshConstant(adaptiveThreshConstant)\n\tparams.SetBorderWidth(borderWidth)\n\tparams.SetMinContourLengthAllowed(minContourLengthAllowed)\n\tparams.SetMinContourPointsAllowed(minContourPointsAllowed)\n\tparams.SetMinImageSize(minImageSize)\n\tparams.SetMinInterCheckerDistance(minInterCheckerDistance)\n\tparams.SetMinInterContourDistance(minInterContourDistance)\n\tparams.SetAdaptiveThreshConstant(adaptiveThreshConstant)\n\tparams.SetConfidenceThreshold(confidenceThreshold)\n\tparams.SetFindCandidatesApproxPolyDPEpsMultiplier(findCandidatesApproxPolyDPEpsMultiplier)\n\tparams.SetMinContourSolidity(minContourSolidity)\n\tparams.SetMinContoursArea(minContoursArea)\n\tparams.SetMinContoursAreaRate(minContoursAreaRate)\n\tparams.SetB0factor(B0factor)\n\tparams.SetMaxError(maxError)\n\tparams.SetMinGroupSize(minGroupSize)\n\n\tif params.GetAdaptiveThreshWinSizeMin() != adaptiveThreshWinSizeMin {\n\t\tt.Errorf(\"AdaptiveThreshWinSizeMin expected %v got %v\", adaptiveThreshWinSizeMin, params.GetAdaptiveThreshWinSizeMin())\n\t}\n\tif params.GetAdaptiveThreshWinSizeMax() != adaptiveThreshWinSizeMax {\n\t\tt.Errorf(\"AdaptiveThreshWinSizeMax expected %v got %v\", adaptiveThreshWinSizeMax, params.GetAdaptiveThreshWinSizeMax())\n\t}\n\tif params.GetAdaptiveThreshWinSizeStep() != adaptiveThreshWinSizeStep {\n\t\tt.Errorf(\"AdaptiveThreshWinSizeStep expected %v got %v\", adaptiveThreshWinSizeStep, params.GetAdaptiveThreshWinSizeStep())\n\t}\n\tif params.GetAdaptiveThreshConstant() != adaptiveThreshConstant {\n\t\tt.Errorf(\"AdaptiveThreshConstant expected %v got %v\", adaptiveThreshConstant, params.GetAdaptiveThreshConstant())\n\t}\n\tif params.GetBorderWidth() != borderWidth {\n\t\tt.Errorf(\"BorderWidth expected %v got %v\", borderWidth, params.GetBorderWidth())\n\t}\n\tif params.GetMinContourLengthAllowed() != minContourLengthAllowed {\n\t\tt.Errorf(\"MinContourLengthAllowed expected %v got %v\", minContourLengthAllowed, params.GetMinContourLengthAllowed())\n\t}\n\tif params.GetMinContourPointsAllowed() != minContourPointsAllowed {\n\t\tt.Errorf(\"MinContourPointsAllowed expected %v got %v\", minContourPointsAllowed, params.GetMinContourPointsAllowed())\n\t}\n\tif params.GetMinImageSize() != minImageSize {\n\t\tt.Errorf(\"MinImageSize expected %v got %v\", minImageSize, params.GetMinImageSize())\n\t}\n\tif params.GetMinInterCheckerDistance() != minInterCheckerDistance {\n\t\tt.Errorf(\"MinInterCheckerDistance expected %v got %v\", minInterCheckerDistance, params.GetMinInterCheckerDistance())\n\t}\n\tif params.GetMinInterContourDistance() != minInterContourDistance {\n\t\tt.Errorf(\"MinInterContourDistance expected %v got %v\", minInterContourDistance, params.GetMinInterContourDistance())\n\t}\n\tif params.GetAdaptiveThreshConstant() != adaptiveThreshConstant {\n\t\tt.Errorf(\"AdaptiveThreshConstant expected %v got %v\", adaptiveThreshConstant, params.GetAdaptiveThreshConstant())\n\t}\n\tif params.GetConfidenceThreshold() != confidenceThreshold {\n\t\tt.Errorf(\"ConfidenceThreshold expected %v got %v\", confidenceThreshold, params.GetConfidenceThreshold())\n\t}\n\tif params.GetFindCandidatesApproxPolyDPEpsMultiplier() != findCandidatesApproxPolyDPEpsMultiplier {\n\t\tt.Errorf(\"FindCandidatesApproxPolyDPEpsMultiplier expected %v got %v\", findCandidatesApproxPolyDPEpsMultiplier, params.GetFindCandidatesApproxPolyDPEpsMultiplier())\n\t}\n\tif params.GetMinContourSolidity() != minContourSolidity {\n\t\tt.Errorf(\"MinContourSolidity expected %v got %v\", minContourSolidity, params.GetMinContourSolidity())\n\t}\n\tif params.GetMinContoursArea() != minContoursArea {\n\t\tt.Errorf(\"MinContoursArea expected %v got %v\", minContoursArea, params.GetMinContoursArea())\n\t}\n\tif params.GetMinContoursAreaRate() != minContoursAreaRate {\n\t\tt.Errorf(\"MinContoursAreaRate expected %v got %v\", minContoursAreaRate, params.GetMinContoursAreaRate())\n\t}\n\tif params.GetB0factor() != B0factor {\n\t\tt.Errorf(\"B0factor expected %v got %v\", B0factor, params.GetB0factor())\n\t}\n\tif params.GetMaxError() != maxError {\n\t\tt.Errorf(\"MaxError expected %v got %v\", maxError, params.GetMaxError())\n\t}\n\tif params.GetMinGroupSize() != minGroupSize {\n\t\tt.Errorf(\"MinGroupSize expected %v got %v\", minGroupSize, params.GetMinGroupSize())\n\t}\n}\n\nfunc TestProcess(t *testing.T) {\n\tpath := macbethImage\n\timgCopy := gocv.NewMat()\n\timg := gocv.IMRead(path, gocv.IMReadColor)\n\timg.CopyTo(&imgCopy)\n\tdefer imgCopy.Close()\n\n\tif img.Empty() {\n\t\tt.Fatal(\"Invalid input: image is empty or could not be loaded. Check that ./images/macbeth.jpg exists and is a valid image.\")\n\t}\n\tdefer img.Close()\n\n\tdetector := NewMccCCheckerDetector()\n\tdefer detector.Close()\n\n\tres := detector.Process(img, MCC24)\n\tif !res {\n\t\tt.Error(\"Atleast one chart is expected to be detected got 0\")\n\t}\n\n\tcheckers := detector.GetListColorChecker()\n\n\tvar EPS = 0.001\n\n\tfor _, checker := range checkers {\n\t\twhitePatch := checker.GetColorCharts()[18*4 : 18*4+4]\n\t\texpected := make([]gocv.Point2f, 4)\n\t\texpected[0] = gocv.Point2f{X: 438.60522, Y: 465.06586}\n\t\texpected[1] = gocv.Point2f{X: 480.70596, Y: 461.58606}\n\t\texpected[2] = gocv.Point2f{X: 484.52277, Y: 502.17834}\n\t\texpected[3] = gocv.Point2f{X: 442.45264, Y: 505.96082}\n\n\t\tfor idx, _ := range expected {\n\n\t\t\tif distPoint2f(whitePatch[idx], expected[idx]) > EPS {\n\t\t\t\tt.Errorf(\"White patch expected at %v got %v\", expected[idx], whitePatch[idx])\n\t\t\t}\n\t\t}\n\n\t\t// Outputting for visual inspection\n\t\tcdraw := NewMccCCheckerDraw(checker, gocv.NewScalar(0, 250, 0, 255), 2)\n\t\tcdraw.Draw(img)\n\t}\n\tgocv.IMWrite(\"../images/macbeth-correct.png\", img)\n}\n\nfunc distPoint2f(a, b gocv.Point2f) float64 {\n\treturn math.Sqrt(math.Pow(float64(a.X-b.X), 2) + math.Pow(float64(a.Y-b.Y), 2))\n}\n"
  },
  {
    "path": "contrib/tracking.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_tracking)\n\n#include \"tracking.h\"\n#include <opencv2/opencv.hpp>\n\nbool TrackerSubclass_Init(Tracker self, Mat image, Rect boundingBox) {\n    try {\n        cv::Rect bb(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height);\n\n        (*self)->init(*image, bb);\n        return true;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool TrackerSubclass_Update(Tracker self, Mat image, Rect* boundingBox) {\n    try {\n        cv::Rect bb;\n        bool ret = (*self)->update(*image, bb);\n        boundingBox->x = int(bb.x);\n        boundingBox->y = int(bb.y);\n        boundingBox->width = int(bb.width);\n        boundingBox->height = int(bb.height);\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nTrackerKCF TrackerKCF_Create() {\n    try {\n        return new cv::Ptr<cv::TrackerKCF>(cv::TrackerKCF::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid TrackerKCF_Close(TrackerKCF self) {\n    delete self;\n}\n\nTrackerCSRT TrackerCSRT_Create() {\n    try {\n        return new cv::Ptr<cv::TrackerCSRT>(cv::TrackerCSRT::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid TrackerCSRT_Close(TrackerCSRT self) {\n    delete self;\n}\n"
  },
  {
    "path": "contrib/tracking.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_tracking)\n\npackage contrib\n\n/*\n#include \"tracking.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// TrackerKCF is a Tracker based on KCF, which is a novel tracking framework that\n// utilizes properties of circulant matrix to enhance the processing speed.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/dff/classcv_1_1TrackerKCF.html\ntype TrackerKCF struct {\n\tp C.TrackerKCF\n}\n\n// NewTrackerKCF returns a new TrackerKCF.\nfunc NewTrackerKCF() gocv.Tracker {\n\treturn TrackerKCF{p: C.TrackerKCF_Create()}\n}\n\n// Close closes this Tracker.\nfunc (trk TrackerKCF) Close() error {\n\tC.TrackerKCF_Close(trk.p)\n\ttrk.p = nil\n\treturn nil\n}\n\n// Init initializes this Tracker.\nfunc (trk TrackerKCF) Init(img gocv.Mat, boundingBox image.Rectangle) bool {\n\treturn trackerInit(C.Tracker(trk.p), img, boundingBox)\n}\n\n// Update updates this Tracker.\nfunc (trk TrackerKCF) Update(img gocv.Mat) (image.Rectangle, bool) {\n\treturn trackerUpdate(C.Tracker(trk.p), img)\n}\n\n// TrackerCSRT is an implementation of Discriminative Correlation Filter Tracker\n// with Channel and Spatial Reliability.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/da2/classcv_1_1TrackerCSRT.html\ntype TrackerCSRT struct {\n\tp C.TrackerCSRT\n}\n\n// NewTrackerCSRT returns a new TrackerCSRT.\nfunc NewTrackerCSRT() gocv.Tracker {\n\treturn TrackerCSRT{p: C.TrackerCSRT_Create()}\n}\n\n// Close closes this Tracker.\nfunc (trk TrackerCSRT) Close() error {\n\tC.TrackerCSRT_Close(trk.p)\n\ttrk.p = nil\n\treturn nil\n}\n\n// Init initializes this Tracker.\nfunc (trk TrackerCSRT) Init(img gocv.Mat, boundingBox image.Rectangle) bool {\n\treturn trackerInit(C.Tracker(trk.p), img, boundingBox)\n}\n\n// Update updates this Tracker.\nfunc (trk TrackerCSRT) Update(img gocv.Mat) (image.Rectangle, bool) {\n\treturn trackerUpdate(C.Tracker(trk.p), img)\n}\n\nfunc trackerInit(trk C.Tracker, img gocv.Mat, boundingBox image.Rectangle) bool {\n\tcBox := C.struct_Rect{\n\t\tx:      C.int(boundingBox.Min.X),\n\t\ty:      C.int(boundingBox.Min.Y),\n\t\twidth:  C.int(boundingBox.Size().X),\n\t\theight: C.int(boundingBox.Size().Y),\n\t}\n\n\tret := C.TrackerSubclass_Init(trk, C.Mat(img.Ptr()), cBox)\n\treturn bool(ret)\n}\n\nfunc trackerUpdate(trk C.Tracker, img gocv.Mat) (image.Rectangle, bool) {\n\tcBox := C.struct_Rect{}\n\n\tret := C.TrackerSubclass_Update(trk, C.Mat(img.Ptr()), &cBox)\n\n\trect := image.Rect(int(cBox.x), int(cBox.y), int(cBox.x+cBox.width), int(cBox.y+cBox.height))\n\treturn rect, bool(ret)\n}\n"
  },
  {
    "path": "contrib/tracking.h",
    "content": "\n#ifndef _OPENCV3_TRACKING_H_\n#define _OPENCV3_TRACKING_H_\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\n#include <opencv2/tracking/tracking.hpp>\n\nextern \"C\" {\n#endif\n\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::Tracker>* Tracker;\ntypedef cv::Ptr<cv::TrackerKCF>* TrackerKCF;\ntypedef cv::Ptr<cv::TrackerCSRT>* TrackerCSRT;\n#else\ntypedef void* Tracker;\ntypedef void* TrackerKCF;\ntypedef void* TrackerCSRT;\n#endif\n\nbool TrackerSubclass_Init(Tracker self, Mat image, Rect boundingBox);\nbool TrackerSubclass_Update(Tracker self, Mat image, Rect* boundingBox);\n\nTrackerKCF TrackerKCF_Create();\nvoid TrackerKCF_Close(TrackerKCF self);\n\nTrackerCSRT TrackerCSRT_Create();\nvoid TrackerCSRT_Close(TrackerCSRT self);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_TRACKING_H_\n"
  },
  {
    "path": "contrib/tracking_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_tracking)\n\npackage contrib\n\nimport (\n\t\"image\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc BaseTestTracker(t *testing.T, tracker gocv.Tracker, name string) {\n\tif tracker == nil {\n\t\tt.Error(\"TestTracker \" + name + \" should not be nil\")\n\t}\n\n\timg := gocv.IMRead(\"../images/face.jpg\", 1)\n\tif img.Empty() {\n\t\tt.Error(\"TestTracker \" + name + \" input img failed to load\")\n\t}\n\tdefer img.Close()\n\n\trect := image.Rect(250, 150, 250+200, 150+250)\n\tinit := tracker.Init(img, rect)\n\tif !init {\n\t\tt.Error(\"TestTracker \" + name + \" failed in Init\")\n\t}\n\n\t_, ok := tracker.Update(img)\n\tif !ok {\n\t\tt.Error(\"TestTracker \" + name + \" lost object in Update\")\n\t}\n}\n\nfunc TestSingleTrackers(t *testing.T) {\n\ttab := []struct {\n\t\tname    string\n\t\ttracker gocv.Tracker\n\t}{\n\t\t{\"KCF\", NewTrackerKCF()},\n\t\t{\"CSRT\", NewTrackerCSRT()},\n\t}\n\n\tfor _, test := range tab {\n\t\tfunc() {\n\t\t\tdefer test.tracker.Close()\n\t\t\tBaseTestTracker(t, test.tracker, test.name)\n\t\t}()\n\t}\n}\n"
  },
  {
    "path": "contrib/wechat_qrcode.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_wechat_qrcode)\n\n#include \"wechat_qrcode.h\"\n\nWeChatQRCode NewWeChatQRCode(const char *detector_prototxt_path,\n                             const char *detector_caffe_model_path,\n                             const char *super_resolution_prototxt_path,\n                             const char *super_resolution_caffe_model_path) {\n    try {\n        return new cv::Ptr<cv::wechat_qrcode::WeChatQRCode>(\n            cv::makePtr<cv::wechat_qrcode::WeChatQRCode>(detector_prototxt_path, detector_caffe_model_path,\n                                                         super_resolution_prototxt_path,\n                                                         super_resolution_caffe_model_path));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nStringsVector NewStringsVector() {\n    return new std::vector<std::string>;\n}\n\nvoid WeChatQRCode_CStrings_Close(struct CStrings cstrs) {\n    for ( int i = 0; i < cstrs.length; i++ ) {\n        delete [] cstrs.strs[i];\n    }\n    delete [] cstrs.strs;\n}\n\nvoid WeChatQRCode_Mats_to(struct Mats mats, int i, Mat dst) {\n    try {\n        mats.mats[i]->copyTo(*dst);;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid WeChatQRCode_Mats_Close(struct Mats mats) {\n    delete[] mats.mats;\n}\n\n\nCStrings WeChatQRCode_DetectAndDecode(WeChatQRCode wq, Mat img, struct Mats *points, StringsVector codes) {\n    try {\n        std::vector <cv::Mat> Points;\n        *codes = ((*wq)->detectAndDecode(*img, Points));\n        CStrings results;\n    \n        points->mats = new Mat[Points.size()];\n    \n        for (size_t i = 0; i < Points.size(); ++i) {\n            points->mats[i] = new cv::Mat(Points[i]);\n        }\n        points->length = (int) Points.size();\n    \n        const char **decodes = new const char *[codes->size()];\n    \n        for (size_t i = 0; i < codes->size(); ++i) {\n            decodes[i] = (*codes)[i].c_str();\n        }\n        (&results)->length = codes->size();\n        (&results)->strs = decodes;\n        return results;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        CStrings results;\n        return results;\n    }\n}"
  },
  {
    "path": "contrib/wechat_qrcode.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_wechat_qrcode)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"wechat_qrcode.h\"\n*/\nimport \"C\"\nimport (\n\t\"gocv.io/x/gocv\"\n\t\"unsafe\"\n)\n\ntype WeChatQRCode struct {\n\tp C.WeChatQRCode\n}\n\nfunc NewWeChatQRCode(detectProtoTxt, detectCaffe, superProtoTxt, superCaffe string) *WeChatQRCode {\n\tdp := C.CString(detectProtoTxt)\n\tdc := C.CString(detectCaffe)\n\tsp := C.CString(superProtoTxt)\n\tsc := C.CString(superCaffe)\n\n\tdefer C.free(unsafe.Pointer(dp))\n\tdefer C.free(unsafe.Pointer(dc))\n\tdefer C.free(unsafe.Pointer(sp))\n\tdefer C.free(unsafe.Pointer(sc))\n\treturn &WeChatQRCode{p: C.NewWeChatQRCode(dp, dc, sp, sc)}\n}\n\nfunc (wq *WeChatQRCode) DetectAndDecode(img gocv.Mat, point *[]gocv.Mat) []string {\n\tcMats := C.struct_Mats{}\n\tdefer C.WeChatQRCode_Mats_Close(cMats)\n\tcDecoded := C.CStrings{}\n\tdefer C.WeChatQRCode_CStrings_Close(cDecoded)\n\tcCodes := C.NewStringsVector()\n\tdefer C.free(unsafe.Pointer(cCodes))\n\n\tcDecoded = C.WeChatQRCode_DetectAndDecode((C.WeChatQRCode)(wq.p), (C.Mat)(img.Ptr()), &(cMats), cCodes)\n\tps := make([]gocv.Mat, cMats.length)\n\n\tfor i := C.int(0); i < cMats.length; i++ {\n\t\tps[i] = gocv.NewMat()\n\t\tC.WeChatQRCode_Mats_to(cMats, i, (C.Mat)(ps[i].Ptr()))\n\t}\n\n\t*point = ps\n\n\tresult := make([]string, 0)\n\tfor _, v := range toGoStrings(cDecoded) {\n\t\tresult = append(result, v)\n\t}\n\n\treturn result\n}\n\nfunc toGoStrings(strs C.CStrings) []string {\n\tlength := int(strs.length)\n\ttmpslice := (*[1 << 20]*C.char)(unsafe.Pointer(strs.strs))[:length:length]\n\tgostrings := make([]string, length)\n\tfor i, s := range tmpslice {\n\t\tgostrings[i] = C.GoString(s)\n\t}\n\treturn gostrings\n}\n"
  },
  {
    "path": "contrib/wechat_qrcode.h",
    "content": "#ifndef _OPENCV4_WECHAT_QRCODE_H_\n#define _OPENCV4_WECHAT_QRCODE_H_\n\n#ifdef __cplusplus\n\n#include <opencv2/opencv.hpp>\n#include <opencv2/wechat_qrcode.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::wechat_qrcode::WeChatQRCode> *WeChatQRCode;\ntypedef std::vector<std::string> *StringsVector;\n#else\ntypedef void* WeChatQRCode;\ntypedef void* StringsVector;\n#endif\n\nWeChatQRCode NewWeChatQRCode(const char *detector_prototxt_path, const char *detector_caffe_model_path,\n                             const char *super_resolution_prototxt_path, const char *super_resolution_caffe_model_path);\nCStrings WeChatQRCode_DetectAndDecode(WeChatQRCode wq, Mat img, struct Mats *points, StringsVector codes);\nStringsVector NewStringsVector();\nvoid WeChatQRCode_CStrings_Close(struct CStrings cstrs);\nvoid WeChatQRCode_Mats_Close(struct Mats mats);\nvoid WeChatQRCode_Mats_to(struct Mats mats, int i, Mat dst);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV4_WECHAT_QRCODE_H_"
  },
  {
    "path": "contrib/wechat_qrcode_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_wechat_qrcode)\n\npackage contrib\n\nimport (\n\t\"gocv.io/x/gocv\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestNewWeChatQRCode(t *testing.T) {\n\ttests := []struct {\n\t\tname    string\n\t\tnotWant *WeChatQRCode\n\t}{\n\t\t{\"testNewWeChatQRCode\", nil},\n\t}\n\n\tpath := os.Getenv(\"GOCV_CAFFE_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Caffe model files for tests\")\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\n\t\t\tif got := NewWeChatQRCode(path+\"/detect.prototxt\", path+\"/detect.caffemodel\",\n\t\t\t\tpath+\"/sr.prototxt\", path+\"/sr.caffemodel\"); reflect.DeepEqual(got, tt.notWant) {\n\t\t\t\tt.Errorf(\"NewWeChatQRCode() = %v, want %v\", got, tt.notWant)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestWeChatQRCode_DetectAndDecode(t *testing.T) {\n\tmat := gocv.IMRead(\"../images/qrcode.png\", gocv.IMReadColor)\n\tmats := make([]gocv.Mat, 0)\n\tdefer mat.Close()\n\n\ttype args struct {\n\t\timg   gocv.Mat\n\t\tpoint *[]gocv.Mat\n\t}\n\ttests := []struct {\n\t\tname     string\n\t\targs     args\n\t\twant     []string\n\t\tqrCounts int\n\t}{\n\t\t{\"TestDetectAndDecode\", args{point: &mats, img: mat}, []string{\"Hello World!\"}, 1},\n\t}\n\n\tpath := os.Getenv(\"GOCV_CAFFE_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Caffe model files for tests\")\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\twq := NewWeChatQRCode(path+\"/detect.prototxt\", path+\"/detect.caffemodel\",\n\t\t\t\tpath+\"/sr.prototxt\", path+\"/sr.caffemodel\")\n\t\t\tif got := wq.DetectAndDecode(tt.args.img, tt.args.point); !reflect.DeepEqual(got, tt.want) {\n\t\t\t\tt.Errorf(\"DetectAndDecode() = %v, want %v\", got, tt.want)\n\t\t\t}\n\t\t\tif len(mats) != tt.qrCounts {\n\t\t\t\tt.Errorf(\"DetectAndDecode() = %v, want qrcode counts %v\", tt.qrCounts, len(mats))\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "contrib/xfeatures2d.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xfeatures2d)\n\n#include \"xfeatures2d.h\"\n\n\nSURF SURF_Create() {\n    try {\n        return new cv::Ptr<cv::xfeatures2d::SURF>(cv::xfeatures2d::SURF::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nSURF SURF_CreateWithParams(double hessianThreshold, int nOctaves, int nOctaveLayers, bool extended, bool upright) {\n    try {\n        return new cv::Ptr<cv::xfeatures2d::SURF>(cv::xfeatures2d::SURF::create(hessianThreshold, nOctaves, nOctaveLayers, extended, upright));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid SURF_Close(SURF d) {\n    delete d;\n}\n\nstruct KeyPoints SURF_Detect(SURF d, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*d)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoints ret = {NULL, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints SURF_Compute(SURF d, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*d)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoints ret = {NULL, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints SURF_DetectAndCompute(SURF d, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*d)->detectAndCompute(*src, *mask, detected, *desc);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoints ret = {NULL, 0};\n        return ret;\n    }\n}\n\nBriefDescriptorExtractor BriefDescriptorExtractor_Create() {\n    try {\n        return new cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor>(cv::xfeatures2d::BriefDescriptorExtractor::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nBriefDescriptorExtractor BriefDescriptorExtractor_CreateWithParams(int bytes, bool useOrientation) {\n    try {\n        return new cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor>(cv::xfeatures2d::BriefDescriptorExtractor::create(bytes, useOrientation));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid BriefDescriptorExtractor_Close(BriefDescriptorExtractor b) {\n    delete b;\n}\n\nvoid BriefDescriptorExtractor_Compute(BriefDescriptorExtractor b, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> keypts;\n        keypts.reserve(kp.length);\n        cv::KeyPoint keypt;\n    \n        for (int i = 0; i < kp.length; ++i) {\n            keypt = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                            kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                            kp.keypoints[i].octave, kp.keypoints[i].classID);\n            keypts.push_back(keypt);\n        }\n    \n        (*b)->compute(*src, keypts, *desc);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "contrib/xfeatures2d.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xfeatures2d)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"xfeatures2d.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// SURF is a wrapper around the cv::SURF algorithm.\n// Due to being a patented algorithm you must set the OpenCV contrib build flag OPENCV_ENABLE_NONFREE=1\n// in order to use it.\ntype SURF struct {\n\t// C.SURF\n\tp unsafe.Pointer\n}\n\nvar _ gocv.Feature2D = (*SURF)(nil)\n\n// NewSURF returns a new SURF algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/df7/classcv_1_1xfeatures2d_1_1SURF.html\nfunc NewSURF() SURF {\n\treturn SURF{p: unsafe.Pointer(C.SURF_Create())}\n}\n\n// NewSURFWithParams returns a new SURF algorithm algorithm with parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/df7/classcv_1_1xfeatures2d_1_1SURF.html#a436553ca44d9a2238761ddbee5b395e5\nfunc NewSURFWithParams(hessianThreshold float64, nOctaves int, nOctaveLayers int, extended bool, upright bool) SURF {\n\treturn SURF{p: unsafe.Pointer(C.SURF_CreateWithParams(C.double(hessianThreshold), C.int(nOctaves), C.int(nOctaveLayers), C.bool(extended), C.bool(upright)))}\n}\n\n// Close SURF.\nfunc (d *SURF) Close() error {\n\tC.SURF_Close((C.SURF)(d.p))\n\td.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using SURF.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (d *SURF) Detect(src gocv.Mat) []gocv.KeyPoint {\n\tret := C.SURF_Detect((C.SURF)(d.p), C.Mat(src.Ptr()))\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using SURF.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (d *SURF) Compute(src gocv.Mat, mask gocv.Mat, kps []gocv.KeyPoint) ([]gocv.KeyPoint, gocv.Mat) {\n\tdesc := gocv.NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\tret := C.SURF_Compute((C.SURF)(d.p), C.Mat(src.Ptr()), cKeyPoints, C.Mat(desc.Ptr()))\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute detects and computes keypoints in an image using SURF.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (d *SURF) DetectAndCompute(src gocv.Mat, mask gocv.Mat) ([]gocv.KeyPoint, gocv.Mat) {\n\tdesc := gocv.NewMat()\n\tret := C.SURF_DetectAndCompute((C.SURF)(d.p), C.Mat(src.Ptr()), C.Mat(mask.Ptr()),\n\t\tC.Mat(desc.Ptr()))\n\n\treturn getKeyPoints(ret), desc\n}\n\nfunc getKeyPoints(ret C.KeyPoints) []gocv.KeyPoint {\n\tcArray := ret.keypoints\n\tdefer C.free(unsafe.Pointer(cArray))\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.KeyPoint)(unsafe.Pointer(&hdr))\n\n\tkeys := make([]gocv.KeyPoint, length)\n\tfor i, r := range s {\n\t\tkeys[i] = gocv.KeyPoint{X: float64(r.x), Y: float64(r.y), Size: float64(r.size), Angle: float64(r.angle),\n\t\t\tResponse: float64(r.response), Octave: int(r.octave), ClassID: int(r.classID)}\n\t}\n\treturn keys\n}\n\n// BriefDescriptorExtractor is a wrapper around the cv::BriefDescriptorExtractor algorithm.\ntype BriefDescriptorExtractor struct {\n\t// C.BriefDescriptorExtractor\n\tp unsafe.Pointer\n}\n\n// NewBriefDescriptorExtractor returns a new BriefDescriptorExtractor algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d93/classcv_1_1xfeatures2d_1_1BriefDescriptorExtractor.html\nfunc NewBriefDescriptorExtractor() BriefDescriptorExtractor {\n\treturn BriefDescriptorExtractor{p: unsafe.Pointer(C.BriefDescriptorExtractor_Create())}\n}\n\n// NewBriefDescriptorExtractorWithParams returns a new BriefDescriptorExtractor algorithm algorithm with parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d93/classcv_1_1xfeatures2d_1_1BriefDescriptorExtractor.html#ae3bc52666010fb137ab6f0d32de51f60\nfunc NewBriefDescriptorExtractorWithParams(bytes int, useOrientation bool) BriefDescriptorExtractor {\n\treturn BriefDescriptorExtractor{p: unsafe.Pointer(C.BriefDescriptorExtractor_CreateWithParams(C.int(bytes), C.bool(useOrientation)))}\n}\n\n// Close BriefDescriptorExtractor.\nfunc (d *BriefDescriptorExtractor) Close() error {\n\tC.BriefDescriptorExtractor_Close((C.BriefDescriptorExtractor)(d.p))\n\td.p = nil\n\treturn nil\n}\n\n// Compute descriptors with given keypoints using BriefDescriptorExtractor\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (b *BriefDescriptorExtractor) Compute(keyPoints []gocv.KeyPoint, src gocv.Mat) gocv.Mat {\n\tdesc := gocv.NewMat()\n\tcKeyPointArray := make([]C.struct_KeyPoint, len(keyPoints))\n\n\tfor i, kp := range keyPoints {\n\t\tcKeyPointArray[i].x = C.double(kp.X)\n\t\tcKeyPointArray[i].y = C.double(kp.Y)\n\t\tcKeyPointArray[i].size = C.double(kp.Size)\n\t\tcKeyPointArray[i].angle = C.double(kp.Angle)\n\t\tcKeyPointArray[i].response = C.double(kp.Response)\n\t\tcKeyPointArray[i].octave = C.int(kp.Octave)\n\t\tcKeyPointArray[i].classID = C.int(kp.ClassID)\n\t}\n\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&cKeyPointArray[0]),\n\t\tlength:    (C.int)(len(keyPoints)),\n\t}\n\n\tC.BriefDescriptorExtractor_Compute((C.BriefDescriptorExtractor)(b.p), C.Mat(src.Ptr()), cKeyPoints, C.Mat(desc.Ptr()))\n\treturn desc\n}\n"
  },
  {
    "path": "contrib/xfeatures2d.h",
    "content": "#ifndef _OPENCV3_XFEATURES2D_H_\n#define _OPENCV3_XFEATURES2D_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/xfeatures2d.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::xfeatures2d::SURF>* SURF;\ntypedef cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor>* BriefDescriptorExtractor;\n#else\ntypedef void* SURF;\ntypedef void* BriefDescriptorExtractor;\n#endif\n\nSURF SURF_Create();\nSURF SURF_CreateWithParams(double hessianThreshold, int nOctaves, int nOctaveLayers, bool extended, bool upright);\nvoid SURF_Close(SURF f);\nstruct KeyPoints SURF_Detect(SURF f, Mat src);\nstruct KeyPoints SURF_Compute(SURF f, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints SURF_DetectAndCompute(SURF f, Mat src, Mat mask, Mat desc);\nBriefDescriptorExtractor BriefDescriptorExtractor_Create();\nBriefDescriptorExtractor BriefDescriptorExtractor_CreateWithParams(int bytes, bool useOrientation);\nvoid BriefDescriptorExtractor_Close(BriefDescriptorExtractor b);\nvoid BriefDescriptorExtractor_Compute(BriefDescriptorExtractor b, Mat src, struct KeyPoints kp, Mat desc);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_XFEATURES2D_H_\n"
  },
  {
    "path": "contrib/xfeatures2d_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xfeatures2d)\n\npackage contrib\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestSURF(t *testing.T) {\n\ttestNonFree := os.Getenv(\"OPENCV_ENABLE_NONFREE\")\n\tif testNonFree == \"\" {\n\t\tt.Skip(\"Skipping SURF test since OPENCV_ENABLE_NONFREE was not set\")\n\t}\n\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SURF test\")\n\t}\n\tdefer img.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tsi := NewSURF()\n\tdefer si.Close()\n\n\tkp := si.Detect(img)\n\tif len(kp) == 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF Detect: %d\", len(kp))\n\t}\n\n\tmask := gocv.NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := si.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SURF Compute\")\n\t}\n\n\tkpdc, desc2 := si.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SURF DetectAndCompute\")\n\t}\n}\n\nfunc TestSURFWithParams(t *testing.T) {\n\ttestNonFree := os.Getenv(\"OPENCV_ENABLE_NONFREE\")\n\tif testNonFree == \"\" {\n\t\tt.Skip(\"Skipping SURFWithParams test since OPENCV_ENABLE_NONFREE was not set\")\n\t}\n\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SURF test\")\n\t}\n\tdefer img.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tsi := NewSURFWithParams(100, 4, 3, false, false)\n\tdefer si.Close()\n\n\tkp := si.Detect(img)\n\tif len(kp) == 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF Detect: %d\", len(kp))\n\t}\n\n\tmask := gocv.NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := si.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SURF Compute\")\n\t}\n\n\tkpdc, desc2 := si.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SURF DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SURF DetectAndCompute\")\n\t}\n}\n\nfunc TestBriefDescriptorExtractor(t *testing.T) {\n\ttestNonFree := os.Getenv(\"OPENCV_ENABLE_NONFREE\")\n\tif testNonFree == \"\" {\n\t\tt.Skip(\"Skipping BriefDescriptorExtractor test since OPENCV_ENABLE_NONFREE was not set\")\n\t}\n\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BriefDescriptorExtractor test\")\n\t}\n\tdefer img.Close()\n\n\tfast := gocv.NewFastFeatureDetector()\n\tdefer fast.Close()\n\n\tb := NewBriefDescriptorExtractor()\n\tdefer b.Close()\n\n\tkp := fast.Detect(img)\n\n\tdesc := b.Compute(kp, img)\n\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BriefDescriptorExtractor Compute\")\n\t}\n}\n\nfunc TestBriefDescriptorExtractorWithParams(t *testing.T) {\n\ttestNonFree := os.Getenv(\"OPENCV_ENABLE_NONFREE\")\n\tif testNonFree == \"\" {\n\t\tt.Skip(\"Skipping BriefDescriptorExtractorWithParams test since OPENCV_ENABLE_NONFREE was not set\")\n\t}\n\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BriefDescriptorExtractorWithParams test\")\n\t}\n\tdefer img.Close()\n\n\tfast := gocv.NewFastFeatureDetector()\n\tdefer fast.Close()\n\n\tb := NewBriefDescriptorExtractorWithParams(32, false)\n\tdefer b.Close()\n\n\tkp := fast.Detect(img)\n\n\tdesc := b.Compute(kp, img)\n\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BriefDescriptorExtractorWithParams Compute\")\n\t}\n}\n"
  },
  {
    "path": "contrib/ximgproc.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_ximgproc)\n\n#include \"ximgproc.h\"\n\nOpenCVResult anisotropicDiffusion(Mat src, Mat dst, float alpha, float K, int niters) {\n    try {\n        cv::ximgproc::anisotropicDiffusion(*src, *dst, alpha, K, niters);\t\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult edgePreservingFilter(Mat src, Mat dst, int d, float threshold) {\n    try {\n        cv::ximgproc::edgePreservingFilter(*src, *dst, d, threshold);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult niBlackThreshold(Mat src, Mat dst, float maxValue, int type, int blockSize, float k, int binarizationMethod, float r) {\n    try {\n        cv::ximgproc::niBlackThreshold(*src, *dst, maxValue, type, blockSize, k, binarizationMethod, r);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult PeiLinNormalization(Mat src, Mat dst) {\n    try {\n        cv::ximgproc::PeiLinNormalization(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult thinning(Mat src, Mat dst, int typ) {\n    try {\n        cv::ximgproc::thinning(*src, *dst, typ);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "contrib/ximgproc.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_ximgproc)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"ximgproc.h\"\n*/\nimport \"C\"\nimport (\n\t\"gocv.io/x/gocv\"\n)\n\n// AnisotropicDiffusion performs anisotropic diffusion on an image.\n//\n// The function applies Perona-Malik anisotropic diffusion to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#gaffedd976e0a8efb5938107acab185ec2\nfunc AnisotropicDiffusion(src gocv.Mat, dst *gocv.Mat, alpha float32, k float32, niters int) error {\n\treturn OpenCVResult(C.anisotropicDiffusion(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.float(alpha), C.float(k), C.int(niters)))\n}\n\n// EdgePreservingFilter smoothes an image using the Edge-Preserving filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#ga86fcda65ced0aafa2741088d82e9161c\nfunc EdgePreservingFilter(src gocv.Mat, dst *gocv.Mat, d int, threshold float32) error {\n\treturn OpenCVResult(C.edgePreservingFilter(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.int(d), C.float(threshold)))\n}\n\ntype BinarizationMethod int\n\nconst (\n\tBinarizationNiblack BinarizationMethod = iota\n\tBinarizationSauvola\n\tBinarizationWolf\n\tBinarizationNICK\n)\n\n// NiblackThreshold performs thresholding on input images using Niblack's technique\n// or some of the popular variations it inspired.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#gab042a5032bbb85275f1fd3e04e7c7660\nfunc NiblackThreshold(src gocv.Mat, dst *gocv.Mat, maxValue float32,\n\ttyp gocv.ThresholdType, blockSize int, k float32, binarizationMethod BinarizationMethod, r float32) error {\n\treturn OpenCVResult(C.niBlackThreshold(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.float(maxValue), C.int(typ),\n\t\tC.int(blockSize), C.float(k), C.int(binarizationMethod), C.float(r)))\n}\n\n// PeiLinNormalization calculates an affine transformation that normalize\n// given image using Pei&Lin Normalization.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#ga50d064b92f63916f4162474eea22d656\nfunc PeiLinNormalization(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.PeiLinNormalization(C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\ntype ThinningType int\n\nconst (\n\tThinningZhangSuen ThinningType = iota\n\tThinningGuoHall\n)\n\n// Thinning applies a binary blob thinning operation, to achieve a skeletization\n// of the input image.\n//\n// The function transforms a binary blob image into a skeletized form using the\n// technique of Zhang-Suen.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d2d/group__ximgproc.html#ga37002c6ca80c978edb6ead5d6b39740c\nfunc Thinning(src gocv.Mat, dst *gocv.Mat, typ ThinningType) error {\n\treturn OpenCVResult(C.thinning(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.int(typ)))\n}\n"
  },
  {
    "path": "contrib/ximgproc.h",
    "content": "#ifndef _OPENCV3_XIMGPROC_H_\n#define _OPENCV3_XIMGPROC_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/ximgproc.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\nOpenCVResult anisotropicDiffusion(Mat src, Mat dst, float alpha, float K, int niters);\nOpenCVResult edgePreservingFilter(Mat src, Mat dst, int d, float threshold);\nOpenCVResult niBlackThreshold(Mat src, Mat dst, float maxValue, int type, int blockSize, float k, int binarizationMethod, float r);\nOpenCVResult PeiLinNormalization(Mat src, Mat dst);\nOpenCVResult thinning(Mat src, Mat dst, int typ);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_XIMGPROC_H\n"
  },
  {
    "path": "contrib/ximgproc_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_ximgproc)\n\npackage contrib\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestAnisotropicDiffusion(t *testing.T) {\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tAnisotropicDiffusion(src, &dst, 0.5, 0.5, 100)\n\n\tif src.Empty() || dst.Rows() != src.Rows() {\n\t\tt.Error(\"invalid AnisotropicDiffusion test\")\n\t}\n}\n\nfunc TestAnisotropicDiffusionException(t *testing.T) {\n\tsrc := gocv.NewMat()\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\terr := AnisotropicDiffusion(src, &dst, 0.5, 0.5, 100)\n\tif err == nil {\n\t\tt.Error(\"Expected exception in test\")\n\t}\n\tif len(err.Error()) == 0 {\n\t\tt.Error(\"Expected exception message in test\")\n\t}\n}\n\nfunc TestEdgePreservingFilter(t *testing.T) {\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tEdgePreservingFilter(src, &dst, 3, 0.5)\n\n\tif src.Empty() || dst.Rows() != src.Rows() {\n\t\tt.Error(\"invalid EdgePreservingFilter test\")\n\t}\n}\n\nfunc TestNiblackThreshold(t *testing.T) {\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tNiblackThreshold(src, &dst, 127.0, gocv.ThresholdBinary, 3, 0.5, BinarizationNiblack, 128)\n\n\tif src.Empty() || dst.Rows() != src.Rows() {\n\t\tt.Error(\"invalid NiblackThreshold test\")\n\t}\n}\n\nfunc TestPeiLinNormalization(t *testing.T) {\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tPeiLinNormalization(src, &dst)\n\n\tif src.Empty() || dst.Rows() != 2 || dst.Cols() != 3 {\n\t\tt.Error(\"invalid PeiLinNormalization test\", dst.Rows(), dst.Cols())\n\t}\n}\n\nfunc TestThinning(t *testing.T) {\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tThinning(src, &dst, ThinningZhangSuen)\n\n\tif src.Empty() || dst.Rows() != src.Rows() {\n\t\tt.Error(\"invalid Thinning test\")\n\t}\n}\n"
  },
  {
    "path": "contrib/xobjdetect.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xobjdetect)\n\n#include \"xobjdetect.h\"\n\nWBDetector WBDetector_Create(){\n    try {\n        return new cv::Ptr<cv::xobjdetect::WBDetector>(cv::xobjdetect::WBDetector::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid WBDetector_Close(WBDetector det){\n    delete det;\n}\n\nWBDetector_detect_result WBDetector_Detect(WBDetector det, Mat img){\n    try {\n        std::vector<cv::Rect> bb;\n        std::vector<double> conf;\n        WBDetector_detect_result result;\n    \n        (*det)->detect(*img, bb, conf);\n    \n        Rect* result_rects = (Rect*)malloc(bb.size()*sizeof(Rect));\n        float* result_confs = (float*)malloc(conf.size()*sizeof(float));\n    \n        for(int i = 0; i < bb.size(); i ++) {\n            result_rects[i].x = bb[i].x;\n            result_rects[i].y = bb[i].y;\n            result_rects[i].width = bb[i].width;\n            result_rects[i].height = bb[i].height;\n        }\n    \n        for(int i = 0; i < conf.size(); i ++){\n            result_confs[i] = conf[i];\n        }\n    \n        result.bboxes.rects = result_rects;\n        result.bboxes.length = bb.size();\n    \n        result.confidences.val = result_confs;\n        result.confidences.length = conf.size();\n    \n        return result;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        WBDetector_detect_result result;\n        return result;\n    }\n}\n\nvoid WBDetector_Read(WBDetector det, FileNode node){\n    try {\n        (*det)->read(*node);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid WBDetector_Train(WBDetector det, const char* pos_samples, const char* neg_imgs){\n    try {\n        (*det)->train(pos_samples, neg_imgs);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid WBDetector_Write(WBDetector det, FileStorage fs){\n    try {\n        (*det)->write(*fs);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "contrib/xobjdetect.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xobjdetect)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"xobjdetect.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// WBDetector is a wrapper around the cv::xobjdetect::WBDetector.\ntype WBDetector struct {\n\tp C.WBDetector\n}\n\n// NewWBDetector Creates a new WBDetector\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d0e/classcv_1_1xobjdetect_1_1WBDetector.html#a58377ae61694aac08ad842ac830972d9\nfunc NewWBDetector() WBDetector {\n\tp := C.WBDetector_Create()\n\treturn WBDetector{p: p}\n}\n\n// Close Releases WBDetector allocated resources.\nfunc (det *WBDetector) Close() {\n\tC.WBDetector_Close(det.p)\n}\n\n// Detect Detect objects on image using WaldBoost detector\n//\n// img: Input image for detection\n//\n// Returns:\n//\n// Bounding boxes coordinates and\n// Confidence values for bounding boxes output vector\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d0e/classcv_1_1xobjdetect_1_1WBDetector.html#ad19680e6545f49a9ca42dfc3457319e2\nfunc (det *WBDetector) Detect(img gocv.Mat) ([]image.Rectangle, []float32) {\n\n\tresult := C.WBDetector_Detect(det.p, C.Mat(img.Ptr()))\n\n\tdefer C.free(unsafe.Pointer(result.bboxes.rects))\n\tdefer C.free(unsafe.Pointer(result.confidences.val))\n\n\tcRects := unsafe.Slice(result.bboxes.rects, result.bboxes.length)\n\tcConfs := unsafe.Slice(result.confidences.val, result.confidences.length)\n\n\tgoRects := make([]image.Rectangle, int(result.bboxes.length))\n\tgoConfs := make([]float32, int(result.confidences.length))\n\n\tfor i := 0; i < int(result.bboxes.length); i++ {\n\t\tr := image.Rect(int(cRects[i].x),\n\t\t\tint(cRects[i].y),\n\t\t\tint(cRects[i].width),\n\t\t\tint(cRects[i].height))\n\n\t\tgoRects = append(goRects, r)\n\t}\n\n\tfor i := 0; i < int(result.confidences.length); i++ {\n\t\tgoConfs[i] = float32(cConfs[i])\n\t}\n\n\treturn goRects, goConfs\n}\n\n// Read Read detector from gocv.FileNode\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d0e/classcv_1_1xobjdetect_1_1WBDetector.html#aef2df760f45d25aade518196986e139f\nfunc (det *WBDetector) Read(node *gocv.FileNode) {\n\tC.WBDetector_Read(det.p, C.FileNode(node.Ptr()))\n}\n\n// Train WaldBoost detector.\n//\n// Parameters:\n//\n// posSamples: Path to directory with cropped positive samples\n//\n// negImgs: Path to directory with negative (background) images\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d0e/classcv_1_1xobjdetect_1_1WBDetector.html#a3720fb425a2d16f6cd0625a2d8bc563e\nfunc (det *WBDetector) Train(posSamples string, negImgs string) {\n\n\tpos_samples := C.CString(posSamples)\n\tneg_imgs := C.CString(negImgs)\n\tdefer C.free(unsafe.Pointer(pos_samples))\n\tdefer C.free(unsafe.Pointer(neg_imgs))\n\n\tC.WBDetector_Train(det.p, pos_samples, neg_imgs)\n}\n\n// Write detector to gocv.FileStorage.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d0e/classcv_1_1xobjdetect_1_1WBDetector.html#a7d85338895707904ae1ddb4374ec8dac\nfunc (det *WBDetector) Write(fs *gocv.FileStorage) {\n\tC.WBDetector_Write(det.p, C.FileStorage(fs.Ptr()))\n}\n"
  },
  {
    "path": "contrib/xobjdetect.h",
    "content": "#ifndef _OPENCV3_XOBJDETECT_H_\n#define _OPENCV3_XOBJDETECT_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/xobjdetect.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n#include \"../persistence.h\"\n\ntypedef struct WBDetector_detect_result_t {\n    Rects       bboxes;\n    FloatVector confidences;\n} WBDetector_detect_result;\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::xobjdetect::WBDetector>* WBDetector;\n#else\ntypedef void* WBDetector;\n#endif\n\nWBDetector WBDetector_Create();\nvoid WBDetector_Close(WBDetector det);\nWBDetector_detect_result WBDetector_Detect(WBDetector det, Mat img);\nvoid WBDetector_Read(WBDetector det, FileNode node);\nvoid WBDetector_Train(WBDetector det, const char* pos_samples, const char* neg_imgs);\nvoid WBDetector_Write(WBDetector det, FileStorage fs);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_XOBJDETECT_H_\n"
  },
  {
    "path": "contrib/xobjdetect_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xobjdetect)\n\npackage contrib\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestWBDetector(t *testing.T) {\n\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadAnyColor)\n\tif img.Empty() {\n\t\tt.Error(\"xobjdetect: cannot read image\")\n\t}\n\n\tdet := NewWBDetector()\n\tdefer det.Close()\n\n\tdet.Train(\"../images/gocvlogo.jpg\", \"../images/gocvlogo.png\")\n\n\tdet.Detect(img)\n\n\tfs := gocv.NewFileStorageWithParams(\"../testdata/WBDetector.json\", gocv.FileStorageModeWrite, \"utf-8\")\n\tdefer fs.Close()\n\n\tfs.StartWriteStruct(\"gocv\", gocv.FileNodeTypeSeq, \"model\")\n\n\tdet.Write(fs)\n\n\tfs.EndWriteStruct()\n\n\tnode := fs.GetFirstTopLevelNode()\n\n\tdet.Read(node)\n\n}\n"
  },
  {
    "path": "contrib/xphoto.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xphoto)\n\n#include \"xphoto.h\"\n\nOpenCVResult Xphoto_ApplyChannelGains(Mat src, Mat dst, float gainB, float gainG, float gainR) {\n    try {\n        cv::xphoto::applyChannelGains(*src, *dst, gainB, gainG, gainR);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Xphoto_Bm3dDenoising_Step(Mat src, Mat dststep1, Mat dststep2) {\n    try {\n        cv::xphoto::bm3dDenoising(\n            *src, *dststep1, *dststep2,\n            1, 4,\n            16, 2500,\n            400, 8,\n            1, 2.0f,\n            cv::NORM_L2, cv::xphoto::BM3D_STEPALL,\n            cv::xphoto::HAAR\n        );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n\nOpenCVResult Xphoto_Bm3dDenoising_Step_WithParams(\n    Mat src, Mat dststep1, Mat dststep2,\n    float h, int templateWindowSize,\n    int searchWindowSize, int blockMatchingStep1,\n    int blockMatchingStep2, int groupSize,\n    int slidingStep, float beta,\n    int normType, int step,\n    int transformType\n) {\n    try {\n        cv::xphoto::bm3dDenoising(\n            *src, *dststep1, *dststep2,\n            h, templateWindowSize,\n            searchWindowSize, blockMatchingStep1,\n            blockMatchingStep2, groupSize,\n            slidingStep, beta,\n            normType, step,\n            transformType\n        );    \n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Xphoto_Bm3dDenoising(Mat src, Mat dst) {\n    try {\n        cv::xphoto::bm3dDenoising(*src, *dst,\n            1, 4,\n            16, 2500,\n            400, 8,\n            1, 2.0f,\n            cv::NORM_L2, cv::xphoto::BM3D_STEPALL,\n            cv::xphoto::HAAR\n           );\n           OpenCVResult result = {0, NULL};\n           return result;\n    } catch(const cv::Exception& e) {\n        OpenCVResult result = {e.code, e.what()};\n        return result;\n    }\n}\n\nOpenCVResult Xphoto_Bm3dDenoising_WithParams(\n    Mat src, Mat dst, float h, int templateWindowSize,\n    int searchWindowSize, int blockMatchingStep1,\n    int blockMatchingStep2, int groupSize,\n    int slidingStep, float beta,\n    int normType, int step,\n    int transformType\n) {\n    try {\n        cv::xphoto::bm3dDenoising(*src, *dst, h, templateWindowSize,\n            searchWindowSize, blockMatchingStep1,\n            blockMatchingStep2, groupSize,\n            slidingStep, beta,\n            normType, step,\n            transformType\n           );\n           OpenCVResult result = {0, NULL};\n           return result;\n    } catch(const cv::Exception& e) {\n        OpenCVResult result = {e.code, e.what()};\n        return result;\n    }\n}\n\n// ----------------------- GrayworldWB -----------------------\n\nGrayworldWB GrayworldWB_Create() {\n    try {\n        return new cv::Ptr<cv::xphoto::GrayworldWB>(cv::xphoto::createGrayworldWB());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid GrayworldWB_Close(GrayworldWB b) {\n    delete b;\n}\n\nvoid GrayworldWB_SetSaturationThreshold(GrayworldWB b, float saturationThreshold) {\n    try {\n        (*b)->setSaturationThreshold(saturationThreshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nfloat GrayworldWB_GetSaturationThreshold(GrayworldWB b) {\n    try {\n        return (*b)->getSaturationThreshold();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult GrayworldWB_BalanceWhite(GrayworldWB b, Mat src, Mat dst) {\n    try {\n        (*b)->balanceWhite(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// ----------------------- LearningBasedWB -----------------------\n\nLearningBasedWB LearningBasedWB_Create() {\n    try {\n        return new cv::Ptr<cv::xphoto::LearningBasedWB>(cv::xphoto::createLearningBasedWB());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nLearningBasedWB LearningBasedWB_CreateWithParams(const char* pathmodel) {\n    try {\n        cv::String path(pathmodel);\n        return new cv::Ptr<cv::xphoto::LearningBasedWB>(cv::xphoto::createLearningBasedWB(path));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid LearningBasedWB_Close(LearningBasedWB b) {\n    delete b;\n}\n\nOpenCVResult LearningBasedWB_ExtractSimpleFeatures(LearningBasedWB b, Mat src, Mat dst) {\n    try {\n        (*b)->extractSimpleFeatures(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint LearningBasedWB_GetHistBinNum(LearningBasedWB b)  {\n    try {\n        return (*b)->getHistBinNum();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nint LearningBasedWB_GetRangeMaxVal(LearningBasedWB b)  {\n    try {\n        return (*b)->getRangeMaxVal();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nfloat LearningBasedWB_GetSaturationThreshold(LearningBasedWB b)  {\n    try {\n        return (*b)->getSaturationThreshold();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid LearningBasedWB_SetHistBinNum(LearningBasedWB b, int val)  {\n    try {\n        (*b)->setHistBinNum(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid LearningBasedWB_SetRangeMaxVal(LearningBasedWB b, int val) {\n    try {\n        (*b)->setRangeMaxVal(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid LearningBasedWB_SetSaturationThreshold(LearningBasedWB b, float val) {\n    try {\n        (*b)->setSaturationThreshold(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult LearningBasedWB_BalanceWhite(LearningBasedWB b, Mat src, Mat dst) {\n    try {\n        (*b)->balanceWhite(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// ----------------------- SimpleWB -----------------------\n\n\nSimpleWB SimpleWB_Create() {\n    try {\n        return new cv::Ptr<cv::xphoto::SimpleWB>(cv::xphoto::createSimpleWB());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid SimpleWB_Close(SimpleWB b) {\n    delete b;\n}\n\n//  Input image range maximum value.\nfloat SimpleWB_GetInputMax(SimpleWB b) {\n    try {\n        return (*b)->getInputMax();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\n//  Input image range minimum value.\nfloat SimpleWB_GetInputMin(SimpleWB b) {\n    try {\n        return (*b)->getInputMin();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\n//  Output image range maximum value.\nfloat SimpleWB_GetOutputMax(SimpleWB b) {\n    try {\n        return (*b)->getOutputMax();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\n//  Output image range minimum value.\nfloat SimpleWB_GetOutputMin(SimpleWB b) {\n    try {\n        return (*b)->getOutputMin();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\n//  Percent of top/bottom values to ignore.\nfloat SimpleWB_GetP(SimpleWB b) {\n    try {\n        return (*b)->getP();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\n//  Input image range maximum value.\nvoid SimpleWB_SetInputMax(SimpleWB b, float val) {\n    try {\n        (*b)->setInputMax(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\n//  Input image range minimum value.\nvoid SimpleWB_SetInputMin(SimpleWB b, float val) {\n    try {\n        (*b)->setInputMin(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\n//  Output image range maximum value.\nvoid SimpleWB_SetOutputMax(SimpleWB b, float val) {\n    try {\n        (*b)->setOutputMax(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\n//  Output image range minimum value.\nvoid SimpleWB_SetOutputMin(SimpleWB b, float val) {\n    try {\n        (*b)->setOutputMin(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\n//  Percent of top/bottom values to ignore.\nvoid SimpleWB_SetP(SimpleWB b, float val) {\n    try {\n        (*b)->setP(val);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult SimpleWB_BalanceWhite(SimpleWB b, Mat src, Mat dst) {\n    try {\n        (*b)->balanceWhite(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// -------------------- TonemapDurand --------------------\n\n// Creates TonemapDurand object. More...\nTonemapDurand TonemapDurand_Create() {\n    try {\n        return new cv::Ptr<cv::xphoto::TonemapDurand>(cv::xphoto::createTonemapDurand(1.0f, 4.0f, 1.0f, 2.0f, 2.0f));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nTonemapDurand TonemapDurand_CreateWithParams(float gamma, float contrast, float saturation,\n        float sigma_color, float sigma_space) {\n\n    try {\n        return new cv::Ptr<cv::xphoto::TonemapDurand>(cv::xphoto::createTonemapDurand(gamma, contrast,\n            saturation, sigma_color, sigma_space));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid TonemapDurand_Close(TonemapDurand b) {\n    delete b;\n}\n\nfloat TonemapDurand_GetContrast(TonemapDurand b) {\n    try {\n        return (*b)->getContrast();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat TonemapDurand_GetSaturation(TonemapDurand b) {\n    try {\n        return (*b)->getSaturation();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat TonemapDurand_GetSigmaColor(TonemapDurand b) {\n    try {\n        return (*b)->getSigmaColor();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat TonemapDurand_GetSigmaSpace(TonemapDurand b) {\n    try {\n        return (*b)->getSigmaSpace();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid TonemapDurand_SetContrast(TonemapDurand b, float contrast) {\n    try {\n        (*b)->setContrast(contrast);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid TonemapDurand_SetSaturation(TonemapDurand b, float saturation) {\n    try {\n        (*b)->setSaturation(saturation);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid TonemapDurand_SetSigmaColor(TonemapDurand b, float sigma_color) {\n    try {\n        (*b)->setSigmaColor(sigma_color);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid TonemapDurand_SetSigmaSpace(TonemapDurand b, float sigma_space) {\n    try {\n        (*b)->setSigmaSpace(sigma_space);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nfloat TonemapDurand_GetGamma(TonemapDurand b) {\n    try {\n        return (*b)->getGamma();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid TonemapDurand_SetGamma(TonemapDurand b, float gamma) {\n    try {\n        (*b)->setGamma(gamma);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult TonemapDurand_Process(TonemapDurand b, Mat src, Mat dst) {\n    try {\n        (*b)->process(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// -------------------- cv::xphoto::Inpaint --------------------\n\nOpenCVResult Inpaint(Mat src, Mat mask, Mat dst, int algorithmType) {\n    try {\n        cv::xphoto::inpaint(*src, *mask, *dst, algorithmType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult OilPaintingWithParams(Mat src, Mat dst, int size, int dynRatio, int code) {\n    try {\n        cv::xphoto::oilPainting(*src, *dst, size, dynRatio, code);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult OilPainting(Mat src, Mat dst, int size, int dynRatio) {\n    try {\n        cv::xphoto::oilPainting(*src, *dst, size, dynRatio);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "contrib/xphoto.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xphoto)\n\npackage contrib\n\n/*\n#include <stdlib.h>\n#include \"xphoto.h\"\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// GrayworldWB is a wrapper around the cv::xphoto::GrayworldWB.\ntype GrayworldWB struct {\n\t// C.GrayworldWB\n\tp unsafe.Pointer\n}\n\n// LearningBasedWB is a wrapper around the cv::xphoto::LearningBasedWB.\ntype LearningBasedWB struct {\n\t// C.GrayworldWB\n\tp unsafe.Pointer\n}\n\n// SimpleWB is a wrapper around the cv::xphoto::SimpleWB.\ntype SimpleWB struct {\n\t// C.GrayworldWB\n\tp unsafe.Pointer\n}\n\n// TonemapDurand is a wrapper around the cv::xphoto::TonemapDurand.\ntype TonemapDurand struct {\n\t// C.GrayworldWB\n\tp unsafe.Pointer\n}\n\n// Bm3dSteps is the type for the various BM3D algorithm steps\ntype Bm3dSteps int\n\nconst (\n\tBm3dAlgoStepAll Bm3dSteps = 0\n\tBm3dAlgoSte1    Bm3dSteps = 1\n\tBm3dAlgoSte2    Bm3dSteps = 2\n)\n\ntype TransformTypes int\n\nconst (\n\tBm3dTypeHaar TransformTypes = 0\n)\n\ntype InpaintTypes int\n\nconst (\n\tShitMap InpaintTypes = 0\n\tFsrBest InpaintTypes = 1\n\tFsrFast InpaintTypes = 2\n)\n\n// ----------------------- ---------------------------------------\n// ----------------------- Bm3dDenoising -------------------------\n// ----------------------- ---------------------------------------\n\nfunc ApplyChannelGains(src gocv.Mat, dst *gocv.Mat, gainB float32, gainG float32, gainR float32) error {\n\treturn OpenCVResult(C.Xphoto_ApplyChannelGains(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.float(gainB), C.float(gainG), C.float(gainR)))\n}\n\n// src = Input 8-bit or 16-bit 1-channel image.\nfunc Bm3dDenoisingStep(src gocv.Mat, dststep1 *gocv.Mat, dststep2 *gocv.Mat) error {\n\treturn OpenCVResult(C.Xphoto_Bm3dDenoising_Step(C.Mat(src.Ptr()), C.Mat(dststep1.Ptr()), C.Mat(dststep2.Ptr())))\n}\n\n// src = Input 8-bit or 16-bit 1-channel image.\nfunc Bm3dDenoisingStepWithParams(src gocv.Mat, dststep1 *gocv.Mat, dststep2 *gocv.Mat,\n\th float32, templateWindowSize int,\n\tsearchWindowSize int, blockMatchingStep1 int,\n\tblockMatchingStep2 int, groupSize int,\n\tslidingStep int, beta float32,\n\tnormType gocv.NormType, step Bm3dSteps,\n\ttransformType TransformTypes) error {\n\treturn OpenCVResult(C.Xphoto_Bm3dDenoising_Step_WithParams(C.Mat(src.Ptr()), C.Mat(dststep1.Ptr()), C.Mat(dststep2.Ptr()),\n\t\tC.float(h), C.int(templateWindowSize),\n\t\tC.int(searchWindowSize), C.int(blockMatchingStep1),\n\t\tC.int(blockMatchingStep2), C.int(groupSize),\n\t\tC.int(slidingStep), C.float(beta),\n\t\tC.int(normType), C.int(step),\n\t\tC.int(transformType)))\n}\n\n// src = Input 8-bit or 16-bit 1-channel image.\nfunc Bm3dDenoising(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.Xphoto_Bm3dDenoising(C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// src = Input 8-bit or 16-bit 1-channel image.\nfunc Bm3dDenoisingWithParams(src gocv.Mat, dst *gocv.Mat,\n\th float32, templateWindowSize int,\n\tsearchWindowSize int, blockMatchingStep1 int,\n\tblockMatchingStep2 int, groupSize int,\n\tslidingStep int, beta float32,\n\tnormType gocv.NormType, step Bm3dSteps,\n\ttransformType TransformTypes) error {\n\n\treturn OpenCVResult(C.Xphoto_Bm3dDenoising_WithParams(C.Mat(src.Ptr()), C.Mat(dst.Ptr()),\n\t\tC.float(h), C.int(templateWindowSize),\n\t\tC.int(searchWindowSize), C.int(blockMatchingStep1),\n\t\tC.int(blockMatchingStep2), C.int(groupSize),\n\t\tC.int(slidingStep), C.float(beta),\n\t\tC.int(normType), C.int(step),\n\t\tC.int(transformType)))\n}\n\n// ----------------------- ---------------------------------------\n// ----------------------- GrayworldWB ---------------------------\n// ----------------------- ---------------------------------------\n\n// NewGrayworldWBWithParams returns a new Gray-world white balance algorithm.\n// of type GrayworldWB with customized parameters. GrayworldWB algorithm scales the values\n// of pixels based on a gray-world assumption which states that the average of all\n// channels should result in a gray image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html\nfunc NewGrayworldWB() GrayworldWB {\n\treturn GrayworldWB{p: unsafe.Pointer(C.GrayworldWB_Create())}\n}\n\n// SetSaturationThreshold set a Maximum saturation for a pixel to be included in the gray-world assumption.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html#ac6e17766e394adc15588b8522202cc71\nfunc (b *GrayworldWB) SetSaturationThreshold(saturationThreshold float32) {\n\tC.GrayworldWB_SetSaturationThreshold((C.GrayworldWB)(b.p), C.float(saturationThreshold))\n\treturn\n}\n\n// GetSaturationThreshold return the Maximum saturation for a pixel to be included in the gray-world assumption.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html#ac6e17766e394adc15588b8522202cc71\nfunc (b *GrayworldWB) GetSaturationThreshold() float32 {\n\treturn float32(C.GrayworldWB_GetSaturationThreshold((C.GrayworldWB)(b.p)))\n}\n\n// Close GrayworldWB.\nfunc (b *GrayworldWB) Close() error {\n\tC.GrayworldWB_Close((C.GrayworldWB)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// BalanceWhite computes a Gray-world white balance using the current GrayworldWB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d71/classcv_1_1xphoto_1_1GrayworldWB.html#details\nfunc (b *GrayworldWB) BalanceWhite(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.GrayworldWB_BalanceWhite((C.GrayworldWB)(b.p), C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// ----------------------- ---------------------------------------\n// ----------------------- LearningBasedWB -----------------------\n// ----------------------- ---------------------------------------\n\n// NewLearningBasedWB returns more sophisticated learning-based\n// automatic white balance algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gac8fb5636b27eac575f4a4c9c54dd1c7c\nfunc NewLearningBasedWB() LearningBasedWB {\n\treturn LearningBasedWB{p: unsafe.Pointer(C.LearningBasedWB_Create())}\n}\n\n// NewLearningBasedWBWithParams returns more sophisticated learning-based\n// automatic white balance algorithm.\n// A type LearningBasedWB algorithm with path model parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gac8fb5636b27eac575f4a4c9c54dd1c7c\nfunc NewLearningBasedWBWithParams(pathmodel string) LearningBasedWB {\n\tcpath := C.CString(pathmodel)\n\tdefer C.free(unsafe.Pointer(cpath))\n\treturn LearningBasedWB{p: unsafe.Pointer(C.LearningBasedWB_CreateWithParams(cpath))}\n}\n\n// Close LearningBasedWB.\nfunc (b *LearningBasedWB) Close() error {\n\tC.LearningBasedWB_Close((C.LearningBasedWB)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// ExtractSimpleFeatures\n// Implements the feature extraction part of the algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#aeeaca052262a01d0feed6312ccb9a76e\nfunc (b *LearningBasedWB) ExtractSimpleFeatures(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.LearningBasedWB_ExtractSimpleFeatures((C.LearningBasedWB)(b.p), C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// GetHistBinNum\n// Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#abfe7d3983f8245a7eba0a7f9de40e3e1\nfunc (b *LearningBasedWB) GetHistBinNum() int {\n\treturn int(C.LearningBasedWB_GetHistBinNum((C.LearningBasedWB)(b.p)))\n}\n\n// GetRangeMaxVal\n// Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#a764b51265b5a1bd7bd11ce9d14d6f75f\nfunc (b *LearningBasedWB) GetRangeMaxVal() int {\n\treturn int(C.LearningBasedWB_GetRangeMaxVal((C.LearningBasedWB)(b.p)))\n}\n\n// GetSaturationThreshold\n// Threshold that is used to determine saturated pixels\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#ae7eb310249709c2aef41d6399ebd7660\nfunc (b *LearningBasedWB) GetSaturationThreshold() float32 {\n\treturn float32(C.LearningBasedWB_GetSaturationThreshold((C.LearningBasedWB)(b.p)))\n}\n\n// SetHistBinNum\n// Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#a3381bd425bc4201133c9669071908e7f\nfunc (b *LearningBasedWB) SetHistBinNum(val int) {\n\tC.LearningBasedWB_SetHistBinNum((C.LearningBasedWB)(b.p), C.int(val))\n\treturn\n}\n\n// SetRangeMaxVal\n// Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#a3d9395274be8053b2f09e46d11a24a65\nfunc (b *LearningBasedWB) SetRangeMaxVal(val int) {\n\tC.LearningBasedWB_SetRangeMaxVal((C.LearningBasedWB)(b.p), C.int(val))\n\treturn\n}\n\n// SetSaturationThreshold\n// Threshold that is used to determine saturated pixels\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d3b/classcv_1_1xphoto_1_1LearningBasedWB.html#a9bff5a507d4dffc58e16d85b1d07f35f\nfunc (b *LearningBasedWB) SetSaturationThreshold(val float32) {\n\tC.LearningBasedWB_SetSaturationThreshold((C.LearningBasedWB)(b.p), C.float(val))\n\treturn\n}\n\n// BalanceWhite computes a learning-based white balance using the current LearningBasedWB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d7a/classcv_1_1xphoto_1_1WhiteBalancer.html#ae23838a1a54f101b255bca1a97418aa3\nfunc (b *LearningBasedWB) BalanceWhite(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.LearningBasedWB_BalanceWhite((C.LearningBasedWB)(b.p), C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// ----------------------- ---------------------------------------\n// ----------------------- SimpleWB ------------------------------\n// ----------------------- ---------------------------------------\n\n// NewSimpleWBWithParams returns more sophisticated learning-based\n// automatic white balance algorithm.\n// A type SimpleWB algorithm with path model parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga2b48b3b384b5c5ee1b15a2a01c26d5f1\nfunc NewSimpleWB() SimpleWB {\n\treturn SimpleWB{p: unsafe.Pointer(C.SimpleWB_Create())}\n}\n\n// Close SimpleWB.\nfunc (b *SimpleWB) Close() error {\n\tC.SimpleWB_Close((C.SimpleWB)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// GetInputMax\n// Input image range maximum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a45fef780842168cba868212c71ad8318\nfunc (b *SimpleWB) GetInputMax() float32 {\n\treturn float32(C.SimpleWB_GetInputMax((C.SimpleWB)(b.p)))\n}\n\n// GetInputMin\n// Input image range minimum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a69ee7c05e5ca45cac60040371a4a648c\nfunc (b *SimpleWB) GetInputMin() float32 {\n\treturn float32(C.SimpleWB_GetInputMin((C.SimpleWB)(b.p)))\n}\n\n// GetOutputMax\n// Output image range maximum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#af8b051a0b2d3e8ad0aa323c195d966c1\nfunc (b *SimpleWB) GetOutputMax() float32 {\n\treturn float32(C.SimpleWB_GetOutputMax((C.SimpleWB)(b.p)))\n}\n\n// GetOutputMin\n// Output image range minimum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#ada11ef4159bd6354a98d371f5be68b44\nfunc (b *SimpleWB) GetOutputMin() float32 {\n\treturn float32(C.SimpleWB_GetOutputMin((C.SimpleWB)(b.p)))\n}\n\n// GetP\n// Percent of top/bottom values to ignore.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a49d63fd73572fc88c944f5ffbcb085a3\nfunc (b *SimpleWB) GetP() float32 {\n\treturn float32(C.SimpleWB_GetP((C.SimpleWB)(b.p)))\n}\n\n// SetInputMax\n// Input image range maximum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a6b2523a8740b353ef50e136d0399bf3a\nfunc (b *SimpleWB) SetInputMax(val float32) {\n\tC.SimpleWB_SetInputMax((C.SimpleWB)(b.p), C.float(val))\n\treturn\n}\n\n// SetInputMin\n// Input image range minimum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a1b08a24a8589aae886fbf96ba27691a0\nfunc (b *SimpleWB) SetInputMin(val float32) {\n\tC.SimpleWB_SetInputMin((C.SimpleWB)(b.p), C.float(val))\n\treturn\n}\n\n// SetOutputMax\n// Output image range maximum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a06962b042d9089366bc6347e608481b6\nfunc (b *SimpleWB) SetOutputMax(val float32) {\n\tC.SimpleWB_SetOutputMax((C.SimpleWB)(b.p), C.float(val))\n\treturn\n}\n\n// SetOutputMin\n// Output image range minimum value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a60d1e06b122747d416c4f1563167c740\nfunc (b *SimpleWB) SetOutputMin(val float32) {\n\tC.SimpleWB_SetOutputMin((C.SimpleWB)(b.p), C.float(val))\n\treturn\n}\n\n// SetP\n// Percent of top/bottom values to ignore.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d8b/classcv_1_1xphoto_1_1SimpleWB.html#a31b6bb5452afdb5a444920013417f018\nfunc (b *SimpleWB) SetP(val float32) {\n\tC.SimpleWB_SetP((C.SimpleWB)(b.p), C.float(val))\n\treturn\n}\n\n// BalanceWhite computes a learning-based white balance using the current LearningBasedWB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d7a/classcv_1_1xphoto_1_1WhiteBalancer.html#ae23838a1a54f101b255bca1a97418aa3\nfunc (b *SimpleWB) BalanceWhite(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.SimpleWB_BalanceWhite((C.SimpleWB)(b.p), C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// ----------------------- ---------------------------------------\n// ----------------------- TonemapDurand -------------------------\n// ----------------------- ---------------------------------------\n\n// NewTonemapDurand returns more sophisticated learning-based\n// automatic white balance algorithm.\n// A type TonemapDurand algorithm with path model parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d1/db3/classcv_1_1xphoto_1_1TonemapDurand.html\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga51a091aa54e26b3546316ce2c1df190b\nfunc NewTonemapDurand() TonemapDurand {\n\treturn TonemapDurand{p: unsafe.Pointer(C.TonemapDurand_Create())}\n}\n\n// NewTonemapDurandWithParams returns more sophisticated learning-based\n// automatic white balance algorithm.\n// A type TonemapDurand algorithm with path model parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html\n// https://docs.opencv.org/master/d1/db3/classcv_1_1xphoto_1_1TonemapDurand.html\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga51a091aa54e26b3546316ce2c1df190b\nfunc NewTonemapDurandWithParams(gamma float32, contrast float32, saturation float32,\n\tsigma_color float32, sigma_space float32) TonemapDurand {\n\treturn TonemapDurand{p: unsafe.Pointer(C.TonemapDurand_CreateWithParams(C.float(gamma), C.float(contrast),\n\t\tC.float(saturation), C.float(sigma_color), C.float(sigma_space)))}\n}\n\n// Close TonemapDurand.\nfunc (b *TonemapDurand) Close() error {\n\tC.TonemapDurand_Close((C.TonemapDurand)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// GetContrast\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga2df693dd285a7e7fd3b4fc8a8a750cce\nfunc (b *TonemapDurand) GetContrast() float32 {\n\treturn float32(C.TonemapDurand_GetContrast((C.TonemapDurand)(b.p)))\n}\n\n// GetSaturation\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gad8ab5850af6fdb3f6bc51d5c9371bbfe\nfunc (b *TonemapDurand) GetSaturation() float32 {\n\treturn float32(C.TonemapDurand_GetSaturation((C.TonemapDurand)(b.p)))\n}\n\n// GetSigmaColor\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga31d7588db7e47fb81890cba7ff014edb\nfunc (b *TonemapDurand) GetSigmaColor() float32 {\n\treturn float32(C.TonemapDurand_GetSigmaColor((C.TonemapDurand)(b.p)))\n}\n\n// GetSigmaSpace\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga078b11014d8a41920f50cab57fce9515\nfunc (b *TonemapDurand) GetSigmaSpace() float32 {\n\treturn float32(C.TonemapDurand_GetSigmaSpace((C.TonemapDurand)(b.p)))\n}\n\n// SetContrast\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga99eaaa24dc25ba387093e957bfca1cad\nfunc (b *TonemapDurand) SetContrast(val float32) {\n\tC.TonemapDurand_SetContrast((C.TonemapDurand)(b.p), C.float(val))\n\treturn\n}\n\n// SetSaturation\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga9c7de9517f95fd046910fc818e256d55\nfunc (b *TonemapDurand) SetSaturation(val float32) {\n\tC.TonemapDurand_SetSaturation((C.TonemapDurand)(b.p), C.float(val))\n\treturn\n}\n\n// SetSigmaColor\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga7dec866735ecbae9e05224958d4585fd\nfunc (b *TonemapDurand) SetSigmaColor(val float32) {\n\tC.TonemapDurand_SetSigmaColor((C.TonemapDurand)(b.p), C.float(val))\n\treturn\n}\n\n// SetSigmaSpace\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#ga8869068912fae078699ce931bdc17fc4\nfunc (b *TonemapDurand) SetSigmaSpace(val float32) {\n\tC.TonemapDurand_SetSigmaSpace((C.TonemapDurand)(b.p), C.float(val))\n\treturn\n}\n\n// GetGamma\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d5e/classcv_1_1Tonemap.html#a147c2b57ed5a5a0566001f4db2ddc0dd\nfunc (b *TonemapDurand) GetGamma() float32 {\n\treturn float32(C.TonemapDurand_GetGamma((C.TonemapDurand)(b.p)))\n}\n\n// SetGamma\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d5e/classcv_1_1Tonemap.html#ac809d2967f942b038b4bf21c97f8b1b7\nfunc (b *TonemapDurand) SetGamma(val float32) {\n\tC.TonemapDurand_SetGamma((C.TonemapDurand)(b.p), C.float(val))\n\treturn\n}\n\n// Process\n// Tonemaps image with gocv.MatTypeCV32FC3 type image\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d5e/classcv_1_1Tonemap.html#aa705c3b7226f7028a5c117dffab60fe4\nfunc (b *TonemapDurand) Process(src gocv.Mat, dst *gocv.Mat) error {\n\treturn OpenCVResult(C.TonemapDurand_Process((C.TonemapDurand)(b.p), C.Mat(src.Ptr()), C.Mat(dst.Ptr())))\n}\n\n// ----------------------- ---------------------------------------\n// -------------------------- Inpaint ----------------------------\n// ----------------------- ---------------------------------------\n\n// The function implements different single-image inpainting algorithms.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gab4febba6be53e5fddc480b8cedf51eee\nfunc Inpaint(src *gocv.Mat, mask *gocv.Mat, dst *gocv.Mat, algorithmType InpaintTypes) error {\n\treturn OpenCVResult(C.Inpaint(C.Mat(src.Ptr()), C.Mat(mask.Ptr()), C.Mat(dst.Ptr()), C.int(algorithmType)))\n}\n\n// oilPainting, See the book for details :\n// GerPublished by ard J. Holzmann. Beyond Photography: The Digital Darkroom. Prentice Hall in 1988.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gac050a6e876298cb9713cd2c09db9a027\nfunc OilPaintingWithParams(src gocv.Mat, dst gocv.Mat, size int, dynRatio int, code gocv.ColorConversionCode) error {\n\treturn OpenCVResult(C.OilPaintingWithParams(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.int(size), C.int(dynRatio), C.int(code)))\n}\n\n// oilPainting, See the book for details :\n// GerPublished by ard J. Holzmann. Beyond Photography: The Digital Darkroom. Prentice Hall in 1988.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/daa/group__xphoto.html#gac18ef93a7b1e65f703f7dc3b1e8e5235\nfunc OilPainting(src gocv.Mat, dst *gocv.Mat, size int, dynRatio int) error {\n\treturn OpenCVResult(C.OilPainting(C.Mat(src.Ptr()), C.Mat(dst.Ptr()), C.int(size), C.int(dynRatio)))\n}\n"
  },
  {
    "path": "contrib/xphoto.h",
    "content": "#ifndef _OPENCV3_XPHOTO_H_\n#define _OPENCV3_XPHOTO_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/xphoto/bm3d_image_denoising.hpp>\n#include <opencv2/xphoto/white_balance.hpp>\n#include <opencv2/xphoto/tonemap.hpp>\n#include <opencv2/xphoto/inpainting.hpp>\n#include <opencv2/xphoto/oilpainting.hpp>\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::xphoto::GrayworldWB>* GrayworldWB;\ntypedef cv::Ptr<cv::xphoto::LearningBasedWB>* LearningBasedWB;\ntypedef cv::Ptr<cv::xphoto::SimpleWB>* SimpleWB;\ntypedef cv::Ptr<cv::xphoto::TonemapDurand>* TonemapDurand;\n#else\ntypedef void* GrayworldWB;\ntypedef void* LearningBasedWB;\ntypedef void* SimpleWB;\ntypedef void* TonemapDurand;\n#endif\n\n\n// ----------------------- bm3d_image_denoising -----------------------\n\nOpenCVResult Xphoto_ApplyChannelGains(Mat src, Mat dst, float gainB, float gainG, float gainR);\n\nOpenCVResult Xphoto_Bm3dDenoising_Step(Mat src, Mat dststep1, Mat dststep2);\nOpenCVResult Xphoto_Bm3dDenoising_Step_WithParams(\n    Mat src, Mat dststep1, Mat dststep2,\n    float h, int templateWindowSize,\n    int searchWindowSize, int blockMatchingStep1,\n    int blockMatchingStep2, int groupSize,\n    int slidingStep, float beta,\n    int normType, int step,\n    int transformType\n);\n\nOpenCVResult Xphoto_Bm3dDenoising(Mat src, Mat dst);\nOpenCVResult Xphoto_Bm3dDenoising_WithParams(\n    Mat src, Mat dst,\n    float h, int templateWindowSize,\n    int searchWindowSize, int blockMatchingStep1,\n    int blockMatchingStep2, int groupSize,\n    int slidingStep, float beta,\n    int normType, int step,\n    int transformType\n);\n\n\n// ----------------------- GrayworldWB -----------------------\n\nGrayworldWB GrayworldWB_Create();\nvoid GrayworldWB_Close(GrayworldWB b);\nvoid GrayworldWB_SetSaturationThreshold(GrayworldWB b, float saturationThreshold);\nfloat GrayworldWB_GetSaturationThreshold(GrayworldWB b);\nOpenCVResult GrayworldWB_BalanceWhite(GrayworldWB b, Mat src, Mat dst);\n\n// ----------------------- LearningBasedWB -----------------------\n\nLearningBasedWB LearningBasedWB_Create();\nLearningBasedWB LearningBasedWB_CreateWithParams(const char* pathmodel);\nvoid LearningBasedWB_Close(LearningBasedWB b);\nOpenCVResult LearningBasedWB_ExtractSimpleFeatures(LearningBasedWB b, Mat src, Mat dst);\nint LearningBasedWB_GetHistBinNum(LearningBasedWB b) ;\nint LearningBasedWB_GetRangeMaxVal(LearningBasedWB b) ;\nfloat LearningBasedWB_GetSaturationThreshold(LearningBasedWB b) ;\nvoid LearningBasedWB_SetHistBinNum(LearningBasedWB b, int val);\nvoid LearningBasedWB_SetRangeMaxVal(LearningBasedWB b, int val);\nvoid LearningBasedWB_SetSaturationThreshold(LearningBasedWB b, float val);\nOpenCVResult LearningBasedWB_BalanceWhite(LearningBasedWB b, Mat src, Mat dst);\n\n// ----------------------- SimpleWB -----------------------\n\nSimpleWB SimpleWB_Create();\nvoid SimpleWB_Close(SimpleWB b);\nfloat SimpleWB_GetInputMax(SimpleWB b);\nfloat SimpleWB_GetInputMin(SimpleWB b);\nfloat SimpleWB_GetOutputMax(SimpleWB b);\nfloat SimpleWB_GetOutputMin(SimpleWB b);\nfloat SimpleWB_GetP(SimpleWB b);\nvoid SimpleWB_SetInputMax(SimpleWB b, float val);\nvoid SimpleWB_SetInputMin(SimpleWB b, float val);\nvoid SimpleWB_SetOutputMax(SimpleWB b, float val);\nvoid SimpleWB_SetOutputMin(SimpleWB b, float val);\nvoid SimpleWB_SetP(SimpleWB b, float val);\nOpenCVResult SimpleWB_BalanceWhite(SimpleWB b, Mat src, Mat dst);\n\n\n// -------------------- TonemapDurand --------------------\n\nTonemapDurand TonemapDurand_Create();\nTonemapDurand TonemapDurand_CreateWithParams(float gamma, float contrast, float saturation,\n        float sigma_color, float sigma_space) ;\nvoid TonemapDurand_Close(TonemapDurand b);\n\nfloat TonemapDurand_GetContrast(TonemapDurand b);\nfloat TonemapDurand_GetSaturation(TonemapDurand b);\nfloat TonemapDurand_GetSigmaColor(TonemapDurand b);\nfloat TonemapDurand_GetSigmaSpace(TonemapDurand b);\nvoid TonemapDurand_SetContrast(TonemapDurand b, float contrast);\nvoid TonemapDurand_SetSaturation(TonemapDurand b, float saturation);\nvoid TonemapDurand_SetSigmaColor(TonemapDurand b, float sigma_color);\nvoid TonemapDurand_SetSigmaSpace(TonemapDurand b, float sigma_space);\n\nfloat TonemapDurand_GetGamma(TonemapDurand b);\nOpenCVResult TonemapDurand_Process(TonemapDurand b, Mat src, Mat dst);\nvoid TonemapDurand_SetGamma(TonemapDurand b, float gamma);\n\n\n// ------------------------ Inpaint -----------------------\n\nOpenCVResult Inpaint(Mat src, Mat mask, Mat dst, int algorithmType);\nOpenCVResult OilPaintingWithParams(Mat src, Mat dst, int size, int dynRatio, int code);\nOpenCVResult OilPainting(Mat src, Mat dst, int size, int dynRatio);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_XPHOTO_H\n"
  },
  {
    "path": "contrib/xphoto_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_contrib_xphoto)\n\npackage contrib\n\n//:testing\n\nimport (\n\t\"gocv.io/x/gocv\"\n\t\"testing\"\n)\n\nfunc TestBm3dDenoisingStepWithParams(t *testing.T) {\n\t// src = Input 8-bit or 16-bit 1-channel image.\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\tdst1 := gocv.NewMat()\n\tdefer dst1.Close()\n\tdst2 := gocv.NewMat()\n\tdefer dst2.Close()\n\n\tBm3dDenoisingStepWithParams(src, &dst1, &dst2,\n\t\tfloat32(1.0), int(4),\n\t\tint(16), int(2500),\n\t\tint(400), int(8),\n\t\tint(1), float32(2.0),\n\t\tgocv.NormL2,\n\t\tBm3dAlgoStepAll,\n\t\tBm3dTypeHaar)\n\n\tif src.Empty() || dst1.Rows() != src.Rows() || dst1.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid TestBm3dDenoisingStepWithParams test\")\n\t}\n}\n\nfunc TestBm3dDenoisingWithParams(t *testing.T) {\n\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tBm3dDenoisingWithParams(src, &dst,\n\t\tfloat32(1.0), int(4),\n\t\tint(16), int(2500),\n\t\tint(400), int(8),\n\t\tint(1), float32(2.0),\n\t\tgocv.NormL2,\n\t\tBm3dAlgoStepAll,\n\t\tBm3dTypeHaar)\n\n\tif src.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() || dst.Type() != src.Type() {\n\t\tt.Error(\"Invlalid BalanceWhite test\")\n\t}\n}\n\nfunc TestSetSaturationThreshold(t *testing.T) {\n\n\tgrayworldwb := NewGrayworldWB()\n\tvar saturation float32 = 0.7\n\tgrayworldwb.SetSaturationThreshold(saturation)\n\n\tif grayworldwb.GetSaturationThreshold() < 0 {\n\t\tt.Error(\" Invlalid SetSaturationThreshold test\")\n\t}\n}\n\nfunc TestBalanceWhite(t *testing.T) {\n\tgrayworldwb := NewGrayworldWB()\n\tdefer grayworldwb.Close()\n\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tgrayworldwb.BalanceWhite(src, &dst)\n\tif src.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid BalanceWhite test\")\n\t}\n}\n\nfunc TestNewLearningBasedWB(t *testing.T) {\n\n\tlearningbasedwb := NewLearningBasedWB()\n\tdefer learningbasedwb.Close()\n\n\tvalueset := 2\n\tlearningbasedwb.SetHistBinNum(valueset)\n\tlearningbasedwb.SetRangeMaxVal(valueset)\n\tlearningbasedwb.SetSaturationThreshold(float32(valueset))\n\n\tvaluehistbinNum := learningbasedwb.GetHistBinNum()\n\tvaluerangemaxval := learningbasedwb.GetRangeMaxVal()\n\tvaluesaturation := learningbasedwb.GetSaturationThreshold()\n\n\tif valueset != valuehistbinNum {\n\t\tt.Error(\"Invalid TestNewLearningBasedWB : Set/Get HistBinNum test\")\n\t}\n\n\tif valueset != valuerangemaxval {\n\t\tt.Error(\"Invalid TestNewLearningBasedWB : Set/Get RangeMaxVal test\")\n\t}\n\n\tif valuesaturation < 0 {\n\t\tt.Error(\"Invalid TestNewLearningBasedWB : Set/Get SaturationThreshold test\")\n\t}\n}\n\nfunc TestNewSimpleWB(t *testing.T) {\n\n\tsimplewb := NewSimpleWB()\n\tdefer simplewb.Close()\n\n}\n\nfunc TestNewTonemapDurand(t *testing.T) {\n\n\ttonemapdurand := NewTonemapDurand()\n\tdefer tonemapdurand.Close()\n\n\tvar valueset float32 = 2.05\n\n\ttonemapdurand.SetContrast(valueset)\n\ttonemapdurand.SetSaturation(valueset)\n\ttonemapdurand.SetSigmaColor(valueset)\n\ttonemapdurand.SetSigmaSpace(valueset)\n\n\tvaluecontrast := tonemapdurand.GetContrast()\n\tvaluestaturation := tonemapdurand.GetSaturation()\n\tvaluesigmacolor := tonemapdurand.GetSigmaColor()\n\tvaluesigmaspace := tonemapdurand.GetSigmaSpace()\n\n\tif valueset != valuecontrast {\n\t\tt.Error(\"Invalid result TestNewTonemapDurand : Set/Get Contrast test\")\n\t}\n\tif valueset != valuestaturation {\n\t\tt.Error(\"Invalid result TestNewTonemapDurand : Set/Get Saturation test\")\n\t}\n\tif valueset != valuesigmacolor {\n\t\tt.Error(\"Invalid result TestNewTonemapDurand : Set/Get SigmaColor test\")\n\t}\n\tif valueset != valuesigmaspace {\n\t\tt.Error(\"Invalid result TestNewTonemapDurand : Set/Get SigmaSpace test\")\n\t}\n\n\ttonemapdurand.SetGamma(valueset)\n\tvaluegamma := tonemapdurand.GetGamma()\n\n\tif valueset != valuegamma {\n\t\tt.Error(\"Invalid result TestNewTonemapDurand : Set/Get Gamma test\")\n\t}\n\n}\n\nfunc TestTonemapDurandProcess(t *testing.T) {\n\ttonemapdurand := NewTonemapDurand()\n\tdefer tonemapdurand.Close()\n\n\tsrc := gocv.NewMatWithSize(200, 200, gocv.MatTypeCV32FC3)\n\tdefer src.Close()\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\ttonemapdurand.Process(src, &dst)\n\n\tif src.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() || dst.Type() != gocv.MatTypeCV32FC3 {\n\t\tt.Error(\"Invlalid TestTonemapDurandProcess test\")\n\t}\n}\n\nfunc TestOilPainting(t *testing.T) {\n\n\tjpgImageOilPainting := gocv.IMRead(\"../images/space_shuttle.jpg\", gocv.IMReadColor)\n\tif jpgImageOilPainting.Empty() {\n\t\tt.Error(\"Invalid read of Source Mat in TestInpaint test\")\n\t}\n\tdefer jpgImageOilPainting.Close()\n\n\tt.Logf(\"Read of Source Mat in TestOilPainting test : %d x %d\", jpgImageOilPainting.Cols(), jpgImageOilPainting.Rows())\n\n\tsrcOilPainting := gocv.NewMat()\n\tdefer srcOilPainting.Close()\n\tjpgImageOilPainting.ConvertTo(&srcOilPainting, gocv.MatTypeCV8UC3)\n\n\tdstOilPainting := gocv.NewMat()\n\tdefer dstOilPainting.Close()\n\n\tOilPainting(srcOilPainting, &dstOilPainting, 2, 2)\n\n\tt.Logf(\"OilPainting : MAT %d <> %d : %d\", dstOilPainting.Rows(), srcOilPainting.Rows(), dstOilPainting.Type())\n\n\tif srcOilPainting.Empty() || dstOilPainting.Rows() != srcOilPainting.Rows() || dstOilPainting.Cols() != srcOilPainting.Cols() {\n\t\tt.Error(\"Invlalid TestInpaint OilPainting test\")\n\t\treturn\n\t}\n\n\tgocv.IMWrite(\"testOilPainting.png\", dstOilPainting)\n}\n"
  },
  {
    "path": "core.cpp",
    "content": "#include \"core.h\"\n#include <string.h>\n\nint lastException = 0;\nchar lastExceptionMessage[1024];\n\nint GetOpenCVException() {\n    return lastException;\n}\n\nconst char* GetOpenCVExceptionMessage() {\n    return lastExceptionMessage;\n}\n\nvoid ClearOpenCVException() {\n    lastException = 0;\n    strncpy(lastExceptionMessage, \"\", 1024);\n}\n\nvoid setExceptionInfo(int code, const char* message) {\n    lastException = code;\n    strncpy(lastExceptionMessage, message, 1024);\n}\n\nOpenCVResult successResult() {\n    OpenCVResult ri = {0, \"\", 0};\n    return ri;\n}\n\nOpenCVResult errorResult(int code, const char* message) {\n    OpenCVResult ri;\n    ri.Code = code;\n\n    auto res = (char*)malloc(strlen(message)+1);\n    memset(res, 0, strlen(message)+1);\n    memcpy(res, message, strlen(message));\n    ri.Message = res;\n    ri.Length = strlen(message);\n    return ri;\n}\n\n// Mat_New creates a new empty Mat\nMat Mat_New() {\n    return new cv::Mat();\n}\n\n// Mat_NewWithSize creates a new Mat with a specific size dimension and number of channels.\nMat Mat_NewWithSize(int rows, int cols, int type) {\n    return new cv::Mat(rows, cols, type, 0.0);\n}\n\n// Mat_NewWithSizes creates a new Mat with specific dimension sizes and number of channels.\nMat Mat_NewWithSizes(struct IntVector sizes, int type) {\n\tstd::vector<int> sizess;\n    for (int i = 0; i < sizes.length; ++i) {\n        sizess.push_back(sizes.val[i]);\n    }\n    return new cv::Mat(sizess, type);\n}\n\n// Mat_NewFromScalar creates a new Mat from a Scalar. Intended to be used\n// for Mat comparison operation such as InRange.\nMat Mat_NewFromScalar(Scalar ar, int type) {\n    cv::Scalar c = cv::Scalar(ar.val1, ar.val2, ar.val3, ar.val4);\n    return new cv::Mat(1, 1, type, c);\n}\n\n// Mat_NewWithSizeFromScalar creates a new Mat from a Scalar with a specific size dimension and number of channels\nMat Mat_NewWithSizeFromScalar(Scalar ar, int rows, int cols, int type) {\n    cv::Scalar c = cv::Scalar(ar.val1, ar.val2, ar.val3, ar.val4);\n    return new cv::Mat(rows, cols, type, c);\n}\n\nMat Mat_NewFromBytes(int rows, int cols, int type, struct ByteArray buf) {\n    return new cv::Mat(rows, cols, type, buf.data);\n}\n\n// Mat_NewWithSizesFromScalar creates multidimensional Mat from a scalar\nMat Mat_NewWithSizesFromScalar(IntVector sizes, int type, Scalar ar) {\n    std::vector<int> _sizes;\n    for (int i = 0, *v = sizes.val; i < sizes.length; ++v, ++i) {\n        _sizes.push_back(*v);\n    }\n\n    cv::Scalar c = cv::Scalar(ar.val1, ar.val2, ar.val3, ar.val4);\n    return new cv::Mat(_sizes, type, c);\n}\n\n// Mat_NewWithSizesFromBytes creates multidimensional Mat from a bytes\nMat Mat_NewWithSizesFromBytes(IntVector sizes, int type, struct ByteArray buf) {\n    std::vector<int> _sizes;\n    for (int i = 0, *v = sizes.val; i < sizes.length; ++v, ++i) {\n        _sizes.push_back(*v);\n    }\n\n    return new cv::Mat(_sizes, type, buf.data);\n}\n\nMat Mat_NewFromPoint2fVector(Point2fVector pfv, bool copy_data) {\n    return new cv::Mat(*pfv, copy_data);\n}\n\nMat Mat_NewFromPointVector(PointVector pv, bool copy_data) {\n    return new cv::Mat(*pv, copy_data);\n}\n\nMat Eye(int rows, int cols, int type) {\n    try {\n        cv::Mat* mat = new cv::Mat(rows, cols, type);\n        *mat = cv::Mat::eye(rows, cols, type);\n        return mat;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Zeros(int rows, int cols, int type) {\n    try {\n        cv::Mat* mat = new cv::Mat(rows, cols, type);\n        *mat = cv::Mat::zeros(rows, cols, type);\n        return mat;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Ones(int rows, int cols, int type) {\n    try {\n        cv::Mat* mat = new cv::Mat(rows, cols, type);\n        *mat = cv::Mat::ones(rows, cols, type);\n        return mat;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Mat_FromPtr(Mat m, int rows, int cols, int type, int prow, int pcol) {\n    return new cv::Mat(rows, cols, type, m->ptr(prow, pcol));\n}\n\n// Mat_Close deletes an existing Mat\nvoid Mat_Close(Mat m) {\n    delete m;\n}\n\n// Mat_Empty tests if a Mat is empty\nint Mat_Empty(Mat m) {\n    return m->empty();\n}\n\n// Mat_IsContinuous tests if a Mat is continuous\nbool Mat_IsContinuous(Mat m) {\n    return m->isContinuous();\n}\n\nvoid Mat_Inv(Mat m) {\n    m->inv();\n}\n\nMat Mat_Col(Mat m, int c) {\n    return new cv::Mat(m->col(c));\n}\n\nMat Mat_Row(Mat m, int r) {\n    return new cv::Mat(m->row(r));\n}\n\nMat Mat_Copy(Mat m) {\n    return new cv::Mat(*m);\n}\n\n// Mat_Clone returns a clone of this Mat\nMat Mat_Clone(Mat m) {\n    return new cv::Mat(m->clone());\n}\n\n// Mat_CopyTo copies this Mat to another Mat.\nOpenCVResult Mat_CopyTo(Mat m, Mat dst) {\n    try {\n        m->copyTo(*dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// Mat_CopyToWithMask copies this Mat to another Mat while applying the mask\nOpenCVResult Mat_CopyToWithMask(Mat m, Mat dst, Mat mask) {\n    try {\n        m->copyTo(*dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ConvertTo(Mat m, Mat dst, int type) {\n    try {\n        m->convertTo(*dst, type);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ConvertToWithParams(Mat m, Mat dst, int type, float alpha, float beta) {\n    try {\n        m->convertTo(*dst, type, alpha, beta);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// Mat_ToBytes returns the bytes representation of the underlying data.\nstruct ByteArray Mat_ToBytes(Mat m) {\n    return toByteArray(reinterpret_cast<const char*>(m->data), m->total() * m->elemSize());\n}\n\nstruct ByteArray Mat_DataPtr(Mat m) {\n    return ByteArray {reinterpret_cast<char*>(m->data), static_cast<int>(m->total() * m->elemSize())};\n}\n\n// Mat_Region returns a Mat of a region of another Mat\nMat Mat_Region(Mat m, Rect r) {\n    return new cv::Mat(*m, cv::Rect(r.x, r.y, r.width, r.height));\n}\n\nMat Mat_Reshape(Mat m, int cn, int rows) {\n    try {\n        return new cv::Mat(m->reshape(cn, rows));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Mat_ReshapeWithSize(Mat m, int cn, struct IntVector dims) {\n    try {\n        std::vector<int> _dims;\n        for (int i = 0, *v = dims.val; i < dims.length; ++v, ++i) {\n            _dims.push_back(*v);\n        }\n        return new cv::Mat(m->reshape(cn, _dims));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult Mat_PatchNaNs(Mat m) {\n    try {\n        cv::patchNaNs(*m);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat Mat_ConvertFp16(Mat m) {\n    try {\n        Mat dst = new cv::Mat();\n        cv::convertFp16(*m, *dst);\n        return dst;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Mat_Sqrt(Mat m) {\n    try {\n        Mat dst = new cv::Mat();\n        cv::sqrt(*m, *dst);\n        return dst;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\n// Mat_Mean calculates the mean value M of array elements, independently for each channel, and return it as Scalar vector\nScalar Mat_Mean(Mat m) {\n    cv::Scalar c = cv::mean(*m);\n    Scalar scal = Scalar();\n    scal.val1 = c.val[0];\n    scal.val2 = c.val[1];\n    scal.val3 = c.val[2];\n    scal.val4 = c.val[3];\n    return scal;\n}\n\n// Mat_MeanWithMask calculates the mean value M of array elements,\n// independently for each channel, and returns it as Scalar vector\n// while applying the mask.\n\nScalar Mat_MeanWithMask(Mat m, Mat mask){\n    cv::Scalar c = cv::mean(*m, *mask);\n    Scalar scal = Scalar();\n    scal.val1 = c.val[0];\n    scal.val2 = c.val[1];\n    scal.val3 = c.val[2];\n    scal.val4 = c.val[3];\n    return scal;\n}\n\nOpenCVResult LUT(Mat src, Mat lut, Mat dst) {\n    try {\n        cv::LUT(*src, *lut, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n// Mat_Rows returns how many rows in this Mat.\nint Mat_Rows(Mat m) {\n    return m->rows;\n}\n\n// Mat_Cols returns how many columns in this Mat.\nint Mat_Cols(Mat m) {\n    return m->cols;\n}\n\n// Mat_Channels returns how many channels in this Mat.\nint Mat_Channels(Mat m) {\n    return m->channels();\n}\n\n// Mat_Type returns the type from this Mat.\nint Mat_Type(Mat m) {\n    return m->type();\n}\n\n// Mat_Step returns the number of bytes each matrix row occupies.\nint Mat_Step(Mat m) {\n    return m->step;\n}\n\nint Mat_Total(Mat m) {\n    return m->total();\n}\n\nint Mat_ElemSize(Mat m){\n    return m->elemSize();\n}\n\nvoid Mat_Size(Mat m, IntVector* res) {\n    cv::MatSize ms(m->size);\n    int* ids = new int[ms.dims()];\n\n    for (size_t i = 0; i < ms.dims(); ++i) {\n        ids[i] = ms[i];\n    }\n\n    res->length = ms.dims();\n    res->val = ids;\n    return;\n}\n\n// Mat_GetUChar returns a specific row/col value from this Mat expecting\n// each element to contain a schar aka CV_8U.\nuint8_t Mat_GetUChar(Mat m, int row, int col) {\n    return m->at<uchar>(row, col);\n}\n\nuint8_t Mat_GetUChar3(Mat m, int x, int y, int z) {\n    return m->at<uchar>(x, y, z);\n}\n\n// Mat_GetSChar returns a specific row/col value from this Mat expecting\n// each element to contain a schar aka CV_8S.\nint8_t Mat_GetSChar(Mat m, int row, int col) {\n    return m->at<schar>(row, col);\n}\n\nint8_t Mat_GetSChar3(Mat m, int x, int y, int z) {\n    return m->at<schar>(x, y, z);\n}\n\n// Mat_GetShort returns a specific row/col value from this Mat expecting\n// each element to contain a short aka CV_16S.\nint16_t Mat_GetShort(Mat m, int row, int col) {\n    return m->at<short>(row, col);\n}\n\nint16_t Mat_GetShort3(Mat m, int x, int y, int z) {\n    return m->at<short>(x, y, z);\n}\n\n// Mat_GetInt returns a specific row/col value from this Mat expecting\n// each element to contain an int aka CV_32S.\nint32_t Mat_GetInt(Mat m, int row, int col) {\n    return m->at<int>(row, col);\n}\n\nint32_t Mat_GetInt3(Mat m, int x, int y, int z) {\n    return m->at<int>(x, y, z);\n}\n\n// Mat_GetFloat returns a specific row/col value from this Mat expecting\n// each element to contain a float aka CV_32F.\nfloat Mat_GetFloat(Mat m, int row, int col) {\n    return m->at<float>(row, col);\n}\n\nfloat Mat_GetFloat3(Mat m, int x, int y, int z) {\n    return m->at<float>(x, y, z);\n}\n\n// Mat_GetDouble returns a specific row/col value from this Mat expecting\n// each element to contain a double aka CV_64F.\ndouble Mat_GetDouble(Mat m, int row, int col) {\n    return m->at<double>(row, col);\n}\n\ndouble Mat_GetDouble3(Mat m, int x, int y, int z) {\n    return m->at<double>(x, y, z);\n}\n\nvoid Mat_SetTo(Mat m, Scalar value) {\n    cv::Scalar c_value(value.val1, value.val2, value.val3, value.val4);\n    m->setTo(c_value);\n}\n\n// Mat_SetUChar set a specific row/col value from this Mat expecting\n// each element to contain a schar aka CV_8U.\nvoid Mat_SetUChar(Mat m, int row, int col, uint8_t val) {\n    m->at<uchar>(row, col) = val;\n}\n\nvoid Mat_SetUChar3(Mat m, int x, int y, int z, uint8_t val) {\n    m->at<uchar>(x, y, z) = val;\n}\n\n// Mat_SetSChar set a specific row/col value from this Mat expecting\n// each element to contain a schar aka CV_8S.\nvoid Mat_SetSChar(Mat m, int row, int col, int8_t val) {\n    m->at<schar>(row, col) = val;\n}\n\nvoid Mat_SetSChar3(Mat m, int x, int y, int z, int8_t val) {\n    m->at<schar>(x, y, z) = val;\n}\n\n// Mat_SetShort set a specific row/col value from this Mat expecting\n// each element to contain a short aka CV_16S.\nvoid Mat_SetShort(Mat m, int row, int col, int16_t val) {\n    m->at<short>(row, col) = val;\n}\n\nvoid Mat_SetShort3(Mat m, int x, int y, int z, int16_t val) {\n    m->at<short>(x, y, z) = val;\n}\n\n// Mat_SetInt set a specific row/col value from this Mat expecting\n// each element to contain an int aka CV_32S.\nvoid Mat_SetInt(Mat m, int row, int col, int32_t val) {\n    m->at<int>(row, col) = val;\n}\n\nvoid Mat_SetInt3(Mat m, int x, int y, int z, int32_t val) {\n    m->at<int>(x, y, z) = val;\n}\n\n// Mat_SetFloat set a specific row/col value from this Mat expecting\n// each element to contain a float aka CV_32F.\nvoid Mat_SetFloat(Mat m, int row, int col, float val) {\n    m->at<float>(row, col) = val;\n}\n\nvoid Mat_SetFloat3(Mat m, int x, int y, int z, float val) {\n    m->at<float>(x, y, z) = val;\n}\n\n// Mat_SetDouble set a specific row/col value from this Mat expecting\n// each element to contain a double aka CV_64F.\nvoid Mat_SetDouble(Mat m, int row, int col, double val) {\n    m->at<double>(row, col) = val;\n}\n\nvoid Mat_SetDouble3(Mat m, int x, int y, int z, double val) {\n    m->at<double>(x, y, z) = val;\n}\n\nvoid Mat_AddUChar(Mat m, uint8_t val) {\n    *m += val;\n}\n\nvoid Mat_SubtractUChar(Mat m, uint8_t val) {\n    *m -= val;\n}\n\nvoid Mat_MultiplyUChar(Mat m, uint8_t val) {\n    *m *= val;\n}\n\nvoid Mat_DivideUChar(Mat m, uint8_t val) {\n    *m /= val;\n}\n\nvoid Mat_AddFloat(Mat m, float val) {\n    *m += val;\n}\n\nvoid Mat_SubtractFloat(Mat m, float val) {\n    *m -= val;\n}\n\nvoid Mat_MultiplyFloat(Mat m, float val) {\n    *m *= val;\n}\n\nvoid Mat_DivideFloat(Mat m, float val) {\n    *m /= val;\n}\n\nMat Mat_MultiplyMatrix(Mat x, Mat y) {\n    return new cv::Mat((*x) * (*y));\n}\n\nMat Mat_T(Mat x) {\n    try {\n        return new cv::Mat(x->t());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult Mat_AbsDiff(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::absdiff(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Add(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::add(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AddWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat dst) {\n    try {\n        cv::addWeighted(*src1, alpha, *src2, beta, gamma, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseAnd(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::bitwise_and(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseAndWithMask(Mat src1, Mat src2, Mat dst, Mat mask){\n    try {\n        cv::bitwise_and(*src1, *src2, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseNot(Mat src1, Mat dst) {\n    try {\n        cv::bitwise_not(*src1, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseNotWithMask(Mat src1, Mat dst, Mat mask) {\n    try {\n        cv::bitwise_not(*src1, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseOr(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::bitwise_or(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseOrWithMask(Mat src1, Mat src2, Mat dst, Mat mask) {\n    try {\n        cv::bitwise_or(*src1, *src2, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseXor(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::bitwise_xor(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BitwiseXorWithMask(Mat src1, Mat src2, Mat dst, Mat mask) {\n    try {\n        cv::bitwise_xor(*src1, *src2, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_BatchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K,\n                       Mat mask, int update, bool crosscheck) {\n    try {\n        cv::batchDistance(*src1, *src2, *dist, dtype, *nidx, normType, K, *mask, update, crosscheck);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint Mat_BorderInterpolate(int p, int len, int borderType) {\n    try {\n        return cv::borderInterpolate(p, len, borderType);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nOpenCVResult Mat_CalcCovarMatrix(Mat samples, Mat covar, Mat mean, int flags, int ctype) {\n    try {\n        cv::calcCovarMatrix(*samples, *covar, *mean, flags, ctype);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_CartToPolar(Mat x, Mat y, Mat magnitude, Mat angle, bool angleInDegrees) {\n    try {\n        cv::cartToPolar(*x, *y, *magnitude, *angle, angleInDegrees);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool Mat_CheckRange(Mat m) {\n    try {\n        return cv::checkRange(*m);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult Mat_Compare(Mat src1, Mat src2, Mat dst, int ct) {\n    try {\n        cv::compare(*src1, *src2, *dst, ct);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint Mat_CountNonZero(Mat src) {\n    try {\n        return cv::countNonZero(*src);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nOpenCVResult Mat_CompleteSymm(Mat m, bool lowerToUpper) {\n    try {\n        cv::completeSymm(*m, lowerToUpper);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ConvertScaleAbs(Mat src, Mat dst, double alpha, double beta) {\n    try {\n        cv::convertScaleAbs(*src, *dst, alpha, beta);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_CopyMakeBorder(Mat src, Mat dst, int top, int bottom, int left, int right, int borderType,\n                        Scalar value) {\n    try {\n        cv::Scalar c_value(value.val1, value.val2, value.val3, value.val4);\n        cv::copyMakeBorder(*src, *dst, top, bottom, left, right, borderType, c_value);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_DCT(Mat src, Mat dst, int flags) {\n    try {\n        cv::dct(*src, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Mat_Determinant(Mat m) {\n    try {\n        return cv::determinant(*m);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Mat_DFT(Mat m, Mat dst, int flags) {\n    try {\n        cv::dft(*m, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Divide(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::divide(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool Mat_Eigen(Mat src, Mat eigenvalues, Mat eigenvectors) {\n    try {\n        return cv::eigen(*src, *eigenvalues, *eigenvectors);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult Mat_EigenNonSymmetric(Mat src, Mat eigenvalues, Mat eigenvectors) {\n    try {\n        cv::eigenNonSymmetric(*src, *eigenvalues, *eigenvectors);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_PCABackProject(Mat data, Mat mean, Mat eigenvectors, Mat result) {\n    try {\n        cv::PCABackProject(*data, *mean, *eigenvectors, *result);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_PCACompute(Mat src, Mat mean, Mat eigenvectors, Mat eigenvalues, int maxComponents) {\n    try {\n        cv::PCACompute(*src, *mean, *eigenvectors, *eigenvalues, maxComponents);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_PCAProject(Mat data, Mat mean, Mat eigenvectors, Mat result) {\n    try {\n        cv::PCAProject(*data, *mean, *eigenvectors, *result);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble PSNR(Mat src1, Mat src2) {\n    try {\n        return cv::PSNR(*src1, *src2);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult SVBackSubst(Mat w, Mat u, Mat vt, Mat rhs, Mat dst) {\n    try {\n        cv::SVBackSubst(*w, *u, *vt, *rhs, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult SVDecomp(Mat src, Mat w, Mat u, Mat vt) {\n    try {\n        cv::SVDecomp(*src, *w, *u, *vt);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Exp(Mat src, Mat dst) {\n    try {\n        cv::exp(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ExtractChannel(Mat src, Mat dst, int coi) {\n    try {\n        cv::extractChannel(*src, *dst, coi);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_FindNonZero(Mat src, Mat idx) {\n    try {\n        cv::findNonZero(*src, *idx);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Flip(Mat src, Mat dst, int flipCode) {\n    try {\n        cv::flip(*src, *dst, flipCode);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat dst, int flags) {\n    try {\n        cv::gemm(*src1, *src2, alpha, *src3, beta, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint Mat_GetOptimalDFTSize(int vecsize) {\n    try {\n        return cv::getOptimalDFTSize(vecsize);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nOpenCVResult Mat_Hconcat(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::hconcat(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Vconcat(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::vconcat(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Rotate(Mat src, Mat dst, int rotateCode) {\n    try {\n        cv::rotate(*src, *dst, rotateCode);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Idct(Mat src, Mat dst, int flags) {\n    try {\n        cv::idct(*src, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Idft(Mat src, Mat dst, int flags, int nonzeroRows) {\n    try {\n        cv::idft(*src, *dst, flags, nonzeroRows);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_InRange(Mat src, Mat lowerb, Mat upperb, Mat dst) {\n    try {\n        cv::inRange(*src, *lowerb, *upperb, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_InRangeWithScalar(Mat src, Scalar lowerb, Scalar upperb, Mat dst) {\n    try {\n        cv::Scalar lb = cv::Scalar(lowerb.val1, lowerb.val2, lowerb.val3, lowerb.val4);\n        cv::Scalar ub = cv::Scalar(upperb.val1, upperb.val2, upperb.val3, upperb.val4);\n        cv::inRange(*src, lb, ub, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_InsertChannel(Mat src, Mat dst, int coi) {\n    try {\n        cv::insertChannel(*src, *dst, coi);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Mat_Invert(Mat src, Mat dst, int flags) {\n    try {\n        return cv::invert(*src, *dst, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\ndouble KMeans(Mat data, int k, Mat bestLabels, TermCriteria criteria, int attempts, int flags, Mat centers) {\n    try {\n        return cv::kmeans(*data, k, *bestLabels, *criteria, attempts, flags, *centers);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\ndouble KMeansPoints(PointVector points, int k, Mat bestLabels, TermCriteria criteria, int attempts, int flags, Mat centers) {\n    try {\n        std::vector<cv::Point2f> pts;\n        copyPointVectorToPoint2fVector(points, &pts);\n        return cv::kmeans(pts, k, *bestLabels, *criteria, attempts, flags, *centers);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Mat_Log(Mat src, Mat dst) {\n    try {\n        cv::log(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Magnitude(Mat x, Mat y, Mat magnitude) {\n    try {\n        cv::magnitude(*x, *y, *magnitude);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Mat_Mahalanobis(Mat v1, Mat v2, Mat icovar) {\n    try {\n        return cv::Mahalanobis(*v1, *v2, *icovar);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult MulTransposed(Mat src, Mat dest, bool ata) {\n    try {\n        cv::mulTransposed(*src, *dest, ata);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Max(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::max(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MeanStdDev(Mat src, Mat dstMean, Mat dstStdDev) {\n    try {\n        cv::meanStdDev(*src, *dstMean, *dstStdDev);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MeanStdDevWithMask(Mat src, Mat dstMean, Mat dstStdDev, Mat mask) {\n    try {\n        cv::meanStdDev(*src, *dstMean, *dstStdDev, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Merge(struct Mats mats, Mat dst) {\n    try {\n        std::vector<cv::Mat> images;\n\n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n\n        cv::merge(images, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Min(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::min(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MinMaxIdx(Mat m, double* minVal, double* maxVal, int* minIdx, int* maxIdx) {\n    try {\n        cv::minMaxIdx(*m, minVal, maxVal, minIdx, maxIdx);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MinMaxLoc(Mat m, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc) {\n    try {\n        cv::Point cMinLoc;\n        cv::Point cMaxLoc;\n        cv::minMaxLoc(*m, minVal, maxVal, &cMinLoc, &cMaxLoc);\n\n        minLoc->x = cMinLoc.x;\n        minLoc->y = cMinLoc.y;\n        maxLoc->x = cMaxLoc.x;\n        maxLoc->y = cMaxLoc.y;\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MinMaxLocWithMask(Mat m, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc, Mat mask) {\n    try {\n        cv::Point cMinLoc;\n        cv::Point cMaxLoc;\n        cv::minMaxLoc(*m, minVal, maxVal, &cMinLoc, &cMaxLoc, *mask);\n\n        minLoc->x = cMinLoc.x;\n        minLoc->y = cMinLoc.y;\n        maxLoc->x = cMaxLoc.x;\n        maxLoc->y = cMaxLoc.y;\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MixChannels(struct Mats src, struct Mats dst, struct IntVector fromTo) {\n    try {\n        std::vector<cv::Mat> srcMats;\n\n        for (int i = 0; i < src.length; ++i) {\n            srcMats.push_back(*src.mats[i]);\n        }\n\n        std::vector<cv::Mat> dstMats;\n\n        for (int i = 0; i < dst.length; ++i) {\n            dstMats.push_back(*dst.mats[i]);\n        }\n\n        std::vector<int> fromTos;\n\n        for (int i = 0; i < fromTo.length; ++i) {\n            fromTos.push_back(fromTo.val[i]);\n        }\n\n        cv::mixChannels(srcMats, dstMats, fromTos);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MulSpectrums(Mat a, Mat b, Mat c, int flags) {\n    try {\n        cv::mulSpectrums(*a, *b, *c, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Multiply(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::multiply(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_MultiplyWithParams(Mat src1, Mat src2, Mat dst, double scale, int dtype) {\n    try {\n        cv::multiply(*src1, *src2, *dst, scale, dtype);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Normalize(Mat src, Mat dst, double alpha, double beta, int typ) {\n    try {\n        cv::normalize(*src, *dst, alpha, beta, typ);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Norm(Mat src1, int normType) {\n    try {\n        return cv::norm(*src1, normType);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\ndouble NormWithMats(Mat src1, Mat src2, int normType) {\n    try {\n        return cv::norm(*src1, *src2, normType);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Mat_PerspectiveTransform(Mat src, Mat dst, Mat tm) {\n    try {\n        cv::perspectiveTransform(*src, *dst, *tm);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool Mat_Solve(Mat src1, Mat src2, Mat dst, int flags) {\n    try {\n        return cv::solve(*src1, *src2, *dst, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nint Mat_SolveCubic(Mat coeffs, Mat roots) {\n    try {\n        return cv::solveCubic(*coeffs, *roots);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\ndouble Mat_SolvePoly(Mat coeffs, Mat roots, int maxIters) {\n    try {\n        return cv::solvePoly(*coeffs, *roots, maxIters);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Mat_Reduce(Mat src, Mat dst, int dim, int rType, int dType) {\n    try {\n        cv::reduce(*src, *dst, dim, rType, dType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ReduceArgMax(Mat src, Mat dst, int axis, bool lastIndex) {\n    try {\n        cv::reduceArgMax(*src, *dst, axis, lastIndex);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ReduceArgMin(Mat src, Mat dst, int axis, bool lastIndex) {\n    try {\n        cv::reduceArgMin(*src, *dst, axis, lastIndex);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Repeat(Mat src, int nY, int nX, Mat dst) {\n    try {\n        cv::repeat(*src, nY, nX, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_ScaleAdd(Mat src1, double alpha, Mat src2, Mat dst) {\n    try {\n        cv::scaleAdd(*src1, alpha, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_SetIdentity(Mat src, double scalar) {\n    try {\n        cv::setIdentity(*src, scalar);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Sort(Mat src, Mat dst, int flags) {\n    try {\n        cv::sort(*src, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_SortIdx(Mat src, Mat dst, int flags) {\n    try {\n        cv::sortIdx(*src, *dst, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Split(Mat src, struct Mats* mats) {\n    try {\n        std::vector<cv::Mat> channels;\n        cv::split(*src, channels);\n        mats->mats = new Mat[channels.size()];\n\n        for (size_t i = 0; i < channels.size(); ++i) {\n            mats->mats[i] = new cv::Mat(channels[i]);\n        }\n\n        mats->length = (int)channels.size();\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Subtract(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::subtract(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nScalar Mat_Trace(Mat src) {\n    try {\n        cv::Scalar c = cv::trace(*src);\n        Scalar scal = Scalar();\n        scal.val1 = c.val[0];\n        scal.val2 = c.val[1];\n        scal.val3 = c.val[2];\n        scal.val4 = c.val[3];\n        return scal;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return Scalar();\n    }\n}\n\nOpenCVResult Mat_Transform(Mat src, Mat dst, Mat tm) {\n    try {\n        cv::transform(*src, *dst, *tm);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Transpose(Mat src, Mat dst) {\n    try {\n        cv::transpose(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_TransposeND(Mat src, struct IntVector order, Mat dst) {\n    try {\n        std::vector<int> _order;\n        for (int i = 0, *v = order.val; i < order.length; ++v, ++i) {\n            _order.push_back(*v);\n        }\n\n        cv::transposeND(*src, _order, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_PolarToCart(Mat magnitude, Mat degree, Mat x, Mat y, bool angleInDegrees) {\n    try {\n        cv::polarToCart(*magnitude, *degree, *x, *y, angleInDegrees);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Pow(Mat src, double power, Mat dst) {\n    try {\n        cv::pow(*src, power, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Phase(Mat x, Mat y, Mat angle, bool angleInDegrees) {\n    try {\n        cv::phase(*x, *y, *angle, angleInDegrees);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nScalar Mat_Sum(Mat src) {\n    try {\n        cv::Scalar c = cv::sum(*src);\n        Scalar scal = Scalar();\n        scal.val1 = c.val[0];\n        scal.val2 = c.val[1];\n        scal.val3 = c.val[2];\n        scal.val4 = c.val[3];\n        return scal;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return Scalar();\n    }\n}\n\n// TermCriteria_New creates a new TermCriteria\nTermCriteria TermCriteria_New(int typ, int maxCount, double epsilon) {\n    try {\n        return new cv::TermCriteria(typ, maxCount, epsilon);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid Contours_Close(struct Contours cs) {\n    for (int i = 0; i < cs.length; i++) {\n        Points_Close(cs.contours[i]);\n    }\n\n    delete[] cs.contours;\n}\n\nvoid CStrings_Close(struct CStrings cstrs) {\n    for ( int i = 0; i < cstrs.length; i++ ) {\n        delete [] cstrs.strs[i];\n    }\n    delete [] cstrs.strs;\n}\n\nvoid KeyPoints_Close(struct KeyPoints ks) {\n    delete[] ks.keypoints;\n}\n\nvoid Points_Close(Points ps) {\n    for (size_t i = 0; i < ps.length; i++) {\n        Point_Close(ps.points[i]);\n    }\n\n    delete[] ps.points;\n}\n\nvoid Point_Close(Point p) {}\n\nvoid Points2f_Close(Points2f ps) {\n    for (size_t i = 0; i < ps.length; i++) {\n        Point2f_Close(ps.points[i]);\n    }\n\n    delete[] ps.points;\n}\n\nvoid Point2f_Close(Point2f p) {}\n\nvoid Rects_Close(struct Rects rs) {\n    delete[] rs.rects;\n}\n\nvoid DMatches_Close(struct DMatches ds) {\n    delete[] ds.dmatches;\n}\n\nvoid MultiDMatches_Close(struct MultiDMatches mds) {\n    for (size_t i = 0; i < mds.length; i++) {\n        DMatches_Close(mds.dmatches[i]);\n    }\n\n    delete[] mds.dmatches;\n}\n\nstruct DMatches MultiDMatches_get(struct MultiDMatches mds, int index) {\n    return mds.dmatches[index];\n}\n\n// since it is next to impossible to iterate over mats.mats on the cgo side\nMat Mats_get(struct Mats mats, int i) {\n    return mats.mats[i];\n}\n\nvoid Mats_Close(struct Mats mats) {\n    delete[] mats.mats;\n}\n\nvoid ByteArray_Release(struct ByteArray buf) {\n    delete[] buf.data;\n}\n\nstruct ByteArray toByteArray(const char* buf, int len) {\n    ByteArray ret = {new char[len], len};\n    memcpy(ret.data, buf, len);\n    return ret;\n}\n\nint64 GetCVTickCount() {\n    try {\n        return cv::getTickCount();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\ndouble GetTickFrequency() {\n    try {\n        return cv::getTickFrequency();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nMat Mat_rowRange(Mat m,int startrow,int endrow) {\n    try {\n        return new cv::Mat(m->rowRange(startrow,endrow));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Mat_colRange(Mat m,int startrow,int endrow) {\n    try {\n        return new cv::Mat(m->colRange(startrow,endrow));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nPointVector PointVector_New() {\n    return new std::vector< cv::Point >;\n}\n\nPointVector PointVector_NewFromPoints(Contour points) {\n    std::vector<cv::Point>* cntr = new std::vector<cv::Point>;\n\n    for (size_t i = 0; i < points.length; i++) {\n        cntr->push_back(cv::Point(points.points[i].x, points.points[i].y));\n    }\n\n    return cntr;\n}\n\nPointVector PointVector_NewFromMat(Mat mat) {\n    std::vector<cv::Point>* pts = new std::vector<cv::Point>;\n    *pts = (std::vector<cv::Point>) *mat;\n    return pts;\n}\n\nPoint PointVector_At(PointVector pv, int idx) {\n    cv::Point p = pv->at(idx);\n    return Point{.x = p.x, .y = p.y};\n}\n\nvoid PointVector_Append(PointVector pv, Point p) {\n    pv->push_back(cv::Point(p.x, p.y));\n}\n\nint PointVector_Size(PointVector p) {\n    return p->size();\n}\n\nvoid PointVector_Close(PointVector p) {\n    p->clear();\n    delete p;\n}\n\nPointsVector PointsVector_New() {\n    return new std::vector< std::vector< cv::Point > >;\n}\n\nPointsVector PointsVector_NewFromPoints(Contours points) {\n    std::vector< std::vector< cv::Point > >* pv = new std::vector< std::vector< cv::Point > >;\n\n    for (size_t i = 0; i < points.length; i++) {\n        Contour contour = points.contours[i];\n\n        std::vector<cv::Point> cntr;\n\n        for (size_t i = 0; i < contour.length; i++) {\n            cntr.push_back(cv::Point(contour.points[i].x, contour.points[i].y));\n        }\n\n        pv->push_back(cntr);\n    }\n\n    return pv;\n}\n\nint PointsVector_Size(PointsVector ps) {\n    return ps->size();\n}\n\nPointVector PointsVector_At(PointsVector ps, int idx) {\n    std::vector< cv::Point >* p = &(ps->at(idx));\n    return p;\n}\n\nvoid PointsVector_Append(PointsVector psv, PointVector pv) {\n    psv->push_back(*pv);\n}\n\nvoid PointsVector_Close(PointsVector ps) {\n    ps->clear();\n    delete ps;\n}\n\nPoint2fVector Point2fVector_New() {\n    return new std::vector< cv::Point2f >;\n}\n\nPoint2fVector Point2fVector_NewFromPoints(Contour2f points) {\n    std::vector<cv::Point2f>* cntr = new std::vector<cv::Point2f>;\n\n    for (size_t i = 0; i < points.length; i++) {\n        cntr->push_back(cv::Point2f(points.points[i].x, points.points[i].y));\n    }\n\n    return cntr;\n}\n\nPoint2fVector Point2fVector_NewFromMat(Mat mat) {\n    std::vector<cv::Point2f>* pts = new std::vector<cv::Point2f>;\n    *pts = (std::vector<cv::Point2f>) *mat;\n    return pts;\n}\n\nPoint2f Point2fVector_At(Point2fVector pfv, int idx) {\n    cv::Point2f p = pfv->at(idx);\n    return Point2f{.x = p.x, .y = p.y};\n}\n\nint Point2fVector_Size(Point2fVector pfv) {\n    return pfv->size();\n}\n\nvoid Point2fVector_Close(Point2fVector pv) {\n    pv->clear();\n    delete pv;\n}\n\n\nvoid IntVector_Close(struct IntVector ivec) {\n    delete[] ivec.val;\n}\n\nRNG TheRNG() {\n    return &cv::theRNG();\n}\n\nvoid SetRNGSeed(int seed) {\n    cv::setRNGSeed(seed);\n}\n\nvoid RNG_Fill(RNG rng, Mat mat, int distType, double a, double b, bool saturateRange) {\n    try {\n        rng->fill(*mat, distType, a, b, saturateRange);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\ndouble RNG_Gaussian(RNG rng, double sigma) {\n    try {\n        return rng->gaussian(sigma);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nunsigned int RNG_Next(RNG rng) {\n    try {\n        return rng->next();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nvoid RandN(Mat mat, Scalar mean, Scalar stddev) {\n    try {\n        cv::Scalar m = cv::Scalar(mean.val1, mean.val2, mean.val3, mean.val4);\n        cv::Scalar s = cv::Scalar(stddev.val1, stddev.val2, stddev.val3, stddev.val4);\n        cv::randn(*mat, m, s);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid RandShuffle(Mat mat) {\n    try {\n        cv::randShuffle(*mat);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid RandShuffleWithParams(Mat mat, double iterFactor, RNG rng) {\n    try {\n        cv::randShuffle(*mat, iterFactor, rng);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid RandU(Mat mat, Scalar low, Scalar high) {\n    try {\n        cv::Scalar l = cv::Scalar(low.val1, low.val2, low.val3, low.val4);\n        cv::Scalar h = cv::Scalar(high.val1, high.val2, high.val3, high.val4);\n        cv::randn(*mat, l, h);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid copyPointVectorToPoint2fVector(PointVector src, Point2fVector dest) {\n    for (size_t i = 0; i < src->size(); i++) {\n        dest->push_back(cv::Point2f(src->at(i).x, src->at(i).y));\n    }\n}\n\nvoid StdByteVectorInitialize(void* data) {\n    new (data) std::vector<uchar>();\n}\n\nvoid StdByteVectorFree(void *data) {\n    reinterpret_cast<std::vector<uchar> *>(data)->~vector<uchar>();\n}\n\nsize_t StdByteVectorLen(void *data) {\n    return reinterpret_cast<std::vector<uchar> *>(data)->size();\n}\n\nuint8_t* StdByteVectorData(void *data) {\n    return reinterpret_cast<std::vector<uchar> *>(data)->data();\n}\n\nPoints2fVector Points2fVector_New(){\n    return new std::vector< std::vector< cv::Point2f > >;\n}\n\nPoints2fVector Points2fVector_NewFromPoints(Contours2f points) {\n    Points2fVector pv = Points2fVector_New();\n    for(size_t i = 0;i<points.length;i++){\n        Contour2f contour2f = points.contours[i];\n        Point2fVector cntr = Point2fVector_NewFromPoints(contour2f);\n        Points2fVector_Append(pv, cntr);\n    }\n\n    return pv;\n}\n\nint Points2fVector_Size(Points2fVector ps) {\n    return ps->size();\n}\n\nPoint2fVector Points2fVector_At(Points2fVector ps, int idx) {\n    return &(ps->at(idx));\n}\n\nvoid Points2fVector_Append(Points2fVector psv, Point2fVector pv) {\n    psv->push_back(*pv);\n}\n\nvoid Points2fVector_Close(Points2fVector ps) {\n    ps->clear();\n    delete ps;\n}\n\nPoint3fVector Point3fVector_New() {\n    return new std::vector< cv::Point3f >;\n}\n\n\nPoint3fVector Point3fVector_NewFromPoints(Contour3f points) {\n    std::vector<cv::Point3f> *cntr = new std::vector<cv::Point3f>;\n    for(size_t i = 0;i< points.length;i++) {\n        cntr->push_back(cv::Point3f(\n            points.points[i].x,\n            points.points[i].y,\n            points.points[i].z\n        ));\n    }\n\n    return cntr;\n}\n\nPoint3fVector Point3fVector_NewFromMat(Mat mat) {\n    std::vector<cv::Point3f> *pts = new std::vector<cv::Point3f>;\n    *pts = (std::vector<cv::Point3f>) *mat;\n    return pts;\n}\n\nPoint3f Point3fVector_At(Point3fVector pfv, int idx) {\n    cv::Point3f p = pfv->at(idx);\n    return Point3f{\n        .x = p.x,\n        .y = p.y,\n        .z = p.z\n    };\n}\n\nvoid Point3fVector_Append(Point3fVector pfv, Point3f point) {\n    pfv->push_back(cv::Point3f(point.x, point.y, point.z));\n}\n\nint Point3fVector_Size(Point3fVector pfv) {\n    return pfv->size();\n}\n\nvoid Point3fVector_Close(Point3fVector pv) {\n    pv->clear();\n    delete pv;\n}\n\nPoints3fVector Points3fVector_New(){\n    return new std::vector< std::vector< cv::Point3f > >;\n}\n\nPoints3fVector Points3fVector_NewFromPoints(Contours3f points) {\n    Points3fVector pv = Points3fVector_New();\n    for(size_t i = 0;i<points.length;i++){\n        Contour3f contour3f = points.contours[i];\n        Point3fVector cntr = Point3fVector_NewFromPoints(contour3f);\n        Points3fVector_Append(pv, cntr);\n    }\n\n    return pv;\n}\n\nint Points3fVector_Size(Points3fVector ps) {\n    return ps->size();\n}\n\nPoint3fVector Points3fVector_At(Points3fVector ps, int idx) {\n    return &(ps->at(idx));\n}\n\nvoid Points3fVector_Append(Points3fVector psv, Point3fVector pv) {\n    psv->push_back(*pv);\n}\n\nvoid Points3fVector_Close(Points3fVector ps) {\n    ps->clear();\n    delete ps;\n}\n\nvoid SetNumThreads(int n) {\n    cv::setNumThreads(n);\n}\n\nint GetNumThreads() {\n    return cv::getNumThreads();\n}\n\nstruct RotatedRect RotatedRect_Create(struct Point2f center, int width, int height, float angle){\n\n    cv::Point2f cvpoint2f = cv::Point2f(center.x, center.y);\n    cv::Size2f cvsize2f = cv::Size2f(width, height);\n\n    cv::RotatedRect cvrect = cv::RotatedRect(cvpoint2f, cvsize2f, angle);\n\n    Point* rpts = new Point[4];\n    cv::Point2f* pts4 = new cv::Point2f[4];\n    cvrect.points(pts4);\n\n    for (size_t j = 0; j < 4; j++) {\n        Point pt = {int(lroundf(pts4[j].x)), int(lroundf(pts4[j].y))};\n        rpts[j] = pt;\n    }\n\n    delete[] pts4;\n\n    cv::Rect bRect = cvrect.boundingRect();\n    Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n    Point centrpt = {int(lroundf(cvrect.center.x)), int(lroundf(cvrect.center.y))};\n    Size szsz = {int(lroundf(cvrect.size.width)), int(lroundf(cvrect.size.height))};\n\n    RotatedRect retrect = {(Contour){rpts, 4}, r, centrpt, szsz, cvrect.angle};\n    return retrect;\n}\n\nstruct RotatedRect2f RotatedRect2f_Create(struct Point2f center, float width, float height, float angle){\n\n    cv::Point2f cvpoint2f = cv::Point2f(center.x, center.y);\n    cv::Size2f cvsize2f = cv::Size2f(width, height);\n\n    cv::RotatedRect cvrect = cv::RotatedRect(cvpoint2f, cvsize2f, angle);\n\n    Point2f* rpts = new Point2f[4];\n    cv::Point2f* pts4 = new cv::Point2f[4];\n    cvrect.points(pts4);\n\n    for (size_t j = 0; j < 4; j++) {\n        Point2f pt = {pts4[j].x, pts4[j].y};\n        rpts[j] = pt;\n    }\n\n    delete[] pts4;\n\n    cv::Rect bRect = cvrect.boundingRect();\n    Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n    Point2f centrpt = {cvrect.center.x, cvrect.center.y};\n    Size2f szsz = {cvrect.size.width, cvrect.size.height};\n\n    RotatedRect2f retrect = {(Contour2f){rpts, 4}, r, centrpt, szsz, cvrect.angle};\n    return retrect;\n}\n"
  },
  {
    "path": "core.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include \"core.h\"\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"image\"\n\t\"image/color\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// GetLastException returns the last exception code from the OpenCV library.\nfunc GetLastException() int {\n\treturn int(C.GetOpenCVException())\n}\n\n// GetLastExceptionMessage returns the last exception message from the OpenCV library.\nfunc GetLastExceptionMessage() string {\n\treturn C.GoString(C.GetOpenCVExceptionMessage())\n}\n\n// ClearLastException clears the last exception from the OpenCV library.\nfunc ClearLastException() {\n\tC.ClearOpenCVException()\n}\n\n// LastExceptionError returns an error if there was an exception in the OpenCV library.\nfunc LastExceptionError() error {\n\tif GetLastException() == 0 {\n\t\treturn nil\n\t}\n\tdefer ClearLastException()\n\n\treturn errors.New(GetLastExceptionMessage())\n}\n\n// Converts a OpenCVResult struct to an error.\nfunc OpenCVResult(result C.OpenCVResult) error {\n\tif result.Code == 0 {\n\t\treturn nil\n\t}\n\tif result.Message == nil {\n\t\treturn errors.New(\"unknown openCV error\")\n\t}\n\tdefer C.free(unsafe.Pointer(result.Message))\n\treturn errors.New(C.GoString(result.Message))\n}\n\nconst (\n\t// MatChannels1 is a single channel Mat.\n\tMatChannels1 = 0\n\n\t// MatChannels2 is 2 channel Mat.\n\tMatChannels2 = 8\n\n\t// MatChannels3 is 3 channel Mat.\n\tMatChannels3 = 16\n\n\t// MatChannels4 is 4 channel Mat.\n\tMatChannels4 = 24\n)\n\n// MatType is the type for the various different kinds of Mat you can create.\ntype MatType int\n\nconst (\n\t// MatTypeCV8U is a Mat of 8-bit unsigned int\n\tMatTypeCV8U MatType = 0\n\n\t// MatTypeCV8S is a Mat of 8-bit signed int\n\tMatTypeCV8S MatType = 1\n\n\t// MatTypeCV16U is a Mat of 16-bit unsigned int\n\tMatTypeCV16U MatType = 2\n\n\t// MatTypeCV16S is a Mat of 16-bit signed int\n\tMatTypeCV16S MatType = 3\n\n\t// MatTypeCV16SC2 is a Mat of 16-bit signed int with 2 channels\n\tMatTypeCV16SC2 = MatTypeCV16S + MatChannels2\n\n\t// MatTypeCV32S is a Mat of 32-bit signed int\n\tMatTypeCV32S MatType = 4\n\n\t// MatTypeCV32F is a Mat of 32-bit float\n\tMatTypeCV32F MatType = 5\n\n\t// MatTypeCV64F is a Mat of 64-bit float\n\tMatTypeCV64F MatType = 6\n\n\t// MatTypeCV16F is a Mat of 16-bit (half) float\n\tMatTypeCV16F MatType = 7\n\n\t// MatTypeCV8UC1 is a Mat of 8-bit unsigned int with a single channel\n\tMatTypeCV8UC1 = MatTypeCV8U + MatChannels1\n\n\t// MatTypeCV8UC2 is a Mat of 8-bit unsigned int with 2 channels\n\tMatTypeCV8UC2 = MatTypeCV8U + MatChannels2\n\n\t// MatTypeCV8UC3 is a Mat of 8-bit unsigned int with 3 channels\n\tMatTypeCV8UC3 = MatTypeCV8U + MatChannels3\n\n\t// MatTypeCV8UC4 is a Mat of 8-bit unsigned int with 4 channels\n\tMatTypeCV8UC4 = MatTypeCV8U + MatChannels4\n\n\t// MatTypeCV8SC1 is a Mat of 8-bit signed int with a single channel\n\tMatTypeCV8SC1 = MatTypeCV8S + MatChannels1\n\n\t// MatTypeCV8SC2 is a Mat of 8-bit signed int with 2 channels\n\tMatTypeCV8SC2 = MatTypeCV8S + MatChannels2\n\n\t// MatTypeCV8SC3 is a Mat of 8-bit signed int with 3 channels\n\tMatTypeCV8SC3 = MatTypeCV8S + MatChannels3\n\n\t// MatTypeCV8SC4 is a Mat of 8-bit signed int with 4 channels\n\tMatTypeCV8SC4 = MatTypeCV8S + MatChannels4\n\n\t// MatTypeCV16UC1 is a Mat of 16-bit unsigned int with a single channel\n\tMatTypeCV16UC1 = MatTypeCV16U + MatChannels1\n\n\t// MatTypeCV16UC2 is a Mat of 16-bit unsigned int with 2 channels\n\tMatTypeCV16UC2 = MatTypeCV16U + MatChannels2\n\n\t// MatTypeCV16UC3 is a Mat of 16-bit unsigned int with 3 channels\n\tMatTypeCV16UC3 = MatTypeCV16U + MatChannels3\n\n\t// MatTypeCV16UC4 is a Mat of 16-bit unsigned int with 4 channels\n\tMatTypeCV16UC4 = MatTypeCV16U + MatChannels4\n\n\t// MatTypeCV16SC1 is a Mat of 16-bit signed int with a single channel\n\tMatTypeCV16SC1 = MatTypeCV16S + MatChannels1\n\n\t// MatTypeCV16SC3 is a Mat of 16-bit signed int with 3 channels\n\tMatTypeCV16SC3 = MatTypeCV16S + MatChannels3\n\n\t// MatTypeCV16SC4 is a Mat of 16-bit signed int with 4 channels\n\tMatTypeCV16SC4 = MatTypeCV16S + MatChannels4\n\n\t// MatTypeCV32SC1 is a Mat of 32-bit signed int with a single channel\n\tMatTypeCV32SC1 = MatTypeCV32S + MatChannels1\n\n\t// MatTypeCV32SC2 is a Mat of 32-bit signed int with 2 channels\n\tMatTypeCV32SC2 = MatTypeCV32S + MatChannels2\n\n\t// MatTypeCV32SC3 is a Mat of 32-bit signed int with 3 channels\n\tMatTypeCV32SC3 = MatTypeCV32S + MatChannels3\n\n\t// MatTypeCV32SC4 is a Mat of 32-bit signed int with 4 channels\n\tMatTypeCV32SC4 = MatTypeCV32S + MatChannels4\n\n\t// MatTypeCV32FC1 is a Mat of 32-bit float int with a single channel\n\tMatTypeCV32FC1 = MatTypeCV32F + MatChannels1\n\n\t// MatTypeCV32FC2 is a Mat of 32-bit float int with 2 channels\n\tMatTypeCV32FC2 = MatTypeCV32F + MatChannels2\n\n\t// MatTypeCV32FC3 is a Mat of 32-bit float int with 3 channels\n\tMatTypeCV32FC3 = MatTypeCV32F + MatChannels3\n\n\t// MatTypeCV32FC4 is a Mat of 32-bit float int with 4 channels\n\tMatTypeCV32FC4 = MatTypeCV32F + MatChannels4\n\n\t// MatTypeCV64FC1 is a Mat of 64-bit float int with a single channel\n\tMatTypeCV64FC1 = MatTypeCV64F + MatChannels1\n\n\t// MatTypeCV64FC2 is a Mat of 64-bit float int with 2 channels\n\tMatTypeCV64FC2 = MatTypeCV64F + MatChannels2\n\n\t// MatTypeCV64FC3 is a Mat of 64-bit float int with 3 channels\n\tMatTypeCV64FC3 = MatTypeCV64F + MatChannels3\n\n\t// MatTypeCV64FC4 is a Mat of 64-bit float int with 4 channels\n\tMatTypeCV64FC4 = MatTypeCV64F + MatChannels4\n\n\t// MatTypeCV16FC1 is a Mat of 16-bit float with a single channel\n\tMatTypeCV16FC1 = MatTypeCV16F + MatChannels1\n\n\t// MatTypeCV16FC2 is a Mat of 16-bit float with 2 channels\n\tMatTypeCV16FC2 = MatTypeCV16F + MatChannels2\n\n\t// MatTypeCV16FC3 is a Mat of 16-bit float with 3 channels\n\tMatTypeCV16FC3 = MatTypeCV16F + MatChannels3\n\n\t// MatTypeCV16FC4 is a Mat of 16-bit float with 4 channels\n\tMatTypeCV16FC4 = MatTypeCV16F + MatChannels4\n)\n\n// CompareType is used for Compare operations to indicate which kind of\n// comparison to use.\ntype CompareType int\n\nconst (\n\t// CompareEQ src1 is equal to src2.\n\tCompareEQ CompareType = 0\n\n\t// CompareGT src1 is greater than src2.\n\tCompareGT CompareType = 1\n\n\t// CompareGE src1 is greater than or equal to src2.\n\tCompareGE CompareType = 2\n\n\t// CompareLT src1 is less than src2.\n\tCompareLT CompareType = 3\n\n\t// CompareLE src1 is less than or equal to src2.\n\tCompareLE CompareType = 4\n\n\t// CompareNE src1 is unequal to src2.\n\tCompareNE CompareType = 5\n)\n\ntype Point2f struct {\n\tX float32\n\tY float32\n}\n\nfunc NewPoint2f(x, y float32) Point2f {\n\treturn Point2f{x, y}\n}\n\nvar ErrEmptyByteSlice = errors.New(\"empty byte array\")\n\n// Mat represents an n-dimensional dense numerical single-channel\n// or multi-channel array. It can be used to store real or complex-valued\n// vectors and matrices, grayscale or color images, voxel volumes,\n// vector fields, point clouds, tensors, and histograms.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html\ntype Mat struct {\n\tp C.Mat\n\n\t// Non-nil if Mat was created with a []byte (using NewMatFromBytes()). Nil otherwise.\n\td []byte\n}\n\n// NewMat returns a new empty Mat.\nfunc NewMat() Mat {\n\treturn newMat(C.Mat_New())\n}\n\n// NewMatFromCMat returns a new Mat from an unsafe.Pointer(C.Mat).\nfunc NewMatFromCMat(c_mat unsafe.Pointer) Mat {\n\treturn newMat(C.Mat(c_mat))\n}\n\n// NewMatWithSize returns a new Mat with a specific size and type.\nfunc NewMatWithSize(rows int, cols int, mt MatType) Mat {\n\treturn newMat(C.Mat_NewWithSize(C.int(rows), C.int(cols), C.int(mt)))\n}\n\n// NewMatWithSizes returns a new multidimensional Mat with a specific size and type.\nfunc NewMatWithSizes(sizes []int, mt MatType) Mat {\n\tsizesArray := make([]C.int, len(sizes))\n\tfor i, s := range sizes {\n\t\tsizesArray[i] = C.int(s)\n\t}\n\n\tsizesIntVector := C.IntVector{\n\t\tval:    (*C.int)(&sizesArray[0]),\n\t\tlength: C.int(len(sizes)),\n\t}\n\treturn newMat(C.Mat_NewWithSizes(sizesIntVector, C.int(mt)))\n}\n\n// NewMatWithSizesWithScalar returns a new multidimensional Mat with a specific size, type and scalar value.\nfunc NewMatWithSizesWithScalar(sizes []int, mt MatType, s Scalar) Mat {\n\tcsizes := []C.int{}\n\tfor _, v := range sizes {\n\t\tcsizes = append(csizes, C.int(v))\n\t}\n\tsizesVector := C.struct_IntVector{}\n\tsizesVector.val = (*C.int)(&csizes[0])\n\tsizesVector.length = (C.int)(len(csizes))\n\n\tsVal := C.struct_Scalar{\n\t\tval1: C.double(s.Val1),\n\t\tval2: C.double(s.Val2),\n\t\tval3: C.double(s.Val3),\n\t\tval4: C.double(s.Val4),\n\t}\n\n\treturn newMat(C.Mat_NewWithSizesFromScalar(sizesVector, C.int(mt), sVal))\n}\n\n// NewMatWithSizesFromBytes returns a new multidimensional Mat with a specific size, type and preexisting data.\nfunc NewMatWithSizesFromBytes(sizes []int, mt MatType, data []byte) (Mat, error) {\n\tcBytes, err := toByteArray(data)\n\tif err != nil {\n\t\treturn Mat{}, err\n\t}\n\n\tcsizes := []C.int{}\n\tfor _, v := range sizes {\n\t\tcsizes = append(csizes, C.int(v))\n\t}\n\tsizesVector := C.struct_IntVector{}\n\tsizesVector.val = (*C.int)(&csizes[0])\n\tsizesVector.length = (C.int)(len(csizes))\n\n\treturn newMat(C.Mat_NewWithSizesFromBytes(sizesVector, C.int(mt), *cBytes)), nil\n}\n\n// NewMatFromScalar returns a new Mat for a specific Scalar value\nfunc NewMatFromScalar(s Scalar, mt MatType) Mat {\n\tsVal := C.struct_Scalar{\n\t\tval1: C.double(s.Val1),\n\t\tval2: C.double(s.Val2),\n\t\tval3: C.double(s.Val3),\n\t\tval4: C.double(s.Val4),\n\t}\n\n\treturn newMat(C.Mat_NewFromScalar(sVal, C.int(mt)))\n}\n\n// NewMatWithSizeFromScalar returns a new Mat for a specific Scala value with a specific size and type\n// This simplifies creation of specific color filters or creating Mats of specific colors and sizes\nfunc NewMatWithSizeFromScalar(s Scalar, rows int, cols int, mt MatType) Mat {\n\tsVal := C.struct_Scalar{\n\t\tval1: C.double(s.Val1),\n\t\tval2: C.double(s.Val2),\n\t\tval3: C.double(s.Val3),\n\t\tval4: C.double(s.Val4),\n\t}\n\n\treturn newMat(C.Mat_NewWithSizeFromScalar(sVal, C.int(rows), C.int(cols), C.int(mt)))\n}\n\n// NewMatFromBytes returns a new Mat with a specific size and type, initialized from a []byte.\nfunc NewMatFromBytes(rows int, cols int, mt MatType, data []byte) (Mat, error) {\n\tcBytes, err := toByteArray(data)\n\tif err != nil {\n\t\treturn Mat{}, err\n\t}\n\tmat := newMat(C.Mat_NewFromBytes(C.int(rows), C.int(cols), C.int(mt), *cBytes))\n\n\t// Store a reference to the backing data slice. This is needed because we pass the backing\n\t// array directly to C code and without keeping a Go reference to it, it might end up\n\t// garbage collected which would result in crashes.\n\t//\n\t// TODO(bga): This could live in newMat() but I wanted to reduce the change surface.\n\t// TODO(bga): Code that needs access to the array from Go could use this directly.\n\tmat.d = data\n\n\treturn mat, nil\n}\n\n// NewMatFromPoint2fVector returns a new Mat from a gocv.Point2fVector.\nfunc NewMatFromPoint2fVector(pfv Point2fVector, copyData bool) Mat {\n\tmat := newMat(C.Mat_NewFromPoint2fVector(pfv.p, C.bool(copyData)))\n\treturn mat\n}\n\n// NewMatFromPointVector returns a new Mat from a gocv.PointVector.\nfunc NewMatFromPointVector(pv PointVector, copyData bool) Mat {\n\tmat := newMat(C.Mat_NewFromPointVector(pv.p, C.bool(copyData)))\n\treturn mat\n}\n\n// Returns an identity matrix of the specified size and type.\n//\n// The method returns a Matlab-style identity matrix initializer, similarly to Mat::zeros. Similarly to Mat::ones.\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a2cf9b9acde7a9852542bbc20ef851ed2\nfunc Eye(rows int, cols int, mt MatType) Mat {\n\treturn newMat(C.Eye(C.int(rows), C.int(cols), C.int(mt)))\n}\n\n// Returns a zero array of the specified size and type.\n//\n// The method returns a Matlab-style zero array initializer.\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a0b57b6a326c8876d944d188a46e0f556\nfunc Zeros(rows int, cols int, mt MatType) Mat {\n\treturn newMat(C.Zeros(C.int(rows), C.int(cols), C.int(mt)))\n}\n\n// Returns an array of all 1's of the specified size and type.\n//\n// The method returns a Matlab-style 1's array initializer\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a69ae0402d116fc9c71908d8508dc2f09\nfunc Ones(rows int, cols int, mt MatType) Mat {\n\treturn newMat(C.Ones(C.int(rows), C.int(cols), C.int(mt)))\n}\n\n// FromPtr returns a new Mat with a specific size and type, initialized from a Mat Ptr.\nfunc (m *Mat) FromPtr(rows int, cols int, mt MatType, prow int, pcol int) (Mat, error) {\n\treturn newMat(C.Mat_FromPtr(m.p, C.int(rows), C.int(cols), C.int(mt), C.int(prow), C.int(pcol))), nil\n}\n\n// Ptr returns the Mat's underlying object pointer.\nfunc (m *Mat) Ptr() C.Mat {\n\treturn m.p\n}\n\n// Empty determines if the Mat is empty or not.\nfunc (m *Mat) Empty() bool {\n\tisEmpty := C.Mat_Empty(m.p)\n\treturn isEmpty != 0\n}\n\n// Closed determines if the Mat is closed or not.\nfunc (m *Mat) Closed() bool {\n\treturn m.p == nil\n}\n\n// IsContinuous determines if the Mat is continuous.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa90cea495029c7d1ee0a41361ccecdf3\nfunc (m *Mat) IsContinuous() bool {\n\treturn bool(C.Mat_IsContinuous(m.p))\n}\n\n// Inv inverses a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a039eb3c6740a850696a12519a4b8bfc6\nfunc (m *Mat) Inv() {\n\tC.Mat_Inv(m.p)\n}\n\n// Col creates a matrix header for the specified matrix column.\n// The underlying data of the new matrix is shared with the original matrix.\nfunc (m *Mat) Col(col int) Mat {\n\treturn newMat(C.Mat_Col(m.p, C.int(col)))\n}\n\n// Row creates a matrix header for the specified matrix row.\n// The underlying data of the new matrix is shared with the original matrix.\nfunc (m *Mat) Row(row int) Mat {\n\treturn newMat(C.Mat_Row(m.p, C.int(row)))\n}\n\n// Copy returns a shallow copy of the Mat. No data is copied.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a294eaf8a95d2f9c7be19ff594d06278e\nfunc (m *Mat) Copy() Mat {\n\treturn Mat{\n\t\tp: C.Mat_Copy(m.p),\n\t\td: m.d,\n\t}\n}\n\n// Clone returns a cloned full copy of the Mat.\nfunc (m *Mat) Clone() Mat {\n\treturn newMat(C.Mat_Clone(m.p))\n}\n\n// CopyTo copies Mat into destination Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a33fd5d125b4c302b0c9aa86980791a77\nfunc (m *Mat) CopyTo(dst *Mat) error {\n\treturn OpenCVResult(C.Mat_CopyTo(m.p, dst.p))\n}\n\n// CopyToWithMask copies Mat into destination Mat after applying the mask Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a626fe5f96d02525e2604d2ad46dd574f\nfunc (m *Mat) CopyToWithMask(dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_CopyToWithMask(m.p, dst.p, mask.p))\n}\n\n// ConvertTo converts Mat into destination Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#adf88c60c5b4980e05bb556080916978b\nfunc (m *Mat) ConvertTo(dst *Mat, mt MatType) error {\n\treturn OpenCVResult(C.Mat_ConvertTo(m.p, dst.p, C.int(mt)))\n}\n\nfunc (m *Mat) ConvertToWithParams(dst *Mat, mt MatType, alpha, beta float32) error {\n\treturn OpenCVResult(C.Mat_ConvertToWithParams(m.p, dst.p, C.int(mt), C.float(alpha), C.float(beta)))\n}\n\n// Total returns the total number of array elements.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa4d317d43fb0cba9c2503f3c61b866c8\nfunc (m *Mat) Total() int {\n\treturn int(C.Mat_Total(m.p))\n}\n\n// Size returns an array with one element for each dimension containing the size of that dimension for the Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa4d317d43fb0cba9c2503f3c61b866c8\nfunc (m *Mat) Size() (dims []int) {\n\tcdims := C.IntVector{}\n\tC.Mat_Size(m.p, &cdims)\n\tdefer C.IntVector_Close(cdims)\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cdims.val)),\n\t\tLen:  int(cdims.length),\n\t\tCap:  int(cdims.length),\n\t}\n\tpdims := *(*[]C.int)(unsafe.Pointer(h))\n\n\tfor i := 0; i < int(cdims.length); i++ {\n\t\tdims = append(dims, int(pdims[i]))\n\t}\n\treturn\n}\n\n// ToBytes copies the underlying Mat data to a byte array.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.3.1/d3/d63/classcv_1_1Mat.html#a4d33bed1c850265370d2af0ff02e1564\nfunc (m *Mat) ToBytes() []byte {\n\tb := C.Mat_DataPtr(m.p)\n\treturn toGoBytes(b)\n}\n\n// DataPtrUint8 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrUint8() ([]uint8, error) {\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrUint8 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length),\n\t\tCap:  int(p.length),\n\t}\n\treturn *(*[]uint8)(unsafe.Pointer(h)), nil\n}\n\n// DataPtrInt8 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrInt8() ([]int8, error) {\n\tif m.Type()&MatTypeCV8S != MatTypeCV8S {\n\t\treturn nil, errors.New(\"DataPtrInt8 only supports MatTypeCV8S\")\n\t}\n\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrInt8 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length),\n\t\tCap:  int(p.length),\n\t}\n\treturn *(*[]int8)(unsafe.Pointer(h)), nil\n}\n\n// DataPtrUint16 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrUint16() ([]uint16, error) {\n\tif m.Type()&MatTypeCV16U != MatTypeCV16U {\n\t\treturn nil, errors.New(\"DataPtrUint16 only supports MatTypeCV16U\")\n\t}\n\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrUint16 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length) / 2,\n\t\tCap:  int(p.length) / 2,\n\t}\n\treturn *(*[]uint16)(unsafe.Pointer(h)), nil\n}\n\n// DataPtrInt16 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrInt16() ([]int16, error) {\n\tif m.Type()&MatTypeCV16S != MatTypeCV16S {\n\t\treturn nil, errors.New(\"DataPtrInt16 only supports MatTypeCV16S\")\n\t}\n\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrInt16 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length) / 2,\n\t\tCap:  int(p.length) / 2,\n\t}\n\treturn *(*[]int16)(unsafe.Pointer(h)), nil\n}\n\n// DataPtrFloat32 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrFloat32() ([]float32, error) {\n\tif m.Type()&MatTypeCV32F != MatTypeCV32F {\n\t\treturn nil, errors.New(\"DataPtrFloat32 only supports MatTypeCV32F\")\n\t}\n\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrFloat32 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length) / 4,\n\t\tCap:  int(p.length) / 4,\n\t}\n\treturn *(*[]float32)(unsafe.Pointer(h)), nil\n}\n\n// DataPtrFloat64 returns a slice that references the OpenCV allocated data.\n//\n// The data is no longer valid once the Mat has been closed. Any data that\n// needs to be accessed after the Mat is closed must be copied into Go memory.\nfunc (m *Mat) DataPtrFloat64() ([]float64, error) {\n\tif m.Type()&MatTypeCV64F != MatTypeCV64F {\n\t\treturn nil, errors.New(\"DataPtrFloat64 only supports MatTypeCV64F\")\n\t}\n\n\tif !m.IsContinuous() {\n\t\treturn nil, errors.New(\"DataPtrFloat64 requires continuous Mat\")\n\t}\n\n\tp := C.Mat_DataPtr(m.p)\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p.data)),\n\t\tLen:  int(p.length) / 8,\n\t\tCap:  int(p.length) / 8,\n\t}\n\treturn *(*[]float64)(unsafe.Pointer(h)), nil\n}\n\n// Region returns a new Mat that points to a region of this Mat. Changes made to the\n// region Mat will affect the original Mat, since they are pointers to the underlying\n// OpenCV Mat object.\nfunc (m *Mat) Region(rio image.Rectangle) Mat {\n\tcRect := C.struct_Rect{\n\t\tx:      C.int(rio.Min.X),\n\t\ty:      C.int(rio.Min.Y),\n\t\twidth:  C.int(rio.Size().X),\n\t\theight: C.int(rio.Size().Y),\n\t}\n\n\treturn newMat(C.Mat_Region(m.p, cRect))\n}\n\n// Reshape changes the shape and/or the number of channels of a 2D matrix without copying the data.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a4eb96e3251417fa88b78e2abd6cfd7d8\nfunc (m *Mat) Reshape(cn int, rows int) Mat {\n\treturn newMat(C.Mat_Reshape(m.p, C.int(cn), C.int(rows)))\n}\n\n// ReshapeWithSize changes the shape and/or the number of channels of a 2D matrix without copying the data.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#a4eb96e3251417fa88b78e2abd6cfd7d8\nfunc (m *Mat) ReshapeWithSize(cn int, dims []int) Mat {\n\tcDimsArray := make([]C.int, len(dims))\n\tfor i, ft := range dims {\n\t\tcDimsArray[i] = C.int(ft)\n\t}\n\n\tcDimsVector := C.IntVector{\n\t\tval:    (*C.int)(&cDimsArray[0]),\n\t\tlength: C.int(len(dims)),\n\t}\n\n\treturn newMat(C.Mat_ReshapeWithSize(m.p, C.int(cn), cDimsVector))\n}\n\n// ConvertFp16 converts a Mat to half-precision floating point.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9c25d9ef44a2a48ecc3774b30cb80082\nfunc (m *Mat) ConvertFp16() Mat {\n\treturn newMat(C.Mat_ConvertFp16(m.p))\n}\n\n// Mean calculates the mean value M of array elements, independently for each channel, and return it as Scalar\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga191389f8a0e58180bb13a727782cd461\nfunc (m *Mat) Mean() Scalar {\n\ts := C.Mat_Mean(m.p)\n\treturn NewScalar(float64(s.val1), float64(s.val2), float64(s.val3), float64(s.val4))\n}\n\n// MeanWithMask calculates the mean value M of array elements,independently for each channel,\n// and returns it as Scalar vector while applying the mask.\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga191389f8a0e58180bb13a727782cd461\nfunc (m *Mat) MeanWithMask(mask Mat) Scalar {\n\ts := C.Mat_MeanWithMask(m.p, mask.p)\n\treturn NewScalar(float64(s.val1), float64(s.val2), float64(s.val3), float64(s.val4))\n}\n\n// Sqrt calculates a square root of array elements.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga186222c3919657890f88df5a1f64a7d7\nfunc (m *Mat) Sqrt() Mat {\n\treturn newMat(C.Mat_Sqrt(m.p))\n}\n\n// Sum calculates the per-channel pixel sum of an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722\nfunc (m *Mat) Sum() Scalar {\n\ts := C.Mat_Sum(m.p)\n\treturn NewScalar(float64(s.val1), float64(s.val2), float64(s.val3), float64(s.val4))\n}\n\n// PatchNaNs converts NaN's to zeros.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga62286befb7cde3568ff8c7d14d5079da\nfunc (m *Mat) PatchNaNs() error {\n\treturn OpenCVResult(C.Mat_PatchNaNs(m.p))\n}\n\n// LUT performs a look-up table transform of an array.\n//\n// The function LUT fills the output array with values from the look-up table.\n// Indices of the entries are taken from the input array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gab55b8d062b7f5587720ede032d34156f\nfunc LUT(src, wbLUT Mat, dst *Mat) error {\n\treturn OpenCVResult(C.LUT(src.p, wbLUT.p, dst.p))\n}\n\n// Rows returns the number of rows for this Mat.\nfunc (m *Mat) Rows() int {\n\treturn int(C.Mat_Rows(m.p))\n}\n\n// Cols returns the number of columns for this Mat.\nfunc (m *Mat) Cols() int {\n\treturn int(C.Mat_Cols(m.p))\n}\n\n// Channels returns the number of channels for this Mat.\nfunc (m *Mat) Channels() int {\n\treturn int(C.Mat_Channels(m.p))\n}\n\n// Type returns the type for this Mat.\nfunc (m *Mat) Type() MatType {\n\treturn MatType(C.Mat_Type(m.p))\n}\n\n// Step returns the number of bytes each matrix row occupies.\nfunc (m *Mat) Step() int {\n\treturn int(C.Mat_Step(m.p))\n}\n\n// ElemSize returns the matrix element size in bytes.\nfunc (m *Mat) ElemSize() int {\n\treturn int(C.Mat_ElemSize(m.p))\n}\n\n// GetUCharAt returns a value from a specific row/col\n// in this Mat expecting it to be of type uchar aka CV_8U.\nfunc (m *Mat) GetUCharAt(row int, col int) uint8 {\n\treturn uint8(C.Mat_GetUChar(m.p, C.int(row), C.int(col)))\n}\n\n// GetUCharAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type uchar aka CV_8U.\nfunc (m *Mat) GetUCharAt3(x, y, z int) uint8 {\n\treturn uint8(C.Mat_GetUChar3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// GetSCharAt returns a value from a specific row/col\n// in this Mat expecting it to be of type schar aka CV_8S.\nfunc (m *Mat) GetSCharAt(row int, col int) int8 {\n\treturn int8(C.Mat_GetSChar(m.p, C.int(row), C.int(col)))\n}\n\n// GetSCharAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type schar aka CV_8S.\nfunc (m *Mat) GetSCharAt3(x, y, z int) int8 {\n\treturn int8(C.Mat_GetSChar3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// GetShortAt returns a value from a specific row/col\n// in this Mat expecting it to be of type short aka CV_16S.\nfunc (m *Mat) GetShortAt(row int, col int) int16 {\n\treturn int16(C.Mat_GetShort(m.p, C.int(row), C.int(col)))\n}\n\n// GetShortAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type short aka CV_16S.\nfunc (m *Mat) GetShortAt3(x, y, z int) int16 {\n\treturn int16(C.Mat_GetShort3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// GetIntAt returns a value from a specific row/col\n// in this Mat expecting it to be of type int aka CV_32S.\nfunc (m *Mat) GetIntAt(row int, col int) int32 {\n\treturn int32(C.Mat_GetInt(m.p, C.int(row), C.int(col)))\n}\n\n// GetIntAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type int aka CV_32S.\nfunc (m *Mat) GetIntAt3(x, y, z int) int32 {\n\treturn int32(C.Mat_GetInt3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// GetFloatAt returns a value from a specific row/col\n// in this Mat expecting it to be of type float aka CV_32F.\nfunc (m *Mat) GetFloatAt(row int, col int) float32 {\n\treturn float32(C.Mat_GetFloat(m.p, C.int(row), C.int(col)))\n}\n\n// GetFloatAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type float aka CV_32F.\nfunc (m *Mat) GetFloatAt3(x, y, z int) float32 {\n\treturn float32(C.Mat_GetFloat3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// GetDoubleAt returns a value from a specific row/col\n// in this Mat expecting it to be of type double aka CV_64F.\nfunc (m *Mat) GetDoubleAt(row int, col int) float64 {\n\treturn float64(C.Mat_GetDouble(m.p, C.int(row), C.int(col)))\n}\n\n// GetDoubleAt3 returns a value from a specific x, y, z coordinate location\n// in this Mat expecting it to be of type double aka CV_64F.\nfunc (m *Mat) GetDoubleAt3(x, y, z int) float64 {\n\treturn float64(C.Mat_GetDouble3(m.p, C.int(x), C.int(y), C.int(z)))\n}\n\n// SetTo sets all or some of the array elements to the specified scalar value.\nfunc (m *Mat) SetTo(s Scalar) {\n\tsVal := C.struct_Scalar{\n\t\tval1: C.double(s.Val1),\n\t\tval2: C.double(s.Val2),\n\t\tval3: C.double(s.Val3),\n\t\tval4: C.double(s.Val4),\n\t}\n\n\tC.Mat_SetTo(m.p, sVal)\n}\n\n// SetUCharAt sets a value at a specific row/col\n// in this Mat expecting it to be of type uchar aka CV_8U.\nfunc (m *Mat) SetUCharAt(row int, col int, val uint8) {\n\tC.Mat_SetUChar(m.p, C.int(row), C.int(col), C.uint8_t(val))\n}\n\n// SetUCharAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type uchar aka CV_8U.\nfunc (m *Mat) SetUCharAt3(x, y, z int, val uint8) {\n\tC.Mat_SetUChar3(m.p, C.int(x), C.int(y), C.int(z), C.uint8_t(val))\n}\n\n// SetSCharAt sets a value at a specific row/col\n// in this Mat expecting it to be of type schar aka CV_8S.\nfunc (m *Mat) SetSCharAt(row int, col int, val int8) {\n\tC.Mat_SetSChar(m.p, C.int(row), C.int(col), C.int8_t(val))\n}\n\n// SetSCharAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type schar aka CV_8S.\nfunc (m *Mat) SetSCharAt3(x, y, z int, val int8) {\n\tC.Mat_SetSChar3(m.p, C.int(x), C.int(y), C.int(z), C.int8_t(val))\n}\n\n// SetShortAt sets a value at a specific row/col\n// in this Mat expecting it to be of type short aka CV_16S.\nfunc (m *Mat) SetShortAt(row int, col int, val int16) {\n\tC.Mat_SetShort(m.p, C.int(row), C.int(col), C.int16_t(val))\n}\n\n// SetShortAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type short aka CV_16S.\nfunc (m *Mat) SetShortAt3(x, y, z int, val int16) {\n\tC.Mat_SetShort3(m.p, C.int(x), C.int(y), C.int(z), C.int16_t(val))\n}\n\n// SetIntAt sets a value at a specific row/col\n// in this Mat expecting it to be of type int aka CV_32S.\nfunc (m *Mat) SetIntAt(row int, col int, val int32) {\n\tC.Mat_SetInt(m.p, C.int(row), C.int(col), C.int32_t(val))\n}\n\n// SetIntAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type int aka CV_32S.\nfunc (m *Mat) SetIntAt3(x, y, z int, val int32) {\n\tC.Mat_SetInt3(m.p, C.int(x), C.int(y), C.int(z), C.int32_t(val))\n}\n\n// SetFloatAt sets a value at a specific row/col\n// in this Mat expecting it to be of type float aka CV_32F.\nfunc (m *Mat) SetFloatAt(row int, col int, val float32) {\n\tC.Mat_SetFloat(m.p, C.int(row), C.int(col), C.float(val))\n}\n\n// SetFloatAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type float aka CV_32F.\nfunc (m *Mat) SetFloatAt3(x, y, z int, val float32) {\n\tC.Mat_SetFloat3(m.p, C.int(x), C.int(y), C.int(z), C.float(val))\n}\n\n// SetDoubleAt sets a value at a specific row/col\n// in this Mat expecting it to be of type double aka CV_64F.\nfunc (m *Mat) SetDoubleAt(row int, col int, val float64) {\n\tC.Mat_SetDouble(m.p, C.int(row), C.int(col), C.double(val))\n}\n\n// SetDoubleAt3 sets a value at a specific x, y, z coordinate location\n// in this Mat expecting it to be of type double aka CV_64F.\nfunc (m *Mat) SetDoubleAt3(x, y, z int, val float64) {\n\tC.Mat_SetDouble3(m.p, C.int(x), C.int(y), C.int(z), C.double(val))\n}\n\n// AddUChar adds a uchar value to each element in the Mat. Performs a\n// mat += val operation.\nfunc (m *Mat) AddUChar(val uint8) {\n\tC.Mat_AddUChar(m.p, C.uint8_t(val))\n}\n\n// SubtractUChar subtracts a uchar value from each element in the Mat. Performs a\n// mat -= val operation.\nfunc (m *Mat) SubtractUChar(val uint8) {\n\tC.Mat_SubtractUChar(m.p, C.uint8_t(val))\n}\n\n// MultiplyUChar multiplies each element in the Mat by a uint value. Performs a\n// mat *= val operation.\nfunc (m *Mat) MultiplyUChar(val uint8) {\n\tC.Mat_MultiplyUChar(m.p, C.uint8_t(val))\n}\n\n// DivideUChar divides each element in the Mat by a uint value. Performs a\n// mat /= val operation.\nfunc (m *Mat) DivideUChar(val uint8) {\n\tC.Mat_DivideUChar(m.p, C.uint8_t(val))\n}\n\n// AddFloat adds a float value to each element in the Mat. Performs a\n// mat += val operation.\nfunc (m *Mat) AddFloat(val float32) {\n\tC.Mat_AddFloat(m.p, C.float(val))\n}\n\n// SubtractFloat subtracts a float value from each element in the Mat. Performs a\n// mat -= val operation.\nfunc (m *Mat) SubtractFloat(val float32) {\n\tC.Mat_SubtractFloat(m.p, C.float(val))\n}\n\n// MultiplyFloat multiplies each element in the Mat by a float value. Performs a\n// mat *= val operation.\nfunc (m *Mat) MultiplyFloat(val float32) {\n\tC.Mat_MultiplyFloat(m.p, C.float(val))\n}\n\n// DivideFloat divides each element in the Mat by a float value. Performs a\n// mat /= val operation.\nfunc (m *Mat) DivideFloat(val float32) {\n\tC.Mat_DivideFloat(m.p, C.float(val))\n}\n\n// MultiplyMatrix multiplies matrix (m*x)\nfunc (m *Mat) MultiplyMatrix(x Mat) Mat {\n\treturn newMat(C.Mat_MultiplyMatrix(m.p, x.p))\n}\n\n// T  transpose matrix\n// https://docs.opencv.org/4.1.2/d3/d63/classcv_1_1Mat.html#aaa428c60ccb6d8ea5de18f63dfac8e11\nfunc (m *Mat) T() Mat {\n\treturn newMat(C.Mat_T(m.p))\n}\n\n// AbsDiff calculates the per-element absolute difference between two arrays\n// or between an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6fef31bc8c4071cbc114a758a2b79c14\nfunc AbsDiff(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_AbsDiff(src1.p, src2.p, dst.p))\n}\n\n// Add calculates the per-element sum of two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga10ac1bfb180e2cfda1701d06c24fdbd6\nfunc Add(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Add(src1.p, src2.p, dst.p))\n}\n\n// AddWeighted calculates the weighted sum of two arrays.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gafafb2513349db3bcff51f54ee5592a19\nfunc AddWeighted(src1 Mat, alpha float64, src2 Mat, beta float64, gamma float64, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_AddWeighted(src1.p, C.double(alpha), src2.p, C.double(beta), C.double(gamma), dst.p))\n}\n\n// BitwiseAnd computes bitwise conjunction of the two arrays (dst = src1 & src2).\n// Calculates the per-element bit-wise conjunction of two arrays\n// or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14\nfunc BitwiseAnd(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseAnd(src1.p, src2.p, dst.p))\n}\n\n// BitwiseAndWithMask computes bitwise conjunction of the two arrays (dst = src1 & src2).\n// Calculates the per-element bit-wise conjunction of two arrays\n// or an array and a scalar. It has an additional parameter for a mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga60b4d04b251ba5eb1392c34425497e14\nfunc BitwiseAndWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseAndWithMask(src1.p, src2.p, dst.p, mask.p))\n}\n\n// BitwiseNot inverts every bit of an array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f\nfunc BitwiseNot(src1 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseNot(src1.p, dst.p))\n}\n\n// BitwiseNotWithMask inverts every bit of an array. It has an additional parameter for a mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0002cf8b418479f4cb49a75442baee2f\nfunc BitwiseNotWithMask(src1 Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseNotWithMask(src1.p, dst.p, mask.p))\n}\n\n// BitwiseOr calculates the per-element bit-wise disjunction of two arrays\n// or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4\nfunc BitwiseOr(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseOr(src1.p, src2.p, dst.p))\n}\n\n// BitwiseOrWithMask calculates the per-element bit-wise disjunction of two arrays\n// or an array and a scalar. It has an additional parameter for a mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gab85523db362a4e26ff0c703793a719b4\nfunc BitwiseOrWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseOrWithMask(src1.p, src2.p, dst.p, mask.p))\n}\n\n// BitwiseXor calculates the per-element bit-wise \"exclusive or\" operation\n// on two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c\nfunc BitwiseXor(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseXor(src1.p, src2.p, dst.p))\n}\n\n// BitwiseXorWithMask calculates the per-element bit-wise \"exclusive or\" operation\n// on two arrays or an array and a scalar. It has an additional parameter for a mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga84b2d8188ce506593dcc3f8cd00e8e2c\nfunc BitwiseXorWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_BitwiseXorWithMask(src1.p, src2.p, dst.p, mask.p))\n}\n\n// BatchDistance is a naive nearest neighbor finder.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4ba778a1c57f83233b1d851c83f5a622\nfunc BatchDistance(src1 Mat, src2 Mat, dist Mat, dtype MatType, nidx Mat, normType NormType, K int, mask Mat, update int, crosscheck bool) error {\n\treturn OpenCVResult(C.Mat_BatchDistance(src1.p, src2.p, dist.p, C.int(dtype), nidx.p, C.int(normType), C.int(K), mask.p, C.int(update), C.bool(crosscheck)))\n}\n\n// BorderInterpolate computes the source location of an extrapolated pixel.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga247f571aa6244827d3d798f13892da58\nfunc BorderInterpolate(p int, len int, borderType CovarFlags) int {\n\tret := C.Mat_BorderInterpolate(C.int(p), C.int(len), C.int(borderType))\n\treturn int(ret)\n}\n\n// CovarFlags are the covariation flags used by functions such as BorderInterpolate.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/de1/group__core.html#ga719ebd4a73f30f4fab258ab7616d0f0f\ntype CovarFlags int\n\nconst (\n\t// CovarScrambled indicates to scramble the results.\n\tCovarScrambled CovarFlags = 0\n\n\t// CovarNormal indicates to use normal covariation.\n\tCovarNormal CovarFlags = 1\n\n\t// CovarUseAvg indicates to use average covariation.\n\tCovarUseAvg CovarFlags = 2\n\n\t// CovarScale indicates to use scaled covariation.\n\tCovarScale CovarFlags = 4\n\n\t// CovarRows indicates to use covariation on rows.\n\tCovarRows CovarFlags = 8\n\n\t// CovarCols indicates to use covariation on columns.\n\tCovarCols CovarFlags = 16\n)\n\n// CalcCovarMatrix calculates the covariance matrix of a set of vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga017122d912af19d7d0d2cccc2d63819f\nfunc CalcCovarMatrix(samples Mat, covar *Mat, mean *Mat, flags CovarFlags, ctype MatType) error {\n\treturn OpenCVResult(C.Mat_CalcCovarMatrix(samples.p, covar.p, mean.p, C.int(flags), C.int(ctype)))\n}\n\n// CartToPolar calculates the magnitude and angle of 2D vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gac5f92f48ec32cacf5275969c33ee837d\nfunc CartToPolar(x Mat, y Mat, magnitude *Mat, angle *Mat, angleInDegrees bool) error {\n\treturn OpenCVResult(C.Mat_CartToPolar(x.p, y.p, magnitude.p, angle.p, C.bool(angleInDegrees)))\n}\n\n// CheckRange checks every element of an input array for invalid values.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga2bd19d89cae59361416736f87e3c7a64\nfunc CheckRange(src Mat) bool {\n\treturn bool(C.Mat_CheckRange(src.p))\n}\n\n// Compare performs the per-element comparison of two arrays\n// or an array and scalar value.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga303cfb72acf8cbb36d884650c09a3a97\nfunc Compare(src1 Mat, src2 Mat, dst *Mat, ct CompareType) error {\n\treturn OpenCVResult(C.Mat_Compare(src1.p, src2.p, dst.p, C.int(ct)))\n}\n\n// CountNonZero counts non-zero array elements.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa4b89393263bb4d604e0fe5986723914\nfunc CountNonZero(src Mat) int {\n\treturn int(C.Mat_CountNonZero(src.p))\n}\n\n// CompleteSymm copies the lower or the upper half of a square matrix to its another half.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa9d88dcd0e54b6d1af38d41f2a3e3d25\nfunc CompleteSymm(m Mat, lowerToUpper bool) error {\n\treturn OpenCVResult(C.Mat_CompleteSymm(m.p, C.bool(lowerToUpper)))\n}\n\n// ConvertScaleAbs scales, calculates absolute values, and converts the result to 8-bit.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3460e9c9f37b563ab9dd550c4d8c4e7d\nfunc ConvertScaleAbs(src Mat, dst *Mat, alpha float64, beta float64) error {\n\treturn OpenCVResult(C.Mat_ConvertScaleAbs(src.p, dst.p, C.double(alpha), C.double(beta)))\n}\n\n// CopyMakeBorder forms a border around an image (applies padding).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga2ac1049c2c3dd25c2b41bffe17658a36\nfunc CopyMakeBorder(src Mat, dst *Mat, top int, bottom int, left int, right int, bt BorderType, value color.RGBA) error {\n\n\tcValue := C.struct_Scalar{\n\t\tval1: C.double(value.B),\n\t\tval2: C.double(value.G),\n\t\tval3: C.double(value.R),\n\t\tval4: C.double(value.A),\n\t}\n\n\treturn OpenCVResult(C.Mat_CopyMakeBorder(src.p, dst.p, C.int(top), C.int(bottom), C.int(left), C.int(right), C.int(bt), cValue))\n}\n\n// DftFlags represents a DFT or DCT flag.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf4dde112b483b38175621befedda1f1c\ntype DftFlags int\n\nconst (\n\t// DftForward performs forward 1D or 2D dft or dct.\n\tDftForward DftFlags = 0\n\n\t// DftInverse performs an inverse 1D or 2D transform.\n\tDftInverse DftFlags = 1\n\n\t// DftScale scales the result: divide it by the number of array elements. Normally, it is combined with DFT_INVERSE.\n\tDftScale DftFlags = 2\n\n\t// DftRows performs a forward or inverse transform of every individual row of the input matrix.\n\tDftRows DftFlags = 4\n\n\t// DftComplexOutput performs a forward transformation of 1D or 2D real array; the result, though being a complex array, has complex-conjugate symmetry\n\tDftComplexOutput DftFlags = 16\n\n\t// DftRealOutput performs an inverse transformation of a 1D or 2D complex array; the result is normally a complex array of the same size,\n\t// however, if the input array has conjugate-complex symmetry (for example, it is a result of forward transformation with DFT_COMPLEX_OUTPUT flag),\n\t// the output is a real array.\n\tDftRealOutput DftFlags = 32\n\n\t// DftComplexInput specifies that input is complex input. If this flag is set, the input must have 2 channels.\n\tDftComplexInput DftFlags = 64\n\n\t// DctInverse performs an inverse 1D or 2D dct transform.\n\tDctInverse = DftInverse\n\n\t// DctRows performs a forward or inverse dct transform of every individual row of the input matrix.\n\tDctRows = DftRows\n)\n\n// DCT performs a forward or inverse discrete Cosine transform of 1D or 2D array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga85aad4d668c01fbd64825f589e3696d4\nfunc DCT(src Mat, dst *Mat, flags DftFlags) error {\n\treturn OpenCVResult(C.Mat_DCT(src.p, dst.p, C.int(flags)))\n}\n\n// Determinant returns the determinant of a square floating-point matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf802bd9ca3e07b8b6170645ef0611d0c\nfunc Determinant(src Mat) float64 {\n\treturn float64(C.Mat_Determinant(src.p))\n}\n\n// DFT performs a forward or inverse Discrete Fourier Transform (DFT)\n// of a 1D or 2D floating-point array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d\nfunc DFT(src Mat, dst *Mat, flags DftFlags) error {\n\treturn OpenCVResult(C.Mat_DFT(src.p, dst.p, C.int(flags)))\n}\n\n// Divide performs the per-element division\n// on two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6db555d30115642fedae0cda05604874\nfunc Divide(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Divide(src1.p, src2.p, dst.p))\n}\n\n// Eigen calculates eigenvalues and eigenvectors of a symmetric matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9fa0d58657f60eaa6c71f6fbb40456e3\nfunc Eigen(src Mat, eigenvalues *Mat, eigenvectors *Mat) bool {\n\tret := C.Mat_Eigen(src.p, eigenvalues.p, eigenvectors.p)\n\treturn bool(ret)\n}\n\n// EigenNonSymmetric calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf51987e03cac8d171fbd2b327cf966f6\nfunc EigenNonSymmetric(src Mat, eigenvalues *Mat, eigenvectors *Mat) error {\n\treturn OpenCVResult(C.Mat_EigenNonSymmetric(src.p, eigenvalues.p, eigenvectors.p))\n}\n\n// PCABackProject reconstructs vectors from their PC projections.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab26049f30ee8e94f7d69d82c124faafc\nfunc PCABackProject(data Mat, mean Mat, eigenvectors Mat, result *Mat) error {\n\treturn OpenCVResult(C.Mat_PCABackProject(data.p, mean.p, eigenvectors.p, result.p))\n}\n\n// PCACompute performs PCA.\n//\n// The computed eigenvalues are sorted from the largest to the smallest and the corresponding\n// eigenvectors are stored as eigenvectors rows.\n//\n// Note: Calling with maxComponents == 0 (opencv default) will cause all components to be retained.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga27a565b31d820b05dcbcd47112176b6e\nfunc PCACompute(src Mat, mean *Mat, eigenvectors *Mat, eigenvalues *Mat, maxComponents int) error {\n\treturn OpenCVResult(C.Mat_PCACompute(src.p, mean.p, eigenvectors.p, eigenvalues.p, C.int(maxComponents)))\n}\n\n// PCAProject projects vector(s) to the principal component subspace.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga6b9fbc7b3a99ebfd441bbec0a6bc4f88\nfunc PCAProject(data Mat, mean Mat, eigenvectors Mat, result *Mat) error {\n\treturn OpenCVResult(C.Mat_PCAProject(data.p, mean.p, eigenvectors.p, result.p))\n}\n\n// PSNR computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga3119e3ea73010a6f810bb05aa36ac8d6\nfunc PSNR(src1 Mat, src2 Mat) float64 {\n\treturn float64(C.PSNR(src1.p, src2.p))\n}\n\n// SVBackSubst performs a singular value back substitution.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab4e620e6fc6c8a27bb2be3d50a840c0b\nfunc SVBackSubst(w Mat, u Mat, vt Mat, rhs Mat, dst *Mat) error {\n\treturn OpenCVResult(C.SVBackSubst(w.p, u.p, vt.p, rhs.p, dst.p))\n}\n\n// SVDecomp decomposes matrix and stores the results to user-provided matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab477b5b7b39b370bb03e75b19d2d5109\nfunc SVDecomp(src Mat, w *Mat, u *Mat, vt *Mat) error {\n\treturn OpenCVResult(C.SVDecomp(src.p, w.p, u.p, vt.p))\n}\n\n// Exp calculates the exponent of every array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3e10108e2162c338f1b848af619f39e5\nfunc Exp(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Exp(src.p, dst.p))\n}\n\n// ExtractChannel extracts a single channel from src (coi is 0-based index).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gacc6158574aa1f0281878c955bcf35642\nfunc ExtractChannel(src Mat, dst *Mat, coi int) error {\n\treturn OpenCVResult(C.Mat_ExtractChannel(src.p, dst.p, C.int(coi)))\n}\n\n// FindNonZero returns the list of locations of non-zero pixels.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaed7df59a3539b4cc0fe5c9c8d7586190\nfunc FindNonZero(src Mat, idx *Mat) error {\n\treturn OpenCVResult(C.Mat_FindNonZero(src.p, idx.p))\n}\n\n// Flip flips a 2D array around horizontal(0), vertical(1), or both axes(-1).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaca7be533e3dac7feb70fc60635adf441\nfunc Flip(src Mat, dst *Mat, flipCode int) error {\n\treturn OpenCVResult(C.Mat_Flip(src.p, dst.p, C.int(flipCode)))\n}\n\n// Gemm performs generalized matrix multiplication.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gacb6e64071dffe36434e1e7ee79e7cb35\nfunc Gemm(src1, src2 Mat, alpha float64, src3 Mat, beta float64, dst *Mat, flags int) error {\n\treturn OpenCVResult(C.Mat_Gemm(src1.p, src2.p, C.double(alpha), src3.p, C.double(beta), dst.p, C.int(flags)))\n}\n\n// GetOptimalDFTSize returns the optimal Discrete Fourier Transform (DFT) size\n// for a given vector size.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6577a2e59968936ae02eb2edde5de299\nfunc GetOptimalDFTSize(vecsize int) int {\n\treturn int(C.Mat_GetOptimalDFTSize(C.int(vecsize)))\n}\n\n// Hconcat applies horizontal concatenation to given matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaab5ceee39e0580f879df645a872c6bf7\nfunc Hconcat(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Hconcat(src1.p, src2.p, dst.p))\n}\n\n// Vconcat applies vertical concatenation to given matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaab5ceee39e0580f879df645a872c6bf7\nfunc Vconcat(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Vconcat(src1.p, src2.p, dst.p))\n}\n\n// RotateFlag for image rotation\n//\n// For further details please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6f45d55c0b1cc9d97f5353a7c8a7aac2\ntype RotateFlag int\n\nconst (\n\t// Rotate90Clockwise allows to rotate image 90 degrees clockwise\n\tRotate90Clockwise RotateFlag = 0\n\t// Rotate180Clockwise allows to rotate image 180 degrees clockwise\n\tRotate180Clockwise RotateFlag = 1\n\t// Rotate90CounterClockwise allows to rotate 270 degrees clockwise\n\tRotate90CounterClockwise RotateFlag = 2\n)\n\n// Rotate rotates a 2D array in multiples of 90 degrees\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4ad01c0978b0ce64baa246811deeac24\nfunc Rotate(src Mat, dst *Mat, code RotateFlag) error {\n\treturn OpenCVResult(C.Rotate(src.p, dst.p, C.int(code)))\n}\n\n// IDCT calculates the inverse Discrete Cosine Transform of a 1D or 2D array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga77b168d84e564c50228b69730a227ef2\nfunc IDCT(src Mat, dst *Mat, flags int) error {\n\treturn OpenCVResult(C.Mat_Idct(src.p, dst.p, C.int(flags)))\n}\n\n// IDFT calculates the inverse Discrete Fourier Transform of a 1D or 2D array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa708aa2d2e57a508f968eb0f69aa5ff1\nfunc IDFT(src Mat, dst *Mat, flags, nonzeroRows int) error {\n\treturn OpenCVResult(C.Mat_Idft(src.p, dst.p, C.int(flags), C.int(nonzeroRows)))\n}\n\n// InRange checks if array elements lie between the elements of two Mat arrays.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981\nfunc InRange(src, lb, ub Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_InRange(src.p, lb.p, ub.p, dst.p))\n}\n\n// InRangeWithScalar checks if array elements lie between the elements of two Scalars\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga48af0ab51e36436c5d04340e036ce981\nfunc InRangeWithScalar(src Mat, lb, ub Scalar, dst *Mat) error {\n\tlbVal := C.struct_Scalar{\n\t\tval1: C.double(lb.Val1),\n\t\tval2: C.double(lb.Val2),\n\t\tval3: C.double(lb.Val3),\n\t\tval4: C.double(lb.Val4),\n\t}\n\n\tubVal := C.struct_Scalar{\n\t\tval1: C.double(ub.Val1),\n\t\tval2: C.double(ub.Val2),\n\t\tval3: C.double(ub.Val3),\n\t\tval4: C.double(ub.Val4),\n\t}\n\n\treturn OpenCVResult(C.Mat_InRangeWithScalar(src.p, lbVal, ubVal, dst.p))\n}\n\n// InsertChannel inserts a single channel to dst (coi is 0-based index)\n// (it replaces channel i with another in dst).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1d4bd886d35b00ec0b764cb4ce6eb515\nfunc InsertChannel(src Mat, dst *Mat, coi int) error {\n\treturn OpenCVResult(C.Mat_InsertChannel(src.p, dst.p, C.int(coi)))\n}\n\n// Invert finds the inverse or pseudo-inverse of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gad278044679d4ecf20f7622cc151aaaa2\nfunc Invert(src Mat, dst *Mat, flags SolveDecompositionFlags) float64 {\n\tret := C.Mat_Invert(src.p, dst.p, C.int(flags))\n\treturn float64(ret)\n}\n\n// KMeansFlags for kmeans center selection\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/de1/group__core.html#ga276000efe55ee2756e0c471c7b270949\ntype KMeansFlags int\n\nconst (\n\t// KMeansRandomCenters selects random initial centers in each attempt.\n\tKMeansRandomCenters KMeansFlags = 0\n\t// KMeansPPCenters uses kmeans++ center initialization by Arthur and Vassilvitskii [Arthur2007].\n\tKMeansPPCenters KMeansFlags = 1\n\t// KMeansUseInitialLabels uses the user-supplied lables during the first (and possibly the only) attempt\n\t// instead of computing them from the initial centers. For the second and further attempts, use the random or semi-random     // centers. Use one of KMEANS_*_CENTERS flag to specify the exact method.\n\tKMeansUseInitialLabels KMeansFlags = 2\n)\n\n// KMeans finds centers of clusters and groups input samples around the clusters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d38/group__core__cluster.html#ga9a34dc06c6ec9460e90860f15bcd2f88\nfunc KMeans(data Mat, k int, bestLabels *Mat, criteria TermCriteria, attempts int, flags KMeansFlags, centers *Mat) float64 {\n\tret := C.KMeans(data.p, C.int(k), bestLabels.p, criteria.p, C.int(attempts), C.int(flags), centers.p)\n\treturn float64(ret)\n}\n\n// KMeansPoints finds centers of clusters and groups input samples around the clusters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d38/group__core__cluster.html#ga9a34dc06c6ec9460e90860f15bcd2f88\nfunc KMeansPoints(points PointVector, k int, bestLabels *Mat, criteria TermCriteria, attempts int, flags KMeansFlags, centers *Mat) float64 {\n\tret := C.KMeansPoints(points.p, C.int(k), bestLabels.p, criteria.p, C.int(attempts), C.int(flags), centers.p)\n\treturn float64(ret)\n}\n\n// Log calculates the natural logarithm of every array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga937ecdce4679a77168730830a955bea7\nfunc Log(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Log(src.p, dst.p))\n}\n\n// Magnitude calculates the magnitude of 2D vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6d3b097586bca4409873d64a90fe64c3\nfunc Magnitude(x, y Mat, magnitude *Mat) error {\n\treturn OpenCVResult(C.Mat_Magnitude(x.p, y.p, magnitude.p))\n}\n\n// Mahalanobis calculates the Mahalanobis distance between two vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga4493aee129179459cbfc6064f051aa7d\nfunc Mahalanobis(v1, v2, icovar Mat) float64 {\n\treturn float64(C.Mat_Mahalanobis(v1.p, v2.p, icovar.p))\n}\n\n// MulTransposed calculates the product of a matrix and its transposition.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gadc4e49f8f7a155044e3be1b9e3b270ab\nfunc MulTransposed(src Mat, dest *Mat, ata bool) error {\n\treturn OpenCVResult(C.MulTransposed(src.p, dest.p, C.bool(ata)))\n}\n\n// Max calculates per-element maximum of two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gacc40fa15eac0fb83f8ca70b7cc0b588d\nfunc Max(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Max(src1.p, src2.p, dst.p))\n}\n\n// MeanStdDev calculates a mean and standard deviation of array elements.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga846c858f4004d59493d7c6a4354b301d\nfunc MeanStdDev(src Mat, dst *Mat, dstStdDev *Mat) error {\n\treturn OpenCVResult(C.Mat_MeanStdDev(src.p, dst.p, dstStdDev.p))\n}\n\n// MeanStdDevWithMask calculates a mean and standard deviation of array elements while applying the mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#ga846c858f4004d59493d7c6a4354b301d\nfunc MeanStdDevWithMask(src Mat, dstMean *Mat, dstStdDev *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_MeanStdDevWithMask(src.p, dstMean.p, dstStdDev.p, mask.p))\n}\n\n// Merge creates one multi-channel array out of several single-channel ones.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7d7b4d6c6ee504b30a20b1680029c7b4\nfunc Merge(mv []Mat, dst *Mat) error {\n\tcMatArray := make([]C.Mat, len(mv))\n\tfor i, r := range mv {\n\t\tcMatArray[i] = r.p\n\t}\n\tcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(mv)),\n\t}\n\n\treturn OpenCVResult(C.Mat_Merge(cMats, dst.p))\n}\n\n// Min calculates per-element minimum of two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9af368f182ee76d0463d0d8d5330b764\nfunc Min(src1, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Min(src1.p, src2.p, dst.p))\n}\n\n// MinMaxIdx finds the global minimum and maximum in an array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7622c466c628a75d9ed008b42250a73f\nfunc MinMaxIdx(input Mat) (minVal, maxVal float32, minIdx, maxIdx int) {\n\tvar cMinVal C.double\n\tvar cMaxVal C.double\n\tvar cMinIdx C.int\n\tvar cMaxIdx C.int\n\n\tC.Mat_MinMaxIdx(input.p, &cMinVal, &cMaxVal, &cMinIdx, &cMaxIdx)\n\n\treturn float32(cMinVal), float32(cMaxVal), int(minIdx), int(maxIdx)\n}\n\n// MinMaxLoc finds the global minimum and maximum in an array.\n//\n// For further details, please see:\n// https://docs.opencv.org/trunk/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707\nfunc MinMaxLoc(input Mat) (minVal, maxVal float32, minLoc, maxLoc image.Point) {\n\tvar cMinVal C.double\n\tvar cMaxVal C.double\n\tvar cMinLoc C.struct_Point\n\tvar cMaxLoc C.struct_Point\n\n\tC.Mat_MinMaxLoc(input.p, &cMinVal, &cMaxVal, &cMinLoc, &cMaxLoc)\n\n\tminLoc = image.Pt(int(cMinLoc.x), int(cMinLoc.y))\n\tmaxLoc = image.Pt(int(cMaxLoc.x), int(cMaxLoc.y))\n\n\treturn float32(cMinVal), float32(cMaxVal), minLoc, maxLoc\n}\n\n// MinMaxLocWithMask finds the global minimum and maximum in an array with a mask used to select a sub-array.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707\nfunc MinMaxLocWithMask(input, mask Mat) (minVal, maxVal float32, minLoc, maxLoc image.Point) {\n\tvar cMinVal C.double\n\tvar cMaxVal C.double\n\tvar cMinLoc C.struct_Point\n\tvar cMaxLoc C.struct_Point\n\n\tC.Mat_MinMaxLocWithMask(input.p, &cMinVal, &cMaxVal, &cMinLoc, &cMaxLoc, mask.p)\n\n\tminLoc = image.Pt(int(cMinLoc.x), int(cMinLoc.y))\n\tmaxLoc = image.Pt(int(cMaxLoc.x), int(cMaxLoc.y))\n\n\treturn float32(cMinVal), float32(cMaxVal), minLoc, maxLoc\n}\n\n// Copies specified channels from input arrays to the specified channels of output arrays.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga51d768c270a1cdd3497255017c4504be\nfunc MixChannels(src []Mat, dst []Mat, fromTo []int) error {\n\tcSrcArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcSrcArray[i] = r.p\n\t}\n\tcSrcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cSrcArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\n\tcDstArray := make([]C.Mat, len(dst))\n\tfor i, r := range dst {\n\t\tcDstArray[i] = r.p\n\t}\n\tcDstMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cDstArray[0]),\n\t\tlength: C.int(len(dst)),\n\t}\n\n\tcFromToArray := make([]C.int, len(fromTo))\n\tfor i, ft := range fromTo {\n\t\tcFromToArray[i] = C.int(ft)\n\t}\n\n\tcFromToIntVector := C.IntVector{\n\t\tval:    (*C.int)(&cFromToArray[0]),\n\t\tlength: C.int(len(fromTo)),\n\t}\n\n\tC.Mat_MixChannels(cSrcMats, cDstMats, cFromToIntVector)\n\n\tfor i := C.int(0); i < cDstMats.length; i++ {\n\t\tdst[i].p = C.Mats_get(cDstMats, i)\n\t}\n\treturn LastExceptionError()\n}\n\n// Mulspectrums performs the per-element multiplication of two Fourier spectrums.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3ab38646463c59bf0ce962a9d51db64f\nfunc MulSpectrums(a Mat, b Mat, dst *Mat, flags DftFlags) error {\n\treturn OpenCVResult(C.Mat_MulSpectrums(a.p, b.p, dst.p, C.int(flags)))\n}\n\n// Multiply calculates the per-element scaled product of two arrays.\n// Both input arrays must be of the same size and the same type.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga979d898a58d7f61c53003e162e7ad89f\nfunc Multiply(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Multiply(src1.p, src2.p, dst.p))\n}\n\n// MultiplyWithParams calculates the per-element scaled product of two arrays.\n// Both input arrays must be of the same size and the same type.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga979d898a58d7f61c53003e162e7ad89f\nfunc MultiplyWithParams(src1 Mat, src2 Mat, dst *Mat, scale float64, dtype MatType) error {\n\treturn OpenCVResult(C.Mat_MultiplyWithParams(src1.p, src2.p, dst.p, C.double(scale), C.int(dtype)))\n}\n\n// NormType for normalization operations.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gad12cefbcb5291cf958a85b4b67b6149f\ntype NormType int\n\nconst (\n\t// NormInf indicates use infinite normalization.\n\tNormInf NormType = 1\n\n\t// NormL1 indicates use L1 normalization.\n\tNormL1 NormType = 2\n\n\t// NormL2 indicates use L2 normalization.\n\tNormL2 NormType = 4\n\n\t// NormL2Sqr indicates use L2 squared normalization.\n\tNormL2Sqr NormType = 5\n\n\t// NormHamming indicates use Hamming normalization.\n\tNormHamming NormType = 6\n\n\t// NormHamming2 indicates use Hamming 2-bit normalization.\n\tNormHamming2 NormType = 7\n\n\t// NormTypeMask indicates use type mask for normalization.\n\tNormTypeMask NormType = 7\n\n\t// NormRelative indicates use relative normalization.\n\tNormRelative NormType = 8\n\n\t// NormMinMax indicates use min/max normalization.\n\tNormMinMax NormType = 32\n)\n\n// Normalize normalizes the norm or value range of an array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga87eef7ee3970f86906d69a92cbf064bd\nfunc Normalize(src Mat, dst *Mat, alpha float64, beta float64, typ NormType) error {\n\treturn OpenCVResult(C.Mat_Normalize(src.p, dst.p, C.double(alpha), C.double(beta), C.int(typ)))\n}\n\n// Norm calculates the absolute norm of an array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7c331fb8dd951707e184ef4e3f21dd33\nfunc Norm(src1 Mat, normType NormType) float64 {\n\treturn float64(C.Norm(src1.p, C.int(normType)))\n}\n\n// Norm calculates the absolute difference/relative norm of two arrays.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga7c331fb8dd951707e184ef4e3f21dd33\nfunc NormWithMats(src1 Mat, src2 Mat, normType NormType) float64 {\n\treturn float64(C.NormWithMats(src1.p, src2.p, C.int(normType)))\n}\n\n// PerspectiveTransform performs the perspective matrix transformation of vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gad327659ac03e5fd6894b90025e6900a7\nfunc PerspectiveTransform(src Mat, dst *Mat, tm Mat) error {\n\treturn OpenCVResult(C.Mat_PerspectiveTransform(src.p, dst.p, tm.p))\n}\n\n// TermCriteriaType for TermCriteria.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57\ntype TermCriteriaType int\n\nconst (\n\t// Count is the maximum number of iterations or elements to compute.\n\tCount TermCriteriaType = 1\n\n\t// MaxIter is the maximum number of iterations or elements to compute.\n\tMaxIter TermCriteriaType = 1\n\n\t// EPS is the desired accuracy or change in parameters at which the\n\t// iterative algorithm stops.\n\tEPS TermCriteriaType = 2\n)\n\ntype SolveDecompositionFlags int\n\nconst (\n\t// Gaussian elimination with the optimal pivot element chosen.\n\tSolveDecompositionLu SolveDecompositionFlags = 0\n\n\t// Singular value decomposition (SVD) method. The system can be over-defined and/or the matrix src1 can be singular.\n\tSolveDecompositionSvd SolveDecompositionFlags = 1\n\n\t// Eigenvalue decomposition. The matrix src1 must be symmetrical.\n\tSolveDecompositionEing SolveDecompositionFlags = 2\n\n\t// Cholesky LL^T factorization. The matrix src1 must be symmetrical and positively defined.\n\tSolveDecompositionCholesky SolveDecompositionFlags = 3\n\n\t// QR factorization. The system can be over-defined and/or the matrix src1 can be singular.\n\tSolveDecompositionQr SolveDecompositionFlags = 4\n\n\t// While all the previous flags are mutually exclusive, this flag can be used together with any of the previous.\n\t// It means that the normal equations 𝚜𝚛𝚌𝟷^T⋅𝚜𝚛𝚌𝟷⋅𝚍𝚜𝚝=𝚜𝚛𝚌𝟷^T𝚜𝚛𝚌𝟸 are solved instead of the original system\n\t// 𝚜𝚛𝚌𝟷⋅𝚍𝚜𝚝=𝚜𝚛𝚌𝟸.\n\tSolveDecompositionNormal SolveDecompositionFlags = 5\n)\n\n// Solve solves one or more linear systems or least-squares problems.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga12b43690dbd31fed96f213eefead2373\nfunc Solve(src1 Mat, src2 Mat, dst *Mat, flags SolveDecompositionFlags) bool {\n\treturn bool(C.Mat_Solve(src1.p, src2.p, dst.p, C.int(flags)))\n}\n\n// SolveCubic finds the real roots of a cubic equation.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1c3b0b925b085b6e96931ee309e6a1da\nfunc SolveCubic(coeffs Mat, roots *Mat) int {\n\treturn int(C.Mat_SolveCubic(coeffs.p, roots.p))\n}\n\n// SolvePoly finds the real or complex roots of a polynomial equation.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gac2f5e953016fabcdf793d762f4ec5dce\nfunc SolvePoly(coeffs Mat, roots *Mat, maxIters int) float64 {\n\treturn float64(C.Mat_SolvePoly(coeffs.p, roots.p, C.int(maxIters)))\n}\n\ntype ReduceTypes int\n\nconst (\n\t// The output is the sum of all rows/columns of the matrix.\n\tReduceSum ReduceTypes = 0\n\n\t// The output is the mean vector of all rows/columns of the matrix.\n\tReduceAvg ReduceTypes = 1\n\n\t// The output is the maximum (column/row-wise) of all rows/columns of the matrix.\n\tReduceMax ReduceTypes = 2\n\n\t// The output is the minimum (column/row-wise) of all rows/columns of the matrix.\n\tReduceMin ReduceTypes = 3\n)\n\n// Reduce reduces a matrix to a vector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga4b78072a303f29d9031d56e5638da78e\nfunc Reduce(src Mat, dst *Mat, dim int, rType ReduceTypes, dType MatType) error {\n\treturn OpenCVResult(C.Mat_Reduce(src.p, dst.p, C.int(dim), C.int(rType), C.int(dType)))\n}\n\n// Finds indices of max elements along provided axis.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa87ea34d99bcc5bf9695048355163da0\nfunc ReduceArgMax(src Mat, dst *Mat, axis int, lastIndex bool) error {\n\treturn OpenCVResult(C.Mat_ReduceArgMax(src.p, dst.p, C.int(axis), C.bool(lastIndex)))\n}\n\n// Finds indices of min elements along provided axis.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaeecd548276bfb91b938989e66b722088\nfunc ReduceArgMin(src Mat, dst *Mat, axis int, lastIndex bool) error {\n\treturn OpenCVResult(C.Mat_ReduceArgMin(src.p, dst.p, C.int(axis), C.bool(lastIndex)))\n}\n\n// Repeat fills the output array with repeated copies of the input array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga496c3860f3ac44c40b48811333cfda2d\nfunc Repeat(src Mat, nY int, nX int, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Repeat(src.p, C.int(nY), C.int(nX), dst.p))\n}\n\n// Calculates the sum of a scaled array and another array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9e0845db4135f55dcf20227402f00d98\nfunc ScaleAdd(src1 Mat, alpha float64, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_ScaleAdd(src1.p, C.double(alpha), src2.p, dst.p))\n}\n\n// SetIdentity initializes a scaled identity matrix.\n// For further details, please see:\n//\n//\thttps://docs.opencv.org/master/d2/de8/group__core__array.html#ga388d7575224a4a277ceb98ccaa327c99\nfunc SetIdentity(src Mat, scalar float64) error {\n\treturn OpenCVResult(C.Mat_SetIdentity(src.p, C.double(scalar)))\n}\n\ntype SortFlags int\n\nconst (\n\t// Each matrix row is sorted independently\n\tSortEveryRow SortFlags = 0\n\n\t// Each matrix column is sorted independently; this flag and the previous one are mutually exclusive.\n\tSortEveryColumn SortFlags = 1\n\n\t// Each matrix row is sorted in the ascending order.\n\tSortAscending SortFlags = 0\n\n\t// Each matrix row is sorted in the descending order; this flag and the previous one are also mutually exclusive.\n\tSortDescending SortFlags = 16\n)\n\n// Sort sorts each row or each column of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga45dd56da289494ce874be2324856898f\nfunc Sort(src Mat, dst *Mat, flags SortFlags) error {\n\treturn OpenCVResult(C.Mat_Sort(src.p, dst.p, C.int(flags)))\n}\n\n// SortIdx sorts each row or each column of a matrix.\n// Instead of reordering the elements themselves, it stores the indices of sorted elements in the output array\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gadf35157cbf97f3cb85a545380e383506\nfunc SortIdx(src Mat, dst *Mat, flags SortFlags) error {\n\treturn OpenCVResult(C.Mat_SortIdx(src.p, dst.p, C.int(flags)))\n}\n\n// Split creates an array of single channel images from a multi-channel image\n// Created images should be closed manualy to avoid memory leaks.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga0547c7fed86152d7e9d0096029c8518a\nfunc Split(src Mat) (mv []Mat) {\n\tcMats := C.struct_Mats{}\n\tC.Mat_Split(src.p, &(cMats))\n\tdefer C.Mats_Close(cMats)\n\tmv = make([]Mat, cMats.length)\n\tfor i := C.int(0); i < cMats.length; i++ {\n\t\tmv[i].p = C.Mats_get(cMats, i)\n\t\taddMatToProfile(mv[i].p)\n\t}\n\treturn\n}\n\n// Subtract calculates the per-element subtraction of two arrays or an array and a scalar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa0f00d98b4b5edeaeb7b8333b2de353b\nfunc Subtract(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Subtract(src1.p, src2.p, dst.p))\n}\n\n// Trace returns the trace of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga3419ac19c7dcd2be4bd552a23e147dd8\nfunc Trace(src Mat) Scalar {\n\ts := C.Mat_Trace(src.p)\n\treturn NewScalar(float64(s.val1), float64(s.val2), float64(s.val3), float64(s.val4))\n}\n\n// Transform performs the matrix transformation of every array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga393164aa54bb9169ce0a8cc44e08ff22\nfunc Transform(src Mat, dst *Mat, tm Mat) error {\n\treturn OpenCVResult(C.Mat_Transform(src.p, dst.p, tm.p))\n}\n\n// Transpose transposes a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga46630ed6c0ea6254a35f447289bd7404\nfunc Transpose(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Transpose(src.p, dst.p))\n}\n\n// TransposeND transpose for n-dimensional matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gab1b1274b4a563be34cdfa55b8919a4ec\nfunc TransposeND(src Mat, order []int, dst *Mat) error {\n\tcOrderArray := make([]C.int, len(order))\n\tfor i, o := range order {\n\t\tcOrderArray[i] = C.int(o)\n\t}\n\n\tcOrderVector := C.IntVector{\n\t\tval:    (*C.int)(&cOrderArray[0]),\n\t\tlength: C.int(len(order)),\n\t}\n\n\treturn OpenCVResult(C.Mat_TransposeND(src.p, cOrderVector, dst.p))\n}\n\n// Pow raises every array element to a power.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaf0d056b5bd1dc92500d6f6cf6bac41ef\nfunc Pow(src Mat, power float64, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Pow(src.p, C.double(power), dst.p))\n}\n\n// PolatToCart calculates x and y coordinates of 2D vectors from their magnitude and angle.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga581ff9d44201de2dd1b40a50db93d665\nfunc PolarToCart(magnitude Mat, degree Mat, x *Mat, y *Mat, angleInDegrees bool) error {\n\treturn OpenCVResult(C.Mat_PolarToCart(magnitude.p, degree.p, x.p, y.p, C.bool(angleInDegrees)))\n}\n\n// Phase calculates the rotation angle of 2D vectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga9db9ca9b4d81c3bde5677b8f64dc0137\nfunc Phase(x, y Mat, angle *Mat, angleInDegrees bool) error {\n\treturn OpenCVResult(C.Mat_Phase(x.p, y.p, angle.p, C.bool(angleInDegrees)))\n}\n\n// TermCriteria is the criteria for iterative algorithms.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d5d/classcv_1_1TermCriteria.html\ntype TermCriteria struct {\n\tp C.TermCriteria\n}\n\n// NewTermCriteria returns a new TermCriteria.\nfunc NewTermCriteria(typ TermCriteriaType, maxCount int, epsilon float64) TermCriteria {\n\treturn TermCriteria{p: C.TermCriteria_New(C.int(typ), C.int(maxCount), C.double(epsilon))}\n}\n\n// Ptr returns the underlying C.TermCriteria\nfunc (tc *TermCriteria) Ptr() C.TermCriteria {\n\treturn tc.p\n}\n\n// Scalar is a 4-element vector widely used in OpenCV to pass pixel values.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/da0/classcv_1_1Scalar__.html\ntype Scalar struct {\n\tVal1 float64\n\tVal2 float64\n\tVal3 float64\n\tVal4 float64\n}\n\n// NewScalar returns a new Scalar. These are usually colors typically being in BGR order.\nfunc NewScalar(v1 float64, v2 float64, v3 float64, v4 float64) Scalar {\n\ts := Scalar{Val1: v1, Val2: v2, Val3: v3, Val4: v4}\n\treturn s\n}\n\n// KeyPoint is data structure for salient point detectors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/d29/classcv_1_1KeyPoint.html\ntype KeyPoint struct {\n\tX, Y                  float64\n\tSize, Angle, Response float64\n\tOctave, ClassID       int\n}\n\n// DMatch is data structure for matching keypoint descriptors.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/de0/classcv_1_1DMatch.html#a546ddb9a87898f06e510e015a6de596e\ntype DMatch struct {\n\tQueryIdx int\n\tTrainIdx int\n\tImgIdx   int\n\tDistance float64\n}\n\n// Vecb is a generic vector of bytes.\ntype Vecb []uint8\n\n// GetVecbAt returns a vector of bytes. Its size corresponds to the number\n// of channels of the Mat.\nfunc (m *Mat) GetVecbAt(row int, col int) Vecb {\n\tch := m.Channels()\n\tv := make(Vecb, ch)\n\n\tfor c := 0; c < ch; c++ {\n\t\tv[c] = m.GetUCharAt(row, col*ch+c)\n\t}\n\n\treturn v\n}\n\n// Vecf is a generic vector of floats.\ntype Vecf []float32\n\n// GetVecfAt returns a vector of floats. Its size corresponds to the number of\n// channels of the Mat.\nfunc (m *Mat) GetVecfAt(row int, col int) Vecf {\n\tch := m.Channels()\n\tv := make(Vecf, ch)\n\n\tfor c := 0; c < ch; c++ {\n\t\tv[c] = m.GetFloatAt(row, col*ch+c)\n\t}\n\n\treturn v\n}\n\n// Vecd is a generic vector of float64/doubles.\ntype Vecd []float64\n\n// GetVecdAt returns a vector of float64s. Its size corresponds to the number\n// of channels of the Mat.\nfunc (m *Mat) GetVecdAt(row int, col int) Vecd {\n\tch := m.Channels()\n\tv := make(Vecd, ch)\n\n\tfor c := 0; c < ch; c++ {\n\t\tv[c] = m.GetDoubleAt(row, col*ch+c)\n\t}\n\n\treturn v\n}\n\n// Veci is a generic vector of integers.\ntype Veci []int32\n\n// GetVeciAt returns a vector of integers. Its size corresponds to the number\n// of channels of the Mat.\nfunc (m *Mat) GetVeciAt(row int, col int) Veci {\n\tch := m.Channels()\n\tv := make(Veci, ch)\n\n\tfor c := 0; c < ch; c++ {\n\t\tv[c] = m.GetIntAt(row, col*ch+c)\n\t}\n\n\treturn v\n}\n\n// PointVector is a wrapper around a std::vector< cv::Point >*\n// This is needed anytime that you need to pass or receive a collection of points.\ntype PointVector struct {\n\tp C.PointVector\n}\n\n// NewPointVector returns a new empty PointVector.\nfunc NewPointVector() PointVector {\n\treturn PointVector{p: C.PointVector_New()}\n}\n\n// NewPointVectorFromPoints returns a new PointVector that has been\n// initialized to a slice of image.Point.\nfunc NewPointVectorFromPoints(pts []image.Point) PointVector {\n\tp := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(pts))))\n\tdefer C.free(unsafe.Pointer(p))\n\n\th := unsafe.Slice(p, len(pts))\n\tfor j, point := range pts {\n\t\th[j] = C.struct_Point{\n\t\t\tx: C.int(point.X),\n\t\t\ty: C.int(point.Y),\n\t\t}\n\t}\n\n\tcpoints := C.struct_Points{\n\t\tpoints: (*C.Point)(p),\n\t\tlength: C.int(len(pts)),\n\t}\n\n\treturn PointVector{p: C.PointVector_NewFromPoints(cpoints)}\n}\n\n// NewPointVectorFromMat returns a new PointVector that has been\n// wrapped around a Mat of type CV_32SC2 with a single columm.\nfunc NewPointVectorFromMat(mat Mat) PointVector {\n\treturn PointVector{p: C.PointVector_NewFromMat(mat.p)}\n}\n\n// IsNil checks the CGo pointer in the PointVector.\nfunc (pv PointVector) IsNil() bool {\n\treturn pv.p == nil\n}\n\n// Size returns how many Point are in the PointVector.\nfunc (pv PointVector) Size() int {\n\treturn int(C.PointVector_Size(pv.p))\n}\n\n// At returns the image.Point\nfunc (pv PointVector) At(idx int) image.Point {\n\tif idx > pv.Size() {\n\t\treturn image.Point{}\n\t}\n\n\tcp := C.PointVector_At(pv.p, C.int(idx))\n\treturn image.Pt(int(cp.x), int(cp.y))\n}\n\n// Append appends an image.Point at end of the PointVector.\nfunc (pv PointVector) Append(point image.Point) {\n\tp := C.struct_Point{\n\t\tx: C.int(point.X),\n\t\ty: C.int(point.Y),\n\t}\n\n\tC.PointVector_Append(pv.p, p)\n\n\treturn\n}\n\n// ToPoints returns a slice of image.Point for the data in this PointVector.\nfunc (pv PointVector) ToPoints() []image.Point {\n\tpoints := make([]image.Point, pv.Size())\n\n\tfor j := 0; j < pv.Size(); j++ {\n\t\tpoints[j] = pv.At(j)\n\t}\n\treturn points\n}\n\n// Close closes and frees memory for this PointVector.\nfunc (pv PointVector) Close() {\n\tC.PointVector_Close(pv.p)\n}\n\n// PointsVector is a wrapper around a std::vector< std::vector< cv::Point > >*\ntype PointsVector struct {\n\tp C.PointsVector\n}\n\n// NewPointsVector returns a new empty PointsVector.\nfunc NewPointsVector() PointsVector {\n\treturn PointsVector{p: C.PointsVector_New()}\n}\n\n// NewPointsVectorFromPoints returns a new PointsVector that has been\n// initialized to a slice of slices of image.Point.\nfunc NewPointsVectorFromPoints(pts [][]image.Point) PointsVector {\n\tif len(pts) <= 0 {\n\t\treturn NewPointsVector()\n\t}\n\tpoints := make([]C.struct_Points, len(pts))\n\n\tfor i, pt := range pts {\n\t\tp := (*C.struct_Point)(C.malloc(C.size_t(C.sizeof_struct_Point * len(pt))))\n\t\tdefer C.free(unsafe.Pointer(p))\n\n\t\th := &reflect.SliceHeader{\n\t\t\tData: uintptr(unsafe.Pointer(p)),\n\t\t\tLen:  len(pt),\n\t\t\tCap:  len(pt),\n\t\t}\n\t\tpa := *(*[]C.Point)(unsafe.Pointer(h))\n\n\t\tfor j, point := range pt {\n\t\t\tpa[j] = C.struct_Point{\n\t\t\t\tx: C.int(point.X),\n\t\t\t\ty: C.int(point.Y),\n\t\t\t}\n\t\t}\n\n\t\tpoints[i] = C.struct_Points{\n\t\t\tpoints: (*C.Point)(p),\n\t\t\tlength: C.int(len(pt)),\n\t\t}\n\t}\n\n\tcPoints := C.struct_Contours{\n\t\tcontours: (*C.struct_Points)(&points[0]),\n\t\tlength:   C.int(len(pts)),\n\t}\n\n\treturn PointsVector{p: C.PointsVector_NewFromPoints(cPoints)}\n}\n\nfunc (pvs PointsVector) P() C.PointsVector {\n\treturn pvs.p\n}\n\n// ToPoints returns a slice of slices of image.Point for the data in this PointsVector.\nfunc (pvs PointsVector) ToPoints() [][]image.Point {\n\tppoints := make([][]image.Point, pvs.Size())\n\tfor i := 0; i < pvs.Size(); i++ {\n\t\tpts := pvs.At(i)\n\t\tpoints := make([]image.Point, pts.Size())\n\n\t\tfor j := 0; j < pts.Size(); j++ {\n\t\t\tpoints[j] = pts.At(j)\n\t\t}\n\t\tppoints[i] = points\n\t}\n\n\treturn ppoints\n}\n\n// IsNil checks the CGo pointer in the PointsVector.\nfunc (pvs PointsVector) IsNil() bool {\n\treturn pvs.p == nil\n}\n\n// Size returns how many vectors of Points are in the PointsVector.\nfunc (pvs PointsVector) Size() int {\n\treturn int(C.PointsVector_Size(pvs.p))\n}\n\n// At returns the PointVector at that index of the PointsVector.\nfunc (pvs PointsVector) At(idx int) PointVector {\n\tif idx > pvs.Size() {\n\t\treturn PointVector{}\n\t}\n\n\treturn PointVector{p: C.PointsVector_At(pvs.p, C.int(idx))}\n}\n\n// Append appends a PointVector at end of the PointsVector.\nfunc (pvs PointsVector) Append(pv PointVector) {\n\tif !pv.IsNil() {\n\t\tC.PointsVector_Append(pvs.p, pv.p)\n\t}\n\n\treturn\n}\n\n// Close closes and frees memory for this PointsVector.\nfunc (pvs PointsVector) Close() {\n\tC.PointsVector_Close(pvs.p)\n}\n\n// Point2fVector is a wrapper around a std::vector< cv::Point2f >*\n// This is needed anytime that you need to pass or receive a collection of points.\ntype Point2fVector struct {\n\tp C.Point2fVector\n}\n\n// NewPoint2fVector returns a new empty Point2fVector.\nfunc NewPoint2fVector() Point2fVector {\n\treturn Point2fVector{p: C.Point2fVector_New()}\n}\n\n// NewPoint2fVectorFromPoints returns a new Point2fVector that has been\n// initialized to a slice of image.Point.\nfunc NewPoint2fVectorFromPoints(pts []Point2f) Point2fVector {\n\tp := (*C.struct_Point2f)(C.malloc(C.size_t(C.sizeof_struct_Point2f * len(pts))))\n\tdefer C.free(unsafe.Pointer(p))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p)),\n\t\tLen:  len(pts),\n\t\tCap:  len(pts),\n\t}\n\tpa := *(*[]C.Point2f)(unsafe.Pointer(h))\n\n\tfor j, point := range pts {\n\t\tpa[j] = C.struct_Point2f{\n\t\t\tx: C.float(point.X),\n\t\t\ty: C.float(point.Y),\n\t\t}\n\t}\n\n\tcpoints := C.struct_Points2f{\n\t\tpoints: (*C.Point2f)(p),\n\t\tlength: C.int(len(pts)),\n\t}\n\n\treturn Point2fVector{p: C.Point2fVector_NewFromPoints(cpoints)}\n}\n\n// NewPoint2fVectorFromMat returns a new Point2fVector that has been\n// wrapped around a Mat of type CV_32FC2 with a single columm.\nfunc NewPoint2fVectorFromMat(mat Mat) Point2fVector {\n\treturn Point2fVector{p: C.Point2fVector_NewFromMat(mat.p)}\n}\n\n// IsNil checks the CGo pointer in the Point2fVector.\nfunc (pfv Point2fVector) IsNil() bool {\n\treturn pfv.p == nil\n}\n\n// Size returns how many Point are in the PointVector.\nfunc (pfv Point2fVector) Size() int {\n\treturn int(C.Point2fVector_Size(pfv.p))\n}\n\n// At returns the image.Point\nfunc (pfv Point2fVector) At(idx int) Point2f {\n\tif idx > pfv.Size() {\n\t\treturn Point2f{}\n\t}\n\n\tcp := C.Point2fVector_At(pfv.p, C.int(idx))\n\treturn Point2f{float32(cp.x), float32(cp.y)}\n}\n\n// ToPoints returns a slice of image.Point for the data in this PointVector.\nfunc (pfv Point2fVector) ToPoints() []Point2f {\n\tpoints := make([]Point2f, pfv.Size())\n\n\tfor j := 0; j < pfv.Size(); j++ {\n\t\tpoints[j] = pfv.At(j)\n\t}\n\treturn points\n}\n\n// Close closes and frees memory for this Point2fVector.\nfunc (pfv Point2fVector) Close() {\n\tC.Point2fVector_Close(pfv.p)\n}\n\n// GetTickCount returns the number of ticks.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/de0/group__core__utils.html#gae73f58000611a1af25dd36d496bf4487\nfunc GetTickCount() float64 {\n\treturn float64(C.GetCVTickCount())\n}\n\n// GetTickFrequency returns the number of ticks per second.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/de0/group__core__utils.html#ga705441a9ef01f47acdc55d87fbe5090c\nfunc GetTickFrequency() float64 {\n\treturn float64(C.GetTickFrequency())\n}\n\nfunc toByteArray(b []byte) (*C.struct_ByteArray, error) {\n\tif len(b) == 0 {\n\t\treturn nil, ErrEmptyByteSlice\n\t}\n\treturn &C.struct_ByteArray{\n\t\tdata:   (*C.char)(unsafe.Pointer(&b[0])),\n\t\tlength: C.int(len(b)),\n\t}, nil\n}\n\nfunc toGoBytes(b C.struct_ByteArray) []byte {\n\treturn C.GoBytes(unsafe.Pointer(b.data), b.length)\n}\n\n// Converts CStrings to a slice of Go strings even when the C strings are not contiguous in memory\nfunc toGoStrings(strs C.CStrings) []string {\n\tlength := int(strs.length)\n\ttmpslice := (*[1 << 20]*C.char)(unsafe.Pointer(strs.strs))[:length:length]\n\tgostrings := make([]string, length)\n\tfor i, s := range tmpslice {\n\t\tgostrings[i] = C.GoString(s)\n\t}\n\treturn gostrings\n}\n\nfunc toRectangles(ret C.Rects) []image.Rectangle {\n\tcArray := ret.rects\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.Rect)(unsafe.Pointer(&hdr))\n\n\trects := make([]image.Rectangle, length)\n\tfor i, r := range s {\n\t\trects[i] = image.Rect(int(r.x), int(r.y), int(r.x+r.width), int(r.y+r.height))\n\t}\n\treturn rects\n}\n\nfunc toRect(rect C.Rect) image.Rectangle {\n\treturn image.Rect(int(rect.x), int(rect.y), int(rect.x+rect.width), int(rect.y+rect.height))\n}\n\nfunc toCPoints(points []image.Point) C.struct_Points {\n\tcPointSlice := make([]C.struct_Point, len(points))\n\tfor i, point := range points {\n\t\tcPointSlice[i] = C.struct_Point{\n\t\t\tx: C.int(point.X),\n\t\t\ty: C.int(point.Y),\n\t\t}\n\t}\n\n\treturn C.struct_Points{\n\t\tpoints: (*C.Point)(&cPointSlice[0]),\n\t\tlength: C.int(len(points)),\n\t}\n}\n\nfunc toCPoints2f(points []Point2f) C.struct_Points2f {\n\tcPointSlice := make([]C.struct_Point2f, len(points))\n\tfor i, point := range points {\n\t\tcPointSlice[i] = C.struct_Point2f{\n\t\t\tx: C.float(point.X),\n\t\t\ty: C.float(point.Y),\n\t\t}\n\t}\n\n\treturn C.struct_Points2f{\n\t\tpoints: (*C.Point2f)(&cPointSlice[0]),\n\t\tlength: C.int(len(points)),\n\t}\n}\n\nfunc toCStrings(strs []string) C.struct_CStrings {\n\tcStringsSlice := make([]*C.char, len(strs))\n\tfor i, s := range strs {\n\t\tcStringsSlice[i] = C.CString(s)\n\t}\n\n\treturn C.struct_CStrings{\n\t\tstrs:   (**C.char)(&cStringsSlice[0]),\n\t\tlength: C.int(len(strs)),\n\t}\n}\n\n// RowRange creates a matrix header for the specified row span.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aa6542193430356ad631a9beabc624107\nfunc (m *Mat) RowRange(start, end int) Mat {\n\treturn newMat(C.Mat_rowRange(m.p, C.int(start), C.int(end)))\n}\n\n// ColRange creates a matrix header for the specified column span.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d63/classcv_1_1Mat.html#aadc8f9210fe4dec50513746c246fa8d9\nfunc (m *Mat) ColRange(start, end int) Mat {\n\treturn newMat(C.Mat_colRange(m.p, C.int(start), C.int(end)))\n}\n\n// RNG Random Number Generator.\n// It encapsulates the state (currently, a 64-bit integer) and\n// has methods to return scalar random values and to fill arrays\n// with random values\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html\ntype RNG struct {\n\tp C.RNG\n}\n\ntype RNGDistType int\n\nconst (\n\t// Uniform distribution\n\tRNGDistUniform RNGDistType = 0\n\t// Normal distribution\n\tRNGDistNormal RNGDistType = 1\n)\n\n// TheRNG Returns the default random number generator.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga75843061d150ad6564b5447e38e57722\nfunc TheRNG() RNG {\n\treturn RNG{\n\t\tp: C.TheRNG(),\n\t}\n}\n\n// TheRNG Sets state of default random number generator.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga757e657c037410d9e19e819569e7de0f\nfunc SetRNGSeed(seed int) {\n\tC.SetRNGSeed(C.int(seed))\n}\n\n// Fill Fills arrays with random numbers.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#ad26f2b09d9868cf108e84c9814aa682d\nfunc (r *RNG) Fill(mat *Mat, distType RNGDistType, a, b float64, saturateRange bool) {\n\tC.RNG_Fill(r.p, mat.p, C.int(distType), C.double(a), C.double(b), C.bool(saturateRange))\n}\n\n// Gaussian Returns the next random number sampled from\n// the Gaussian distribution.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#a8df8ce4dc7d15916cee743e5a884639d\nfunc (r *RNG) Gaussian(sigma float64) float64 {\n\treturn float64(C.RNG_Gaussian(r.p, C.double(sigma)))\n}\n\n// Next The method updates the state using the MWC algorithm\n// and returns the next 32-bit random number.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dd6/classcv_1_1RNG.html#a8df8ce4dc7d15916cee743e5a884639d\nfunc (r *RNG) Next() uint {\n\treturn uint(C.RNG_Next(r.p))\n}\n\n// RandN Fills the array with normally distributed random numbers.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#gaeff1f61e972d133a04ce3a5f81cf6808\nfunc RandN(mat *Mat, mean, stddev Scalar) {\n\tmeanVal := C.struct_Scalar{\n\t\tval1: C.double(mean.Val1),\n\t\tval2: C.double(mean.Val2),\n\t\tval3: C.double(mean.Val3),\n\t\tval4: C.double(mean.Val4),\n\t}\n\tstddevVal := C.struct_Scalar{\n\t\tval1: C.double(stddev.Val1),\n\t\tval2: C.double(stddev.Val2),\n\t\tval3: C.double(stddev.Val3),\n\t\tval4: C.double(stddev.Val4),\n\t}\n\n\tC.RandN(mat.p, meanVal, stddevVal)\n}\n\n// RandShuffle Shuffles the array elements randomly.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763\nfunc RandShuffle(mat *Mat) {\n\tC.RandShuffle(mat.p)\n}\n\n// RandShuffleWithParams Shuffles the array elements randomly.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga6a789c8a5cb56c6dd62506179808f763\nfunc RandShuffleWithParams(mat *Mat, iterFactor float64, rng RNG) {\n\tC.RandShuffleWithParams(mat.p, C.double(iterFactor), rng.p)\n}\n\n// RandU Generates a single uniformly-distributed random\n// number or an array of random numbers.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1ba1026dca0807b27057ba6a49d258c0\nfunc RandU(mat *Mat, low, high Scalar) {\n\tlowVal := C.struct_Scalar{\n\t\tval1: C.double(low.Val1),\n\t\tval2: C.double(low.Val2),\n\t\tval3: C.double(low.Val3),\n\t\tval4: C.double(low.Val4),\n\t}\n\thighVal := C.struct_Scalar{\n\t\tval1: C.double(high.Val1),\n\t\tval2: C.double(high.Val2),\n\t\tval3: C.double(high.Val3),\n\t\tval4: C.double(high.Val4),\n\t}\n\n\tC.RandU(mat.p, lowVal, highVal)\n}\n\ntype NativeByteBuffer struct {\n\t// std::vector is build of 3 pointers And this will not change ever.\n\tstdVectorOpaq [3]uintptr\n}\n\nfunc newNativeByteBuffer() *NativeByteBuffer {\n\tbuffer := &NativeByteBuffer{}\n\tC.StdByteVectorInitialize(buffer.nativePointer())\n\treturn buffer\n}\n\nfunc (buffer *NativeByteBuffer) nativePointer() unsafe.Pointer {\n\treturn unsafe.Pointer(&buffer.stdVectorOpaq[0])\n}\n\nfunc (buffer *NativeByteBuffer) dataPointer() unsafe.Pointer {\n\treturn unsafe.Pointer(C.StdByteVectorData(buffer.nativePointer()))\n}\n\n// GetBytes returns slice of bytes backed by native buffer\nfunc (buffer *NativeByteBuffer) GetBytes() []byte {\n\tvar result []byte\n\tsliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&result))\n\tvectorLen := int(C.StdByteVectorLen(buffer.nativePointer()))\n\tsliceHeader.Cap = vectorLen\n\tsliceHeader.Len = vectorLen\n\tsliceHeader.Data = uintptr(buffer.dataPointer())\n\treturn result\n}\n\n// Len - returns length in bytes of underlying buffer\nfunc (buffer *NativeByteBuffer) Len() int {\n\treturn int(C.StdByteVectorLen(buffer.nativePointer()))\n}\n\n// Close the buffer releasing all its resources\nfunc (buffer *NativeByteBuffer) Close() {\n\tC.StdByteVectorFree(buffer.nativePointer())\n}\n\n// Points2fVector is a wrapper around a std::vector< std::vector< cv::Point2f > >*\ntype Points2fVector struct {\n\tp C.Points2fVector\n}\n\n// NewPoints2fVector returns a new empty Points2fVector.\nfunc NewPoints2fVector() Points2fVector {\n\treturn Points2fVector{p: C.Points2fVector_New()}\n}\n\n// NewPoints2fVectorFromPoints returns a new Points2fVector that has been\n// initialized to a slice of slices of Point2f.\nfunc NewPoints2fVectorFromPoints(pts [][]Point2f) Points2fVector {\n\tpvf := NewPoints2fVector()\n\tfor j := 0; j < len(pts); j++ {\n\t\tpv := NewPoint2fVectorFromPoints(pts[j])\n\t\tpvf.Append(pv)\n\t\tpv.Close()\n\t}\n\treturn pvf\n}\n\nfunc (pvs Points2fVector) P() C.Points2fVector {\n\treturn pvs.p\n}\n\n// ToPoints returns a slice of slices of Point2f for the data in this Points2fVector.\nfunc (pvs Points2fVector) ToPoints() [][]Point2f {\n\tppoints := make([][]Point2f, pvs.Size())\n\tfor j := 0; j < pvs.Size(); j++ {\n\t\tpts := pvs.At(j)\n\t\tpoints := pts.ToPoints()\n\t\tppoints[j] = points\n\t}\n\treturn ppoints\n}\n\n// IsNil checks the CGo pointer in the Points2fVector.\nfunc (pvs Points2fVector) IsNil() bool {\n\treturn pvs.p == nil\n}\n\n// Size returns how many vectors of Points are in the Points2fVector.\nfunc (pvs Points2fVector) Size() int {\n\treturn int(C.Points2fVector_Size(pvs.p))\n}\n\n// At returns the Point2fVector at that index of the Points2fVector.\nfunc (pvs Points2fVector) At(idx int) Point2fVector {\n\tif idx > pvs.Size() {\n\t\treturn Point2fVector{}\n\t}\n\treturn Point2fVector{p: C.Points2fVector_At(pvs.p, C.int(idx))}\n}\n\n// Append appends a Point2fVector at end of the Points2fVector.\nfunc (pvs Points2fVector) Append(pv Point2fVector) {\n\tif !pv.IsNil() {\n\t\tC.Points2fVector_Append(pvs.p, pv.p)\n\t}\n}\n\n// Close closes and frees memory for this Points2fVector.\nfunc (pvs Points2fVector) Close() {\n\tC.Points2fVector_Close(pvs.p)\n}\n\ntype Point3f struct {\n\tX float32\n\tY float32\n\tZ float32\n}\n\nfunc NewPoint3f(x, y, z float32) Point3f {\n\treturn Point3f{x, y, z}\n}\n\n// Point3fVector is a wrapper around a std::vector< cv::Point3f >*\ntype Point3fVector struct {\n\tp C.Point3fVector\n}\n\n// NewPoint3fVector returns a new empty Point3fVector.\nfunc NewPoint3fVector() Point3fVector {\n\treturn Point3fVector{p: C.Point3fVector_New()}\n}\n\n// NewPoint3fVectorFromPoints returns a new Point3fVector that has been\n// initialized to a slice of image.Point.\nfunc NewPoint3fVectorFromPoints(pts []Point3f) Point3fVector {\n\tp := (*C.struct_Point3f)(C.malloc(C.size_t(C.sizeof_struct_Point3f * len(pts))))\n\tdefer C.free(unsafe.Pointer(p))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(p)),\n\t\tLen:  len(pts),\n\t\tCap:  len(pts),\n\t}\n\tpa := *(*[]C.Point3f)(unsafe.Pointer(h))\n\n\tfor j, point := range pts {\n\t\tpa[j] = C.struct_Point3f{\n\t\t\tx: C.float(point.X),\n\t\t\ty: C.float(point.Y),\n\t\t\tz: C.float(point.Z),\n\t\t}\n\t}\n\n\tcPoints := C.struct_Points3f{\n\t\tpoints: (*C.Point3f)(p),\n\t\tlength: C.int(len(pts)),\n\t}\n\n\treturn Point3fVector{p: C.Point3fVector_NewFromPoints(cPoints)}\n}\n\n// NewPoint3fVectorFromMat returns a new Point3fVector that has been\n// wrapped around a Mat of type CV_32FC3 with a single columm.\nfunc NewPoint3fVectorFromMat(mat Mat) Point3fVector {\n\treturn Point3fVector{p: C.Point3fVector_NewFromMat(mat.p)}\n}\n\n// IsNil checks the CGo pointer in the Point3fVector.\nfunc (pfv Point3fVector) IsNil() bool {\n\treturn pfv.p == nil\n}\n\n// Size returns how many Point are in the Point3fVector.\nfunc (pfv Point3fVector) Size() int {\n\treturn int(C.Point3fVector_Size(pfv.p))\n}\n\n// At returns the Point3f\nfunc (pfv Point3fVector) At(idx int) Point3f {\n\tif idx > pfv.Size() {\n\t\treturn Point3f{}\n\t}\n\tcp := C.Point3fVector_At(pfv.p, C.int(idx))\n\treturn Point3f{X: float32(cp.x), Y: float32(cp.y), Z: float32(cp.z)}\n}\n\nfunc (pfv Point3fVector) Append(point Point3f) {\n\tC.Point3fVector_Append(pfv.p, C.Point3f{\n\t\tx: C.float(point.X),\n\t\ty: C.float(point.Y),\n\t\tz: C.float(point.Z),\n\t})\n}\n\n// ToPoints returns a slice of Point3f for the data in this Point3fVector.\nfunc (pfv Point3fVector) ToPoints() []Point3f {\n\tpoints := make([]Point3f, pfv.Size())\n\tfor j := 0; j < pfv.Size(); j++ {\n\t\tpoints[j] = pfv.At(j)\n\t}\n\treturn points\n}\n\n// Close closes and frees memory for this Point3fVector.\nfunc (pfv Point3fVector) Close() {\n\tC.Point3fVector_Close(pfv.p)\n}\n\n// Points3fVector is a wrapper around a std::vector< std::vector< cv::Point3f > >*\ntype Points3fVector struct {\n\tp C.Points3fVector\n}\n\n// NewPoints3fVector returns a new empty Points3fVector.\nfunc NewPoints3fVector() Points3fVector {\n\treturn Points3fVector{p: C.Points3fVector_New()}\n}\n\n// NewPoints3fVectorFromPoints returns a new Points3fVector that has been\n// initialized to a slice of slices of Point3f.\nfunc NewPoints3fVectorFromPoints(pts [][]Point3f) Points3fVector {\n\tpvf := NewPoints3fVector()\n\tfor j := 0; j < len(pts); j++ {\n\t\tpv := NewPoint3fVectorFromPoints(pts[j])\n\t\tpvf.Append(pv)\n\t\tpv.Close()\n\t}\n\treturn pvf\n}\n\n// ToPoints returns a slice of slices of Point3f for the data in this Points3fVector.\nfunc (pvs Points3fVector) ToPoints() [][]Point3f {\n\tppoints := make([][]Point3f, pvs.Size())\n\tfor j := 0; j < pvs.Size(); j++ {\n\t\tpts := pvs.At(j)\n\t\tpoints := pts.ToPoints()\n\t\tppoints[j] = points\n\t}\n\treturn ppoints\n}\n\n// IsNil checks the CGo pointer in the Points3fVector.\nfunc (pvs Points3fVector) IsNil() bool {\n\treturn pvs.p == nil\n}\n\n// Size returns how many vectors of Points are in the Points3fVector.\nfunc (pvs Points3fVector) Size() int {\n\treturn int(C.Points3fVector_Size(pvs.p))\n}\n\n// At returns the Point3fVector at that index of the Points3fVector.\nfunc (pvs Points3fVector) At(idx int) Point3fVector {\n\tif idx > pvs.Size() {\n\t\treturn Point3fVector{}\n\t}\n\treturn Point3fVector{p: C.Points3fVector_At(pvs.p, C.int(idx))}\n}\n\n// Append appends a Point3fVector at end of the Points3fVector.\nfunc (pvs Points3fVector) Append(pv Point3fVector) {\n\tif !pv.IsNil() {\n\t\tC.Points3fVector_Append(pvs.p, pv.p)\n\t}\n}\n\n// Close closes and frees memory for this Points3fVector.\nfunc (pvs Points3fVector) Close() {\n\tC.Points3fVector_Close(pvs.p)\n}\n\n// Set the number of threads for OpenCV.\nfunc SetNumThreads(n int) {\n\tC.SetNumThreads(C.int(n))\n}\n\n// Get the number of threads for OpenCV.\nfunc GetNumThreads() int {\n\treturn int(C.GetNumThreads())\n}\n\n// NewRotatedRect creates [RotatedRect] (i.e. not up-right) rectangle on a plane.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/db/dd6/classcv_1_1RotatedRect.html#aba20dfc8444fff72bd820b616f0297ee\nfunc NewRotatedRect(center image.Point, width int, height int, angle float64) RotatedRect {\n\n\tp2f := C.struct_Point2f{\n\t\tx: C.float(float32(center.X)),\n\t\ty: C.float(float32(center.Y)),\n\t}\n\n\tc_rotRect := C.RotatedRect_Create(p2f, C.int(width), C.int(height), C.float(angle))\n\tdefer C.Points_Close(c_rotRect.pts)\n\n\treturn RotatedRect{\n\t\tPoints:       toPoints(c_rotRect.pts),\n\t\tBoundingRect: image.Rect(int(c_rotRect.boundingRect.x), int(c_rotRect.boundingRect.y), int(c_rotRect.boundingRect.x)+int(c_rotRect.boundingRect.width), int(c_rotRect.boundingRect.y)+int(c_rotRect.boundingRect.height)),\n\t\tCenter:       image.Pt(int(c_rotRect.center.x), int(c_rotRect.center.y)),\n\t\tWidth:        int(c_rotRect.size.width),\n\t\tHeight:       int(c_rotRect.size.height),\n\t\tAngle:        float64(c_rotRect.angle),\n\t}\n\n}\n\n// NewRotatedRect2f creates [RotatedRect2f] (i.e. not up-right) rectangle on a plane.\n//\n// For further information, see:\n// https://docs.opencv.org/4.x/db/dd6/classcv_1_1RotatedRect.html#aba20dfc8444fff72bd820b616f0297ee\nfunc NewRotatedRect2f(center Point2f, width float32, height float32, angle float64) RotatedRect2f {\n\tp2f := C.struct_Point2f{\n\t\tx: C.float(center.X),\n\t\ty: C.float(center.Y),\n\t}\n\tc_rotRect2f := C.RotatedRect2f_Create(p2f, C.float(width), C.float(height), C.float(angle))\n\tdefer C.Points2f_Close(c_rotRect2f.pts)\n\n\treturn RotatedRect2f{\n\t\tPoints:       toPoints2f(c_rotRect2f.pts),\n\t\tBoundingRect: image.Rect(int(c_rotRect2f.boundingRect.x), int(c_rotRect2f.boundingRect.y), int(c_rotRect2f.boundingRect.x)+int(c_rotRect2f.boundingRect.width), int(c_rotRect2f.boundingRect.y)+int(c_rotRect2f.boundingRect.height)),\n\t\tCenter:       NewPoint2f(float32(c_rotRect2f.center.x), float32(c_rotRect2f.center.y)),\n\t\tWidth:        float32(c_rotRect2f.size.width),\n\t\tHeight:       float32(c_rotRect2f.size.height),\n\t\tAngle:        float64(c_rotRect2f.angle),\n\t}\n}\n"
  },
  {
    "path": "core.h",
    "content": "#ifndef _OPENCV3_CORE_H_\n#define _OPENCV3_CORE_H_\n\n#include <stdint.h>\n#include <stdbool.h>\n\n// Wrapper for std::vector<string>\ntypedef struct CStrings {\n    const char** strs;\n    int length;\n} CStrings;\n\ntypedef struct ByteArray {\n    char* data;\n    int length;\n} ByteArray;\n\n// Wrapper for std::vector<int>\ntypedef struct IntVector {\n    int* val;\n    int length;\n} IntVector;\n\n// Wrapper for std::vector<float>\ntypedef struct FloatVector {\n    float* val;\n    int length;\n} FloatVector;\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\ntypedef struct RawData {\n    int width;\n    int height;\n    struct ByteArray data;\n} RawData;\n\n// Wrapper for an individual cv::Point2f\ntypedef struct Point2f {\n    float x;\n    float y;\n} Point2f;\n\ntypedef struct Point3f {\n    float x;\n    float y;\n    float z;\n} Point3f;\n\n// Wrapper for an individual cv::cvPoint\ntypedef struct Point {\n    int x;\n    int y;\n} Point;\n\n// Wrapper for the vector of Point structs aka std::vector<Point>\ntypedef struct Points {\n    Point* points;\n    int length;\n} Points;\n\n// Wrapper for the vector of Point2f structs aka std::vector<Point2f>\ntypedef struct Points2f {\n    Point2f* points;\n    int length;\n} Points2f;\n\ntypedef struct Points3f {\n    Point3f *points;\n    int length;\n} Points3f;\n\n// Contour is alias for Points\ntypedef Points Contour;\n\n\n// Contour2f is alias for Points2f\ntypedef Points2f Contour2f;\n\ntypedef struct Contours2f {\n    Contour2f *contours;\n    int length;\n} Contours2f;\n\n// Contour3f is alias for Points3f\ntypedef Points3f Contour3f;\n\n// Wrapper for the vector of Points3f vectors aka std::vector< std::vector<Point3f> >\ntypedef struct Contours3f {\n    Contour3f *contours;\n    int length;\n} Contours3f;\n\n\n// Wrapper for the vector of Points vectors aka std::vector< std::vector<Point> >\ntypedef struct Contours {\n    Contour* contours;\n    int length;\n} Contours;\n\n// Wrapper for an individual cv::cvRect\ntypedef struct Rect {\n    int x;\n    int y;\n    int width;\n    int height;\n} Rect;\n\n// Wrapper for an individual cv::cvRect2f\ntypedef struct Rect2f {\n    float x;\n    float y;\n    float width;\n    float height;\n} Rect2f;\n\n// Wrapper for the vector of Rect struct aka std::vector<Rect>\ntypedef struct Rects {\n    Rect* rects;\n    int length;\n} Rects;\n\n// Wrapper for an individual cv::cvSize\ntypedef struct Size {\n    int width;\n    int height;\n} Size;\n\n// Wrapper for an individual cv::cvSize\ntypedef struct Size2f {\n    float width;\n    float height;\n} Size2f;\n\n// Wrapper for an individual cv::RotatedRect\ntypedef struct RotatedRect {\n    Points pts;\n    Rect boundingRect;\n    Point center;\n    Size size;\n    double angle;\n} RotatedRect;\n\n// Wrapper for an individual cv::RotatedRect2f\ntypedef struct RotatedRect2f {\n    Points2f pts;\n    Rect boundingRect;\n    Point2f center;\n    Size2f size;\n    double angle;\n} RotatedRect2f;\n\n// Wrapper for an individual cv::cvScalar\ntypedef struct Scalar {\n    double val1;\n    double val2;\n    double val3;\n    double val4;\n} Scalar;\n\n// Wrapper for a individual cv::KeyPoint\ntypedef struct KeyPoint {\n    double x;\n    double y;\n    double size;\n    double angle;\n    double response;\n    int octave;\n    int classID;\n} KeyPoint;\n\n// Wrapper for the vector of KeyPoint struct aka std::vector<KeyPoint>\ntypedef struct KeyPoints {\n    KeyPoint* keypoints;\n    int length;\n} KeyPoints;\n\n// Wrapper for SimpleBlobDetectorParams aka SimpleBlobDetector::Params\ntypedef struct SimpleBlobDetectorParams {\n    unsigned char   blobColor;\n    bool    filterByArea;\n    bool    filterByCircularity;\n    bool    filterByColor;\n    bool    filterByConvexity;\n    bool    filterByInertia;\n    float   maxArea;\n    float   maxCircularity;\n    float   maxConvexity;\n    float   maxInertiaRatio;\n    float   maxThreshold;\n    float   minArea;\n    float   minCircularity;\n    float   minConvexity;\n    float   minDistBetweenBlobs;\n    float   minInertiaRatio;\n    size_t  minRepeatability;\n    float   minThreshold;\n    float   thresholdStep;\n} SimpleBlobDetectorParams;\n\ntypedef struct GFTTDetectorParams {\n    int maxCorners;\n    double qualityLevel;\n    double minDistance;\n    int blockSize;\n    bool useHarrisDetector;\n    double k;\n}GFTTDetectorParams;\n\n// Wrapper for an individual cv::DMatch\ntypedef struct DMatch {\n    int queryIdx;\n    int trainIdx;\n    int imgIdx;\n    float distance;\n} DMatch;\n\n// Wrapper for the vector of DMatch struct aka std::vector<DMatch>\ntypedef struct DMatches {\n    DMatch* dmatches;\n    int length;\n} DMatches;\n\n// Wrapper for the vector vector of DMatch struct aka std::vector<std::vector<DMatch>>\ntypedef struct MultiDMatches {\n    DMatches* dmatches;\n    int length;\n} MultiDMatches;\n\n// Wrapper for an individual cv::Moment\ntypedef struct Moment {\n    double m00;\n    double m10;\n    double m01;\n    double m20;\n    double m11;\n    double m02;\n    double m30;\n    double m21;\n    double m12;\n    double m03;\n\n    double mu20;\n    double mu11;\n    double mu02;\n    double mu30;\n    double mu21;\n    double mu12;\n    double mu03;\n\n    double nu20;\n    double nu11;\n    double nu02;\n    double nu30;\n    double nu21;\n    double nu12;\n    double nu03;\n} Moment;\n\n// OpenCVResult is a struct that contains the result of an OpenCV operation.\n// It contains a code and a message. The code of 0 mean success, while a non-zero\n// code means an error occurred.\n// This is needed to wrap the result of an OpenCV operation, since Go does not\n// have exceptions.\ntypedef struct OpenCVResult {\n    int Code;\n    const char* Message;\n    int Length;\n} OpenCVResult;\n\nint GetOpenCVException();\nconst char* GetOpenCVExceptionMessage();\nvoid ClearOpenCVException();\n\n#ifdef __cplusplus\ntypedef cv::Mat* Mat;\ntypedef cv::TermCriteria* TermCriteria;\ntypedef cv::RNG* RNG;\ntypedef std::vector< cv::Point >* PointVector;\ntypedef std::vector< std::vector< cv::Point > >* PointsVector;\ntypedef std::vector< cv::Point2f >* Point2fVector;\ntypedef std::vector< std::vector< cv::Point2f> >* Points2fVector;\ntypedef std::vector< cv::Point3f >* Point3fVector;\ntypedef std::vector< std::vector< cv::Point3f > >* Points3fVector;\ntypedef cv::RotatedRect* RotatedRectT;\n#else\ntypedef void* Mat;\ntypedef void* TermCriteria;\ntypedef void* RNG;\ntypedef void* PointVector;\ntypedef void* PointsVector;\ntypedef void* Point2fVector;\ntypedef void* Points2fVector;\ntypedef void* Point3fVector;\ntypedef void* Points3fVector;\ntypedef void* RotatedRectT;\n#endif\n\nvoid setExceptionInfo(int code, const char* message);\nOpenCVResult successResult();\nOpenCVResult errorResult(int code, const char* message);\n\n// Wrapper for the vector of Mat aka std::vector<Mat>\ntypedef struct Mats {\n    Mat* mats;\n    int length;\n} Mats;\n\nMat Mats_get(struct Mats mats, int i);\nstruct DMatches MultiDMatches_get(struct MultiDMatches mds, int index);\n\nstruct ByteArray toByteArray(const char* buf, int len);\nvoid ByteArray_Release(struct ByteArray buf);\n\nvoid Contours_Close(struct Contours cs);\nvoid KeyPoints_Close(struct KeyPoints ks);\nvoid Rects_Close(struct Rects rs);\nvoid Mats_Close(struct Mats mats);\nvoid Point_Close(struct Point p);\nvoid Points_Close(struct Points ps);\nvoid Point2f_Close(struct Point2f p);\nvoid Points2f_Close(struct Points2f ps);\nvoid DMatches_Close(struct DMatches ds);\nvoid MultiDMatches_Close(struct MultiDMatches mds);\n\nMat Mat_New();\nMat Mat_NewWithSize(int rows, int cols, int type);\nMat Mat_NewWithSizes(struct IntVector sizes, int type);\nMat Mat_NewWithSizesFromScalar(IntVector sizes, int type, Scalar ar);\nMat Mat_NewWithSizesFromBytes(IntVector sizes, int type, struct ByteArray buf);\nMat Mat_NewFromScalar(const Scalar ar, int type);\nMat Mat_NewWithSizeFromScalar(const Scalar ar, int rows, int cols, int type);\nMat Mat_NewFromBytes(int rows, int cols, int type, struct ByteArray buf);\nMat Mat_NewFromPoint2fVector(Point2fVector pfv, bool copy_data);\nMat Mat_NewFromPointVector(PointVector pv, bool copy_data);\nMat Mat_FromPtr(Mat m, int rows, int cols, int type, int prows, int pcols);\nvoid Mat_Close(Mat m);\nint Mat_Empty(Mat m);\nbool Mat_IsContinuous(Mat m);\nvoid Mat_Inv(Mat m);\nMat Mat_Col(Mat m, int c);\nMat Mat_Row(Mat m, int r);\nMat Mat_Copy(Mat m);\nMat Mat_Clone(Mat m);\nOpenCVResult Mat_CopyTo(Mat m, Mat dst);\nint Mat_Total(Mat m);\nvoid Mat_Size(Mat m, IntVector* res);\nOpenCVResult Mat_CopyToWithMask(Mat m, Mat dst, Mat mask);\nOpenCVResult Mat_ConvertTo(Mat m, Mat dst, int type);\nOpenCVResult Mat_ConvertToWithParams(Mat m, Mat dst, int type, float alpha, float beta);\nstruct ByteArray Mat_ToBytes(Mat m);\nstruct ByteArray Mat_DataPtr(Mat m);\nMat Mat_Region(Mat m, Rect r);\nMat Mat_Reshape(Mat m, int cn, int rows);\nMat Mat_ReshapeWithSize(Mat m, int cn, struct IntVector dims);\nOpenCVResult Mat_PatchNaNs(Mat m);\nMat Mat_ConvertFp16(Mat m);\nScalar Mat_Mean(Mat m);\nScalar Mat_MeanWithMask(Mat m, Mat mask);\nMat Mat_Sqrt(Mat m);\nint Mat_Rows(Mat m);\nint Mat_Cols(Mat m);\nint Mat_Channels(Mat m);\nint Mat_Type(Mat m);\nint Mat_Step(Mat m);\nint Mat_ElemSize(Mat m);\nMat Eye(int rows, int cols, int type);\nMat Zeros(int rows, int cols, int type);\nMat Ones(int rows, int cols, int type);\n\nuint8_t Mat_GetUChar(Mat m, int row, int col);\nuint8_t Mat_GetUChar3(Mat m, int x, int y, int z);\nint8_t Mat_GetSChar(Mat m, int row, int col);\nint8_t Mat_GetSChar3(Mat m, int x, int y, int z);\nint16_t Mat_GetShort(Mat m, int row, int col);\nint16_t Mat_GetShort3(Mat m, int x, int y, int z);\nint32_t Mat_GetInt(Mat m, int row, int col);\nint32_t Mat_GetInt3(Mat m, int x, int y, int z);\nfloat Mat_GetFloat(Mat m, int row, int col);\nfloat Mat_GetFloat3(Mat m, int x, int y, int z);\ndouble Mat_GetDouble(Mat m, int row, int col);\ndouble Mat_GetDouble3(Mat m, int x, int y, int z);\n\nvoid Mat_SetTo(Mat m, Scalar value);\nvoid Mat_SetUChar(Mat m, int row, int col, uint8_t val);\nvoid Mat_SetUChar3(Mat m, int x, int y, int z, uint8_t val);\nvoid Mat_SetSChar(Mat m, int row, int col, int8_t val);\nvoid Mat_SetSChar3(Mat m, int x, int y, int z, int8_t val);\nvoid Mat_SetShort(Mat m, int row, int col, int16_t val);\nvoid Mat_SetShort3(Mat m, int x, int y, int z, int16_t val);\nvoid Mat_SetInt(Mat m, int row, int col, int32_t val);\nvoid Mat_SetInt3(Mat m, int x, int y, int z, int32_t val);\nvoid Mat_SetFloat(Mat m, int row, int col, float val);\nvoid Mat_SetFloat3(Mat m, int x, int y, int z, float val);\nvoid Mat_SetDouble(Mat m, int row, int col, double val);\nvoid Mat_SetDouble3(Mat m, int x, int y, int z, double val);\n\nvoid Mat_AddUChar(Mat m, uint8_t val);\nvoid Mat_SubtractUChar(Mat m, uint8_t val);\nvoid Mat_MultiplyUChar(Mat m, uint8_t val);\nvoid Mat_DivideUChar(Mat m, uint8_t val);\nvoid Mat_AddFloat(Mat m, float val);\nvoid Mat_SubtractFloat(Mat m, float val);\nvoid Mat_MultiplyFloat(Mat m, float val);\nvoid Mat_DivideFloat(Mat m, float val);\nMat Mat_MultiplyMatrix(Mat x, Mat y);\n\nMat Mat_T(Mat x);\n\nOpenCVResult LUT(Mat src, Mat lut, Mat dst);\n\nOpenCVResult Mat_AbsDiff(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_Add(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_AddWeighted(Mat src1, double alpha, Mat src2, double beta, double gamma, Mat dst);\nOpenCVResult Mat_BitwiseAnd(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_BitwiseAndWithMask(Mat src1, Mat src2, Mat dst, Mat mask);\nOpenCVResult Mat_BitwiseNot(Mat src1, Mat dst);\nOpenCVResult Mat_BitwiseNotWithMask(Mat src1, Mat dst, Mat mask);\nOpenCVResult Mat_BitwiseOr(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_BitwiseOrWithMask(Mat src1, Mat src2, Mat dst, Mat mask);\nOpenCVResult Mat_BitwiseXor(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_BitwiseXorWithMask(Mat src1, Mat src2, Mat dst, Mat mask);\nOpenCVResult Mat_Compare(Mat src1, Mat src2, Mat dst, int ct);\nOpenCVResult Mat_BatchDistance(Mat src1, Mat src2, Mat dist, int dtype, Mat nidx, int normType, int K,\n                       Mat mask, int update, bool crosscheck);\nint Mat_BorderInterpolate(int p, int len, int borderType);\nOpenCVResult Mat_CalcCovarMatrix(Mat samples, Mat covar, Mat mean, int flags, int ctype);\nOpenCVResult Mat_CartToPolar(Mat x, Mat y, Mat magnitude, Mat angle, bool angleInDegrees);\nbool Mat_CheckRange(Mat m);\nOpenCVResult Mat_CompleteSymm(Mat m, bool lowerToUpper);\nOpenCVResult Mat_ConvertScaleAbs(Mat src, Mat dst, double alpha, double beta);\nOpenCVResult Mat_CopyMakeBorder(Mat src, Mat dst, int top, int bottom, int left, int right, int borderType,\n                        Scalar value);\nint Mat_CountNonZero(Mat src);\nOpenCVResult Mat_DCT(Mat src, Mat dst, int flags);\ndouble Mat_Determinant(Mat m);\nOpenCVResult Mat_DFT(Mat m, Mat dst, int flags);\nOpenCVResult Mat_Divide(Mat src1, Mat src2, Mat dst);\nbool Mat_Eigen(Mat src, Mat eigenvalues, Mat eigenvectors);\nOpenCVResult Mat_EigenNonSymmetric(Mat src, Mat eigenvalues, Mat eigenvectors);\nOpenCVResult Mat_PCABackProject(Mat data, Mat mean, Mat eigenvectors, Mat result);\nOpenCVResult Mat_PCACompute(Mat src, Mat mean, Mat eigenvectors, Mat eigenvalues, int maxComponents);\nOpenCVResult Mat_PCAProject(Mat data, Mat mean, Mat eigenvectors, Mat result);\ndouble PSNR(Mat src1, Mat src2);\nOpenCVResult SVBackSubst(Mat w, Mat u, Mat vt, Mat rhs, Mat dst);\nOpenCVResult SVDecomp(Mat src, Mat w, Mat u, Mat vt);\nOpenCVResult Mat_Exp(Mat src, Mat dst);\nOpenCVResult Mat_ExtractChannel(Mat src, Mat dst, int coi);\nOpenCVResult Mat_FindNonZero(Mat src, Mat idx);\nOpenCVResult Mat_Flip(Mat src, Mat dst, int flipCode);\nOpenCVResult Mat_Gemm(Mat src1, Mat src2, double alpha, Mat src3, double beta, Mat dst, int flags);\nint Mat_GetOptimalDFTSize(int vecsize);\nOpenCVResult Mat_Hconcat(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_Vconcat(Mat src1, Mat src2, Mat dst);\nOpenCVResult Rotate(Mat src, Mat dst, int rotationCode);\nOpenCVResult Mat_Idct(Mat src, Mat dst, int flags);\nOpenCVResult Mat_Idft(Mat src, Mat dst, int flags, int nonzeroRows);\nOpenCVResult Mat_InRange(Mat src, Mat lowerb, Mat upperb, Mat dst);\nOpenCVResult Mat_InRangeWithScalar(Mat src, const Scalar lowerb, const Scalar upperb, Mat dst);\nOpenCVResult Mat_InsertChannel(Mat src, Mat dst, int coi);\ndouble Mat_Invert(Mat src, Mat dst, int flags);\ndouble KMeans(Mat data, int k, Mat bestLabels, TermCriteria criteria, int attempts, int flags, Mat centers);\ndouble KMeansPoints(PointVector pts, int k, Mat bestLabels, TermCriteria criteria, int attempts, int flags, Mat centers);\nOpenCVResult Mat_Log(Mat src, Mat dst);\nOpenCVResult Mat_Magnitude(Mat x, Mat y, Mat magnitude);\ndouble Mat_Mahalanobis(Mat v1, Mat v2, Mat icovar);\nOpenCVResult MulTransposed(Mat src, Mat dest, bool ata);\nOpenCVResult Mat_Max(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_MeanStdDev(Mat src, Mat dstMean, Mat dstStdDev);\nOpenCVResult Mat_MeanStdDevWithMask(Mat src, Mat dstMean, Mat dstStdDev, Mat mask);\nOpenCVResult Mat_Merge(struct Mats mats, Mat dst);\nOpenCVResult Mat_Min(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_MinMaxIdx(Mat m, double* minVal, double* maxVal, int* minIdx, int* maxIdx);\nOpenCVResult Mat_MinMaxLoc(Mat m, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc);\nOpenCVResult Mat_MinMaxLocWithMask(Mat m, double* minVal, double* maxVal, Point* minLoc, Point* maxLoc, Mat mask);\nOpenCVResult Mat_MixChannels(struct Mats src, struct Mats dst, struct IntVector fromTo);\nOpenCVResult Mat_MulSpectrums(Mat a, Mat b, Mat c, int flags);\nOpenCVResult Mat_Multiply(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_MultiplyWithParams(Mat src1, Mat src2, Mat dst, double scale, int dtype);\nOpenCVResult Mat_Subtract(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_Normalize(Mat src, Mat dst, double alpha, double beta, int typ);\ndouble Norm(Mat src1, int normType);\ndouble NormWithMats(Mat src1, Mat src2, int normType);\nOpenCVResult Mat_PerspectiveTransform(Mat src, Mat dst, Mat tm);\nbool Mat_Solve(Mat src1, Mat src2, Mat dst, int flags);\nint Mat_SolveCubic(Mat coeffs, Mat roots);\ndouble Mat_SolvePoly(Mat coeffs, Mat roots, int maxIters);\nOpenCVResult Mat_Reduce(Mat src, Mat dst, int dim, int rType, int dType);\nOpenCVResult Mat_ReduceArgMax(Mat src, Mat dst, int axis, bool lastIndex);\nOpenCVResult Mat_ReduceArgMin(Mat src, Mat dst, int axis, bool lastIndex);\nOpenCVResult Mat_Repeat(Mat src, int nY, int nX, Mat dst);\nOpenCVResult Mat_ScaleAdd(Mat src1, double alpha, Mat src2, Mat dst);\nOpenCVResult Mat_SetIdentity(Mat src, double scalar);\nOpenCVResult Mat_Sort(Mat src, Mat dst, int flags);\nOpenCVResult Mat_SortIdx(Mat src, Mat dst, int flags);\nOpenCVResult Mat_Split(Mat src, struct Mats* mats);\nOpenCVResult Mat_Subtract(Mat src1, Mat src2, Mat dst);\nScalar Mat_Trace(Mat src);\nOpenCVResult Mat_Transform(Mat src, Mat dst, Mat tm);\nOpenCVResult Mat_Transpose(Mat src, Mat dst);\nOpenCVResult Mat_TransposeND(Mat src, struct IntVector order, Mat dst);\nOpenCVResult Mat_PolarToCart(Mat magnitude, Mat degree, Mat x, Mat y, bool angleInDegrees);\nOpenCVResult Mat_Pow(Mat src, double power, Mat dst);\nOpenCVResult Mat_Phase(Mat x, Mat y, Mat angle, bool angleInDegrees);\nScalar Mat_Sum(Mat src1);\n\nTermCriteria TermCriteria_New(int typ, int maxCount, double epsilon);\n\nint64_t GetCVTickCount();\ndouble GetTickFrequency();\n\nMat Mat_rowRange(Mat m,int startrow,int endrow);\nMat Mat_colRange(Mat m,int startrow,int endrow);\n\nPointVector PointVector_New();\nPointVector PointVector_NewFromPoints(Contour points);\nPointVector PointVector_NewFromMat(Mat mat);\nPoint PointVector_At(PointVector pv, int idx);\nvoid PointVector_Append(PointVector pv, Point p);\nint PointVector_Size(PointVector pv);\nvoid PointVector_Close(PointVector pv);\n\nPointsVector PointsVector_New();\nPointsVector PointsVector_NewFromPoints(Contours points);\nPointVector PointsVector_At(PointsVector psv, int idx);\nvoid PointsVector_Append(PointsVector psv, PointVector pv);\nint PointsVector_Size(PointsVector psv);\nvoid PointsVector_Close(PointsVector psv);\n\nPoint2fVector Point2fVector_New();\nvoid Point2fVector_Close(Point2fVector pfv);\nPoint2fVector Point2fVector_NewFromPoints(Contour2f pts);\nPoint2fVector Point2fVector_NewFromMat(Mat mat);\nPoint2f Point2fVector_At(Point2fVector pfv, int idx);\nint Point2fVector_Size(Point2fVector pfv);\n\nvoid IntVector_Close(struct IntVector ivec);\n\nvoid CStrings_Close(struct CStrings cstrs);\n\nRNG TheRNG();\n\nvoid SetRNGSeed(int seed);\n\nvoid RNG_Fill(RNG rng, Mat mat, int distType, double a, double b, bool saturateRange);\n\ndouble RNG_Gaussian(RNG rng, double sigma);\n\nunsigned int RNG_Next(RNG rng);\n\nvoid RandN(Mat mat, Scalar mean, Scalar stddev);\n\nvoid RandShuffle(Mat mat);\n\nvoid RandShuffleWithParams(Mat mat, double iterFactor, RNG rng);\n\nvoid RandU(Mat mat, Scalar low, Scalar high);\n\nvoid copyPointVectorToPoint2fVector(PointVector src, Point2fVector dest);\n\nvoid StdByteVectorInitialize(void* data);\nvoid StdByteVectorFree(void *data);\nsize_t StdByteVectorLen(void *data);\nuint8_t* StdByteVectorData(void *data);\n\nPoints2fVector Points2fVector_New();\nPoints2fVector Points2fVector_NewFromPoints(Contours2f points);\nint Points2fVector_Size(Points2fVector ps);\nPoint2fVector Points2fVector_At(Points2fVector ps, int idx);\nvoid Points2fVector_Append(Points2fVector psv, Point2fVector pv);\nvoid Points2fVector_Close(Points2fVector ps);\n\nPoint3fVector Point3fVector_New();\nPoint3fVector Point3fVector_NewFromPoints(Contour3f points);\nPoint3fVector Point3fVector_NewFromMat(Mat mat);\nvoid Point3fVector_Append(Point3fVector pfv, Point3f point);\nPoint3f Point3fVector_At(Point3fVector pfv, int idx);\nint Point3fVector_Size(Point3fVector pfv);\nvoid Point3fVector_Close(Point3fVector pv);\nPoints3fVector Points3fVector_New();\nPoints3fVector Points3fVector_NewFromPoints(Contours3f points);\nint Points3fVector_Size(Points3fVector ps);\nPoint3fVector Points3fVector_At(Points3fVector ps, int idx);\nvoid Points3fVector_Append(Points3fVector psv, Point3fVector pv);\nvoid Points3fVector_Close(Points3fVector ps);\n\nvoid SetNumThreads(int n);\nint GetNumThreads();\n\n\nstruct RotatedRect RotatedRect_Create(struct Point2f center, int width, int height, float angle);\nstruct RotatedRect2f RotatedRect2f_Create(struct Point2f center, float width, float height, float angle);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CORE_H_\n"
  },
  {
    "path": "core_string.go",
    "content": "package gocv\n\nfunc (c MatType) String() string {\n\tswitch c {\n\tcase MatTypeCV8U:\n\t\treturn \"CV8U\"\n\tcase MatTypeCV8UC2:\n\t\treturn \"CV8UC2\"\n\tcase MatTypeCV8UC3:\n\t\treturn \"CV8UC3\"\n\tcase MatTypeCV8UC4:\n\t\treturn \"CV8UC4\"\n\tcase MatTypeCV16U:\n\t\treturn \"CV16U\"\n\tcase MatTypeCV16UC2:\n\t\treturn \"CV16UC2\"\n\tcase MatTypeCV16UC3:\n\t\treturn \"CV16UC3\"\n\tcase MatTypeCV16UC4:\n\t\treturn \"CV16UC4\"\n\tcase MatTypeCV16S:\n\t\treturn \"CV16S\"\n\tcase MatTypeCV16SC2:\n\t\treturn \"CV16SC2\"\n\tcase MatTypeCV16SC3:\n\t\treturn \"CV16SC3\"\n\tcase MatTypeCV16SC4:\n\t\treturn \"CV16SC4\"\n\tcase MatTypeCV32S:\n\t\treturn \"CV32S\"\n\tcase MatTypeCV32SC2:\n\t\treturn \"CV32SC2\"\n\tcase MatTypeCV32SC3:\n\t\treturn \"CV32SC3\"\n\tcase MatTypeCV32SC4:\n\t\treturn \"CV32SC4\"\n\tcase MatTypeCV32F:\n\t\treturn \"CV32F\"\n\tcase MatTypeCV32FC2:\n\t\treturn \"CV32FC2\"\n\tcase MatTypeCV32FC3:\n\t\treturn \"CV32FC3\"\n\tcase MatTypeCV32FC4:\n\t\treturn \"CV32FC4\"\n\tcase MatTypeCV64F:\n\t\treturn \"CV64F\"\n\tcase MatTypeCV64FC2:\n\t\treturn \"CV64FC2\"\n\tcase MatTypeCV64FC3:\n\t\treturn \"CV64FC3\"\n\tcase MatTypeCV64FC4:\n\t\treturn \"CV64FC4\"\n\t}\n\treturn \"\"\n}\n\nfunc (c CompareType) String() string {\n\tswitch c {\n\tcase CompareEQ:\n\t\treturn \"eq\"\n\tcase CompareGT:\n\t\treturn \"gt\"\n\tcase CompareGE:\n\t\treturn \"ge\"\n\tcase CompareLT:\n\t\treturn \"lt\"\n\tcase CompareLE:\n\t\treturn \"le\"\n\tcase CompareNE:\n\t\treturn \"ne\"\n\t}\n\treturn \"\"\n}\n\nfunc (c CovarFlags) String() string {\n\tswitch c {\n\tcase CovarScrambled:\n\t\treturn \"covar-scrambled\"\n\tcase CovarNormal:\n\t\treturn \"covar-normal\"\n\tcase CovarUseAvg:\n\t\treturn \"covar-use-avg\"\n\tcase CovarScale:\n\t\treturn \"covar-scale\"\n\tcase CovarRows:\n\t\treturn \"covar-rows\"\n\tcase CovarCols:\n\t\treturn \"covar-cols\"\n\t}\n\treturn \"\"\n}\n\nfunc (c DftFlags) String() string {\n\tswitch c {\n\tcase DftForward:\n\t\treturn \"dft-forward\"\n\tcase DftInverse:\n\t\treturn \"dft-inverse\"\n\tcase DftScale:\n\t\treturn \"dft-scale\"\n\tcase DftRows:\n\t\treturn \"dft-rows\"\n\tcase DftComplexOutput:\n\t\treturn \"dft-complex-output\"\n\tcase DftRealOutput:\n\t\treturn \"dft-real-output\"\n\tcase DftComplexInput:\n\t\treturn \"dft-complex-input\"\n\t}\n\treturn \"\"\n}\n\nfunc (c RotateFlag) String() string {\n\tswitch c {\n\tcase Rotate90Clockwise:\n\t\treturn \"rotate-90-clockwise\"\n\tcase Rotate180Clockwise:\n\t\treturn \"rotate-180-clockwise\"\n\tcase Rotate90CounterClockwise:\n\t\treturn \"rotate-90-counter-clockwise\"\n\t}\n\treturn \"\"\n}\n\nfunc (c KMeansFlags) String() string {\n\tswitch c {\n\tcase KMeansRandomCenters:\n\t\treturn \"kmeans-random-centers\"\n\tcase KMeansPPCenters:\n\t\treturn \"kmeans-pp-centers\"\n\tcase KMeansUseInitialLabels:\n\t\treturn \"kmeans-use-initial-labels\"\n\t}\n\treturn \"\"\n}\n\nfunc (c NormType) String() string {\n\tswitch c {\n\tcase NormInf:\n\t\treturn \"norm-inf\"\n\tcase NormL1:\n\t\treturn \"norm-l1\"\n\tcase NormL2:\n\t\treturn \"norm-l2\"\n\tcase NormL2Sqr:\n\t\treturn \"norm-l2-sqr\"\n\tcase NormHamming:\n\t\treturn \"norm-hamming\"\n\tcase NormHamming2:\n\t\treturn \"norm-hamming2\"\n\tcase NormRelative:\n\t\treturn \"norm-relative\"\n\tcase NormMinMax:\n\t\treturn \"norm-minmax\"\n\t}\n\treturn \"\"\n}\n\nfunc (c TermCriteriaType) String() string {\n\tswitch c {\n\tcase Count:\n\t\treturn \"count\"\n\tcase EPS:\n\t\treturn \"eps\"\n\t}\n\treturn \"\"\n}\n\nfunc (c SolveDecompositionFlags) String() string {\n\tswitch c {\n\tcase SolveDecompositionLu:\n\t\treturn \"solve-decomposition-lu\"\n\tcase SolveDecompositionSvd:\n\t\treturn \"solve-decomposition-svd\"\n\tcase SolveDecompositionEing:\n\t\treturn \"solve-decomposition-eing\"\n\tcase SolveDecompositionCholesky:\n\t\treturn \"solve-decomposition-cholesky\"\n\tcase SolveDecompositionQr:\n\t\treturn \"solve-decomposition-qr\"\n\tcase SolveDecompositionNormal:\n\t\treturn \"solve-decomposition-normal\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ReduceTypes) String() string {\n\tswitch c {\n\tcase ReduceSum:\n\t\treturn \"reduce-sum\"\n\tcase ReduceAvg:\n\t\treturn \"reduce-avg\"\n\tcase ReduceMax:\n\t\treturn \"reduce-max\"\n\tcase ReduceMin:\n\t\treturn \"reduce-min\"\n\t}\n\treturn \"\"\n}\n\nfunc (c SortFlags) String() string {\n\tswitch c {\n\tcase SortEveryRow:\n\t\treturn \"sort-every-row\"\n\tcase SortEveryColumn:\n\t\treturn \"sort-every-column\"\n\tcase SortDescending:\n\t\treturn \"sort-descending\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "core_test.go",
    "content": "package gocv\n\nimport (\n\t\"bytes\"\n\t\"image\"\n\t\"image/color\"\n\t_ \"image/jpeg\"\n\t_ \"image/png\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestMat(t *testing.T) {\n\tmat := NewMat()\n\tdefer mat.Close()\n\tif !mat.Empty() {\n\t\tt.Error(\"New Mat should be empty\")\n\t}\n}\n\nfunc TestMatClosed(t *testing.T) {\n\tmat := NewMat()\n\tmat.Close()\n\tif !mat.Closed() {\n\t\tt.Error(\"Closed Mat should be closed\")\n\t}\n}\n\nfunc TestMatWithSizes(t *testing.T) {\n\tt.Run(\"create mat with multidimensional array\", func(t *testing.T) {\n\t\tsizes := []int{100, 100, 100}\n\t\tmat := NewMatWithSizes(sizes, MatTypeCV8U)\n\t\tdefer mat.Close()\n\t\tif mat.Empty() {\n\t\t\tt.Error(\"NewMatWithSizes should not be empty\")\n\t\t}\n\n\t\tfor i, val := range mat.Size() {\n\t\t\tif val != sizes[i] {\n\t\t\t\tt.Errorf(\"NewMatWithSizes incorrect size: %v\\n\", mat.Size())\n\t\t\t}\n\t\t}\n\n\t\tif mat.Rows() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizes incorrect row count: %v\\n\", mat.Rows())\n\t\t}\n\n\t\tif mat.Cols() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizes incorrect col count: %v\\n\", mat.Cols())\n\t\t}\n\n\t\tif mat.Channels() != 1 {\n\t\t\tt.Errorf(\"NewMatWithSizes incorrect channels count: %v\\n\", mat.Channels())\n\t\t}\n\n\t\tif mat.Type() != MatTypeCV8U {\n\t\t\tt.Errorf(\"NewMatWithSizes incorrect type: %v\\n\", mat.Type())\n\t\t}\n\n\t\tif mat.Total() != 100*100*100 {\n\t\t\tt.Errorf(\"NewMatWithSizes incorrect total: %v\\n\", mat.Total())\n\t\t}\n\t})\n\n\tt.Run(\"create 2x3x3 multidimensional array with 3 channels and scalar\", func(t *testing.T) {\n\t\tsizes := []int{2, 3, 3}\n\t\ts := NewScalar(255.0, 105.0, 180.0, 0.0)\n\t\tmat := NewMatWithSizesWithScalar(sizes, MatTypeCV32FC3, s)\n\t\tdefer mat.Close()\n\t\tif mat.Empty() {\n\t\t\tt.Error(\"NewMatWithSizesWithScalar should not be empty\")\n\t\t}\n\n\t\tfor i, val := range mat.Size() {\n\t\t\tif val != sizes[i] {\n\t\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect size: %v\\n\", mat.Size())\n\t\t\t}\n\t\t}\n\n\t\tif mat.Rows() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect row count: %v\\n\", mat.Rows())\n\t\t}\n\n\t\tif mat.Cols() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect col count: %v\\n\", mat.Cols())\n\t\t}\n\n\t\tif mat.Channels() != 3 {\n\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect channels count: %v\\n\", mat.Channels())\n\t\t}\n\n\t\tif mat.Type() != MatTypeCV32FC3 {\n\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect type: %v\\n\", mat.Type())\n\t\t}\n\n\t\tif mat.Total() != 2*3*3 {\n\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect total: %v\\n\", mat.Total())\n\t\t}\n\n\t\tmatChans := Split(mat)\n\t\tscalar := []float32{255.0, 105.0, 180.0}\n\t\tfor c := 0; c < mat.Channels(); c++ {\n\t\t\tfor x := 0; x < sizes[0]; x++ {\n\t\t\t\tfor y := 0; y < sizes[1]; y++ {\n\t\t\t\t\tfor z := 0; z < sizes[2]; z++ {\n\t\t\t\t\t\tif s := matChans[c].GetFloatAt3(x, y, z); s != scalar[c] {\n\t\t\t\t\t\t\tt.Errorf(\"NewMatWithSizesWithScalar incorrect scalar: %v\\n\", s)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, ch := range matChans {\n\t\t\tch.Close()\n\t\t}\n\t})\n\n\tt.Run(\"create 1x2x3 multidimensional array with 3 channel and data\", func(t *testing.T) {\n\t\tsizes := []int{1, 2, 3}\n\n\t\t// generate byte array\n\t\ts := NewScalar(255.0, 123.0, 55.0, 0.0)\n\t\tmat1 := NewMatWithSizesWithScalar(sizes, MatTypeCV32FC2, s)\n\t\tdefer mat1.Close()\n\t\tb := mat1.ToBytes()\n\n\t\tmat, err := NewMatWithSizesFromBytes(sizes, MatTypeCV32FC2, b)\n\t\tdefer mat.Close()\n\t\tif err != nil {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes %v\\n\", err)\n\t\t}\n\t\tif mat.Empty() {\n\t\t\tt.Error(\"NewMatWithSizesFromBytes should not be empty\")\n\t\t}\n\n\t\tmat2, err := NewMatWithSizesFromBytes(sizes, MatTypeCV32FC2, nil)\n\t\tdefer mat2.Close()\n\t\tif err == nil {\n\t\t\tt.Error(\"NewMatWithSizesFromBytes should return error with empty bytes\")\n\t\t}\n\n\t\tb1 := mat.ToBytes()\n\t\tif !bytes.Equal(b, b1) {\n\t\t\tt.Error(\"NewMatWithSizesFromBytes byte arrays not equal\")\n\t\t}\n\n\t\tfor i, val := range mat.Size() {\n\t\t\tif val != sizes[i] {\n\t\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect size: %v\\n\", mat.Size())\n\t\t\t}\n\t\t}\n\n\t\tif mat.Rows() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect row count: %v\\n\", mat.Rows())\n\t\t}\n\n\t\tif mat.Cols() != -1 {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect col count: %v\\n\", mat.Cols())\n\t\t}\n\n\t\tif mat.Channels() != 2 {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect channels count: %v\\n\", mat.Channels())\n\t\t}\n\n\t\tif mat.Type() != MatTypeCV32FC2 {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect type: %v\\n\", mat.Type())\n\t\t}\n\n\t\tif mat.Total() != 1*2*3 {\n\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect total: %v\\n\", mat.Total())\n\t\t}\n\n\t\tmatChans := Split(mat)\n\t\tscalar := []float32{255.0, 123.0, 55.0}\n\t\tfor c := 0; c < mat.Channels(); c++ {\n\t\t\tfor x := 0; x < sizes[0]; x++ {\n\t\t\t\tfor y := 0; y < sizes[1]; y++ {\n\t\t\t\t\tfor z := 0; z < sizes[2]; z++ {\n\t\t\t\t\t\tif s := matChans[c].GetFloatAt3(x, y, z); s != scalar[c] {\n\t\t\t\t\t\t\tt.Errorf(\"NewMatWithSizesFromBytes incorrect value: %v\\n\", s)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, ch := range matChans {\n\t\t\tch.Close()\n\t\t}\n\t})\n}\n\nfunc TestMatFromBytesWithEmptyByteSlice(t *testing.T) {\n\t_, err := NewMatFromBytes(600, 800, MatTypeCV8U, []byte{})\n\tif err == nil {\n\t\tt.Error(\"TestMatFromBytesWithEmptyByteSlise: \" +\n\t\t\t\"must fail because of an empty byte slice\")\n\t}\n\tif !strings.Contains(err.Error(), ErrEmptyByteSlice.Error()) {\n\t\tt.Errorf(\"TestMatFromBytesWithEmptyByteSlice: \"+\n\t\t\t\"error must contain the following description: \"+\n\t\t\t\"%v, but have: %v\", ErrEmptyByteSlice, err)\n\t}\n}\n\nfunc TestMatFromBytesSliceGarbageCollected(t *testing.T) {\n\tdata := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}\n\tm, err := NewMatFromBytes(2, 5, MatTypeCV8U, data)\n\tif err != nil {\n\t\tt.Error(\"TestMatFromBytesSliceGarbageCollected: \" +\n\t\t\t\"failed to create Mat\")\n\t}\n\tdefer m.Close()\n\n\t// Force garbage collection. As data is not used after this, its backing array should\n\t// be collected.\n\truntime.GC()\n\n\tv := m.GetUCharAt(0, 0)\n\tif v != 0 {\n\t\tt.Errorf(\"TestMatFromBytesSliceGarbageCollected: \"+\n\t\t\t\"unexpected value. Want %d, got %d.\", 0, v)\n\t}\n}\n\nfunc TestMatWithSize(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tif mat.Empty() {\n\t\tt.Error(\"NewMatWithSize should not be empty\")\n\t}\n\n\tif mat.Rows() != 101 {\n\t\tt.Errorf(\"NewMatWithSize incorrect row count: %v\\n\", mat.Rows())\n\t}\n\n\tif mat.Cols() != 102 {\n\t\tt.Errorf(\"NewMatWithSize incorrect col count: %v\\n\", mat.Cols())\n\t}\n\n\tif mat.Channels() != 1 {\n\t\tt.Errorf(\"NewMatWithSize incorrect channels count: %v\\n\", mat.Channels())\n\t}\n\n\tif mat.Type() != 0 {\n\t\tt.Errorf(\"NewMatWithSize incorrect type: %v\\n\", mat.Type())\n\t}\n\n\tif mat.Step() != 102 {\n\t\tt.Errorf(\"NewMatWithSize incorrect step count: %v\\n\", mat.Step())\n\t}\n}\n\nfunc TestMatWithSizeFromScalar(t *testing.T) {\n\ts := NewScalar(255.0, 105.0, 180.0, 0.0)\n\tmat := NewMatWithSizeFromScalar(s, 2, 3, MatTypeCV8UC3)\n\tdefer mat.Close()\n\tif mat.Empty() {\n\t\tt.Error(\"NewMatWithSizeFromScalar should not be empty\")\n\t}\n\n\tif mat.Rows() != 2 {\n\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect row count: %v\\n\", mat.Rows())\n\t}\n\n\tif mat.Cols() != 3 {\n\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect col count: %v\\n\", mat.Cols())\n\t}\n\n\tif mat.Channels() != 3 {\n\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect channels count: %v\\n\", mat.Channels())\n\t}\n\n\tif mat.Type() != 16 {\n\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect type: %v\\n\", mat.Type())\n\t}\n\n\tif mat.Total() != 6 {\n\t\tt.Errorf(\"incorrect total: %v\\n\", mat.Total())\n\t}\n\n\tif mat.Step() != 9 {\n\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect step count: %v\\n\", mat.Step())\n\t}\n\n\tsz := mat.Size()\n\tif sz[0] != 2 && sz[1] != 3 {\n\t\tt.Errorf(\"NewMatWithSize incorrect size: %v\\n\", sz)\n\t}\n\n\tmatChans := Split(mat)\n\tscalarByte := []byte{255, 105, 180}\n\tfor c := 0; c < mat.Channels(); c++ {\n\t\tfor i := 0; i < mat.Rows(); i++ {\n\t\t\tfor j := 0; j < mat.Cols(); j++ {\n\t\t\t\tif s := matChans[c].GetUCharAt(i, j); s != scalarByte[c] {\n\t\t\t\t\tt.Errorf(\"NewMatWithSizeFromScalar incorrect scalar: %v\\n\", s)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, i := range matChans {\n\t\ti.Close()\n\t}\n}\n\nfunc TestMatFromPtr(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tpmat, _ := mat.FromPtr(11, 12, MatTypeCV8U, 10, 10)\n\tdefer pmat.Close()\n\n\tif pmat.Rows() != 11 {\n\t\tt.Errorf(\"Mat copy incorrect row count: %v\\n\", pmat.Rows())\n\t}\n\n\tif pmat.Cols() != 12 {\n\t\tt.Errorf(\"Mat copy incorrect col count: %v\\n\", pmat.Cols())\n\t}\n}\n\nfunc TestMatClone(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tclone := mat.Clone()\n\tdefer clone.Close()\n\tif clone.Rows() != 101 {\n\t\tt.Errorf(\"Mat clone incorrect row count: %v\\n\", clone.Rows())\n\t}\n\n\tif clone.Cols() != 102 {\n\t\tt.Errorf(\"Mat clone incorrect col count: %v\\n\", clone.Cols())\n\t}\n}\n\nfunc TestMatCopyTo(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tcopy := NewMat()\n\tdefer copy.Close()\n\n\tmat.CopyTo(&copy)\n\tif copy.Rows() != 101 {\n\t\tt.Errorf(\"Mat copy incorrect row count: %v\\n\", copy.Rows())\n\t}\n\n\tif copy.Cols() != 102 {\n\t\tt.Errorf(\"Mat copy incorrect col count: %v\\n\", copy.Cols())\n\t}\n}\n\nfunc TestMatCopyToWithMask(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tmask := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mask.Close()\n\tdiff := NewMat()\n\tdefer diff.Close()\n\n\tmat.SetUCharAt(0, 0, 255)\n\tmat.SetUCharAt(0, 1, 255)\n\n\tmask.SetUCharAt(0, 0, 255)\n\n\tcopy := NewMat()\n\tdefer copy.Close()\n\n\tmat.CopyToWithMask(&copy, mask)\n\tif copy.Rows() != 101 {\n\t\tt.Errorf(\"Mat copy incorrect row count: %v\\n\", copy.Rows())\n\t}\n\n\tif copy.Cols() != 102 {\n\t\tt.Errorf(\"Mat copy incorrect col count: %v\\n\", copy.Cols())\n\t}\n\n\tif copy.GetUCharAt(0, 0) != 255 || copy.GetUCharAt(0, 1) != 0 {\n\t\tt.Errorf(\"Mask failed to apply to source image\")\n\t}\n\n\tCompare(mat, copy, &diff, CompareEQ)\n\tif CountNonZero(diff) == 0 {\n\t\tt.Errorf(\"Mat CopyToWithMask incorrect diff: %v\\n\", CountNonZero(diff))\n\t}\n}\n\nfunc TestMatToBytes(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tb := mat1.ToBytes()\n\tif len(b) != 101*102 {\n\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t}\n\n\tcopy, err := NewMatFromBytes(101, 102, MatTypeCV8U, b)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\tdefer copy.Close()\n\tif copy.Rows() != 101 {\n\t\tt.Errorf(\"Mat from bytes incorrect row count: %v\\n\", copy.Rows())\n\t}\n\tif copy.Cols() != 102 {\n\t\tt.Errorf(\"Mat region incorrect col count: %v\\n\", copy.Cols())\n\t}\n\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV16S)\n\tdefer mat2.Close()\n\tb = mat2.ToBytes()\n\tif len(b) != 101*102*2 {\n\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t}\n\n\tmat3 := NewMatFromScalar(NewScalar(255.0, 105.0, 180.0, 0.0), MatTypeCV8UC3)\n\tdefer mat3.Close()\n\tb = mat3.ToBytes()\n\tif len(b) != 3 {\n\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t}\n\tif bytes.Compare(b, []byte{255, 105, 180}) != 0 {\n\t\tt.Errorf(\"Mat bytes unexpected values: %v\\n\", b)\n\t}\n}\n\nfunc TestMatEye(t *testing.T) {\n\tdata := []byte{1, 0, 0, 1}\n\te := Eye(2, 2, MatTypeCV8U)\n\n\tif bytes.Compare(e.ToBytes(), data) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\te.Close()\n\n\tdata2 := []byte{1, 0, 0, 0, 1, 0}\n\te2 := Eye(2, 3, MatTypeCV8U)\n\tif bytes.Compare(e2.ToBytes(), data2) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\n\tval := e2.GetUCharAt(0, 2)\n\tif val != 0 {\n\t\tt.Errorf(\"Mat bytes unexpected value at [0,2]: %v\\n\", val)\n\t}\n\te2.Close()\n}\n\nfunc TestMatZeros(t *testing.T) {\n\texpected := NewMatWithSize(2, 3, MatTypeCV8U)\n\tz := Zeros(2, 3, MatTypeCV8U)\n\n\tif bytes.Compare(z.ToBytes(), expected.ToBytes()) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\n\texpected.Close()\n\tz.Close()\n\n\texpected2 := NewMatWithSize(2, 3, MatTypeCV64F)\n\tz2 := Zeros(2, 3, MatTypeCV64F)\n\n\tif bytes.Compare(z2.ToBytes(), expected2.ToBytes()) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\texpected2.Close()\n\tz2.Close()\n}\n\nfunc TestMatOnes(t *testing.T) {\n\texpected := NewMatWithSizeFromScalar(Scalar{Val1: 1}, 2, 3, MatTypeCV8U)\n\to := Ones(2, 3, MatTypeCV8U)\n\tif bytes.Compare(o.ToBytes(), expected.ToBytes()) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\tdefer expected.Close()\n\tdefer o.Close()\n\n\texpected2 := NewMatWithSizeFromScalar(Scalar{Val1: 1}, 2, 1, MatTypeCV64F)\n\to2 := Ones(2, 1, MatTypeCV64F)\n\n\tif bytes.Compare(o2.ToBytes(), expected2.ToBytes()) != 0 {\n\t\tt.Errorf(\"Mat bytes are not equal\")\n\t}\n\texpected2.Close()\n\to2.Close()\n}\n\nfunc TestMatDataPtr(t *testing.T) {\n\tconst (\n\t\trows = 101\n\t\tcols = 102\n\t)\n\tt.Run(\"Uint8\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval uint8\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10},\n\t\t\t{row: 30, col: 31, val: 20},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(rows, cols, MatTypeCV8U)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrUint8()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != 101*102 {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetUCharAt(p.row, p.col, p.val)\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %d, but it was %d\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV32F)\n\t\tdefer mat2.Close()\n\t\tb, err = mat2.DataPtrUint8()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != 3*9*4 {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrUint8()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n\tt.Run(\"Int8\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval int8\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10},\n\t\t\t{row: 30, col: 31, val: 20},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(101, 102, MatTypeCV8S)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrInt8()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\n\t\tif len(b) != rows*cols {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetSCharAt(p.row, p.col, p.val)\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %d, but it was %d\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV32F)\n\t\tdefer mat2.Close()\n\t\tb, err = mat2.DataPtrInt8()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != 3*9*4 {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrInt8()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n\tt.Run(\"Uint16\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval uint16\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10},\n\t\t\t{row: 30, col: 31, val: 20},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(rows, cols, MatTypeCV16U)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrUint16()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != rows*cols {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetShortAt(p.row, p.col, int16(p.val))\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %d, but it was %d\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV32F)\n\t\tdefer mat2.Close()\n\t\t_, err = mat2.DataPtrUint16()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrUint16()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n\tt.Run(\"Int16\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval int16\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10},\n\t\t\t{row: 30, col: 31, val: 20},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(rows, cols, MatTypeCV16S)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrInt16()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != rows*cols {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetShortAt(p.row, p.col, p.val)\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %d, but it was %d\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV32F)\n\t\tdefer mat2.Close()\n\t\t_, err = mat2.DataPtrInt16()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrInt16()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n\tt.Run(\"Float32\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval float32\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10.5},\n\t\t\t{row: 30, col: 31, val: 20.5},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30.5},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(rows, cols, MatTypeCV32F)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrFloat32()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != rows*cols {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetFloatAt(p.row, p.col, p.val)\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %f, but it was %f\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV16S)\n\t\tdefer mat2.Close()\n\t\t_, err = mat2.DataPtrFloat32()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrFloat32()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n\tt.Run(\"Float64\", func(t *testing.T) {\n\t\ttestPoints := []struct {\n\t\t\trow int\n\t\t\tcol int\n\t\t\tval float64\n\t\t}{\n\t\t\t{row: 0, col: 0, val: 10.5},\n\t\t\t{row: 30, col: 31, val: 20.5},\n\t\t\t{row: rows - 1, col: cols - 1, val: 30.5},\n\t\t}\n\n\t\tmat1 := NewMatWithSize(rows, cols, MatTypeCV64F)\n\t\tdefer mat1.Close()\n\n\t\tb, err := mat1.DataPtrFloat64()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t\tif len(b) != rows*cols {\n\t\t\tt.Errorf(\"Mat bytes incorrect length: %v\\n\", len(b))\n\t\t}\n\n\t\tfor _, p := range testPoints {\n\t\t\tmat1.SetDoubleAt(p.row, p.col, p.val)\n\n\t\t\tif got := b[p.row*cols+p.col]; got != p.val {\n\t\t\t\tt.Errorf(\"Expected %d,%d = %f, but it was %f\", p.row, p.col, p.val, got)\n\t\t\t}\n\t\t}\n\n\t\tmat2 := NewMatWithSize(3, 9, MatTypeCV16S)\n\t\tdefer mat2.Close()\n\t\t_, err = mat2.DataPtrFloat64()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\n\t\tmat3 := mat1.Region(image.Rect(25, 25, 75, 75))\n\t\tdefer mat3.Close()\n\t\t_, err = mat3.DataPtrFloat64()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error.\")\n\t\t}\n\t})\n}\n\nfunc TestMatRegion(t *testing.T) {\n\tmat := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdefer mat.Close()\n\tregion := mat.Region(image.Rect(20, 25, 80, 75))\n\tdefer region.Close()\n\tif region.Rows() != 50 {\n\t\tt.Errorf(\"Mat region incorrect row count: %v\\n\", region.Rows())\n\t}\n\n\tif region.Cols() != 60 {\n\t\tt.Errorf(\"Mat region incorrect col count: %v\\n\", region.Cols())\n\t}\n}\n\nfunc TestMatReshape(t *testing.T) {\n\tmat := NewMatWithSize(100, 100, MatTypeCV8UC4)\n\tdefer mat.Close()\n\n\tr := mat.Reshape(1, 1)\n\tdefer r.Close()\n\tif r.Rows() != 1 {\n\t\tt.Errorf(\"Mat reshape incorrect row count: %v\\n\", r.Rows())\n\t}\n\n\tif r.Cols() != 40000 {\n\t\tt.Errorf(\"Mat reshape incorrect col count: %v\\n\", r.Cols())\n\t}\n}\n\nfunc TestMatReshapeWithSize(t *testing.T) {\n\tmat := NewMatWithSize(512, 512, MatTypeCV32FC3)\n\tdefer mat.Close()\n\n\tr := mat.ReshapeWithSize(0, []int{512, 512})\n\tdefer r.Close()\n\tif r.Rows() != 512 {\n\t\tt.Errorf(\"Mat reshape with size incorrect row count: %v\\n\", r.Rows())\n\t}\n\n\tif r.Cols() != 512 {\n\t\tt.Errorf(\"Mat reshape with size incorrect col count: %v\\n\", r.Cols())\n\t}\n}\n\nfunc TestMatPatchNaNs(t *testing.T) {\n\tmat := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdefer mat.Close()\n\n\tmat.PatchNaNs()\n\tif mat.Empty() {\n\t\tt.Error(\"TestMatPatchNaNs error.\")\n\t}\n}\n\nfunc TestMatConvert(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tsrc.ConvertTo(&dst, MatTypeCV16S)\n\tif dst.Empty() {\n\t\tt.Error(\"TestConvert dst should not be empty.\")\n\t}\n}\n\nfunc TestMatConvertWithParams(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tsrc.ConvertToWithParams(&dst, MatTypeCV32F, 1.0/255.0, 0.0)\n\tif dst.Empty() {\n\t\tt.Error(\"TestConvertWithParams dst should not be empty.\")\n\t}\n}\n\nfunc TestMatConvertFp16(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdefer src.Close()\n\tdst := src.ConvertFp16()\n\tdefer dst.Close()\n\tif dst.Empty() {\n\t\tt.Error(\"TestConvertFp16 dst should not be empty.\")\n\t}\n}\n\nfunc TestMatSqrt(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := src.Sqrt()\n\tdefer dst.Close()\n\tif dst.Empty() {\n\t\tt.Error(\"TestSqrt dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMean(t *testing.T) {\n\tmat := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdefer mat.Close()\n\tmean := mat.Mean()\n\tif mean.Val1 != 0 {\n\t\tt.Errorf(\"Mat Mean incorrect Val1\")\n\t}\n}\n\nfunc TestMatMeanWithMask(t *testing.T) {\n\tmat := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdefer mat.Close()\n\tmask := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdefer mask.Close()\n\tmean := mat.MeanWithMask(mask)\n\tif mean.Val1 != 0 {\n\t\tt.Errorf(\"Mat Mean incorrect Val1\")\n\t}\n}\n\nfunc TestLUT(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Source Mat in LUT test\")\n\t}\n\tdefer src.Close()\n\n\tlut := IMRead(\"images/lut.png\", IMReadColor)\n\tif lut.Empty() {\n\t\tt.Error(\"Invalid read of LUT Mat in LUT test\")\n\t}\n\tdefer lut.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tLUT(src, lut, &dst)\n\tif dst.Cols() != 400 || dst.Rows() != 343 {\n\t\tt.Errorf(\"Expected dst size of 200x172 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n}\n\nfunc TestMatAccessors(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tif mat.GetUCharAt(50, 50) != 0 {\n\t\tt.Errorf(\"GetUCharAt incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t}\n\tif mat.GetUCharAt3(50, 50, 0) != 0 {\n\t\tt.Errorf(\"GetUCharAt3 incorrect value: %v\\n\", mat.GetUCharAt3(50, 50, 0))\n\t}\n\tmat.Close()\n\n\tmat = NewMatWithSize(101, 102, MatTypeCV8S)\n\tif mat.GetSCharAt(50, 50) != 0 {\n\t\tt.Errorf(\"GetSCharAt incorrect value: %v\\n\", mat.GetSCharAt(50, 50))\n\t}\n\tif mat.GetSCharAt3(50, 50, 0) != 0 {\n\t\tt.Errorf(\"GetSCharAt3 incorrect value: %v\\n\", mat.GetSCharAt3(50, 50, 0))\n\t}\n\tmat.Close()\n\n\tmat = NewMatWithSize(101, 102, MatTypeCV16S)\n\tif mat.GetShortAt(50, 50) != 0 {\n\t\tt.Errorf(\"GetShortAt incorrect value: %v\\n\", mat.GetShortAt(50, 50))\n\t}\n\tif mat.GetShortAt3(50, 50, 0) != 0 {\n\t\tt.Errorf(\"GetShortAt3 incorrect value: %v\\n\", mat.GetShortAt3(50, 50, 0))\n\t}\n\tmat.Close()\n\n\tmat = NewMatWithSize(101, 102, MatTypeCV32S)\n\tif mat.GetIntAt(50, 50) != 0 {\n\t\tt.Errorf(\"GetIntAt incorrect value: %v\\n\", mat.GetIntAt(50, 50))\n\t}\n\tif mat.GetIntAt3(50, 50, 0) != 0 {\n\t\tt.Errorf(\"GetIntAt3 incorrect value: %v\\n\", mat.GetIntAt3(50, 50, 0))\n\t}\n\tmat.Close()\n\n\tmat = NewMatWithSize(101, 102, MatTypeCV32F)\n\tif mat.GetFloatAt(50, 50) != 0.0 {\n\t\tt.Errorf(\"GetFloatAt incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t}\n\tif mat.GetFloatAt3(50, 50, 0) != 0.0 {\n\t\tt.Errorf(\"GetFloatAt3 incorrect value: %v\\n\", mat.GetFloatAt3(50, 50, 0))\n\t}\n\tmat.Close()\n\n\tmat = NewMatWithSize(101, 102, MatTypeCV64F)\n\tif mat.GetDoubleAt(50, 50) != 0.0 {\n\t\tt.Errorf(\"GetDoubleAt incorrect value: %v\\n\", mat.GetDoubleAt(50, 50))\n\t}\n\tif mat.GetDoubleAt3(50, 50, 0) != 0.0 {\n\t\tt.Errorf(\"GetDoubleAt3 incorrect value: %v\\n\", mat.GetDoubleAt3(50, 50, 0))\n\t}\n\tmat.Close()\n}\n\nfunc TestMatMutators(t *testing.T) {\n\tt.Run(\"SetTo\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(0, 0, 0, 0), 1, 1, MatTypeCV8U)\n\t\tmat.SetTo(NewScalar(255, 255, 255, 255))\n\t\tfor z := 0; z < mat.Channels(); z++ {\n\t\t\tif mat.GetUCharAt3(0, 0, z) != 255 {\n\t\t\t\tt.Errorf(\"SetTo incorrect value: z=%v: %v\\n\", z, mat.GetUCharAt3(0, 0, z))\n\t\t\t}\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetUCharAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\t\tmat.SetUCharAt(50, 50, 25)\n\t\tif mat.GetUCharAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"SetUCharAt incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetUCharAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\t\tmat.SetUCharAt3(50, 50, 0, 25)\n\t\tif mat.GetUCharAt3(50, 50, 0) != 25 {\n\t\t\tt.Errorf(\"SetUCharAt3 incorrect value: %v\\n\", mat.GetUCharAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetSCharAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV8S)\n\t\tmat.SetSCharAt(50, 50, 25)\n\t\tif mat.GetSCharAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"SetSCharAt incorrect value: %v\\n\", mat.GetSCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetSCharAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV8S)\n\t\tmat.SetSCharAt3(50, 50, 0, 25)\n\t\tif mat.GetSCharAt3(50, 50, 0) != 25 {\n\t\t\tt.Errorf(\"SetSCharAt3 incorrect value: %v\\n\", mat.GetSCharAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetShortAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV16S)\n\t\tmat.SetShortAt(50, 50, 25)\n\t\tif mat.GetShortAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"SetShortAt incorrect value: %v\\n\", mat.GetShortAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetShortAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV16S)\n\t\tmat.SetShortAt3(50, 50, 0, 25)\n\t\tif mat.GetShortAt3(50, 50, 0) != 25 {\n\t\t\tt.Errorf(\"SetShortAt3 incorrect value: %v\\n\", mat.GetShortAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetIntAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV32S)\n\t\tmat.SetIntAt(50, 50, 25)\n\t\tif mat.GetIntAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"SetIntAt incorrect value: %v\\n\", mat.GetIntAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetIntAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV32S)\n\t\tmat.SetIntAt3(50, 50, 0, 25)\n\t\tif mat.GetIntAt3(50, 50, 0) != 25 {\n\t\t\tt.Errorf(\"SetIntAt3 incorrect value: %v\\n\", mat.GetIntAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetFloatAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV32F)\n\t\tmat.SetFloatAt(50, 50, 25.0)\n\t\tif mat.GetFloatAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"SetFloatAt incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetFloatAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV32F)\n\t\tmat.SetFloatAt3(50, 50, 0, 25.0)\n\t\tif mat.GetFloatAt3(50, 50, 0) != 25 {\n\t\t\tt.Errorf(\"SetFloatAt incorrect value: %v\\n\", mat.GetFloatAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetDoubleAt\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV64F)\n\t\tmat.SetDoubleAt(50, 50, 25.0)\n\t\tif mat.GetDoubleAt(50, 50) != 25.0 {\n\t\t\tt.Errorf(\"SetDoubleAt incorrect value: %v\\n\", mat.GetDoubleAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SetDoubleAt3\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV64F)\n\t\tmat.SetDoubleAt3(50, 50, 0, 25.0)\n\t\tif mat.GetDoubleAt3(50, 50, 0) != 25.0 {\n\t\t\tt.Errorf(\"SetDoubleAt3 incorrect value: %v\\n\", mat.GetDoubleAt3(50, 50, 0))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"AddUChar\", func(t *testing.T) {\n\t\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\t\tmat.AddUChar(42)\n\t\tif mat.GetUCharAt(50, 50) != 42 {\n\t\t\tt.Errorf(\"AddUChar incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SubtractUChar\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(42.0, 0, 0, 0), 101, 102, MatTypeCV8U)\n\t\tmat.SubtractUChar(40)\n\t\tif mat.GetUCharAt(50, 50) != 2 {\n\t\t\tt.Errorf(\"SubtractUChar incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"MultiplyUChar\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(5.0, 0, 0, 0), 101, 102, MatTypeCV8U)\n\t\tmat.MultiplyUChar(5)\n\t\tif mat.GetUCharAt(50, 50) != 25 {\n\t\t\tt.Errorf(\"MultiplyUChar incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"DivideUChar\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(25.0, 0, 0, 0), 101, 102, MatTypeCV8U)\n\t\tmat.DivideUChar(5)\n\t\tif mat.GetUCharAt(50, 50) != 5 {\n\t\t\tt.Errorf(\"DivideUChar incorrect value: %v\\n\", mat.GetUCharAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"AddFloat\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 101, 102, MatTypeCV32F)\n\t\tmat.AddFloat(1.0)\n\t\tif mat.GetFloatAt(50, 50) != 31.0 {\n\t\t\tt.Errorf(\"AddFloat incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"SubtractFloat\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 101, 102, MatTypeCV32F)\n\t\tmat.SubtractFloat(1.0)\n\t\tif mat.GetFloatAt(50, 50) != 29.0 {\n\t\t\tt.Errorf(\"SubtractFloat incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"MultiplyFloat\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 101, 102, MatTypeCV32F)\n\t\tmat.MultiplyFloat(2.0)\n\t\tif mat.GetFloatAt(50, 50) != 60.0 {\n\t\t\tt.Errorf(\"MultiplyFloat incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"DivideFloat\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 101, 102, MatTypeCV32F)\n\t\tmat.DivideFloat(2.0)\n\t\tif mat.GetFloatAt(50, 50) != 15.0 {\n\t\t\tt.Errorf(\"DivideFloat incorrect value: %v\\n\", mat.GetFloatAt(50, 50))\n\t\t}\n\t\tmat.Close()\n\t})\n\tt.Run(\"MultiplyMatrix\", func(t *testing.T) {\n\t\tmat := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 2, 1, MatTypeCV32F)\n\t\tmat2 := NewMatWithSizeFromScalar(NewScalar(30.0, 0, 0, 0), 1, 2, MatTypeCV32F)\n\t\tmat3 := mat.MultiplyMatrix(mat2)\n\t\tfor i := 0; i < mat3.Cols(); i++ {\n\t\t\tfor j := 0; j < mat3.Rows(); j++ {\n\t\t\t\tif mat3.GetFloatAt(i, j) != 900.0 {\n\t\t\t\t\tt.Errorf(\"MultiplyMatrix incorrect value: %v\\n\", mat3.GetFloatAt(i, j))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmat.Close()\n\t\tmat2.Close()\n\t\tmat3.Close()\n\t})\n}\n\nfunc TestMatAbsDiff(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tAbsDiff(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatAbsDiff dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatAdd(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tAdd(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatAdd dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatAddWeighted(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tAddWeighted(mat1, 2.0, mat2, 3.0, 4.0, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatAddWeighted dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatBitwiseOperations(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tBitwiseAnd(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseAnd dest mat3 should not be empty.\")\n\t}\n\n\tBitwiseOr(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseOr dest mat3 should not be empty.\")\n\t}\n\n\tBitwiseXor(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseXor dest mat3 should not be empty.\")\n\t}\n\n\tBitwiseNot(mat1, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseNot dest mat3 should not be empty.\")\n\t}\n\n}\n\nfunc TestMatBitwiseOperationsWithMasks(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tmat4 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat4.Close()\n\tBitwiseAndWithMask(mat1, mat2, &mat3, mat4)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseAndWithMask dest mat3 should not be empty.\")\n\t}\n\n\tBitwiseOrWithMask(mat1, mat2, &mat3, mat4)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseOrWithMask dest mat3 should not be empty.\")\n\t}\n\n\tBitwiseXorWithMask(mat1, mat2, &mat3, mat4)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseXorWithMask dest mat3 should not be empty.\")\n\t}\n\tBitwiseNotWithMask(mat1, &mat3, mat4)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatBitwiseNotWithMask dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatInRange(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tlb := NewMatFromScalar(NewScalar(20.0, 100.0, 100.0, 0.0), MatTypeCV8U)\n\tdefer lb.Close()\n\tub := NewMatFromScalar(NewScalar(20.0, 100.0, 100.0, 0.0), MatTypeCV8U)\n\tdefer ub.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tInRange(mat1, lb, ub, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatAddWeighted dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatInRangeWithScalar(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tlb := NewScalar(20.0, 100.0, 100.0, 0.0)\n\tub := NewScalar(20.0, 100.0, 100.0, 0.0)\n\tdst := NewMat()\n\tdefer dst.Close()\n\tInRangeWithScalar(mat1, lb, ub, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatAddWeighted dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMatDCT(t *testing.T) {\n\tsrc := NewMatWithSize(64, 64, MatTypeCV32F)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tDCT(src, &dst, DftForward)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatDCT dst should not be empty.\")\n\t}\n}\n\nfunc TestMatDFT(t *testing.T) {\n\tsrc := NewMatWithSize(101, 102, MatTypeCV32F)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tm := GetOptimalDFTSize(101)\n\tn := GetOptimalDFTSize(102)\n\tif m != 108 {\n\t\tt.Errorf(\"TestMatOptimalDFT dst error: %d\", m)\n\t}\n\n\tif n != 108 {\n\t\tt.Errorf(\"TestMatOptimalDFT dst error: %d\", n)\n\t}\n\n\tDFT(src, &dst, DftForward)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatDFT dst should not be empty.\")\n\t}\n}\n\nfunc TestMatDivide(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tDivide(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatDivide dest mat3 should not be empty.\")\n\t}\n}\n\nfunc TestMeanStdDev(t *testing.T) {\n\tsrc := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tdstStdDev := NewMat()\n\tdefer dstStdDev.Close()\n\tMeanStdDev(src, &dst, &dstStdDev)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMeanStdDev dst should not be empty.\")\n\t}\n\tif dstStdDev.Empty() {\n\t\tt.Error(\"TestMeanStdDev dstStdDev should not be empty.\")\n\t}\n}\n\nfunc TestMeanStdDevWithMask(t *testing.T) {\n\tsrc := NewMatWithSize(2, 2, MatTypeCV8U)\n\tdefer src.Close()\n\tsrc.SetUCharAt(0, 0, 0)\n\tsrc.SetUCharAt(0, 1, 0)\n\tsrc.SetUCharAt(1, 0, 60)\n\tsrc.SetUCharAt(1, 1, 60)\n\tmask := NewMatWithSize(2, 2, MatTypeCV8U)\n\tmask.SetUCharAt(0, 0, 1)\n\tmask.SetUCharAt(0, 1, 1)\n\tmask.SetUCharAt(1, 0, 1)\n\tmask.SetUCharAt(1, 1, 1)\n\tdefer mask.Close()\n\tdstMean := NewMat()\n\tdefer dstMean.Close()\n\tdstStdDev := NewMat()\n\tdefer dstStdDev.Close()\n\n\tMeanStdDevWithMask(src, &dstMean, &dstStdDev, mask)\n\tif dstMean.Empty() {\n\t\tt.Error(\"TestMeanStdDevWithMask dstMean should not be empty.\")\n\t}\n\tif dstStdDev.Empty() {\n\t\tt.Error(\"TestMeanStdDevWithMask dstStdDev should not be empty.\")\n\t}\n\tif gotMean := dstMean.GetDoubleAt(0, 0); gotMean != 30.0 {\n\t\tt.Errorf(\"TestMeanStdDevWithMask dstMean got %f, want %f\", gotMean, 30.0)\n\t}\n\tif gotStdDev := dstStdDev.GetDoubleAt(0, 0); gotStdDev != 30.0 {\n\t\tt.Errorf(\"TestMeanStdDevWithMask dstStdDev got %f, want %f\", gotStdDev, 30.0)\n\t}\n}\n\nfunc TestMatMerge(t *testing.T) {\n\tsrc := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src.Close()\n\tsrc2 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src2.Close()\n\tsrc3 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src3.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tMerge([]Mat{src, src2, src3}, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatMerge dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMulSpectrums(t *testing.T) {\n\ta := NewMatWithSize(101, 102, MatTypeCV32F)\n\tdefer a.Close()\n\tb := NewMatWithSize(101, 102, MatTypeCV32F)\n\tdefer b.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tMulSpectrums(a, b, &dst, 0)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatMulSpectrums dst should not be empty.\")\n\t}\n\tdst2 := NewMat()\n\tdefer dst2.Close()\n\t//test with dftrows flag (the only flag accepted in addition to 0)\n\tMulSpectrums(a, b, &dst2, DftRows)\n\tif dst2.Empty() {\n\t\tt.Error(\"TestMatMulSpectrums dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMultiply(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV64F)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV64F)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tMultiply(mat1, mat2, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatMultiply dest mat3 should not be empty.\")\n\t}\n\n\t// since this is a single channel Mat, only the first value in the scalar is used\n\tmat4 := NewMatWithSizeFromScalar(NewScalar(2.0, 0.0, 0.0, 0.0), 101, 102, MatTypeCV64F)\n\tdefer mat4.Close()\n\tmat5 := NewMatWithSizeFromScalar(NewScalar(3.0, 0.0, 0.0, 0.0), 101, 102, MatTypeCV64F)\n\tdefer mat5.Close()\n\tMultiply(mat4, mat5, &mat3)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatMultiply dest mat3 should not be empty.\")\n\t}\n\tif mat3.GetDoubleAt(0, 0) != 6.0 {\n\t\tt.Error(\"TestMatMultiply invalue value in dest mat3.\")\n\t}\n}\n\nfunc TestMatMultiplyWithParams(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV64F)\n\tdefer mat1.Close()\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV64F)\n\tdefer mat2.Close()\n\tmat3 := NewMat()\n\tdefer mat3.Close()\n\tMultiplyWithParams(mat1, mat2, &mat3, 0.5, -1)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatMultiplyWithParams dest mat3 should not be empty.\")\n\t}\n\n\t// since this is a single channel Mat, only the first value in the scalar is used\n\tmat4 := NewMatWithSizeFromScalar(NewScalar(2.0, 0.0, 0.0, 0.0), 101, 102, MatTypeCV64F)\n\tdefer mat4.Close()\n\tmat5 := NewMatWithSizeFromScalar(NewScalar(3.0, 0.0, 0.0, 0.0), 101, 102, MatTypeCV64F)\n\tdefer mat5.Close()\n\tMultiplyWithParams(mat4, mat5, &mat3, 2.0, -1)\n\tif mat3.Empty() {\n\t\tt.Error(\"TestMatMultiplyWithParams dest mat3 should not be empty.\")\n\t}\n\tif mat3.GetDoubleAt(0, 0) != 12.0 {\n\t\tt.Error(\"TestMatMultiplyWithParams invalue value in dest mat3.\")\n\t}\n}\n\nfunc TestMatNormalize(t *testing.T) {\n\tsrc := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tNormalize(src, &dst, 0.0, 255.0, NormMinMax)\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatNormalize dst should not be empty.\")\n\t}\n}\n\nfunc TestMatPerspectiveTransform(t *testing.T) {\n\tsrc := NewMatWithSize(100, 1, MatTypeCV32F+MatChannels2)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\ttm := NewMatWithSize(3, 3, MatTypeCV32F)\n\tdefer tm.Close()\n\tPerspectiveTransform(src, &dst, tm)\n\tif dst.Empty() {\n\t\tt.Error(\"PerspectiveTransform error\")\n\t}\n}\n\nfunc TestMatSolve(t *testing.T) {\n\ta := NewMatWithSize(3, 3, MatTypeCV32F)\n\tdefer a.Close()\n\tb := NewMatWithSize(3, 1, MatTypeCV32F)\n\tdefer b.Close()\n\tsolve := NewMat()\n\tdefer solve.Close()\n\n\ttestPoints := []struct {\n\t\tx2 float32\n\t\tx  float32\n\t\tc  float32\n\t\ty  float32\n\t}{\n\t\t{x2: 1, x: 1, c: 1, y: 0},\n\t\t{x2: 0, x: 0, c: 1, y: 2},\n\t\t{x2: 9, x: 3, c: 1, y: 2},\n\t}\n\n\tfor row, p := range testPoints {\n\t\ta.SetFloatAt(row, 0, p.x2)\n\t\ta.SetFloatAt(row, 1, p.x)\n\t\ta.SetFloatAt(row, 2, p.c)\n\n\t\tb.SetFloatAt(row, 0, p.y)\n\t}\n\n\tsolved := Solve(a, b, &solve, SolveDecompositionLu)\n\n\tif !solved {\n\t\tt.Errorf(\"TestMatSolve could not solve linear equations\")\n\t}\n\n\tif solve.GetFloatAt(0, 0) != 1 || solve.GetFloatAt(1, 0) != -3 || solve.GetFloatAt(2, 0) != 2 {\n\t\tt.Errorf(\"TestMatSolve incorrect results: got %v expected %v, got %v expected %v, got %v expected %v\",\n\t\t\tsolve.GetFloatAt(0, 0), 1,\n\t\t\tsolve.GetFloatAt(1, 0), -3,\n\t\t\tsolve.GetFloatAt(2, 0), 2)\n\t}\n}\n\nfunc TestSolveCubic(t *testing.T) {\n\tcoeffs := NewMatWithSize(1, 4, MatTypeCV32F)\n\tdefer coeffs.Close()\n\troots := NewMat()\n\tdefer roots.Close()\n\n\tcoeffs.SetFloatAt(0, 0, 2.0)\n\tcoeffs.SetFloatAt(0, 1, 3.0)\n\tcoeffs.SetFloatAt(0, 2, -11.0)\n\tcoeffs.SetFloatAt(0, 3, -6.0)\n\n\trootsCount := SolveCubic(coeffs, &roots)\n\n\texpectedRootsCount := 3\n\tif rootsCount != expectedRootsCount {\n\t\tt.Errorf(\"TestSolveCubic incorrect numbers of roots %d, expected %d\", rootsCount, expectedRootsCount)\n\t}\n\n\tif roots.GetFloatAt(0, 0) != -3.0 || roots.GetFloatAt(0, 1) != 2.0 || roots.GetFloatAt(0, 0) != -3.0 {\n\t\tt.Errorf(\"TestSolveCubic incorrect roots: got %f expected %f, got %f expected %f, got %f expected %f\",\n\t\t\troots.GetFloatAt(0, 0), -3.0,\n\t\t\troots.GetFloatAt(0, 1), -0.5,\n\t\t\troots.GetFloatAt(0, 0), -3.0)\n\t}\n}\n\nfunc TestSolvePoly(t *testing.T) {\n\tcoeffs := NewMatWithSize(1, 3, MatTypeCV32F)\n\tdefer coeffs.Close()\n\troots := NewMat()\n\tdefer roots.Close()\n\n\t// x² - 14x + 49 = 0\n\tcoeffs.SetFloatAt(0, 0, 49.0)\n\tcoeffs.SetFloatAt(0, 1, -14.0)\n\tcoeffs.SetFloatAt(0, 2, 1)\n\n\tdiffError := SolvePoly(coeffs, &roots, 300)\n\n\tdiffTolerance := 1.0e-61\n\tif diffError > diffTolerance {\n\t\tt.Errorf(\"TestSolvePoly was not exact, got an error of %e and should have been less than %f\", diffError, diffTolerance)\n\t}\n\n\tif roots.GetFloatAt(0, 0) != 7.0 {\n\t\tt.Errorf(\"TestSolvePoly incorrect roots: got %f expected %f\",\n\t\t\troots.GetFloatAt(0, 0), 7.0)\n\t}\n}\n\nfunc TestMatReduceToSingleRow(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col+1))\n\t\t}\n\t}\n\n\tReduce(src, &dst, 0, ReduceSum, MatTypeCV32F)\n\n\tsz := dst.Size()\n\tif sz[0] != 1 && sz[1] != 3 {\n\t\tt.Errorf(\"TestMatReduceToSingleRow incorrect size: %v\\n\", sz)\n\t}\n\n\tif dst.GetFloatAt(0, 0) != 2 || dst.GetFloatAt(0, 1) != 4 || dst.GetFloatAt(0, 2) != 6 {\n\t\tt.Errorf(\"TestMatReduceToSingleRow incorrect reduce result: %v at (0, 0) expected 2, %v at (0, 1) expected 4, %v at (0, 2) expected 6\",\n\t\t\tdst.GetFloatAt(0, 0), dst.GetFloatAt(0, 1), dst.GetFloatAt(0, 2))\n\t}\n}\n\nfunc TestMatReduceToSingleColumn(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col+1))\n\t\t}\n\t}\n\n\tReduce(src, &dst, 1, ReduceSum, MatTypeCV32F)\n\n\tsz := dst.Size()\n\tif sz[0] != 3 && sz[1] != 1 {\n\t\tt.Errorf(\"TestMatReduceToSingleColumn incorrect size: %v\\n\", sz)\n\t}\n\n\tif dst.GetFloatAt(0, 0) != 6 || dst.GetFloatAt(1, 0) != 6 {\n\t\tt.Errorf(\"TestMatReduceToSingleColumn incorrect reduce result: %v at (0, 0) expected 6, %v at (1, 0) expected 6\",\n\t\t\tdst.GetFloatAt(0, 0), dst.GetFloatAt(1, 0))\n\t}\n}\n\nfunc TestMatReduceArgMax(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col+1))\n\t\t}\n\t}\n\n\tReduceArgMax(src, &dst, 1, false)\n\n\tsz := dst.Size()\n\tif sz[0] != 2 && sz[1] != 1 {\n\t\tt.Errorf(\"TestMatReduceArgMax incorrect size: %v\\n\", sz)\n\t}\n\n\tif dst.GetUCharAt(0, 0) != 2 || dst.GetUCharAt(1, 0) != 2 {\n\t\tt.Errorf(\"TestMatReduceArgMax incorrect reduce result: %v at (0, 0) expected 1, %v at (1, 0) expected 1\",\n\t\t\tdst.GetUCharAt(0, 0), dst.GetUCharAt(1, 0))\n\t}\n}\n\nfunc TestMatReduceArgMin(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col+1))\n\t\t}\n\t}\n\n\tReduceArgMin(src, &dst, 1, false)\n\n\tsz := dst.Size()\n\tif sz[0] != 2 && sz[1] != 1 {\n\t\tt.Errorf(\"TestMatReduceArgMax incorrect size: %v\\n\", sz)\n\t}\n\n\tif dst.GetUCharAt(0, 0) != 0 || dst.GetUCharAt(1, 0) != 0 {\n\t\tt.Errorf(\"TestMatReduceArgMax incorrect reduce result: %v at (0, 0) expected 0, %v at (1, 0) expected 0\",\n\t\t\tdst.GetUCharAt(0, 0), dst.GetUCharAt(1, 0))\n\t}\n}\n\nfunc TestRepeat(t *testing.T) {\n\trows := 1\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col))\n\t\t}\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\tRepeat(src, 3, 1, &dst)\n\n\tsize := dst.Size()\n\texpectedRows := 3\n\texpectedCols := 3\n\n\tif size[0] != expectedRows || size[1] != expectedCols {\n\t\tt.Errorf(\"TestRepeat incorrect size, got y=%d x=%d, expected y=%d x=%d.\", size[0], size[1], expectedRows, expectedCols)\n\t}\n\n\tfor row := 0; row < expectedRows; row++ {\n\t\tfor col := 0; col < expectedCols; col++ {\n\n\t\t\tresult := dst.GetUCharAt(row, col)\n\n\t\t\tif result != uint8(col) {\n\t\t\t\tt.Errorf(\"TestRepeat dst at row=%d col=%d should be %d and got %d.\", row, col, col, result)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestScaleAdd(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc1 := NewMatWithSize(rows, cols, MatTypeCV64F)\n\tdefer src1.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc1.SetDoubleAt(row, col, float64(col))\n\t\t}\n\t}\n\n\tsrc2 := NewMatWithSize(rows, cols, MatTypeCV64F)\n\tdefer src2.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc2.SetDoubleAt(row, col, 1.0)\n\t\t}\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\talpha := 1.5\n\tScaleAdd(src1, alpha, src2, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestScaleAdd dst should not be empty.\")\n\t}\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\texpected := float64(col)*alpha + 1.0\n\t\t\tresult := dst.GetDoubleAt(row, col)\n\t\t\tif result != expected {\n\t\t\t\tt.Errorf(\"TestScaleAdd dst at row=%d col=%d should be %f and got %f.\", row, col, expected, result)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestSetIdentity(t *testing.T) {\n\trows := 4\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV64F)\n\tdefer src.Close()\n\tscalar := 2.5\n\tSetIdentity(src, scalar)\n\n\tif src.Empty() {\n\t\tt.Error(\"TestSetIdentity src should not be empty.\")\n\t}\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tresult := src.GetDoubleAt(row, col)\n\t\t\texpected := 0.0\n\t\t\tif row == col {\n\t\t\t\texpected = scalar\n\t\t\t}\n\t\t\tif result != expected {\n\t\t\t\tt.Errorf(\"TestSetIdentity src at row=%d col=%d should be %f and got %f.\", row, col, expected, result)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestMatSortEveryRowDescending(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col))\n\t\t}\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tflags := SortEveryRow + SortDescending\n\tSort(src, &dst, flags)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatSortEveryRowDescending dst should not be empty.\")\n\t}\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\texpected := cols - col - 1\n\t\t\tresult := dst.GetUCharAt(row, col)\n\t\t\tif result != uint8(expected) {\n\t\t\t\tt.Errorf(\"TestMatSortEveryRowDescending dst at row=%d col=%d should be %d and got %d.\", row, col, expected, result)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc TestMatSortIdxEveryRowDescending(t *testing.T) {\n\trows := 2\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col))\n\t\t}\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\tflags := SortEveryRow + SortDescending\n\tSortIdx(src, &dst, flags)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatSortIdxEveryRowDescending dst should not be empty.\")\n\t}\n}\n\nfunc TestMatSplit(t *testing.T) {\n\tsrc := IMRead(\"images/face.jpg\", 1)\n\tdefer src.Close()\n\tchans := Split(src)\n\tif len(chans) != src.Channels() {\n\t\tt.Error(\"Split Channel count differs\")\n\t}\n\tdst := NewMat()\n\tdefer dst.Close()\n\tMerge(chans, &dst)\n\tfor _, ch := range chans {\n\t\tch.Close()\n\t}\n\tdiff := NewMat()\n\tdefer diff.Close()\n\tAbsDiff(src, dst, &diff)\n\tsum := diff.Sum()\n\tif sum.Val1 != 0 || sum.Val2 != 0 || sum.Val3 != 0 {\n\t\tt.Error(\"Split/Merged images differ\")\n\t}\n}\n\nfunc TestMatSubtract(t *testing.T) {\n\tsrc1 := IMRead(\"images/lut.png\", 1)\n\tdefer src1.Close()\n\tsrc2 := IMRead(\"images/lut.png\", 1)\n\tdefer src2.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tSubtract(src1, src2, &dst)\n\tsum := dst.Sum()\n\tif sum.Val1 != 0 || sum.Val2 != 0 || sum.Val3 != 0 {\n\t\tt.Error(\"Sum of Subtracting equal images is not 0\")\n\t}\n}\n\nfunc TestMatTrace(t *testing.T) {\n\trows := 3\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\n\t// Create and identity eye matrix\n\tfor row := 0; row <= rows; row++ {\n\t\tfor col := 0; col <= cols; col++ {\n\t\t\tif row == col {\n\t\t\t\tsrc.SetUCharAt(row, col, uint8(1))\n\t\t\t}\n\t\t}\n\t}\n\n\ttrace := Trace(src)\n\texpected := NewScalar(3, 0, 0, 0)\n\n\tif trace.Val1 != expected.Val1 || trace.Val2 != expected.Val2 || trace.Val3 != expected.Val3 || trace.Val4 != expected.Val4 {\n\t\tt.Errorf(\"Trace values should be %v and was %v\", expected, trace)\n\t}\n}\n\nfunc TestMatTransform(t *testing.T) {\n\tsrc := IMRead(\"images/lut.png\", 1)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\ttm := NewMatWithSize(4, 4, MatTypeCV8UC4)\n\tdefer tm.Close()\n\tTransform(src, &dst, tm)\n\tif dst.Empty() {\n\t\tt.Error(\"Transform error\")\n\t}\n}\n\nfunc TestMatTranspose(t *testing.T) {\n\tsrc := IMRead(\"images/lut.png\", 1)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tTranspose(src, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"Transpose error\")\n\t}\n}\n\nfunc TestMatTransposeND(t *testing.T) {\n\trows := 1\n\tcols := 3\n\tsrc := NewMatWithSize(rows, cols, MatTypeCV8U)\n\tdefer src.Close()\n\n\tfor row := 0; row < rows; row++ {\n\t\tfor col := 0; col < cols; col++ {\n\t\t\tsrc.SetUCharAt(row, col, uint8(col))\n\t\t}\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\tTransposeND(src, []int{1, 0}, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"TransposeND error\")\n\t}\n}\n\nfunc TestPolarToCart(t *testing.T) {\n\tmagnitude := NewMatWithSize(101, 102, MatTypeCV32F)\n\tangle := NewMatWithSize(101, 102, MatTypeCV32F)\n\tx := NewMat()\n\ty := NewMat()\n\n\tPolarToCart(magnitude, angle, &x, &y, false)\n\n\tif x.Empty() || y.Empty() {\n\t\tt.Error(\"TestPolarToCart neither x nor y should be empty.\")\n\t}\n\n\tx.Close()\n\ty.Close()\n\tmagnitude.Close()\n\tangle.Close()\n}\n\nfunc TestMatPow(t *testing.T) {\n\tsrc := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tpower := 2.0\n\tPow(src, power, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatPow dest should not be empty.\")\n\t}\n}\n\nfunc TestMatSum(t *testing.T) {\n\tsrc := NewMatFromScalar(NewScalar(1, 2, 3, 4), MatTypeCV8UC4)\n\tdefer src.Close()\n\tsum := src.Sum()\n\tif sum.Val1 != 1 || sum.Val2 != 2 || sum.Val3 != 3 || sum.Val4 != 4 {\n\t\tt.Error(\"Sum values do not match constructor\")\n\t}\n}\n\nfunc TestTermCriteria(t *testing.T) {\n\ttc := NewTermCriteria(Count, 50, 2.0)\n\tif tc.p == nil {\n\t\tt.Error(\"TermCriteria has invalid value\")\n\t}\n}\n\nfunc TestScalar(t *testing.T) {\n\ts := NewScalar(127.0, 255.0, 64.0, 0.0)\n\tif s.Val1 != 127.0 || s.Val2 != 255.0 || s.Val3 != 64.0 || s.Val4 != 0.0 {\n\t\tt.Error(\"Scalar has invalid value\")\n\t}\n}\n\nfunc TestToCPoints(t *testing.T) {\n\tpoints := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(1, 1),\n\t}\n\n\tcPoints := toCPoints(points)\n\n\tif int(cPoints.length) != len(points) {\n\t\tt.Error(\"Invalid C Points length\")\n\t}\n}\n\nfunc TestToCStrings(t *testing.T) {\n\tstrs := []string{\n\t\t\"hello\",\n\t\t\"fellow\",\n\t\t\"CStrings\",\n\t}\n\n\tcStrs := toCStrings(strs)\n\n\tif int(cStrs.length) != len(strs) {\n\t\tt.Error(\"Invalid CStrings length\")\n\t}\n}\n\nfunc TestMatBatchDistance(t *testing.T) {\n\tsrc1 := NewMatWithSize(100, 100, MatTypeCV8U)\n\tsrc2 := NewMatWithSize(100, 100, MatTypeCV8U)\n\tmask := NewMatWithSize(100, 100, MatTypeCV8U)\n\tdist := NewMat()\n\tnidx := NewMat()\n\tBatchDistance(src1, src2, dist, -1, nidx, NormL2, 15, mask, 0, false)\n\tif dist.Empty() {\n\t\tt.Error(\"TestBatchDistance dst should not be empty.\")\n\t}\n\tsrc1.Close()\n\tsrc2.Close()\n\tmask.Close()\n\tdist.Close()\n\tnidx.Close()\n}\n\nfunc TestMatBorderInterpolate(t *testing.T) {\n\tn := BorderInterpolate(1, 5, 1)\n\tif n == 0 {\n\t\tt.Error(\"TestBorderInterpolate dst should not be 0.\")\n\t}\n}\n\nfunc TestMatCalcCovarMatrix(t *testing.T) {\n\tsamples := NewMatWithSize(10, 10, MatTypeCV32F)\n\tcovar := NewMat()\n\tmean := NewMat()\n\tCalcCovarMatrix(samples, &covar, &mean, CovarRows, MatTypeCV64F)\n\tif covar.Empty() {\n\t\tt.Error(\"TestCalcCovarMatrix dst should not be empty.\")\n\t}\n\tsamples.Close()\n\tcovar.Close()\n\tmean.Close()\n}\n\nfunc TestMatCartToPolar(t *testing.T) {\n\tx := NewMatWithSize(100, 100, MatTypeCV32F)\n\ty := NewMatWithSize(100, 100, MatTypeCV32F)\n\tmagnitude := NewMat()\n\tangle := NewMat()\n\tCartToPolar(x, y, &magnitude, &angle, false)\n\tif magnitude.Empty() || angle.Empty() {\n\t\tt.Error(\"TestCartToPolar neither magnitude nor angle should be empty.\")\n\t}\n\tx.Close()\n\ty.Close()\n\tmagnitude.Close()\n\tangle.Close()\n}\n\nfunc TestMatCheckRange(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat1.Close()\n\tret := CheckRange(mat1)\n\tif !ret {\n\t\tt.Error(\"TestCheckRange error.\")\n\t}\n}\n\nfunc TestMatCompleteSymm(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tCompleteSymm(src, false)\n\tif src.Empty() {\n\t\tt.Error(\"TestCompleteSymm src should not be empty.\")\n\t}\n\tsrc.Close()\n}\n\nfunc TestMatConvertScaleAbs(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdst := NewMat()\n\tConvertScaleAbs(src, &dst, 1, 0)\n\tif dst.Empty() {\n\t\tt.Error(\"TestConvertScaleAbs dst should not be empty.\")\n\t}\n\tsrc.Close()\n\tdst.Close()\n}\n\nfunc TestMatCopyMakeBorder(t *testing.T) {\n\tsrc := NewMatWithSize(100, 100, MatTypeCV32F)\n\tdst := NewMat()\n\tCopyMakeBorder(src, &dst, 10, 10, 10, 10, BorderReflect, color.RGBA{0, 0, 0, 0})\n\tif dst.Empty() {\n\t\tt.Error(\"TestCopyMakeBorder dst should not be empty.\")\n\t}\n\tsrc.Close()\n\tdst.Close()\n}\n\nfunc TestMatDeterminant(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 101, MatTypeCV32F)\n\tdefer mat1.Close()\n\tret := Determinant(mat1)\n\tif ret != 0 {\n\t\tt.Error(\"TestMatDeterminant error.\")\n\t}\n}\n\nfunc TestMatEigen(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\teigenvalues := NewMat()\n\teigenvectors := NewMat()\n\tEigen(src, &eigenvalues, &eigenvectors)\n\tif eigenvectors.Empty() || eigenvalues.Empty() {\n\t\tt.Error(\"TestEigen should not have empty eigenvectors or eigenvalues.\")\n\t}\n\tsrc.Close()\n\teigenvectors.Close()\n\teigenvalues.Close()\n}\n\nfunc TestMatEigenNonSymmetric(t *testing.T) {\n\tsrc := NewMatWithSizeFromScalar(NewScalar(0.1, 0.1, 0.1, 0.1), 10, 10, MatTypeCV32F)\n\teigenvalues := NewMat()\n\teigenvectors := NewMat()\n\tEigenNonSymmetric(src, &eigenvalues, &eigenvectors)\n\tif eigenvectors.Empty() || eigenvalues.Empty() {\n\t\tt.Error(\"TestEigenNonSymmetric should not have empty eigenvectors or eigenvalues.\")\n\t}\n\tsrc.Close()\n\teigenvectors.Close()\n\teigenvalues.Close()\n}\n\nfunc TestPCABackProject(t *testing.T) {\n\tdata := NewMatWithSize(3, 1, MatTypeCV32F)\n\tdefer data.Close()\n\tdata.SetFloatAt(0, 0, float32(-5))\n\tdata.SetFloatAt(1, 0, float32(0))\n\tdata.SetFloatAt(2, 0, float32(-10))\n\n\tmean := NewMatWithSize(1, 4, MatTypeCV32F)\n\tdefer mean.Close()\n\tmean.SetFloatAt(0, 0, float32(2))\n\tmean.SetFloatAt(0, 1, float32(4))\n\tmean.SetFloatAt(0, 2, float32(4))\n\tmean.SetFloatAt(0, 3, float32(8))\n\n\tvectors := NewMatWithSizeFromScalar(NewScalar(0, 0, 0, 0), 1, 4, MatTypeCV32F)\n\tdefer vectors.Close()\n\tvectors.SetFloatAt(0, 0, float32(0.2))\n\tvectors.SetFloatAt(0, 1, float32(0.4))\n\tvectors.SetFloatAt(0, 2, float32(0.4))\n\tvectors.SetFloatAt(0, 3, float32(0.8))\n\n\tresult := NewMat()\n\tdefer result.Close()\n\n\tPCABackProject(data, mean, vectors, &result)\n\tif result.Empty() {\n\t\tt.Error(\"PCABackProject should not have empty result.\")\n\t}\n}\n\nfunc TestPCACompute(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\t// Set some source data so the PCA is done on a non-zero matrix.\n\tsrc.SetFloatAt(0, 0, 17)\n\tsrc.SetFloatAt(2, 1, 5)\n\tsrc.SetFloatAt(9, 9, 25)\n\tmean := NewMat()\n\teigenvectors := NewMat()\n\teigenvalues := NewMat()\n\tmaxComponents := 2\n\tPCACompute(src, &mean, &eigenvectors, &eigenvalues, maxComponents)\n\tif mean.Empty() || eigenvectors.Empty() || eigenvalues.Empty() {\n\t\tt.Error(\"TestPCACompute should not have empty eigenvectors or eigenvalues.\")\n\t}\n\tif eigenvectors.Rows() > maxComponents {\n\t\tt.Errorf(\"TestPCACompute unexpected numComponents, got=%d, want<=%d\", eigenvectors.Rows(), maxComponents)\n\t}\n\tsrc.Close()\n\tmean.Close()\n\teigenvectors.Close()\n\teigenvalues.Close()\n}\n\nfunc TestPCAProject(t *testing.T) {\n\tdata := NewMatWithSize(3, 4, MatTypeCV32F)\n\tdefer data.Close()\n\tdata.SetFloatAt(0, 0, float32(1))\n\tdata.SetFloatAt(0, 1, float32(2))\n\tdata.SetFloatAt(0, 2, float32(2))\n\tdata.SetFloatAt(0, 3, float32(4))\n\tdata.SetFloatAt(1, 0, float32(2))\n\tdata.SetFloatAt(1, 1, float32(4))\n\tdata.SetFloatAt(1, 2, float32(4))\n\tdata.SetFloatAt(1, 3, float32(8))\n\tdata.SetFloatAt(2, 0, float32(0))\n\tdata.SetFloatAt(2, 1, float32(0))\n\tdata.SetFloatAt(2, 2, float32(0))\n\tdata.SetFloatAt(2, 3, float32(0))\n\n\tmean := NewMatWithSize(1, 4, MatTypeCV32F)\n\tdefer mean.Close()\n\tmean.SetFloatAt(0, 0, float32(2))\n\tmean.SetFloatAt(0, 1, float32(4))\n\tmean.SetFloatAt(0, 2, float32(4))\n\tmean.SetFloatAt(0, 3, float32(8))\n\n\tvectors := NewMatWithSizeFromScalar(NewScalar(0, 0, 0, 0), 1, 4, MatTypeCV32F)\n\tdefer vectors.Close()\n\tvectors.SetFloatAt(0, 0, float32(0.2))\n\tvectors.SetFloatAt(0, 1, float32(0.4))\n\tvectors.SetFloatAt(0, 2, float32(0.4))\n\tvectors.SetFloatAt(0, 3, float32(0.8))\n\n\tresult := NewMat()\n\tdefer result.Close()\n\n\tPCAProject(data, mean, vectors, &result)\n\tif result.Empty() {\n\t\tt.Error(\"PCABackProject should not have empty result.\")\n\t}\n}\n\nfunc TestPSNR(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Source Mat in PSNR test\")\n\t}\n\tdefer src.Close()\n\n\tresult := PSNR(src, src)\n\tif result == 0 {\n\t\tt.Error(\"Unexpected PSNR of 0\")\n\t}\n}\n\nfunc TestSVBackSubst(t *testing.T) {\n\tw := NewMatWithSizeFromScalar(NewScalar(2, 0, 0, 0), 2, 2, MatTypeCV32F)\n\tdefer w.Close()\n\n\tu := NewMatWithSizeFromScalar(NewScalar(4, 0, 0, 0), 2, 2, MatTypeCV32F)\n\tdefer u.Close()\n\n\tvt := NewMatWithSizeFromScalar(NewScalar(2, 0, 0, 0), 2, 2, MatTypeCV32F)\n\tdefer vt.Close()\n\n\trhs := NewMatWithSizeFromScalar(NewScalar(1, 0, 0, 0), 2, 2, MatTypeCV32F)\n\tdefer rhs.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tSVBackSubst(w, u, vt, rhs, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"SVBackSubst should not have empty result.\")\n\t}\n}\n\nfunc TestSVDecomp(t *testing.T) {\n\tsrc := NewMatWithSize(1, 4, MatTypeCV32F)\n\tdefer src.Close()\n\tsrc.SetFloatAt(0, 0, float32(1))\n\tsrc.SetFloatAt(0, 1, float32(4))\n\tsrc.SetFloatAt(0, 2, float32(8))\n\tsrc.SetFloatAt(0, 3, float32(6))\n\n\tw := NewMat()\n\tdefer w.Close()\n\n\tu := NewMat()\n\tdefer u.Close()\n\n\tvt := NewMat()\n\tdefer vt.Close()\n\n\tSVDecomp(src, &w, &u, &vt)\n\tif w.Empty() || u.Empty() || vt.Empty() {\n\t\tt.Error(\"SVDecomp should not have empty results.\")\n\t}\n}\n\nfunc TestMatExp(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdst := NewMat()\n\tExp(src, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"TestExp dst should not be empty.\")\n\t}\n\tsrc.Close()\n\tdst.Close()\n}\n\nfunc TestMatExtractChannel(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F+MatChannels3)\n\tdst := NewMat()\n\tExtractChannel(src, &dst, 1)\n\tif dst.Empty() {\n\t\tt.Error(\"TestExtractChannel dst should not be empty.\")\n\t}\n\tsrc.Close()\n\tdst.Close()\n}\n\nfunc TestMatFindNonZero(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV8U)\n\tdefer src.Close()\n\tsrc.SetFloatAt(3, 3, 17)\n\tsrc.SetFloatAt(4, 4, 17)\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tFindNonZero(src, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatFindNonZero dst should not be empty.\")\n\t}\n\tif dst.Rows() != 2*2 {\n\t\tt.Error(\"TestMatFindNonZero didn't find all nonzero locations.\")\n\t}\n}\n\nfunc TestMatFlip(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tFlip(src, &dst, 0)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatFlip dst should not be empty.\")\n\t}\n\tif dst.Rows() != src.Rows() {\n\t\tt.Error(\"TestMatFlip src and dst size should be same.\")\n\t}\n}\n\nfunc TestMatPhase(t *testing.T) {\n\tx := NewMatFromScalar(NewScalar(1.2, 2.3, 3.4, 4.5), MatTypeCV32F)\n\tdefer x.Close()\n\n\ty := NewMatFromScalar(NewScalar(5.6, 6.7, 7.8, 8.9), MatTypeCV32F)\n\tdefer y.Close()\n\n\tangle := NewMatWithSize(4, 5, MatTypeCV32F)\n\tdefer angle.Close()\n\n\tPhase(x, y, &angle, false)\n\n\tif angle.Empty() {\n\t\tt.Error(\"TestMatPhase angle should not be empty.\")\n\t}\n\n\tif angle.Rows() != x.Rows() {\n\t\tt.Error(\"TestMatPhase x and angle size should be same.\")\n\t}\n}\n\nfunc TestMatGemm(t *testing.T) {\n\tsrc1 := NewMatWithSize(3, 4, MatTypeCV32F)\n\tdefer src1.Close()\n\n\tsrc2 := NewMatWithSize(4, 3, MatTypeCV32F)\n\tdefer src2.Close()\n\n\tsrc3 := NewMat()\n\tdefer src3.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tGemm(src1, src2, 1, src3, 0, &dst, 0)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Gemm dst should not be empty.\")\n\t}\n\tif dst.Rows() != src1.Rows() {\n\t\tt.Error(\"Gemm src and dst size should be same.\")\n\t}\n}\n\nfunc TestMatHconcat(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tHconcat(src, src, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatHconcat dst should not be empty.\")\n\t}\n\tif dst.Cols() != 2*src.Cols() {\n\t\tt.Error(\"TestMatHconcat dst.Cols should be 2 x src.Cols.\")\n\t}\n}\n\nfunc TestMatVconcat(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tVconcat(src, src, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"TestMatVconcat dst should not be empty.\")\n\t}\n\tif dst.Rows() != 2*src.Rows() {\n\t\tt.Error(\"TestMatVconcat dst.Cols should be 2 x src.Rows().\")\n\t}\n}\n\nfunc TestRotate(t *testing.T) {\n\tsrc := NewMatWithSize(1, 2, MatTypeCV64F)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tRotate(src, &dst, Rotate90Clockwise)\n\tif dst.Rows() != 2 {\n\t\tt.Errorf(\"expected rows: %d got %d\", src.Cols(), dst.Rows())\n\t}\n\n\tdst2src := NewMat()\n\tdefer dst2src.Close()\n\n\tRotate(dst, &dst2src, Rotate90CounterClockwise)\n\tif dst2src.Rows() != 1 {\n\t\tt.Errorf(\"expected rows: %d got %d\", src.Rows(), dst2src.Rows())\n\t}\n}\n\nfunc TestMatIdct(t *testing.T) {\n\tsrc := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tIDCT(src, &dst, 0)\n\tif dst.Empty() {\n\t\tt.Error(\"Idct dst should not be empty.\")\n\t}\n\tif dst.Rows() != src.Rows() {\n\t\tt.Error(\"Idct src and dst size should be same.\")\n\t}\n}\n\nfunc TestMatIdft(t *testing.T) {\n\tsrc := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tIDFT(src, &dst, 0, 0)\n\tif dst.Empty() {\n\t\tt.Error(\"Idct dst should not be empty.\")\n\t}\n\tif dst.Rows() != src.Rows() {\n\t\tt.Error(\"Idct src and dst size should be same.\")\n\t}\n}\n\nfunc TestMatInsertChannel(t *testing.T) {\n\tsrc := NewMatWithSize(4, 4, MatTypeCV8U)\n\tdefer src.Close()\n\n\tdst := NewMatWithSize(4, 4, MatTypeCV8UC3)\n\tdefer dst.Close()\n\n\tInsertChannel(src, &dst, 1)\n\tif dst.Channels() != 3 {\n\t\tt.Error(\"TestMatInsertChannel dst should change the channel count\")\n\t}\n}\n\nfunc TestMatInvert(t *testing.T) {\n\tsrc := NewMatWithSize(4, 4, MatTypeCV32F) // only implemented for symm. Mats\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tInvert(src, &dst, SolveDecompositionLu)\n\tif dst.Empty() {\n\t\tt.Error(\"Invert dst should not be empty.\")\n\t}\n}\n\nfunc TestKMeans(t *testing.T) {\n\tsrc := NewMatWithSize(4, 4, MatTypeCV32F) // only implemented for symm. Mats\n\tdefer src.Close()\n\n\tbestLabels := NewMat()\n\tdefer bestLabels.Close()\n\n\tcenters := NewMat()\n\tdefer centers.Close()\n\n\tcriteria := NewTermCriteria(Count, 10, 1.0)\n\tKMeans(src, 2, &bestLabels, criteria, 2, KMeansRandomCenters, &centers)\n\tif bestLabels.Empty() {\n\t\tt.Error(\"bla\")\n\t}\n}\n\nfunc TestKMeansPoints(t *testing.T) {\n\tpoints := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(1, 1),\n\t}\n\n\tpv := NewPointVectorFromPoints(points)\n\tdefer pv.Close()\n\n\tbestLabels := NewMat()\n\tdefer bestLabels.Close()\n\tcenters := NewMat()\n\tdefer centers.Close()\n\n\tcriteria := NewTermCriteria(Count, 10, 1.0)\n\tKMeansPoints(pv, 2, &bestLabels, criteria, 2, KMeansRandomCenters, &centers)\n\tif bestLabels.Empty() || bestLabels.Size()[0] != len(points) {\n\t\tt.Error(\"Labels is not proper\")\n\t}\n}\n\nfunc TestMatLog(t *testing.T) {\n\tsrc := NewMatWithSize(4, 3, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tLog(src, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"Log dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMagnitude(t *testing.T) {\n\tsrc1 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src1.Close()\n\tsrc2 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src2.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tMagnitude(src1, src2, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"Magnitude dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMahalanobis(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer src.Close()\n\n\tRandU(&src, Scalar{Val1: -128}, Scalar{Val1: 128})\n\n\ticovar := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer icovar.Close()\n\tmean := NewMatWithSize(1, 10, MatTypeCV32F)\n\tdefer mean.Close()\n\n\tCalcCovarMatrix(src, &icovar, &mean, CovarRows|CovarNormal, MatTypeCV32F)\n\ticovar.Inv()\n\n\tline1 := src.Row(0)\n\tdefer line1.Close()\n\tline2 := src.Row(1)\n\tdefer line2.Close()\n\n\tresult := Mahalanobis(line1, line2, icovar)\n\tif result == 0 {\n\t\tt.Error(\"Mahalanobis result should not be empty.\")\n\t}\n}\n\nfunc TestMulTransposed(t *testing.T) {\n\tsrc := Eye(10, 10, MatTypeCV32FC1)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tMulTransposed(src, &dst, true)\n\tif dst.Empty() {\n\t\tt.Error(\"MulTransposed dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMax(t *testing.T) {\n\tsrc1 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src1.Close()\n\tsrc2 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src2.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tMax(src1, src2, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"Max dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMin(t *testing.T) {\n\tsrc1 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src1.Close()\n\tsrc2 := NewMatWithSize(4, 4, MatTypeCV32F)\n\tdefer src2.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tMin(src1, src2, &dst)\n\tif dst.Empty() {\n\t\tt.Error(\"Min dst should not be empty.\")\n\t}\n}\n\nfunc TestMatMinMaxIdx(t *testing.T) {\n\tsrc := NewMatWithSize(10, 10, MatTypeCV32F)\n\tdefer src.Close()\n\tsrc.SetFloatAt(3, 3, 17)\n\tsrc.SetFloatAt(4, 4, 16)\n\n\tminVal, maxVal, _, _ := MinMaxIdx(src)\n\n\tif minVal != 0 {\n\t\tt.Error(\"TestMatMinMaxIdx minVal should be 0.\")\n\t}\n\tif maxVal != 17 {\n\t\tt.Errorf(\"TestMatMinMaxIdx maxVal should be 17, was %f\", maxVal)\n\t}\n}\n\nfunc TestMixChannels(t *testing.T) {\n\tbgra := NewMatWithSizeFromScalar(NewScalar(255, 0, 0, 255), 10, 10, MatTypeCV8UC4)\n\tdefer bgra.Close()\n\tbgr := NewMatWithSize(bgra.Rows(), bgra.Cols(), MatTypeCV8UC3)\n\tdefer bgr.Close()\n\talpha := NewMatWithSize(bgra.Rows(), bgra.Cols(), MatTypeCV8UC1)\n\tdefer alpha.Close()\n\n\tdst := []Mat{bgr, alpha}\n\n\t// bgra[0] -> bgr[2], bgra[1] -> bgr[1],\n\t// bgra[2] -> bgr[0], bgra[3] -> alpha[0]\n\tfromTo := []int{0, 2, 1, 1, 2, 0, 3, 3}\n\n\tMixChannels([]Mat{bgra}, dst, fromTo)\n\n\tbgrChans := Split(bgr)\n\tscalarByte := []byte{0, 0, 255}\n\tfor c := 0; c < bgr.Channels(); c++ {\n\t\tfor i := 0; i < bgr.Rows(); i++ {\n\t\t\tfor j := 0; j < bgr.Cols(); j++ {\n\t\t\t\tif s := bgrChans[c].GetUCharAt(i, j); s != scalarByte[c] {\n\t\t\t\t\tt.Errorf(\"TestMixChannels incorrect bgr scalar: %v\\n\", s)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, ch := range bgrChans {\n\t\tch.Close()\n\t}\n\n\talphaChans := Split(alpha)\n\tscalarByte = []byte{255}\n\tfor c := 0; c < alpha.Channels(); c++ {\n\t\tfor i := 0; i < alpha.Rows(); i++ {\n\t\t\tfor j := 0; j < alpha.Cols(); j++ {\n\t\t\t\tif s := alphaChans[c].GetUCharAt(i, j); s != scalarByte[c] {\n\t\t\t\t\tt.Errorf(\"TestMixChannels incorrect alpha scalar: %v\\n\", s)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, ch := range alphaChans {\n\t\tch.Close()\n\t}\n}\n\nfunc TestGetVecfAt(t *testing.T) {\n\tvar cases = []struct {\n\t\tm            Mat\n\t\texpectedSize int\n\t}{\n\t\t{NewMatWithSize(1, 1, MatTypeCV32FC1), 1},\n\t\t{NewMatWithSize(1, 1, MatTypeCV32FC2), 2},\n\t\t{NewMatWithSize(1, 1, MatTypeCV32FC3), 3},\n\t\t{NewMatWithSize(1, 1, MatTypeCV32FC4), 4},\n\t}\n\n\tfor _, c := range cases {\n\t\tvec := c.m.GetVecfAt(0, 0)\n\t\tif len := len(vec); len != c.expectedSize {\n\t\t\tt.Errorf(\"TestGetVecfAt: expected %d, got: %d.\", c.expectedSize, len)\n\t\t}\n\t\tc.m.Close()\n\t}\n}\n\nfunc TestGetVecdAt(t *testing.T) {\n\tvar cases = []struct {\n\t\tm            Mat\n\t\texpectedSize int\n\t}{\n\t\t{NewMatWithSize(1, 1, MatTypeCV64FC1), 1},\n\t\t{NewMatWithSize(1, 1, MatTypeCV64FC2), 2},\n\t\t{NewMatWithSize(1, 1, MatTypeCV64FC3), 3},\n\t\t{NewMatWithSize(1, 1, MatTypeCV64FC4), 4},\n\t}\n\n\tfor _, c := range cases {\n\t\tvec := c.m.GetVecdAt(0, 0)\n\t\tif len := len(vec); len != c.expectedSize {\n\t\t\tt.Errorf(\"TestGetVecdAt: expected %d, got: %d.\", c.expectedSize, len)\n\t\t}\n\t\tc.m.Close()\n\t}\n}\n\nfunc TestGetVecbAt(t *testing.T) {\n\tvar cases = []struct {\n\t\tm            Mat\n\t\texpectedSize int\n\t}{\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC1), 1},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC2), 2},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC3), 3},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC4), 4},\n\t}\n\n\tfor _, c := range cases {\n\t\tvec := c.m.GetVecbAt(0, 0)\n\t\tif len := len(vec); len != c.expectedSize {\n\t\t\tt.Errorf(\"TestGetVecbAt: expected %d, got: %d.\", c.expectedSize, len)\n\t\t}\n\t\tc.m.Close()\n\t}\n}\n\nfunc TestGetVeciAt(t *testing.T) {\n\tvar cases = []struct {\n\t\tm            Mat\n\t\texpectedSize int\n\t}{\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC1), 1},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC2), 2},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC3), 3},\n\t\t{NewMatWithSize(1, 1, MatTypeCV8UC4), 4},\n\t}\n\n\tfor _, c := range cases {\n\t\tvec := c.m.GetVeciAt(0, 0)\n\t\tif len := len(vec); len != c.expectedSize {\n\t\t\tt.Errorf(\"TestGetVeciAt: expected %d, got: %d.\", c.expectedSize, len)\n\t\t}\n\t\tc.m.Close()\n\t}\n}\n\nfunc TestGetTickFrequencyCount(t *testing.T) {\n\tfreq := GetTickFrequency()\n\tif freq == 0 {\n\t\tt.Error(\"GetTickFrequency expected non zero.\")\n\t}\n\n\tcount := GetTickCount()\n\tif count == 0 {\n\t\tt.Error(\"GetTickCount expected non zero.\")\n\t}\n}\n\nfunc TestMatT(t *testing.T) {\n\tvar q = []float32{1, 3, 2, 4}\n\tsrc := NewMatWithSize(2, 2, MatTypeCV32F)\n\tdefer src.Close()\n\tsrc.SetFloatAt(0, 0, 1)\n\tsrc.SetFloatAt(0, 1, 2)\n\tsrc.SetFloatAt(1, 0, 3)\n\tsrc.SetFloatAt(1, 1, 4)\n\n\tdst := src.T()\n\tdefer dst.Close()\n\n\tret, err := dst.DataPtrFloat32()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tfor i := 0; i < len(ret); i++ {\n\t\tif ret[i] != q[i] {\n\t\t\tt.Errorf(\"MatT incorrect value: %v\\n\", ret[i])\n\t\t}\n\t}\n}\n\nfunc compareImages(img0, img1 image.Image) bool {\n\tbounds0 := img0.Bounds()\n\tbounds1 := img1.Bounds()\n\tdx0 := bounds0.Dx()\n\tdy0 := bounds0.Dy()\n\tif dx0 != bounds1.Dx() || dy0 != bounds1.Dy() {\n\t\treturn false\n\t}\n\txMin0 := bounds0.Min.X\n\txMin1 := bounds1.Min.X\n\tyMin0 := bounds0.Min.Y\n\tyMin1 := bounds1.Min.Y\n\tfor i := 0; i < dx0; i++ {\n\t\tfor j := 0; j < dy0; j++ {\n\t\t\tpoint0 := img0.At(xMin0+i, yMin0+j)\n\t\t\tpoint1 := img1.At(xMin1+i, yMin1+j)\n\t\t\tr0, g0, b0, a0 := point0.RGBA()\n\t\t\tr1, g1, b1, a1 := point1.RGBA()\n\t\t\tr0 >>= 8\n\t\t\tg0 >>= 8\n\t\t\tb0 >>= 8\n\t\t\ta0 >>= 8\n\t\t\tr1 >>= 8\n\t\t\tg1 >>= 8\n\t\t\tb1 >>= 8\n\t\t\ta1 >>= 8\n\t\t\tif r0 != r1 || g0 != g1 || b0 != b1 || a0 != a1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc TestColRowRange(t *testing.T) {\n\tmat := NewMatWithSize(101, 102, MatTypeCV8U)\n\tdefer mat.Close()\n\tif mat.Empty() {\n\t\tt.Error(\"TestColRowRange should not be empty\")\n\t}\n\n\tif mat.Rows() != 101 {\n\t\tt.Errorf(\"TestColRowRange incorrect row count: %v\\n\", mat.Rows())\n\t}\n\n\tif mat.Cols() != 102 {\n\t\tt.Errorf(\"TestColRowRange incorrect col count: %v\\n\", mat.Cols())\n\t}\n\n\tsubmatRow := mat.RowRange(0, 50)\n\tdefer submatRow.Close()\n\tif submatRow.Rows() != 50 {\n\t\tt.Errorf(\"TestColRowRange incorrect submatRow count: %v\\n\", submatRow.Rows())\n\t}\n\n\tsubmatCols := mat.ColRange(0, 50)\n\tdefer submatCols.Close()\n\tif submatCols.Cols() != 50 {\n\t\tt.Errorf(\"TestColRowRange incorrect submatCols count: %v\\n\", submatCols.Cols())\n\t}\n}\n\nfunc TestNormWithMats(t *testing.T) {\n\tmat1 := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\tdefer mat1.Close()\n\n\tmat2 := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\tdefer mat2.Close()\n\n\td := NormWithMats(mat1, mat2, NormInf)\n\tif d != 0 {\n\t\tt.Fatal(\"expected 0\")\n\t}\n}\n\nfunc Test_toGoStrings(t *testing.T) {\n\tgoStrings := []string{\"foo\", \"bar\"}\n\tcStrings := toCStrings(goStrings)\n\tresult := toGoStrings(cStrings)\n\tif len(goStrings) != len(result) {\n\t\tt.Errorf(\"TesttoGoStrings failed: length of converted string is not equal to original \\n\")\n\t}\n\tfor i, s := range goStrings {\n\t\tif s != result[i] {\n\t\t\tt.Errorf(\"TesttoGoStrings failed: strings are not equal. expected=%s, actusal=%s\", s, result[i])\n\t\t}\n\t}\n}\n\nfunc TestTheRNG(t *testing.T) {\n\trng := TheRNG()\n\tif rng.p == nil {\n\t\tt.Errorf(\"got no rng\")\n\t}\n}\n\nfunc TestSetRNGSeed(t *testing.T) {\n\tSetRNGSeed(123)\n}\n\nfunc TestRNG_Fill(t *testing.T) {\n\trng := TheRNG()\n\tmat := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer mat.Close()\n\trng.Fill(&mat, RNGDistNormal, 10, 20, false)\n}\n\nfunc TestRNG_Gaussian(t *testing.T) {\n\trng := TheRNG()\n\t_ = rng.Gaussian(0.5)\n}\n\nfunc TestRNG_Next(t *testing.T) {\n\trng := TheRNG()\n\t_ = rng.Next()\n}\n\nfunc TestRandN(t *testing.T) {\n\tmat := NewMatWithSize(5, 5, MatTypeCV8UC3)\n\tdefer mat.Close()\n\tRandN(&mat, NewScalar(10, 10, 10, 10), NewScalar(20, 20, 20, 20))\n}\n\nfunc TestRandShuffle(t *testing.T) {\n\tmat := NewMatWithSize(5, 5, MatTypeCV8UC3)\n\tdefer mat.Close()\n\tRandShuffle(&mat)\n}\n\nfunc TestRandShuffleWithParams(t *testing.T) {\n\tmat := NewMatWithSize(5, 5, MatTypeCV8UC3)\n\tdefer mat.Close()\n\tRandShuffleWithParams(&mat, 1, TheRNG())\n}\n\nfunc TestRandU(t *testing.T) {\n\tmat := NewMatWithSize(5, 5, MatTypeCV8UC3)\n\tdefer mat.Close()\n\tRandU(&mat, NewScalar(10, 10, 10, 10), NewScalar(20, 20, 20, 20))\n}\n\nfunc TestNewPointsVector(t *testing.T) {\n\tepv := NewPointsVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty pointsvector size not 0\")\n\t}\n\n\tpts := [][]image.Point{\n\t\t{\n\t\t\timage.Pt(10, 10),\n\t\t\timage.Pt(10, 20),\n\t\t\timage.Pt(20, 20),\n\t\t\timage.Pt(20, 10),\n\t\t},\n\t}\n\n\tpsv := NewPointsVectorFromPoints(pts)\n\tdefer psv.Close()\n\n\tif psv.IsNil() {\n\t\tt.Fatal(\"pointsvector pointer was nil\")\n\t}\n\n\tif psv.Size() != 1 {\n\t\tt.Fatal(\"expected pointsvector size 1\")\n\t}\n\n\tipv := psv.At(10)\n\tif !ipv.IsNil() {\n\t\tt.Fatal(\"expected pointvector nil\")\n\t}\n\n\tpv := psv.At(0)\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected pointvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\tif p != image.Pt(10, 10) {\n\t\tt.Fatal(\"invalid At() point\")\n\t}\n\n\tp = pv.At(10)\n\tif p != image.Pt(0, 0) {\n\t\tt.Fatal(\"invalid At() point beyond range\")\n\t}\n\n\tout := psv.ToPoints()\n\tif out[0][0] != image.Pt(10, 10) {\n\t\tt.Fatal(\"invalid ToPoints() point\")\n\t}\n\n\tps := []image.Point{\n\t\timage.Pt(10, 10),\n\t\timage.Pt(10, 20),\n\t\timage.Pt(20, 20),\n\t\timage.Pt(20, 10),\n\t}\n\n\tapv := NewPointVectorFromPoints(ps)\n\tdefer apv.Close()\n\n\tpsv.Append(apv)\n\tif psv.Size() != 2 {\n\t\tt.Fatal(\"unable to append to PointsVector\")\n\t}\n}\n\nfunc TestNewPointVector(t *testing.T) {\n\tepv := NewPointVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty pointvector size not 0\")\n\t}\n\n\tpts := []image.Point{\n\t\timage.Pt(10, 10),\n\t\timage.Pt(10, 20),\n\t\timage.Pt(20, 20),\n\t\timage.Pt(20, 10),\n\t}\n\n\tpv := NewPointVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tif pv.IsNil() {\n\t\tt.Fatal(\"pointvector pointer was nil\")\n\t}\n\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected pointvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\tif p != image.Pt(10, 10) {\n\t\tt.Fatal(\"invalid point\")\n\t}\n\n\tnp := image.Pt(50, 50)\n\n\tpv.Append(np)\n\tif pv.Size() != 5 {\n\t\tt.Fatal(\"unable to append to PointVector\")\n\t}\n\n\tmat := NewMatWithSize(4, 1, MatTypeCV32SC2)\n\tdefer mat.Close()\n\n\tpvm := NewPointVectorFromMat(mat)\n\tdefer pvm.Close()\n\n\tif pvm.Size() != 4 {\n\t\tt.Fatalf(\"expected size of NewPointVectorFromMat to be 4, was %d\", pvm.Size())\n\t}\n}\n\nfunc TestNewPoint2fVector(t *testing.T) {\n\tepv := NewPoint2fVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty pointvector size not 0\")\n\t}\n\n\tpts := []Point2f{\n\t\t{10.0, 10.0},\n\t\t{10.0, 20.0},\n\t\t{20.5, 21.5},\n\t\t{25.5, 30.5},\n\t}\n\n\tpv := NewPoint2fVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tif pv.IsNil() {\n\t\tt.Fatal(\"point2fvector pointer was nil\")\n\t}\n\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected point2fvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\twant := Point2f{10.0, 10.0}\n\tif p != want {\n\t\tt.Fatal(\"invalid point\")\n\t}\n\n\tp = pv.At(10)\n\tnopoint := Point2f{0, 0}\n\tif p != nopoint {\n\t\tt.Fatal(\"invalid At() point beyond range\")\n\t}\n\n\tout := pv.ToPoints()\n\tif len(out) != 4 && out[0] != want {\n\t\tt.Fatal(\"invalid ToPoints()\")\n\t}\n\n\tmat := NewMatWithSize(4, 1, MatTypeCV32FC2)\n\tdefer mat.Close()\n\n\tpvm := NewPoint2fVectorFromMat(mat)\n\tdefer pvm.Close()\n\n\tif pvm.Size() != 4 {\n\t\tt.Fatalf(\"expected size of NewPoint2fVectorFromMat to be 4, was %d\", pvm.Size())\n\t}\n}\n\nfunc TestNewPoints2fVector(t *testing.T) {\n\tepv := NewPoints2fVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty points2fvector size not 0\")\n\t}\n\n\tpts := [][]Point2f{\n\t\t{\n\t\t\tNewPoint2f(10.0, 10.0),\n\t\t\tNewPoint2f(10.0, 20.0),\n\t\t\tNewPoint2f(20.0, 20.0),\n\t\t\tNewPoint2f(20.0, 10.0),\n\t\t},\n\t}\n\n\tpsv := NewPoints2fVectorFromPoints(pts)\n\tdefer psv.Close()\n\n\tif psv.IsNil() {\n\t\tt.Fatal(\"points2fvector pointer was nil\")\n\t}\n\n\tif psv.Size() != 1 {\n\t\tt.Fatal(\"expected points2fvector size 1\")\n\t}\n\n\tipv := psv.At(10)\n\tif !ipv.IsNil() {\n\t\tt.Fatal(\"expected pointvector nil\")\n\t}\n\n\tpv := psv.At(0)\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected pointvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\tif p != NewPoint2f(10.0, 10.0) {\n\t\tt.Fatal(\"invalid At() point\")\n\t}\n\n\tp = pv.At(10)\n\tif p != NewPoint2f(0, 0) {\n\t\tt.Fatal(\"invalid At() point beyond range\")\n\t}\n\n\tout := psv.ToPoints()\n\tif out[0][0] != NewPoint2f(10.0, 10.0) {\n\t\tt.Fatal(\"invalid ToPoints() point\")\n\t}\n\n\tps := []Point2f{\n\t\tNewPoint2f(10, 10),\n\t\tNewPoint2f(10, 20),\n\t\tNewPoint2f(20, 20),\n\t\tNewPoint2f(20, 10),\n\t}\n\n\tapv := NewPoint2fVectorFromPoints(ps)\n\tdefer apv.Close()\n\n\tpsv.Append(apv)\n\tif psv.Size() != 2 {\n\t\tt.Fatal(\"unable to append to Points2fVector\")\n\t}\n}\n\nfunc TestNewPoint3fVector(t *testing.T) {\n\tepv := NewPoint3fVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty pointvector size not 0\")\n\t}\n\n\tpts := []Point3f{\n\t\t{10.0, 10.0, 0.1},\n\t\t{10.0, 20.0, 1.0},\n\t\t{20.5, 21.5, 2.0},\n\t}\n\n\tpv := NewPoint3fVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tpv.Append(NewPoint3f(25.5, 30.5, 3.0))\n\n\tif pv.IsNil() {\n\t\tt.Fatal(\"point3fvector pointer was nil\")\n\t}\n\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected point3fvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\twant := Point3f{10.0, 10.0, 0.1}\n\tif p != want {\n\t\tt.Fatal(\"invalid point\")\n\t}\n\n\twant2 := NewPoint3f(25.5, 30.5, 3.0)\n\tif pv.At(3) != want2 {\n\t\tt.Fatal(\"fail to append point to Point3fVector\")\n\t}\n\n\tp = pv.At(10)\n\tnopoint := Point3f{0, 0, 0}\n\tif p != nopoint {\n\t\tt.Fatal(\"invalid At() point beyond range\")\n\t}\n\n\tout := pv.ToPoints()\n\tif len(out) != 4 && out[0] != want {\n\t\tt.Fatal(\"invalid ToPoints()\")\n\t}\n\n\tmat := NewMatWithSize(4, 1, MatTypeCV32FC3)\n\tdefer mat.Close()\n\n\tpvm := NewPoint3fVectorFromMat(mat)\n\tdefer pvm.Close()\n\n\tif pvm.Size() != 4 {\n\t\tt.Fatalf(\"expected size of NewPoint3fVectorFromMat to be 4, was %d\", pvm.Size())\n\t}\n}\n\nfunc TestNewPoints3fVector(t *testing.T) {\n\tepv := NewPoints3fVector()\n\tdefer epv.Close()\n\n\tif epv.Size() != 0 {\n\t\tt.Fatal(\"expected empty points3fvector size not 0\")\n\t}\n\n\tpts := [][]Point3f{\n\t\t{\n\t\t\tNewPoint3f(10.0, 10.0, 0.1),\n\t\t\tNewPoint3f(10.0, 20.0, 0.2),\n\t\t\tNewPoint3f(20.0, 20.0, 0.3),\n\t\t\tNewPoint3f(20.0, 10.0, 0.4),\n\t\t},\n\t}\n\n\tpsv := NewPoints3fVectorFromPoints(pts)\n\tdefer psv.Close()\n\n\tif psv.IsNil() {\n\t\tt.Fatal(\"points3fvector pointer was nil\")\n\t}\n\n\tif psv.Size() != 1 {\n\t\tt.Fatal(\"expected points3fvector size 1\")\n\t}\n\n\tipv := psv.At(10)\n\tif !ipv.IsNil() {\n\t\tt.Fatal(\"expected pointvector nil\")\n\t}\n\n\tpv := psv.At(0)\n\tif pv.Size() != 4 {\n\t\tt.Fatal(\"expected pointvector size 4\")\n\t}\n\n\tp := pv.At(0)\n\tif p != NewPoint3f(10.0, 10.0, 0.1) {\n\t\tt.Fatal(\"invalid At() point\")\n\t}\n\n\tp = pv.At(10)\n\tif p != NewPoint3f(0, 0, 0) {\n\t\tt.Fatal(\"invalid At() point beyond range\")\n\t}\n\n\tout := psv.ToPoints()\n\tif out[0][0] != NewPoint3f(10.0, 10.0, 0.1) {\n\t\tt.Fatal(\"invalid ToPoints() point\")\n\t}\n\n\tps := []Point3f{\n\t\tNewPoint3f(10, 10, 0.1),\n\t\tNewPoint3f(10, 20, 0.2),\n\t\tNewPoint3f(20, 20, 0.3),\n\t\tNewPoint3f(20, 10, 0.4),\n\t}\n\n\tapv := NewPoint3fVectorFromPoints(ps)\n\tdefer apv.Close()\n\n\tpsv.Append(apv)\n\tif psv.Size() != 2 {\n\t\tt.Fatal(\"unable to append to Points3fVector\")\n\t}\n}\n\nfunc TestElemSize(t *testing.T) {\n\tm1 := NewMat()\n\tdefer m1.Close()\n\tif m1.ElemSize() != 0 {\n\t\tt.Error(\"incorrect element size\")\n\t}\n\n\tm2 := NewMatWithSize(2, 2, MatTypeCV16S)\n\tdefer m2.Close()\n\tif m2.ElemSize() != 2 {\n\t\tt.Error(\"incorrect element size of MatTypeCV16S\")\n\t}\n\n\tm3 := NewMatWithSize(2, 2, MatTypeCV16SC3)\n\tdefer m3.Close()\n\tif m3.ElemSize() != 6 {\n\t\tt.Error(\"incorrect element size of MatTypeCV16SC3\")\n\t}\n\n\tm4 := NewMatWithSize(2, 2, MatTypeCV32SC4)\n\tdefer m4.Close()\n\tif m4.ElemSize() != 16 {\n\t\tt.Error(\"incorrect element size of MatTypeCV32SC4\")\n\t\treturn\n\t}\n}\n\nfunc TestSetThreadNumber(t *testing.T) {\n\toriginal := GetNumThreads()\n\n\tSetNumThreads(-1)\n\tif num := GetNumThreads(); num != original {\n\t\tt.Errorf(\"incorrect number of threads, got %d, want %d\", num, original)\n\t}\n\n\tSetNumThreads(0)\n\tif num := GetNumThreads(); num < 1 {\n\t\tt.Errorf(\"incorrect number of threads, got %d, want at least 1\", num)\n\t}\n\n\tSetNumThreads(1)\n\tif num := GetNumThreads(); num != 1 {\n\t\tt.Errorf(\"incorrect number of threads, got %d, want %d\", num, 1)\n\t}\n\n\tSetNumThreads(original)\n}\n\nfunc TestMinMaxLoc(t *testing.T) {\n\tinput := NewMatWithSize(2, 2, MatTypeCV32F)\n\tdefer input.Close()\n\tinput.SetFloatAt(0, 0, 1)\n\tinput.SetFloatAt(0, 1, 2)\n\tinput.SetFloatAt(1, 0, 3)\n\tinput.SetFloatAt(1, 1, 4)\n\tminVal, maxVal, minLoc, maxLoc := MinMaxLoc(input)\n\n\twantMinVal, wantMaxValue := float32(1.0), float32(4.0)\n\tif minVal != wantMinVal {\n\t\tt.Errorf(\"minVal got: %v, want %v\", minVal, wantMinVal)\n\t}\n\tif maxVal != wantMaxValue {\n\t\tt.Errorf(\"maxVal got: %v, want %v\", maxVal, wantMaxValue)\n\t}\n\twantMinLoc, wantMaxLoc := image.Point{Y: 0, X: 0}, image.Point{Y: 1, X: 1}\n\tif minLoc != wantMinLoc {\n\t\tt.Errorf(\"minLoc got: %v, want %v\", minLoc, wantMinLoc)\n\t}\n\tif maxLoc != wantMaxLoc {\n\t\tt.Errorf(\"maxLoc got: %v, want %v\", maxLoc, wantMaxLoc)\n\t}\n}\n\nfunc TestMinMaxLocWithMask(t *testing.T) {\n\tinput := NewMatWithSize(2, 2, MatTypeCV32F)\n\tdefer input.Close()\n\tinput.SetFloatAt(0, 0, 1)\n\tinput.SetFloatAt(0, 1, 2)\n\tinput.SetFloatAt(1, 0, 3)\n\tinput.SetFloatAt(1, 1, 4)\n\tmask := NewMatWithSize(2, 2, MatTypeCV8U)\n\tdefer mask.Close()\n\tmask.SetUCharAt(1, 0, 1)\n\tmask.SetUCharAt(1, 1, 1)\n\tminVal, maxVal, minLoc, maxLoc := MinMaxLocWithMask(input, mask)\n\n\twantMinVal, wantMaxValue := float32(3.0), float32(4.0)\n\tif minVal != wantMinVal {\n\t\tt.Errorf(\"minVal got: %v, want %v\", minVal, wantMinVal)\n\t}\n\tif maxVal != wantMaxValue {\n\t\tt.Errorf(\"maxVal got: %v, want %v\", maxVal, wantMaxValue)\n\t}\n\twantMinLoc, wantMaxLoc := image.Point{Y: 1, X: 0}, image.Point{Y: 1, X: 1}\n\tif minLoc != wantMinLoc {\n\t\tt.Errorf(\"minLoc got: %v, want %v\", minLoc, wantMinLoc)\n\t}\n\tif maxLoc != wantMaxLoc {\n\t\tt.Errorf(\"maxLoc got: %v, want %v\", maxLoc, wantMaxLoc)\n\t}\n}\n\nfunc TestNewRotatedRect(t *testing.T) {\n\n\trr := NewRotatedRect(image.Pt(1, 1), 10, 10, 75.0)\n\tif rr.Angle != 75.0 {\n\t\tt.Errorf(\"NewRotatedRect not working as intended\")\n\t}\n\n}\n\nfunc TestNewRotatedRect2f(t *testing.T) {\n\n\tpts := Point2f{\n\t\tX: 1.5,\n\t\tY: 1.5,\n\t}\n\n\trr := NewRotatedRect2f(pts, 10.5, 10.5, 75.0)\n\tif rr.Angle != 75.0 {\n\t\tt.Errorf(\"NewRotatedRect not working as intended\")\n\t}\n\n}\n\nfunc TestNewMatFromPointVector(t *testing.T) {\n\n\timg := NewMatWithSize(320, 200, MatTypeCV32SC1)\n\tdefer img.Close()\n\n\tsize := img.Size()\n\n\tpoints := []image.Point{\n\t\timage.Pt(0, 0), image.Pt(0, size[0]-1),\n\t\timage.Pt(size[1]-1, size[0]-1),\n\t\timage.Pt(size[1]-1, 0),\n\t}\n\n\tpv := NewPointVectorFromPoints(points)\n\tdefer pv.Close()\n\n\tm := NewMatFromPointVector(pv, false)\n\tdefer m.Close()\n\n\tif m.Empty() {\n\t\tt.Error(\"Mat shlould not be empty\")\n\t}\n\n}\n\nfunc TestNewMatFromPoint2fVector(t *testing.T) {\n\n\tpv2f := NewPoint2fVectorFromPoints([]Point2f{NewPoint2f(1.1, 2.2)})\n\tdefer pv2f.Close()\n\n\tm := NewMatFromPoint2fVector(pv2f, false)\n\tdefer m.Close()\n\n\tif m.Empty() {\n\t\tt.Error(\"Mat shlould not be empty\")\n\t}\n\n}\n"
  },
  {
    "path": "cuda/README.md",
    "content": "# CUDA\n\nIn order to use the GoCV `cuda` package, the CUDA toolkit from nvidia needs to be installed on the host system. \n\nThe CUDA backend for DNN module requires CC (Compute Capability) 5.3 or higher. Check your GPU https://developer.nvidia.com/cuda-gpus\n\nPlease see https://docs.nvidia.com/cuda/index.html for more information.\n\nFurthermore opencv must be compiled with CUDA support.\n\nGoCV also supports using CUDA as a backend for the OpenCV deep neural network (DNN) module.\n\n## How to use\n\n### Deep Neural Network (DNN) module\n\nThis code loads a Caffe model, and then uses CUDA to prepare it for execution on the GPU:\n\n```go\nnet := gocv.ReadNet(\"/path/to/your/model.caffemodel\", \"/path/to/your/config.proto\")\nif net.Empty() {\n    fmt.Println(\"Error reading network model\")\n    return\n}\n\nnet.SetPreferableBackend(gocv.NetBackendType(gocv.NetBackendCUDA))\nnet.SetPreferableTarget(gocv.NetTargetType(gocv.NetTargetCUDA))\n```\n\n### OpenCV CUDA modules\n\nYou can use calls directly to the OpenCV CUDA wrappers, both the synchronous and asynchronous versions.\n\nHere is an example that uses the synchronous CUDA calls:\n\n```go\n    cimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n    defer cimg.Close()\n    defer mimg.Close()\n    defer dimg.Close()\n\n    canny := NewCannyEdgeDetector(50, 100)\n    defer canny.Close()\n\n    detector := NewHoughSegmentDetector(1, math.Pi/180, 150, 50)\n    defer detector.Close()\n\n    dest := gocv.NewMat()\n    defer dest.Close()\n\n    // after each call, CPU thread is blocked until GPU operation is completed.\n    cimg.Upload(src)\n    canny.Detect(cimg, &mimg)\n    detector.Detect(mimg, &dimg)\n    dimg.Download(&dest)\n```\n\nHere is an example that uses the `Stream` type for calling CUDA using the asynchronous interface:\n\n```go\n    cimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n    defer cimg.Close()\n    defer mimg.Close()\n    defer dimg.Close()\n\n    stream := NewStream()\n    defer stream.Close()\n\n    canny := NewCannyEdgeDetector(50, 100)\n    defer canny.Close()\n\n    detector := NewHoughSegmentDetector(1, math.Pi/180, 150, 50)\n    defer detector.Close()\n\n    dest := gocv.NewMat()\n    defer dest.Close()\n\n    // all calls return immediately to CPU, work is scheduled to be done on GPU.\n    cimg.UploadWithStream(src, stream)\n    canny.DetectWithStream(cimg, &mimg, stream)\n    detector.DetectWithStream(mimg, &dimg, stream)\n    dimg.DownloadWithStream(&dest, stream)\n\n    // CPU thread blocks until all GPU calls have completed.\n    stream.WaitForCompletion()\n```\n\n## Installing CUDA\n\nDownload and install packages from https://developer.nvidia.com/cuda-downloads\n\nFor example, download 'cuda_10.2.89_440.33.01_linux.run'\n\nDownload and install packages from https://developer.nvidia.com/rdp/cudnn-archive\n\nFor example the 'cuDNN Runtime Library for Ubuntu18.04 (Deb)' and 'cuDNN Developer Library for Ubuntu18.04 (Deb)'\n\n## Compiling OpenCV with CUDA\n\nWe have included the make target `install_cuda` that compiles OpenCV with CUDA support. (For more details on the compilation process please see the `Makefile`)\n\nRun the command `make install_cuda` and you should be good to go.\n\nIf you need static opencv libraries\n\n\tmake install_cuda BUILD_SHARED_LIBS=OFF\n\nThen finally verify that it is all working \n\n    cd $GOPATH/src/gocv.io/x/gocv\n\tgo run ./cmd/cuda/main.go\n\t\nYou should see something along the lines of:\n\n    gocv version: 0.25.0\n    cuda information:\n      Device 0:  \"GeForce MX150\"  2003Mb, sm_61, Driver/Runtime ver.10.0/10.0\n"
  },
  {
    "path": "cuda/arithm.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_arithm)\n\n#include \"../core.h\"\n#include \"arithm.h\"\n#include <string.h>\n\nOpenCVResult GpuAbs(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::abs(*src, *dst);\n        } else {\n            cv::cuda::abs(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuAbsDiff(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::absdiff(*src1, *src2, *dst);\n        } else {\n            cv::cuda::absdiff(*src1, *src2, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuAdd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::add(*src1, *src2, *dst);\n        } else {\n            cv::cuda::add(*src1, *src2, *dst, cv::noArray(), -1, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuBitwiseAnd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::bitwise_and(*src1, *src2, *dst);\n        } else {\n            cv::cuda::bitwise_and(*src1, *src2, *dst, cv::noArray(), *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuBitwiseNot(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::bitwise_not(*src, *dst);\n        } else {\n            cv::cuda::bitwise_not(*src, *dst, cv::noArray(), *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuBitwiseOr(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::bitwise_or(*src1, *src2, *dst);\n        } else {\n            cv::cuda::bitwise_or(*src1, *src2, *dst, cv::noArray(), *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuBitwiseXor(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::bitwise_xor(*src1, *src2, *dst);\n        } else {\n            cv::cuda::bitwise_xor(*src1, *src2, *dst, cv::noArray(), *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuDivide(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::divide(*src1, *src2, *dst);\n        } else {\n            cv::cuda::divide(*src1, *src2, *dst, 1, -1, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuExp(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::exp(*src, *dst);\n        } else {\n            cv::cuda::exp(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuLog(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::log(*src, *dst);\n        } else {\n            cv::cuda::log(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMax(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::max(*src1, *src2, *dst);\n        } else {\n            cv::cuda::max(*src1, *src2, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMin(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::min(*src1, *src2, *dst);\n        } else {\n            cv::cuda::min(*src1, *src2, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMultiply(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::multiply(*src1, *src2, *dst);\n        } else {\n            cv::cuda::multiply(*src1, *src2, *dst, 1, -1, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuSqr(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::sqr(*src, *dst);\n        } else {\n            cv::cuda::sqr(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuSqrt(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::sqrt(*src, *dst);\n        } else {\n            cv::cuda::sqrt(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuSubtract(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::subtract(*src1, *src2, *dst);\n        } else {\n            cv::cuda::subtract(*src1, *src2, *dst, cv::noArray(), -1, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuThreshold(GpuMat src, GpuMat dst, double thresh, double maxval, int typ, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::threshold(*src, *dst, thresh, maxval, typ);\n        } else {\n            cv::cuda::threshold(*src, *dst, thresh, maxval, typ, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuFlip(GpuMat src, GpuMat dst, int flipCode, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::flip(*src, *dst, flipCode);\n        } else {\n            cv::cuda::flip(*src, *dst, flipCode, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMerge(struct GpuMats mats, GpuMat dst, Stream s) {\n    try {\n        std::vector<cv::cuda::GpuMat> images;\n\n        for (int i = 0; i < mats.length; ++i) {\n            images.push_back(*mats.mats[i]);\n        }\n    \n        if (s == NULL) {\n            cv::cuda::merge(images, *dst);\n        } else {\n            cv::cuda::merge(images, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuTranspose(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::transpose(*src, *dst);\n        } else {\n            cv::cuda::transpose(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuAddWeighted(GpuMat src1, double alpha, GpuMat src2, double beta, double gamma, GpuMat dst, int dType, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::addWeighted(*src1, alpha, *src2, beta, gamma, *dst, dType);\n        } else {    \n            cv::cuda::addWeighted(*src1, alpha, *src2, beta, gamma, *dst, dType, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuCopyMakeBorder(GpuMat src, GpuMat dst, int top, int bottom, int left, int right, int borderType, Scalar value, Stream s) {\n    try {\n        cv::Scalar cValue = cv::Scalar(value.val1, value.val2, value.val3, value.val4);\n\n        if (s == NULL) {\n            cv::cuda::copyMakeBorder(*src, *dst, top, bottom, left, right, borderType, cValue);\n        } else {\n            cv::cuda::copyMakeBorder(*src, *dst, top, bottom, left, right, borderType, cValue, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nLookUpTable Cuda_Create_LookUpTable(GpuMat lut){\n    try {\n        return new cv::Ptr<cv::cuda::LookUpTable>(cv::cuda::createLookUpTable(*lut));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid Cuda_LookUpTable_Close(LookUpTable lt) {\n    delete lt;\n}\n\nbool Cuda_LookUpTable_Empty(LookUpTable lut) {\n    try {\n        return lut->empty();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return true;\n    }\n}\n\nOpenCVResult Cuda_LookUpTable_Transform(LookUpTable lt, GpuMat src, GpuMat dst, Stream s) {\n    try {\n        cv::Ptr< cv::cuda::LookUpTable> p = cv::Ptr< cv::cuda::LookUpTable>(*lt);\n\n        if(s == NULL) {\n            p->transform(*src, *dst);\n        } else {\n            p->transform(*src, *dst, *s);\n        }    \n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_Split(GpuMat src, GpuMats dst, Stream s) {\n    try {\n        std::vector< cv::cuda::GpuMat > dstv;\n\n        for(int i = 0; i < dst.length; i++) {\n            dstv.push_back(*(dst.mats[i]));\n        }\n    \n        if(s == NULL){\n            cv::cuda::split(*src, dstv);\n        } else {\n            cv::cuda::split(*src, dstv, *s);\n        }    \n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuCalcNorm(GpuMat src, GpuMat dst, int typ, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::calcNorm(*src, *dst, typ);\n        } else {\n            cv::cuda::calcNorm(*src, *dst, typ, cv::noArray(), *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuCalcNormDiff(GpuMat src1, GpuMat src2, GpuMat dst, int typ, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::calcNormDiff(*src1, *src2, *dst, typ);\n        } else {\n            cv::cuda::calcNormDiff(*src1, *src2, *dst, typ, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble GpuNorm(GpuMat src1, GpuMat src2, int typ) {\n    try {\n        return cv::cuda::norm(*src1, *src2, typ);\n    } catch(const cv::Exception& e) {\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult GpuCompare(GpuMat src1, GpuMat src2, GpuMat dst, int typ, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::compare(*src1, *src2, *dst, typ);\n        } else {\n            cv::cuda::compare(*src1, *src2, *dst, typ, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuLShift(GpuMat src, Scalar shift, GpuMat dst, Stream s) {\n    try {\n        cv::Scalar cValue = cv::Scalar(shift.val1, shift.val2, shift.val3, shift.val4);\n\n        if (s == NULL) {\n            cv::cuda::lshift(*src, cValue, *dst);\n        } else {\n            cv::cuda::lshift(*src, cValue, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuRShift(GpuMat src, Scalar shift, GpuMat dst, Stream s) {\n    try {\n        cv::Scalar cValue = cv::Scalar(shift.val1, shift.val2, shift.val3, shift.val4);\n\n        if (s == NULL) {\n            cv::cuda::rshift(*src, cValue, *dst);\n        } else {\n            cv::cuda::rshift(*src, cValue, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuAbsSum(GpuMat src, GpuMat mask, struct Scalar* result) {\n    try {\n        cv::Scalar s = cv::cuda::absSum(*src, mask == NULL ? cv::noArray() : *mask);\n        result->val1 = s[0];\n        result->val2 = s[1];\n        result->val3 = s[2];\n        result->val4 = s[3];\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuCalcAbsSum(GpuMat src, GpuMat dst, GpuMat mask, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::calcAbsSum(*src, *dst, mask == NULL ? cv::noArray() : *mask);\n        } else {\n            cv::cuda::calcAbsSum(*src, *dst, mask == NULL ? cv::noArray() : *mask, *s);\n        }\n\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMinMax(GpuMat src, GpuMat mask, double* minVal, double* maxVal) {\n    try {\n        if (mask == NULL) {\n            cv::cuda::minMax(*src, minVal, maxVal, cv::noArray());\n        } else {\n            cv::cuda::minMax(*src, minVal, maxVal, *mask);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuMinMaxLoc(GpuMat src, GpuMat mask, double* minVal, double* maxVal, int* minLocX, int* minLocY, int* maxLocX, int* maxLocY) {\n    try {\n        cv::Point minLoc, maxLoc;\n        if (mask == NULL) {\n            cv::cuda::minMaxLoc(*src, minVal, maxVal, &minLoc, &maxLoc, cv::noArray());\n        } else {\n            cv::cuda::minMaxLoc(*src, minVal, maxVal, &minLoc, &maxLoc, *mask);\n        }\n        *minLocX = minLoc.x;\n        *minLocY = minLoc.y;\n        *maxLocX = maxLoc.x;\n        *maxLocY = maxLoc.y;\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuNormalize(GpuMat src, GpuMat dst, double alpha, double beta, int normType, int dtype, GpuMat mask, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::normalize(*src, *dst, alpha, beta, normType, dtype, mask == NULL ? cv::noArray() : *mask);\n        } else {\n            cv::cuda::normalize(*src, *dst, alpha, beta, normType, dtype, mask == NULL ? cv::noArray() : *mask, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuFindMinMaxLoc(GpuMat src, GpuMat minMaxVals, GpuMat loc, GpuMat mask, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::findMinMaxLoc(*src, *minMaxVals, *loc, mask == NULL ? cv::noArray() : *mask);\n        } else {\n            cv::cuda::findMinMaxLoc(*src, *minMaxVals, *loc, mask == NULL ? cv::noArray() : *mask, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuFindMinMax(GpuMat src, GpuMat dst, GpuMat mask, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::findMinMax(*src, *dst, mask == NULL ? cv::noArray() : *mask);\n        } else {\n            cv::cuda::findMinMax(*src, *dst, mask == NULL ? cv::noArray() : *mask, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/arithm.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_arithm)\n\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"../core.h\"\n#include \"core.h\"\n#include \"arithm.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"image\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// Abs computes an absolute value of each matrix element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga54a72bd772494ab34d05406fd76df2b6\nfunc Abs(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuAbs(src.p, dst.p, nil))\n}\n\n// AbsWithStream computes an absolute value of each matrix element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga54a72bd772494ab34d05406fd76df2b6\nfunc AbsWithStream(src GpuMat, dst *GpuMat, stream Stream) error {\n\treturn OpenCVResult(C.GpuAbs(src.p, dst.p, stream.p))\n}\n\n// AbsDiff computes per-element absolute difference of two matrices\n// (or of a matrix and scalar) using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac062b283cf46ee90f74a773d3382ab54\nfunc AbsDiff(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuAbsDiff(src1.p, src2.p, dst.p, nil))\n}\n\n// AbsDiffWithStream computes an absolute value of each matrix element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac062b283cf46ee90f74a773d3382ab54\nfunc AbsDiffWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuAbsDiff(src1.p, src2.p, dst.p, s.p))\n}\n\n// Add computes a matrix-matrix or matrix-scalar sum.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga5d9794bde97ed23d1c1485249074a8b1\nfunc Add(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuAdd(src1.p, src2.p, dst.p, nil))\n}\n\n// AddWithStream computes a matrix-matrix or matrix-scalar sum\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga5d9794bde97ed23d1c1485249074a8b1\nfunc AddWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuAdd(src1.p, src2.p, dst.p, s.p))\n}\n\n// BitwiseAnd performs a per-element bitwise conjunction of two matrices\n// (or of matrix and scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga78d7c1a013877abd4237fbfc4e13bd76\nfunc BitwiseAnd(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuBitwiseAnd(src1.p, src2.p, dst.p, nil))\n}\n\n// BitwiseAndWithStream performs a per-element bitwise conjunction of two matrices\n// (or of matrix and scalar) using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga78d7c1a013877abd4237fbfc4e13bd76\nfunc BitwiseAndWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuBitwiseAnd(src1.p, src2.p, dst.p, s.p))\n}\n\n// BitwiseNot performs a per-element bitwise inversion.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gae58159a2259ae1acc76b531c171cf06a\nfunc BitwiseNot(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuBitwiseNot(src.p, dst.p, nil))\n}\n\n// BitwiseNotWithStream performs a per-element bitwise inversion\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gae58159a2259ae1acc76b531c171cf06a\nfunc BitwiseNotWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuBitwiseNot(src.p, dst.p, s.p))\n}\n\n// BitwiseOr performs a per-element bitwise disjunction of two matrices\n// (or of matrix and scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gafd098ee3e51c68daa793999c1da3dfb7\nfunc BitwiseOr(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuBitwiseOr(src1.p, src2.p, dst.p, nil))\n}\n\n// BitwiseOrWithStream performs a per-element bitwise disjunction of two matrices\n// (or of matrix and scalar) using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gafd098ee3e51c68daa793999c1da3dfb7\nfunc BitwiseOrWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuBitwiseXor(src1.p, src2.p, dst.p, s.p))\n}\n\n// BitwiseXor performs a per-element exclusive or of two matrices\n// (or of matrix and scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga3d95d4faafb099aacf18e8b915a4ad8d\nfunc BitwiseXor(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuBitwiseXor(src1.p, src2.p, dst.p, nil))\n}\n\n// BitwiseXorWithStream performs a per-element exclusive or of two matrices\n// (or of matrix and scalar) using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga3d95d4faafb099aacf18e8b915a4ad8d\nfunc BitwiseXorWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuBitwiseXor(src1.p, src2.p, dst.p, s.p))\n}\n\n// Divide computes a matrix-matrix or matrix-scalar division.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga124315aa226260841e25cc0b9ea99dc3\nfunc Divide(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuDivide(src1.p, src2.p, dst.p, nil))\n}\n\n// DivideWithStream computes a matrix-matrix or matrix-scalar division\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga124315aa226260841e25cc0b9ea99dc3\nfunc DivideWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuDivide(src1.p, src2.p, dst.p, s.p))\n}\n\n// Exp computes an exponent of each matrix element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac6e51541d3bb0a7a396128e4d5919b61\nfunc Exp(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuExp(src.p, dst.p, nil))\n}\n\n// ExpWithStream computes an exponent of each matrix element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac6e51541d3bb0a7a396128e4d5919b61\nfunc ExpWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuExp(src.p, dst.p, s.p))\n}\n\n// Log computes natural logarithm of absolute value of each matrix element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac6e51541d3bb0a7a396128e4d5919b61\nfunc Log(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuLog(src.p, dst.p, nil))\n}\n\n// LogWithStream computes natural logarithm of absolute value of each matrix element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gac6e51541d3bb0a7a396128e4d5919b61\nfunc LogWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuLog(src.p, dst.p, s.p))\n}\n\n// Max computes the per-element maximum of two matrices (or a matrix and a scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gadb5dd3d870f10c0866035755b929b1e7\nfunc Max(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuMax(src1.p, src2.p, dst.p, nil))\n}\n\n// MaxWithStream computes the per-element maximum of two matrices (or a matrix and a scalar).\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#gadb5dd3d870f10c0866035755b929b1e7\nfunc MaxWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuMax(src1.p, src2.p, dst.p, s.p))\n}\n\n// Min computes the per-element minimum of two matrices (or a matrix and a scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga74f0b05a65b3d949c237abb5e6c60867\nfunc Min(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuMin(src1.p, src2.p, dst.p, nil))\n}\n\n// MinWithStream computes the per-element minimum of two matrices (or a matrix and a scalar).\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga74f0b05a65b3d949c237abb5e6c60867\nfunc MinWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuMin(src1.p, src2.p, dst.p, s.p))\n}\n\n// Multiply computes a matrix-matrix or matrix-scalar multiplication.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga497cc0615bf717e1e615143b56f00591\nfunc Multiply(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuMultiply(src1.p, src2.p, dst.p, nil))\n}\n\n// MultiplyWithStream computes a matrix-matrix or matrix-scalar multiplication.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga497cc0615bf717e1e615143b56f00591\nfunc MultiplyWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuMultiply(src1.p, src2.p, dst.p, s.p))\n}\n\n// Sqr computes a square value of each matrix element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga8aae233da90ce0ffe309ab8004342acb\nfunc Sqr(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuSqr(src.p, dst.p, nil))\n}\n\n// SqrWithStream computes a square value of each matrix element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga8aae233da90ce0ffe309ab8004342acb\nfunc SqrWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuSqr(src.p, dst.p, s.p))\n}\n\n// Sqrt computes a square root of each matrix element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga09303680cb1a5521a922b6d392028d8c\nfunc Sqrt(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuSqrt(src.p, dst.p, nil))\n}\n\n// SqrtWithStream computes a square root of each matrix element.\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga09303680cb1a5521a922b6d392028d8c\nfunc SqrtWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuSqrt(src.p, dst.p, s.p))\n}\n\n// Subtract computes a matrix-matrix or matrix-scalar difference.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga6eab60fc250059e2fda79c5636bd067f\nfunc Subtract(src1, src2 GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuSubtract(src1.p, src2.p, dst.p, nil))\n}\n\n// SubtractWithStream computes a matrix-matrix or matrix-scalar difference\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga6eab60fc250059e2fda79c5636bd067f\nfunc SubtractWithStream(src1, src2 GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuSubtract(src1.p, src2.p, dst.p, s.p))\n}\n\n// Threshold applies a fixed-level threshold to each array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga40f1c94ae9a9456df3cad48e3cb008e1\nfunc Threshold(src GpuMat, dst *GpuMat, thresh, maxval float64, typ gocv.ThresholdType) error {\n\treturn OpenCVResult(C.GpuThreshold(src.p, dst.p, C.double(thresh), C.double(maxval), C.int(typ), nil))\n}\n\n// ThresholdWithStream applies a fixed-level threshold to each array element\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d34/group__cudaarithm__elem.html#ga40f1c94ae9a9456df3cad48e3cb008e1\nfunc ThresholdWithStream(src GpuMat, dst *GpuMat, thresh, maxval float64, typ gocv.ThresholdType, s Stream) error {\n\treturn OpenCVResult(C.GpuThreshold(src.p, dst.p, C.double(thresh), C.double(maxval), C.int(typ), s.p))\n}\n\n// Flip flips a 2D matrix around vertical, horizontal, or both axes.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/d09/group__cudaarithm__core.html#ga4d0a3f2b46e8f0f1ec2b5ac178dcd871\nfunc Flip(src GpuMat, dst *GpuMat, flipCode int) error {\n\treturn OpenCVResult(C.GpuFlip(src.p, dst.p, C.int(flipCode), nil))\n}\n\n// FlipWithStream flips a 2D matrix around vertical, horizontal, or both axes\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/d09/group__cudaarithm__core.html#ga4d0a3f2b46e8f0f1ec2b5ac178dcd871\nfunc FlipWithStream(src GpuMat, dst *GpuMat, flipCode int, stream Stream) error {\n\treturn OpenCVResult(C.GpuFlip(src.p, dst.p, C.int(flipCode), stream.p))\n}\n\n// Merge makes a multi-channel matrix out of several single-channel matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#gafce19eb0fcad23f67ab45d544992436d\nfunc Merge(mv []GpuMat, dst *GpuMat) error {\n\tcMatArray := make([]C.GpuMat, len(mv))\n\tfor i, r := range mv {\n\t\tcMatArray[i] = r.p\n\t}\n\tcMats := C.GpuMats{\n\t\tmats:   (*C.GpuMat)(&cMatArray[0]),\n\t\tlength: C.int(len(mv)),\n\t}\n\n\treturn OpenCVResult(C.GpuMerge(cMats, dst.p, nil))\n}\n\n// MergeWithStream makes a multi-channel matrix out of several single-channel matrices\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#gafce19eb0fcad23f67ab45d544992436d\nfunc MergeWithStream(mv []GpuMat, dst *GpuMat, s Stream) error {\n\tcMatArray := make([]C.GpuMat, len(mv))\n\tfor i, r := range mv {\n\t\tcMatArray[i] = r.p\n\t}\n\tcMats := C.GpuMats{\n\t\tmats:   (*C.GpuMat)(&cMatArray[0]),\n\t\tlength: C.int(len(mv)),\n\t}\n\n\treturn OpenCVResult(C.GpuMerge(cMats, dst.p, s.p))\n}\n\n// Transpose transposes a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#ga327b71c3cb811a904ccf5fba37fc29f2\nfunc Transpose(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GpuTranspose(src.p, dst.p, nil))\n}\n\n// Transpose transposes a matrix using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#ga327b71c3cb811a904ccf5fba37fc29f2\nfunc TransposeWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GpuTranspose(src.p, dst.p, s.p))\n}\n\n// AddWeighted computes a weighted sum of two matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga2cd14a684ea70c6ab2a63ee90ffe6201\nfunc AddWeighted(src1 GpuMat, alpha float64, src2 GpuMat, beta float64, gamma float64, dst *GpuMat, dType int) error {\n\treturn OpenCVResult(C.GpuAddWeighted(src1.p, C.double(alpha), src2.p, C.double(beta), C.double(gamma), dst.p, C.int(dType), nil))\n}\n\n// AddWeightedWithStream computes a weighted sum of two matrices using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga2cd14a684ea70c6ab2a63ee90ffe6201\nfunc AddWeightedWithStream(src1 GpuMat, alpha float64, src2 GpuMat, beta float64, gamma float64, dst *GpuMat, dType int, s Stream) error {\n\treturn OpenCVResult(C.GpuAddWeighted(src1.p, C.double(alpha), src2.p, C.double(beta), C.double(gamma), dst.p, C.int(dType), s.p))\n}\n\n// CopyMakeBorder forms a border around an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/d09/group__cudaarithm__core.html#ga5368db7656eacf846b40089c98053a49\nfunc CopyMakeBorder(src GpuMat, dst *GpuMat, top, bottom, left, right int, borderType gocv.BorderType, value gocv.Scalar) error {\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(value.Val1),\n\t\tval2: C.double(value.Val2),\n\t\tval3: C.double(value.Val3),\n\t\tval4: C.double(value.Val4),\n\t}\n\n\treturn OpenCVResult(C.GpuCopyMakeBorder(src.p, dst.p, C.int(top), C.int(bottom), C.int(left), C.int(right), C.int(borderType), bv, nil))\n}\n\n// CopyMakeBorderWithStream forms a border around an image using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/d09/group__cudaarithm__core.html#ga5368db7656eacf846b40089c98053a49\nfunc CopyMakeBorderWithStream(src GpuMat, dst *GpuMat, top, bottom, left, right int, borderType gocv.BorderType, value gocv.Scalar, s Stream) error {\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(value.Val1),\n\t\tval2: C.double(value.Val2),\n\t\tval3: C.double(value.Val3),\n\t\tval4: C.double(value.Val4),\n\t}\n\n\treturn OpenCVResult(C.GpuCopyMakeBorder(src.p, dst.p, C.int(top), C.int(bottom), C.int(left), C.int(right), C.int(borderType), bv, s.p))\n}\n\ntype LookUpTable struct {\n\tp C.LookUpTable\n}\n\n// NewLookUpTable Creates implementation for cuda::LookUpTable .\n//\n// lut\tLook-up table of 256 elements. It is a continuous CV_8U matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#gaa75254a07dcf7996b4b5a68d383847f8\nfunc NewLookUpTable(lut GpuMat) LookUpTable {\n\treturn LookUpTable{p: C.Cuda_Create_LookUpTable(lut.p)}\n}\n\n// Close releases LookUpTable resources.\nfunc (lt *LookUpTable) Close() {\n\tC.Cuda_LookUpTable_Close(lt.p)\n}\n\n// Transform Transforms the source matrix into the destination\n// matrix using the given look-up table: dst(I) = lut(src(I)) .\n//\n// src: Source matrix. CV_8UC1 and CV_8UC3 matrices are supported for now.\n//\n// dst: Destination matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d29/classcv_1_1cuda_1_1LookUpTable.html#afdbcbd3047f847451892f3b18cd018de\nfunc (lt *LookUpTable) Transform(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.Cuda_LookUpTable_Transform(lt.p, src.p, dst.p, nil))\n}\n\n// Empty Returns true if the Algorithm is empty\n// (e.g. in the very beginning or after unsuccessful read.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d3/d46/classcv_1_1Algorithm.html#a827c8b2781ed17574805f373e6054ff1\nfunc (lt *LookUpTable) Empty() bool {\n\tb := C.Cuda_LookUpTable_Empty(lt.p)\n\n\treturn bool(b)\n}\n\n// TransformWithStream Transforms the source matrix into the destination\n// matrix using the given look-up table: dst(I) = lut(src(I)) .\n//\n// src: Source matrix. CV_8UC1 and CV_8UC3 matrices are supported for now.\n//\n// dst: Destination matrix.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d29/classcv_1_1cuda_1_1LookUpTable.html#afdbcbd3047f847451892f3b18cd018de\nfunc (lt *LookUpTable) TransformWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_LookUpTable_Transform(lt.p, src.p, dst.p, s.p))\n}\n\n// Split Copies each plane of a multi-channel matrix into an array.\n//\n// src: Source matrix.\n//\n// dst: Destination array/vector of single-channel matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#gaf1714e7a9ea0719c29bf378beaf5f99d\nfunc Split(src GpuMat, dst []GpuMat) error {\n\n\tdstv := make([]C.GpuMat, len(dst))\n\n\tfor i := range dst {\n\t\tdstv[i] = dst[i].p\n\t}\n\n\tc_dstv := C.GpuMats{\n\t\tmats:   unsafe.SliceData(dstv),\n\t\tlength: C.int(len(dstv)),\n\t}\n\n\treturn OpenCVResult(C.Cuda_Split(src.p, c_dstv, nil))\n}\n\n// SplitWithStream Copies each plane of a multi-channel matrix into an array.\n//\n// src: Source matrix.\n//\n// dst: Destination array/vector of single-channel matrices.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/d09/group__cudaarithm__core.html#gaf1714e7a9ea0719c29bf378beaf5f99d\nfunc SplitWithStream(src GpuMat, dst []GpuMat, s Stream) error {\n\n\tdstv := make([]C.GpuMat, len(dst))\n\n\tfor i := range dst {\n\t\tdstv[i] = dst[i].p\n\t}\n\n\tc_dstv := C.GpuMats{\n\t\tmats:   unsafe.SliceData(dstv),\n\t\tlength: C.int(len(dstv)),\n\t}\n\n\treturn OpenCVResult(C.Cuda_Split(src.p, c_dstv, s.p))\n}\n\n// CalcNorm calculates the norm of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga39d2826990d29b7e4b69dbe02bdae2e1\nfunc CalcNorm(src, dst GpuMat, normType gocv.NormType) error {\n\treturn OpenCVResult(C.GpuCalcNorm(src.p, dst.p, C.int(normType), nil))\n}\n\n// CalcNormWithStream calculates the norm of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga39d2826990d29b7e4b69dbe02bdae2e1\nfunc CalcNormWithStream(src, dst GpuMat, normType gocv.NormType, s Stream) error {\n\treturn OpenCVResult(C.GpuCalcNorm(src.p, dst.p, C.int(normType), s.p))\n}\n\n// CalcNormDiff calculates the norm of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga9be3d9a7b6c5760955f37d1039d01265\nfunc CalcNormDiff(src1, src2, dst GpuMat, normType gocv.NormType) error {\n\treturn OpenCVResult(C.GpuCalcNormDiff(src1.p, src2.p, dst.p, C.int(normType), nil))\n}\n\n// CalcNormDiffWithStream calculates the norm of a matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga9be3d9a7b6c5760955f37d1039d01265\nfunc CalcNormDiffWithStream(src1, src2, dst GpuMat, normType gocv.NormType, s Stream) error {\n\treturn OpenCVResult(C.GpuCalcNormDiff(src1.p, src2.p, dst.p, C.int(normType), s.p))\n}\n\n// Norm returns the difference of two matrices.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga48b6298589b80a6915d076e2dcdbd11b\nfunc Norm(src1, src2 GpuMat, normType gocv.NormType) float64 {\n\treturn float64(C.GpuNorm(src1.p, src2.p, C.int(normType)))\n}\n\n// Compare compares elements of two matrices (or of a matrix and scalar).\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga4d41cd679f4a83862a3de71a6057db54\nfunc Compare(src1, src2, dst GpuMat, compareType gocv.CompareType) error {\n\treturn OpenCVResult(C.GpuCompare(src1.p, src2.p, dst.p, C.int(compareType), nil))\n}\n\n// CompareWithStream compares elements of two matrices (or of a matrix and scalar)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga4d41cd679f4a83862a3de71a6057db54\nfunc CompareWithStream(src1, src2, dst GpuMat, compareType gocv.CompareType, s Stream) error {\n\treturn OpenCVResult(C.GpuCompare(src1.p, src2.p, dst.p, C.int(compareType), s.p))\n}\n\n// LShift performs a per-element left bit-shift of a matrix by a constant amount.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga79fd71721b04444eb87c6c4844c22a6e\nfunc LShift(src GpuMat, shift gocv.Scalar, dst *GpuMat) error {\n\tcShift := C.struct_Scalar{\n\t\tval1: C.double(shift.Val1),\n\t\tval2: C.double(shift.Val2),\n\t\tval3: C.double(shift.Val3),\n\t\tval4: C.double(shift.Val4),\n\t}\n\treturn OpenCVResult(C.GpuLShift(src.p, cShift, dst.p, nil))\n}\n\n// LShiftWithStream performs a per-element left bit-shift of a matrix by a constant amount using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga79fd71721b04444eb87c6c4844c22a6e\nfunc LShiftWithStream(src GpuMat, shift gocv.Scalar, dst *GpuMat, s Stream) error {\n\tcShift := C.struct_Scalar{\n\t\tval1: C.double(shift.Val1),\n\t\tval2: C.double(shift.Val2),\n\t\tval3: C.double(shift.Val3),\n\t\tval4: C.double(shift.Val4),\n\t}\n\treturn OpenCVResult(C.GpuLShift(src.p, cShift, dst.p, s.p))\n}\n\n// RShift performs a per-element right bit-shift of a matrix by a constant amount.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga513719d25e508160a245724369d68346\nfunc RShift(src GpuMat, shift gocv.Scalar, dst *GpuMat) error {\n\tcShift := C.struct_Scalar{\n\t\tval1: C.double(shift.Val1),\n\t\tval2: C.double(shift.Val2),\n\t\tval3: C.double(shift.Val3),\n\t\tval4: C.double(shift.Val4),\n\t}\n\treturn OpenCVResult(C.GpuRShift(src.p, cShift, dst.p, nil))\n}\n\n// RShiftWithStream performs a per-element right bit-shift of a matrix by a constant amount using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d34/group__cudaarithm__elem.html#ga513719d25e508160a245724369d68346\nfunc RShiftWithStream(src GpuMat, shift gocv.Scalar, dst *GpuMat, s Stream) error {\n\tcShift := C.struct_Scalar{\n\t\tval1: C.double(shift.Val1),\n\t\tval2: C.double(shift.Val2),\n\t\tval3: C.double(shift.Val3),\n\t\tval4: C.double(shift.Val4),\n\t}\n\treturn OpenCVResult(C.GpuRShift(src.p, cShift, dst.p, s.p))\n}\n\n// AbsSum computes the sum of absolute values of array elements.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga690fa79ba4426c53f7d2bebf3d37a32a\nfunc AbsSum(src GpuMat) (gocv.Scalar, error) {\n    var cResult C.struct_Scalar\n    err := OpenCVResult(C.GpuAbsSum(src.p, nil, &cResult))\n    return gocv.Scalar{\n        Val1: float64(cResult.val1),\n        Val2: float64(cResult.val2),\n        Val3: float64(cResult.val3),\n        Val4: float64(cResult.val4),\n    }, err\n}\n\n// AbsSumWithMask computes the sum of absolute values of array elements using a mask.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga690fa79ba4426c53f7d2bebf3d37a32a\nfunc AbsSumWithMask(src, mask GpuMat) (gocv.Scalar, error) {\n    var cResult C.struct_Scalar\n    err := OpenCVResult(C.GpuAbsSum(src.p, mask.p, &cResult))\n    return gocv.Scalar{\n        Val1: float64(cResult.val1),\n        Val2: float64(cResult.val2),\n        Val3: float64(cResult.val3),\n        Val4: float64(cResult.val4),\n    }, err\n}\n\n// CalcAbsSum computes the sum of absolute values of array elements and stores the result in dst.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga15c403b76ab2c4d7ed0f5edc09891b7e\nfunc CalcAbsSum(src GpuMat, dst *GpuMat) error {\n    return OpenCVResult(C.GpuCalcAbsSum(src.p, dst.p, nil, nil))\n}\n\n// CalcAbsSumWithMask computes the sum of absolute values of array elements using a mask and stores the result in dst.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga15c403b76ab2c4d7ed0f5edc09891b7e\nfunc CalcAbsSumWithMask(src GpuMat, dst *GpuMat, mask GpuMat) error {\n    return OpenCVResult(C.GpuCalcAbsSum(src.p, dst.p, mask.p, nil))\n}\n\n// CalcAbsSumWithStream computes the sum of absolute values of array elements and stores the result in dst using a Stream.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga15c403b76ab2c4d7ed0f5edc09891b7e\nfunc CalcAbsSumWithStream(src GpuMat, dst *GpuMat, mask GpuMat, s Stream) error {\n    return OpenCVResult(C.GpuCalcAbsSum(src.p, dst.p, mask.p, s.p))\n}\n\n// MinMax computes the global minimum and maximum in a GpuMat.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga8d7de68c10717cf25e787e3c20d2dfee\nfunc MinMax(src GpuMat) (minVal, maxVal float64, err error) {\n    var cMin, cMax C.double\n    e := OpenCVResult(C.GpuMinMax(src.p, nil, &cMin, &cMax))\n    return float64(cMin), float64(cMax), e\n}\n\n// MinMaxWithMask computes the global minimum and maximum in a GpuMat using a mask.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga8d7de68c10717cf25e787e3c20d2dfee\nfunc MinMaxWithMask(src, mask GpuMat) (minVal, maxVal float64, err error) {\n    var cMin, cMax C.double\n    e := OpenCVResult(C.GpuMinMax(src.p, mask.p, &cMin, &cMax))\n    return float64(cMin), float64(cMax), e\n}\n\n// MinMaxLoc finds the global minimum and maximum in a GpuMat as well as their locations.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga5cacbc2a2323c4eaa81e7390c5d9f530\nfunc MinMaxLoc(src GpuMat) (minVal, maxVal float64, minLoc, maxLoc image.Point, err error) {\n    var cMin, cMax C.double\n    var minLocX, minLocY, maxLocX, maxLocY C.int\n    e := OpenCVResult(C.GpuMinMaxLoc(src.p, nil, &cMin, &cMax, &minLocX, &minLocY, &maxLocX, &maxLocY))\n    return float64(cMin), float64(cMax),\n        image.Pt(int(minLocX), int(minLocY)),\n        image.Pt(int(maxLocX), int(maxLocY)),\n        e\n}\n\n// MinMaxLocWithMask finds the global minimum and maximum in a GpuMat as well as their locations, using a mask.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga5cacbc2a2323c4eaa81e7390c5d9f530\nfunc MinMaxLocWithMask(src, mask GpuMat) (minVal, maxVal float64, minLoc, maxLoc image.Point, err error) {\n    var cMin, cMax C.double\n    var minLocX, minLocY, maxLocX, maxLocY C.int\n    e := OpenCVResult(C.GpuMinMaxLoc(src.p, mask.p, &cMin, &cMax, &minLocX, &minLocY, &maxLocX, &maxLocY))\n    return float64(cMin), float64(cMax),\n        image.Pt(int(minLocX), int(minLocY)),\n        image.Pt(int(maxLocX), int(maxLocY)),\n        e\n}\n\n// Normalize scales and shifts array elements so that they cover a certain range.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga4da4738b9956a5baaa2f5f8c2fba438a\nfunc Normalize(src GpuMat, dst *GpuMat, alpha, beta float64, normType gocv.NormType, dtype int) error {\n    return OpenCVResult(C.GpuNormalize(src.p, dst.p, C.double(alpha), C.double(beta), C.int(normType), C.int(dtype), nil, nil))\n}\n\n// NormalizeWithMask scales and shifts array elements so that they cover a certain range, using a mask.\nfunc NormalizeWithMask(src GpuMat, dst *GpuMat, alpha, beta float64, normType gocv.NormType, dtype int, mask GpuMat) error {\n    return OpenCVResult(C.GpuNormalize(src.p, dst.p, C.double(alpha), C.double(beta), C.int(normType), C.int(dtype), mask.p, nil))\n}\n\n// NormalizeWithStream scales and shifts array elements so that they cover a certain range, using a mask and Stream.\nfunc NormalizeWithStream(src GpuMat, dst *GpuMat, alpha, beta float64, normType gocv.NormType, dtype int, mask GpuMat, s Stream) error {\n    return OpenCVResult(C.GpuNormalize(src.p, dst.p, C.double(alpha), C.double(beta), C.int(normType), C.int(dtype), mask.p, s.p))\n}\n\n// FindMinMaxLoc finds the minimum and maximum values and their locations in a GpuMat.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#ga93916bc473a62d215d1130fab84d090a\nfunc FindMinMaxLoc(src GpuMat, minMaxVals, loc *GpuMat) error {\n    return OpenCVResult(C.GpuFindMinMaxLoc(src.p, minMaxVals.p, loc.p, nil, nil))\n}\n\n// FindMinMaxLocWithMask finds the minimum and maximum values and their locations in a GpuMat using a mask.\nfunc FindMinMaxLocWithMask(src GpuMat, minMaxVals, loc *GpuMat, mask GpuMat) error {\n    return OpenCVResult(C.GpuFindMinMaxLoc(src.p, minMaxVals.p, loc.p, mask.p, nil))\n}\n\n// FindMinMaxLocWithStream finds the minimum and maximum values and their locations in a GpuMat using a mask and Stream.\nfunc FindMinMaxLocWithStream(src GpuMat, minMaxVals, loc *GpuMat, mask GpuMat, s Stream) error {\n    return OpenCVResult(C.GpuFindMinMaxLoc(src.p, minMaxVals.p, loc.p, mask.p, s.p))\n}\n\n// FindMinMax finds the minimum and maximum values in a GpuMat and stores them in dst.\n// For further details, see:\n// https://docs.opencv.org/4.x/d5/de6/group__cudaarithm__reduce.html#gae7f5f2aa9f65314470a76fccdff887f2\nfunc FindMinMax(src GpuMat, dst *GpuMat) error {\n    return OpenCVResult(C.GpuFindMinMax(src.p, dst.p, nil, nil))\n}\n\n// FindMinMaxWithMask finds the minimum and maximum values in a GpuMat using a mask and stores them in dst.\nfunc FindMinMaxWithMask(src GpuMat, dst *GpuMat, mask GpuMat) error {\n    return OpenCVResult(C.GpuFindMinMax(src.p, dst.p, mask.p, nil))\n}\n\n// FindMinMaxWithStream finds the minimum and maximum values in a GpuMat using a mask and Stream, and stores them in dst.\nfunc FindMinMaxWithStream(src GpuMat, dst *GpuMat, mask GpuMat, s Stream) error {\n    return OpenCVResult(C.GpuFindMinMax(src.p, dst.p, mask.p, s.p))\n}\n"
  },
  {
    "path": "cuda/arithm.h",
    "content": "#ifndef _OPENCV3_CUDA_ARITHM_H_\n#define _OPENCV3_CUDA_ARITHM_H_\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/cudaarithm.hpp>\nextern \"C\" {\n#endif\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr< cv::cuda::LookUpTable >* LookUpTable;\n#else\ntypedef void* LookUpTable;\n#endif\n\nOpenCVResult GpuAbs(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuAbsDiff(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuAdd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuBitwiseAnd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuBitwiseNot(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuBitwiseOr(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuBitwiseXor(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuDivide(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuExp(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuLog(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuMax(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuMin(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuMultiply(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuSqr(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuSqrt(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuSubtract(GpuMat src1, GpuMat src2, GpuMat dst, Stream s);\nOpenCVResult GpuThreshold(GpuMat src, GpuMat dst, double thresh, double maxval, int typ, Stream s);\nOpenCVResult GpuFlip(GpuMat src, GpuMat dst, int flipCode, Stream s);\nOpenCVResult GpuMerge(struct GpuMats mats, GpuMat dst, Stream s);\nOpenCVResult GpuTranspose(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult GpuAddWeighted(GpuMat src1, double alpha, GpuMat src2, double beta, double gamma, GpuMat dst, int dType, Stream s);\nOpenCVResult GpuCopyMakeBorder(GpuMat src, GpuMat dst, int top, int bottom, int left, int right, int borderType, Scalar value, Stream s);\nOpenCVResult GpuCalcNorm(GpuMat src, GpuMat dst, int typ, Stream s);\nOpenCVResult GpuCalcNormDiff(GpuMat src1, GpuMat src2, GpuMat dst, int typ, Stream s);\ndouble GpuNorm(GpuMat src1, GpuMat src2, int typ);\nOpenCVResult GpuCompare(GpuMat src1, GpuMat src2, GpuMat dst, int typ, Stream s);\nOpenCVResult GpuLShift(GpuMat src, Scalar shift, GpuMat dst, Stream s);\nOpenCVResult GpuRShift(GpuMat src, Scalar shift, GpuMat dst, Stream s);\nOpenCVResult GpuAbsSum(GpuMat src, GpuMat mask, struct Scalar* result);\nOpenCVResult GpuAbsSumWithMask(GpuMat src, GpuMat mask, struct Scalar* result);\nOpenCVResult GpuCalcAbsSum(GpuMat src, GpuMat dst, GpuMat mask, Stream s);\nOpenCVResult GpuMinMax(GpuMat src, GpuMat mask, double* minVal, double* maxVal);\nOpenCVResult GpuMinMaxLoc(GpuMat src, GpuMat mask, double* minVal, double* maxVal, int* minLocX, int* minLocY, int* maxLocX, int* maxLocY);\nOpenCVResult GpuNormalize(GpuMat src, GpuMat dst, double alpha, double beta, int normType, int dtype, GpuMat mask, Stream s);\nOpenCVResult GpuFindMinMaxLoc(GpuMat src, GpuMat minMaxVals, GpuMat loc, GpuMat mask, Stream s);\nOpenCVResult GpuFindMinMax(GpuMat src, GpuMat dst, GpuMat mask, Stream s);\n\n//LookUpTable\nLookUpTable Cuda_Create_LookUpTable(GpuMat lut);\nvoid Cuda_LookUpTable_Close(LookUpTable lt);\nOpenCVResult Cuda_LookUpTable_Transform(LookUpTable lt, GpuMat src, GpuMat dst, Stream s);\n\nbool Cuda_LookUpTable_Empty(LookUpTable lut);\n\nOpenCVResult Cuda_Split(GpuMat src, GpuMats dst, Stream s);\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDA_ARITHM_H_\n"
  },
  {
    "path": "cuda/arithm_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_arithm)\n\npackage cuda\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestAbs(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Abs test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tAbs(cimg, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Abs test\")\n\t}\n}\n\nfunc TestAbsException(t *testing.T) {\n\tsrc := gocv.NewMat()\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\terr := Abs(cimg, &dimg)\n\tif err == nil {\n\t\tt.Error(\"Expected exception in test\")\n\t}\n\tif len(err.Error()) == 0 {\n\t\tt.Error(\"Expected exception message in test\")\n\t}\n}\n\nfunc TestAbsWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Abs test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, s)\n\tAbsWithStream(cimg, &dimg, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Abs test\")\n\t}\n}\n\nfunc TestAbsDiff(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AbsDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tAbsDiff(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid AbsDiff test\")\n\t}\n}\n\nfunc TestAdd(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AbsDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tAdd(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Add test\")\n\t}\n}\n\nfunc TestBitwiseAnd(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AbsDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tBitwiseAnd(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BitwiseAnd test\")\n\t}\n}\n\nfunc TestBitwiseNot(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AbsDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tBitwiseNot(cimg, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BitwiseNot test\")\n\t}\n}\n\nfunc TestBitwiseOr(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BitwiseOr test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tBitwiseOr(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BitwiseOr test\")\n\t}\n}\n\nfunc TestBitwiseXor(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BitwiseXor test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tBitwiseXor(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BitwiseXor test\")\n\t}\n}\n\nfunc TestDivide(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Divide test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tDivide(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Divide test\")\n\t}\n}\n\nfunc TestDivideWithStream(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Divide test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tvar s = NewStream()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tcimg1.UploadWithStream(src1, s)\n\tcimg2.UploadWithStream(src1, s)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tDivideWithStream(cimg1, cimg2, &dimg, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Divide test\")\n\t}\n}\n\nfunc TestExp(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Exp test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tExp(cimg1, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Exp test\")\n\t}\n}\n\nfunc TestLog(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Log test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tLog(cimg1, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Log test\")\n\t}\n}\n\nfunc TestMax(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Max test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tMax(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Max test\")\n\t}\n}\n\nfunc TestMin(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Min test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tMin(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Min test\")\n\t}\n}\n\nfunc TestMultiply(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Multiply test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src1)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tMultiply(cimg1, cimg2, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Multiply test\")\n\t}\n}\n\nfunc TestMultiplyWithStream(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Multiply test\")\n\t}\n\tdefer src1.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tvar s = NewStream()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tcimg1.UploadWithStream(src1, s)\n\tcimg2.UploadWithStream(src1, s)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tMultiplyWithStream(cimg1, cimg2, &dimg, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src1.Rows() != dest.Rows() || src1.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Multiply test\")\n\t}\n\n}\n\nfunc TestThreshold(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Threshold test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tThreshold(cimg, &dimg, 25, 255, gocv.ThresholdBinary)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Threshold test\")\n\t}\n}\n\nfunc TestThresholdWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Threshold test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, s)\n\tThresholdWithStream(cimg, &dimg, 25, 255, gocv.ThresholdBinary, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Threshold test\")\n\t}\n}\n\nfunc TestFlip(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Flip test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tFlip(cimg, &dimg, 0)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Flip test\")\n\t}\n}\n\nfunc TestFlipWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Flip test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, s)\n\tFlipWithStream(cimg, &dimg, 0, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src.Rows() != dest.Rows() || src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Flip test\")\n\t}\n}\n\nfunc TestMerge(t *testing.T) {\n\tsrc := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src.Close()\n\tsrc2 := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src2.Close()\n\tsrc3 := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src3.Close()\n\n\tdstGPU := NewGpuMat()\n\tdefer dstGPU.Close()\n\n\tMerge([]GpuMat{src, src2, src3}, &dstGPU)\n\tif dstGPU.Empty() {\n\t\tt.Error(\"TestMerge dst should not be empty.\")\n\t}\n}\n\nfunc TestMergeWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src.Close()\n\tsrc2 := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src2.Close()\n\tsrc3 := NewGpuMatWithSize(101, 102, gocv.MatTypeCV8U)\n\tdefer src3.Close()\n\ts := NewStream()\n\tdefer s.Close()\n\n\tdstGPU := NewGpuMat()\n\tdefer dstGPU.Close()\n\n\tMergeWithStream([]GpuMat{src, src2, src3}, &dstGPU, s)\n\n\ts.WaitForCompletion()\n\tif dstGPU.Empty() {\n\t\tt.Error(\"TestMergeWithStream dst should not be empty.\")\n\t}\n}\n\nfunc TestTranspose(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Transpose test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tTranspose(cimg, &dimg)\n\tdimg.Download(&dest)\n\tif dest.Empty() || src.Rows() != dest.Cols() || src.Cols() != dest.Rows() {\n\t\tt.Error(\"Invalid Transpose test\")\n\t}\n}\n\nfunc TestTransposeWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in TransposeWithStream test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tTransposeWithStream(cimg, &dimg, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() || src.Rows() != dest.Cols() || src.Cols() != dest.Rows() {\n\t\tt.Error(\"Invalid TransposeWithStream test\")\n\t}\n}\n\nfunc TestAddWeighted(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AddWeighted test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AddWeighted test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src2)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\talpha, beta, gamma := 0.5, 0.5, 0.0\n\tAddWeighted(cimg1, alpha, cimg2, beta, gamma, &dimg, -1)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid AddWeighted test\")\n\t}\n}\n\nfunc TestAddWeightedWithStream(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AddWeighted test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AddWeighted test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2, dimg, s = NewGpuMat(), NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tcimg1.UploadWithStream(src1, s)\n\tcimg2.UploadWithStream(src2, s)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\talpha, beta, gamma := 0.5, 0.5, 0.0\n\tAddWeightedWithStream(cimg1, alpha, cimg2, beta, gamma, &dimg, -1, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid AddWeightedWithStream test\")\n\t}\n}\n\nfunc TestCopyMakeBorder(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CopyMakeBorder test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tCopyMakeBorder(cimg, &dimg, 10, 10, 10, 10, gocv.BorderReflect, gocv.NewScalar(0, 0, 0, 0))\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CopyMakeBorder test\")\n\t}\n}\n\nfunc TestCopyMakeBorderWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CopyMakeBorder test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tcimg.UploadWithStream(src, s)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tCopyMakeBorderWithStream(cimg, &dimg, 10, 10, 10, 10, gocv.BorderReflect, gocv.NewScalar(0, 0, 0, 0), s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CopyMakeBorderWithStream test\")\n\t}\n}\n\nfunc TestNewLookUpTable(t *testing.T) {\n\n\tm := NewGpuMatWithSize(1, 256, gocv.MatTypeCV8U)\n\tdefer m.Close()\n\n\tlt := NewLookUpTable(m)\n\tdefer lt.Close()\n\n}\n\nfunc TestLookUpTableEmpty(t *testing.T) {\n\tm := NewGpuMatWithSize(1, 256, gocv.MatTypeCV8U)\n\tdefer m.Close()\n\n\tlt := NewLookUpTable(m)\n\tdefer lt.Close()\n\n\tlt.Empty()\n}\n\nfunc TestTransform(t *testing.T) {\n\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC3)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC3)\n\tdefer dst.Close()\n\n\tm := NewGpuMatWithSize(1, 256, gocv.MatTypeCV8U)\n\tdefer m.Close()\n\n\tlt := NewLookUpTable(m)\n\tdefer lt.Close()\n\n\tlt.Transform(src, &dst)\n}\n\nfunc TestTransformWithStream(t *testing.T) {\n\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC3)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC3)\n\tdefer dst.Close()\n\n\tm := NewGpuMatWithSize(1, 256, gocv.MatTypeCV8U)\n\tdefer m.Close()\n\n\tlt := NewLookUpTable(m)\n\tdefer lt.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tlt.TransformWithStream(src, &dst, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestSplit(t *testing.T) {\n\n\tm := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC2)\n\tdefer m.Close()\n\n\tm0 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m0.Close()\n\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tmats := []GpuMat{m0, m1}\n\n\tSplit(m, mats)\n}\n\nfunc TestSplitWithStream(t *testing.T) {\n\n\tm := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC2)\n\tdefer m.Close()\n\n\tm0 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m0.Close()\n\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tmats := []GpuMat{m0, m1}\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tSplitWithStream(m, mats, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestCalcNorm(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNorm test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.Upload(src)\n\tCalcNorm(cimg, dimg, gocv.NormL2)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CalcNorm test\")\n\t}\n}\n\nfunc TestCalcNormWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNorm test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, s)\n\tCalcNormWithStream(cimg, dimg, gocv.NormL2, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CalcNormWithStream test\")\n\t}\n}\n\nfunc TestCalcNormDiff(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNormDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/chessboard_4x6_distort.png\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNormDiff test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src2)\n\tCalcNormDiff(cimg1, cimg2, dimg, gocv.NormL2)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CalcNormDiff test\")\n\t}\n}\n\nfunc TestCalcNormDiffWithStream(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNormDiff test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/chessboard_4x6_distort.png\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcNormDiff test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2, dimg, s = NewGpuMat(), NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg1.UploadWithStream(src1, s)\n\tcimg2.UploadWithStream(src2, s)\n\tCalcNormDiffWithStream(cimg1, cimg2, dimg, gocv.NormL2, s)\n\tdimg.DownloadWithStream(&dest, s)\n\n\ts.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CalcNormWithStream test\")\n\t}\n}\n\nfunc TestNorm(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Norm test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/chessboard_4x6_distort.png\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Norm test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2 = NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src2)\n\n\tresult := Norm(cimg1, cimg2, gocv.NormL2)\n\n\tif result == 0 {\n\t\tt.Error(\"Invalid Norm test\")\n\t}\n}\n\nfunc TestCompareDiff(t *testing.T) {\n\tsrc1 := gocv.IMRead(\"../images/chessboard_4x6_distort_correct.png\", gocv.IMReadGrayScale)\n\tif src1.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Compare test\")\n\t}\n\tdefer src1.Close()\n\n\tsrc2 := gocv.IMRead(\"../images/chessboard_4x6_distort.png\", gocv.IMReadGrayScale)\n\tif src2.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Compare test\")\n\t}\n\tdefer src2.Close()\n\n\tvar cimg1, cimg2, dimg = NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg1.Close()\n\tdefer cimg2.Close()\n\tdefer dimg.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg1.Upload(src1)\n\tcimg2.Upload(src2)\n\tCompare(cimg1, cimg2, dimg, gocv.CompareNE)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Invalid CalcNormDiff test\")\n\t}\n}\n\nfunc TestLShift(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in LShift test\")\n\t}\n\tdefer src.Close()\n\n\tcimg := NewGpuMat()\n\tdefer cimg.Close()\n\tcimg.Upload(src)\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\terr := LShift(cimg, gocv.NewScalar(128, 128, 128, 128), &dst)\n\tif err != nil {\n\t\tt.Errorf(\"LShift error: %v\", err)\n\t}\n\tif dst.Empty() {\n\t\tt.Error(\"LShift result should not be empty\")\n\t}\n}\n\nfunc TestLShiftWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in LShiftWithStream test\")\n\t}\n\tdefer src.Close()\n\n\tcimg := NewGpuMat()\n\tdefer cimg.Close()\n\tcimg.Upload(src)\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\terr := LShiftWithStream(cimg, gocv.NewScalar(128, 128, 128, 128), &dst, s)\n\tif err != nil {\n\t\tt.Errorf(\"LShiftWithStream error: %v\", err)\n\t}\n\ts.WaitForCompletion()\n\tif dst.Empty() {\n\t\tt.Error(\"LShiftWithStream result should not be empty\")\n\t}\n}\n\nfunc TestRShift(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in RShift test\")\n\t}\n\tdefer src.Close()\n\n\tcimg := NewGpuMat()\n\tdefer cimg.Close()\n\tcimg.Upload(src)\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\terr := RShift(cimg, gocv.NewScalar(2, 2, 2, 2), &dst)\n\tif err != nil {\n\t\tt.Errorf(\"RShift error: %v\", err)\n\t}\n\tif dst.Empty() {\n\t\tt.Error(\"RShift result should not be empty\")\n\t}\n}\n\nfunc TestRShiftWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in RShiftWithStream test\")\n\t}\n\tdefer src.Close()\n\n\tcimg := NewGpuMat()\n\tdefer cimg.Close()\n\tcimg.Upload(src)\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\terr := RShiftWithStream(cimg, gocv.NewScalar(2, 2, 2, 2), &dst, s)\n\tif err != nil {\n\t\tt.Errorf(\"RShiftWithStream error: %v\", err)\n\t}\n\ts.WaitForCompletion()\n\tif dst.Empty() {\n\t\tt.Error(\"RShiftWithStream result should not be empty\")\n\t}\n}\n\nfunc TestAbsSum(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in AbsSum test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    sum, err := AbsSum(cimg)\n    if err != nil {\n        t.Errorf(\"AbsSum error: %v\", err)\n    }\n    if sum.Val1 == 0 && sum.Val2 == 0 && sum.Val3 == 0 && sum.Val4 == 0 {\n        t.Error(\"AbsSum result should not be all zeros\")\n    }\n}\n\nfunc TestCalcAbsSum(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in CalcAbsSum test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    dst := NewGpuMat()\n    defer dst.Close()\n\n    err := CalcAbsSum(cimg, &dst)\n    if err != nil {\n        t.Errorf(\"CalcAbsSum error: %v\", err)\n    }\n    if dst.Empty() {\n        t.Error(\"CalcAbsSum result should not be empty\")\n    }\n}\n\nfunc TestMinMax(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in MinMax test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    minVal, maxVal, err := MinMax(cimg)\n    if err != nil {\n        t.Errorf(\"MinMax error: %v\", err)\n    }\n    if minVal >= maxVal {\n        t.Errorf(\"MinMax result invalid: min=%v max=%v\", minVal, maxVal)\n    }\n}\n\nfunc TestMinMaxLoc(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in MinMaxLoc test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    minVal, maxVal, minLoc, maxLoc, err := MinMaxLoc(cimg)\n    if err != nil {\n        t.Errorf(\"MinMaxLoc error: %v\", err)\n    }\n    if minVal >= maxVal {\n        t.Errorf(\"MinMaxLoc result invalid: min=%v max=%v\", minVal, maxVal)\n    }\n    if minLoc == maxLoc {\n        t.Errorf(\"MinMaxLoc locations should not be equal: minLoc=%v maxLoc=%v\", minLoc, maxLoc)\n    }\n}\n\nfunc TestNormalize(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in Normalize test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    dst := NewGpuMat()\n    defer dst.Close()\n\n    err := Normalize(cimg, &dst, 0, 255, gocv.NormMinMax, -1)\n    if err != nil {\n        t.Errorf(\"Normalize error: %v\", err)\n    }\n    if dst.Empty() {\n        t.Error(\"Normalize result should not be empty\")\n    }\n}\n\nfunc TestFindMinMaxLoc(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in FindMinMaxLoc test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    minMaxVals := NewGpuMat()\n    defer minMaxVals.Close()\n    loc := NewGpuMat()\n    defer loc.Close()\n\n    err := FindMinMaxLoc(cimg, &minMaxVals, &loc)\n    if err != nil {\n        t.Errorf(\"FindMinMaxLoc error: %v\", err)\n    }\n    if minMaxVals.Empty() || loc.Empty() {\n        t.Error(\"FindMinMaxLoc result should not be empty\")\n    }\n}\n\nfunc TestFindMinMax(t *testing.T) {\n    src := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadGrayScale)\n    if src.Empty() {\n        t.Error(\"Invalid read of Mat in FindMinMax test\")\n    }\n    defer src.Close()\n\n    cimg := NewGpuMat()\n    defer cimg.Close()\n    cimg.Upload(src)\n\n    dst := NewGpuMat()\n    defer dst.Close()\n\n    err := FindMinMax(cimg, &dst)\n    if err != nil {\n        t.Errorf(\"FindMinMax error: %v\", err)\n    }\n    if dst.Empty() {\n        t.Error(\"FindMinMax result should not be empty\")\n    }\n}\n\n"
  },
  {
    "path": "cuda/bgsegm.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_bgsegm)\n\n#include \"bgsegm.h\"\n\nCudaBackgroundSubtractorMOG2 CudaBackgroundSubtractorMOG2_Create() {\n    try {\n        return new cv::Ptr<cv::cuda::BackgroundSubtractorMOG2>(cv::cuda::createBackgroundSubtractorMOG2());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid CudaBackgroundSubtractorMOG2_Close(CudaBackgroundSubtractorMOG2 b) {\n    delete b;\n}\n\nOpenCVResult CudaBackgroundSubtractorMOG2_Apply(CudaBackgroundSubtractorMOG2 b, GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*b)->apply(*src, *dst);\n        } else {\n            (*b)->apply(*src, *dst, -1.0, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nCudaBackgroundSubtractorMOG CudaBackgroundSubtractorMOG_Create() {\n    try {\n        return new cv::Ptr<cv::cuda::BackgroundSubtractorMOG>(cv::cuda::createBackgroundSubtractorMOG());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid CudaBackgroundSubtractorMOG_Close(CudaBackgroundSubtractorMOG b) {\n    delete b;\n}\n\nOpenCVResult CudaBackgroundSubtractorMOG_Apply(CudaBackgroundSubtractorMOG b, GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*b)->apply(*src, *dst);\n        } else {\n            (*b)->apply(*src, *dst, -1.0, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}"
  },
  {
    "path": "cuda/bgsegm.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_bgsegm)\n\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"bgsegm.h\"\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// BackgroundSubtractorMOG2 is a wrapper around the cv::cuda::BackgroundSubtractorMOG2.\ntype BackgroundSubtractorMOG2 struct {\n\t// C.BackgroundSubtractorMOG2\n\tp unsafe.Pointer\n}\n\n// BackgroundSubtractorMOG is a wrapper around the cv::cuda::BackgroundSubtractorMOG.\ntype BackgroundSubtractorMOG struct {\n\t// C.BackgroundSubtractorMOG\n\tp unsafe.Pointer\n}\n\n// NewBackgroundSubtractorMOG2 returns a new BackgroundSubtractor algorithm\n// of type MOG2. MOG2 is a Gaussian Mixture-based Background/Foreground\n// Segmentation Algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d3d/cudabgsegm_8hpp.html\nfunc NewBackgroundSubtractorMOG2() BackgroundSubtractorMOG2 {\n\treturn BackgroundSubtractorMOG2{p: unsafe.Pointer(C.CudaBackgroundSubtractorMOG2_Create())}\n}\n\n// Close BackgroundSubtractorMOG2.\nfunc (b *BackgroundSubtractorMOG2) Close() error {\n\tC.CudaBackgroundSubtractorMOG2_Close((C.CudaBackgroundSubtractorMOG2)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Apply computes a foreground mask using the current BackgroundSubtractorMOG2.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d23/classcv_1_1cuda_1_1BackgroundSubtractorMOG2.html#a92408f07bf1268c1b778cb186b3113b0\nfunc (b *BackgroundSubtractorMOG2) Apply(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.CudaBackgroundSubtractorMOG2_Apply((C.CudaBackgroundSubtractorMOG2)(b.p), src.p, dst.p, nil))\n}\n\n// ApplyWithStream computes a foreground mask using the current BackgroundSubtractorMOG2\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d23/classcv_1_1cuda_1_1BackgroundSubtractorMOG2.html#a92408f07bf1268c1b778cb186b3113b0\nfunc (b *BackgroundSubtractorMOG2) ApplyWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.CudaBackgroundSubtractorMOG2_Apply((C.CudaBackgroundSubtractorMOG2)(b.p), src.p, dst.p, s.p))\n}\n\n// NewBackgroundSubtractorMOG returns a new BackgroundSubtractor algorithm\n// of type MOG. MOG is a Gaussian Mixture-based Background/Foreground\n// Segmentation Algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d3d/cudabgsegm_8hpp.html\nfunc NewBackgroundSubtractorMOG() BackgroundSubtractorMOG {\n\treturn BackgroundSubtractorMOG{p: unsafe.Pointer(C.CudaBackgroundSubtractorMOG_Create())}\n}\n\n// Close BackgroundSubtractorMOG.\nfunc (b *BackgroundSubtractorMOG) Close() error {\n\tC.CudaBackgroundSubtractorMOG_Close((C.CudaBackgroundSubtractorMOG)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Apply computes a foreground mask using the current BackgroundSubtractorMOG.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dfe/classcv_1_1cuda_1_1BackgroundSubtractorMOG.html#a8f52d2f7abd1c77c84243efc53972cbf\nfunc (b *BackgroundSubtractorMOG) Apply(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.CudaBackgroundSubtractorMOG_Apply((C.CudaBackgroundSubtractorMOG)(b.p), src.p, dst.p, nil))\n}\n\n// ApplyWithStream computes a foreground mask using the current BackgroundSubtractorMOG\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/dfe/classcv_1_1cuda_1_1BackgroundSubtractorMOG.html#a8f52d2f7abd1c77c84243efc53972cbf\nfunc (b *BackgroundSubtractorMOG) ApplyWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.CudaBackgroundSubtractorMOG_Apply((C.CudaBackgroundSubtractorMOG)(b.p), src.p, dst.p, s.p))\n}\n"
  },
  {
    "path": "cuda/bgsegm.h",
    "content": "#ifndef _OPENCV3_CUDABGSEGM_H_\n#define _OPENCV3_CUDABGSEGM_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/cudabgsegm.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::cuda::BackgroundSubtractorMOG2>* CudaBackgroundSubtractorMOG2;\ntypedef cv::Ptr<cv::cuda::BackgroundSubtractorMOG>* CudaBackgroundSubtractorMOG;\n#else\ntypedef void* CudaBackgroundSubtractorMOG2;\ntypedef void* CudaBackgroundSubtractorMOG;\n#endif\n\nCudaBackgroundSubtractorMOG2 CudaBackgroundSubtractorMOG2_Create();\nvoid CudaBackgroundSubtractorMOG2_Close(CudaBackgroundSubtractorMOG2 b);\nOpenCVResult CudaBackgroundSubtractorMOG2_Apply(CudaBackgroundSubtractorMOG2 b, GpuMat src, GpuMat dst, Stream s);\n\nCudaBackgroundSubtractorMOG CudaBackgroundSubtractorMOG_Create();\nvoid CudaBackgroundSubtractorMOG_Close(CudaBackgroundSubtractorMOG b);\nOpenCVResult CudaBackgroundSubtractorMOG_Apply(CudaBackgroundSubtractorMOG b, GpuMat src, GpuMat dst, Stream s);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDABGSEGM_H_\n"
  },
  {
    "path": "cuda/bgsegm_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_bgsegm)\n\npackage cuda\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestCudaMOG2(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CudaMOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(img)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tmog2.Apply(cimg, &dimg)\n\n\tdimg.Download(&dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestCudaMOG2 test\")\n\t}\n}\n\nfunc TestCudaMOG2WithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CudaMOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tcimg.UploadWithStream(img, s)\n\tmog2.ApplyWithStream(cimg, &dimg, s)\n\tdimg.DownloadWithStream(&dst, s)\n\n\ts.WaitForCompletion()\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestCudaMOG2 test\")\n\t}\n}\n\nfunc TestCudaMOG(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CudaMOG test\")\n\t}\n\tdefer img.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(img)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG()\n\tdefer mog2.Close()\n\n\tmog2.Apply(cimg, &dimg)\n\n\tdimg.Download(&dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestCudaMOG test\")\n\t}\n}\n\nfunc TestCudaMOGWithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CudaMOG test\")\n\t}\n\tdefer img.Close()\n\n\tvar cimg, dimg, s = NewGpuMat(), NewGpuMat(), NewStream()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\tdefer s.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG()\n\tdefer mog2.Close()\n\n\tcimg.UploadWithStream(img, s)\n\tmog2.ApplyWithStream(cimg, &dimg, s)\n\tdimg.DownloadWithStream(&dst, s)\n\n\ts.WaitForCompletion()\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestCudaMOG test\")\n\t}\n}\n"
  },
  {
    "path": "cuda/cgo.go",
    "content": "//go:build !customenv && !opencvstatic\n\npackage cuda\n\n// Changes here should be mirrored in gocv/cgo.go and contrib/cgo.go.\n\n/*\n#cgo !windows pkg-config: opencv4\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core4120 -lopencv_face4120 -lopencv_videoio4120 -lopencv_imgproc4120 -lopencv_highgui4120 -lopencv_imgcodecs4120 -lopencv_objdetect4120 -lopencv_features2d4120 -lopencv_video4120 -lopencv_dnn4120 -lopencv_xfeatures2d4120 -lopencv_plot4120 -lopencv_tracking4120 -lopencv_img_hash4120 -lopencv_calib3d4120 -lopencv_bgsegm4120 -lopencv_aruco4120 -lopencv_wechat_qrcode4120 -lopencv_ximgproc4120 -lopencv_xobjdetect4120 -lopencv_mcc4120\n*/\nimport \"C\"\n"
  },
  {
    "path": "cuda/cgo_static.go",
    "content": "//go:build !customenv && opencvstatic && linux\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static.go and cuda/cgo_static.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo CPPFLAGS: -I/usr/local/include -I/usr/local/include/opencv4\n#cgo amd64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -lippiw -lippicv -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n#cgo arm64 LDFLAGS: -O2 -g -static -L/usr/local/lib -L/usr/local/lib/opencv4/3rdparty -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_signal -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -llibprotobuf -lade -ltbb -littnotify -llibjpeg-turbo -llibwebp -llibtiff -llibopenjp2 -lIlmImf -lquirc -ltegra_hal -lpng -lz -lgcc -lstdc++ -lfreetype -lharfbuzz -ldl -lm -lpthread -lrt -lavdevice -lm -latomic -lavfilter -pthread -lm -latomic -lswscale -lm -latomic -lpostproc -lm -latomic -lavformat -lm -latomic -lz -lavcodec -lvpx -lm -lvpx -lm -lvpx -lm -lvpx -lm -pthread -lm -latomic -lz -lx264 -lswresample -lm -latomic -lavutil -pthread -lm -latomic\n*/\nimport \"C\"\n"
  },
  {
    "path": "cuda/cgo_static_darwin.go",
    "content": "//go:build !customenv && opencvstatic && darwin\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static_darwin.go and cuda/cgo_static_darwin.go.\n\n/*\n#cgo CXXFLAGS: --std=c++11 -DNDEBUG\n#cgo pkg-config: --static opencv4\n*/\nimport \"C\"\n"
  },
  {
    "path": "cuda/cgo_static_windows.go",
    "content": "//go:build !customenv && opencvstatic && windows\n\npackage gocv\n\n// Changes here should be mirrored in contrib/cgo_static_windows.go and cuda/cgo_static_windows.go.\n\n/*\n#cgo CXXFLAGS:   --std=c++11 -DNDEBUG\n#cgo CPPFLAGS:   -IC:/opencv/build/install/include\n#cgo LDFLAGS:    -LC:/opencv/build/install/x64/mingw/staticlib -lopencv_stereo4120 -lopencv_tracking4120 -lopencv_superres4120 -lopencv_stitching4120 -lopencv_optflow4120 -lopencv_gapi4120 -lopencv_face4120 -lopencv_dpm4120 -lopencv_dnn_objdetect4120 -lopencv_ccalib4120 -lopencv_bioinspired4120 -lopencv_bgsegm4120 -lopencv_aruco4120 -lopencv_xobjdetect4120 -lopencv_ximgproc4120 -lopencv_xfeatures2d4120 -lopencv_videostab4120 -lopencv_video4120 -lopencv_structured_light4120 -lopencv_shape4120 -lopencv_rgbd4120 -lopencv_rapid4120 -lopencv_objdetect4120 -lopencv_mcc4120 -lopencv_highgui4120 -lopencv_datasets4120 -lopencv_calib3d4120 -lopencv_videoio4120 -lopencv_text4120 -lopencv_line_descriptor4120 -lopencv_imgcodecs4120 -lopencv_img_hash4120 -lopencv_hfs4120 -lopencv_fuzzy4120 -lopencv_features2d4120 -lopencv_dnn_superres4120 -lopencv_dnn4120 -lopencv_xphoto4120 -lopencv_wechat_qrcode4120 -lopencv_surface_matching4120 -lopencv_reg4120 -lopencv_quality4120 -lopencv_plot4120 -lopencv_photo4120 -lopencv_phase_unwrapping4120 -lopencv_ml4120 -lopencv_intensity_transform4120 -lopencv_imgproc4120 -lopencv_flann4120 -lopencv_core4120 -lade -lquirc -llibprotobuf -lIlmImf -llibpng -llibopenjp2 -llibwebp -llibtiff -llibjpeg-turbo -lzlib -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -luser32\n*/\nimport \"C\"\n"
  },
  {
    "path": "cuda/core.cpp",
    "content": "#include \"../core.h\"\n#include \"core.h\"\n#include <string.h>\n\nvoid GpuRects_Close(struct Rects rs) {\n    delete[] rs.rects;\n}\n"
  },
  {
    "path": "cuda/core.go",
    "content": "package cuda\n\n/*\n#include <stdlib.h>\n#include \"../core.h\"\n#include \"core.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\nfunc toRectangles(ret C.Rects) []image.Rectangle {\n\tcArray := ret.rects\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.Rect)(unsafe.Pointer(&hdr))\n\n\trects := make([]image.Rectangle, length)\n\tfor i, r := range s {\n\t\trects[i] = image.Rect(int(r.x), int(r.y), int(r.x+r.width), int(r.y+r.height))\n\t}\n\treturn rects\n}\n"
  },
  {
    "path": "cuda/core.h",
    "content": "#ifndef _OPENCV3_CUDA_CORE_H_\n#define _OPENCV3_CUDA_CORE_H_\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\nvoid GpuRects_Close(struct Rects rs);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDA_CORE_H_\n"
  },
  {
    "path": "cuda/cuda.cpp",
    "content": "#include \"cuda.h\"\n\nGpuMat GpuMat_New() {\n    try {\n        return new cv::cuda::GpuMat();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nGpuMat GpuMat_NewFromMat(Mat mat) {\n    try {\n        return new cv::cuda::GpuMat(*mat);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nGpuMat GpuMat_NewWithSize(int rows, int cols, int type) {\n    try {\n        return new cv::cuda::GpuMat(rows, cols, type);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid GpuMat_Upload(GpuMat m, Mat data, Stream s){\n    try {\n        if (s == NULL) {\n            m->upload(*data);\n            return;\n        }\n        m->upload(*data, *s);    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid GpuMat_Download(GpuMat m, Mat dst, Stream s){\n    try {\n        if (s == NULL) {\n            m->download(*dst);\n            return;\n        }\n        m->download(*dst, *s);    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint GpuMat_Empty(GpuMat m){\n    try {\n        return m->empty();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return true;\n    }\n}\n\nvoid GpuMat_Close(GpuMat m){\n    delete m;\n}\n\nvoid PrintCudaDeviceInfo(int device){\n    try {\n        cv::cuda::printCudaDeviceInfo(device);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid PrintShortCudaDeviceInfo(int device){\n    try {\n        cv::cuda::printShortCudaDeviceInfo(device);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint GetCudaEnabledDeviceCount(){\n    try {\n        return cv::cuda::getCudaEnabledDeviceCount();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nint GetCudaDevice() {\n    try {\n        return cv::cuda::getDevice();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nvoid SetCudaDevice(int device) {\n    try {\n        cv::cuda::setDevice(device);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid ResetCudaDevice(){\n    try {\n        cv::cuda::resetDevice();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nbool CudaDeviceSupports(int features) {\n    try {\n        return cv::cuda::deviceSupports(cv::cuda::FeatureSet(features));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nvoid GpuMat_ConvertTo(GpuMat m, GpuMat dst, int type, Stream s) {\n    try {\n        if (s == NULL) {\n            m->convertTo(*dst, type);\n            return;\n        }\n        m->convertTo(*dst, type, *s);    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid GpuMat_ConvertFp16(GpuMat m, GpuMat dst) {\n    try {\n        cv::cuda::convertFp16(*m, *dst);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid GpuMat_CopyTo(GpuMat m, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            m->copyTo(*dst);\n            return;\n        }\n        m->copyTo(*dst, *s);    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nGpuMat GpuMat_Reshape(GpuMat m, int cn, int rows) {\n    try {\n        return new cv::cuda::GpuMat(m->reshape(cn, rows));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nint GpuMat_Cols(GpuMat m) {\n    return m->cols;\n}\n\nint GpuMat_Rows(GpuMat m) {\n    return m->rows;\n}\n\nint GpuMat_Channels(GpuMat m) {\n    return m->channels();\n}\n\nint GpuMat_Type(GpuMat m) {\n    return m->type();\n}\n\nStream Stream_New() {\n    try {\n        return new cv::cuda::Stream();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid Stream_Close(Stream s){\n    delete s;\n}\n\nbool Stream_QueryIfComplete(Stream s) {\n    try {\n        return s->queryIfComplete();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nvoid Stream_WaitForCompletion(Stream s) {\n    try {\n        s->waitForCompletion();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/cuda.go",
    "content": "// Package cuda is the GoCV wrapper around OpenCV cuda.\n//\n// For further details, please see:\n// https://github.com/opencv/opencv\n//\n// import \"gocv.io/x/gocv/cuda\"\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"cuda.h\"\n*/\nimport \"C\"\nimport \"gocv.io/x/gocv\"\n\ntype FeatureSet int\n\nconst (\n\tFeatureSetCompute10            FeatureSet = 10\n\tFeatureSetCompute11            FeatureSet = 11\n\tFeatureSetCompute12            FeatureSet = 12\n\tFeatureSetCompute13            FeatureSet = 13\n\tFeatureSetCompute20            FeatureSet = 20\n\tFeatureSetCompute21            FeatureSet = 21\n\tFeatureSetCompute30            FeatureSet = 30\n\tFeatureSetCompute32            FeatureSet = 32\n\tFeatureSetCompute35            FeatureSet = 35\n\tFeatureSetCompute50            FeatureSet = 50\n\tFeatureSetGlobalAtomics                   = FeatureSetCompute11\n\tFeatureSetSharedAtomics                   = FeatureSetCompute12\n\tFeatureSetNativeDouble                    = FeatureSetCompute13\n\tFeatureSetWarpShuffleFunctions            = FeatureSetCompute30\n\tFeatureSetDynamicParallelism              = FeatureSetCompute35\n)\n\n// GpuMat is the GPU version of a Mat\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html\ntype GpuMat struct {\n\tp C.GpuMat\n}\n\n// Upload performs data upload to GpuMat (Blocking call)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a00ef5bfe18d14623dcf578a35e40a46b\nfunc (g *GpuMat) Upload(data gocv.Mat) {\n\tC.GpuMat_Upload(g.p, C.Mat(data.Ptr()), nil)\n}\n\n// UploadWithStream performs data upload to GpuMat (non-blocking call)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a00ef5bfe18d14623dcf578a35e40a46b\nfunc (g *GpuMat) UploadWithStream(data gocv.Mat, s Stream) {\n\tC.GpuMat_Upload(g.p, C.Mat(data.Ptr()), s.p)\n}\n\n// Download performs data download from GpuMat (Blocking call)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a027e74e4364ddfd9687b58aa5db8d4e8\nfunc (g *GpuMat) Download(dst *gocv.Mat) {\n\tC.GpuMat_Download(g.p, C.Mat(dst.Ptr()), nil)\n}\n\n// DownloadWithStream performs data download from GpuMat (non-blocking call)\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a027e74e4364ddfd9687b58aa5db8d4e8\nfunc (g *GpuMat) DownloadWithStream(dst *gocv.Mat, s Stream) {\n\tC.GpuMat_Download(g.p, C.Mat(dst.Ptr()), s.p)\n}\n\n// Empty returns true if GpuMat is empty\nfunc (g *GpuMat) Empty() bool {\n\treturn C.GpuMat_Empty(g.p) != 0\n}\n\n// Close the GpuMat object\nfunc (g *GpuMat) Close() error {\n\tC.GpuMat_Close(g.p)\n\tg.p = nil\n\treturn nil\n}\n\n// Closed determines if the GpuMat is closed or not.\nfunc (g *GpuMat) Closed() bool {\n\treturn g.p == nil\n}\n\n// NewGpuMat returns a new empty GpuMat\nfunc NewGpuMat() GpuMat {\n\treturn newGpuMat(C.GpuMat_New())\n}\n\n// NewGpuMatFromMat returns a new GpuMat based on a Mat\nfunc NewGpuMatFromMat(mat gocv.Mat) GpuMat {\n\treturn newGpuMat(C.GpuMat_NewFromMat(C.Mat(mat.Ptr())))\n}\n\n// NewGpuMatWithSize returns a new GpuMat with a specific size and type.\nfunc NewGpuMatWithSize(rows int, cols int, mt gocv.MatType) GpuMat {\n\treturn newGpuMat(C.GpuMat_NewWithSize(C.int(rows), C.int(cols), C.int(mt)))\n}\n\nfunc newGpuMat(p C.GpuMat) GpuMat {\n\treturn GpuMat{p: p}\n}\n\n// PrintCudaDeviceInfo prints extensive cuda device information\nfunc PrintCudaDeviceInfo(device int) {\n\tC.PrintCudaDeviceInfo(C.int(device))\n}\n\n// PrintShortCudaDeviceInfo prints a small amount of cuda device information\nfunc PrintShortCudaDeviceInfo(device int) {\n\tC.PrintShortCudaDeviceInfo(C.int(device))\n}\n\n// GetCudaEnabledDeviceCount returns the number of cuda enabled devices on the\n// system\nfunc GetCudaEnabledDeviceCount() int {\n\treturn int(C.GetCudaEnabledDeviceCount())\n}\n\n// GetDevice returns the current device index.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d40/group__cudacore__init.html#ga6ded4ed8e4fc483a9863d31f34ec9c0e\nfunc GetDevice() int {\n\treturn int(C.GetCudaDevice())\n}\n\n// SetDevice sets a device and initializes it for the current thread.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d40/group__cudacore__init.html#gaefa34186b185de47851836dba537828b\nfunc SetDevice(device int) {\n\tC.SetCudaDevice(C.int(device))\n}\n\n// ResetDevice explicitly destroys and cleans up all resources associated\n// with the current device in the current process.\n//\n// Any subsequent API call to this device will reinitialize the device.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d40/group__cudacore__init.html#ga6153b6f461101374e655a54fc77e725e\nfunc ResetDevice() {\n\tC.ResetCudaDevice()\n}\n\n// DeviceSupports checks whether current device supports the given feature.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d40/group__cudacore__init.html#ga170b10cc9af4aa8cce8c0afdb4b1d08c\nfunc DeviceSupports(feature FeatureSet) bool {\n\treturn bool(C.CudaDeviceSupports(C.int(feature)))\n}\n\n// ConvertTo converts GpuMat into destination GpuMat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a3a1b076e54d8a8503014e27a5440d98a\nfunc (m *GpuMat) ConvertTo(dst *GpuMat, mt gocv.MatType) {\n\tC.GpuMat_ConvertTo(m.p, dst.p, C.int(mt), nil)\n\treturn\n}\n\n// ConvertToWithStream converts GpuMat into destination GpuMat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a3a1b076e54d8a8503014e27a5440d98a\nfunc (m *GpuMat) ConvertToWithStream(dst *GpuMat, mt gocv.MatType, s Stream) {\n\tC.GpuMat_ConvertTo(m.p, dst.p, C.int(mt), s.p)\n\treturn\n}\n\n// ConvertFp16 converts an array to half precision floating number.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d40/group__cudacore__init.html#gaa1c52258763197958eb9e6681917f723\nfunc (m *GpuMat) ConvertFp16(dst *GpuMat) {\n\tC.GpuMat_ConvertFp16(m.p, dst.p)\n\treturn\n}\n\n// CopyTo copies GpuMat into destination GpuMat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a948c562ee340c0678a44884bde1f5a3e\nfunc (m *GpuMat) CopyTo(dst *GpuMat) {\n\tC.GpuMat_CopyTo(m.p, dst.p, nil)\n\treturn\n}\n\n// CopyToWithStream copies GpuMat into destination GpuMat.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a948c562ee340c0678a44884bde1f5a3e\nfunc (m *GpuMat) CopyToWithStream(dst *GpuMat, s Stream) {\n\tC.GpuMat_CopyTo(m.p, dst.p, s.p)\n\treturn\n}\n\n// Rows returns the number of rows for this GpuMat.\nfunc (m *GpuMat) Rows() int {\n\treturn int(C.GpuMat_Rows(m.p))\n}\n\n// Cols returns the number of columns for this GpuMat.\nfunc (m *GpuMat) Cols() int {\n\treturn int(C.GpuMat_Cols(m.p))\n}\n\n// Channels returns the number of channels for this GpuMat.\nfunc (m *GpuMat) Channels() int {\n\treturn int(C.GpuMat_Channels(m.p))\n}\n\n// Type returns the type for this GpuMat.\nfunc (m *GpuMat) Type() gocv.MatType {\n\treturn gocv.MatType(C.GpuMat_Type(m.p))\n}\n\n// Ptr returns the GpuMat's underlying object pointer.\nfunc (m *GpuMat) Ptr() C.GpuMat {\n\treturn m.p\n}\n\n// Reshape creates a new GpuMat with the same data\n// but with a different number of channels and/or different number of rows.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d60/classcv_1_1cuda_1_1GpuMat.html#a408e22ed824d1ddf59f58bda895017a8\nfunc (m *GpuMat) Reshape(cn int, rows int) GpuMat {\n\treturn newGpuMat(C.GpuMat_Reshape(m.p, C.int(cn), C.int(rows)))\n}\n\n// Stream asynchronous stream used for CUDA operations.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/df3/classcv_1_1cuda_1_1Stream.html#aa6434e2f5f29bd81406732b39951c246\ntype Stream struct {\n\tp C.Stream\n}\n\n// NewStream returns a new empty Stream.\nfunc NewStream() Stream {\n\treturn Stream{p: C.Stream_New()}\n}\n\n// Close the Stream.\nfunc (s *Stream) Close() error {\n\tC.Stream_Close(s.p)\n\ts.p = nil\n\treturn nil\n}\n\n// QueryIfComplete returns true if the current stream queue is finished\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/df3/classcv_1_1cuda_1_1Stream.html#a9fab618395d42fa31987506e42fab1b4\nfunc (s *Stream) QueryIfComplete() bool {\n\treturn bool(C.Stream_QueryIfComplete(s.p))\n}\n\n// WaitForCompletion blocks the current CPU thread until all operations in the stream are complete.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/df3/classcv_1_1cuda_1_1Stream.html#a0e1d939503e8faad741ab584b720bca6\nfunc (s *Stream) WaitForCompletion() {\n\tC.Stream_WaitForCompletion(s.p)\n}\n"
  },
  {
    "path": "cuda/cuda.h",
    "content": "#ifndef _OPENCV3_CUDA_H_\n#define _OPENCV3_CUDA_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/core/cuda.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n\n#ifdef __cplusplus\ntypedef cv::cuda::GpuMat* GpuMat;\ntypedef cv::cuda::Stream* Stream;\n#else\ntypedef void* GpuMat;\ntypedef void* Stream;\n#endif\n\n// Wrapper for the vector of GpuMat aka std::vector<GpuMat>\ntypedef struct GpuMats {\n    GpuMat* mats;\n    int length;\n} GpuMats;\n\nGpuMat GpuMat_New();\nGpuMat GpuMat_NewFromMat(Mat mat);\nGpuMat GpuMat_NewWithSize(int rows, int cols, int type);\nvoid GpuMat_Upload(GpuMat m, Mat data, Stream s);\nvoid GpuMat_Download(GpuMat m, Mat dst, Stream s);\nvoid GpuMat_Close(GpuMat m);\nint GpuMat_Empty(GpuMat m);\nvoid GpuMat_ConvertTo(GpuMat m, GpuMat dst, int type, Stream s);\nvoid GpuMat_ConvertFp16(GpuMat m, GpuMat dst);\nvoid GpuMat_CopyTo(GpuMat m, GpuMat dst, Stream s);\nGpuMat GpuMat_Reshape(GpuMat m, int cn, int rows);\nint GpuMat_Cols(GpuMat m);\nint GpuMat_Rows(GpuMat m);\nint GpuMat_Channels(GpuMat m);\nint GpuMat_Type(GpuMat m);\n\nvoid PrintCudaDeviceInfo(int device);\nvoid PrintShortCudaDeviceInfo(int device);\nint GetCudaEnabledDeviceCount();\nint GetCudaDevice();\nvoid SetCudaDevice(int device);\nvoid ResetCudaDevice();\nbool CudaDeviceSupports(int features);\n\nStream Stream_New();\nvoid Stream_Close(Stream s);\nbool Stream_QueryIfComplete(Stream s);\nvoid Stream_WaitForCompletion(Stream s);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDA_H_\n"
  },
  {
    "path": "cuda/cuda_test.go",
    "content": "package cuda\n\nimport (\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestNewGpuMat(t *testing.T) {\n\tmat := NewGpuMat()\n\tdefer mat.Close()\n\n\tif !mat.Empty() {\n\t\tt.Error(\"New GpuMat should be empty\")\n\t}\n}\n\nfunc TestGpuMatClosed(t *testing.T) {\n\tmat := NewGpuMat()\n\tmat.Close()\n\n\tif !mat.Closed() {\n\t\tt.Error(\"Closed GpuMat should be closed\")\n\t}\n}\n\nfunc TestNewGpuMatFromMat(t *testing.T) {\n\tmat := gocv.NewMat()\n\tdefer mat.Close()\n\n\tgpumat := NewGpuMatFromMat(mat)\n\tdefer gpumat.Close()\n\n\tif !gpumat.Empty() {\n\t\tt.Error(\"New GpuMat should be empty\")\n\t}\n}\n\nfunc TestNewGpuMatFromMatWithSize(t *testing.T) {\n\tmat := gocv.NewMatWithSize(100, 200, gocv.MatTypeCV32FC4)\n\tdefer mat.Close()\n\n\tgpumat := NewGpuMatFromMat(mat)\n\tdefer gpumat.Close()\n\n\tif gpumat.Empty() {\n\t\tt.Error(\"New GpuMat should be not empty\")\n\t}\n\n\tif gpumat.Rows() != 100 {\n\t\tt.Error(\"incorrect number of rows for GpuMat\")\n\t}\n\n\tif gpumat.Cols() != 200 {\n\t\tt.Error(\"incorrect number of cols for GpuMat\")\n\t}\n\n\tif gpumat.Type() != gocv.MatTypeCV32FC4 {\n\t\tt.Error(\"incorrect type for GpuMat\")\n\t}\n}\n\nfunc TestNewGpuMatWithSize(t *testing.T) {\n\tgpumat := NewGpuMatWithSize(100, 200, gocv.MatTypeCV32FC4)\n\tdefer gpumat.Close()\n\n\tif gpumat.Empty() {\n\t\tt.Error(\"New GpuMat should be not empty\")\n\t}\n\n\tif gpumat.Rows() != 100 {\n\t\tt.Error(\"incorrect number of rows for GpuMat\")\n\t}\n\n\tif gpumat.Cols() != 200 {\n\t\tt.Error(\"incorrect number of cols for GpuMat\")\n\t}\n\n\tif gpumat.Type() != gocv.MatTypeCV32FC4 {\n\t\tt.Error(\"incorrect type for GpuMat\")\n\t}\n}\n\nfunc TestGetCudaEnabledDeviceCount(t *testing.T) {\n\tif GetCudaEnabledDeviceCount() < 1 {\n\t\tt.Fatal(\"expected atleast one cuda enabled device\")\n\t}\n}\n\nfunc TestConvertFp16(t *testing.T) {\n\tgpumat := NewGpuMatWithSize(100, 200, gocv.MatTypeCV32FC4)\n\tdefer gpumat.Close()\n\n\tfp16mat := NewGpuMatWithSize(100, 200, gocv.MatTypeCV32FC4)\n\tdefer fp16mat.Close()\n\n\tgpumat.ConvertFp16(&fp16mat)\n\n\tif fp16mat.Empty() {\n\t\tt.Error(\"New fp16mat should be not empty\")\n\t}\n\n\tif fp16mat.Rows() != 100 {\n\t\tt.Error(\"incorrect number of rows for fp16mat\")\n\t}\n\n\tif fp16mat.Cols() != 200 {\n\t\tt.Error(\"incorrect number of cols for fp16mat\")\n\t}\n\n\tif fp16mat.Type() != gocv.MatTypeCV16SC4 {\n\t\tt.Error(\"incorrect type for fp16mat\", fp16mat.Type())\n\t}\n}\n\nfunc TestCudaDeviceSupports(t *testing.T) {\n\tif !DeviceSupports(FeatureSetCompute10) {\n\t\tt.Fatal(\"expected FeatureSetCompute10 on cuda enabled device\")\n\t}\n}\n"
  },
  {
    "path": "cuda/errors.go",
    "content": "package cuda\n\n/*\n#include \"../core.h\"\n*/\nimport \"C\"\nimport \"errors\"\n\n// Converts a OpenCVResult struct to an error.\nfunc OpenCVResult(result C.OpenCVResult) error {\n\tif result.Code == 0 {\n\t\treturn nil\n\t}\n\treturn errors.New(C.GoString(result.Message))\n}\n"
  },
  {
    "path": "cuda/filters.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_filters)\n\n#include \"../core.h\"\n#include \"filters.h\"\n#include <string.h>\n\nGaussianFilter CreateGaussianFilter(int srcType, int dstType, Size ksize, double sigma1) {\n    try {\n        cv::Size sz(ksize.width, ksize.height);\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createGaussianFilter(srcType, dstType, sz, sigma1));    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nGaussianFilter CreateGaussianFilterWithParams(int srcType, int dstType, Size ksize, double sigma1, double sigma2, int rowBorderMode, int columnBorderMode) {\n    try {\n        cv::Size sz(ksize.width, ksize.height);\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createGaussianFilter(srcType, dstType, sz, sigma1, sigma2, rowBorderMode, columnBorderMode));    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid GaussianFilter_Close(GaussianFilter gf) {\n    delete gf;\n}\n\nOpenCVResult GaussianFilter_Apply(GaussianFilter gf, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*gf)->apply(*img, *dst);\n        } else {\n            (*gf)->apply(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMorphologyFilter CreateMorphologyFilter(int op, int srcType, Mat kernel) {\n    try {\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createMorphologyFilter(op, srcType, *kernel));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nMorphologyFilter CreateMorphologyFilterWithParams(int op, int srcType, Mat kernel, Point anchor, int iterations) {\n    try {\n        cv::Point pt(anchor.x, anchor.y);\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createMorphologyFilter(op, srcType, *kernel, pt, iterations));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid MorphologyFilter_Close(MorphologyFilter mf) {\n    delete mf;\n}\n\nOpenCVResult MorphologyFilter_Apply(MorphologyFilter mf, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*mf)->apply(*img, *dst);\n        } else {\n            (*mf)->apply(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n\nSobelFilter CreateSobelFilter(int srcType, int dstType, int dx, int dy) {\n    try {\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createSobelFilter(srcType, dstType, dx, dy));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nSobelFilter CreateSobelFilterWithParams(int srcType, int dstType, int dx, int dy, int ksize, double scale, int rowBorderMode, int columnBorderMode) {\n    try {\n        return new cv::Ptr<cv::cuda::Filter>(cv::cuda::createSobelFilter(srcType, dstType, dx, dy, ksize, rowBorderMode, columnBorderMode));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid SobelFilter_Close(SobelFilter sf) {\n    delete sf;\n}\n\nOpenCVResult SobelFilter_Apply(SobelFilter sf, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*sf)->apply(*img, *dst);\n        } else {\n            (*sf)->apply(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/filters.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_filters)\n\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"../core.h\"\n#include \"core.h\"\n#include \"filters.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// GaussianFilter\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d66/group__cudafilters.html#gaa4df286369114cfd4b144ae211f6a6c8\ntype GaussianFilter struct {\n\tp unsafe.Pointer\n}\n\n// NewGaussianFilter returns a new GaussianFilter.\nfunc NewGaussianFilter(srcType gocv.MatType, dstType gocv.MatType, ksize image.Point, sigma1 float64) GaussianFilter {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(ksize.X),\n\t\theight: C.int(ksize.Y),\n\t}\n\n\treturn GaussianFilter{p: unsafe.Pointer(C.CreateGaussianFilter(C.int(srcType), C.int(dstType), pSize, C.double(sigma1)))}\n}\n\n// Close GaussianFilter\nfunc (gf *GaussianFilter) Close() error {\n\tC.GaussianFilter_Close((C.GaussianFilter)(gf.p))\n\tgf.p = nil\n\treturn nil\n}\n\n// Apply applies the Gaussian filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (gf *GaussianFilter) Apply(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.GaussianFilter_Apply(C.GaussianFilter(gf.p), img.p, dst.p, nil))\n}\n\n// ApplyWithStream applies the Gaussian filter\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (gf *GaussianFilter) ApplyWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.GaussianFilter_Apply(C.GaussianFilter(gf.p), img.p, dst.p, s.p))\n}\n\n// MorphologyFilter\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/dc/d66/group__cudafilters.html#gae58694e07be6bdbae126f36c75c08ee6\ntype MorphologyFilter struct {\n\tp unsafe.Pointer\n}\n\n// NewMorphologyFilter returns a new MorphologyFilter.\nfunc NewMorphologyFilter(op gocv.MorphType, srcType gocv.MatType, kernel gocv.Mat) MorphologyFilter {\n\treturn MorphologyFilter{p: unsafe.Pointer(C.CreateMorphologyFilter(C.int(op), C.int(srcType), C.Mat(kernel.Ptr())))}\n}\n\n// NewMorphologyFilterWithParams returns a new MorphologyFilter.\nfunc NewMorphologyFilterWithParams(op gocv.MorphType, srcType gocv.MatType, kernel gocv.Mat, anchor image.Point, iterations int) MorphologyFilter {\n\tpt := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\treturn MorphologyFilter{p: unsafe.Pointer(C.CreateMorphologyFilterWithParams(C.int(op), C.int(srcType), C.Mat(kernel.Ptr()), pt, C.int(iterations)))}\n}\n\n// Close MorphologyFilter\nfunc (mf *MorphologyFilter) Close() error {\n\tC.MorphologyFilter_Close((C.MorphologyFilter)(mf.p))\n\tmf.p = nil\n\treturn nil\n}\n\n// Apply applies the Morphology filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (mf *MorphologyFilter) Apply(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.MorphologyFilter_Apply(C.MorphologyFilter(mf.p), img.p, dst.p, nil))\n}\n\n// ApplyWithStream applies the Morphology filter\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (mf *MorphologyFilter) ApplyWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.MorphologyFilter_Apply(C.MorphologyFilter(mf.p), img.p, dst.p, s.p))\n}\n\n// SobelFilter\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d66/group__cudafilters.html#gabf85fe61958bb21e93211a6fcc7c5c3b\ntype SobelFilter struct {\n\tp unsafe.Pointer\n}\n\n// NewSobelFilter returns a new SobelFilter.\nfunc NewSobelFilter(srcType gocv.MatType, dstType gocv.MatType, dx int, dy int) SobelFilter {\n\treturn SobelFilter{p: unsafe.Pointer(C.CreateSobelFilter(C.int(srcType), C.int(dstType), C.int(dx), C.int(dy)))}\n}\n\n// NewSobelFilterWithParams returns a new SobelFilter.\nfunc NewSobelFilterWithParams(srcType gocv.MatType, dstType gocv.MatType, dx int, dy int, ksize int, scale float64, rowBorderMode int, columnBorderMode int) SobelFilter {\n\treturn SobelFilter{p: unsafe.Pointer(C.CreateSobelFilterWithParams(C.int(srcType), C.int(dstType), C.int(dx), C.int(dy), C.int(ksize), C.double(scale), C.int(rowBorderMode), C.int(columnBorderMode)))}\n}\n\n// Close SobelFilter\nfunc (sf *SobelFilter) Close() error {\n\tC.SobelFilter_Close((C.SobelFilter)(sf.p))\n\tsf.p = nil\n\treturn nil\n}\n\n// Apply applies the Sobel filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (sf *SobelFilter) Apply(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.SobelFilter_Apply(C.SobelFilter(sf.p), img.p, dst.p, nil))\n}\n\n// ApplyWithStream applies the Sobel filter\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d2b/classcv_1_1cuda_1_1Filter.html#a20b58d13871027473b4c39cc698cf80f\nfunc (sf *SobelFilter) ApplyWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.SobelFilter_Apply(C.SobelFilter(sf.p), img.p, dst.p, s.p))\n}\n"
  },
  {
    "path": "cuda/filters.h",
    "content": "#ifndef _GOCV_CUDA_FILTERS_H_\n#define _GOCV_CUDA_FILTERS_H_\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/cudafilters.hpp>\nextern \"C\" {\n#endif\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::cuda::Filter>* GaussianFilter;\ntypedef cv::Ptr<cv::cuda::Filter>* MorphologyFilter;\ntypedef cv::Ptr<cv::cuda::Filter>* SobelFilter;\n#else\ntypedef void* GaussianFilter;\ntypedef void* MorphologyFilter;\ntypedef void* SobelFilter;\n#endif\n\n// GaussianFilter\nGaussianFilter CreateGaussianFilter(int srcType, int dstType, Size ksize, double sigma1);\nGaussianFilter CreateGaussianFilterWithParams(int srcType, int dstType, Size ksize, double sigma1, double sigma2, int rowBorderMode, int columnBorderMode);\nvoid GaussianFilter_Close(GaussianFilter gf);\nOpenCVResult GaussianFilter_Apply(GaussianFilter gf, GpuMat img, GpuMat dst, Stream s);\n\n// MorphologyFilter\nMorphologyFilter CreateMorphologyFilter(int op, int srcType, Mat kernel);\nMorphologyFilter CreateMorphologyFilterWithParams(int op, int srcType, Mat kernel, Point anchor, int iterations);\nvoid MorphologyFilter_Close(MorphologyFilter mf);\nOpenCVResult MorphologyFilter_Apply(MorphologyFilter mf, GpuMat img, GpuMat dst, Stream s);\n\n// SobelFilter\nSobelFilter CreateSobelFilter(int srcType, int dstType, int dx, int dy);\nSobelFilter CreateSobelFilterWithParams(int srcType, int dstType, int dx, int dy, int ksize, double scale, int rowBorderMode, int columnBorderMode);\nvoid SobelFilter_Close(SobelFilter sf);\nOpenCVResult SobelFilter_Apply(SobelFilter sf, GpuMat img, GpuMat dst, Stream s);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_GOCV_CUDA_FILTERS_H_\n"
  },
  {
    "path": "cuda/filters_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_filters)\n\npackage cuda\n\nimport (\n\t\"image\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestGaussianFilter_Apply(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GaussianFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tfilter := NewGaussianFilter(src.Type(), src.Type(), image.Pt(23, 23), 30)\n\tdefer filter.Close()\n\n\tfilter.Apply(cimg, &dimg)\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty GaussianFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid GaussianFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid GaussianFilter test cols\")\n\t}\n}\n\nfunc TestGaussianFilter_ApplyWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GaussianFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tfilter := NewGaussianFilter(src.Type(), src.Type(), image.Pt(23, 23), 30)\n\tdefer filter.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, stream)\n\tfilter.ApplyWithStream(cimg, &dimg, stream)\n\tdimg.DownloadWithStream(&dest, stream)\n\n\tstream.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty GaussianFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid GaussianFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid GaussianFilter test cols\")\n\t}\n}\n\nfunc TestMorphologyFilter_Apply(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in MorphologyFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tkernel := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tfilter := NewMorphologyFilter(gocv.MorphDilate, src.Type(), kernel)\n\tdefer filter.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.Upload(src)\n\tfilter.Apply(cimg, &dimg)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty MorphologyFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid MorphologyFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid MorphologyFilter test cols\")\n\t}\n}\n\nfunc TestMorphologyFilter_ApplyWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in MorphologyFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tkernel := gocv.GetStructuringElement(gocv.MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tfilter := NewMorphologyFilter(gocv.MorphDilate, src.Type(), kernel)\n\tdefer filter.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, stream)\n\tfilter.ApplyWithStream(cimg, &dimg, stream)\n\tdimg.DownloadWithStream(&dest, stream)\n\n\tstream.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty MorphologyFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid MorphologyFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid MorphologyFilter test cols\")\n\t}\n}\n\nfunc TestSobelFilter_Apply(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in SobelFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tfilter := NewSobelFilter(src.Type(), src.Type(), 0, 1)\n\tdefer filter.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.Upload(src)\n\tfilter.Apply(cimg, &dimg)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty SobelFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid SobelFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid SobelFilter test cols\")\n\t}\n}\n\nfunc TestSobelFilter_ApplyWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in SobelFilter test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tfilter := NewSobelFilter(src.Type(), src.Type(), 0, 1)\n\tdefer filter.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, stream)\n\tfilter.ApplyWithStream(cimg, &dimg, stream)\n\tdimg.DownloadWithStream(&dest, stream)\n\n\tstream.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty SobelFilter test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid SobelFilter test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid SobelFilter test cols\")\n\t}\n}\n"
  },
  {
    "path": "cuda/helpers_test.go",
    "content": "package cuda\n\nimport \"math\"\n\nvar eps = 0.00000001\n\nfunc floatEquals(a, b float32) bool {\n\tif math.Abs(float64(a-b)) < eps {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// round helper from https://stackoverflow.com/questions/39544571/golang-round-to-nearest-0-05\nfunc round(x, unit float32) float32 {\n\treturn float32(int32(x/unit+0.5)) * unit\n}\n"
  },
  {
    "path": "cuda/imgproc.cpp",
    "content": "#include \"../core.h\"\n#include \"imgproc.h\"\n#include <string.h>\n\nOpenCVResult GpuCvtColor(GpuMat src, GpuMat dst, int code, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::cvtColor(*src, *dst, code);\n        } else {\n            cv::cuda::cvtColor(*src, *dst, code, 0, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GpuDemosaicing(GpuMat src, GpuMat dst, int code, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::demosaicing(*src, *dst, code);\n        } else {\n            cv::cuda::demosaicing(*src, *dst, code, -1, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nCannyEdgeDetector CreateCannyEdgeDetector(double lowThresh, double highThresh) {\n    try {\n        return new cv::Ptr<cv::cuda::CannyEdgeDetector>(cv::cuda::createCannyEdgeDetector(lowThresh, highThresh));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nCannyEdgeDetector CreateCannyEdgeDetectorWithParams(double lowThresh, double highThresh, int appertureSize, bool L2gradient) {\n    try {\n        return new cv::Ptr<cv::cuda::CannyEdgeDetector>(cv::cuda::createCannyEdgeDetector(lowThresh, highThresh, appertureSize, L2gradient));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid CannyEdgeDetector_Close(CannyEdgeDetector det) {\n    delete det;\n}\n\nOpenCVResult CannyEdgeDetector_Detect(CannyEdgeDetector det, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*det)->detect(*img, *dst);\n        } else {\n            (*det)->detect(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint CannyEdgeDetector_GetAppertureSize(CannyEdgeDetector det) {\n    try {\n        return int((*det)->getAppertureSize());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\ndouble CannyEdgeDetector_GetHighThreshold(CannyEdgeDetector det) {\n    try {\n        return double((*det)->getHighThreshold());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nbool CannyEdgeDetector_GetL2Gradient(CannyEdgeDetector det) {\n    try {\n        return bool((*det)->getL2Gradient());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\ndouble CannyEdgeDetector_GetLowThreshold(CannyEdgeDetector det) {\n    try {\n        return double((*det)->getLowThreshold());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nvoid CannyEdgeDetector_SetAppertureSize(CannyEdgeDetector det, int appertureSize) {\n    try {\n        (*det)->setAppertureSize(appertureSize);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid CannyEdgeDetector_SetHighThreshold(CannyEdgeDetector det, double highThresh) {\n    try {\n        (*det)->setHighThreshold(highThresh);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid CannyEdgeDetector_SetL2Gradient(CannyEdgeDetector det, bool L2gradient) {\n    try {\n        (*det)->setL2Gradient(L2gradient);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid CannyEdgeDetector_SetLowThreshold(CannyEdgeDetector det, double lowThresh) {\n    try {\n        (*det)->setLowThreshold(lowThresh);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nHoughLinesDetector HoughLinesDetector_Create(double rho, double theta, int threshold) {\n    try {\n        return new cv::Ptr<cv::cuda::HoughLinesDetector>(cv::cuda::createHoughLinesDetector(rho, theta, threshold));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nHoughLinesDetector HoughLinesDetector_CreateWithParams(double rho, double theta, int threshold, bool sort, int maxlines) {\n    try {\n        return new cv::Ptr<cv::cuda::HoughLinesDetector>(cv::cuda::createHoughLinesDetector(rho, theta, threshold, sort, maxlines));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid HoughLinesDetector_Close(HoughLinesDetector hld) {\n    delete hld;\n}\n\nOpenCVResult HoughLinesDetector_Detect(HoughLinesDetector hld, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*hld)->detect(*img, *dst);\n        } else {\n            (*hld)->detect(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nHoughSegmentDetector HoughSegmentDetector_Create(double rho, double theta, int minLineLength, int maxLineGap) {\n    try {\n        return new cv::Ptr<cv::cuda::HoughSegmentDetector>(cv::cuda::createHoughSegmentDetector(rho, theta, minLineLength, maxLineGap));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid HoughSegmentDetector_Close(HoughSegmentDetector hsd) {\n    delete hsd;\n}\n\nOpenCVResult HoughSegmentDetector_Detect(HoughSegmentDetector hsd, GpuMat img, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*hsd)->detect(*img, *dst);\n        } else {\n            (*hsd)->detect(*img, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nTemplateMatching TemplateMatching_Create(int srcType, int method) {\n    try {\n        return new cv::Ptr<cv::cuda::TemplateMatching>(cv::cuda::createTemplateMatching(srcType, method));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid TemplateMatching_Close(TemplateMatching tm) {\n    delete tm;\n}\n\nOpenCVResult TemplateMatching_Match(TemplateMatching tm, GpuMat img, GpuMat tmpl, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            (*tm)->match(*img, *tmpl, *dst);\n        } else {\n            (*tm)->match(*img, *tmpl, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult AlphaComp(GpuMat img1, GpuMat img2, GpuMat dst, int alpha_op, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::alphaComp(*img1, *img2, *dst, alpha_op);\n        } else {\n            cv::cuda::alphaComp(*img1, *img2, *dst, alpha_op, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GammaCorrection(GpuMat src, GpuMat dst, bool forward, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::gammaCorrection(*src, *dst, forward);\n        } else {\n            cv::cuda::gammaCorrection(*src, *dst, forward, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n\n}\n\nOpenCVResult SwapChannels(GpuMat image, int dstOrder[4], Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::swapChannels(*image, dstOrder);\n        } else {\n            cv::cuda::swapChannels(*image, dstOrder, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_CalcHist(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::calcHist(*src, *dst);\n        } else {\n            cv::cuda::calcHist(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_CalcHist_WithParams(GpuMat src, GpuMat mask, GpuMat dst, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::calcHist(*src, *mask, *dst);\n        } else {\n            cv::cuda::calcHist(*src, *mask, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_EqualizeHist(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::equalizeHist(*src, *dst);\n        } else {\n            cv::cuda::equalizeHist(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_EvenLevels(GpuMat levels, int nLevels, int lowerLevel, int upperLevel, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::evenLevels(*levels, nLevels, lowerLevel, upperLevel);\n        } else {\n            cv::cuda::evenLevels(*levels, nLevels, lowerLevel, upperLevel, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_HistEven(GpuMat src, GpuMat hist, int histSize, int lowerLevel, int upperLevel, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::histEven(*src, *hist, histSize, lowerLevel, upperLevel);\n        } else {\n            cv::cuda::histEven(*src, *hist, histSize, lowerLevel, upperLevel, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_HistRange(GpuMat src, GpuMat hist, GpuMat levels, Stream s){\n    try {\n        if(s == NULL) {\n            cv::cuda::histRange(*src, *hist, *levels);\n        } else {\n            cv::cuda::histRange(*src, *hist, *levels, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n} \n\nOpenCVResult Cuda_BilateralFilter(GpuMat src, GpuMat dst, int kernel_size, float sigma_color, float sigma_spatial, int borderMode, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::bilateralFilter(*src, *dst, kernel_size, sigma_color, sigma_spatial, borderMode);\n        } else {\n            cv::cuda::bilateralFilter(*src, *dst, kernel_size, sigma_color, sigma_spatial, borderMode, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_BlendLinear(GpuMat img1, GpuMat img2, GpuMat weights1, GpuMat weights2, GpuMat result, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::blendLinear(*img1, *img2, *weights1, *weights2, *result);\n        } else {\n            cv::cuda::blendLinear(*img1, *img2, *weights1, *weights2, *result, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_MeanShiftFiltering(GpuMat src, GpuMat dst, int sp, int sr, TermCriteria criteria, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::meanShiftFiltering(*src, *dst, sp, sr, *criteria);\n        } else {\n            cv::cuda::meanShiftFiltering(*src, *dst, sp, sr, *criteria, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_MeanShiftProc(GpuMat src, GpuMat dstr, GpuMat dstsp, int sp, int sr, TermCriteria criteria, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::meanShiftProc(*src, *dstr, *dstsp, sp, sr, *criteria);\n        } else {\n            cv::cuda::meanShiftProc(*src, *dstr, *dstsp, sp, sr, *criteria, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Cuda_MeanShiftSegmentation(GpuMat src, GpuMat dst, int sp, int sr, int minSize, TermCriteria criteria, Stream s) {\n    try {\n        if(s == NULL) {\n            cv::cuda::meanShiftSegmentation(*src, *dst, sp, sr, minSize, *criteria);\n        } else {\n            cv::cuda::meanShiftSegmentation(*src, *dst, sp, sr, minSize, *criteria, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/imgproc.go",
    "content": "package cuda\n\n/*\n#include <stdlib.h>\n#include \"../core.h\"\n#include \"core.h\"\n#include \"imgproc.h\"\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n\n\t\"gocv.io/x/gocv\"\n)\n\n// CannyEdgeDetector\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html\ntype CannyEdgeDetector struct {\n\tp unsafe.Pointer\n}\n\n// NewCannyEdgeDetector returns a new CannyEdgeDetector.\nfunc NewCannyEdgeDetector(lowThresh, highThresh float64) CannyEdgeDetector {\n\treturn CannyEdgeDetector{p: unsafe.Pointer(C.CreateCannyEdgeDetector(C.double(lowThresh), C.double(highThresh)))}\n}\n\n// NewCannyEdgeDetectorWithParams returns a new CannyEdgeDetector.\nfunc NewCannyEdgeDetectorWithParams(lowThresh, highThresh float64, appertureSize int, L2gradient bool) CannyEdgeDetector {\n\treturn CannyEdgeDetector{p: unsafe.Pointer(C.CreateCannyEdgeDetectorWithParams(C.double(lowThresh), C.double(highThresh), C.int(appertureSize), C.bool(L2gradient)))}\n}\n\n// Close CannyEdgeDetector\nfunc (h *CannyEdgeDetector) Close() error {\n\tC.CannyEdgeDetector_Close((C.CannyEdgeDetector)(h.p))\n\th.p = nil\n\treturn nil\n}\n\n// Detect finds edges in an image using the Canny algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a6438cf8453f2dfd6703ceb50056de309\nfunc (h *CannyEdgeDetector) Detect(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.CannyEdgeDetector_Detect(C.CannyEdgeDetector(h.p), img.p, dst.p, nil))\n}\n\n// DetectWithStream finds edges in an image using the Canny algorithm\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a6438cf8453f2dfd6703ceb50056de309\nfunc (h *CannyEdgeDetector) DetectWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.CannyEdgeDetector_Detect(C.CannyEdgeDetector(h.p), img.p, dst.p, s.p))\n}\n\n// GetAppertureSize\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a19c2963ff255b0c18387594a704439d3\nfunc (h *CannyEdgeDetector) GetAppertureSize() int {\n\treturn int(C.CannyEdgeDetector_GetAppertureSize(C.CannyEdgeDetector(h.p)))\n}\n\n// GetHighThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a8366296a57059487dcfd7b30f4a9e3b1\nfunc (h *CannyEdgeDetector) GetHighThreshold() float64 {\n\treturn float64(C.CannyEdgeDetector_GetHighThreshold(C.CannyEdgeDetector(h.p)))\n}\n\n// GetL2Gradient\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a8fe4ed887c226b12ab44084789b4c6dd\nfunc (h *CannyEdgeDetector) GetL2Gradient() bool {\n\treturn bool(C.CannyEdgeDetector_GetL2Gradient(C.CannyEdgeDetector(h.p)))\n}\n\n// GetLowThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#aaf5a8944a8ac11093cf7a093b45cd3a8\nfunc (h *CannyEdgeDetector) GetLowThreshold() float64 {\n\treturn float64(C.CannyEdgeDetector_GetLowThreshold(C.CannyEdgeDetector(h.p)))\n}\n\n// SetAppertureSize\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#aac7d0602338e1a2a783811a929967714\nfunc (h *CannyEdgeDetector) SetAppertureSize(appertureSize int) {\n\tC.CannyEdgeDetector_SetAppertureSize(C.CannyEdgeDetector(h.p), C.int(appertureSize))\n}\n\n// SetHighThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a63d352fe7f3bad640e63f4e394619235\nfunc (h *CannyEdgeDetector) SetHighThreshold(highThresh float64) {\n\tC.CannyEdgeDetector_SetHighThreshold(C.CannyEdgeDetector(h.p), C.double(highThresh))\n}\n\n// SetL2Gradient\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#ac2e8a675cc30cb3e621ac684e22f89d1\nfunc (h *CannyEdgeDetector) SetL2Gradient(L2gradient bool) {\n\tC.CannyEdgeDetector_SetL2Gradient(C.CannyEdgeDetector(h.p), C.bool(L2gradient))\n}\n\n// SetLowThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d43/classcv_1_1cuda_1_1CannyEdgeDetector.html#a6bdc1479c1557288a69c6314c61d1548\nfunc (h *CannyEdgeDetector) SetLowThreshold(lowThresh float64) {\n\tC.CannyEdgeDetector_SetLowThreshold(C.CannyEdgeDetector(h.p), C.double(lowThresh))\n}\n\n// CvtColor converts an image from one color space to another.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d8c/group__cudaimgproc__color.html#ga48d0f208181d5ca370d8ff6b62cbe826\nfunc CvtColor(src GpuMat, dst *GpuMat, code gocv.ColorConversionCode) error {\n\treturn OpenCVResult(C.GpuCvtColor(src.p, dst.p, C.int(code), nil))\n}\n\n// CvtColorWithStream converts an image from one color space to another\n// using a Stream for concurrency.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d8c/group__cudaimgproc__color.html#ga48d0f208181d5ca370d8ff6b62cbe826\nfunc CvtColorWithStream(src GpuMat, dst *GpuMat, code gocv.ColorConversionCode, s Stream) error {\n\treturn OpenCVResult(C.GpuCvtColor(src.p, dst.p, C.int(code), s.p))\n}\n\n// Demosaicing converts an image from Bayer pattern to RGB or grayscale.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d8c/group__cudaimgproc__color.html#ga7fb153572b573ebd2d7610fcbe64166e\nfunc Demosaicing(src GpuMat, dst *GpuMat, code gocv.ColorConversionCode) error {\n\treturn OpenCVResult(C.GpuDemosaicing(src.p, dst.p, C.int(code), nil))\n}\n\n// DemosaicingWithStream converts an image from Bayer pattern to RGB or grayscale\n// using a Stream for concurrency.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d8c/group__cudaimgproc__color.html#ga7fb153572b573ebd2d7610fcbe64166e\nfunc DemosaicingWithStream(src GpuMat, dst *GpuMat, code gocv.ColorConversionCode, s Stream) error {\n\treturn OpenCVResult(C.GpuDemosaicing(src.p, dst.p, C.int(code), s.p))\n}\n\n// HoughLinesDetector\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/dcd/classcv_1_1cuda_1_1HoughLinesDetector.html\ntype HoughLinesDetector struct {\n\tp unsafe.Pointer\n}\n\n// NewHoughLinesDetector returns a new HoughLinesDetector.\nfunc NewHoughLinesDetector(rho float32, theta float32, threshold int) HoughLinesDetector {\n\treturn HoughLinesDetector{p: unsafe.Pointer(C.HoughLinesDetector_Create(C.double(rho), C.double(theta), C.int(threshold)))}\n}\n\n// NewHoughLinesDetectorWithParams returns a new HoughLinesDetector.\nfunc NewHoughLinesDetectorWithParams(rho float32, theta float32, threshold int, sort bool, maxlines int) HoughLinesDetector {\n\treturn HoughLinesDetector{p: unsafe.Pointer(C.HoughLinesDetector_CreateWithParams(C.double(rho), C.double(theta), C.int(threshold), C.bool(sort), C.int(maxlines)))}\n}\n\n// Close HoughLinesDetector\nfunc (h *HoughLinesDetector) Close() error {\n\tC.HoughLinesDetector_Close((C.HoughLinesDetector)(h.p))\n\th.p = nil\n\treturn nil\n}\n\n// Detect finds lines in a binary image using the classical Hough transform.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/dcd/classcv_1_1cuda_1_1HoughLinesDetector.html#a18ff6d0886833ac6215054e191ae2520\nfunc (h *HoughLinesDetector) Detect(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.HoughLinesDetector_Detect(C.HoughLinesDetector(h.p), img.p, dst.p, nil))\n}\n\n// DetectWithStream finds lines in a binary image using the classical Hough transform\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d2/dcd/classcv_1_1cuda_1_1HoughLinesDetector.html#a18ff6d0886833ac6215054e191ae2520\nfunc (h *HoughLinesDetector) DetectWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.HoughLinesDetector_Detect(C.HoughLinesDetector(h.p), img.p, dst.p, s.p))\n}\n\n// HoughSegmentDetector\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df9/classcv_1_1cuda_1_1HoughSegmentDetector.html\ntype HoughSegmentDetector struct {\n\tp unsafe.Pointer\n}\n\n// NewHoughSegmentDetector returns a new HoughSegmentDetector.\nfunc NewHoughSegmentDetector(rho float32, theta float32, minLineLength int, maxLineGap int) HoughSegmentDetector {\n\treturn HoughSegmentDetector{p: unsafe.Pointer(C.HoughSegmentDetector_Create(C.double(rho), C.double(theta), C.int(minLineLength), C.int(maxLineGap)))}\n}\n\n// Close HoughSegmentDetector\nfunc (h *HoughSegmentDetector) Close() error {\n\tC.HoughSegmentDetector_Close((C.HoughSegmentDetector)(h.p))\n\th.p = nil\n\treturn nil\n}\n\n// Detect finds lines in a binary image using the Hough probabilistic transform.\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df9/classcv_1_1cuda_1_1HoughSegmentDetector.html#a739bf84825ca455966d69dd75ca0ea6e\nfunc (h *HoughSegmentDetector) Detect(img GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.HoughSegmentDetector_Detect(C.HoughSegmentDetector(h.p), img.p, dst.p, nil))\n}\n\n// DetectWithStream finds lines in a binary image using the Hough probabilistic transform\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df9/classcv_1_1cuda_1_1HoughSegmentDetector.html#a739bf84825ca455966d69dd75ca0ea6e\nfunc (h *HoughSegmentDetector) DetectWithStream(img GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.HoughSegmentDetector_Detect(C.HoughSegmentDetector(h.p), img.p, dst.p, s.p))\n}\n\n// TemplateMatching\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/d2/d58/classcv_1_1cuda_1_1TemplateMatching.html\ntype TemplateMatching struct {\n\tp unsafe.Pointer\n}\n\n// NewTemplateMatching returns a new TemplateMatching.\nfunc NewTemplateMatching(srcType gocv.MatType, method gocv.TemplateMatchMode) TemplateMatching {\n\treturn TemplateMatching{p: unsafe.Pointer(C.TemplateMatching_Create(C.int(srcType), C.int(method)))}\n}\n\n// Close TemplateMatching\nfunc (tm *TemplateMatching) Close() error {\n\tC.TemplateMatching_Close((C.TemplateMatching)(tm.p))\n\ttm.p = nil\n\treturn nil\n}\n\n// Match computes a proximity map for a raster template and an image where the template is searched for.\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/d2/d58/classcv_1_1cuda_1_1TemplateMatching.html#a05a565a53461c916b3b10737cbe43a01\nfunc (tm *TemplateMatching) Match(img GpuMat, tmpl GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.TemplateMatching_Match(C.TemplateMatching(tm.p), img.p, tmpl.p, dst.p, nil))\n}\n\n// MatchWithStream computes a proximity map for a raster template and an image where the template is searched for\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/d2/d58/classcv_1_1cuda_1_1TemplateMatching.html#a05a565a53461c916b3b10737cbe43a01\nfunc (tm *TemplateMatching) MatchWithStream(img GpuMat, tmpl GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.TemplateMatching_Match(C.TemplateMatching(tm.p), img.p, tmpl.p, dst.p, s.p))\n}\n\n// AlphaComp Composites two images using alpha opacity values contained in each image.\n//\n// img1: First image. Supports CV_8UC4 , CV_16UC4 , CV_32SC4 and CV_32FC4 types.\n//\n// img2: Second image. Must have the same size and the same type as img1.\n//\n// dst: Destination image.\n//\n// alpha_op: Flag specifying the alpha-blending operation\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#ga08a698700458d9311390997b57fbf8dc\nfunc AlphaComp(img1 GpuMat, img2 GpuMat, dst *GpuMat, alphaOp AlphaCompTypes) error {\n\treturn OpenCVResult(C.AlphaComp(img1.p, img2.p, dst.p, C.int(alphaOp), nil))\n}\n\n// AlphaCompWithStream Composites two images using alpha opacity values contained in each image.\n//\n// img1: First image. Supports CV_8UC4 , CV_16UC4 , CV_32SC4 and CV_32FC4 types.\n//\n// img2: Second image. Must have the same size and the same type as img1.\n//\n// dst: Destination image.\n//\n// alpha_op: Flag specifying the alpha-blending operation\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#ga08a698700458d9311390997b57fbf8dc\nfunc AlphaCompWithStream(img1 GpuMat, img2 GpuMat, dst *GpuMat, alphaOp AlphaCompTypes, s Stream) error {\n\treturn OpenCVResult(C.AlphaComp(img1.p, img2.p, dst.p, C.int(alphaOp), s.p))\n}\n\n// GammaCorrection Routines for correcting image color gamma.\n//\n// src: Source image (3- or 4-channel 8 bit).\n//\n// dst: Destination image.\n//\n// forward: true for forward gamma correction or false for inverse gamma correction.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#gaf4195a8409c3b8fbfa37295c2b2c4729\nfunc GammaCorrection(src GpuMat, dst *GpuMat, forward bool) error {\n\treturn OpenCVResult(C.GammaCorrection(src.p, dst.p, C.bool(forward), nil))\n}\n\n// GammaCorrectionWithStream Routines for correcting image color gamma.\n//\n// src: Source image (3- or 4-channel 8 bit).\n//\n// dst: Destination image.\n//\n// forward: true for forward gamma correction or false for inverse gamma correction.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#gaf4195a8409c3b8fbfa37295c2b2c4729\nfunc GammaCorrectionWithStream(src GpuMat, dst *GpuMat, forward bool, s Stream) error {\n\treturn OpenCVResult(C.GammaCorrection(src.p, dst.p, C.bool(forward), s.p))\n}\n\n// SwapChannels Exchanges the color channels of an image in-place.\n//\n// image: Source image. Supports only CV_8UC4 type.\n//\n// dstOrder: Integer array describing how channel values are permutated. The n-th entry of the array\n// contains the number of the channel that is stored in the n-th channel of the output image.\n// E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR channel order.\n//\n// supports arbitrary permutations of the original channels, including replication.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#ga75a29cc4a97cde0d43ea066b01de927e\nfunc SwapChannels(image *GpuMat, dstOrder []int) error {\n\treturn OpenCVResult(C.SwapChannels(image.p, (*C.int)(unsafe.Pointer(&dstOrder[0])), nil))\n}\n\n// SwapChannelsWithStream Exchanges the color channels of an image in-place.\n//\n// image: Source image. Supports only CV_8UC4 type.\n//\n// dstOrder: Integer array describing how channel values are permutated. The n-th entry of the array\n// contains the number of the channel that is stored in the n-th channel of the output image.\n// E.g. Given an RGBA image, aDstOrder = [3,2,1,0] converts this to ABGR channel order.\n//\n// stream: Stream for the asynchronous version.\n//\n// supports arbitrary permutations of the original channels, including replication.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d8c/group__cudaimgproc__color.html#ga75a29cc4a97cde0d43ea066b01de927e\nfunc SwapChannelsWithStream(image *GpuMat, dstOrder []int, s Stream) error {\n\treturn OpenCVResult(C.SwapChannels(image.p, (*C.int)(unsafe.Pointer(&dstOrder[0])), s.p))\n}\n\n// CalcHist Calculates histogram for one channel 8-bit image.\n//\n// src: Source image with CV_8UC1 type.\n//\n// hist: Destination histogram with one row, 256 columns, and the CV_32SC1 type.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#gaaf3944106890947020bb4522a7619c26\nfunc CalcHist(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.Cuda_CalcHist(src.p, dst.p, nil))\n}\n\n// CalcHistWithStream Calculates histogram for one channel 8-bit image.\n//\n// src: Source image with CV_8UC1 type.\n//\n// hist: Destination histogram with one row, 256 columns, and the CV_32SC1 type.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#gaaf3944106890947020bb4522a7619c26\nfunc CalcHistWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_CalcHist(src.p, dst.p, s.p))\n}\n\n// CalcHistWithParams Calculates histogram for one channel 8-bit image confined in given mask.\n//\n// src: Source image with CV_8UC1 type.\n//\n// mask: A mask image same size as src and of type CV_8UC1.\n//\n// hist: Destination histogram with one row, 256 columns, and the CV_32SC1 type.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga2d55b444ce776c8bbd3087cc90c47f32\nfunc CalcHistWithParams(src GpuMat, mask GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_CalcHist_WithParams(src.p, mask.p, dst.p, s.p))\n}\n\n// EqualizeHist Equalizes the histogram of a grayscale image.\n//\n// src: Source image with CV_8UC1 type.\n//\n// dst: Destination image.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga2384be74bd2feba7e6c46815513f0060\nfunc EqualizeHist(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.Cuda_EqualizeHist(src.p, dst.p, nil))\n}\n\n// EqualizeHistWithStream Equalizes the histogram of a grayscale image.\n//\n// src: Source image with CV_8UC1 type.\n//\n// dst: Destination image.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga2384be74bd2feba7e6c46815513f0060\nfunc EqualizeHistWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_EqualizeHist(src.p, dst.p, s.p))\n}\n\n// EvenLevels Computes levels with even distribution.\n//\n// levels: Destination array. levels has 1 row, nLevels columns, and the CV_32SC1 type.\n//\n// nLevels: Number of computed levels. nLevels must be at least 2.\n//\n// lowerLevel: Lower boundary value of the lowest level.\n//\n// upperLevel: Upper boundary value of the greatest level.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga2f2cbd21dc6d7367a7c4ee1a826f389dFor further details, please see:\nfunc EvenLevels(levels *GpuMat, nLevels int, lowerLevel int, upperLevel int) error {\n\treturn OpenCVResult(C.Cuda_EvenLevels(levels.p, C.int(nLevels), C.int(lowerLevel), C.int(upperLevel), nil))\n}\n\n// EvenLevelsWithStream Computes levels with even distribution.\n//\n// levels: Destination array. levels has 1 row, nLevels columns, and the CV_32SC1 type.\n//\n// nLevels: Number of computed levels. nLevels must be at least 2.\n//\n// lowerLevel: Lower boundary value of the lowest level.\n//\n// upperLevel: Upper boundary value of the greatest level.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga2f2cbd21dc6d7367a7c4ee1a826f389dFor further details, please see:\nfunc EvenLevelsWithStream(levels *GpuMat, nLevels int, lowerLevel int, upperLevel int, s Stream) error {\n\treturn OpenCVResult(C.Cuda_EvenLevels(levels.p, C.int(nLevels), C.int(lowerLevel), C.int(upperLevel), s.p))\n}\n\n// HistEven Calculates a histogram with evenly distributed bins.\n//\n// src: Source image. CV_8U, CV_16U, or CV_16S depth and 1 or 4 channels are supported.\n// For a four-channel image, all channels are processed separately.\n//\n// hist: Destination histogram with one row, histSize columns, and the CV_32S type.\n//\n// histSize: Size of the histogram.\n//\n// lowerLevel: Lower boundary of lowest-level bin.\n//\n// upperLevel: Upper boundary of highest-level bin.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#gacd3b14279fb77a57a510cb8c89a1856f\nfunc HistEven(src GpuMat, hist *GpuMat, histSize int, lowerLevel int, upperLevel int) error {\n\treturn OpenCVResult(C.Cuda_HistEven(src.p, hist.p, C.int(histSize), C.int(lowerLevel), C.int(upperLevel), nil))\n}\n\n// HistEvenWithStream Calculates a histogram with evenly distributed bins.\n//\n// src: Source image. CV_8U, CV_16U, or CV_16S depth and 1 or 4 channels are supported.\n// For a four-channel image, all channels are processed separately.\n//\n// hist: Destination histogram with one row, histSize columns, and the CV_32S type.\n//\n// histSize: Size of the histogram.\n//\n// lowerLevel: Lower boundary of lowest-level bin.\n//\n// upperLevel: Upper boundary of highest-level bin.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#gacd3b14279fb77a57a510cb8c89a1856f\nfunc HistEvenWithStream(src GpuMat, hist *GpuMat, histSize int, lowerLevel int, upperLevel int, s Stream) error {\n\treturn OpenCVResult(C.Cuda_HistEven(src.p, hist.p, C.int(histSize), C.int(lowerLevel), C.int(upperLevel), s.p))\n}\n\n// HistRange Calculates a histogram with bins determined by the levels array.\n//\n// src: Source image. CV_8U , CV_16U , or CV_16S depth and 1 or 4 channels are supported.\n// For a four-channel image, all channels are processed separately.\n//\n// hist: Destination histogram with one row, (levels.cols-1) columns, and the CV_32SC1 type.\n//\n// levels: Number of levels in the histogram.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga87819085c1059186d9cdeacd92cea783\nfunc HistRange(src GpuMat, hist *GpuMat, levels GpuMat) error {\n\treturn OpenCVResult(C.Cuda_HistRange(src.p, hist.p, levels.p, nil))\n}\n\n// HistRangeWithStream Calculates a histogram with bins determined by the levels array.\n//\n// src: Source image. CV_8U , CV_16U , or CV_16S depth and 1 or 4 channels are supported.\n// For a four-channel image, all channels are processed separately.\n//\n// hist: Destination histogram with one row, (levels.cols-1) columns, and the CV_32SC1 type.\n//\n// levels: Number of levels in the histogram.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/d0e/group__cudaimgproc__hist.html#ga87819085c1059186d9cdeacd92cea783\nfunc HistRangeWithStream(src GpuMat, hist *GpuMat, levels GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_HistRange(src.p, hist.p, levels.p, s.p))\n}\n\n// BilateralFilter Performs bilateral filtering of passed image.\n//\n// src: Source image. Supports only (channels != 2 && depth() != CV_8S && depth() != CV_32S && depth() != CV_64F).\n//\n// dst: Destination imagwe.\n//\n// kernelSize: Kernel window size.\n//\n// sigmaColor: Filter sigma in the color space.\n//\n// sigmaSpatial: Filter sigma in the coordinate space.\n//\n// borderMode: Border type. See borderInterpolate for details.\n// BorderReflect101 , BorderReplicate , BorderConstant , BorderReflect and BorderWrap are supported for now.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga6abeaecdd4e7edc0bd1393a04f4f20bd\nfunc BilateralFilter(src GpuMat, dst *GpuMat, kernelSize int, sigmaColor float32, sigmaSpatial float32, borderMode BorderType) error {\n\treturn OpenCVResult(C.Cuda_BilateralFilter(src.p, dst.p, C.int(kernelSize), C.float(sigmaColor), C.float(sigmaSpatial), C.int(borderMode), nil))\n}\n\n// BilateralFilterWithStream Performs bilateral filtering of passed image.\n//\n// src: Source image. Supports only (channels != 2 && depth() != CV_8S && depth() != CV_32S && depth() != CV_64F).\n//\n// dst: Destination imagwe.\n//\n// kernelSize: Kernel window size.\n//\n// sigmaColor: Filter sigma in the color space.\n//\n// sigmaSpatial: Filter sigma in the coordinate space.\n//\n// borderMode: Border type. See borderInterpolate for details.\n// BorderReflect101 , BorderReplicate , BorderConstant , BorderReflect and BorderWrap are supported for now.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga6abeaecdd4e7edc0bd1393a04f4f20bd\nfunc BilateralFilterWithStream(src GpuMat, dst *GpuMat, kernelSize int, sigmaColor float32, sigmaSpatial float32, borderMode BorderType, s Stream) error {\n\treturn OpenCVResult(C.Cuda_BilateralFilter(src.p, dst.p, C.int(kernelSize), C.float(sigmaColor), C.float(sigmaSpatial), C.int(borderMode), s.p))\n}\n\n// BlendLinear Performs linear blending of two images.\n//\n// img1: First image. Supports only CV_8U and CV_32F depth.\n//\n// img2: Second image. Must have the same size and the same type as img1 .\n//\n// weights1: Weights for first image. Must have tha same size as img1 . Supports only CV_32F type.\n//\n// weights2: Weights for second image. Must have tha same size as img2 . Supports only CV_32F type.\n//\n// result: Destination image.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga4793607e5729bcc15b27ea33d9fe335e\nfunc BlendLinear(img1 GpuMat, img2 GpuMat, weights1 GpuMat, weights2 GpuMat, result *GpuMat) error {\n\treturn OpenCVResult(C.Cuda_BlendLinear(img1.p, img2.p, weights1.p, weights2.p, result.p, nil))\n}\n\n// BlendLinearWithStream Performs linear blending of two images.\n//\n// img1: First image. Supports only CV_8U and CV_32F depth.\n//\n// img2: Second image. Must have the same size and the same type as img1 .\n//\n// weights1: Weights for first image. Must have tha same size as img1 . Supports only CV_32F type.\n//\n// weights2: Weights for second image. Must have tha same size as img2 . Supports only CV_32F type.\n//\n// result: Destination image.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga4793607e5729bcc15b27ea33d9fe335e\nfunc BlendLinearWithStream(img1 GpuMat, img2 GpuMat, weights1 GpuMat, weights2 GpuMat, result *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.Cuda_BlendLinear(img1.p, img2.p, weights1.p, weights2.p, result.p, s.p))\n}\n\n// MeanShiftFiltering Performs mean-shift filtering for each point of the source image.\n// It maps each point of the source image into another point.\n// As a result, you have a new color and new position of each point.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dst: Destination image containing the color of mapped points. It has the same size and type as src .\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#gae13b3035bc6df0e512d876dbb8c00555\nfunc MeanShiftFiltering(src GpuMat, dst *GpuMat, sp int, sr int, criteria gocv.TermCriteria) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftFiltering(src.p, dst.p, C.int(sp), C.int(sr), C.TermCriteria(criteria.Ptr()), nil))\n}\n\n// MeanShiftFilteringWithStream Performs mean-shift filtering for each point of the source image.\n// It maps each point of the source image into another point.\n// As a result, you have a new color and new position of each point.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dst: Destination image containing the color of mapped points. It has the same size and type as src .\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#gae13b3035bc6df0e512d876dbb8c00555\nfunc MeanShiftFilteringWithStream(src GpuMat, dst *GpuMat, sp int, sr int, criteria gocv.TermCriteria, s Stream) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftFiltering(src.p, dst.p, C.int(sp), C.int(sr), C.TermCriteria(criteria.Ptr()), s.p))\n}\n\n// MeanShiftProc Performs a mean-shift procedure and stores information\n// about processed points (their colors and positions) in two images.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dstr: Destination image containing the color of mapped points. The size and type is the same as src .\n//\n// dstsp: Destination image containing the position of mapped points. The size is the same as src size. The type is CV_16SC2 .\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga6039dc8ecbe2f912bc83fcc9b3bcca39\nfunc MeanShiftProc(src GpuMat, dstr *GpuMat, dstsp *GpuMat, sp int, sr int, criteria gocv.TermCriteria) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftProc(src.p, dstr.p, dstsp.p, C.int(sp), C.int(sr), C.TermCriteria(criteria.Ptr()), nil))\n}\n\n// MeanShiftProcWithStream Performs a mean-shift procedure and stores information\n// about processed points (their colors and positions) in two images.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dstr: Destination image containing the color of mapped points. The size and type is the same as src .\n//\n// dstsp: Destination image containing the position of mapped points. The size is the same as src size. The type is CV_16SC2 .\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga6039dc8ecbe2f912bc83fcc9b3bcca39\nfunc MeanShiftProcWithStream(src GpuMat, dstr *GpuMat, dstsp *GpuMat, sp int, sr int, criteria gocv.TermCriteria, s Stream) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftProc(src.p, dstr.p, dstsp.p, C.int(sp), C.int(sr), C.TermCriteria(criteria.Ptr()), s.p))\n}\n\n// MeanShiftSegmentation Performs a mean-shift segmentation of the source image and eliminates small segments.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dst: Segmented image with the same size and type as src.\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// minsize: Minimum segment size. Smaller segments are merged.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga70ed80533a448829dc48cf22b1845c16\nfunc MeanShiftSegmentation(src GpuMat, dst *GpuMat, sp int, sr int, minSize int, criteria gocv.TermCriteria) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftSegmentation(src.p, dst.p, C.int(sp), C.int(sr), C.int(minSize), C.TermCriteria(criteria.Ptr()), nil))\n}\n\n// MeanShiftSegmentationWithStream Performs a mean-shift segmentation of the source image and eliminates small segments.\n//\n// src: Source image. Only CV_8UC4 images are supported for now.\n//\n// dst: Segmented image with the same size and type as src.\n//\n// sp: Spatial window radius.\n//\n// sr: Color window radius.\n//\n// minsize: Minimum segment size. Smaller segments are merged.\n//\n// criteria: Termination criteria. See TermCriteria.\n//\n// stream: Stream for the asynchronous version.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d05/group__cudaimgproc.html#ga70ed80533a448829dc48cf22b1845c16\nfunc MeanShiftSegmentationWithStream(src GpuMat, dst *GpuMat, sp int, sr int, minSize int, criteria gocv.TermCriteria, s Stream) error {\n\treturn OpenCVResult(C.Cuda_MeanShiftSegmentation(src.p, dst.p, C.int(sp), C.int(sr), C.int(minSize), C.TermCriteria(criteria.Ptr()), s.p))\n}\n"
  },
  {
    "path": "cuda/imgproc.h",
    "content": "#ifndef _OPENCV3_CUDA_IMGPROC_H_\n#define _OPENCV3_CUDA_IMGPROC_H_\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/cudaimgproc.hpp>\n#include <opencv2/cudaarithm.hpp>\nextern \"C\" {\n#endif\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::cuda::CannyEdgeDetector>* CannyEdgeDetector;\ntypedef cv::Ptr<cv::cuda::HoughLinesDetector>* HoughLinesDetector;\ntypedef cv::Ptr<cv::cuda::HoughSegmentDetector>* HoughSegmentDetector;\ntypedef cv::Ptr<cv::cuda::TemplateMatching>* TemplateMatching;\n#else\ntypedef void* CannyEdgeDetector;\ntypedef void* HoughLinesDetector;\ntypedef void* HoughSegmentDetector;\ntypedef void* TemplateMatching;\n#endif\n\n// standalone functions\nOpenCVResult GpuCvtColor(GpuMat src, GpuMat dst, int code, Stream s);\nOpenCVResult GpuDemosaicing(GpuMat src, GpuMat dst, int code, Stream s);\nOpenCVResult AlphaComp(GpuMat img1, GpuMat img2, GpuMat dst, int alpha_op, Stream s);\nOpenCVResult GammaCorrection(GpuMat src, GpuMat dst, bool forward, Stream s);\nOpenCVResult SwapChannels(GpuMat image, int dstOrder[4], Stream s);\nOpenCVResult Cuda_CalcHist(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult Cuda_CalcHist_WithParams(GpuMat src, GpuMat mask, GpuMat dst, Stream s);\nOpenCVResult Cuda_EqualizeHist(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult Cuda_EvenLevels(GpuMat levels, int nLevels, int lowerLevel, int upperLevel, Stream s);\nOpenCVResult Cuda_HistEven(GpuMat src, GpuMat hist, int histSize, int lowerLevel, int upperLevel, Stream s);\nOpenCVResult Cuda_HistRange(GpuMat src, GpuMat hist, GpuMat levels, Stream s);\nOpenCVResult Cuda_BilateralFilter(GpuMat src, GpuMat dst, int kernel_size, float sigma_color, float sigma_spatial, int borderMode, Stream s);\nOpenCVResult Cuda_BlendLinear(GpuMat img1, GpuMat img2, GpuMat weights1, GpuMat weights2, GpuMat result, Stream s);\nOpenCVResult Cuda_MeanShiftFiltering(GpuMat src, GpuMat dst, int sp, int sr, TermCriteria criteria, Stream s);\nOpenCVResult Cuda_MeanShiftProc(GpuMat src, GpuMat dstr, GpuMat dstsp, int sp, int sr, TermCriteria criteria, Stream s);\nOpenCVResult Cuda_MeanShiftSegmentation(GpuMat src, GpuMat dst, int sp, int sr, int minSize, TermCriteria criteria, Stream s);\n\n// CannyEdgeDetector\nCannyEdgeDetector CreateCannyEdgeDetector(double lowThresh, double highThresh);\nCannyEdgeDetector CreateCannyEdgeDetectorWithParams(double lowThresh, double highThresh, int appertureSize, bool L2gradient);\nvoid CannyEdgeDetector_Close(CannyEdgeDetector det);\nOpenCVResult CannyEdgeDetector_Detect(CannyEdgeDetector det, GpuMat img, GpuMat dst, Stream s);\nint CannyEdgeDetector_GetAppertureSize(CannyEdgeDetector det);\ndouble CannyEdgeDetector_GetHighThreshold(CannyEdgeDetector det);\nbool CannyEdgeDetector_GetL2Gradient(CannyEdgeDetector det);\ndouble CannyEdgeDetector_GetLowThreshold(CannyEdgeDetector det);\nvoid CannyEdgeDetector_SetAppertureSize(CannyEdgeDetector det, int appertureSize);\nvoid CannyEdgeDetector_SetHighThreshold(CannyEdgeDetector det, double highThresh);\nvoid CannyEdgeDetector_SetL2Gradient(CannyEdgeDetector det, bool L2gradient);\nvoid CannyEdgeDetector_SetLowThreshold(CannyEdgeDetector det, double lowThresh);\n\n// HoughLinesDetector\nHoughLinesDetector HoughLinesDetector_Create(double rho, double theta, int threshold);\nHoughLinesDetector HoughLinesDetector_CreateWithParams(double rho, double theta, int threshold, bool sort, int maxlines);\nvoid HoughLinesDetector_Close(HoughLinesDetector hld);\nOpenCVResult HoughLinesDetector_Detect(HoughLinesDetector hld, GpuMat img, GpuMat dst, Stream s);\n\n// HoughSegmentDetector\nHoughSegmentDetector HoughSegmentDetector_Create(double rho, double theta, int minLineLength, int maxLineGap);\nvoid HoughSegmentDetector_Close(HoughSegmentDetector hsd);\nOpenCVResult HoughSegmentDetector_Detect(HoughSegmentDetector hsd, GpuMat img, GpuMat dst, Stream s);\n\n// TemplateMatching\nTemplateMatching TemplateMatching_Create(int srcType, int method);\nvoid TemplateMatching_Close(TemplateMatching tm);\nOpenCVResult TemplateMatching_Match(TemplateMatching tm, GpuMat img, GpuMat tmpl, GpuMat dst, Stream s);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDA_IMGPROC_H_\n"
  },
  {
    "path": "cuda/imgproc_alphacomptypes.go",
    "content": "package cuda\n\ntype AlphaCompTypes int\n\nconst (\n\tAlphaCompTypeOver AlphaCompTypes = iota\n\tAlphaCompTypeIn\n\tAlphaCompTypeOut\n\tAlphaCompTypeAtop\n\tAlphaCompTypeXor\n\tAlphaCompTypePlus\n\tAlphaCompTypeOverPremul\n\tAlphaCompTypeInPremul\n\tAlphaCompTypeOutPremul\n\tAlphaCompTypeAtopPremul\n\tAlphaCompTypeXorPremul\n\tAlphaCompTypePlusPremul\n\tAlphaCompTypePremul\n)\n"
  },
  {
    "path": "cuda/imgproc_test.go",
    "content": "package cuda\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\t\"testing\"\n\n\t\"github.com/pascaldekloe/goe/verify\"\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestCanny_Detect(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Canny test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tdetector := NewCannyEdgeDetector(50, 100)\n\tdefer detector.Close()\n\n\tcimg.Upload(src)\n\tdetector.Detect(cimg, &dimg)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty Canny test\")\n\t}\n\tif src.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid Canny test rows\")\n\t}\n\tif src.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Canny test cols\")\n\t}\n}\n\nfunc TestHoughLines_Calc(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughLines test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer mimg.Close()\n\tdefer dimg.Close()\n\n\tcanny := NewCannyEdgeDetector(100, 200)\n\tdefer canny.Close()\n\n\tdetector := NewHoughLinesDetectorWithParams(1, math.Pi/180, 50, true, 4096)\n\tdefer detector.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.Upload(src)\n\tcanny.Detect(cimg, &mimg)\n\tdetector.Detect(mimg, &dimg)\n\tdimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLines test\")\n\t}\n\n\tif dest.Rows() != 2 {\n\t\tt.Errorf(\"Invalid HoughLines test rows: %v\", dest.Rows())\n\t}\n\n\texpected := map[float32]float32{\n\t\t21:  1.5707964,\n\t\t337: 0.034906585,\n\t\t85:  1.5707964,\n\t\t276: 0,\n\t\t329: 0.034906585,\n\t}\n\n\tactual := make(map[float32]float32)\n\tfor i := 0; i < dest.Cols(); i += 2 {\n\t\tactual[dest.GetFloatAt(0, i)] = dest.GetFloatAt(0, i+1)\n\t}\n\n\tfor k, v := range expected {\n\t\ts32 := strconv.FormatFloat(float64(k), 'f', -1, 32)\n\t\tverify.Values(t, s32, actual[k], v)\n\t}\n}\n\nfunc TestHoughLines_CalcWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughLines test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer mimg.Close()\n\tdefer dimg.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tcanny := NewCannyEdgeDetector(100, 200)\n\tdefer canny.Close()\n\n\tdetector := NewHoughLinesDetectorWithParams(1, math.Pi/180, 50, true, 4096)\n\tdefer detector.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, stream)\n\tcanny.DetectWithStream(cimg, &mimg, stream)\n\tdetector.DetectWithStream(mimg, &dimg, stream)\n\tdimg.DownloadWithStream(&dest, stream)\n\n\tstream.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLines test\")\n\t}\n\n\tif dest.Rows() != 2 {\n\t\tt.Errorf(\"Invalid HoughLines test rows: %v\", dest.Rows())\n\t}\n\n\texpected := map[float32]float32{\n\t\t21:  1.5707964,\n\t\t337: 0.034906585,\n\t\t85:  1.5707964,\n\t\t276: 0,\n\t\t329: 0.034906585,\n\t}\n\n\tactual := make(map[float32]float32)\n\tfor i := 0; i < dest.Cols(); i += 2 {\n\t\tactual[dest.GetFloatAt(0, i)] = dest.GetFloatAt(0, i+1)\n\t}\n\n\tfor k, v := range expected {\n\t\ts32 := strconv.FormatFloat(float64(k), 'f', -1, 32)\n\t\tverify.Values(t, s32, actual[k], v)\n\t}\n}\n\nfunc TestHoughSegment_Calc(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughSegment test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer mimg.Close()\n\tdefer dimg.Close()\n\n\tcanny := NewCannyEdgeDetector(50, 100)\n\tdefer canny.Close()\n\n\tdetector := NewHoughSegmentDetector(1, math.Pi/180, 150, 50)\n\tdefer detector.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.Upload(src)\n\tcanny.Detect(cimg, &mimg)\n\tdetector.Detect(mimg, &dimg)\n\tfimg := dimg.Reshape(0, dimg.Cols())\n\tdefer fimg.Close()\n\tfimg.Download(&dest)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughSegment test\")\n\t}\n\n\tif dest.Rows() != 5 {\n\t\tt.Errorf(\"Invalid HoughSegment test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughSegment test cols: %v\", dest.Cols())\n\t}\n\n\ttype point struct {\n\t\tX, Y int32\n\t}\n\n\texpected := map[point]point{\n\t\t{1, 21}:   {398, 21},\n\t\t{304, 21}: {10, 315},\n\t}\n\n\tactual := make(map[point]point)\n\tfor i := 0; i < dest.Rows(); i += 4 {\n\t\tactual[point{dest.GetVeciAt(i, 0)[0], dest.GetVeciAt(i, 0)[1]}] =\n\t\t\tpoint{dest.GetVeciAt(i, 0)[2], dest.GetVeciAt(i, 0)[3]}\n\t}\n\n\tfor k, v := range expected {\n\t\tverify.Values(t, fmt.Sprintf(\"%d %d\", k.X, k.Y), actual[k], v)\n\t}\n}\n\nfunc TestHoughSegment_CalcWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadGrayScale)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughSegment test\")\n\t}\n\tdefer src.Close()\n\n\tcimg, mimg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer mimg.Close()\n\tdefer dimg.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tcanny := NewCannyEdgeDetector(50, 100)\n\tdefer canny.Close()\n\n\tdetector := NewHoughSegmentDetector(1, math.Pi/180, 150, 50)\n\tdefer detector.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tcimg.UploadWithStream(src, stream)\n\tcanny.DetectWithStream(cimg, &mimg, stream)\n\tdetector.DetectWithStream(mimg, &dimg, stream)\n\tfimg := dimg.Reshape(0, dimg.Cols())\n\tdefer fimg.Close()\n\tfimg.DownloadWithStream(&dest, stream)\n\n\tstream.WaitForCompletion()\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughSegment test\")\n\t}\n\n\tif dest.Rows() != 5 {\n\t\tt.Errorf(\"Invalid HoughSegment test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughSegment test cols: %v\", dest.Cols())\n\t}\n\n\ttype point struct {\n\t\tX, Y int32\n\t}\n\n\texpected := map[point]point{\n\t\t{1, 21}:   {398, 21},\n\t\t{304, 21}: {10, 315},\n\t}\n\n\tactual := make(map[point]point)\n\tfor i := 0; i < dest.Rows(); i += 4 {\n\t\tactual[point{dest.GetVeciAt(i, 0)[0], dest.GetVeciAt(i, 0)[1]}] =\n\t\t\tpoint{dest.GetVeciAt(i, 0)[2], dest.GetVeciAt(i, 0)[3]}\n\t}\n\n\tfor k, v := range expected {\n\t\tverify.Values(t, fmt.Sprintf(\"%d %d\", k.X, k.Y), actual[k], v)\n\t}\n}\n\nfunc TestTemplateMatching_Match(t *testing.T) {\n\timgScene := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadGrayScale)\n\tif imgScene.Empty() {\n\t\tt.Error(\"Invalid read of face.jpg in MatchTemplate test\")\n\t}\n\tdefer imgScene.Close()\n\n\timgTemplate := gocv.IMRead(\"../images/toy.jpg\", gocv.IMReadGrayScale)\n\tif imgTemplate.Empty() {\n\t\tt.Error(\"Invalid read of toy.jpg in MatchTemplate test\")\n\t}\n\tdefer imgTemplate.Close()\n\n\tcimg, timg, dimg := NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer timg.Close()\n\tdefer dimg.Close()\n\n\tdest := gocv.NewMat()\n\tdefer dest.Close()\n\n\tmatcher := NewTemplateMatching(gocv.MatTypeCV8U, gocv.TmSqdiff)\n\tdefer matcher.Close()\n\n\tcimg.Upload(imgScene)\n\ttimg.Upload(imgTemplate)\n\tmatcher.Match(cimg, timg, &dimg)\n\tdimg.Download(&dest)\n\n\t_, maxConfidence, _, _ := gocv.MinMaxLoc(dest)\n\tif maxConfidence < 0.95 {\n\t\tt.Errorf(\"Max confidence of %f is too low. MatchTemplate could not find template in scene.\", maxConfidence)\n\t}\n}\n\nfunc TestDemosaicing(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Demosaicing test\")\n\t}\n\tdefer img.Close()\n\n\tpatterns := map[string]gocv.ColorConversionCode{\n\t\t\"bg\": gocv.ColorBayerBGToBGR,\n\t\t\"gb\": gocv.ColorBayerGBToBGR,\n\t\t\"rg\": gocv.ColorBayerRGToBGR,\n\t\t\"gr\": gocv.ColorBayerGRToBGR,\n\t}\n\n\tfor pattern, code := range patterns {\n\t\tbayerImg, err := NewBayerFromMat(img, pattern)\n\t\tif bayerImg.Empty() {\n\t\t\tt.Error(\"Invalid conversion from Mat to Bayer in Demosaicing test\")\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\n\t\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\t\tcimg.Upload(bayerImg)\n\n\t\tdest := gocv.NewMat()\n\n\t\tDemosaicing(cimg, &dimg, code)\n\n\t\tdimg.Download(&dest)\n\t\tif dest.Empty() || bayerImg.Rows() != dest.Rows() || bayerImg.Cols() != dest.Cols() {\n\t\t\tt.Error(\"Invalid convert in Demosaicing test\")\n\t\t}\n\n\t\tbayerImg.Close()\n\t\tcimg.Close()\n\t\tdimg.Close()\n\t\tdest.Close()\n\t}\n}\n\nfunc TestDemosaicing_WithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/face.jpg\", gocv.IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Demosaicing test\")\n\t}\n\tdefer img.Close()\n\n\tpatterns := map[string]gocv.ColorConversionCode{\n\t\t\"bg\": gocv.ColorBayerBGToBGR,\n\t\t\"gb\": gocv.ColorBayerGBToBGR,\n\t\t\"rg\": gocv.ColorBayerRGToBGR,\n\t\t\"gr\": gocv.ColorBayerGRToBGR,\n\t}\n\n\tfor pattern, code := range patterns {\n\t\tstream := NewStream()\n\n\t\tbayerImg, err := NewBayerFromMat(img, pattern)\n\t\tif bayerImg.Empty() {\n\t\t\tt.Error(\"Invalid conversion from Mat to Bayer in DemosaicingWithStream test\")\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\n\t\tcimg, dimg := NewGpuMat(), NewGpuMat()\n\t\tdest := gocv.NewMat()\n\n\t\tcimg.UploadWithStream(bayerImg, stream)\n\t\tDemosaicingWithStream(cimg, &dimg, code, stream)\n\t\tdimg.DownloadWithStream(&dest, stream)\n\n\t\tstream.WaitForCompletion()\n\n\t\tif dest.Empty() || bayerImg.Rows() != dest.Rows() || bayerImg.Cols() != dest.Cols() {\n\t\t\tt.Error(\"Invalid convert in DemosaicingWithStream test\")\n\t\t}\n\n\t\tbayerImg.Close()\n\t\tcimg.Close()\n\t\tdimg.Close()\n\t\tdest.Close()\n\t\tstream.Close()\n\t}\n}\n\nfunc NewBayerFromMat(src gocv.Mat, pattern string) (gocv.Mat, error) {\n\tdest := gocv.NewMatWithSize(src.Rows(), src.Cols(), gocv.MatTypeCV8UC1)\n\n\tswitch pattern {\n\tcase \"bg\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"gb\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"rg\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"gr\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tdest.Close()\n\t\treturn gocv.Mat{}, fmt.Errorf(\"invalid pattern: %s\", pattern)\n\t}\n\n\treturn dest, nil\n}\n\nfunc TestAlphaComp(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatFromMat(converted)\n\tdefer m2.Close()\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\tAlphaComp(m1, m2, &dst, AlphaCompTypeOver)\n\n}\n\nfunc TestAlphaCompWithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatFromMat(converted)\n\tdefer m2.Close()\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tAlphaCompWithStream(m1, m2, &dst, AlphaCompTypeOver, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestGammaCorrection(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\tGammaCorrection(m1, &dst, true)\n\n}\n\nfunc TestGammaCorrectionWithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\tdst := NewGpuMat()\n\tdefer dst.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tGammaCorrectionWithStream(m1, &dst, true, s)\n\ts.WaitForCompletion()\n\n}\n\nfunc TestSwapChannels(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\tSwapChannels(&m1, []int{3, 2, 1, 0})\n\n}\n\nfunc TestSwapChannelsWithStream(t *testing.T) {\n\timg := gocv.IMRead(\"../images/box.png\", gocv.IMReadUnchanged)\n\tdefer img.Close()\n\n\tconverted := gocv.NewMat()\n\tdefer converted.Close()\n\n\tgocv.CvtColor(img, &converted, gocv.ColorRGBAToBGRA)\n\n\tm1 := NewGpuMatFromMat(converted)\n\tdefer m1.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tSwapChannelsWithStream(&m1, []int{3, 2, 1, 0}, s)\n\ts.WaitForCompletion()\n\n}\n\nfunc TestCalcHist(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\tCalcHist(m1, &m2)\n\tCalcHistWithParams(m1, m1, &m2, Stream{})\n}\n\nfunc TestCalcHistWithStream(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\ts1 := NewStream()\n\tdefer s1.Close()\n\n\tCalcHistWithStream(m1, &m2, s)\n\tCalcHistWithParams(m1, m1, &m2, s1)\n\n\ts.WaitForCompletion()\n\ts1.WaitForCompletion()\n}\n\nfunc TestEqualizeHist(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\tEqualizeHist(m1, &m2)\n}\n\nfunc TestEqualizeHistWithStream(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tEqualizeHistWithStream(m1, &m2, s)\n\ts.WaitForCompletion()\n\n}\n\nfunc TestEvenLevels(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tEvenLevels(&m1, 2, 1, 2)\n}\n\nfunc TestEvenLevelsWithStream(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tEvenLevelsWithStream(&m1, 2, 1, 2, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestHistEven(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\tHistEven(m1, &m2, 256, 1, 2)\n}\n\nfunc TestHistEvenWithStream(t *testing.T) {\n\tm1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer m1.Close()\n\n\tm2 := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer m2.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tHistEvenWithStream(m1, &m2, 256, 1, 2, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestHistRange(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\n\tlevels := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer levels.Close()\n\n\thist := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer hist.Close()\n\n\tHistRange(src, &hist, levels)\n}\n\nfunc TestHistRangeWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\n\tlevels := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer levels.Close()\n\n\thist := NewGpuMatWithSize(1, 256, gocv.MatTypeCV32SC1)\n\tdefer hist.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tHistRangeWithStream(src, &hist, levels, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestBilateralFilter(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32SC1)\n\tdefer dst.Close()\n\n\tBilateralFilter(src, &dst, 1, 2.2, 3.3, BorderDefault)\n}\n\nfunc TestBilateralFilterWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32SC1)\n\tdefer dst.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tBilateralFilterWithStream(src, &dst, 1, 2.2, 3.3, BorderDefault, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestBlendLinear(t *testing.T) {\n\timg1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer img1.Close()\n\n\timg2 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer img2.Close()\n\n\tresult := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer result.Close()\n\n\tweights1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32FC1)\n\tdefer weights1.Close()\n\n\tweights2 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32FC1)\n\tdefer weights2.Close()\n\n\tBlendLinear(img1, img2, weights1, weights2, &result)\n\n}\n\nfunc TestBlendLinearWithStream(t *testing.T) {\n\timg1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer img1.Close()\n\n\timg2 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer img2.Close()\n\n\tresult := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC1)\n\tdefer result.Close()\n\n\tweights1 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32FC1)\n\tdefer weights1.Close()\n\n\tweights2 := NewGpuMatWithSize(256, 256, gocv.MatTypeCV32FC1)\n\tdefer weights2.Close()\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tBlendLinearWithStream(img1, img2, weights1, weights2, &result, s)\n\ts.WaitForCompletion()\n\n}\nfunc TestMeanShiftFiltering(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dst.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\tMeanShiftFiltering(src, &dst, 1, 2, criteria)\n}\n\nfunc TestMeanShiftFilteringWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dst.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tMeanShiftFilteringWithStream(src, &dst, 1, 2, criteria, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestMeanShiftProc(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdstr := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dstr.Close()\n\n\tdstsp := NewGpuMatWithSize(256, 256, gocv.MatTypeCV16SC2)\n\tdefer dstsp.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\tMeanShiftProc(src, &dstr, &dstsp, 1, 2, criteria)\n}\n\nfunc TestMeanShiftProcWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdstr := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dstr.Close()\n\n\tdstsp := NewGpuMatWithSize(256, 256, gocv.MatTypeCV16SC2)\n\tdefer dstsp.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tMeanShiftProcWithStream(src, &dstr, &dstsp, 1, 2, criteria, s)\n\ts.WaitForCompletion()\n}\n\nfunc TestMeanShiftSegmentation(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dst.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\tMeanShiftSegmentation(src, &dst, 1, 2, 3, criteria)\n}\n\nfunc TestMeanShiftSegmentationWithStream(t *testing.T) {\n\tsrc := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer src.Close()\n\n\tdst := NewGpuMatWithSize(256, 256, gocv.MatTypeCV8UC4)\n\tdefer dst.Close()\n\n\tcriteria := gocv.NewTermCriteria(gocv.Count, 1, 2.2)\n\n\ts := NewStream()\n\tdefer s.Close()\n\n\tMeanShiftSegmentationWithStream(src, &dst, 1, 2, 3, criteria, s)\n\ts.WaitForCompletion()\n}\n"
  },
  {
    "path": "cuda/objdetect.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_objdetect)\n\n#include \"../core.h\"\n#include \"cuda.h\"\n#include \"objdetect.h\"\n\n// CascadeClassifier_GPU\n\nCascadeClassifier_GPU CascadeClassifier_GPU_Create(const char*  cascade_name) {\n    try {\n        return new cv::Ptr<cv::cuda::CascadeClassifier>(cv::cuda::CascadeClassifier::create(cascade_name));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nstruct Rects CascadeClassifier_GPU_DetectMultiScale(CascadeClassifier_GPU cs, GpuMat img) {\n    try {\n        std::vector<cv::Rect> detected;\n        cv::cuda::GpuMat objbuf;\n        \n        (*cs)->detectMultiScale(*img, objbuf); // uses all default parameters\n        (*cs)->convert(objbuf, detected);\n        \n        Rect* rects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\n// HOG\n\nHOG HOG_Create() {\n    try {\n        return new cv::Ptr<cv::cuda::HOG>(cv::cuda::HOG::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nHOG HOG_CreateWithParams(Size winSize, Size blockSize, Size blockStride, Size cellSize, int nbins) {\n    try {\n        cv::Size winSz(winSize.width, winSize.height);\n        cv::Size blockSz(blockSize.width, blockSize.height);\n        cv::Size blockSt(blockStride.width, blockStride.height);\n        cv::Size cellSz(cellSize.width, cellSize.height);\n    \n        return new cv::Ptr<cv::cuda::HOG>(cv::cuda::HOG::create(winSz, blockSz, blockSt, cellSz, nbins));    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nstruct Rects HOG_DetectMultiScale(HOG hog, GpuMat img) {    \n    try {\n        std::vector<cv::Rect> detected;    \n        (*hog)->detectMultiScale(*img, detected);\n    \n        Rect* rects = new Rect[detected.size()];\n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\nGpuMat HOG_Compute(HOG hog, GpuMat img) {    \n    try {\n        GpuMat dst = new cv::cuda::GpuMat();\n        (*hog)->compute(*img, *dst);\n    \n        return dst;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nMat HOG_GetPeopleDetector(HOG hog) {\n    try {\n        return new cv::Mat((*hog)->getDefaultPeopleDetector());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nvoid HOG_SetSVMDetector(HOG hog, Mat det) {\n    try {\n        (*hog)->setSVMDetector(*det);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint HOG_GetDescriptorFormat(HOG hog) {\n    try {\n        return int((*hog)->getDescriptorFormat());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nsize_t HOG_GetBlockHistogramSize(HOG hog) {\n    try {\n        return size_t((*hog)->getBlockHistogramSize());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nsize_t HOG_GetDescriptorSize(HOG hog) {\n    try {\n        return size_t((*hog)->getDescriptorSize());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nbool HOG_GetGammaCorrection(HOG hog) {\n    try {\n        return bool((*hog)->getGammaCorrection());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nint HOG_GetGroupThreshold(HOG hog) {\n    try {\n        return int((*hog)->getGroupThreshold());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\ndouble HOG_GetHitThreshold(HOG hog) {\n    try {\n        return double((*hog)->getHitThreshold());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\ndouble HOG_GetL2HysThreshold(HOG hog) {\n    try {\n        return double((*hog)->getL2HysThreshold());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nint HOG_GetNumLevels(HOG hog) {\n    try {\n        return int((*hog)->getNumLevels());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\ndouble HOG_GetScaleFactor(HOG hog) {\n    try {\n        return double((*hog)->getScaleFactor());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\ndouble HOG_GetWinSigma(HOG hog) {\n    try {\n        return double((*hog)->getWinSigma());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nstruct Size HOG_GetWinStride(HOG hog) {\n    try {\n        cv::Size sz = (*hog)->getWinStride();\n        Size size = {sz.width, sz.height};\n        return size;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Size size = {0, 0};\n        return size;\n    }\n}\n\nvoid HOG_SetDescriptorFormat(HOG hog, int descrFormat) {\n    try {\n        auto df = static_cast<cv::HOGDescriptor::DescriptorStorageFormat>(descrFormat); \n        (*hog)->setDescriptorFormat(df);   \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetGammaCorrection(HOG hog, bool gammaCorrection) {\n    try {\n        (*hog)->setGammaCorrection(gammaCorrection);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetGroupThreshold(HOG hog, int groupThreshold) {\n    try {\n        (*hog)->setGroupThreshold(groupThreshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetHitThreshold(HOG hog, double hitThreshold) {\n    try {\n        (*hog)->setHitThreshold(hitThreshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetL2HysThreshold(HOG hog, double thresholdL2hys) {\n    try {\n        (*hog)->setL2HysThreshold(thresholdL2hys);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetNumLevels(HOG hog, int nlevels) {\n    try {\n        (*hog)->setNumLevels(nlevels);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetScaleFactor(HOG hog, double scale0) {\n    try {\n        (*hog)->setScaleFactor(scale0);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetWinSigma(HOG hog, double winSigma) {\n    try {\n        (*hog)->setWinSigma(winSigma);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid HOG_SetWinStride(HOG hog, Size dsize) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        (*hog)->setWinStride(sz);    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/objdetect.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_objdetect)\n\n// Package cuda is the GoCV wrapper around OpenCV cuda.\n//\n// For further details, please see:\n// https://github.com/opencv/c\n//\n// import \"gocv.io/x/gocv/cuda\"\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"../core.h\"\n#include \"objdetect.h\"\n#include \"core.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n)\n\ntype DescriptorStorageFormat int\n\nconst (\n\tDESCR_FORMAT_COL_BY_COL DescriptorStorageFormat = 0\n\n\tDESCR_FORMAT_COL_BY_ROW DescriptorStorageFormat = 1\n)\n\n// CascadeClassifier_GPU is a cascade classifier class for object detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d80/classcv_1_1cuda_1_1CascadeClassifier.html\ntype CascadeClassifier struct {\n\tp unsafe.Pointer\n}\n\n// NewCascadeClassifier_GPU returns a new CascadeClassifier.\nfunc NewCascadeClassifier(name string) CascadeClassifier {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn CascadeClassifier{p: unsafe.Pointer(C.CascadeClassifier_GPU_Create(cName))}\n}\n\n// DetectMultiScale detects objects of different sizes in the input Mat image.\n// The detected objects are returned as a slice of image.Rectangle structs.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d9/d80/classcv_1_1cuda_1_1CascadeClassifier.html#a182656b878046eb3f0e9c0f0ee327f08\nfunc (c *CascadeClassifier) DetectMultiScale(img GpuMat) []image.Rectangle {\n\tret := C.CascadeClassifier_GPU_DetectMultiScale(C.CascadeClassifier_GPU(c.p), img.p)\n\tdefer C.GpuRects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// HOG is a Histogram Of Gradiants (HOG) for object detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOG.html#a723b95b709cfd3f95cf9e616de988fc8\ntype HOG struct {\n\tp unsafe.Pointer\n}\n\n// NewHOG returns a new HOG.\nfunc CreateHOG() HOG {\n\treturn HOG{p: unsafe.Pointer(C.HOG_Create())}\n}\n\nfunc CreateHOGWithParams(winSize, blockSize, blockStride, cellSize image.Point, nbins int) HOG {\n\twSz := C.struct_Size{\n\t\twidth:  C.int(winSize.X),\n\t\theight: C.int(winSize.Y),\n\t}\n\n\tbSz := C.struct_Size{\n\t\twidth:  C.int(blockSize.X),\n\t\theight: C.int(blockSize.Y),\n\t}\n\n\tbSt := C.struct_Size{\n\t\twidth:  C.int(blockStride.X),\n\t\theight: C.int(blockStride.Y),\n\t}\n\n\tcSz := C.struct_Size{\n\t\twidth:  C.int(cellSize.X),\n\t\theight: C.int(cellSize.Y),\n\t}\n\n\treturn HOG{p: unsafe.Pointer(C.HOG_CreateWithParams(wSz, bSz, bSt, cSz, C.int(nbins)))}\n}\n\n// Compute returns block descriptors computed for the whole image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#ab4287267081959ec77c01269dbfcd373\nfunc (h *HOG) Compute(img GpuMat) GpuMat {\n\treturn newGpuMat(C.HOG_Compute(C.HOG(h.p), img.p))\n}\n\n// DetectMultiScale detects objects in the input Mat image.\n// The detected objects are returned as a slice of image.Rectangle structs.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOG.html#a660e5cd036fd5ddf0f5767b352acd948\nfunc (h *HOG) DetectMultiScale(img GpuMat) []image.Rectangle {\n\tret := C.HOG_DetectMultiScale(C.HOG(h.p), img.p)\n\tdefer C.GpuRects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// GetDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a016f9ffced8b2f4b20bdd06a775017d1\nfunc (h *HOG) GetDefaultPeopleDetector() C.Mat {\n\treturn C.Mat(C.HOG_GetPeopleDetector(C.HOG(h.p)))\n}\n\n// SetSVMDetector sets the data for the HOG.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a5d12db2277b7c3c849d75258eec8d1d4\nfunc (h *HOG) SetSVMDetector(det C.Mat) error {\n\tC.HOG_SetSVMDetector(C.HOG(h.p), det)\n\treturn nil\n}\n\n// GetDescriptorFormat\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#adad29ed960a953aa13dc59c410683620\nfunc (h *HOG) GetDescriptorFormat() DescriptorStorageFormat {\n\treturn DescriptorStorageFormat(C.HOG_GetDescriptorFormat(C.HOG(h.p)))\n}\n\n// GetBlockHistogramSize returns the block histogram size.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a016f9ffced8b2f4b20bdd06a775017d1\nfunc (h *HOG) GetBlockHistogramSize() int {\n\treturn int(C.HOG_GetBlockHistogramSize(C.HOG(h.p)))\n}\n\n// GetDescriptorFormat returns the number of coefficients required for the classification.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#adb8c714cba1a025b8869d5a0e152f824\nfunc (h *HOG) GetDescriptorSize() int {\n\treturn int(C.HOG_GetDescriptorSize(C.HOG(h.p)))\n}\n\n// GetGammaCorrection\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a7032eed27cf7a004b727a6e522c2404e\nfunc (h *HOG) GetGammaCorrection() bool {\n\treturn bool(C.HOG_GetGammaCorrection(C.HOG(h.p)))\n}\n\n// GetGroupThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a7032eed27cf7a004b727a6e522c2404e\nfunc (h *HOG) GetGroupThreshold() int {\n\treturn int(C.HOG_GetGroupThreshold(C.HOG(h.p)))\n}\n\n// GetHitThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#ae0de149980ea47fbd39b7766df565b27\nfunc (h *HOG) GetHitThreshold() float64 {\n\treturn float64(C.HOG_GetHitThreshold(C.HOG(h.p)))\n}\n\n// GetL2HysThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a6853c9a66889fed996678f7972df9660\nfunc (h *HOG) GetL2HysThreshold() float64 {\n\treturn float64(C.HOG_GetL2HysThreshold(C.HOG(h.p)))\n}\n\n// GetNumLevels\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a15238eb6f52a1ddeedd015773c46efd8\nfunc (h *HOG) GetNumLevels() int {\n\treturn int(C.HOG_GetNumLevels(C.HOG(h.p)))\n}\n\n// GetScaleFactor\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a89c59564625bb2c691af8c2cf49aab9e\nfunc (h *HOG) GetScaleFactor() float64 {\n\treturn float64(C.HOG_GetScaleFactor(C.HOG(h.p)))\n}\n\n// GetWinSigma\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a22d03fa05b251b4f19cfa1fab36e754e\nfunc (h *HOG) GetWinSigma() float64 {\n\treturn float64(C.HOG_GetWinSigma(C.HOG(h.p)))\n}\n\n// GetWinStride\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a6c63504790b51963ca33496a0b039b48\nfunc (h *HOG) GetWinStride() image.Point {\n\tsz := C.HOG_GetWinStride(C.HOG(h.p))\n\treturn image.Pt(int(sz.width), int(sz.height))\n}\n\n// SetDescriptorFormat\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a6e3e1075a567268f2dfb2151b1c99cb6\nfunc (h *HOG) SetDescriptorFormat(descrFormat DescriptorStorageFormat) {\n\tC.HOG_SetDescriptorFormat(C.HOG(h.p), C.int(descrFormat))\n}\n\n// SetGammaCorrection\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a0eb2f1ecf59ccc599bffac3a0a55562f\nfunc (h *HOG) SetGammaCorrection(gammaCorrection bool) {\n\tC.HOG_SetGammaCorrection(C.HOG(h.p), C.bool(gammaCorrection))\n}\n\n// SetGroupThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#adad9af4e4ed0e0a045a70cd44520eefd\nfunc (h *HOG) SetGroupThreshold(groupThreshold int) {\n\tC.HOG_SetGroupThreshold(C.HOG(h.p), C.int(groupThreshold))\n}\n\n// SetHitThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a8b623393c11d18b89fa373269b97aea4\nfunc (h *HOG) SetHitThreshold(hitThreshold float64) {\n\tC.HOG_SetHitThreshold(C.HOG(h.p), C.double(hitThreshold))\n}\n\n// SetL2HysThreshold\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a30e5c88864fff774f403313993947d62\nfunc (h *HOG) SetL2HysThreshold(thresholdL2hys float64) {\n\tC.HOG_SetL2HysThreshold(C.HOG(h.p), C.double(thresholdL2hys))\n}\n\n// SetNumLevels\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a7602088f3e792de196f8f7efcd9bd448\nfunc (h *HOG) SetNumLevels(nlevels int) {\n\tC.HOG_SetNumLevels(C.HOG(h.p), C.int(nlevels))\n}\n\n// SetScaleFactor\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a21dc5e3dc6272030694d52e83352b337\nfunc (h *HOG) SetScaleFactor(scale0 float64) {\n\tC.HOG_SetScaleFactor(C.HOG(h.p), C.double(scale0))\n}\n\n// SetWinSigma\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#ab291779ff8ac649174b102f64c5f9012\nfunc (h *HOG) SetWinSigma(winSigma float64) {\n\tC.HOG_SetWinSigma(C.HOG(h.p), C.double(winSigma))\n}\n\n// SetWinStride\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/da6/classcv_1_1cuda_1_1HOG.html#a5e74646651209ae13f1b3dd18179773f\nfunc (h *HOG) SetWinStride(sz image.Point) {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\tC.HOG_SetWinStride(C.HOG(h.p), pSize)\n\treturn\n}\n"
  },
  {
    "path": "cuda/objdetect.h",
    "content": "#ifndef _OPENCV3_GPU_H_\n#define _OPENCV3_GPU_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/core/cuda.hpp>\n#include <opencv2/cudaobjdetect.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::cuda::CascadeClassifier>* CascadeClassifier_GPU;\ntypedef cv::Ptr<cv::cuda::HOG>* HOG;\n#else\ntypedef void* CascadeClassifier_GPU;\ntypedef void* HOG;\n#endif\n\n// CascadeClassifier\nCascadeClassifier_GPU CascadeClassifier_GPU_Create(const char*  cascade_name);\nstruct Rects CascadeClassifier_GPU_DetectMultiScale(CascadeClassifier_GPU cs, GpuMat img);\n\n// HOG\nHOG HOG_Create();\nHOG HOG_CreateWithParams(Size winSize, Size blockSize, Size blockStride, Size cellSize, int nbins);\nstruct Rects HOG_DetectMultiScale(HOG hog, GpuMat img);\nGpuMat HOG_Compute(HOG hog, GpuMat img);\nMat HOG_GetPeopleDetector(HOG hog);\nvoid HOG_SetSVMDetector(HOG hog, Mat det);\nint HOG_GetDescriptorFormat(HOG hog);\nsize_t HOG_GetBlockHistogramSize(HOG hog);\nsize_t HOG_GetDescriptorSize(HOG hog);\nbool HOG_GetGammaCorrection(HOG hog);\nint HOG_GetGroupThreshold(HOG hog);\ndouble HOG_GetHitThreshold(HOG hog);\ndouble HOG_GetL2HysThreshold(HOG hog);\nint HOG_GetNumLevels(HOG hog);\ndouble HOG_GetScaleFactor(HOG hog);\ndouble HOG_GetWinSigma(HOG hog);\nstruct Size HOG_GetWinStride(HOG hog);\nvoid HOG_SetDescriptorFormat(HOG hog, int descrFormat);\nvoid HOG_SetGammaCorrection(HOG hog, bool gammaCorrection);\nvoid HOG_SetGroupThreshold(HOG hog, int groupThreshold);\nvoid HOG_SetHitThreshold(HOG hog, double hitThreshold);\nvoid HOG_SetL2HysThreshold(HOG hog, double thresholdL2hys);\nvoid HOG_SetNumLevels(HOG hog, int nlevels);\nvoid HOG_SetScaleFactor(HOG hog, double scale0);\nvoid HOG_SetWinSigma(HOG hog, double winSigma);\nvoid HOG_SetWinStride(HOG hog, Size dsize);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_GPU_H_\n"
  },
  {
    "path": "cuda/optflow.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_optflow)\n\n#include \"optflow.h\"\n\nCudaSparsePyrLKOpticalFlow CudaSparsePyrLKOpticalFlow_Create() {\n    try {\n        return new cv::Ptr<cv::cuda::SparsePyrLKOpticalFlow>(cv::cuda::SparsePyrLKOpticalFlow::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nOpenCVResult CudaSparsePyrLKOpticalFlow_Calc(CudaSparsePyrLKOpticalFlow p, GpuMat prevImg, GpuMat nextImg, GpuMat prevPts, GpuMat nextPts, GpuMat status){\n    try {\n        (*p)->calc(*prevImg,*nextImg,*prevPts,*nextPts,*status);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}"
  },
  {
    "path": "cuda/optflow.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_optflow)\n\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"cuda.h\"\n#include \"optflow.h\"\n*/\nimport \"C\"\nimport \"unsafe\"\n\n// SparsePyrLKOpticalFlow is a wrapper around the cv::cuda::SparsePyrLKOpticalFlow.\ntype SparsePyrLKOpticalFlow struct {\n\t// C.SparsePyrLKOpticalFlow\n\tp unsafe.Pointer\n}\n\n// NewSparsePyrLKOpticalFlow returns a new SparsePyrLKOpticalFlow\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d05/classcv_1_1cuda_1_1SparsePyrLKOpticalFlow.html#a6bcd2d457532d7db76c3e7f11b60063b\nfunc NewSparsePyrLKOpticalFlow() SparsePyrLKOpticalFlow {\n\treturn SparsePyrLKOpticalFlow{p: unsafe.Pointer(C.CudaSparsePyrLKOpticalFlow_Create())}\n}\n\n// Calc calculates a sparse optical flow.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/dcf/classcv_1_1cuda_1_1SparseOpticalFlow.html#a80d5efbb7788e3dc4c49e6226ba34347\nfunc (s SparsePyrLKOpticalFlow) Calc(prevImg, nextImg, prevPts, nextPts, status GpuMat) error {\n\treturn OpenCVResult(C.CudaSparsePyrLKOpticalFlow_Calc(C.CudaSparsePyrLKOpticalFlow(s.p), prevImg.p, nextImg.p, prevPts.p, nextPts.p, status.p))\n}\n"
  },
  {
    "path": "cuda/optflow.h",
    "content": "#ifndef _OPENCV_CUDAOPTFLOW_HPP_\n#define _OPENCV_CUDAOPTFLOW_HPP_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/core/cuda.hpp>\n#include <opencv2/cudaoptflow.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n#include \"cuda.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::cuda::SparsePyrLKOpticalFlow>* CudaSparsePyrLKOpticalFlow;\n#else\ntypedef void* CudaSparsePyrLKOpticalFlow;\n#endif\n\nCudaSparsePyrLKOpticalFlow CudaSparsePyrLKOpticalFlow_Create();\nOpenCVResult CudaSparsePyrLKOpticalFlow_Calc(CudaSparsePyrLKOpticalFlow p, GpuMat prevImg, GpuMat nextImg, GpuMat prevPts, GpuMat nextPts, GpuMat status);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // _OPENCV_CUDAOPTFLOW_HPP_"
  },
  {
    "path": "cuda/optflow_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_optflow)\n\npackage cuda\n\nimport \"testing\"\n\nfunc TestSparsePyrLKOpticalFlow_Calc(t *testing.T) {\n\tprevImg := NewGpuMat()\n\tdefer prevImg.Close()\n\n\tnextImg := NewGpuMat()\n\tdefer nextImg.Close()\n\n\tprevPts := NewGpuMat()\n\tdefer prevPts.Close()\n\n\tnextPts := NewGpuMat()\n\tdefer nextPts.Close()\n\n\tstatus := NewGpuMat()\n\tdefer status.Close()\n\n\tpyrLk := NewSparsePyrLKOpticalFlow()\n\tpyrLk.Calc(prevImg, nextImg, prevPts, nextPts, status)\n}\n"
  },
  {
    "path": "cuda/warping.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_warping)\n\n#include \"warping.h\"\n\nOpenCVResult CudaResize(GpuMat src, GpuMat dst, Size dsize, double fx, double fy, int interp, Stream s) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n\n        if (s == NULL) {\n            cv::cuda::resize(*src, *dst, sz, fx, fy, interp);\n        } else {\n            cv::cuda::resize(*src, *dst, sz, fx, fy, interp, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaPyrDown(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::pyrDown(*src, *dst);\n        } else {\n            cv::cuda::pyrDown(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaPyrUp(GpuMat src, GpuMat dst, Stream s) {\n    try {\n        if (s == NULL) {\n            cv::cuda::pyrUp(*src, *dst);\n        } else {\n            cv::cuda::pyrUp(*src, *dst, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaBuildWarpAffineMaps(GpuMat M, bool inverse, Size dsize, GpuMat xmap, GpuMat ymap, Stream s) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        if (s == NULL) {\n            cv::cuda::buildWarpAffineMaps(*M, inverse, sz, *xmap, *ymap);\n        } else {\n            cv::cuda::buildWarpAffineMaps(*M, inverse, sz, *xmap, *ymap, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaBuildWarpPerspectiveMaps(GpuMat M, bool inverse, Size dsize, GpuMat xmap, GpuMat ymap, Stream s) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        if (s == NULL) {\n            cv::cuda::buildWarpPerspectiveMaps(*M, inverse, sz, *xmap, *ymap);\n        } else {\n            cv::cuda::buildWarpPerspectiveMaps(*M, inverse, sz, *xmap, *ymap, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaRemap(GpuMat src, GpuMat dst, GpuMat xmap, GpuMat ymap, int interp, int borderMode, Scalar borderValue, Stream s) {\n    try {\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        if (s == NULL) {\n            cv::cuda::remap(*src, *dst, *xmap, *ymap, interp, borderMode, c);\n        } else {\n            cv::cuda::remap(*src, *dst, *xmap, *ymap, interp, borderMode, c, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaRotate(GpuMat src, GpuMat dst, Size dsize, double angle, double xShift, double yShift, int interp, Stream s) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        if (s == NULL) {\n            cv::cuda::rotate(*src, *dst, sz, angle, xShift, yShift, interp);\n        } else {\n            cv::cuda::rotate(*src, *dst, sz, angle, xShift, yShift, interp, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaWarpAffine(GpuMat src, GpuMat dst, GpuMat M, Size dsize, int flags, int borderMode, Scalar borderValue, Stream s) {\n    try {\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::Size sz(dsize.width, dsize.height);\n    \n        if (s == NULL) {\n            cv::cuda::warpAffine(*src, *dst, *M, sz, flags, borderMode, c);\n        } else {\n            cv::cuda::warpAffine(*src, *dst, *M, sz, flags, borderMode, c, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CudaWarpPerspective(GpuMat src, GpuMat dst, GpuMat M, Size dsize, int flags, int borderMode, Scalar borderValue, Stream s) {\n    try {\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::Size sz(dsize.width, dsize.height);\n        if (s == NULL) {\n            cv::cuda::warpPerspective(*src, *dst, *M, sz, flags, borderMode, c);\n        } else {\n            cv::cuda::warpPerspective(*src, *dst, *M, sz, flags, borderMode, c, *s);\n        }\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "cuda/warping.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_warping)\n\npackage cuda\n\n/*\n#include <stdlib.h>\n#include \"warping.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"image/color\"\n)\n\n// InterpolationFlags are bit flags that control the interpolation algorithm\n// that is used.\ntype InterpolationFlags int\n\nconst (\n\t// InterpolationNearestNeighbor is nearest neighbor. (fast but low quality)\n\tInterpolationNearestNeighbor InterpolationFlags = 0\n\n\t// InterpolationLinear is bilinear interpolation.\n\tInterpolationLinear InterpolationFlags = 1\n\n\t// InterpolationCubic is bicube interpolation.\n\tInterpolationCubic InterpolationFlags = 2\n\n\t// InterpolationArea uses pixel area relation. It is preferred for image\n\t// decimation as it gives moire-free results.\n\tInterpolationArea InterpolationFlags = 3\n\n\t// InterpolationLanczos4 is Lanczos interpolation over 8x8 neighborhood.\n\tInterpolationLanczos4 InterpolationFlags = 4\n\n\t// InterpolationDefault is an alias for InterpolationLinear.\n\tInterpolationDefault = InterpolationLinear\n\n\t// InterpolationMax indicates use maximum interpolation.\n\tInterpolationMax InterpolationFlags = 7\n)\n\n// BorderType type of border.\ntype BorderType int\n\nconst (\n\t// BorderConstant border type\n\tBorderConstant BorderType = 0\n\n\t// BorderReplicate border type\n\tBorderReplicate BorderType = 1\n\n\t// BorderReflect border type\n\tBorderReflect BorderType = 2\n\n\t// BorderWrap border type\n\tBorderWrap BorderType = 3\n\n\t// BorderReflect101 border type\n\tBorderReflect101 BorderType = 4\n\n\t// BorderTransparent border type\n\tBorderTransparent BorderType = 5\n\n\t// BorderDefault border type\n\tBorderDefault = BorderReflect101\n\n\t// BorderIsolated border type\n\tBorderIsolated BorderType = 16\n)\n\n// Resize resizes an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga4f5fa0770d1c9efbadb9be1b92a6452a\nfunc Resize(src GpuMat, dst *GpuMat, sz image.Point, fx, fy float64, interp InterpolationFlags) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaResize(src.p, dst.p, pSize, C.double(fx), C.double(fy), C.int(interp), nil))\n}\n\n// ResizeWithStream resizes an image\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga4f5fa0770d1c9efbadb9be1b92a6452a\nfunc ResizeWithStream(src GpuMat, dst *GpuMat, sz image.Point, fx, fy float64, interp InterpolationFlags, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaResize(src.p, dst.p, pSize, C.double(fx), C.double(fy), C.int(interp), s.p))\n}\n\n// Rotate rotates an image around the origin (0,0) and then shifts it.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga55d958eceb0f871e04b1be0adc6ef1b5\nfunc Rotate(src GpuMat, dst *GpuMat, sz image.Point, angle, xShift, yShift float64, interp InterpolationFlags) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\treturn OpenCVResult(C.CudaRotate(src.p, dst.p, pSize, C.double(angle), C.double(xShift), C.double(yShift), C.int(interp), nil))\n}\n\n// RotateWithStream rotates an image around the origin (0,0) and then shifts it\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga55d958eceb0f871e04b1be0adc6ef1b5\nfunc RotateWithStream(src GpuMat, dst *GpuMat, sz image.Point, angle, xShift, yShift float64, interp InterpolationFlags, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\treturn OpenCVResult(C.CudaRotate(src.p, dst.p, pSize, C.double(angle), C.double(xShift), C.double(yShift), C.int(interp), s.p))\n}\n\n// Remap applies a generic geometrical transformation to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga0ece6c76e8efa3171adb8432d842beb0\nfunc Remap(src GpuMat, dst, xmap, ymap *GpuMat, interpolation InterpolationFlags, borderMode BorderType, borderValue color.RGBA) error {\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\treturn OpenCVResult(C.CudaRemap(src.p, dst.p, xmap.p, ymap.p, C.int(interpolation), C.int(borderMode), bv, nil))\n}\n\n// RemapWithStream applies a generic geometrical transformation to an image\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga0ece6c76e8efa3171adb8432d842beb0\nfunc RemapWithStream(src GpuMat, dst, xmap, ymap *GpuMat, interpolation InterpolationFlags, borderMode BorderType, borderValue color.RGBA, s Stream) error {\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\treturn OpenCVResult(C.CudaRemap(src.p, dst.p, xmap.p, ymap.p, C.int(interpolation), C.int(borderMode), bv, s.p))\n}\n\n// PyrDown blurs an image and downsamples it.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga9c8456de9792d96431e065f407c7a91b\nfunc PyrDown(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.CudaPyrDown(src.p, dst.p, nil))\n}\n\n// PyrDownWithStream blurs an image and downsamples it\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga9c8456de9792d96431e065f407c7a91b\nfunc PyrDownWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.CudaPyrDown(src.p, dst.p, s.p))\n}\n\n// PyrUp upsamples an image and then blurs it.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga2048da0dfdb9e4a726232c5cef7e5747\nfunc PyrUp(src GpuMat, dst *GpuMat) error {\n\treturn OpenCVResult(C.CudaPyrUp(src.p, dst.p, nil))\n}\n\n// PyrUpWithStream upsamples an image and then blurs it\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga2048da0dfdb9e4a726232c5cef7e5747\nfunc PyrUpWithStream(src GpuMat, dst *GpuMat, s Stream) error {\n\treturn OpenCVResult(C.CudaPyrUp(src.p, dst.p, s.p))\n}\n\n// WarpPerspective applies a perspective transformation to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga7a6cf95065536712de6b155f3440ccff\nfunc WarpPerspective(src GpuMat, dst *GpuMat, m GpuMat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\n\treturn OpenCVResult(C.CudaWarpPerspective(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv, nil))\n}\n\n// WarpPerspectiveWithStream applies a perspective transformation to an image\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga7a6cf95065536712de6b155f3440ccff\nfunc WarpPerspectiveWithStream(src GpuMat, dst *GpuMat, m GpuMat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\n\treturn OpenCVResult(C.CudaWarpPerspective(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv, s.p))\n}\n\n// WarpAffine applies an affine transformation to an image. For more parameters please check WarpAffineWithParams\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga9e8dd9e73b96bdc8e27d85c0e83f1130\nfunc WarpAffine(src GpuMat, dst *GpuMat, m GpuMat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\n\treturn OpenCVResult(C.CudaWarpAffine(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv, nil))\n}\n\n// WarpAffineWithStream applies an affine transformation to an image\n// using a Stream for concurrency.\n//\n// # For more parameters please check WarpAffineWithParams\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga9e8dd9e73b96bdc8e27d85c0e83f1130\nfunc WarpAffineWithStream(src GpuMat, dst *GpuMat, m GpuMat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\n\treturn OpenCVResult(C.CudaWarpAffine(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv, s.p))\n}\n\n// BuildWarpAffineMaps builds transformation maps for affine transformation.\n//\n// For further details. please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga63504590a96e4cc702d994281d17bc1c\nfunc BuildWarpAffineMaps(M GpuMat, inverse bool, sz image.Point, xmap, ymap *GpuMat) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaBuildWarpAffineMaps(M.p, C.bool(inverse), pSize, xmap.p, ymap.p, nil))\n}\n\n// BuildWarpAffineMapsWithStream builds transformation maps for affine transformation\n// using a Stream for concurrency.\n//\n// For further details. please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga63504590a96e4cc702d994281d17bc1c\nfunc BuildWarpAffineMapsWithStream(M GpuMat, inverse bool, sz image.Point, xmap, ymap *GpuMat, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaBuildWarpAffineMaps(M.p, C.bool(inverse), pSize, xmap.p, ymap.p, s.p))\n}\n\n// BuildWarpPerspectiveMaps builds transformation maps for perspective transformation.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga8d16e3003703bd3b89cca98c913ef864\nfunc BuildWarpPerspectiveMaps(M GpuMat, inverse bool, sz image.Point, xmap, ymap *GpuMat) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaBuildWarpPerspectiveMaps(M.p, C.bool(inverse), pSize, xmap.p, ymap.p, nil))\n}\n\n// BuildWarpPerspectiveMapsWithStream builds transformation maps for perspective transformation\n// using a Stream for concurrency.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d29/group__cudawarping.html#ga8d16e3003703bd3b89cca98c913ef864\nfunc BuildWarpPerspectiveMapsWithStream(M GpuMat, inverse bool, sz image.Point, xmap, ymap *GpuMat, s Stream) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.CudaBuildWarpPerspectiveMaps(M.p, C.bool(inverse), pSize, xmap.p, ymap.p, s.p))\n}\n"
  },
  {
    "path": "cuda/warping.h",
    "content": "#ifndef _OPENCV3_CUDAWARPING_H_\n#define _OPENCV3_CUDAWARPING_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/cudawarping.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"../core.h\"\n#include \"cuda.h\"\n\nOpenCVResult CudaResize(GpuMat src, GpuMat dst, Size dsize, double fx, double fy, int interp, Stream s);\nOpenCVResult CudaPyrDown(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult CudaPyrUp(GpuMat src, GpuMat dst, Stream s);\nOpenCVResult CudaBuildWarpAffineMaps(GpuMat M, bool inverse, Size dsize, GpuMat xmap, GpuMat ymap, Stream s);\nOpenCVResult CudaBuildWarpPerspectiveMaps(GpuMat M, bool inverse, Size dsize, GpuMat xmap, GpuMat ymap, Stream s);\nOpenCVResult CudaRemap(GpuMat src, GpuMat dst, GpuMat xmap, GpuMat ymap, int interp, int borderMode, Scalar borderValue, Stream s);\nOpenCVResult CudaRotate(GpuMat src, GpuMat dst, Size dsize, double angle, double xShift, double yShift, int interp, Stream s);\nOpenCVResult CudaWarpAffine(GpuMat src, GpuMat dst, GpuMat M, Size dsize, int flags, int borderMode, Scalar borderValue, Stream s);\nOpenCVResult CudaWarpPerspective(GpuMat src, GpuMat dst, GpuMat M, Size dsize, int flags, int borderMode, Scalar borderValue, Stream s);\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_CUDAWARPING_H_\n"
  },
  {
    "path": "cuda/warping_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_warping)\n\npackage cuda\n\nfunc (c InterpolationFlags) String() string {\n\tswitch c {\n\tcase InterpolationNearestNeighbor:\n\t\treturn \"interpolation-nearest-neighbor\"\n\tcase InterpolationLinear:\n\t\treturn \"interpolation-linear\"\n\tcase InterpolationCubic:\n\t\treturn \"interpolation-cubic\"\n\tcase InterpolationArea:\n\t\treturn \"interpolation-area\"\n\tcase InterpolationLanczos4:\n\t\treturn \"interpolation-lanczos4\"\n\tcase InterpolationMax:\n\t\treturn \"interpolation-max\"\n\t}\n\treturn \"\"\n}\n\nfunc (c BorderType) String() string {\n\tswitch c {\n\tcase BorderConstant:\n\t\treturn \"border-constant\"\n\tcase BorderReplicate:\n\t\treturn \"border-replicate\"\n\tcase BorderWrap:\n\t\treturn \"border-wrap\"\n\tcase BorderReflect101:\n\t\treturn \"border-reflect101\"\n\tcase BorderTransparent:\n\t\treturn \"border-transparent\"\n\tcase BorderIsolated:\n\t\treturn \"border-isolated\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "cuda/warping_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_cuda_warping)\n\npackage cuda\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\t\"testing\"\n\n\t\"gocv.io/x/gocv\"\n)\n\nfunc TestResize(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Resize test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tResize(cimg, &dimg, image.Point{}, 0.5, 0.5, InterpolationDefault)\n\tdimg.Download(&dst)\n\tif dst.Cols() != 200 || dst.Rows() != 172 {\n\t\tt.Errorf(\"Expected dst size of 200x172 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n\n\tResize(cimg, &dimg, image.Pt(440, 377), 0, 0, InterpolationCubic)\n\tdimg.Download(&dst)\n\tif dst.Cols() != 440 || dst.Rows() != 377 {\n\t\tt.Errorf(\"Expected dst size of 440x377 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n}\n\nfunc TestResizeWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Resize test\")\n\t}\n\tdefer src.Close()\n\n\tvar cimg, dimg = NewGpuMat(), NewGpuMat()\n\tdefer cimg.Close()\n\tdefer dimg.Close()\n\n\tcimg.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tResizeWithStream(cimg, &dimg, image.Point{}, 0.5, 0.5, InterpolationDefault, stream)\n\tdimg.Download(&dst)\n\tif dst.Cols() != 200 || dst.Rows() != 172 {\n\t\tt.Errorf(\"Expected dst size of 200x172 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n\n\tResizeWithStream(cimg, &dimg, image.Pt(440, 377), 0, 0, InterpolationCubic, stream)\n\tdimg.Download(&dst)\n\tif dst.Cols() != 440 || dst.Rows() != 377 {\n\t\tt.Errorf(\"Expected dst size of 440x377 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n}\n\nfunc TestPyrDown(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrDown test\")\n\t}\n\tdefer src.Close()\n\n\tvar gsrc, gdst = NewGpuMat(), NewGpuMat()\n\tdefer gsrc.Close()\n\tdefer gdst.Close()\n\n\tgsrc.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tPyrDown(gsrc, &gdst)\n\tgdst.Download(&dst)\n\tif dst.Empty() && math.Abs(float64(src.Cols()-2*dst.Cols())) < 2.0 && math.Abs(float64(src.Rows()-2*dst.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrDown test\")\n\t}\n}\n\nfunc TestPyrDownWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrDown test\")\n\t}\n\tdefer src.Close()\n\n\tvar gsrc, gdst = NewGpuMat(), NewGpuMat()\n\tdefer gsrc.Close()\n\tdefer gdst.Close()\n\n\tgsrc.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tPyrDownWithStream(gsrc, &gdst, stream)\n\tgdst.Download(&dst)\n\tif dst.Empty() && math.Abs(float64(src.Cols()-2*dst.Cols())) < 2.0 && math.Abs(float64(src.Rows()-2*dst.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrDown test\")\n\t}\n}\n\nfunc TestPyrUp(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrUp test\")\n\t}\n\tdefer src.Close()\n\n\tvar gsrc, gdst = NewGpuMat(), NewGpuMat()\n\tdefer gsrc.Close()\n\tdefer gdst.Close()\n\n\tgsrc.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tPyrDown(gsrc, &gdst)\n\tif dst.Empty() && math.Abs(float64(2*src.Cols()-dst.Cols())) < 2.0 && math.Abs(float64(2*src.Rows()-dst.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrUp test\")\n\t}\n}\n\nfunc TestPyrUpWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/face-detect.jpg\", gocv.IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrUp test\")\n\t}\n\tdefer src.Close()\n\n\tvar gsrc, gdst = NewGpuMat(), NewGpuMat()\n\tdefer gsrc.Close()\n\tdefer gdst.Close()\n\n\tgsrc.Upload(src)\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tPyrDownWithStream(gsrc, &gdst, stream)\n\tif dst.Empty() && math.Abs(float64(2*src.Cols()-dst.Cols())) < 2.0 && math.Abs(float64(2*src.Rows()-dst.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrUp test\")\n\t}\n}\n\nfunc TestRemap(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmap1 := gocv.NewMatWithSize(256, 256, gocv.MatTypeCV32F)\n\tdefer map1.Close()\n\tmap1.SetFloatAt(50, 50, 25.4)\n\tmap2 := gocv.NewMatWithSize(256, 256, gocv.MatTypeCV32F)\n\tdefer map2.Close()\n\n\tgsrc, gdst, gmap1, gmap2 := NewGpuMat(), NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tgsrc.Upload(src)\n\tgmap1.Upload(map1)\n\tgmap2.Upload(map2)\n\tRemap(gsrc, &gdst, &gmap1, &gmap2, InterpolationDefault, BorderConstant, color.RGBA{0, 0, 0, 0})\n\tgdst.Download(&dst)\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Remap(): dst is empty\")\n\t}\n}\n\nfunc TestRemapWithStream(t *testing.T) {\n\tsrc := gocv.IMRead(\"../images/gocvlogo.jpg\", gocv.IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := gocv.NewMat()\n\tdefer dst.Close()\n\n\tmap1 := gocv.NewMatWithSize(256, 256, gocv.MatTypeCV32F)\n\tdefer map1.Close()\n\tmap1.SetFloatAt(50, 50, 25.4)\n\tmap2 := gocv.NewMatWithSize(256, 256, gocv.MatTypeCV32F)\n\tdefer map2.Close()\n\n\tgsrc, gdst, gmap1, gmap2 := NewGpuMat(), NewGpuMat(), NewGpuMat(), NewGpuMat()\n\tgsrc.Upload(src)\n\tgmap1.Upload(map1)\n\tgmap2.Upload(map2)\n\n\tstream := NewStream()\n\tdefer stream.Close()\n\n\tRemapWithStream(gsrc, &gdst, &gmap1, &gmap2, InterpolationDefault, BorderConstant, color.RGBA{0, 0, 0, 0}, stream)\n\tgdst.Download(&dst)\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Remap(): dst is empty\")\n\t}\n}\n"
  },
  {
    "path": "data/haarcascade_frontalface_default.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    Stump-based 24x24 discrete(?) adaboost frontal face detector.\n    Created by Rainer Lienhart.\n\n////////////////////////////////////////////////////////////////////////////////////////\n\n  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n\n  By downloading, copying, installing or using the software you agree to this license.\n  If you do not agree to this license, do not download, install,\n  copy or use the software.\n\n\n                        Intel License Agreement\n                For Open Source Computer Vision Library\n\n Copyright (C) 2000, Intel Corporation, all rights reserved.\n Third party copyrights are property of their respective owners.\n\n Redistribution and use in source and binary forms, with or without modification,\n are permitted provided that the following conditions are met:\n\n   * Redistribution's of source code must retain the above copyright notice,\n     this list of conditions and the following disclaimer.\n\n   * Redistribution's in binary form must reproduce the above copyright notice,\n     this list of conditions and the following disclaimer in the documentation\n     and/or other materials provided with the distribution.\n\n   * The name of Intel Corporation may not be used to endorse or promote products\n     derived from this software without specific prior written permission.\n\n This software is provided by the copyright holders and contributors \"as is\" and\n any express or implied warranties, including, but not limited to, the implied\n warranties of merchantability and fitness for a particular purpose are disclaimed.\n In no event shall the Intel Corporation or contributors be liable for any direct,\n indirect, incidental, special, exemplary, or consequential damages\n (including, but not limited to, procurement of substitute goods or services;\n loss of use, data, or profits; or business interruption) however caused\n and on any theory of liability, whether in contract, strict liability,\n or tort (including negligence or otherwise) arising in any way out of\n the use of this software, even if advised of the possibility of such damage.\n-->\n<opencv_storage>\n<cascade type_id=\"opencv-cascade-classifier\"><stageType>BOOST</stageType>\n  <featureType>HAAR</featureType>\n  <height>24</height>\n  <width>24</width>\n  <stageParams>\n    <maxWeakCount>211</maxWeakCount></stageParams>\n  <featureParams>\n    <maxCatCount>0</maxCatCount></featureParams>\n  <stageNum>25</stageNum>\n  <stages>\n    <_>\n      <maxWeakCount>9</maxWeakCount>\n      <stageThreshold>-5.0425500869750977e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 0 -3.1511999666690826e-02</internalNodes>\n          <leafValues>\n            2.0875380039215088e+00 -2.2172100543975830e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1 1.2396000325679779e-02</internalNodes>\n          <leafValues>\n            -1.8633940219879150e+00 1.3272049427032471e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2 2.1927999332547188e-02</internalNodes>\n          <leafValues>\n            -1.5105249881744385e+00 1.0625729560852051e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 3 5.7529998011887074e-03</internalNodes>\n          <leafValues>\n            -8.7463897466659546e-01 1.1760339736938477e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 4 1.5014000236988068e-02</internalNodes>\n          <leafValues>\n            -7.7945697307586670e-01 1.2608419656753540e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 5 9.9371001124382019e-02</internalNodes>\n          <leafValues>\n            5.5751299858093262e-01 -1.8743000030517578e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 6 2.7340000960975885e-03</internalNodes>\n          <leafValues>\n            -1.6911929845809937e+00 4.4009700417518616e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 7 -1.8859000876545906e-02</internalNodes>\n          <leafValues>\n            -1.4769539833068848e+00 4.4350099563598633e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 8 5.9739998541772366e-03</internalNodes>\n          <leafValues>\n            -8.5909199714660645e-01 8.5255599021911621e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>16</maxWeakCount>\n      <stageThreshold>-4.9842400550842285e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 9 -2.1110000088810921e-02</internalNodes>\n          <leafValues>\n            1.2435649633407593e+00 -1.5713009834289551e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 10 2.0355999469757080e-02</internalNodes>\n          <leafValues>\n            -1.6204780340194702e+00 1.1817760467529297e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 11 2.1308999508619308e-02</internalNodes>\n          <leafValues>\n            -1.9415930509567261e+00 7.0069098472595215e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 12 9.1660000383853912e-02</internalNodes>\n          <leafValues>\n            -5.5670100450515747e-01 1.7284419536590576e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 13 3.6288000643253326e-02</internalNodes>\n          <leafValues>\n            2.6763799786567688e-01 -2.1831810474395752e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 14 -1.9109999760985374e-02</internalNodes>\n          <leafValues>\n            -2.6730210781097412e+00 4.5670801401138306e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 15 8.2539999857544899e-03</internalNodes>\n          <leafValues>\n            -1.0852910280227661e+00 5.3564202785491943e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 16 1.8355000764131546e-02</internalNodes>\n          <leafValues>\n            -3.5200199484825134e-01 9.3339198827743530e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 17 -7.0569999516010284e-03</internalNodes>\n          <leafValues>\n            9.2782098054885864e-01 -6.6349899768829346e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 18 -9.8770000040531158e-03</internalNodes>\n          <leafValues>\n            1.1577470302581787e+00 -2.9774799942970276e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 19 1.5814000740647316e-02</internalNodes>\n          <leafValues>\n            -4.1960600018501282e-01 1.3576040267944336e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 20 -2.0700000226497650e-02</internalNodes>\n          <leafValues>\n            1.4590020179748535e+00 -1.9739399850368500e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 21 -1.3760800659656525e-01</internalNodes>\n          <leafValues>\n            1.1186759471893311e+00 -5.2915501594543457e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 22 1.4318999834358692e-02</internalNodes>\n          <leafValues>\n            -3.5127198696136475e-01 1.1440860033035278e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 23 1.0253000073134899e-02</internalNodes>\n          <leafValues>\n            -6.0850602388381958e-01 7.7098500728607178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 24 9.1508001089096069e-02</internalNodes>\n          <leafValues>\n            3.8817799091339111e-01 -1.5122940540313721e+00</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>27</maxWeakCount>\n      <stageThreshold>-4.6551899909973145e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 25 6.9747000932693481e-02</internalNodes>\n          <leafValues>\n            -1.0130879878997803e+00 1.4687349796295166e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 26 3.1502999365329742e-02</internalNodes>\n          <leafValues>\n            -1.6463639736175537e+00 1.0000629425048828e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 27 1.4260999858379364e-02</internalNodes>\n          <leafValues>\n            4.6480301022529602e-01 -1.5959889888763428e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 28 1.4453000389039516e-02</internalNodes>\n          <leafValues>\n            -6.5511900186538696e-01 8.3021801710128784e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 29 -3.0509999487549067e-03</internalNodes>\n          <leafValues>\n            -1.3982310295104980e+00 4.2550599575042725e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 30 3.2722998410463333e-02</internalNodes>\n          <leafValues>\n            -5.0702601671218872e-01 1.0526109933853149e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 31 -7.2960001416504383e-03</internalNodes>\n          <leafValues>\n            3.6356899142265320e-01 -1.3464889526367188e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 32 5.0425000488758087e-02</internalNodes>\n          <leafValues>\n            -3.0461400747299194e-01 1.4504129886627197e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 33 4.6879000961780548e-02</internalNodes>\n          <leafValues>\n            -4.0286201238632202e-01 1.2145609855651855e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 34 -6.9358997046947479e-02</internalNodes>\n          <leafValues>\n            1.0539360046386719e+00 -4.5719701051712036e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 35 -4.9033999443054199e-02</internalNodes>\n          <leafValues>\n            -1.6253089904785156e+00 1.5378999710083008e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 36 8.4827996790409088e-02</internalNodes>\n          <leafValues>\n            2.8402999043464661e-01 -1.5662059783935547e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 37 -1.7229999648407102e-03</internalNodes>\n          <leafValues>\n            -1.0147459506988525e+00 2.3294800519943237e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 38 1.1562199890613556e-01</internalNodes>\n          <leafValues>\n            -1.6732899844646454e-01 1.2804069519042969e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 39 -5.1279999315738678e-02</internalNodes>\n          <leafValues>\n            1.5162390470504761e+00 -3.0271100997924805e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 40 -4.2706999927759171e-02</internalNodes>\n          <leafValues>\n            1.7631920576095581e+00 -5.1832001656293869e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 41 3.7178099155426025e-01</internalNodes>\n          <leafValues>\n            -3.1389200687408447e-01 1.5357979536056519e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 42 1.9412999972701073e-02</internalNodes>\n          <leafValues>\n            -1.0017599910497665e-01 9.3655401468276978e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 43 1.7439000308513641e-02</internalNodes>\n          <leafValues>\n            -4.0379899740219116e-01 9.6293002367019653e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 44 3.9638999849557877e-02</internalNodes>\n          <leafValues>\n            1.7039099335670471e-01 -2.9602990150451660e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 45 -9.1469995677471161e-03</internalNodes>\n          <leafValues>\n            8.8786798715591431e-01 -4.3818700313568115e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 46 1.7219999572262168e-03</internalNodes>\n          <leafValues>\n            -3.7218600511550903e-01 4.0018901228904724e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 47 3.0231000855565071e-02</internalNodes>\n          <leafValues>\n            6.5924003720283508e-02 -2.6469180583953857e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 48 -7.8795999288558960e-02</internalNodes>\n          <leafValues>\n            -1.7491459846496582e+00 2.8475299477577209e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 49 2.1110000088810921e-03</internalNodes>\n          <leafValues>\n            -9.3908101320266724e-01 2.3205199837684631e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 50 2.7091000229120255e-02</internalNodes>\n          <leafValues>\n            -5.2664000540971756e-02 1.0756820440292358e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 51 -4.4964998960494995e-02</internalNodes>\n          <leafValues>\n            -1.8294479846954346e+00 9.9561996757984161e-02</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>32</maxWeakCount>\n      <stageThreshold>-4.4531588554382324e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 52 -6.5701000392436981e-02</internalNodes>\n          <leafValues>\n            1.1558510065078735e+00 -1.0716359615325928e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 53 1.5839999541640282e-02</internalNodes>\n          <leafValues>\n            -1.5634720325469971e+00 7.6877099275588989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 54 1.4570899307727814e-01</internalNodes>\n          <leafValues>\n            -5.7450097799301147e-01 1.3808720111846924e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 55 6.1389999464154243e-03</internalNodes>\n          <leafValues>\n            -1.4570560455322266e+00 5.1610302925109863e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 56 6.7179999314248562e-03</internalNodes>\n          <leafValues>\n            -8.3533602952957153e-01 5.8522200584411621e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 57 1.8518000841140747e-02</internalNodes>\n          <leafValues>\n            -3.1312099099159241e-01 1.1696679592132568e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 58 1.9958000630140305e-02</internalNodes>\n          <leafValues>\n            -4.3442600965499878e-01 9.5446902513504028e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 59 -2.7755001187324524e-01</internalNodes>\n          <leafValues>\n            1.4906179904937744e+00 -1.3815900683403015e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 60 9.1859996318817139e-03</internalNodes>\n          <leafValues>\n            -9.6361500024795532e-01 2.7665498852729797e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 61 -3.7737999111413956e-02</internalNodes>\n          <leafValues>\n            -2.4464108943939209e+00 2.3619599640369415e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 62 1.8463000655174255e-02</internalNodes>\n          <leafValues>\n            1.7539200186729431e-01 -1.3423130512237549e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 63 -1.1114999651908875e-02</internalNodes>\n          <leafValues>\n            4.8710799217224121e-01 -8.9851897954940796e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 64 3.3927999436855316e-02</internalNodes>\n          <leafValues>\n            1.7874200642108917e-01 -1.6342279911041260e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 65 -3.5649001598358154e-02</internalNodes>\n          <leafValues>\n            -1.9607399702072144e+00 1.8102499842643738e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 66 -1.1438000015914440e-02</internalNodes>\n          <leafValues>\n            9.9010699987411499e-01 -3.8103199005126953e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 67 -6.5236002206802368e-02</internalNodes>\n          <leafValues>\n            -2.5794160366058350e+00 2.4753600358963013e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 68 -4.2272001504898071e-02</internalNodes>\n          <leafValues>\n            1.4411840438842773e+00 -2.9508298635482788e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 69 1.9219999667257071e-03</internalNodes>\n          <leafValues>\n            -4.9608600139617920e-01 6.3173598051071167e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 70 -1.2921799719333649e-01</internalNodes>\n          <leafValues>\n            -2.3314270973205566e+00 5.4496999830007553e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 71 2.2931000217795372e-02</internalNodes>\n          <leafValues>\n            -8.4447097778320312e-01 3.8738098740577698e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 72 -3.4120000898838043e-02</internalNodes>\n          <leafValues>\n            -1.4431500434875488e+00 9.8422996699810028e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 73 2.6223000138998032e-02</internalNodes>\n          <leafValues>\n            1.8223099410533905e-01 -1.2586519718170166e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 74 2.2236999124288559e-02</internalNodes>\n          <leafValues>\n            6.9807998836040497e-02 -2.3820950984954834e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 75 -5.8240001089870930e-03</internalNodes>\n          <leafValues>\n            3.9332500100135803e-01 -2.7542799711227417e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 76 4.3653000146150589e-02</internalNodes>\n          <leafValues>\n            1.4832699298858643e-01 -1.1368780136108398e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 77 5.7266999036073685e-02</internalNodes>\n          <leafValues>\n            2.4628099799156189e-01 -1.2687400579452515e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 78 2.3409998975694180e-03</internalNodes>\n          <leafValues>\n            -7.5448900461196899e-01 2.7163800597190857e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 79 1.2996000237762928e-02</internalNodes>\n          <leafValues>\n            -3.6394900083541870e-01 7.0959198474884033e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 80 -2.6517000049352646e-02</internalNodes>\n          <leafValues>\n            -2.3221859931945801e+00 3.5744000226259232e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 81 -5.8400002308189869e-03</internalNodes>\n          <leafValues>\n            4.2194300889968872e-01 -4.8184998333454132e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 82 -1.6568999737501144e-02</internalNodes>\n          <leafValues>\n            1.1099940538406372e+00 -3.4849700331687927e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 83 -6.8157002329826355e-02</internalNodes>\n          <leafValues>\n            -3.3269989490509033e+00 2.1299000084400177e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>52</maxWeakCount>\n      <stageThreshold>-4.3864588737487793e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 84 3.9974000304937363e-02</internalNodes>\n          <leafValues>\n            -1.2173449993133545e+00 1.0826710462570190e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 85 1.8819500505924225e-01</internalNodes>\n          <leafValues>\n            -4.8289400339126587e-01 1.4045250415802002e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 86 7.8027002513408661e-02</internalNodes>\n          <leafValues>\n            -1.0782150030136108e+00 7.4040299654006958e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 87 1.1899999663000926e-04</internalNodes>\n          <leafValues>\n            -1.2019979953765869e+00 3.7749201059341431e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 88 8.5056997835636139e-02</internalNodes>\n          <leafValues>\n            -4.3939098715782166e-01 1.2647340297698975e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 89 8.9720003306865692e-03</internalNodes>\n          <leafValues>\n            -1.8440499901771545e-01 4.5726400613784790e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 90 8.8120000436902046e-03</internalNodes>\n          <leafValues>\n            3.0396699905395508e-01 -9.5991098880767822e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 91 -2.3507999256253242e-02</internalNodes>\n          <leafValues>\n            1.2487529516220093e+00 4.6227999031543732e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 92 7.0039997808635235e-03</internalNodes>\n          <leafValues>\n            -5.9442102909088135e-01 5.3963297605514526e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 93 3.3851999789476395e-02</internalNodes>\n          <leafValues>\n            2.8496098518371582e-01 -1.4895249605178833e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 94 -3.2530000898987055e-03</internalNodes>\n          <leafValues>\n            4.8120799660682678e-01 -5.2712398767471313e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 95 2.9097000136971474e-02</internalNodes>\n          <leafValues>\n            2.6743900775909424e-01 -1.6007850170135498e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 96 -8.4790000692009926e-03</internalNodes>\n          <leafValues>\n            -1.3107639551162720e+00 1.5243099629878998e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 97 -1.0795000009238720e-02</internalNodes>\n          <leafValues>\n            4.5613598823547363e-01 -7.2050899267196655e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 98 -2.4620000272989273e-02</internalNodes>\n          <leafValues>\n            -1.7320619821548462e+00 6.8363003432750702e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 99 3.7380000576376915e-03</internalNodes>\n          <leafValues>\n            -1.9303299486637115e-01 6.8243497610092163e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 100 -1.2264000251889229e-02</internalNodes>\n          <leafValues>\n            -1.6095290184020996e+00 7.5268000364303589e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 101 -4.8670000396668911e-03</internalNodes>\n          <leafValues>\n            7.4286502599716187e-01 -2.1510200202465057e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 102 7.6725997030735016e-02</internalNodes>\n          <leafValues>\n            -2.6835098862648010e-01 1.3094140291213989e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 103 2.8578000143170357e-02</internalNodes>\n          <leafValues>\n            -5.8793000876903534e-02 1.2196329832077026e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 104 1.9694000482559204e-02</internalNodes>\n          <leafValues>\n            -3.5142898559570312e-01 8.4926998615264893e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 105 -2.9093999415636063e-02</internalNodes>\n          <leafValues>\n            -1.0507299900054932e+00 2.9806300997734070e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 106 -2.9144000262022018e-02</internalNodes>\n          <leafValues>\n            8.2547801733016968e-01 -3.2687199115753174e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 107 1.9741000607609749e-02</internalNodes>\n          <leafValues>\n            2.0452600717544556e-01 -8.3760201930999756e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 108 4.3299999088048935e-03</internalNodes>\n          <leafValues>\n            2.0577900111675262e-01 -6.6829800605773926e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 109 -3.5500999540090561e-02</internalNodes>\n          <leafValues>\n            -1.2969900369644165e+00 1.3897499442100525e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 110 -1.6172999516129494e-02</internalNodes>\n          <leafValues>\n            -1.3110569715499878e+00 7.5751997530460358e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 111 -2.2151000797748566e-02</internalNodes>\n          <leafValues>\n            -1.0524389743804932e+00 1.9241100549697876e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 112 -2.2707000374794006e-02</internalNodes>\n          <leafValues>\n            -1.3735309839248657e+00 6.6780999302864075e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 113 1.6607999801635742e-02</internalNodes>\n          <leafValues>\n            -3.7135999649763107e-02 7.7846401929855347e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 114 -1.3309000059962273e-02</internalNodes>\n          <leafValues>\n            -9.9850702285766602e-01 1.2248100340366364e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 115 -3.3732000738382339e-02</internalNodes>\n          <leafValues>\n            1.4461359977722168e+00 1.3151999562978745e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 116 1.6935000196099281e-02</internalNodes>\n          <leafValues>\n            -3.7121298909187317e-01 5.2842199802398682e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 117 3.3259999472647905e-03</internalNodes>\n          <leafValues>\n            -5.7568502426147461e-01 3.9261901378631592e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 118 8.3644002676010132e-02</internalNodes>\n          <leafValues>\n            1.6116000711917877e-02 -2.1173279285430908e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 119 2.5785198807716370e-01</internalNodes>\n          <leafValues>\n            -8.1609003245830536e-02 9.8782497644424438e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 120 -3.6566998809576035e-02</internalNodes>\n          <leafValues>\n            -1.1512110233306885e+00 9.6459001302719116e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 121 -1.6445999965071678e-02</internalNodes>\n          <leafValues>\n            3.7315499782562256e-01 -1.4585399627685547e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 122 -3.7519999314099550e-03</internalNodes>\n          <leafValues>\n            2.6179298758506775e-01 -5.8156698942184448e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 123 -6.3660000450909138e-03</internalNodes>\n          <leafValues>\n            7.5477397441864014e-01 -1.7055200040340424e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 124 -3.8499999791383743e-03</internalNodes>\n          <leafValues>\n            2.2653999924659729e-01 -6.3876402378082275e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 125 -4.5494001358747482e-02</internalNodes>\n          <leafValues>\n            -1.2640299797058105e+00 2.5260698795318604e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 126 -2.3941000923514366e-02</internalNodes>\n          <leafValues>\n            8.7068402767181396e-01 -2.7104699611663818e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 127 -7.7558003365993500e-02</internalNodes>\n          <leafValues>\n            -1.3901610374450684e+00 2.3612299561500549e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 128 2.3614000529050827e-02</internalNodes>\n          <leafValues>\n            6.6140003502368927e-02 -1.2645419836044312e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 129 -2.5750000495463610e-03</internalNodes>\n          <leafValues>\n            -5.3841698169708252e-01 3.0379098653793335e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 130 1.2010800093412399e-01</internalNodes>\n          <leafValues>\n            -3.5343000292778015e-01 5.2866202592849731e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 131 2.2899999748915434e-03</internalNodes>\n          <leafValues>\n            -5.8701997995376587e-01 2.4061000347137451e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 132 6.9716997444629669e-02</internalNodes>\n          <leafValues>\n            -3.3348900079727173e-01 5.1916301250457764e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 133 -4.6670001000165939e-02</internalNodes>\n          <leafValues>\n            6.9795399904251099e-01 -1.4895999804139137e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 134 -5.0129000097513199e-02</internalNodes>\n          <leafValues>\n            8.6146199703216553e-01 -2.5986000895500183e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 135 3.0147999525070190e-02</internalNodes>\n          <leafValues>\n            1.9332799315452576e-01 -5.9131097793579102e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>53</maxWeakCount>\n      <stageThreshold>-4.1299300193786621e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 136 9.1085001826286316e-02</internalNodes>\n          <leafValues>\n            -8.9233100414276123e-01 1.0434230566024780e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 137 1.2818999588489532e-02</internalNodes>\n          <leafValues>\n            -1.2597670555114746e+00 5.5317097902297974e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 138 1.5931999310851097e-02</internalNodes>\n          <leafValues>\n            -8.6254400014877319e-01 6.3731801509857178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 139 2.2780001163482666e-03</internalNodes>\n          <leafValues>\n            -7.4639201164245605e-01 5.3155601024627686e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 140 3.1840998679399490e-02</internalNodes>\n          <leafValues>\n            -1.2650489807128906e+00 3.6153900623321533e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 141 2.6960000395774841e-03</internalNodes>\n          <leafValues>\n            -9.8290401697158813e-01 3.6013001203536987e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 142 -1.2055000290274620e-02</internalNodes>\n          <leafValues>\n            6.4068400859832764e-01 -5.0125002861022949e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 143 2.1324999630451202e-02</internalNodes>\n          <leafValues>\n            -2.4034999310970306e-01 8.5448002815246582e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 144 3.0486000701785088e-02</internalNodes>\n          <leafValues>\n            -3.4273600578308105e-01 1.1428849697113037e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 145 -4.5079998672008514e-02</internalNodes>\n          <leafValues>\n            1.0976949930191040e+00 -1.7974600195884705e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 146 -7.1700997650623322e-02</internalNodes>\n          <leafValues>\n            1.5735000371932983e+00 -3.1433498859405518e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 147 5.9218000620603561e-02</internalNodes>\n          <leafValues>\n            -2.7582401037216187e-01 1.0448570251464844e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 148 6.7010000348091125e-03</internalNodes>\n          <leafValues>\n            -1.0974019765853882e+00 1.9801199436187744e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 149 4.1046999394893646e-02</internalNodes>\n          <leafValues>\n            3.0547699332237244e-01 -1.3287999629974365e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 150 -8.5499999113380909e-04</internalNodes>\n          <leafValues>\n            2.5807100534439087e-01 -7.0052897930145264e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 151 -3.0360000208020210e-02</internalNodes>\n          <leafValues>\n            -1.2306419610977173e+00 2.2609399259090424e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 152 -1.2930000200867653e-02</internalNodes>\n          <leafValues>\n            4.0758600831031799e-01 -5.1234501600265503e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 153 3.7367999553680420e-02</internalNodes>\n          <leafValues>\n            -9.4755001366138458e-02 6.1765098571777344e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 154 2.4434000253677368e-02</internalNodes>\n          <leafValues>\n            -4.1100600361824036e-01 4.7630500793457031e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 155 5.7007998228073120e-02</internalNodes>\n          <leafValues>\n            2.5249299407005310e-01 -6.8669801950454712e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 156 -1.6313999891281128e-02</internalNodes>\n          <leafValues>\n            -9.3928402662277222e-01 1.1448100209236145e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 157 -1.7648899555206299e-01</internalNodes>\n          <leafValues>\n            1.2451089620590210e+00 -5.6519001722335815e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 158 1.7614600062370300e-01</internalNodes>\n          <leafValues>\n            -3.2528200745582581e-01 8.2791501283645630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 159 -7.3910001665353775e-03</internalNodes>\n          <leafValues>\n            3.4783700108528137e-01 -1.7929099500179291e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 160 6.0890998691320419e-02</internalNodes>\n          <leafValues>\n            5.5098000913858414e-02 -1.5480779409408569e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 161 -2.9123000800609589e-02</internalNodes>\n          <leafValues>\n            -1.0255639553070068e+00 2.4106900393962860e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 162 -4.5648999512195587e-02</internalNodes>\n          <leafValues>\n            1.0301599502563477e+00 -3.1672099232673645e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 163 3.7333000451326370e-02</internalNodes>\n          <leafValues>\n            2.1620599925518036e-01 -8.2589900493621826e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 164 -2.4411000311374664e-02</internalNodes>\n          <leafValues>\n            -1.5957959890365601e+00 5.1139000803232193e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 165 -5.9806998819112778e-02</internalNodes>\n          <leafValues>\n            -1.0312290191650391e+00 1.3092300295829773e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 166 -3.0106000602245331e-02</internalNodes>\n          <leafValues>\n            -1.4781630039215088e+00 3.7211999297142029e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 167 7.4209999293088913e-03</internalNodes>\n          <leafValues>\n            -2.4024100601673126e-01 4.9333998560905457e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 168 -2.1909999195486307e-03</internalNodes>\n          <leafValues>\n            2.8941500186920166e-01 -5.7259601354598999e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 169 2.0860999822616577e-02</internalNodes>\n          <leafValues>\n            -2.3148399591445923e-01 6.3765901327133179e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 170 -6.6990000195801258e-03</internalNodes>\n          <leafValues>\n            -1.2107750177383423e+00 6.4018003642559052e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 171 1.8758000805974007e-02</internalNodes>\n          <leafValues>\n            2.4461300671100616e-01 -9.9786698818206787e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 172 -4.4323001056909561e-02</internalNodes>\n          <leafValues>\n            -1.3699189424514771e+00 3.6051999777555466e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 173 2.2859999909996986e-02</internalNodes>\n          <leafValues>\n            2.1288399398326874e-01 -1.0397620201110840e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 174 -9.8600005730986595e-04</internalNodes>\n          <leafValues>\n            3.2443600893020630e-01 -5.4291802644729614e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 175 1.7239000648260117e-02</internalNodes>\n          <leafValues>\n            -2.8323900699615479e-01 4.4468200206756592e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 176 -3.4531001001596451e-02</internalNodes>\n          <leafValues>\n            -2.3107020854949951e+00 -3.1399999279528856e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 177 6.7006997764110565e-02</internalNodes>\n          <leafValues>\n            2.8715699911117554e-01 -6.4481002092361450e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 178 2.3776899278163910e-01</internalNodes>\n          <leafValues>\n            -2.7174800634384155e-01 8.0219101905822754e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 179 -1.2903000228106976e-02</internalNodes>\n          <leafValues>\n            -1.5317620038986206e+00 2.1423600614070892e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 180 1.0514999739825726e-02</internalNodes>\n          <leafValues>\n            7.7037997543811798e-02 -1.0581140518188477e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 181 1.6969000920653343e-02</internalNodes>\n          <leafValues>\n            1.4306700229644775e-01 -8.5828399658203125e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 182 -7.2460002265870571e-03</internalNodes>\n          <leafValues>\n            -1.1020129919052124e+00 6.4906999468803406e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 183 1.0556999593973160e-02</internalNodes>\n          <leafValues>\n            1.3964000158011913e-02 6.3601499795913696e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 184 6.1380001716315746e-03</internalNodes>\n          <leafValues>\n            -3.4545901417732239e-01 5.6296801567077637e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 185 1.3158000074326992e-02</internalNodes>\n          <leafValues>\n            1.9927300512790680e-01 -1.5040320158004761e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 186 3.1310000922530890e-03</internalNodes>\n          <leafValues>\n            -4.0903699398040771e-01 3.7796398997306824e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 187 -1.0920699685811996e-01</internalNodes>\n          <leafValues>\n            -2.2227079868316650e+00 1.2178199738264084e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 188 8.1820003688335419e-03</internalNodes>\n          <leafValues>\n            -2.8652000427246094e-01 6.7890799045562744e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>62</maxWeakCount>\n      <stageThreshold>-4.0218091011047363e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 189 3.1346999108791351e-02</internalNodes>\n          <leafValues>\n            -8.8884598016738892e-01 9.4936800003051758e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 190 3.1918000429868698e-02</internalNodes>\n          <leafValues>\n            -1.1146880388259888e+00 4.8888999223709106e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 191 6.5939999185502529e-03</internalNodes>\n          <leafValues>\n            -1.0097689628601074e+00 4.9723801016807556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 192 2.6148000732064247e-02</internalNodes>\n          <leafValues>\n            2.5991299748420715e-01 -1.2537480592727661e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 193 1.2845000252127647e-02</internalNodes>\n          <leafValues>\n            -5.7138597965240479e-01 5.9659498929977417e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 194 2.6344999670982361e-02</internalNodes>\n          <leafValues>\n            -5.5203199386596680e-01 3.0217400193214417e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 195 -1.5083000063896179e-02</internalNodes>\n          <leafValues>\n            -1.2871240377426147e+00 2.2354200482368469e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 196 -3.8887001574039459e-02</internalNodes>\n          <leafValues>\n            1.7425049543380737e+00 -9.9747002124786377e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 197 -5.7029998861253262e-03</internalNodes>\n          <leafValues>\n            -1.0523240566253662e+00 1.8362599611282349e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 198 -1.4860000228509307e-03</internalNodes>\n          <leafValues>\n            5.6784200668334961e-01 -4.6742001175880432e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 199 -2.8486000373959541e-02</internalNodes>\n          <leafValues>\n            1.3082909584045410e+00 -2.6460900902748108e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 200 6.6224999725818634e-02</internalNodes>\n          <leafValues>\n            -4.6210700273513794e-01 4.1749599575996399e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 201 8.8569996878504753e-03</internalNodes>\n          <leafValues>\n            -4.1474899649620056e-01 5.9204798936843872e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 202 1.1355999857187271e-02</internalNodes>\n          <leafValues>\n            3.6103099584579468e-01 -4.5781201124191284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 203 -2.7679998893290758e-03</internalNodes>\n          <leafValues>\n            -8.9238899946212769e-01 1.4199000597000122e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 204 1.1246999725699425e-02</internalNodes>\n          <leafValues>\n            2.9353401064872742e-01 -9.7330600023269653e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 205 7.1970000863075256e-03</internalNodes>\n          <leafValues>\n            -7.9334902763366699e-01 1.8313400447368622e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 206 3.1768999993801117e-02</internalNodes>\n          <leafValues>\n            1.5523099899291992e-01 -1.3245639801025391e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 207 2.5173999369144440e-02</internalNodes>\n          <leafValues>\n            3.4214999526739120e-02 -2.0948131084442139e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 208 7.5360001064836979e-03</internalNodes>\n          <leafValues>\n            -3.9450600743293762e-01 5.1333999633789062e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 209 3.2873000949621201e-02</internalNodes>\n          <leafValues>\n            8.8372997939586639e-02 -1.2814120054244995e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 210 -2.7379998937249184e-03</internalNodes>\n          <leafValues>\n            5.5286502838134766e-01 -4.6384999155998230e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 211 -3.8075000047683716e-02</internalNodes>\n          <leafValues>\n            -1.8497270345687866e+00 4.5944001525640488e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 212 -3.8984000682830811e-02</internalNodes>\n          <leafValues>\n            -4.8223701119422913e-01 3.4760600328445435e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 213 2.8029999230057001e-03</internalNodes>\n          <leafValues>\n            -4.5154699683189392e-01 4.2806300520896912e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 214 -5.4145999252796173e-02</internalNodes>\n          <leafValues>\n            -8.4520798921585083e-01 1.6674900054931641e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 215 -8.3280000835657120e-03</internalNodes>\n          <leafValues>\n            3.5348299145698547e-01 -4.7163200378417969e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 216 3.3778000622987747e-02</internalNodes>\n          <leafValues>\n            1.8463100492954254e-01 -1.6686669588088989e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 217 -1.1238099634647369e-01</internalNodes>\n          <leafValues>\n            -1.2521569728851318e+00 3.5992000252008438e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 218 -1.0408000089228153e-02</internalNodes>\n          <leafValues>\n            -8.1620401144027710e-01 2.3428599536418915e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 219 -4.9439999274909496e-03</internalNodes>\n          <leafValues>\n            -9.2584699392318726e-01 1.0034800320863724e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 220 -9.3029998242855072e-03</internalNodes>\n          <leafValues>\n            5.6499302387237549e-01 -1.8881900608539581e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 221 -1.1749999597668648e-02</internalNodes>\n          <leafValues>\n            8.0302399396896362e-01 -3.8277000188827515e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 222 -2.3217000067234039e-02</internalNodes>\n          <leafValues>\n            -8.4926998615264893e-01 1.9671200215816498e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 223 1.6866000369191170e-02</internalNodes>\n          <leafValues>\n            -4.0591898560523987e-01 5.0695300102233887e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 224 -2.4031000211834908e-02</internalNodes>\n          <leafValues>\n            -1.5297520160675049e+00 2.3344999551773071e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 225 -3.6945998668670654e-02</internalNodes>\n          <leafValues>\n            6.3007700443267822e-01 -3.1780400872230530e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 226 -6.1563998460769653e-02</internalNodes>\n          <leafValues>\n            5.8627897500991821e-01 -1.2107999995350838e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 227 2.1661000326275826e-02</internalNodes>\n          <leafValues>\n            -2.5623700022697449e-01 1.0409849882125854e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 228 -3.6710000131279230e-03</internalNodes>\n          <leafValues>\n            2.9171100258827209e-01 -8.3287298679351807e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 229 4.4849000871181488e-02</internalNodes>\n          <leafValues>\n            -3.9633199572563171e-01 4.5662000775337219e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 230 5.7195000350475311e-02</internalNodes>\n          <leafValues>\n            2.1023899316787720e-01 -1.5004800558090210e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 231 -1.1342000216245651e-02</internalNodes>\n          <leafValues>\n            4.4071298837661743e-01 -3.8653799891471863e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 232 -1.2004000134766102e-02</internalNodes>\n          <leafValues>\n            9.3954598903656006e-01 -1.0589499771595001e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 233 2.2515999153256416e-02</internalNodes>\n          <leafValues>\n            9.4480002298951149e-03 -1.6799509525299072e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 234 -1.9809000194072723e-02</internalNodes>\n          <leafValues>\n            -1.0133639574050903e+00 2.4146600067615509e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 235 1.5891000628471375e-02</internalNodes>\n          <leafValues>\n            -3.7507599592208862e-01 4.6614098548889160e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 236 -9.1420002281665802e-03</internalNodes>\n          <leafValues>\n            -8.0484098196029663e-01 1.7816999554634094e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 237 -4.4740000739693642e-03</internalNodes>\n          <leafValues>\n            -1.0562069416046143e+00 7.3305003345012665e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 238 1.2742500007152557e-01</internalNodes>\n          <leafValues>\n            2.0165599882602692e-01 -1.5467929840087891e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 239 4.7703001648187637e-02</internalNodes>\n          <leafValues>\n            -3.7937799096107483e-01 3.7885999679565430e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 240 5.3608000278472900e-02</internalNodes>\n          <leafValues>\n            2.1220499277114868e-01 -1.2399710416793823e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 241 -3.9680998772382736e-02</internalNodes>\n          <leafValues>\n            -1.0257550477981567e+00 5.1282998174428940e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 242 -6.7327000200748444e-02</internalNodes>\n          <leafValues>\n            -1.0304750204086304e+00 2.3005299270153046e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 243 1.3337600231170654e-01</internalNodes>\n          <leafValues>\n            -2.0869000256061554e-01 1.2272510528564453e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 244 -2.0919300615787506e-01</internalNodes>\n          <leafValues>\n            8.7929898500442505e-01 -4.4254999607801437e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 245 -6.5589003264904022e-02</internalNodes>\n          <leafValues>\n            1.0443429946899414e+00 -2.1682099997997284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 246 6.1882998794317245e-02</internalNodes>\n          <leafValues>\n            1.3798199594020844e-01 -1.9009059667587280e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 247 -2.5578999891877174e-02</internalNodes>\n          <leafValues>\n            -1.6607600450515747e+00 5.8439997956156731e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 248 -3.4827001392841339e-02</internalNodes>\n          <leafValues>\n            7.9940402507781982e-01 -8.2406997680664062e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 249 -1.8209999427199364e-02</internalNodes>\n          <leafValues>\n            -9.6073997020721436e-01 6.6320002079010010e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 250 1.5070999972522259e-02</internalNodes>\n          <leafValues>\n            1.9899399578571320e-01 -7.6433002948760986e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>72</maxWeakCount>\n      <stageThreshold>-3.8832089900970459e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 251 4.6324998140335083e-02</internalNodes>\n          <leafValues>\n            -1.0362670421600342e+00 8.2201498746871948e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 252 1.5406999737024307e-02</internalNodes>\n          <leafValues>\n            -1.2327589988708496e+00 2.9647698998451233e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 253 1.2808999978005886e-02</internalNodes>\n          <leafValues>\n            -7.5852298736572266e-01 5.7985502481460571e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 254 4.9150999635457993e-02</internalNodes>\n          <leafValues>\n            -3.8983899354934692e-01 8.9680302143096924e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 255 1.2621000409126282e-02</internalNodes>\n          <leafValues>\n            -7.1799302101135254e-01 5.0440901517868042e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 256 -1.8768999725580215e-02</internalNodes>\n          <leafValues>\n            5.5147600173950195e-01 -7.0555400848388672e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 257 4.1965000331401825e-02</internalNodes>\n          <leafValues>\n            -4.4782099127769470e-01 7.0985502004623413e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 258 -5.1401998847723007e-02</internalNodes>\n          <leafValues>\n            -1.0932120084762573e+00 2.6701900362968445e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 259 -7.0960998535156250e-02</internalNodes>\n          <leafValues>\n            8.3618402481079102e-01 -3.8318100571632385e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 260 1.6745999455451965e-02</internalNodes>\n          <leafValues>\n            -2.5733101367950439e-01 2.5966501235961914e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 261 -6.2400000169873238e-03</internalNodes>\n          <leafValues>\n            3.1631499528884888e-01 -5.8796900510787964e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 262 -3.9397999644279480e-02</internalNodes>\n          <leafValues>\n            -1.0491210222244263e+00 1.6822400689125061e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 263 0.</internalNodes>\n          <leafValues>\n            1.6144199669361115e-01 -8.7876898050308228e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 264 -2.2307999432086945e-02</internalNodes>\n          <leafValues>\n            -6.9053500890731812e-01 2.3607000708580017e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 265 1.8919999711215496e-03</internalNodes>\n          <leafValues>\n            2.4989199638366699e-01 -5.6583297252655029e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 266 1.0730000212788582e-03</internalNodes>\n          <leafValues>\n            -5.0415802001953125e-01 3.8374501466751099e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 267 3.9230998605489731e-02</internalNodes>\n          <leafValues>\n            4.2619001120328903e-02 -1.3875889778137207e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 268 6.2238000333309174e-02</internalNodes>\n          <leafValues>\n            1.4119400084018707e-01 -1.0688860416412354e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 269 2.1399999968707561e-03</internalNodes>\n          <leafValues>\n            -8.9622402191162109e-01 1.9796399772167206e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 270 9.1800000518560410e-04</internalNodes>\n          <leafValues>\n            -4.5337298512458801e-01 4.3532699346542358e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 271 -6.9169998168945312e-03</internalNodes>\n          <leafValues>\n            3.3822798728942871e-01 -4.4793000817298889e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 272 -2.3866999894380569e-02</internalNodes>\n          <leafValues>\n            -7.8908598423004150e-01 2.2511799633502960e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 273 -1.0262800008058548e-01</internalNodes>\n          <leafValues>\n            -2.2831439971923828e+00 -5.3960001096129417e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 274 -9.5239998772740364e-03</internalNodes>\n          <leafValues>\n            3.9346700906753540e-01 -5.2242201566696167e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 275 3.9877001196146011e-02</internalNodes>\n          <leafValues>\n            3.2799001783132553e-02 -1.5079489946365356e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 276 -1.3144999742507935e-02</internalNodes>\n          <leafValues>\n            -1.0839990377426147e+00 1.8482400476932526e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 277 -5.0590999424457550e-02</internalNodes>\n          <leafValues>\n            -1.8822289705276489e+00 -2.2199999075382948e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 278 2.4917000904679298e-02</internalNodes>\n          <leafValues>\n            1.4593400061130524e-01 -2.2196519374847412e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 279 -7.6370001770555973e-03</internalNodes>\n          <leafValues>\n            -1.0164569616317749e+00 5.8797001838684082e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 280 4.2911998927593231e-02</internalNodes>\n          <leafValues>\n            1.5443000197410583e-01 -1.1843889951705933e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 281 2.3000000510364771e-04</internalNodes>\n          <leafValues>\n            -7.7305799722671509e-01 1.2189900130033493e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 282 9.0929996222257614e-03</internalNodes>\n          <leafValues>\n            -1.1450099945068359e-01 7.1091300249099731e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 283 1.1145000346004963e-02</internalNodes>\n          <leafValues>\n            7.0000998675823212e-02 -1.0534820556640625e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 284 -5.2453000098466873e-02</internalNodes>\n          <leafValues>\n            -1.7594360113143921e+00 1.9523799419403076e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 285 -2.3020699620246887e-01</internalNodes>\n          <leafValues>\n            9.5840299129486084e-01 -2.5045698881149292e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 286 -1.6365999355912209e-02</internalNodes>\n          <leafValues>\n            4.6731901168823242e-01 -2.1108399331569672e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 287 -1.7208000645041466e-02</internalNodes>\n          <leafValues>\n            7.0835697650909424e-01 -2.8018298745155334e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 288 -3.6648001521825790e-02</internalNodes>\n          <leafValues>\n            -1.1013339757919312e+00 2.4341100454330444e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 289 -1.0304999537765980e-02</internalNodes>\n          <leafValues>\n            -1.0933129787445068e+00 5.6258998811244965e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 290 -1.3713000342249870e-02</internalNodes>\n          <leafValues>\n            -2.6438099145889282e-01 1.9821000099182129e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 291 2.9308000579476357e-02</internalNodes>\n          <leafValues>\n            -2.2142399847507477e-01 1.0525950193405151e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 292 2.4077000096440315e-02</internalNodes>\n          <leafValues>\n            1.8485699594020844e-01 -1.7203969955444336e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 293 6.1280000954866409e-03</internalNodes>\n          <leafValues>\n            -9.2721498012542725e-01 5.8752998709678650e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 294 -2.2377999499440193e-02</internalNodes>\n          <leafValues>\n            1.9646559953689575e+00 2.7785999700427055e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 295 -7.0440000854432583e-03</internalNodes>\n          <leafValues>\n            2.1427600085735321e-01 -4.8407599329948425e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 296 -4.0603000670671463e-02</internalNodes>\n          <leafValues>\n            -1.1754349470138550e+00 1.6061200201511383e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 297 -2.4466000497341156e-02</internalNodes>\n          <leafValues>\n            -1.1239900588989258e+00 4.1110001504421234e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 298 2.5309999473392963e-03</internalNodes>\n          <leafValues>\n            -1.7169700562953949e-01 3.2178801298141479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 299 -1.9588999450206757e-02</internalNodes>\n          <leafValues>\n            8.2720202207565308e-01 -2.6376700401306152e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 300 -2.9635999351739883e-02</internalNodes>\n          <leafValues>\n            -1.1524770259857178e+00 1.4999300241470337e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 301 -1.5030000358819962e-02</internalNodes>\n          <leafValues>\n            -1.0491830110549927e+00 4.0160998702049255e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 302 -6.0715001076459885e-02</internalNodes>\n          <leafValues>\n            -1.0903840065002441e+00 1.5330800414085388e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 303 -1.2790000066161156e-02</internalNodes>\n          <leafValues>\n            4.2248600721359253e-01 -4.2399200797080994e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 304 -2.0247999578714371e-02</internalNodes>\n          <leafValues>\n            -9.1866999864578247e-01 1.8485699594020844e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 305 -3.0683999881148338e-02</internalNodes>\n          <leafValues>\n            -1.5958670377731323e+00 2.5760000571608543e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 306 -2.0718000829219818e-02</internalNodes>\n          <leafValues>\n            -6.6299998760223389e-01 3.1037199497222900e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 307 -1.7290000105276704e-03</internalNodes>\n          <leafValues>\n            1.9183400273323059e-01 -6.5084999799728394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 308 -3.1394001096487045e-02</internalNodes>\n          <leafValues>\n            -6.3643002510070801e-01 1.5408399701118469e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 309 1.9003000110387802e-02</internalNodes>\n          <leafValues>\n            -1.8919399380683899e-01 1.5294510126113892e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 310 6.1769997701048851e-03</internalNodes>\n          <leafValues>\n            -1.0597900301218033e-01 6.4859598875045776e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 311 -1.0165999643504620e-02</internalNodes>\n          <leafValues>\n            -1.0802700519561768e+00 3.7176001816987991e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 312 -1.4169999631121755e-03</internalNodes>\n          <leafValues>\n            3.4157499670982361e-01 -9.7737997770309448e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 313 -4.0799998678267002e-03</internalNodes>\n          <leafValues>\n            4.7624599933624268e-01 -3.4366300702095032e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 314 -4.4096998870372772e-02</internalNodes>\n          <leafValues>\n            9.7634297609329224e-01 -1.9173000007867813e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 315 -6.0669999569654465e-02</internalNodes>\n          <leafValues>\n            -2.1752851009368896e+00 -2.8925999999046326e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 316 -3.2931998372077942e-02</internalNodes>\n          <leafValues>\n            -6.4383101463317871e-01 1.6494099795818329e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 317 -1.4722800254821777e-01</internalNodes>\n          <leafValues>\n            -1.4745830297470093e+00 2.5839998852461576e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 318 -1.1930000036954880e-02</internalNodes>\n          <leafValues>\n            4.2441400885581970e-01 -1.7712600529193878e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 319 1.4517900347709656e-01</internalNodes>\n          <leafValues>\n            2.5444999337196350e-02 -1.2779400348663330e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 320 5.1447998732328415e-02</internalNodes>\n          <leafValues>\n            1.5678399801254272e-01 -1.5188430547714233e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 321 3.1479999888688326e-03</internalNodes>\n          <leafValues>\n            -4.0424400568008423e-01 3.2429701089859009e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 322 -4.3600000441074371e-02</internalNodes>\n          <leafValues>\n            -1.9932260513305664e+00 1.5018600225448608e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>83</maxWeakCount>\n      <stageThreshold>-3.8424909114837646e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 323 1.2899599969387054e-01</internalNodes>\n          <leafValues>\n            -6.2161999940872192e-01 1.1116520166397095e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 324 -9.1261997818946838e-02</internalNodes>\n          <leafValues>\n            1.0143059492111206e+00 -6.1335200071334839e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 325 1.4271999709308147e-02</internalNodes>\n          <leafValues>\n            -1.0261659622192383e+00 3.9779999852180481e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 326 3.2889999449253082e-02</internalNodes>\n          <leafValues>\n            -1.1386079788208008e+00 2.8690800070762634e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 327 1.2590000405907631e-02</internalNodes>\n          <leafValues>\n            -5.6645601987838745e-01 4.5172399282455444e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 328 1.4661000110208988e-02</internalNodes>\n          <leafValues>\n            3.0505999922752380e-01 -6.8129599094390869e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 329 -3.3555999398231506e-02</internalNodes>\n          <leafValues>\n            -1.7208939790725708e+00 6.1439000070095062e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 330 1.4252699911594391e-01</internalNodes>\n          <leafValues>\n            2.3192200064659119e-01 -1.7297149896621704e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 331 -6.2079997733235359e-03</internalNodes>\n          <leafValues>\n            -1.2163300514221191e+00 1.2160199880599976e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 332 1.8178999423980713e-02</internalNodes>\n          <leafValues>\n            3.2553699612617493e-01 -8.1003999710083008e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 333 2.5036999955773354e-02</internalNodes>\n          <leafValues>\n            -3.1698799133300781e-01 6.7361402511596680e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 334 4.6560999006032944e-02</internalNodes>\n          <leafValues>\n            -1.1089800298213959e-01 8.4082502126693726e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 335 -8.9999996125698090e-03</internalNodes>\n          <leafValues>\n            3.9574500918388367e-01 -4.7624599933624268e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 336 4.0805999189615250e-02</internalNodes>\n          <leafValues>\n            -1.8000000272877514e-04 9.4570702314376831e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 337 -3.4221999347209930e-02</internalNodes>\n          <leafValues>\n            7.5206297636032104e-01 -3.1531500816345215e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 338 -3.9716001600027084e-02</internalNodes>\n          <leafValues>\n            -8.3139598369598389e-01 1.7744399607181549e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 339 2.5170000735670328e-03</internalNodes>\n          <leafValues>\n            -5.9377998113632202e-01 2.4657000601291656e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 340 2.7428999543190002e-02</internalNodes>\n          <leafValues>\n            1.5998399257659912e-01 -4.2781999707221985e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 341 3.4986000508069992e-02</internalNodes>\n          <leafValues>\n            3.5055998712778091e-02 -1.5988600254058838e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 342 4.4970000162720680e-03</internalNodes>\n          <leafValues>\n            -5.2034300565719604e-01 3.7828299403190613e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 343 2.7699999045580626e-03</internalNodes>\n          <leafValues>\n            -5.3182601928710938e-01 2.4951000511646271e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 344 3.5174001008272171e-02</internalNodes>\n          <leafValues>\n            1.9983400404453278e-01 -1.4446129798889160e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 345 2.5970999151468277e-02</internalNodes>\n          <leafValues>\n            4.4426999986171722e-02 -1.3622980117797852e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 346 -1.5783999115228653e-02</internalNodes>\n          <leafValues>\n            -9.1020399332046509e-01 2.7190300822257996e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 347 -7.5880000367760658e-03</internalNodes>\n          <leafValues>\n            9.2064999043941498e-02 -8.1628900766372681e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 348 2.0754000172019005e-02</internalNodes>\n          <leafValues>\n            2.1185700595378876e-01 -7.4729001522064209e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 349 5.9829000383615494e-02</internalNodes>\n          <leafValues>\n            -2.7301099896430969e-01 8.0923300981521606e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 350 3.9039000868797302e-02</internalNodes>\n          <leafValues>\n            -1.0432299971580505e-01 8.6226201057434082e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 351 2.1665999665856361e-02</internalNodes>\n          <leafValues>\n            6.2709003686904907e-02 -9.8894298076629639e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 352 -2.7496999129652977e-02</internalNodes>\n          <leafValues>\n            -9.2690998315811157e-01 1.5586300194263458e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 353 1.0462000034749508e-02</internalNodes>\n          <leafValues>\n            1.3418099284172058e-01 -7.0386397838592529e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 354 2.4870999157428741e-02</internalNodes>\n          <leafValues>\n            1.9706700742244720e-01 -4.0263301134109497e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 355 -1.6036000102758408e-02</internalNodes>\n          <leafValues>\n            -1.1409829854965210e+00 7.3997996747493744e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 356 4.8627000302076340e-02</internalNodes>\n          <leafValues>\n            1.6990399360656738e-01 -7.2152197360992432e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 357 1.2619999470189214e-03</internalNodes>\n          <leafValues>\n            -4.7389799356460571e-01 2.6254999637603760e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 358 -8.8035002350807190e-02</internalNodes>\n          <leafValues>\n            -2.1606519222259521e+00 1.4554800093173981e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 359 1.8356999382376671e-02</internalNodes>\n          <leafValues>\n            4.4750999659299850e-02 -1.0766370296478271e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 360 3.5275001078844070e-02</internalNodes>\n          <leafValues>\n            -3.2919000834226608e-02 1.2153890132904053e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 361 -2.0392900705337524e-01</internalNodes>\n          <leafValues>\n            -1.3187999725341797e+00 1.5503999777138233e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 362 -1.6619000583887100e-02</internalNodes>\n          <leafValues>\n            3.6850199103355408e-01 -1.5283699333667755e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 363 3.7739001214504242e-02</internalNodes>\n          <leafValues>\n            -2.5727799534797668e-01 7.0655298233032227e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 364 2.2720000706613064e-03</internalNodes>\n          <leafValues>\n            -7.7602997422218323e-02 3.3367800712585449e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 365 -1.4802999794483185e-02</internalNodes>\n          <leafValues>\n            -7.8524798154830933e-01 7.6934002339839935e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 366 -4.8319000750780106e-02</internalNodes>\n          <leafValues>\n            1.7022320032119751e+00 4.9722000956535339e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 367 -2.9539000242948532e-02</internalNodes>\n          <leafValues>\n            7.7670699357986450e-01 -2.4534299969673157e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 368 -4.6169001609086990e-02</internalNodes>\n          <leafValues>\n            -1.4922779798507690e+00 1.2340000271797180e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 369 -2.8064999729394913e-02</internalNodes>\n          <leafValues>\n            -2.1345369815826416e+00 -2.5797000154852867e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 370 -5.7339998893439770e-03</internalNodes>\n          <leafValues>\n            5.6982600688934326e-01 -1.2056600302457809e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 371 -1.0111000388860703e-02</internalNodes>\n          <leafValues>\n            6.7911398410797119e-01 -2.6638001203536987e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 372 1.1359999887645245e-02</internalNodes>\n          <leafValues>\n            2.4789799749851227e-01 -6.4493000507354736e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 373 5.1809001713991165e-02</internalNodes>\n          <leafValues>\n            1.4716000296175480e-02 -1.2395579814910889e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 374 3.3291999250650406e-02</internalNodes>\n          <leafValues>\n            -8.2559995353221893e-03 1.0168470144271851e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 375 -1.4494000002741814e-02</internalNodes>\n          <leafValues>\n            4.5066800713539124e-01 -3.6250999569892883e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 376 -3.4221999347209930e-02</internalNodes>\n          <leafValues>\n            -9.5292502641677856e-01 2.0684599876403809e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 377 -8.0654002726078033e-02</internalNodes>\n          <leafValues>\n            -2.0139501094818115e+00 -2.3084999993443489e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 378 -8.9399999706074595e-04</internalNodes>\n          <leafValues>\n            3.9572000503540039e-01 -2.9351300001144409e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 379 9.7162000834941864e-02</internalNodes>\n          <leafValues>\n            -2.4980300664901733e-01 1.0859220027923584e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 380 3.6614000797271729e-02</internalNodes>\n          <leafValues>\n            -5.7844001799821854e-02 1.2162159681320190e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 381 5.1693998277187347e-02</internalNodes>\n          <leafValues>\n            4.3062999844551086e-02 -1.0636160373687744e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 382 -2.4557000026106834e-02</internalNodes>\n          <leafValues>\n            -4.8946800827980042e-01 1.7182900011539459e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 383 3.2736799120903015e-01</internalNodes>\n          <leafValues>\n            -2.9688599705696106e-01 5.1798301935195923e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 384 7.6959999278187752e-03</internalNodes>\n          <leafValues>\n            -5.9805899858474731e-01 2.4803200364112854e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 385 1.6172200441360474e-01</internalNodes>\n          <leafValues>\n            -2.9613999649882317e-02 -2.3162529468536377e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 386 -4.7889999113976955e-03</internalNodes>\n          <leafValues>\n            3.7457901239395142e-01 -3.2779198884963989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 387 -1.8402999266982079e-02</internalNodes>\n          <leafValues>\n            -9.9692702293395996e-01 7.2948001325130463e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 388 7.7665001153945923e-02</internalNodes>\n          <leafValues>\n            1.4175699651241302e-01 -1.7238730192184448e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 389 1.8921000882983208e-02</internalNodes>\n          <leafValues>\n            -2.1273100376129150e-01 1.0165189504623413e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 390 -7.9397998750209808e-02</internalNodes>\n          <leafValues>\n            -1.3164349794387817e+00 1.4981999993324280e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 391 -6.8037003278732300e-02</internalNodes>\n          <leafValues>\n            4.9421998858451843e-01 -2.9091000556945801e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 392 -6.1010001227259636e-03</internalNodes>\n          <leafValues>\n            4.2430499196052551e-01 -3.3899301290512085e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 393 3.1927000731229782e-02</internalNodes>\n          <leafValues>\n            -3.1046999618411064e-02 -2.3459999561309814e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 394 -2.9843999072909355e-02</internalNodes>\n          <leafValues>\n            -7.8989601135253906e-01 1.5417699515819550e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 395 -8.0541998147964478e-02</internalNodes>\n          <leafValues>\n            -2.2509229183197021e+00 -3.0906999483704567e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 396 3.8109999150037766e-03</internalNodes>\n          <leafValues>\n            -2.5577300786972046e-01 2.3785500228404999e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 397 3.3647000789642334e-02</internalNodes>\n          <leafValues>\n            -2.2541399300098419e-01 9.2307400703430176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 398 8.2809999585151672e-03</internalNodes>\n          <leafValues>\n            -2.8896200656890869e-01 3.1046199798583984e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 399 1.0104399919509888e-01</internalNodes>\n          <leafValues>\n            -3.4864000976085663e-02 -2.7102620601654053e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 400 -1.0009000077843666e-02</internalNodes>\n          <leafValues>\n            5.9715402126312256e-01 -3.3831000328063965e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 401 7.1919998154044151e-03</internalNodes>\n          <leafValues>\n            -4.7738000750541687e-01 2.2686000168323517e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 402 2.4969000369310379e-02</internalNodes>\n          <leafValues>\n            2.2877700626850128e-01 -1.0435529947280884e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 403 2.7908000349998474e-01</internalNodes>\n          <leafValues>\n            -2.5818100571632385e-01 7.6780498027801514e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 404 -4.4213000684976578e-02</internalNodes>\n          <leafValues>\n            -5.9798002243041992e-01 2.8039899468421936e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 405 -1.4136999845504761e-02</internalNodes>\n          <leafValues>\n            7.0987302064895630e-01 -2.5645199418067932e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>91</maxWeakCount>\n      <stageThreshold>-3.6478610038757324e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 406 1.3771200180053711e-01</internalNodes>\n          <leafValues>\n            -5.5870598554611206e-01 1.0953769683837891e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 407 3.4460999071598053e-02</internalNodes>\n          <leafValues>\n            -7.1171897649765015e-01 5.2899599075317383e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 408 1.8580000847578049e-02</internalNodes>\n          <leafValues>\n            -1.1157519817352295e+00 4.0593999624252319e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 409 2.5041999295353889e-02</internalNodes>\n          <leafValues>\n            -4.0892499685287476e-01 7.4129998683929443e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 410 5.7179000228643417e-02</internalNodes>\n          <leafValues>\n            -3.8054299354553223e-01 7.3647701740264893e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 411 1.4932000078260899e-02</internalNodes>\n          <leafValues>\n            -6.9945502281188965e-01 3.7950998544692993e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 412 8.8900001719594002e-03</internalNodes>\n          <leafValues>\n            -5.4558598995208740e-01 3.6332499980926514e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 413 3.0435999855399132e-02</internalNodes>\n          <leafValues>\n            -1.0124599933624268e-01 7.9585897922515869e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 414 -4.4160000979900360e-02</internalNodes>\n          <leafValues>\n            8.4410899877548218e-01 -3.2976400852203369e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 415 1.8461000174283981e-02</internalNodes>\n          <leafValues>\n            2.6326599717140198e-01 -9.6736502647399902e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 416 1.0614999569952488e-02</internalNodes>\n          <leafValues>\n            1.5251900255680084e-01 -1.0589870214462280e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 417 -4.5974001288414001e-02</internalNodes>\n          <leafValues>\n            -1.9918340444564819e+00 1.3629099726676941e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 418 8.2900002598762512e-02</internalNodes>\n          <leafValues>\n            -3.2037198543548584e-01 6.0304200649261475e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 419 -8.9130001142621040e-03</internalNodes>\n          <leafValues>\n            5.9586602449417114e-01 -2.1139599382877350e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 420 4.2814001441001892e-02</internalNodes>\n          <leafValues>\n            2.2925000637769699e-02 -1.4679330587387085e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 421 -8.7139997631311417e-03</internalNodes>\n          <leafValues>\n            -4.3989500403404236e-01 2.0439699292182922e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 422 -4.3390002101659775e-03</internalNodes>\n          <leafValues>\n            -8.9066797494888306e-01 1.0469999909400940e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 423 8.0749997869133949e-03</internalNodes>\n          <leafValues>\n            2.1164199709892273e-01 -4.0231600403785706e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 424 9.6739001572132111e-02</internalNodes>\n          <leafValues>\n            1.3319999910891056e-02 -1.6085360050201416e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 425 -3.0536999925971031e-02</internalNodes>\n          <leafValues>\n            1.0063740015029907e+00 -1.3413299620151520e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 426 -6.0855999588966370e-02</internalNodes>\n          <leafValues>\n            -1.4689979553222656e+00 9.4240000471472740e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 427 -3.8162000477313995e-02</internalNodes>\n          <leafValues>\n            -8.1636399030685425e-01 2.6171201467514038e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 428 -9.6960002556443214e-03</internalNodes>\n          <leafValues>\n            1.1561699956655502e-01 -7.1693199872970581e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 429 4.8902999609708786e-02</internalNodes>\n          <leafValues>\n            1.3050499558448792e-01 -1.6448370218276978e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 430 -4.1611999273300171e-02</internalNodes>\n          <leafValues>\n            -1.1795840263366699e+00 2.5017000734806061e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 431 -2.0188000053167343e-02</internalNodes>\n          <leafValues>\n            6.3188201189041138e-01 -1.0490400344133377e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 432 -9.7900000400841236e-04</internalNodes>\n          <leafValues>\n            1.8507799506187439e-01 -5.3565901517868042e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 433 -3.3622000366449356e-02</internalNodes>\n          <leafValues>\n            -9.3127602338790894e-01 2.0071500539779663e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 434 1.9455999135971069e-02</internalNodes>\n          <leafValues>\n            3.8029000163078308e-02 -1.0112210512161255e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 435 -3.1800000579096377e-04</internalNodes>\n          <leafValues>\n            3.6457699537277222e-01 -2.7610900998115540e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 436 -3.8899999344721437e-04</internalNodes>\n          <leafValues>\n            1.9665899872779846e-01 -5.3410500288009644e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 437 -9.3496002256870270e-02</internalNodes>\n          <leafValues>\n            -1.6772350072860718e+00 2.0727099478244781e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 438 -7.7877998352050781e-02</internalNodes>\n          <leafValues>\n            -3.0760629177093506e+00 -3.5803999751806259e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 439 1.6947999596595764e-02</internalNodes>\n          <leafValues>\n            2.1447399258613586e-01 -7.1376299858093262e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 440 -2.1459000185132027e-02</internalNodes>\n          <leafValues>\n            -1.1468060016632080e+00 1.5855999663472176e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 441 -1.2865999713540077e-02</internalNodes>\n          <leafValues>\n            8.3812397718429565e-01 -6.5944001078605652e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 442 7.8220004215836525e-03</internalNodes>\n          <leafValues>\n            -2.8026801347732544e-01 7.9376900196075439e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 443 1.0294400155544281e-01</internalNodes>\n          <leafValues>\n            1.7832300066947937e-01 -6.8412202596664429e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 444 -3.7487998604774475e-02</internalNodes>\n          <leafValues>\n            9.6189999580383301e-01 -2.1735599637031555e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 445 2.5505999103188515e-02</internalNodes>\n          <leafValues>\n            1.0103999637067318e-02 1.2461110353469849e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 446 6.6700001480057836e-04</internalNodes>\n          <leafValues>\n            -5.3488200902938843e-01 1.4746299386024475e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 447 -2.8867900371551514e-01</internalNodes>\n          <leafValues>\n            8.2172799110412598e-01 -1.4948000200092793e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 448 9.1294996440410614e-02</internalNodes>\n          <leafValues>\n            -1.9605399668216705e-01 1.0803170204162598e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 449 1.2056600302457809e-01</internalNodes>\n          <leafValues>\n            -2.3848999291658401e-02 1.1392610073089600e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 450 -7.3775000870227814e-02</internalNodes>\n          <leafValues>\n            -1.3583840131759644e+00 -4.2039998807013035e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 451 -3.3128000795841217e-02</internalNodes>\n          <leafValues>\n            -6.4483201503753662e-01 2.4142199754714966e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 452 -4.3937001377344131e-02</internalNodes>\n          <leafValues>\n            8.4285402297973633e-01 -2.0624800026416779e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 453 1.8110199272632599e-01</internalNodes>\n          <leafValues>\n            1.9212099909782410e-01 -1.2222139835357666e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 454 -1.1850999668240547e-02</internalNodes>\n          <leafValues>\n            -7.2677397727966309e-01 5.2687998861074448e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 455 4.5920000411570072e-03</internalNodes>\n          <leafValues>\n            -3.6305201053619385e-01 2.9223799705505371e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 456 7.0620002225041389e-03</internalNodes>\n          <leafValues>\n            5.8116000145673752e-02 -6.7161601781845093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 457 -2.3715000599622726e-02</internalNodes>\n          <leafValues>\n            4.7142100334167480e-01 1.8580000847578049e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 458 -6.7171998322010040e-02</internalNodes>\n          <leafValues>\n            -1.1331889629364014e+00 2.3780999705195427e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 459 -6.5310001373291016e-02</internalNodes>\n          <leafValues>\n            9.8253500461578369e-01 2.8362000361084938e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 460 2.2791000083088875e-02</internalNodes>\n          <leafValues>\n            -2.8213700652122498e-01 5.8993399143218994e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 461 -1.9037999212741852e-02</internalNodes>\n          <leafValues>\n            -6.3711500167846680e-01 2.6514598727226257e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 462 -6.8689999170601368e-03</internalNodes>\n          <leafValues>\n            3.7487301230430603e-01 -3.3232098817825317e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 463 -4.0146000683307648e-02</internalNodes>\n          <leafValues>\n            -1.3048729896545410e+00 1.5724299848079681e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 464 -4.0530998259782791e-02</internalNodes>\n          <leafValues>\n            -2.0458049774169922e+00 -2.6925999671220779e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 465 -1.2253999710083008e-02</internalNodes>\n          <leafValues>\n            7.7649402618408203e-01 -4.2971000075340271e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 466 -2.7219999581575394e-02</internalNodes>\n          <leafValues>\n            1.7424400150775909e-01 -4.4600901007652283e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 467 -8.8366001844406128e-02</internalNodes>\n          <leafValues>\n            -1.5036419630050659e+00 1.4289900660514832e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 468 -7.9159997403621674e-03</internalNodes>\n          <leafValues>\n            2.8666698932647705e-01 -3.7923699617385864e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 469 -4.1960000991821289e-02</internalNodes>\n          <leafValues>\n            1.3846950531005859e+00 6.5026998519897461e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 470 4.5662999153137207e-02</internalNodes>\n          <leafValues>\n            -2.2452299296855927e-01 7.9521000385284424e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 471 -1.4090600609779358e-01</internalNodes>\n          <leafValues>\n            -1.5879319906234741e+00 1.1359000205993652e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 472 -5.9216000139713287e-02</internalNodes>\n          <leafValues>\n            -1.1945960521697998e+00 -7.1640000678598881e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 473 4.3390002101659775e-03</internalNodes>\n          <leafValues>\n            -1.5528699755668640e-01 4.0664499998092651e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 474 -2.0369999110698700e-03</internalNodes>\n          <leafValues>\n            2.5927901268005371e-01 -3.8368299603462219e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 475 2.7516499161720276e-01</internalNodes>\n          <leafValues>\n            -8.8497996330261230e-02 7.6787501573562622e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 476 -2.6601999998092651e-02</internalNodes>\n          <leafValues>\n            7.5024497509002686e-01 -2.2621999680995941e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 477 4.0906000882387161e-02</internalNodes>\n          <leafValues>\n            1.2158600240945816e-01 -1.4566910266876221e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 478 5.5320002138614655e-03</internalNodes>\n          <leafValues>\n            -3.6611500382423401e-01 2.5968599319458008e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 479 3.1879000365734100e-02</internalNodes>\n          <leafValues>\n            -7.5019001960754395e-02 4.8484799265861511e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 480 -4.1482001543045044e-02</internalNodes>\n          <leafValues>\n            7.8220397233963013e-01 -2.1992200613021851e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 481 -9.6130996942520142e-02</internalNodes>\n          <leafValues>\n            -8.9456301927566528e-01 1.4680700004100800e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 482 -1.1568999849259853e-02</internalNodes>\n          <leafValues>\n            8.2714098691940308e-01 -2.0275600254535675e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 483 1.8312999978661537e-02</internalNodes>\n          <leafValues>\n            1.6367999836802483e-02 2.7306801080703735e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 484 -3.4166000783443451e-02</internalNodes>\n          <leafValues>\n            1.1307320594787598e+00 -1.8810899555683136e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 485 -2.4476999416947365e-02</internalNodes>\n          <leafValues>\n            -5.7791298627853394e-01 1.5812499821186066e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 486 4.8957001417875290e-02</internalNodes>\n          <leafValues>\n            -2.2564999759197235e-02 -1.6373280286788940e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 487 -2.0702999085187912e-02</internalNodes>\n          <leafValues>\n            -5.4512101411819458e-01 2.4086999893188477e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 488 -2.3002000525593758e-02</internalNodes>\n          <leafValues>\n            -1.2236540317535400e+00 -7.3440000414848328e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 489 6.4585000276565552e-02</internalNodes>\n          <leafValues>\n            1.4695599675178528e-01 -4.4967499375343323e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 490 1.2666000053286552e-02</internalNodes>\n          <leafValues>\n            -2.7873900532722473e-01 4.3876600265502930e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 491 -1.2002999894320965e-02</internalNodes>\n          <leafValues>\n            -2.4289099872112274e-01 2.5350099802017212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 492 -2.6443999260663986e-02</internalNodes>\n          <leafValues>\n            -8.5864800214767456e-01 2.6025999337434769e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 493 -2.5547999888658524e-02</internalNodes>\n          <leafValues>\n            6.9287902116775513e-01 -2.1160000469535589e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 494 3.9115000516176224e-02</internalNodes>\n          <leafValues>\n            -1.6589100658893585e-01 1.5209139585494995e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 495 -6.0330000706017017e-03</internalNodes>\n          <leafValues>\n            4.3856900930404663e-01 -2.1613700687885284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 496 -3.3936999738216400e-02</internalNodes>\n          <leafValues>\n            -9.7998398542404175e-01 2.2133000195026398e-02</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>99</maxWeakCount>\n      <stageThreshold>-3.8700489997863770e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 497 4.0672998875379562e-02</internalNodes>\n          <leafValues>\n            -9.0474700927734375e-01 6.4410597085952759e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 498 2.5609999895095825e-02</internalNodes>\n          <leafValues>\n            -7.9216998815536499e-01 5.7489997148513794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 499 1.9959500432014465e-01</internalNodes>\n          <leafValues>\n            -3.0099600553512573e-01 1.3143850564956665e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 500 1.2404999695718288e-02</internalNodes>\n          <leafValues>\n            -8.9882999658584595e-01 2.9205799102783203e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 501 3.9207998663187027e-02</internalNodes>\n          <leafValues>\n            -4.1955199837684631e-01 5.3463298082351685e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 502 -3.0843999236822128e-02</internalNodes>\n          <leafValues>\n            4.5793399214744568e-01 -4.4629099965095520e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 503 -3.5523001104593277e-02</internalNodes>\n          <leafValues>\n            9.1310501098632812e-01 -2.7373200654983521e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 504 -6.1650000512599945e-02</internalNodes>\n          <leafValues>\n            -1.4697799682617188e+00 2.0364099740982056e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 505 -1.1739999987185001e-02</internalNodes>\n          <leafValues>\n            -1.0482879877090454e+00 6.7801997065544128e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 506 6.6933996975421906e-02</internalNodes>\n          <leafValues>\n            2.9274499416351318e-01 -5.2282899618148804e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 507 -2.0631000399589539e-02</internalNodes>\n          <leafValues>\n            -1.2855139970779419e+00 4.4550999999046326e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 508 -2.2357000038027763e-02</internalNodes>\n          <leafValues>\n            -8.5753798484802246e-01 1.8434000015258789e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 509 1.1500000255182385e-03</internalNodes>\n          <leafValues>\n            1.6405500471591949e-01 -6.9125002622604370e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 510 3.5872999578714371e-02</internalNodes>\n          <leafValues>\n            1.5756499767303467e-01 -8.4262597560882568e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 511 3.0659999698400497e-02</internalNodes>\n          <leafValues>\n            2.1637000143527985e-02 -1.3634690046310425e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 512 5.5559999309480190e-03</internalNodes>\n          <leafValues>\n            -1.6737000644207001e-01 2.5888401269912720e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 513 -6.1160000041127205e-03</internalNodes>\n          <leafValues>\n            -9.7271800041198730e-01 6.6100001335144043e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 514 -3.0316999182105064e-02</internalNodes>\n          <leafValues>\n            9.8474198579788208e-01 -1.6448000445961952e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 515 -9.7200004383921623e-03</internalNodes>\n          <leafValues>\n            4.7604700922966003e-01 -3.2516700029373169e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 516 -5.7126998901367188e-02</internalNodes>\n          <leafValues>\n            -9.5920699834823608e-01 1.9938200712203979e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 517 4.0059997700154781e-03</internalNodes>\n          <leafValues>\n            -5.2612501382827759e-01 2.2428700327873230e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 518 3.3734001219272614e-02</internalNodes>\n          <leafValues>\n            1.7070099711418152e-01 -1.0737580060958862e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 519 -3.4641999751329422e-02</internalNodes>\n          <leafValues>\n            -1.1343129873275757e+00 3.6540001630783081e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 520 4.6923000365495682e-02</internalNodes>\n          <leafValues>\n            2.5832301378250122e-01 -7.1535801887512207e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 521 -8.7660001590847969e-03</internalNodes>\n          <leafValues>\n            1.9640900194644928e-01 -5.3355097770690918e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 522 6.5627999603748322e-02</internalNodes>\n          <leafValues>\n            -5.1194999366998672e-02 9.7610700130462646e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 523 -4.4165000319480896e-02</internalNodes>\n          <leafValues>\n            1.0631920099258423e+00 -2.3462599515914917e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 524 1.7304999753832817e-02</internalNodes>\n          <leafValues>\n            -1.8582899868488312e-01 4.5889899134635925e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 525 3.3135998994112015e-02</internalNodes>\n          <leafValues>\n            -2.9381999745965004e-02 -2.6651329994201660e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 526 -2.1029999479651451e-02</internalNodes>\n          <leafValues>\n            9.9979901313781738e-01 2.4937000125646591e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 527 2.9783999547362328e-02</internalNodes>\n          <leafValues>\n            -2.9605999588966370e-02 -2.1695868968963623e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 528 5.5291999131441116e-02</internalNodes>\n          <leafValues>\n            -7.5599999399855733e-04 7.4651998281478882e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 529 -3.3597998321056366e-02</internalNodes>\n          <leafValues>\n            -1.5274159908294678e+00 1.1060000397264957e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 530 1.9602999091148376e-02</internalNodes>\n          <leafValues>\n            3.3574998378753662e-02 9.9526202678680420e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 531 -2.0787000656127930e-02</internalNodes>\n          <leafValues>\n            7.6612901687622070e-01 -2.4670800566673279e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 532 3.2536000013351440e-02</internalNodes>\n          <leafValues>\n            1.6263400018215179e-01 -6.1134302616119385e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 533 -1.0788000188767910e-02</internalNodes>\n          <leafValues>\n            -9.7839701175689697e-01 2.8969999402761459e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 534 -9.9560003727674484e-03</internalNodes>\n          <leafValues>\n            4.6145799756050110e-01 -1.3510499894618988e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 535 -3.7489999085664749e-03</internalNodes>\n          <leafValues>\n            2.5458198785781860e-01 -5.1955598592758179e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 536 -4.1779998689889908e-02</internalNodes>\n          <leafValues>\n            -8.0565100908279419e-01 1.5208500623703003e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 537 -3.4221000969409943e-02</internalNodes>\n          <leafValues>\n            -1.3137799501419067e+00 -3.5800000187009573e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 538 1.0130000300705433e-02</internalNodes>\n          <leafValues>\n            2.0175799727439880e-01 -6.1339598894119263e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 539 -8.9849002659320831e-02</internalNodes>\n          <leafValues>\n            9.7632801532745361e-01 -2.0884799957275391e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 540 2.6097999885678291e-02</internalNodes>\n          <leafValues>\n            -1.8807999789714813e-01 4.7705799341201782e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 541 -3.7539999466389418e-03</internalNodes>\n          <leafValues>\n            -6.7980402708053589e-01 1.1288800090551376e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 542 3.1973000615835190e-02</internalNodes>\n          <leafValues>\n            1.8951700627803802e-01 -1.4967479705810547e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 543 1.9332999363541603e-02</internalNodes>\n          <leafValues>\n            -2.3609900474548340e-01 8.1320500373840332e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 544 1.9490000559017062e-03</internalNodes>\n          <leafValues>\n            2.4830399453639984e-01 -6.9211997091770172e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 545 -4.4146999716758728e-02</internalNodes>\n          <leafValues>\n            -1.0418920516967773e+00 4.8053000122308731e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 546 -4.4681999832391739e-02</internalNodes>\n          <leafValues>\n            5.1346302032470703e-01 -7.3799998499453068e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 547 -1.0757499933242798e-01</internalNodes>\n          <leafValues>\n            1.6202019453048706e+00 -1.8667599558830261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 548 -1.2846800684928894e-01</internalNodes>\n          <leafValues>\n            2.9869480133056641e+00 9.5427997410297394e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 549 -4.4757999479770660e-02</internalNodes>\n          <leafValues>\n            6.0405302047729492e-01 -2.7058699727058411e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 550 -4.3990999460220337e-02</internalNodes>\n          <leafValues>\n            -6.1790502071380615e-01 1.5997199714183807e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 551 -1.2268999963998795e-01</internalNodes>\n          <leafValues>\n            6.6327202320098877e-01 -2.3636999726295471e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 552 -1.9982999190688133e-02</internalNodes>\n          <leafValues>\n            -1.1228660345077515e+00 1.9616700708866119e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 553 -1.5527999959886074e-02</internalNodes>\n          <leafValues>\n            -1.0770269632339478e+00 2.0693000406026840e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 554 -4.8971001058816910e-02</internalNodes>\n          <leafValues>\n            8.1168299913406372e-01 -1.7252000048756599e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 555 5.5975999683141708e-02</internalNodes>\n          <leafValues>\n            -2.2529000416398048e-02 -1.7356760501861572e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 556 -9.8580000922083855e-03</internalNodes>\n          <leafValues>\n            6.7881399393081665e-01 -5.8180000633001328e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 557 1.3481000438332558e-02</internalNodes>\n          <leafValues>\n            5.7847999036312103e-02 -7.7255302667617798e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 558 6.5609999001026154e-03</internalNodes>\n          <leafValues>\n            -1.3146899640560150e-01 6.7055797576904297e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 559 7.1149999275803566e-03</internalNodes>\n          <leafValues>\n            -3.7880599498748779e-01 3.0978998541831970e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 560 4.8159998841583729e-03</internalNodes>\n          <leafValues>\n            -5.8470398187637329e-01 2.5602099299430847e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 561 9.5319999381899834e-03</internalNodes>\n          <leafValues>\n            -3.0217000842094421e-01 4.1253298521041870e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 562 -2.7474999427795410e-02</internalNodes>\n          <leafValues>\n            5.9154701232910156e-01 1.7963999882340431e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 563 -3.9519999176263809e-02</internalNodes>\n          <leafValues>\n            9.6913498640060425e-01 -2.1020300686359406e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 564 -3.0658999457955360e-02</internalNodes>\n          <leafValues>\n            9.1155898571014404e-01 4.0550000965595245e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 565 -1.4680000022053719e-03</internalNodes>\n          <leafValues>\n            -6.0489797592163086e-01 1.6960899531841278e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 566 1.9077600538730621e-01</internalNodes>\n          <leafValues>\n            4.3515000492334366e-02 8.1892901659011841e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 567 5.1790000870823860e-03</internalNodes>\n          <leafValues>\n            -9.3617302179336548e-01 2.4937000125646591e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 568 2.4126000702381134e-02</internalNodes>\n          <leafValues>\n            1.8175500631332397e-01 -3.4185901284217834e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 569 -2.6383999735116959e-02</internalNodes>\n          <leafValues>\n            -1.2912579774856567e+00 -3.4280000254511833e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 570 5.4139997810125351e-03</internalNodes>\n          <leafValues>\n            -4.6291999518871307e-02 2.5269600749015808e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 571 5.4216001182794571e-02</internalNodes>\n          <leafValues>\n            -1.2848000042140484e-02 -1.4304540157318115e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 572 2.3799999326001853e-04</internalNodes>\n          <leafValues>\n            -2.6676699519157410e-01 3.3588299155235291e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 573 1.5216999687254429e-02</internalNodes>\n          <leafValues>\n            -5.1367300748825073e-01 1.3005100190639496e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 574 1.7007999122142792e-02</internalNodes>\n          <leafValues>\n            4.1575899720191956e-01 -3.1241199374198914e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 575 3.0496999621391296e-02</internalNodes>\n          <leafValues>\n            -2.4820999801158905e-01 7.0828497409820557e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 576 6.5430002287030220e-03</internalNodes>\n          <leafValues>\n            -2.2637000679969788e-01 1.9184599816799164e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 577 1.4163999259471893e-01</internalNodes>\n          <leafValues>\n            6.5227001905441284e-02 -8.8809502124786377e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 578 1.9338000565767288e-02</internalNodes>\n          <leafValues>\n            1.8891200423240662e-01 -2.7397701144218445e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 579 -1.7324000597000122e-02</internalNodes>\n          <leafValues>\n            -9.4866698980331421e-01 2.4196999147534370e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 580 -6.2069999985396862e-03</internalNodes>\n          <leafValues>\n            3.6938399076461792e-01 -1.7494900524616241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 581 -1.6109000891447067e-02</internalNodes>\n          <leafValues>\n            9.6159499883651733e-01 -2.0005300641059875e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 582 -1.0122500360012054e-01</internalNodes>\n          <leafValues>\n            -3.0699110031127930e+00 1.1363799870014191e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 583 -7.5509999878704548e-03</internalNodes>\n          <leafValues>\n            2.2921000421047211e-01 -4.5645099878311157e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 584 4.4247999787330627e-02</internalNodes>\n          <leafValues>\n            -3.1599999056197703e-04 3.9225301146507263e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 585 -1.1636000126600266e-01</internalNodes>\n          <leafValues>\n            9.5233702659606934e-01 -2.0201599597930908e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 586 4.7360002063214779e-03</internalNodes>\n          <leafValues>\n            -9.9177002906799316e-02 2.0370499789714813e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 587 2.2459000349044800e-02</internalNodes>\n          <leafValues>\n            8.7280003353953362e-03 -1.0217070579528809e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 588 -1.2109000235795975e-02</internalNodes>\n          <leafValues>\n            6.4812600612640381e-01 -9.0149000287055969e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 589 5.6120000779628754e-02</internalNodes>\n          <leafValues>\n            -3.6759998649358749e-02 -1.9275590181350708e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 590 -8.7379999458789825e-03</internalNodes>\n          <leafValues>\n            6.9261300563812256e-01 -6.8374998867511749e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 591 6.6399998031556606e-03</internalNodes>\n          <leafValues>\n            -4.0569800138473511e-01 1.8625700473785400e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 592 -1.8131999298930168e-02</internalNodes>\n          <leafValues>\n            -6.4518201351165771e-01 2.1976399421691895e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 593 -2.2718999534845352e-02</internalNodes>\n          <leafValues>\n            9.7776198387145996e-01 -1.8654300272464752e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 594 1.2705000117421150e-02</internalNodes>\n          <leafValues>\n            -1.0546600073575974e-01 3.7404099106788635e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 595 -1.3682999648153782e-02</internalNodes>\n          <leafValues>\n            6.1064100265502930e-01 -2.6881098747253418e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>115</maxWeakCount>\n      <stageThreshold>-3.7160909175872803e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 596 3.1357999891042709e-02</internalNodes>\n          <leafValues>\n            -1.0183910131454468e+00 5.7528597116470337e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 597 9.3050003051757812e-02</internalNodes>\n          <leafValues>\n            -4.1297501325607300e-01 1.0091199874877930e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 598 2.5949999690055847e-02</internalNodes>\n          <leafValues>\n            -5.8587902784347534e-01 5.6606197357177734e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 599 1.6472000628709793e-02</internalNodes>\n          <leafValues>\n            -9.2857497930526733e-01 3.0924499034881592e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 600 -1.8779999809339643e-03</internalNodes>\n          <leafValues>\n            1.1951000243425369e-01 -1.1180130243301392e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 601 -9.0129999443888664e-03</internalNodes>\n          <leafValues>\n            -5.7849502563476562e-01 3.3154401183128357e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 602 2.2547999396920204e-02</internalNodes>\n          <leafValues>\n            -3.8325101137161255e-01 5.2462202310562134e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 603 -3.7780001759529114e-02</internalNodes>\n          <leafValues>\n            1.1790670156478882e+00 -3.4166999161243439e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 604 -5.3799999877810478e-03</internalNodes>\n          <leafValues>\n            -8.6265897750854492e-01 1.1867900192737579e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 605 -2.3893000558018684e-02</internalNodes>\n          <leafValues>\n            -7.4950599670410156e-01 2.1011400222778320e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 606 -2.6521999388933182e-02</internalNodes>\n          <leafValues>\n            9.2128598690032959e-01 -2.8252801299095154e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 607 1.2280000373721123e-02</internalNodes>\n          <leafValues>\n            2.6662799715995789e-01 -7.0013600587844849e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 608 9.6594996750354767e-02</internalNodes>\n          <leafValues>\n            -2.8453999757766724e-01 7.3168998956680298e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 609 -2.7414999902248383e-02</internalNodes>\n          <leafValues>\n            -6.1492699384689331e-01 1.5576200187206268e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 610 -1.5767000615596771e-02</internalNodes>\n          <leafValues>\n            5.7551199197769165e-01 -3.4362199902534485e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 611 -2.1100000012665987e-03</internalNodes>\n          <leafValues>\n            3.2599699497222900e-01 -1.3008299469947815e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 612 1.2006999924778938e-02</internalNodes>\n          <leafValues>\n            8.9322999119758606e-02 -9.6025598049163818e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 613 -1.5421999618411064e-02</internalNodes>\n          <leafValues>\n            3.4449499845504761e-01 -4.6711999177932739e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 614 -4.1579999960958958e-03</internalNodes>\n          <leafValues>\n            2.3696300387382507e-01 -5.2563297748565674e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 615 -2.1185999736189842e-02</internalNodes>\n          <leafValues>\n            -7.4267697334289551e-01 2.1702000498771667e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 616 -1.7077000811696053e-02</internalNodes>\n          <leafValues>\n            -9.0471798181533813e-01 6.6012002527713776e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 617 -4.0849998593330383e-02</internalNodes>\n          <leafValues>\n            -3.4446600079536438e-01 2.1503700315952301e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 618 -8.1930002197623253e-03</internalNodes>\n          <leafValues>\n            -9.3388599157333374e-01 5.0471000373363495e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 619 -1.9238000735640526e-02</internalNodes>\n          <leafValues>\n            -5.3203701972961426e-01 1.7240600287914276e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 620 -4.4192001223564148e-02</internalNodes>\n          <leafValues>\n            9.2075002193450928e-01 -2.2148500382900238e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 621 -6.2392000108957291e-02</internalNodes>\n          <leafValues>\n            -7.1053802967071533e-01 1.8323899805545807e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 622 -1.0079999919980764e-03</internalNodes>\n          <leafValues>\n            -8.7063097953796387e-01 5.5330000817775726e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 623 2.3870000615715981e-02</internalNodes>\n          <leafValues>\n            -2.2854200005531311e-01 5.2415597438812256e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 624 2.1391000598669052e-02</internalNodes>\n          <leafValues>\n            -3.0325898528099060e-01 5.5860602855682373e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 625 2.0254999399185181e-02</internalNodes>\n          <leafValues>\n            2.6901501417160034e-01 -7.0261800289154053e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 626 -2.8772000223398209e-02</internalNodes>\n          <leafValues>\n            -1.1835030317306519e+00 4.6512000262737274e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 627 3.4199999645352364e-03</internalNodes>\n          <leafValues>\n            -5.4652100801467896e-01 2.5962498784065247e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 628 5.6983001530170441e-02</internalNodes>\n          <leafValues>\n            -2.6982900500297546e-01 5.8170700073242188e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 629 -9.3892000615596771e-02</internalNodes>\n          <leafValues>\n            -9.1046398878097534e-01 1.9677700102329254e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 630 1.7699999734759331e-02</internalNodes>\n          <leafValues>\n            -4.4003298878669739e-01 2.1349500119686127e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 631 2.2844199836254120e-01</internalNodes>\n          <leafValues>\n            2.3605000227689743e-02 7.7171599864959717e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 632 -1.8287500739097595e-01</internalNodes>\n          <leafValues>\n            7.9228597879409790e-01 -2.4644799530506134e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 633 -6.9891996681690216e-02</internalNodes>\n          <leafValues>\n            8.0267798900604248e-01 -3.6072000861167908e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 634 1.5297000296413898e-02</internalNodes>\n          <leafValues>\n            -2.0072300732135773e-01 1.1030600070953369e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 635 6.7500001750886440e-03</internalNodes>\n          <leafValues>\n            -4.5967999845743179e-02 7.2094500064849854e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 636 -1.5983000397682190e-02</internalNodes>\n          <leafValues>\n            -9.0357202291488647e-01 4.4987998902797699e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 637 1.3088000006973743e-02</internalNodes>\n          <leafValues>\n            3.5297098755836487e-01 -3.7710601091384888e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 638 1.3061000034213066e-02</internalNodes>\n          <leafValues>\n            -1.9583599269390106e-01 1.1198940277099609e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 639 -3.9907000958919525e-02</internalNodes>\n          <leafValues>\n            -1.3998429775238037e+00 1.9145099818706512e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 640 1.5026999637484550e-02</internalNodes>\n          <leafValues>\n            2.3600000422447920e-03 -1.1611249446868896e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 641 -2.0517999306321144e-02</internalNodes>\n          <leafValues>\n            -4.8908099532127380e-01 1.6743400692939758e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 642 -2.2359000518918037e-02</internalNodes>\n          <leafValues>\n            -1.2202980518341064e+00 -1.1975999921560287e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 643 -7.9150004312396049e-03</internalNodes>\n          <leafValues>\n            3.7228098511695862e-01 -8.5063003003597260e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 644 1.5258000232279301e-02</internalNodes>\n          <leafValues>\n            -2.9412600398063660e-01 5.9406399726867676e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 645 -3.1665999442338943e-02</internalNodes>\n          <leafValues>\n            -1.4395569562911987e+00 1.3578799366950989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 646 -3.0773999169468880e-02</internalNodes>\n          <leafValues>\n            -2.2545371055603027e+00 -3.3971000462770462e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 647 -1.5483000315725803e-02</internalNodes>\n          <leafValues>\n            3.7700700759887695e-01 1.5847999602556229e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 648 3.5167001187801361e-02</internalNodes>\n          <leafValues>\n            -2.9446101188659668e-01 5.3159099817276001e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 649 -1.7906000837683678e-02</internalNodes>\n          <leafValues>\n            -9.9788200855255127e-01 1.6235999763011932e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 650 -3.1799999997019768e-03</internalNodes>\n          <leafValues>\n            4.7657001763582230e-02 -7.5249898433685303e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 651 1.5720000490546227e-02</internalNodes>\n          <leafValues>\n            1.4873799681663513e-01 -6.5375399589538574e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 652 2.9864000156521797e-02</internalNodes>\n          <leafValues>\n            -1.4952000230550766e-02 -1.2275190353393555e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 653 2.9899999499320984e-03</internalNodes>\n          <leafValues>\n            -1.4263699948787689e-01 4.3272799253463745e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 654 8.4749996662139893e-02</internalNodes>\n          <leafValues>\n            -1.9280999898910522e-02 -1.1946409940719604e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 655 -5.8724999427795410e-02</internalNodes>\n          <leafValues>\n            -1.7328219413757324e+00 1.4374700188636780e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 656 4.4755998998880386e-02</internalNodes>\n          <leafValues>\n            -2.4140599370002747e-01 5.4019999504089355e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 657 4.0369000285863876e-02</internalNodes>\n          <leafValues>\n            5.7680001482367516e-03 5.6578099727630615e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 658 3.7735998630523682e-02</internalNodes>\n          <leafValues>\n            3.8180999457836151e-02 -7.9370397329330444e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 659 6.0752999037504196e-02</internalNodes>\n          <leafValues>\n            7.6453000307083130e-02 1.4813209772109985e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 660 -1.9832000136375427e-02</internalNodes>\n          <leafValues>\n            -1.6971720457077026e+00 -2.7370000258088112e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 661 -1.6592699289321899e-01</internalNodes>\n          <leafValues>\n            6.2976002693176270e-01 3.1762998551130295e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 662 6.9014996290206909e-02</internalNodes>\n          <leafValues>\n            -3.3463200926780701e-01 3.0076700448989868e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 663 1.1358000338077545e-02</internalNodes>\n          <leafValues>\n            2.2741499543190002e-01 -3.8224700093269348e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 664 1.7000000225380063e-03</internalNodes>\n          <leafValues>\n            1.9223800301551819e-01 -5.2735102176666260e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 665 7.9769000411033630e-02</internalNodes>\n          <leafValues>\n            9.1491997241973877e-02 2.1049048900604248e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 666 -5.7144001126289368e-02</internalNodes>\n          <leafValues>\n            -1.7452130317687988e+00 -4.0910001844167709e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 667 7.3830001056194305e-03</internalNodes>\n          <leafValues>\n            -2.4214799702167511e-01 3.5577800869941711e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 668 -1.8040999770164490e-02</internalNodes>\n          <leafValues>\n            1.1779999732971191e+00 -1.7676700651645660e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 669 9.4503000378608704e-02</internalNodes>\n          <leafValues>\n            1.3936099410057068e-01 -1.2993700504302979e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 670 5.4210000671446323e-03</internalNodes>\n          <leafValues>\n            -5.4608601331710815e-01 1.3916400074958801e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 671 7.0290002040565014e-03</internalNodes>\n          <leafValues>\n            -2.1597200632095337e-01 3.9258098602294922e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 672 3.4515999257564545e-02</internalNodes>\n          <leafValues>\n            6.3188999891281128e-02 -7.2108101844787598e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 673 -5.1924999803304672e-02</internalNodes>\n          <leafValues>\n            6.8667602539062500e-01 6.3272997736930847e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 674 -6.9162003695964813e-02</internalNodes>\n          <leafValues>\n            1.7411810159683228e+00 -1.6619299352169037e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 675 -5.5229999125003815e-03</internalNodes>\n          <leafValues>\n            3.0694699287414551e-01 -1.6662900149822235e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 676 6.8599998950958252e-02</internalNodes>\n          <leafValues>\n            -2.1405400335788727e-01 7.3185002803802490e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 677 -6.7038998007774353e-02</internalNodes>\n          <leafValues>\n            -7.9360598325729370e-01 2.0525799691677094e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 678 -2.1005000919103622e-02</internalNodes>\n          <leafValues>\n            3.7344399094581604e-01 -2.9618600010871887e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 679 2.0278999581933022e-02</internalNodes>\n          <leafValues>\n            -1.5200000256299973e-02 4.0555301308631897e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 680 -4.7107998281717300e-02</internalNodes>\n          <leafValues>\n            1.2116849422454834e+00 -1.7464299499988556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 681 1.8768499791622162e-01</internalNodes>\n          <leafValues>\n            -2.2909000515937805e-02 6.9645798206329346e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 682 -4.3228998780250549e-02</internalNodes>\n          <leafValues>\n            -1.0602480173110962e+00 -5.5599998449906707e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 683 2.0004000514745712e-02</internalNodes>\n          <leafValues>\n            -3.2751001417636871e-02 5.3805100917816162e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 684 8.0880001187324524e-03</internalNodes>\n          <leafValues>\n            3.7548001855611801e-02 -7.4768900871276855e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 685 2.7101000770926476e-02</internalNodes>\n          <leafValues>\n            -8.1790000200271606e-02 3.3387100696563721e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 686 -9.1746002435684204e-02</internalNodes>\n          <leafValues>\n            -1.9213509559631348e+00 -3.8952998816967010e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 687 -1.2454999610781670e-02</internalNodes>\n          <leafValues>\n            4.8360601067543030e-01 1.8168000504374504e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 688 1.4649000018835068e-02</internalNodes>\n          <leafValues>\n            -1.9906699657440186e-01 7.2815400362014771e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 689 2.9101999476552010e-02</internalNodes>\n          <leafValues>\n            1.9871099293231964e-01 -4.9216800928115845e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 690 8.7799998000264168e-03</internalNodes>\n          <leafValues>\n            -1.9499599933624268e-01 7.7317398786544800e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 691 -5.4740000516176224e-02</internalNodes>\n          <leafValues>\n            1.8087190389633179e+00 6.8323001265525818e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 692 -1.4798000454902649e-02</internalNodes>\n          <leafValues>\n            7.8064900636672974e-01 -1.8709599971771240e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 693 2.5012999773025513e-02</internalNodes>\n          <leafValues>\n            1.5285299718379974e-01 -1.6021020412445068e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 694 4.6548001468181610e-02</internalNodes>\n          <leafValues>\n            -1.6738200187683105e-01 1.1902060508728027e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 695 1.7624000087380409e-02</internalNodes>\n          <leafValues>\n            -1.0285499691963196e-01 3.9175900816917419e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 696 1.6319599747657776e-01</internalNodes>\n          <leafValues>\n            -3.5624001175165176e-02 -1.6098170280456543e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 697 1.3137999922037125e-02</internalNodes>\n          <leafValues>\n            -5.6359000504016876e-02 5.4158902168273926e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 698 -1.5665000304579735e-02</internalNodes>\n          <leafValues>\n            2.8063100576400757e-01 -3.1708601117134094e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 699 8.0554001033306122e-02</internalNodes>\n          <leafValues>\n            1.2640400230884552e-01 -1.0297529697418213e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 700 3.5363998264074326e-02</internalNodes>\n          <leafValues>\n            2.0752999931573868e-02 -7.9105597734451294e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 701 3.2986998558044434e-02</internalNodes>\n          <leafValues>\n            1.9057099521160126e-01 -8.3839899301528931e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 702 1.2195000424981117e-02</internalNodes>\n          <leafValues>\n            7.3729000985622406e-02 -6.2780702114105225e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 703 4.3065998703241348e-02</internalNodes>\n          <leafValues>\n            4.7384999692440033e-02 1.5712939500808716e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 704 3.0326999723911285e-02</internalNodes>\n          <leafValues>\n            -2.7314600348472595e-01 3.8572001457214355e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 705 3.5493001341819763e-02</internalNodes>\n          <leafValues>\n            5.4593998938798904e-02 5.2583402395248413e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 706 -1.4596999622881413e-02</internalNodes>\n          <leafValues>\n            3.8152599334716797e-01 -2.8332400321960449e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 707 1.2606999836862087e-02</internalNodes>\n          <leafValues>\n            1.5455099940299988e-01 -3.0501499772071838e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 708 1.0172000154852867e-02</internalNodes>\n          <leafValues>\n            2.3637000471353531e-02 -8.7217897176742554e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 709 2.8843000531196594e-02</internalNodes>\n          <leafValues>\n            1.6090999543666840e-01 -2.0277599990367889e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 710 5.5100000463426113e-04</internalNodes>\n          <leafValues>\n            -6.1545401811599731e-01 8.0935999751091003e-02</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>127</maxWeakCount>\n      <stageThreshold>-3.5645289421081543e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 711 4.8344001173973083e-02</internalNodes>\n          <leafValues>\n            -8.4904599189758301e-01 5.6974399089813232e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 712 3.2460000365972519e-02</internalNodes>\n          <leafValues>\n            -8.1417298316955566e-01 4.4781699776649475e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 713 3.3339999616146088e-02</internalNodes>\n          <leafValues>\n            -3.6423799395561218e-01 6.7937397956848145e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 714 6.4019998535513878e-03</internalNodes>\n          <leafValues>\n            -1.1885459423065186e+00 1.9238699972629547e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 715 -5.6889997795224190e-03</internalNodes>\n          <leafValues>\n            3.3085298538208008e-01 -7.1334099769592285e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 716 1.2698000296950340e-02</internalNodes>\n          <leafValues>\n            -5.0990802049636841e-01 1.1376299709081650e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 717 6.0549997724592686e-03</internalNodes>\n          <leafValues>\n            -1.0470550060272217e+00 2.0222599804401398e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 718 2.6420000940561295e-03</internalNodes>\n          <leafValues>\n            -5.0559401512145996e-01 3.6441200971603394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 719 -1.6925999894738197e-02</internalNodes>\n          <leafValues>\n            -9.9541902542114258e-01 1.2602199614048004e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 720 2.8235999867320061e-02</internalNodes>\n          <leafValues>\n            -9.4137996435165405e-02 5.7780402898788452e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 721 1.0428999550640583e-02</internalNodes>\n          <leafValues>\n            2.3272900283336639e-01 -5.2569699287414551e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 722 9.8860003054141998e-03</internalNodes>\n          <leafValues>\n            -1.0316299647092819e-01 4.7657600045204163e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 723 2.6015000417828560e-02</internalNodes>\n          <leafValues>\n            -1.0920000495389104e-03 -1.5581729412078857e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 724 -2.5537999346852303e-02</internalNodes>\n          <leafValues>\n            -6.5451401472091675e-01 1.8843199312686920e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 725 -3.5310001112520695e-03</internalNodes>\n          <leafValues>\n            2.8140598535537720e-01 -4.4575300812721252e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 726 9.2449998483061790e-03</internalNodes>\n          <leafValues>\n            1.5612000226974487e-01 -2.1370999515056610e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 727 2.1030999720096588e-02</internalNodes>\n          <leafValues>\n            -2.9170298576354980e-01 5.2234101295471191e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 728 -5.1063001155853271e-02</internalNodes>\n          <leafValues>\n            1.3661290407180786e+00 3.0465999618172646e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 729 -6.2330000102519989e-02</internalNodes>\n          <leafValues>\n            1.2207020521163940e+00 -2.2434400022029877e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 730 -3.2963000237941742e-02</internalNodes>\n          <leafValues>\n            -8.2016801834106445e-01 1.4531899988651276e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 731 -3.7418000400066376e-02</internalNodes>\n          <leafValues>\n            -1.2218099832534790e+00 1.9448999315500259e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 732 1.2402799725532532e-01</internalNodes>\n          <leafValues>\n            1.2082300335168839e-01 -9.8729300498962402e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 733 -8.9229997247457504e-03</internalNodes>\n          <leafValues>\n            -1.1688489913940430e+00 2.1105000749230385e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 734 -5.9879999607801437e-02</internalNodes>\n          <leafValues>\n            -1.0689330101013184e+00 1.9860200583934784e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 735 6.2620001845061779e-03</internalNodes>\n          <leafValues>\n            -3.6229598522186279e-01 3.8000801205635071e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 736 -1.7673000693321228e-02</internalNodes>\n          <leafValues>\n            4.9094098806381226e-01 -1.4606699347496033e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 737 1.7579000443220139e-02</internalNodes>\n          <leafValues>\n            5.8728098869323730e-01 -2.7774399518966675e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 738 5.1560001447796822e-03</internalNodes>\n          <leafValues>\n            -7.5194999575614929e-02 6.0193097591400146e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 739 -1.0599999688565731e-02</internalNodes>\n          <leafValues>\n            2.7637401223182678e-01 -3.7794300913810730e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 740 2.0884099602699280e-01</internalNodes>\n          <leafValues>\n            -5.3599998354911804e-03 1.0317809581756592e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 741 -2.6412999257445335e-02</internalNodes>\n          <leafValues>\n            8.2336401939392090e-01 -2.2480599582195282e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 742 5.8892000466585159e-02</internalNodes>\n          <leafValues>\n            1.3098299503326416e-01 -1.1853699684143066e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 743 -1.1579000391066074e-02</internalNodes>\n          <leafValues>\n            -9.0667802095413208e-01 4.4126998633146286e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 744 4.5988000929355621e-02</internalNodes>\n          <leafValues>\n            1.0143999941647053e-02 1.0740900039672852e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 745 -2.2838000208139420e-02</internalNodes>\n          <leafValues>\n            1.7791990041732788e+00 -1.7315499484539032e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 746 -8.1709995865821838e-03</internalNodes>\n          <leafValues>\n            5.7386302947998047e-01 -7.4106000363826752e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 747 3.5359999164938927e-03</internalNodes>\n          <leafValues>\n            -3.2072898745536804e-01 4.0182501077651978e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 748 4.9444999545812607e-02</internalNodes>\n          <leafValues>\n            1.9288000464439392e-01 -1.2166700363159180e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 749 3.5139999818056822e-03</internalNodes>\n          <leafValues>\n            6.9568000733852386e-02 -7.1323698759078979e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 750 -3.0996000394225121e-02</internalNodes>\n          <leafValues>\n            -3.8862198591232300e-01 1.8098799884319305e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 751 8.6452998220920563e-02</internalNodes>\n          <leafValues>\n            -2.5792999193072319e-02 -1.5453219413757324e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 752 -1.3652600347995758e-01</internalNodes>\n          <leafValues>\n            -1.9199420213699341e+00 1.6613300144672394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 753 -5.7689999230206013e-03</internalNodes>\n          <leafValues>\n            -1.2822589874267578e+00 -1.5907999128103256e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 754 -1.7899999395012856e-02</internalNodes>\n          <leafValues>\n            -4.0409898757934570e-01 2.3591600358486176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 755 -1.9969999790191650e-02</internalNodes>\n          <leafValues>\n            -7.2891902923583984e-01 5.6235000491142273e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 756 -5.7493001222610474e-02</internalNodes>\n          <leafValues>\n            5.7830798625946045e-01 -1.5796000137925148e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 757 -8.3056002855300903e-02</internalNodes>\n          <leafValues>\n            9.1511601209640503e-01 -2.1121400594711304e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 758 -5.3771000355482101e-02</internalNodes>\n          <leafValues>\n            -5.1931297779083252e-01 1.8576000630855560e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 759 -8.3670001477003098e-03</internalNodes>\n          <leafValues>\n            2.4109700322151184e-01 -3.9648601412773132e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 760 5.5406998842954636e-02</internalNodes>\n          <leafValues>\n            1.6771200299263000e-01 -2.5664970874786377e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 761 -6.7180998623371124e-02</internalNodes>\n          <leafValues>\n            -1.3658570051193237e+00 -1.4232000336050987e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 762 -2.3900000378489494e-02</internalNodes>\n          <leafValues>\n            -1.7084569931030273e+00 1.6507799923419952e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 763 5.5949999950826168e-03</internalNodes>\n          <leafValues>\n            -3.1373998522758484e-01 3.2837900519371033e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 764 2.1294999867677689e-02</internalNodes>\n          <leafValues>\n            1.4953400194644928e-01 -4.8579800128936768e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 765 -2.4613000452518463e-02</internalNodes>\n          <leafValues>\n            7.4346399307250977e-01 -2.2305199503898621e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 766 -1.9626000896096230e-02</internalNodes>\n          <leafValues>\n            -4.0918299555778503e-01 1.8893200159072876e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 767 -5.3266000002622604e-02</internalNodes>\n          <leafValues>\n            8.1381601095199585e-01 -2.0853699743747711e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 768 7.1290000341832638e-03</internalNodes>\n          <leafValues>\n            3.2996100187301636e-01 -5.9937399625778198e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 769 -2.2486999630928040e-02</internalNodes>\n          <leafValues>\n            -1.2551610469818115e+00 -2.0413000136613846e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 770 -8.2310996949672699e-02</internalNodes>\n          <leafValues>\n            1.3821430206298828e+00 5.9308998286724091e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 771 1.3097000122070312e-01</internalNodes>\n          <leafValues>\n            -3.5843998193740845e-02 -1.5396369695663452e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 772 1.4293000102043152e-02</internalNodes>\n          <leafValues>\n            -1.8475200235843658e-01 3.7455001473426819e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 773 6.3479999080300331e-03</internalNodes>\n          <leafValues>\n            -4.4901099801063538e-01 1.3876999914646149e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 774 -4.6055000275373459e-02</internalNodes>\n          <leafValues>\n            6.7832601070404053e-01 -1.7071999609470367e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 775 5.7693999260663986e-02</internalNodes>\n          <leafValues>\n            -1.1955999769270420e-02 -1.2261159420013428e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 776 -6.0609998181462288e-03</internalNodes>\n          <leafValues>\n            3.3958598971366882e-01 6.2800000887364149e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 777 -5.2163001149892807e-02</internalNodes>\n          <leafValues>\n            -1.0621069669723511e+00 -1.3779999688267708e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 778 4.6572998166084290e-02</internalNodes>\n          <leafValues>\n            1.4538800716400146e-01 -1.2384550571441650e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 779 7.5309998355805874e-03</internalNodes>\n          <leafValues>\n            -2.4467700719833374e-01 5.1377099752426147e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 780 2.1615000441670418e-02</internalNodes>\n          <leafValues>\n            1.3072599470615387e-01 -7.0996797084808350e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 781 -1.7864000052213669e-02</internalNodes>\n          <leafValues>\n            -1.0474660396575928e+00 4.9599999329075217e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 782 -3.7195000797510147e-02</internalNodes>\n          <leafValues>\n            -1.5126730203628540e+00 1.4801399409770966e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 783 -3.1100001069717109e-04</internalNodes>\n          <leafValues>\n            1.3971500098705292e-01 -4.6867498755455017e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 784 2.5042999535799026e-02</internalNodes>\n          <leafValues>\n            2.8632000088691711e-01 -4.1794699430465698e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 785 9.3449996784329414e-03</internalNodes>\n          <leafValues>\n            -2.7336201071739197e-01 4.3444699048995972e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 786 3.2363999634981155e-02</internalNodes>\n          <leafValues>\n            1.8438899517059326e-01 -9.5019298791885376e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 787 -6.2299999408423901e-03</internalNodes>\n          <leafValues>\n            3.2581999897956848e-01 -3.0815601348876953e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 788 5.1488999277353287e-02</internalNodes>\n          <leafValues>\n            1.1416000127792358e-01 -1.9795479774475098e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 789 -2.6449000462889671e-02</internalNodes>\n          <leafValues>\n            -1.1067299842834473e+00 -8.5519999265670776e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 790 -1.5420000068843365e-02</internalNodes>\n          <leafValues>\n            8.0138701200485229e-01 -3.2035000622272491e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 791 1.9456999376416206e-02</internalNodes>\n          <leafValues>\n            -2.6449498534202576e-01 3.8753899931907654e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 792 3.3620998263359070e-02</internalNodes>\n          <leafValues>\n            1.6052000224590302e-02 5.8840900659561157e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 793 2.8906000778079033e-02</internalNodes>\n          <leafValues>\n            1.5216000378131866e-02 -9.4723600149154663e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 794 2.0300000323913991e-04</internalNodes>\n          <leafValues>\n            -3.0766001343727112e-01 2.1235899627208710e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 795 -4.9141999334096909e-02</internalNodes>\n          <leafValues>\n            -1.6058609485626221e+00 -3.1094999983906746e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 796 7.6425999402999878e-02</internalNodes>\n          <leafValues>\n            7.4758999049663544e-02 1.1639410257339478e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 797 2.3897999897599220e-02</internalNodes>\n          <leafValues>\n            -6.4320000819861889e-03 -1.1150749921798706e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 798 3.8970001041889191e-03</internalNodes>\n          <leafValues>\n            -2.4105699360370636e-01 2.0858900249004364e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 799 -8.9445002377033234e-02</internalNodes>\n          <leafValues>\n            1.9157789945602417e+00 -1.5721100568771362e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 800 -1.5008999966084957e-02</internalNodes>\n          <leafValues>\n            -2.5174099206924438e-01 1.8179899454116821e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 801 -1.1145999655127525e-02</internalNodes>\n          <leafValues>\n            -6.9349497556686401e-01 4.4927999377250671e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 802 9.4578996300697327e-02</internalNodes>\n          <leafValues>\n            1.8102100491523743e-01 -7.4978601932525635e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 803 5.5038899183273315e-01</internalNodes>\n          <leafValues>\n            -3.0974000692367554e-02 -1.6746139526367188e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 804 4.1381001472473145e-02</internalNodes>\n          <leafValues>\n            6.3910000026226044e-02 7.6561200618743896e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 805 2.4771999567747116e-02</internalNodes>\n          <leafValues>\n            1.1380000039935112e-02 -8.8559401035308838e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 806 5.0999000668525696e-02</internalNodes>\n          <leafValues>\n            1.4890299737453461e-01 -2.4634211063385010e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 807 -1.6893999651074409e-02</internalNodes>\n          <leafValues>\n            3.8870999217033386e-01 -2.9880300164222717e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 808 -1.2162300199270248e-01</internalNodes>\n          <leafValues>\n            -1.5542800426483154e+00 1.6300800442695618e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 809 -3.6049999762326479e-03</internalNodes>\n          <leafValues>\n            2.1842800080776215e-01 -3.7312099337577820e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 810 1.1575400084257126e-01</internalNodes>\n          <leafValues>\n            -4.7061000019311905e-02 5.9403699636459351e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 811 3.6903999745845795e-02</internalNodes>\n          <leafValues>\n            -2.5508600473403931e-01 5.5397301912307739e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 812 1.1483999900519848e-02</internalNodes>\n          <leafValues>\n            -1.8129499256610870e-01 4.0682798624038696e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 813 -2.0233999937772751e-02</internalNodes>\n          <leafValues>\n            5.4311197996139526e-01 -2.3822399973869324e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 814 -2.8765000402927399e-02</internalNodes>\n          <leafValues>\n            -6.9172298908233643e-01 1.5943300724029541e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 815 -5.8320001699030399e-03</internalNodes>\n          <leafValues>\n            2.9447799921035767e-01 -3.4005999565124512e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 816 -5.5468998849391937e-02</internalNodes>\n          <leafValues>\n            9.2200797796249390e-01 9.4093002378940582e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 817 -1.4801000244915485e-02</internalNodes>\n          <leafValues>\n            -7.9539698362350464e-01 3.1521998345851898e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 818 -7.0940000005066395e-03</internalNodes>\n          <leafValues>\n            3.3096000552177429e-01 -5.0886999815702438e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 819 -4.5124001801013947e-02</internalNodes>\n          <leafValues>\n            -1.3719749450683594e+00 -2.1408999338746071e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 820 6.4377002418041229e-02</internalNodes>\n          <leafValues>\n            6.3901998102664948e-02 9.1478300094604492e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 821 -1.4727000147104263e-02</internalNodes>\n          <leafValues>\n            3.6050599813461304e-01 -2.8614500164985657e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 822 4.5007001608610153e-02</internalNodes>\n          <leafValues>\n            -1.5619699656963348e-01 5.3160297870635986e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 823 -1.1330000124871731e-03</internalNodes>\n          <leafValues>\n            1.3422900438308716e-01 -4.4358900189399719e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 824 4.9451000988483429e-02</internalNodes>\n          <leafValues>\n            1.0571800172328949e-01 -2.5589139461517334e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 825 2.9102999716997147e-02</internalNodes>\n          <leafValues>\n            -1.0088000446557999e-02 -1.1073939800262451e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 826 3.4786000847816467e-02</internalNodes>\n          <leafValues>\n            -2.7719999197870493e-03 5.6700998544692993e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 827 -6.1309998854994774e-03</internalNodes>\n          <leafValues>\n            -4.6889400482177734e-01 1.2636399269104004e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 828 1.5525000169873238e-02</internalNodes>\n          <leafValues>\n            -8.4279999136924744e-03 8.7469202280044556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 829 2.9249999206513166e-03</internalNodes>\n          <leafValues>\n            -3.4434300661087036e-01 2.0851600170135498e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 830 -5.3571000695228577e-02</internalNodes>\n          <leafValues>\n            1.4982949495315552e+00 5.7328000664710999e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 831 -1.9217999652028084e-02</internalNodes>\n          <leafValues>\n            -9.9234098196029663e-01 -9.3919998034834862e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 832 -5.5282998830080032e-02</internalNodes>\n          <leafValues>\n            -5.7682299613952637e-01 1.6860599815845490e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 833 5.6336000561714172e-02</internalNodes>\n          <leafValues>\n            -3.3775001764297485e-02 -1.3889650106430054e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 834 -2.3824000731110573e-02</internalNodes>\n          <leafValues>\n            4.0182098746299744e-01 1.8360000103712082e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 835 1.7810000572353601e-03</internalNodes>\n          <leafValues>\n            1.8145999312400818e-01 -4.1743400692939758e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 836 -3.7689000368118286e-02</internalNodes>\n          <leafValues>\n            5.4683101177215576e-01 1.8219999969005585e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 837 -2.4144999682903290e-02</internalNodes>\n          <leafValues>\n            6.8352097272872925e-01 -1.9650200009346008e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>135</maxWeakCount>\n      <stageThreshold>-3.7025990486145020e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 838 2.7444999665021896e-02</internalNodes>\n          <leafValues>\n            -8.9984202384948730e-01 5.1876497268676758e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 839 1.1554100364446640e-01</internalNodes>\n          <leafValues>\n            -5.6524401903152466e-01 7.0551300048828125e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 840 -2.2297000512480736e-02</internalNodes>\n          <leafValues>\n            3.6079999804496765e-01 -6.6864597797393799e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 841 1.3325000181794167e-02</internalNodes>\n          <leafValues>\n            -5.5573397874832153e-01 3.5789999365806580e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 842 -3.8060001097619534e-03</internalNodes>\n          <leafValues>\n            -1.0713000297546387e+00 1.8850000202655792e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 843 -2.6819999329745770e-03</internalNodes>\n          <leafValues>\n            -7.1584302186965942e-01 2.6344498991966248e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 844 3.3819999080151320e-03</internalNodes>\n          <leafValues>\n            -4.6930798888206482e-01 2.6658400893211365e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 845 3.7643000483512878e-02</internalNodes>\n          <leafValues>\n            2.1098700165748596e-01 -1.0804339647293091e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 846 -1.3861999846994877e-02</internalNodes>\n          <leafValues>\n            6.6912001371383667e-01 -2.7942800521850586e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 847 -2.7350001037120819e-03</internalNodes>\n          <leafValues>\n            -9.5332300662994385e-01 2.4051299691200256e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 848 -3.8336999714374542e-02</internalNodes>\n          <leafValues>\n            8.1432801485061646e-01 -2.4919399619102478e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 849 -3.4697998315095901e-02</internalNodes>\n          <leafValues>\n            1.2330100536346436e+00 6.8600000813603401e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 850 2.3360999301075935e-02</internalNodes>\n          <leafValues>\n            -3.0794700980186462e-01 7.0714497566223145e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 851 3.5057999193668365e-02</internalNodes>\n          <leafValues>\n            2.1205900609493256e-01 -1.4399830102920532e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 852 -1.3256999664008617e-02</internalNodes>\n          <leafValues>\n            -9.0260702371597290e-01 4.8610001802444458e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 853 1.2740000151097775e-02</internalNodes>\n          <leafValues>\n            2.2655199468135834e-01 -4.4643801450729370e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 854 3.6400000099092722e-03</internalNodes>\n          <leafValues>\n            -3.9817899465560913e-01 3.4665399789810181e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 855 1.0064700245857239e-01</internalNodes>\n          <leafValues>\n            1.8383599817752838e-01 -1.3410769701004028e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 856 0.</internalNodes>\n          <leafValues>\n            1.5536400675773621e-01 -5.1582497358322144e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 857 1.1708999983966351e-02</internalNodes>\n          <leafValues>\n            2.1651400625705719e-01 -7.2705197334289551e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 858 -3.5964999347925186e-02</internalNodes>\n          <leafValues>\n            -1.4789500236511230e+00 -2.4317000061273575e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 859 -2.1236000582575798e-02</internalNodes>\n          <leafValues>\n            -1.6844099760055542e-01 1.9526599347591400e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 860 1.4874000102281570e-02</internalNodes>\n          <leafValues>\n            3.7335999310016632e-02 -8.7557297945022583e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 861 -5.1409997977316380e-03</internalNodes>\n          <leafValues>\n            3.3466500043869019e-01 -2.4109700322151184e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 862 2.3450000211596489e-02</internalNodes>\n          <leafValues>\n            5.5320002138614655e-03 -1.2509720325469971e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 863 -2.5062000378966331e-02</internalNodes>\n          <leafValues>\n            4.5212399959564209e-01 -8.4469996392726898e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 864 -7.7400001464411616e-04</internalNodes>\n          <leafValues>\n            1.5249900519847870e-01 -4.8486500978469849e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 865 -4.0483999997377396e-02</internalNodes>\n          <leafValues>\n            -1.3024920225143433e+00 1.7983500659465790e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 866 2.8170999139547348e-02</internalNodes>\n          <leafValues>\n            -2.4410900473594666e-01 6.2271100282669067e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 867 4.5692998915910721e-02</internalNodes>\n          <leafValues>\n            2.8122000396251678e-02 9.2394399642944336e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 868 3.9707001298666000e-02</internalNodes>\n          <leafValues>\n            -2.2332799434661865e-01 7.7674001455307007e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 869 5.0517000257968903e-02</internalNodes>\n          <leafValues>\n            2.0319999754428864e-01 -1.0895930528640747e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 870 -1.7266999930143356e-02</internalNodes>\n          <leafValues>\n            6.8598401546478271e-01 -2.3304499685764313e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 871 8.0186001956462860e-02</internalNodes>\n          <leafValues>\n            -1.0292000137269497e-02 6.1881101131439209e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 872 9.7676001489162445e-02</internalNodes>\n          <leafValues>\n            -2.0070299506187439e-01 1.0088349580764771e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 873 -1.5572000294923782e-02</internalNodes>\n          <leafValues>\n            4.7615298628807068e-01 4.5623999089002609e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 874 -1.5305000357329845e-02</internalNodes>\n          <leafValues>\n            -1.1077369451522827e+00 4.5239999890327454e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 875 -1.6485000029206276e-02</internalNodes>\n          <leafValues>\n            1.0152939558029175e+00 1.6327999532222748e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 876 -2.6141999289393425e-02</internalNodes>\n          <leafValues>\n            4.1723299026489258e-01 -2.8645500540733337e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 877 8.8679995387792587e-03</internalNodes>\n          <leafValues>\n            2.1404999494552612e-01 -1.6772800683975220e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 878 -2.6886999607086182e-02</internalNodes>\n          <leafValues>\n            -1.1564220190048218e+00 -1.0324000380933285e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 879 7.7789998613297939e-03</internalNodes>\n          <leafValues>\n            3.5359498858451843e-01 -2.9611301422119141e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 880 -1.5974000096321106e-02</internalNodes>\n          <leafValues>\n            -1.5374109745025635e+00 -2.9958000406622887e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 881 2.0866999402642250e-02</internalNodes>\n          <leafValues>\n            2.0244100689888000e-01 -7.1270197629928589e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 882 8.5482001304626465e-02</internalNodes>\n          <leafValues>\n            -2.5932999327778816e-02 -1.5156569480895996e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 883 2.3872999474406242e-02</internalNodes>\n          <leafValues>\n            1.6803400218486786e-01 -3.8806200027465820e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 884 -3.9105001837015152e-02</internalNodes>\n          <leafValues>\n            -1.1958349943161011e+00 -2.0361000671982765e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 885 -7.7946998178958893e-02</internalNodes>\n          <leafValues>\n            -1.0898950099945068e+00 1.4530299603939056e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 886 -1.6876000910997391e-02</internalNodes>\n          <leafValues>\n            2.8049701452255249e-01 -4.1336300969123840e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 887 1.1875600367784500e-01</internalNodes>\n          <leafValues>\n            -4.3490998446941376e-02 4.1263699531555176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 888 1.5624199807643890e-01</internalNodes>\n          <leafValues>\n            -2.6429599523544312e-01 5.5127799510955811e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 889 -4.5908000320196152e-02</internalNodes>\n          <leafValues>\n            6.0189199447631836e-01 1.8921000882983208e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 890 -1.0309999808669090e-02</internalNodes>\n          <leafValues>\n            3.8152998685836792e-01 -2.9507899284362793e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 891 9.5769003033638000e-02</internalNodes>\n          <leafValues>\n            1.3246500492095947e-01 -4.6266800165176392e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 892 1.3686999678611755e-02</internalNodes>\n          <leafValues>\n            1.1738699674606323e-01 -5.1664102077484131e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 893 2.3990001063793898e-03</internalNodes>\n          <leafValues>\n            -3.4007599949836731e-01 2.0953500270843506e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 894 3.3264998346567154e-02</internalNodes>\n          <leafValues>\n            -1.7052799463272095e-01 1.4366799592971802e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 895 -3.3206000924110413e-02</internalNodes>\n          <leafValues>\n            6.1295700073242188e-01 -4.1549999266862869e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 896 2.7979998849332333e-03</internalNodes>\n          <leafValues>\n            -4.8554301261901855e-01 1.3372699916362762e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 897 -6.5792001783847809e-02</internalNodes>\n          <leafValues>\n            -4.0257668495178223e+00 1.0876700282096863e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 898 2.1430000197142363e-03</internalNodes>\n          <leafValues>\n            -3.9179998636245728e-01 2.2427099943161011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 899 2.2363999858498573e-02</internalNodes>\n          <leafValues>\n            -8.6429998278617859e-02 3.7785199284553528e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 900 -5.7410001754760742e-02</internalNodes>\n          <leafValues>\n            1.1454069614410400e+00 -1.9736599922180176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 901 6.6550001502037048e-03</internalNodes>\n          <leafValues>\n            -2.1105000749230385e-02 5.8453398942947388e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 902 1.2326999567449093e-02</internalNodes>\n          <leafValues>\n            3.7817001342773438e-02 -6.6987001895904541e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 903 -8.1869997084140778e-03</internalNodes>\n          <leafValues>\n            5.6366002559661865e-01 -7.6877996325492859e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 904 3.6681000143289566e-02</internalNodes>\n          <leafValues>\n            -1.7343300580978394e-01 1.1670149564743042e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 905 -4.0220400691032410e-01</internalNodes>\n          <leafValues>\n            1.2640819549560547e+00 4.3398998677730560e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 906 -2.2126000374555588e-02</internalNodes>\n          <leafValues>\n            6.6978102922439575e-01 -2.1605299413204193e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 907 -1.3156999833881855e-02</internalNodes>\n          <leafValues>\n            -4.1198599338531494e-01 2.0215000212192535e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 908 -1.2860000133514404e-02</internalNodes>\n          <leafValues>\n            -9.1582697629928589e-01 3.9232999086380005e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 909 2.1627999842166901e-02</internalNodes>\n          <leafValues>\n            3.8719999138265848e-03 3.5668200254440308e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 910 1.1896000243723392e-02</internalNodes>\n          <leafValues>\n            -3.7303900718688965e-01 1.9235099852085114e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 911 -1.9548999145627022e-02</internalNodes>\n          <leafValues>\n            -4.2374899983406067e-01 2.4429599940776825e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 912 6.4444996416568756e-02</internalNodes>\n          <leafValues>\n            -1.6558900475502014e-01 1.2697030305862427e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 913 1.0898499935865402e-01</internalNodes>\n          <leafValues>\n            1.4894300699234009e-01 -2.1534640789031982e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 914 -3.4077998250722885e-02</internalNodes>\n          <leafValues>\n            1.3779460191726685e+00 -1.6198499500751495e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 915 -3.7489999085664749e-03</internalNodes>\n          <leafValues>\n            -3.3828601241111755e-01 2.1152900159358978e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 916 -1.0971999727189541e-02</internalNodes>\n          <leafValues>\n            7.6517897844314575e-01 -1.9692599773406982e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 917 -1.1485000140964985e-02</internalNodes>\n          <leafValues>\n            -6.9271200895309448e-01 2.1657100319862366e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 918 2.5984000414609909e-02</internalNodes>\n          <leafValues>\n            -1.1983999982476234e-02 -9.9697297811508179e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 919 4.2159999720752239e-03</internalNodes>\n          <leafValues>\n            -1.0205700248479843e-01 4.8884400725364685e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 920 -4.7697000205516815e-02</internalNodes>\n          <leafValues>\n            1.0666010379791260e+00 -1.7576299607753754e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 921 4.0300001273863018e-04</internalNodes>\n          <leafValues>\n            1.8524800240993500e-01 -7.4790000915527344e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 922 1.1539600044488907e-01</internalNodes>\n          <leafValues>\n            -2.2019700706005096e-01 5.4509997367858887e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 923 1.6021000221371651e-02</internalNodes>\n          <leafValues>\n            2.5487500429153442e-01 -5.0740098953247070e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 924 5.6632000952959061e-02</internalNodes>\n          <leafValues>\n            -1.1256000027060509e-02 -9.5968097448348999e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 925 -1.0726000182330608e-02</internalNodes>\n          <leafValues>\n            -2.8544700145721436e-01 1.6994799673557281e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 926 1.2420000135898590e-01</internalNodes>\n          <leafValues>\n            -3.6139998584985733e-02 -1.3132710456848145e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 927 -5.3799999877810478e-03</internalNodes>\n          <leafValues>\n            3.3092701435089111e-01 1.3307999819517136e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 928 1.1908000335097313e-02</internalNodes>\n          <leafValues>\n            -3.4830299019813538e-01 2.4041900038719177e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 929 -4.3007999658584595e-02</internalNodes>\n          <leafValues>\n            -1.4390469789505005e+00 1.5599599480628967e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 930 -3.3149998635053635e-02</internalNodes>\n          <leafValues>\n            -1.1805850267410278e+00 -1.2347999960184097e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 931 -2.1341999992728233e-02</internalNodes>\n          <leafValues>\n            2.2119441032409668e+00 6.2737002968788147e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 932 -1.2218999676406384e-02</internalNodes>\n          <leafValues>\n            -1.8709750175476074e+00 -4.5499999076128006e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 933 -1.6860999166965485e-02</internalNodes>\n          <leafValues>\n            -7.6912701129913330e-01 1.5330000221729279e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 934 -2.4999999441206455e-03</internalNodes>\n          <leafValues>\n            -6.2987399101257324e-01 5.1600001752376556e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 935 -4.5037999749183655e-02</internalNodes>\n          <leafValues>\n            8.5428899526596069e-01 6.2600001692771912e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 936 3.9057999849319458e-02</internalNodes>\n          <leafValues>\n            -3.2458998262882233e-02 -1.3325669765472412e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 937 6.6720000468194485e-03</internalNodes>\n          <leafValues>\n            -1.9423599541187286e-01 3.7328699231147766e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 938 -1.6361000016331673e-02</internalNodes>\n          <leafValues>\n            2.0605869293212891e+00 -1.5042699873447418e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 939 6.1719999648630619e-03</internalNodes>\n          <leafValues>\n            -1.1610999703407288e-01 2.5455400347709656e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 940 4.5722000300884247e-02</internalNodes>\n          <leafValues>\n            -1.6340000554919243e-02 -1.0449140071868896e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 941 4.1209999471902847e-03</internalNodes>\n          <leafValues>\n            -4.1997998952865601e-02 3.9680999517440796e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 942 -1.7800000205170363e-04</internalNodes>\n          <leafValues>\n            -6.6422599554061890e-01 3.3443000167608261e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 943 7.1109998971223831e-03</internalNodes>\n          <leafValues>\n            -5.8231998234987259e-02 3.7857300043106079e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 944 -4.9864001572132111e-02</internalNodes>\n          <leafValues>\n            6.1019402742385864e-01 -2.1005700528621674e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 945 -2.5011999532580376e-02</internalNodes>\n          <leafValues>\n            -5.7100099325180054e-01 1.7848399281501770e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 946 3.0939999967813492e-02</internalNodes>\n          <leafValues>\n            5.6363001465797424e-02 -6.4731001853942871e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 947 4.6271000057458878e-02</internalNodes>\n          <leafValues>\n            1.7482399940490723e-01 -9.8909401893615723e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 948 -3.1870000530034304e-03</internalNodes>\n          <leafValues>\n            -6.6804802417755127e-01 3.2267000526189804e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 949 -2.4351999163627625e-02</internalNodes>\n          <leafValues>\n            2.9444900155067444e-01 -1.3599999947473407e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 950 1.1974000371992588e-02</internalNodes>\n          <leafValues>\n            -2.8345099091529846e-01 4.7171199321746826e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 951 1.3070000335574150e-02</internalNodes>\n          <leafValues>\n            -1.0834600031375885e-01 5.7193297147750854e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 952 5.9163000434637070e-02</internalNodes>\n          <leafValues>\n            -5.0939001142978668e-02 -1.9059720039367676e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 953 -4.1094999760389328e-02</internalNodes>\n          <leafValues>\n            4.5104598999023438e-01 -9.7599998116493225e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 954 -8.3989001810550690e-02</internalNodes>\n          <leafValues>\n            -2.0349199771881104e+00 -5.1019001752138138e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 955 4.4619001448154449e-02</internalNodes>\n          <leafValues>\n            1.7041100561618805e-01 -1.2278720140457153e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 956 2.4419000372290611e-02</internalNodes>\n          <leafValues>\n            -2.1796999499201775e-02 -1.0822949409484863e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 957 -4.3870001100003719e-03</internalNodes>\n          <leafValues>\n            3.0466699600219727e-01 -3.7066599726676941e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 958 2.4607999250292778e-02</internalNodes>\n          <leafValues>\n            -3.1169500946998596e-01 2.3657299578189850e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 959 -8.5182003676891327e-02</internalNodes>\n          <leafValues>\n            -1.7982350587844849e+00 1.5254299342632294e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 960 2.1844999864697456e-02</internalNodes>\n          <leafValues>\n            -5.1888000220060349e-02 -1.9017189741134644e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 961 -1.6829000785946846e-02</internalNodes>\n          <leafValues>\n            2.1025900542736053e-01 2.1656999364495277e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 962 3.2547999173402786e-02</internalNodes>\n          <leafValues>\n            -2.0292599499225616e-01 6.0944002866744995e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 963 2.4709999561309814e-03</internalNodes>\n          <leafValues>\n            -9.5371198654174805e-01 1.8568399548530579e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 964 5.5415999144315720e-02</internalNodes>\n          <leafValues>\n            -1.4405299723148346e-01 2.1506340503692627e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 965 -1.0635499656200409e-01</internalNodes>\n          <leafValues>\n            -1.0911970138549805e+00 1.3228000700473785e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 966 -7.9889995977282524e-03</internalNodes>\n          <leafValues>\n            1.0253400355577469e-01 -5.1744902133941650e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 967 7.5567997992038727e-02</internalNodes>\n          <leafValues>\n            5.8965001255273819e-02 1.2354209423065186e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 968 -9.2805996537208557e-02</internalNodes>\n          <leafValues>\n            -1.3431650400161743e+00 -3.4462999552488327e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 969 4.9431998282670975e-02</internalNodes>\n          <leafValues>\n            4.9601998180150986e-02 1.6054730415344238e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 970 -1.1772999539971352e-02</internalNodes>\n          <leafValues>\n            -1.0261050462722778e+00 -4.1559999808669090e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 971 8.5886001586914062e-02</internalNodes>\n          <leafValues>\n            8.4642998874187469e-02 9.5220798254013062e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 972 8.1031002104282379e-02</internalNodes>\n          <leafValues>\n            -1.4687100052833557e-01 1.9359990358352661e+00</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>136</maxWeakCount>\n      <stageThreshold>-3.4265899658203125e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 973 -3.3840999007225037e-02</internalNodes>\n          <leafValues>\n            6.5889501571655273e-01 -6.9755297899246216e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 974 1.5410000458359718e-02</internalNodes>\n          <leafValues>\n            -9.0728402137756348e-01 3.0478599667549133e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 975 5.4905999451875687e-02</internalNodes>\n          <leafValues>\n            -4.9774798750877380e-01 5.7132601737976074e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 976 2.1390000358223915e-02</internalNodes>\n          <leafValues>\n            -4.2565199732780457e-01 5.8096802234649658e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 977 7.8849997371435165e-03</internalNodes>\n          <leafValues>\n            -4.7905999422073364e-01 4.3016499280929565e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 978 -3.7544999271631241e-02</internalNodes>\n          <leafValues>\n            5.0861597061157227e-01 -1.9985899329185486e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 979 1.5925799310207367e-01</internalNodes>\n          <leafValues>\n            -2.3263600468635559e-01 1.0993319749832153e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 980 -6.8939998745918274e-02</internalNodes>\n          <leafValues>\n            4.0569001436233521e-01 5.6855000555515289e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 981 -3.3695001155138016e-02</internalNodes>\n          <leafValues>\n            4.5132800936698914e-01 -3.3332800865173340e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 982 -6.3314996659755707e-02</internalNodes>\n          <leafValues>\n            -8.5015702247619629e-01 2.2341699898242950e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 983 7.3699997738003731e-03</internalNodes>\n          <leafValues>\n            -9.3082201480865479e-01 5.9216998517513275e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 984 -9.5969997346401215e-03</internalNodes>\n          <leafValues>\n            -1.2794899940490723e+00 1.8447299301624298e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 985 -1.3067999482154846e-01</internalNodes>\n          <leafValues>\n            5.8426898717880249e-01 -2.6007199287414551e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 986 5.7402998208999634e-02</internalNodes>\n          <leafValues>\n            -5.3789000958204269e-02 7.1175599098205566e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 987 -7.2340001352131367e-03</internalNodes>\n          <leafValues>\n            -8.6962199211120605e-01 7.5214996933937073e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 988 3.1098999083042145e-02</internalNodes>\n          <leafValues>\n            -7.5006999075412750e-02 9.0781599283218384e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 989 3.5854000598192215e-02</internalNodes>\n          <leafValues>\n            -2.4795499444007874e-01 7.2272098064422607e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 990 -3.1534999608993530e-02</internalNodes>\n          <leafValues>\n            -1.1238329410552979e+00 2.0988300442695618e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 991 -1.9437000155448914e-02</internalNodes>\n          <leafValues>\n            -1.4499390125274658e+00 -1.5100000426173210e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 992 -7.2420001961290836e-03</internalNodes>\n          <leafValues>\n            5.3864902257919312e-01 -1.1375399678945541e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 993 8.1639997661113739e-03</internalNodes>\n          <leafValues>\n            6.6889002919197083e-02 -7.6872897148132324e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 994 -4.3653000146150589e-02</internalNodes>\n          <leafValues>\n            1.1413530111312866e+00 4.0217000991106033e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 995 2.6569999754428864e-02</internalNodes>\n          <leafValues>\n            -2.4719099700450897e-01 5.9295099973678589e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 996 3.2216999679803848e-02</internalNodes>\n          <leafValues>\n            -4.0024999529123306e-02 3.2688000798225403e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 997 -7.2236001491546631e-02</internalNodes>\n          <leafValues>\n            5.8729398250579834e-01 -2.5396001338958740e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 998 3.1424999237060547e-02</internalNodes>\n          <leafValues>\n            1.5315100550651550e-01 -5.6042098999023438e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 999 -4.7699999413453043e-04</internalNodes>\n          <leafValues>\n            1.6958899796009064e-01 -5.2626699209213257e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1000 2.7189999818801880e-03</internalNodes>\n          <leafValues>\n            -1.4944599568843842e-01 2.9658699035644531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1001 3.2875001430511475e-02</internalNodes>\n          <leafValues>\n            -3.9943501353263855e-01 2.5156599283218384e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1002 -1.4553000219166279e-02</internalNodes>\n          <leafValues>\n            2.7972599864006042e-01 -4.7203800082206726e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1003 3.8017999380826950e-02</internalNodes>\n          <leafValues>\n            -2.9200001154094934e-03 -1.1300059556961060e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1004 2.8659999370574951e-03</internalNodes>\n          <leafValues>\n            4.1111800074577332e-01 -2.6220801472663879e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1005 -4.1606999933719635e-02</internalNodes>\n          <leafValues>\n            -1.4293819665908813e+00 -1.9132999703288078e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1006 -2.4802999570965767e-02</internalNodes>\n          <leafValues>\n            -2.5013598799705505e-01 1.5978699922561646e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1007 1.0098000057041645e-02</internalNodes>\n          <leafValues>\n            4.3738998472690582e-02 -6.9986099004745483e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1008 -2.0947000011801720e-02</internalNodes>\n          <leafValues>\n            -9.4137799739837646e-01 2.3204000294208527e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1009 2.2458000108599663e-02</internalNodes>\n          <leafValues>\n            -2.7185800671577454e-01 4.5319199562072754e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1010 -3.7110999226570129e-02</internalNodes>\n          <leafValues>\n            -1.0314660072326660e+00 1.4421799778938293e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1011 -1.0648000054061413e-02</internalNodes>\n          <leafValues>\n            6.3107001781463623e-01 -2.5520798563957214e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1012 5.5422998964786530e-02</internalNodes>\n          <leafValues>\n            1.6206599771976471e-01 -1.7722640037536621e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1013 2.1601999178528786e-02</internalNodes>\n          <leafValues>\n            -2.5016099214553833e-01 5.4119801521301270e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1014 8.7000000348780304e-05</internalNodes>\n          <leafValues>\n            -2.9008901119232178e-01 3.3507999777793884e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1015 1.4406000263988972e-02</internalNodes>\n          <leafValues>\n            -7.8840004280209541e-03 -1.1677219867706299e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1016 1.0777399688959122e-01</internalNodes>\n          <leafValues>\n            1.1292000114917755e-01 -2.4940319061279297e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1017 3.5943999886512756e-02</internalNodes>\n          <leafValues>\n            -1.9480599462985992e-01 9.5757502317428589e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1018 -3.9510000497102737e-03</internalNodes>\n          <leafValues>\n            3.0927801132202148e-01 -2.5530201196670532e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1019 2.0942000672221184e-02</internalNodes>\n          <leafValues>\n            -7.6319999061524868e-03 -1.0086350440979004e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1020 -2.9877999797463417e-02</internalNodes>\n          <leafValues>\n            -4.6027699112892151e-01 1.9507199525833130e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1021 2.5971999391913414e-02</internalNodes>\n          <leafValues>\n            -1.2187999673187733e-02 -1.0035500526428223e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1022 1.0603000409901142e-02</internalNodes>\n          <leafValues>\n            -7.5969003140926361e-02 4.1669899225234985e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1023 8.5819996893405914e-03</internalNodes>\n          <leafValues>\n            -2.6648598909378052e-01 3.9111500978469849e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1024 2.1270999684929848e-02</internalNodes>\n          <leafValues>\n            1.8273900449275970e-01 -3.6052298545837402e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1025 7.4518002569675446e-02</internalNodes>\n          <leafValues>\n            -1.8938399851322174e-01 9.2658001184463501e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1026 4.6569998376071453e-03</internalNodes>\n          <leafValues>\n            -1.4506199955940247e-01 3.3294600248336792e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1027 1.7119999974966049e-03</internalNodes>\n          <leafValues>\n            -5.2464002370834351e-01 8.9879997074604034e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1028 9.8500004969537258e-04</internalNodes>\n          <leafValues>\n            -3.8381999731063843e-01 2.4392999708652496e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1029 2.8233999386429787e-02</internalNodes>\n          <leafValues>\n            -5.7879998348653316e-03 -1.2617139816284180e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1030 -3.2678000628948212e-02</internalNodes>\n          <leafValues>\n            -5.7953298091888428e-01 1.6955299675464630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1031 2.2536000236868858e-02</internalNodes>\n          <leafValues>\n            2.2281000390648842e-02 -8.7869602441787720e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1032 -2.1657999604940414e-02</internalNodes>\n          <leafValues>\n            -6.5108501911163330e-01 1.2966899573802948e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1033 7.6799998059868813e-03</internalNodes>\n          <leafValues>\n            -3.3965200185775757e-01 2.2013300657272339e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1034 1.4592000283300877e-02</internalNodes>\n          <leafValues>\n            1.5077300369739532e-01 -5.0452399253845215e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1035 2.7868000790476799e-02</internalNodes>\n          <leafValues>\n            -2.5045299530029297e-01 4.5741999149322510e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1036 5.6940000504255295e-03</internalNodes>\n          <leafValues>\n            -1.0948500037193298e-01 5.5757802724838257e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1037 -1.0002999566495419e-02</internalNodes>\n          <leafValues>\n            -9.7366297245025635e-01 1.8467999994754791e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1038 -4.0719998069107533e-03</internalNodes>\n          <leafValues>\n            3.8222199678421021e-01 -1.6921100020408630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1039 -2.2593999281525612e-02</internalNodes>\n          <leafValues>\n            -1.0391089916229248e+00 5.1839998923242092e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1040 -3.9579998701810837e-02</internalNodes>\n          <leafValues>\n            -5.5109229087829590e+00 1.1163999885320663e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1041 -1.7537999898195267e-02</internalNodes>\n          <leafValues>\n            9.5485800504684448e-01 -1.8584500253200531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1042 9.0300003066658974e-03</internalNodes>\n          <leafValues>\n            1.0436000302433968e-02 8.2114797830581665e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1043 -7.9539995640516281e-03</internalNodes>\n          <leafValues>\n            2.2632899880409241e-01 -3.4568199515342712e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1044 2.7091000229120255e-02</internalNodes>\n          <leafValues>\n            1.6430099308490753e-01 -1.3926379680633545e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1045 -2.0625999197363853e-02</internalNodes>\n          <leafValues>\n            -8.6366099119186401e-01 2.3880000226199627e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1046 -7.1989998221397400e-02</internalNodes>\n          <leafValues>\n            -2.8192629814147949e+00 1.1570499837398529e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1047 -2.6964999735355377e-02</internalNodes>\n          <leafValues>\n            -1.2946130037307739e+00 -2.4661000818014145e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1048 -4.7377999871969223e-02</internalNodes>\n          <leafValues>\n            -8.1306397914886475e-01 1.1831399798393250e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1049 -1.0895600169897079e-01</internalNodes>\n          <leafValues>\n            6.5937900543212891e-01 -2.0843900740146637e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1050 1.3574000447988510e-02</internalNodes>\n          <leafValues>\n            7.4240001849830151e-03 5.3152197599411011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1051 -6.6920001991093159e-03</internalNodes>\n          <leafValues>\n            3.0655801296234131e-01 -3.1084299087524414e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1052 -3.9070001803338528e-03</internalNodes>\n          <leafValues>\n            2.5576499104499817e-01 -5.2932001650333405e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1053 -3.7613000720739365e-02</internalNodes>\n          <leafValues>\n            -1.4350049495697021e+00 -1.5448000282049179e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1054 8.6329998448491096e-03</internalNodes>\n          <leafValues>\n            -1.6884399950504303e-01 4.2124900221824646e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1055 -3.2097000628709793e-02</internalNodes>\n          <leafValues>\n            -6.4979398250579834e-01 4.1110001504421234e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1056 5.8495998382568359e-02</internalNodes>\n          <leafValues>\n            -5.2963998168706894e-02 6.3368302583694458e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1057 -4.0901999920606613e-02</internalNodes>\n          <leafValues>\n            -9.2101097106933594e-01 9.0640000998973846e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1058 -1.9925000146031380e-02</internalNodes>\n          <leafValues>\n            5.3759998083114624e-01 -6.2996998429298401e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1059 -4.6020001173019409e-03</internalNodes>\n          <leafValues>\n            -5.4333502054214478e-01 8.4104999899864197e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1060 1.6824999824166298e-02</internalNodes>\n          <leafValues>\n            1.5563699603080750e-01 -4.0171200037002563e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1061 9.4790002331137657e-03</internalNodes>\n          <leafValues>\n            -2.4245299398899078e-01 5.1509499549865723e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1062 -1.9534999504685402e-02</internalNodes>\n          <leafValues>\n            -5.1118397712707520e-01 1.3831999897956848e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1063 1.0746000334620476e-02</internalNodes>\n          <leafValues>\n            -2.1854999661445618e-01 6.2828701734542847e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1064 3.7927001714706421e-02</internalNodes>\n          <leafValues>\n            1.1640299856662750e-01 -2.7301959991455078e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1065 1.6390999779105186e-02</internalNodes>\n          <leafValues>\n            -1.4635999687016010e-02 -1.0797250270843506e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1066 -1.9785000011324883e-02</internalNodes>\n          <leafValues>\n            1.2166420221328735e+00 3.3275000751018524e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1067 1.1067000217735767e-02</internalNodes>\n          <leafValues>\n            -2.5388300418853760e-01 4.4038599729537964e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1068 5.2479999139904976e-03</internalNodes>\n          <leafValues>\n            2.2496800124645233e-01 -2.4216499924659729e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1069 -1.1141999624669552e-02</internalNodes>\n          <leafValues>\n            2.5018098950386047e-01 -3.0811500549316406e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1070 -1.0666999965906143e-02</internalNodes>\n          <leafValues>\n            -3.2729101181030273e-01 2.6168298721313477e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1071 1.0545299947261810e-01</internalNodes>\n          <leafValues>\n            -5.5750001221895218e-02 -1.9605729579925537e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1072 5.4827999323606491e-02</internalNodes>\n          <leafValues>\n            -1.9519999623298645e-03 7.3866099119186401e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1073 1.7760999500751495e-02</internalNodes>\n          <leafValues>\n            -3.0647200345993042e-01 2.6346999406814575e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1074 -3.1185999512672424e-02</internalNodes>\n          <leafValues>\n            -2.4600900709629059e-01 1.7082199454307556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1075 -5.7296000421047211e-02</internalNodes>\n          <leafValues>\n            4.7033500671386719e-01 -2.6048299670219421e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1076 -1.1312000453472137e-02</internalNodes>\n          <leafValues>\n            3.8628900051116943e-01 -2.8817000985145569e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1077 3.0592000111937523e-02</internalNodes>\n          <leafValues>\n            -4.8826001584529877e-02 -1.7638969421386719e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1078 1.8489999929443002e-03</internalNodes>\n          <leafValues>\n            2.1099899709224701e-01 -2.5940999388694763e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1079 1.1419000104069710e-02</internalNodes>\n          <leafValues>\n            -1.6829599440097809e-01 1.0278660058975220e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1080 8.1403002142906189e-02</internalNodes>\n          <leafValues>\n            1.1531999707221985e-01 -1.2482399940490723e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1081 5.3495999425649643e-02</internalNodes>\n          <leafValues>\n            -4.6303998678922653e-02 -1.7165969610214233e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1082 -2.3948000743985176e-02</internalNodes>\n          <leafValues>\n            -4.0246599912643433e-01 2.0562100410461426e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1083 6.7690000869333744e-03</internalNodes>\n          <leafValues>\n            -3.3152300119400024e-01 2.0683400332927704e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1084 -3.2343998551368713e-02</internalNodes>\n          <leafValues>\n            -7.2632801532745361e-01 2.0073500275611877e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1085 3.7863001227378845e-02</internalNodes>\n          <leafValues>\n            -1.5631000697612762e-01 1.6697460412979126e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1086 1.5440000221133232e-02</internalNodes>\n          <leafValues>\n            1.9487400352954865e-01 -3.5384199023246765e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1087 -4.4376000761985779e-02</internalNodes>\n          <leafValues>\n            8.2093602418899536e-01 -1.8193599581718445e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1088 -2.3102000355720520e-02</internalNodes>\n          <leafValues>\n            -4.3044099211692810e-01 1.2375400215387344e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1089 1.9400000572204590e-02</internalNodes>\n          <leafValues>\n            -2.9726000502705574e-02 -1.1597590446472168e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1090 1.0385700315237045e-01</internalNodes>\n          <leafValues>\n            1.1149899661540985e-01 -4.6835222244262695e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1091 -1.8964000046253204e-02</internalNodes>\n          <leafValues>\n            2.1773819923400879e+00 -1.4544400572776794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1092 3.8750998675823212e-02</internalNodes>\n          <leafValues>\n            -4.9446001648902893e-02 3.4018298983573914e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1093 2.2766999900341034e-02</internalNodes>\n          <leafValues>\n            -3.2802999019622803e-01 3.0531400442123413e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1094 -3.1357001513242722e-02</internalNodes>\n          <leafValues>\n            1.1520819664001465e+00 2.7305999770760536e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1095 9.6909999847412109e-03</internalNodes>\n          <leafValues>\n            -3.8799500465393066e-01 2.1512599289417267e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1096 -4.9284998327493668e-02</internalNodes>\n          <leafValues>\n            -1.6774909496307373e+00 1.5774199366569519e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1097 -3.9510998874902725e-02</internalNodes>\n          <leafValues>\n            -9.7647899389266968e-01 -1.0552000254392624e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1098 4.7997999936342239e-02</internalNodes>\n          <leafValues>\n            2.0843900740146637e-01 -6.8992799520492554e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1099 5.1422998309135437e-02</internalNodes>\n          <leafValues>\n            -1.6665300726890564e-01 1.2149239778518677e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1100 1.4279999770224094e-02</internalNodes>\n          <leafValues>\n            2.3627699911594391e-01 -4.1396799683570862e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1101 -9.1611996293067932e-02</internalNodes>\n          <leafValues>\n            -9.2830902338027954e-01 -1.8345000222325325e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1102 6.5080001950263977e-03</internalNodes>\n          <leafValues>\n            -7.3647201061248779e-01 1.9497099518775940e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1103 3.5723000764846802e-02</internalNodes>\n          <leafValues>\n            1.4197799563407898e-01 -4.2089301347732544e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1104 5.0638001412153244e-02</internalNodes>\n          <leafValues>\n            1.1644000187516212e-02 7.8486597537994385e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1105 -1.4613999985158443e-02</internalNodes>\n          <leafValues>\n            -1.1909500360488892e+00 -3.5128001123666763e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1106 -3.8662999868392944e-02</internalNodes>\n          <leafValues>\n            2.4314730167388916e+00 6.5647996962070465e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1107 -4.0346998721361160e-02</internalNodes>\n          <leafValues>\n            7.1755301952362061e-01 -1.9108299911022186e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1108 2.3902000859379768e-02</internalNodes>\n          <leafValues>\n            1.5646199882030487e-01 -7.9294800758361816e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>137</maxWeakCount>\n      <stageThreshold>-3.5125269889831543e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1109 8.5640000179409981e-03</internalNodes>\n          <leafValues>\n            -8.1450700759887695e-01 5.8875298500061035e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1110 -1.3292600214481354e-01</internalNodes>\n          <leafValues>\n            9.3213397264480591e-01 -2.9367300868034363e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1111 9.8400004208087921e-03</internalNodes>\n          <leafValues>\n            -5.6462901830673218e-01 4.1647699475288391e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1112 5.0889998674392700e-03</internalNodes>\n          <leafValues>\n            -7.9232800006866455e-01 1.6975000500679016e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1113 -6.1039000749588013e-02</internalNodes>\n          <leafValues>\n            -1.4169000387191772e+00 2.5020999833941460e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1114 -4.6599999768659472e-04</internalNodes>\n          <leafValues>\n            3.7982499599456787e-01 -4.1567099094390869e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1115 3.3889999613165855e-03</internalNodes>\n          <leafValues>\n            -4.0768599510192871e-01 3.5548499226570129e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1116 2.1006999537348747e-02</internalNodes>\n          <leafValues>\n            -2.4080100655555725e-01 8.6112701892852783e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1117 7.5559997931122780e-03</internalNodes>\n          <leafValues>\n            -8.7467199563980103e-01 9.8572000861167908e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1118 2.4779999628663063e-02</internalNodes>\n          <leafValues>\n            1.5566200017929077e-01 -6.9229799509048462e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1119 -3.5620000213384628e-02</internalNodes>\n          <leafValues>\n            -1.1472270488739014e+00 3.6359999328851700e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1120 1.9810000434517860e-02</internalNodes>\n          <leafValues>\n            1.5516200661659241e-01 -6.9520097970962524e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1121 1.5019999817013741e-02</internalNodes>\n          <leafValues>\n            4.1990000754594803e-02 -9.6622800827026367e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1122 -2.3137999698519707e-02</internalNodes>\n          <leafValues>\n            4.3396899104118347e-01 2.4160000029951334e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1123 -1.8743000924587250e-02</internalNodes>\n          <leafValues>\n            4.3481099605560303e-01 -3.2522499561309814e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1124 4.5080000162124634e-01</internalNodes>\n          <leafValues>\n            -9.4573996961116791e-02 7.2421300411224365e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1125 1.1854999698698521e-02</internalNodes>\n          <leafValues>\n            -3.8133099675178528e-01 3.0098399519920349e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1126 -2.4830000475049019e-02</internalNodes>\n          <leafValues>\n            8.9300602674484253e-01 -1.0295899957418442e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1127 -4.4743001461029053e-02</internalNodes>\n          <leafValues>\n            8.6280298233032227e-01 -2.1716499328613281e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1128 -1.4600000344216824e-02</internalNodes>\n          <leafValues>\n            6.0069400072097778e-01 -1.5906299650669098e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1129 -2.4527000263333321e-02</internalNodes>\n          <leafValues>\n            -1.5872869491577148e+00 -2.1817000582814217e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1130 2.3024000227451324e-02</internalNodes>\n          <leafValues>\n            1.6853399574756622e-01 -3.8106900453567505e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1131 -2.4917000904679298e-02</internalNodes>\n          <leafValues>\n            5.0810897350311279e-01 -2.7279898524284363e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1132 1.0130000300705433e-03</internalNodes>\n          <leafValues>\n            -4.3138799071311951e-01 2.6438099145889282e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1133 1.5603000298142433e-02</internalNodes>\n          <leafValues>\n            -3.1624200940132141e-01 5.5715900659561157e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1134 -2.6685999706387520e-02</internalNodes>\n          <leafValues>\n            1.0553920269012451e+00 2.9074000194668770e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1135 1.3940000208094716e-03</internalNodes>\n          <leafValues>\n            -7.1873801946640015e-01 6.5390996634960175e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1136 -6.4799998654052615e-04</internalNodes>\n          <leafValues>\n            2.4884399771690369e-01 -2.0978200435638428e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1137 -3.1888000667095184e-02</internalNodes>\n          <leafValues>\n            -6.8844497203826904e-01 6.3589997589588165e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1138 -4.9290000461041927e-03</internalNodes>\n          <leafValues>\n            -5.9152501821517944e-01 2.7943599224090576e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1139 3.1168000772595406e-02</internalNodes>\n          <leafValues>\n            4.5223999768495560e-02 -8.8639199733734131e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1140 -3.3663000911474228e-02</internalNodes>\n          <leafValues>\n            -6.1590200662612915e-01 1.5749299526214600e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1141 1.1966999620199203e-02</internalNodes>\n          <leafValues>\n            -3.0606698989868164e-01 4.2293301224708557e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1142 -3.4680001437664032e-02</internalNodes>\n          <leafValues>\n            -1.3734940290451050e+00 1.5908700227737427e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1143 9.9290004000067711e-03</internalNodes>\n          <leafValues>\n            -5.5860197544097900e-01 1.2119200080633163e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1144 5.9574998915195465e-02</internalNodes>\n          <leafValues>\n            4.9720001406967640e-03 8.2055401802062988e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1145 -6.5428003668785095e-02</internalNodes>\n          <leafValues>\n            1.5651429891586304e+00 -1.6817499697208405e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1146 -9.2895999550819397e-02</internalNodes>\n          <leafValues>\n            -1.5794529914855957e+00 1.4661799371242523e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1147 -4.1184000670909882e-02</internalNodes>\n          <leafValues>\n            -1.5518720149993896e+00 -2.9969999566674232e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1148 2.1447999402880669e-02</internalNodes>\n          <leafValues>\n            1.7196300625801086e-01 -6.9343197345733643e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1149 -2.5569999590516090e-02</internalNodes>\n          <leafValues>\n            -1.3061310052871704e+00 -2.4336999282240868e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1150 -4.1200999170541763e-02</internalNodes>\n          <leafValues>\n            -1.3821059465408325e+00 1.4801800251007080e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1151 -1.7668999731540680e-02</internalNodes>\n          <leafValues>\n            -7.0889997482299805e-01 3.6524001508951187e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1152 9.0060001239180565e-03</internalNodes>\n          <leafValues>\n            -4.0913999080657959e-02 8.0373102426528931e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1153 -1.1652999557554722e-02</internalNodes>\n          <leafValues>\n            5.7546800374984741e-01 -2.4991700053215027e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1154 -7.4780001305043697e-03</internalNodes>\n          <leafValues>\n            -4.9280899763107300e-01 1.9810900092124939e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1155 8.5499999113380909e-04</internalNodes>\n          <leafValues>\n            -4.8858100175857544e-01 1.3563099503517151e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1156 -3.0538000166416168e-02</internalNodes>\n          <leafValues>\n            -6.0278397798538208e-01 1.8522000312805176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1157 -1.8846999853849411e-02</internalNodes>\n          <leafValues>\n            2.3565599322319031e-01 -3.5136300325393677e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1158 -8.1129996106028557e-03</internalNodes>\n          <leafValues>\n            -8.1304997205734253e-02 2.1069599688053131e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1159 -3.4830000251531601e-02</internalNodes>\n          <leafValues>\n            -1.2065670490264893e+00 -1.4251999557018280e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1160 1.9021000713109970e-02</internalNodes>\n          <leafValues>\n            2.3349900543689728e-01 -4.5664900541305542e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1161 -1.9004000350832939e-02</internalNodes>\n          <leafValues>\n            -8.1075799465179443e-01 1.3140000402927399e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1162 -8.9057996869087219e-02</internalNodes>\n          <leafValues>\n            6.1542397737503052e-01 3.2983001321554184e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1163 6.8620000965893269e-03</internalNodes>\n          <leafValues>\n            -2.9583099484443665e-01 2.7003699541091919e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1164 -2.8240999206900597e-02</internalNodes>\n          <leafValues>\n            -6.1102700233459473e-01 1.7357499897480011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1165 -3.2099999953061342e-04</internalNodes>\n          <leafValues>\n            -5.3322899341583252e-01 6.8539001047611237e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1166 -1.0829100012779236e-01</internalNodes>\n          <leafValues>\n            -1.2879559993743896e+00 1.1801700294017792e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1167 1.5878999605774879e-02</internalNodes>\n          <leafValues>\n            -1.7072600126266479e-01 1.1103910207748413e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1168 8.6859995499253273e-03</internalNodes>\n          <leafValues>\n            -1.0995099693536758e-01 4.6010500192642212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1169 -2.5234999135136604e-02</internalNodes>\n          <leafValues>\n            1.0220669507980347e+00 -1.8694299459457397e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1170 -1.3508999720215797e-02</internalNodes>\n          <leafValues>\n            -7.8316599130630493e-01 1.4202600717544556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1171 -7.7149998396635056e-03</internalNodes>\n          <leafValues>\n            -8.8060700893402100e-01 1.1060000397264957e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1172 7.1580000221729279e-02</internalNodes>\n          <leafValues>\n            1.1369399726390839e-01 -1.1032789945602417e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1173 -1.3554000295698643e-02</internalNodes>\n          <leafValues>\n            -8.1096500158309937e-01 3.4080001059919596e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1174 2.9450000729411840e-03</internalNodes>\n          <leafValues>\n            -7.2879999876022339e-02 3.4998100996017456e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1175 -5.0833001732826233e-02</internalNodes>\n          <leafValues>\n            -1.2868590354919434e+00 -2.8842000290751457e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1176 -8.7989997118711472e-03</internalNodes>\n          <leafValues>\n            4.7613599896430969e-01 -1.4690400660037994e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1177 2.1424399316310883e-01</internalNodes>\n          <leafValues>\n            -5.9702001512050629e-02 -2.4802260398864746e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1178 1.3962999917566776e-02</internalNodes>\n          <leafValues>\n            1.7420299351215363e-01 -4.3911001086235046e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1179 4.2502000927925110e-02</internalNodes>\n          <leafValues>\n            -1.9965299963951111e-01 7.0654797554016113e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1180 1.9827999174594879e-02</internalNodes>\n          <leafValues>\n            -6.9136001169681549e-02 6.1643397808074951e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1181 -3.3560000360012054e-02</internalNodes>\n          <leafValues>\n            -1.2740780115127563e+00 -2.5673000141978264e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1182 6.3542999327182770e-02</internalNodes>\n          <leafValues>\n            1.2403500080108643e-01 -1.0776289701461792e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1183 2.1933000534772873e-02</internalNodes>\n          <leafValues>\n            1.4952000230550766e-02 -7.1023499965667725e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1184 -7.8424997627735138e-02</internalNodes>\n          <leafValues>\n            6.2033998966217041e-01 3.3610999584197998e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1185 1.4390000142157078e-02</internalNodes>\n          <leafValues>\n            -3.6324599385261536e-01 1.7308300733566284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1186 -6.7309997975826263e-02</internalNodes>\n          <leafValues>\n            5.2374100685119629e-01 1.2799999676644802e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1187 1.3047499954700470e-01</internalNodes>\n          <leafValues>\n            -1.7122499644756317e-01 1.1235200166702271e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1188 -4.6245999634265900e-02</internalNodes>\n          <leafValues>\n            -1.1908329725265503e+00 1.7425599694252014e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1189 -2.9842000454664230e-02</internalNodes>\n          <leafValues>\n            8.3930599689483643e-01 -1.8064199388027191e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1190 -3.8099999073892832e-04</internalNodes>\n          <leafValues>\n            3.5532799363136292e-01 -2.3842300474643707e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1191 -2.2378999739885330e-02</internalNodes>\n          <leafValues>\n            -8.7943899631500244e-01 -7.8399997437372804e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1192 -1.5569999814033508e-03</internalNodes>\n          <leafValues>\n            -1.4253300428390503e-01 2.5876200199127197e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1193 1.2013000436127186e-02</internalNodes>\n          <leafValues>\n            -2.9015499353408813e-01 2.6051101088523865e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1194 2.4384999647736549e-02</internalNodes>\n          <leafValues>\n            -3.1438998878002167e-02 5.8695900440216064e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1195 -4.7180999070405960e-02</internalNodes>\n          <leafValues>\n            6.9430100917816162e-01 -2.1816100180149078e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1196 -2.4893999099731445e-02</internalNodes>\n          <leafValues>\n            -6.4599299430847168e-01 1.5611599385738373e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1197 2.1944999694824219e-02</internalNodes>\n          <leafValues>\n            -2.7742000296711922e-02 -1.1346880197525024e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1198 1.8809899687767029e-01</internalNodes>\n          <leafValues>\n            -1.0076000355184078e-02 1.2429029941558838e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1199 -7.7872000634670258e-02</internalNodes>\n          <leafValues>\n            8.5008001327514648e-01 -1.9015499949455261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1200 -4.8769000917673111e-02</internalNodes>\n          <leafValues>\n            -2.0763080120086670e+00 1.2179400026798248e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1201 -1.7115000635385513e-02</internalNodes>\n          <leafValues>\n            -8.5687297582626343e-01 7.8760003671050072e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1202 -2.7499999850988388e-03</internalNodes>\n          <leafValues>\n            3.8645499944686890e-01 -1.1391499638557434e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1203 -9.8793998360633850e-02</internalNodes>\n          <leafValues>\n            -1.7233899831771851e+00 -5.6063000112771988e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1204 -2.1936999633908272e-02</internalNodes>\n          <leafValues>\n            5.4749399423599243e-01 -4.2481999844312668e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1205 6.1096999794244766e-02</internalNodes>\n          <leafValues>\n            -3.8945000618696213e-02 -1.0807880163192749e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1206 -2.4563999846577644e-02</internalNodes>\n          <leafValues>\n            5.8311098814010620e-01 -9.7599998116493225e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1207 3.3752001821994781e-02</internalNodes>\n          <leafValues>\n            -1.3795999810099602e-02 -8.4730297327041626e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1208 3.8199000060558319e-02</internalNodes>\n          <leafValues>\n            1.5114299952983856e-01 -7.9473400115966797e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1209 -2.0117999985814095e-02</internalNodes>\n          <leafValues>\n            5.1579099893569946e-01 -2.1445399522781372e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1210 2.4734999984502792e-02</internalNodes>\n          <leafValues>\n            -2.2105000913143158e-02 4.2917698621749878e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1211 -2.4357000365853310e-02</internalNodes>\n          <leafValues>\n            -8.6201298236846924e-01 -3.6760000512003899e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1212 -2.6442000642418861e-02</internalNodes>\n          <leafValues>\n            -4.5397499203681946e-01 2.2462800145149231e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1213 -3.4429999068379402e-03</internalNodes>\n          <leafValues>\n            1.3073000311851501e-01 -3.8622701168060303e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1214 1.0701700299978256e-01</internalNodes>\n          <leafValues>\n            1.3158600032329559e-01 -7.9306900501251221e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1215 4.5152999460697174e-02</internalNodes>\n          <leafValues>\n            -2.5296801328659058e-01 4.0672400593757629e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1216 4.4349998235702515e-02</internalNodes>\n          <leafValues>\n            2.2613000124692917e-02 7.9618102312088013e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1217 1.0839999886229634e-03</internalNodes>\n          <leafValues>\n            -3.9158400893211365e-01 1.1639100313186646e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1218 7.1433000266551971e-02</internalNodes>\n          <leafValues>\n            8.2466997206211090e-02 1.2530590295791626e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1219 3.5838000476360321e-02</internalNodes>\n          <leafValues>\n            -1.8203300237655640e-01 7.7078700065612793e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1220 -2.0839000120759010e-02</internalNodes>\n          <leafValues>\n            -6.1744397878646851e-01 1.5891399979591370e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1221 4.2525801062583923e-01</internalNodes>\n          <leafValues>\n            -4.8978000879287720e-02 -1.8422030210494995e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1222 1.1408000253140926e-02</internalNodes>\n          <leafValues>\n            1.7918199300765991e-01 -1.5383499860763550e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1223 -1.5364999882876873e-02</internalNodes>\n          <leafValues>\n            -8.4016501903533936e-01 -1.0280000278726220e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1224 -1.5212000347673893e-02</internalNodes>\n          <leafValues>\n            -1.8995699286460876e-01 1.7130999267101288e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1225 -1.8972000107169151e-02</internalNodes>\n          <leafValues>\n            -7.9541999101638794e-01 6.6800001077353954e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1226 -3.3330000005662441e-03</internalNodes>\n          <leafValues>\n            -2.3530800640583038e-01 2.4730099737644196e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1227 9.3248002231121063e-02</internalNodes>\n          <leafValues>\n            -5.4758001118898392e-02 -1.8324300050735474e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1228 -1.2555000372231007e-02</internalNodes>\n          <leafValues>\n            2.6385200023651123e-01 -3.8526400923728943e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1229 -2.7070000767707825e-02</internalNodes>\n          <leafValues>\n            -6.6929799318313599e-01 2.0340999588370323e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1230 -2.3677000775933266e-02</internalNodes>\n          <leafValues>\n            6.7265301942825317e-01 -1.4344000257551670e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1231 -1.4275000430643559e-02</internalNodes>\n          <leafValues>\n            3.0186399817466736e-01 -2.8514400124549866e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1232 2.8096999973058701e-02</internalNodes>\n          <leafValues>\n            1.4766000211238861e-01 -1.4078520536422729e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1233 5.0840001553297043e-02</internalNodes>\n          <leafValues>\n            -1.8613600730895996e-01 7.9953002929687500e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1234 1.1505999602377415e-02</internalNodes>\n          <leafValues>\n            1.9118399918079376e-01 -8.5035003721714020e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1235 -1.4661000110208988e-02</internalNodes>\n          <leafValues>\n            4.5239299535751343e-01 -2.2205199301242828e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1236 2.2842499613761902e-01</internalNodes>\n          <leafValues>\n            1.3488399982452393e-01 -1.2894610166549683e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1237 1.1106900125741959e-01</internalNodes>\n          <leafValues>\n            -2.0753799378871918e-01 5.4561597108840942e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1238 3.2450000289827585e-03</internalNodes>\n          <leafValues>\n            3.2053700089454651e-01 -1.6403500735759735e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1239 8.5309997200965881e-02</internalNodes>\n          <leafValues>\n            -2.0210500061511993e-01 5.3296798467636108e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1240 2.2048000246286392e-02</internalNodes>\n          <leafValues>\n            1.5698599815368652e-01 -1.7014099657535553e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1241 -1.5676999464631081e-02</internalNodes>\n          <leafValues>\n            -6.2863498926162720e-01 4.0761999785900116e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1242 3.3112901449203491e-01</internalNodes>\n          <leafValues>\n            1.6609300673007965e-01 -1.0326379537582397e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1243 8.8470000773668289e-03</internalNodes>\n          <leafValues>\n            -2.5076198577880859e-01 3.1660598516464233e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1244 4.6080000698566437e-02</internalNodes>\n          <leafValues>\n            1.5352100133895874e-01 -1.6333500146865845e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1245 -3.7703000009059906e-02</internalNodes>\n          <leafValues>\n            5.6873798370361328e-01 -2.0102599263191223e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>159</maxWeakCount>\n      <stageThreshold>-3.5939640998840332e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1246 -8.1808999180793762e-02</internalNodes>\n          <leafValues>\n            5.7124799489974976e-01 -6.7438799142837524e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1247 2.1761199831962585e-01</internalNodes>\n          <leafValues>\n            -3.8610199093818665e-01 9.0343999862670898e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1248 1.4878000132739544e-02</internalNodes>\n          <leafValues>\n            2.2241599857807159e-01 -1.2779350280761719e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1249 5.2434999495744705e-02</internalNodes>\n          <leafValues>\n            -2.8690400719642639e-01 7.5742298364639282e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1250 9.1429995372891426e-03</internalNodes>\n          <leafValues>\n            -6.4880400896072388e-01 2.2268800437450409e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1251 7.9169999808073044e-03</internalNodes>\n          <leafValues>\n            -2.9253599047660828e-01 3.1030198931694031e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1252 -2.6084000244736671e-02</internalNodes>\n          <leafValues>\n            4.5532700419425964e-01 -3.8500601053237915e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1253 -2.9400000348687172e-03</internalNodes>\n          <leafValues>\n            -5.1264399290084839e-01 2.7432298660278320e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1254 5.7130001485347748e-02</internalNodes>\n          <leafValues>\n            1.5788000077009201e-02 -1.2133100032806396e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1255 -6.1309998854994774e-03</internalNodes>\n          <leafValues>\n            3.9174601435661316e-01 -3.0866798758506775e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1256 -4.0405001491308212e-02</internalNodes>\n          <leafValues>\n            1.1901949644088745e+00 -2.0347100496292114e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1257 -2.0297000184655190e-02</internalNodes>\n          <leafValues>\n            -6.8239498138427734e-01 2.0458699762821198e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1258 -1.7188999801874161e-02</internalNodes>\n          <leafValues>\n            -8.4939897060394287e-01 3.8433000445365906e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1259 -2.4215999990701675e-02</internalNodes>\n          <leafValues>\n            -1.1039420366287231e+00 1.5975099802017212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1260 5.6869000196456909e-02</internalNodes>\n          <leafValues>\n            -1.9595299661159515e-01 1.1806850433349609e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1261 3.6199999158270657e-04</internalNodes>\n          <leafValues>\n            -4.0847799181938171e-01 3.2938599586486816e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1262 9.9790003150701523e-03</internalNodes>\n          <leafValues>\n            -2.9673001170158386e-01 4.1547900438308716e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1263 -5.2625000476837158e-02</internalNodes>\n          <leafValues>\n            -1.3069299459457397e+00 1.7862600088119507e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1264 -1.3748999685049057e-02</internalNodes>\n          <leafValues>\n            2.3665800690650940e-01 -4.4536599516868591e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1265 -3.0517000705003738e-02</internalNodes>\n          <leafValues>\n            2.9018300771713257e-01 -1.1210100352764130e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1266 -3.0037501454353333e-01</internalNodes>\n          <leafValues>\n            -2.4237680435180664e+00 -4.2830999940633774e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1267 -3.5990998148918152e-02</internalNodes>\n          <leafValues>\n            8.8206499814987183e-01 -4.7012999653816223e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1268 -5.5112000554800034e-02</internalNodes>\n          <leafValues>\n            8.0119001865386963e-01 -2.0490999519824982e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1269 3.3762000501155853e-02</internalNodes>\n          <leafValues>\n            1.4617599546909332e-01 -1.1349489688873291e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1270 -8.2710003480315208e-03</internalNodes>\n          <leafValues>\n            -8.1604897975921631e-01 1.8988000229001045e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1271 -5.4399999789893627e-03</internalNodes>\n          <leafValues>\n            -7.0980900526046753e-01 2.2343699634075165e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1272 3.1059999018907547e-03</internalNodes>\n          <leafValues>\n            -7.2808599472045898e-01 4.0224999189376831e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1273 5.3651999682188034e-02</internalNodes>\n          <leafValues>\n            1.7170900106430054e-01 -1.1163710355758667e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1274 -1.2541399896144867e-01</internalNodes>\n          <leafValues>\n            2.7680370807647705e+00 -1.4611500501632690e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1275 9.2542000114917755e-02</internalNodes>\n          <leafValues>\n            1.1609800159931183e-01 -3.9635529518127441e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1276 3.8513999432325363e-02</internalNodes>\n          <leafValues>\n            -7.6399999670684338e-03 -9.8780900239944458e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1277 -2.0200000144541264e-03</internalNodes>\n          <leafValues>\n            2.3059999942779541e-01 -7.4970299005508423e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1278 9.7599998116493225e-03</internalNodes>\n          <leafValues>\n            -3.1137999892234802e-01 3.0287799239158630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1279 2.4095000699162483e-02</internalNodes>\n          <leafValues>\n            -4.9529999494552612e-02 5.2690100669860840e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1280 -1.7982000485062599e-02</internalNodes>\n          <leafValues>\n            -1.1610640287399292e+00 -5.7000000961124897e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1281 -1.0555000044405460e-02</internalNodes>\n          <leafValues>\n            -2.7189099788665771e-01 2.3597699403762817e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1282 -7.2889998555183411e-03</internalNodes>\n          <leafValues>\n            -5.4219102859497070e-01 8.1914000213146210e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1283 2.3939000442624092e-02</internalNodes>\n          <leafValues>\n            1.7975799739360809e-01 -6.7049497365951538e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1284 -1.8365999683737755e-02</internalNodes>\n          <leafValues>\n            6.2664300203323364e-01 -2.0970100164413452e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1285 1.5715999528765678e-02</internalNodes>\n          <leafValues>\n            2.4193699657917023e-01 -1.0444309711456299e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1286 -4.8804000020027161e-02</internalNodes>\n          <leafValues>\n            -9.4060599803924561e-01 -3.7519999314099550e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1287 6.7130001261830330e-03</internalNodes>\n          <leafValues>\n            -7.5432002544403076e-02 6.1575299501419067e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1288 9.7770001739263535e-03</internalNodes>\n          <leafValues>\n            3.9285000413656235e-02 -8.4810298681259155e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1289 1.4744999818503857e-02</internalNodes>\n          <leafValues>\n            1.6968999803066254e-01 -5.0906401872634888e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1290 9.7079001367092133e-02</internalNodes>\n          <leafValues>\n            -3.3103000372648239e-02 -1.2706379890441895e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1291 4.8285998404026031e-02</internalNodes>\n          <leafValues>\n            9.4329997897148132e-02 2.7203190326690674e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1292 9.7810002043843269e-03</internalNodes>\n          <leafValues>\n            -3.9533400535583496e-01 1.5363800525665283e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1293 -3.9893999695777893e-02</internalNodes>\n          <leafValues>\n            -2.2767400741577148e-01 1.3913999497890472e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1294 2.2848000749945641e-02</internalNodes>\n          <leafValues>\n            -2.7391999959945679e-01 3.4199500083923340e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1295 6.7179999314248562e-03</internalNodes>\n          <leafValues>\n            -1.0874299705028534e-01 4.8125401139259338e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1296 5.9599999338388443e-02</internalNodes>\n          <leafValues>\n            -4.9522001296281815e-02 -2.0117089748382568e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1297 6.9340001791715622e-03</internalNodes>\n          <leafValues>\n            1.5037499368190765e-01 -1.1271899938583374e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1298 1.5757000073790550e-02</internalNodes>\n          <leafValues>\n            -2.0885000005364418e-02 -1.1651979684829712e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1299 -4.9690000712871552e-02</internalNodes>\n          <leafValues>\n            -8.0213499069213867e-01 1.4372299611568451e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1300 5.2347000688314438e-02</internalNodes>\n          <leafValues>\n            -2.0836700499057770e-01 6.1677598953247070e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1301 2.2430999204516411e-02</internalNodes>\n          <leafValues>\n            2.0305900275707245e-01 -7.5326198339462280e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1302 4.1142001748085022e-02</internalNodes>\n          <leafValues>\n            -1.8118199706077576e-01 1.0033359527587891e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1303 -2.1632000803947449e-02</internalNodes>\n          <leafValues>\n            4.9998998641967773e-01 -3.4662999212741852e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1304 -8.2808002829551697e-02</internalNodes>\n          <leafValues>\n            1.1711900234222412e+00 -1.8433600664138794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1305 8.5060000419616699e-03</internalNodes>\n          <leafValues>\n            -6.3225001096725464e-02 2.9024899005889893e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1306 7.8905001282691956e-02</internalNodes>\n          <leafValues>\n            -2.3274500668048859e-01 5.9695798158645630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1307 -9.0207003057003021e-02</internalNodes>\n          <leafValues>\n            -8.2211899757385254e-01 1.7772200703620911e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1308 -2.9269000515341759e-02</internalNodes>\n          <leafValues>\n            6.0860699415206909e-01 -2.1468900144100189e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1309 6.9499998353421688e-03</internalNodes>\n          <leafValues>\n            -4.2665999382734299e-02 6.0512101650238037e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1310 -8.0629996955394745e-03</internalNodes>\n          <leafValues>\n            -1.1508270502090454e+00 -2.7286000549793243e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1311 1.9595999270677567e-02</internalNodes>\n          <leafValues>\n            -9.1880001127719879e-03 5.6857800483703613e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1312 -1.4884999953210354e-02</internalNodes>\n          <leafValues>\n            3.7658798694610596e-01 -2.7149501442909241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1313 2.5217000395059586e-02</internalNodes>\n          <leafValues>\n            -9.9991001188755035e-02 2.4664700031280518e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1314 -1.5855999663472176e-02</internalNodes>\n          <leafValues>\n            6.6826701164245605e-01 -2.0614700019359589e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1315 2.9441000893712044e-02</internalNodes>\n          <leafValues>\n            1.5832200646400452e-01 -7.6060897111892700e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1316 -8.5279997438192368e-03</internalNodes>\n          <leafValues>\n            3.8212299346923828e-01 -2.5407800078392029e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1317 2.4421999230980873e-02</internalNodes>\n          <leafValues>\n            1.5105099976062775e-01 -2.8752899169921875e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1318 -3.3886998891830444e-02</internalNodes>\n          <leafValues>\n            -6.8002802133560181e-01 3.4327000379562378e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1319 -2.0810000132769346e-03</internalNodes>\n          <leafValues>\n            2.5413900613784790e-01 -2.6859098672866821e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1320 3.0358999967575073e-02</internalNodes>\n          <leafValues>\n            -3.0842000618577003e-02 -1.1476809978485107e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1321 4.0210001170635223e-03</internalNodes>\n          <leafValues>\n            -3.5253798961639404e-01 2.9868099093437195e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1322 2.7681000530719757e-02</internalNodes>\n          <leafValues>\n            -3.8148999214172363e-02 -1.3262039422988892e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1323 7.9039996489882469e-03</internalNodes>\n          <leafValues>\n            -2.3737000301480293e-02 7.0503002405166626e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1324 4.4031001627445221e-02</internalNodes>\n          <leafValues>\n            1.0674899816513062e-01 -4.5261201262474060e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1325 -3.2370999455451965e-02</internalNodes>\n          <leafValues>\n            4.6674901247024536e-01 -6.1546999961137772e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1326 2.0933000370860100e-02</internalNodes>\n          <leafValues>\n            -2.8447899222373962e-01 4.3845599889755249e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1327 2.5227999314665794e-02</internalNodes>\n          <leafValues>\n            -2.2537000477313995e-02 7.0389097929000854e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1328 6.5520000644028187e-03</internalNodes>\n          <leafValues>\n            -3.2554900646209717e-01 2.4023699760437012e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1329 -5.8557998389005661e-02</internalNodes>\n          <leafValues>\n            -1.2227720022201538e+00 1.1668799817562103e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1330 3.1899999827146530e-02</internalNodes>\n          <leafValues>\n            -1.9305000081658363e-02 -1.0973169803619385e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1331 -3.0445000156760216e-02</internalNodes>\n          <leafValues>\n            6.5582501888275146e-01 7.5090996921062469e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1332 1.4933000318706036e-02</internalNodes>\n          <leafValues>\n            -5.2155798673629761e-01 1.1523099988698959e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1333 -4.9008000642061234e-02</internalNodes>\n          <leafValues>\n            -7.8303998708724976e-01 1.6657200455665588e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1334 8.3158999681472778e-02</internalNodes>\n          <leafValues>\n            -2.6879999786615372e-03 -8.5282301902770996e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1335 2.3902999237179756e-02</internalNodes>\n          <leafValues>\n            -5.1010999828577042e-02 4.1999098658561707e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1336 1.6428999602794647e-02</internalNodes>\n          <leafValues>\n            1.9232999533414841e-02 -6.5049099922180176e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1337 -1.1838000267744064e-02</internalNodes>\n          <leafValues>\n            -6.2409800291061401e-01 1.5411199629306793e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1338 -1.6799999866634607e-04</internalNodes>\n          <leafValues>\n            1.7589199542999268e-01 -3.4338700771331787e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1339 1.9193999469280243e-02</internalNodes>\n          <leafValues>\n            4.3418999761343002e-02 7.9069197177886963e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1340 -1.0032000020146370e-02</internalNodes>\n          <leafValues>\n            4.5648899674415588e-01 -2.2494800388813019e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1341 -1.4004000462591648e-02</internalNodes>\n          <leafValues>\n            3.3570998907089233e-01 -4.8799999058246613e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1342 -1.0319899767637253e-01</internalNodes>\n          <leafValues>\n            -2.3378000259399414e+00 -5.8933001011610031e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1343 -9.5697000622749329e-02</internalNodes>\n          <leafValues>\n            -6.6153901815414429e-01 2.0098599791526794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1344 -4.1480999439954758e-02</internalNodes>\n          <leafValues>\n            4.5939201116561890e-01 -2.2314099967479706e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1345 2.4099999573081732e-03</internalNodes>\n          <leafValues>\n            -2.6898598670959473e-01 2.4922999739646912e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1346 1.0724999755620956e-01</internalNodes>\n          <leafValues>\n            -1.8640199303627014e-01 7.2769802808761597e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1347 3.1870000530034304e-03</internalNodes>\n          <leafValues>\n            -2.4608999490737915e-02 2.8643900156021118e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1348 2.9167000204324722e-02</internalNodes>\n          <leafValues>\n            -3.4683000296354294e-02 -1.1162580251693726e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1349 1.1287000030279160e-02</internalNodes>\n          <leafValues>\n            6.3760001212358475e-03 6.6632097959518433e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1350 -1.2001000344753265e-02</internalNodes>\n          <leafValues>\n            4.2420101165771484e-01 -2.6279801130294800e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1351 -1.2695999816060066e-02</internalNodes>\n          <leafValues>\n            -2.1957000717520714e-02 1.8936799466609955e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1352 2.4597000330686569e-02</internalNodes>\n          <leafValues>\n            -3.4963998943567276e-02 -1.0989320278167725e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1353 4.5953001827001572e-02</internalNodes>\n          <leafValues>\n            1.1109799891710281e-01 -2.9306049346923828e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1354 -2.7241000905632973e-02</internalNodes>\n          <leafValues>\n            2.9101699590682983e-01 -2.7407899498939514e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1355 4.0063999593257904e-02</internalNodes>\n          <leafValues>\n            1.1877900362014771e-01 -6.2801802158355713e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1356 2.3055000230669975e-02</internalNodes>\n          <leafValues>\n            1.4813800156116486e-01 -3.7007498741149902e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1357 -2.3737000301480293e-02</internalNodes>\n          <leafValues>\n            -5.3724801540374756e-01 1.9358199834823608e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1358 7.7522002160549164e-02</internalNodes>\n          <leafValues>\n            -6.0194000601768494e-02 -1.9489669799804688e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1359 -1.3345000334084034e-02</internalNodes>\n          <leafValues>\n            -4.5229598879814148e-01 1.8741500377655029e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1360 -2.1719999611377716e-02</internalNodes>\n          <leafValues>\n            1.2144249677658081e+00 -1.5365800261497498e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1361 -7.1474999189376831e-02</internalNodes>\n          <leafValues>\n            -2.3047130107879639e+00 1.0999900102615356e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1362 -5.4999999701976776e-03</internalNodes>\n          <leafValues>\n            -7.1855199337005615e-01 2.0100999623537064e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1363 2.6740999892354012e-02</internalNodes>\n          <leafValues>\n            7.3545001447200775e-02 9.8786002397537231e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1364 -3.9407998323440552e-02</internalNodes>\n          <leafValues>\n            -1.2227380275726318e+00 -4.3506998568773270e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1365 2.5888999924063683e-02</internalNodes>\n          <leafValues>\n            1.3409300148487091e-01 -1.1770780086517334e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1366 4.8925001174211502e-02</internalNodes>\n          <leafValues>\n            -3.0810000374913216e-02 -9.3479502201080322e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1367 3.6892998963594437e-02</internalNodes>\n          <leafValues>\n            1.3333700597286224e-01 -1.4998290538787842e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1368 7.8929997980594635e-02</internalNodes>\n          <leafValues>\n            -1.4538800716400146e-01 1.5631790161132812e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1369 2.9006000608205795e-02</internalNodes>\n          <leafValues>\n            1.9383700191974640e-01 -6.7642802000045776e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1370 6.3089998438954353e-03</internalNodes>\n          <leafValues>\n            -3.7465399503707886e-01 1.0857500135898590e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1371 -6.5830998122692108e-02</internalNodes>\n          <leafValues>\n            8.1059402227401733e-01 3.0201999470591545e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1372 -6.8965002894401550e-02</internalNodes>\n          <leafValues>\n            8.3772599697113037e-01 -1.7140999436378479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1373 -1.1669100075960159e-01</internalNodes>\n          <leafValues>\n            -9.4647198915481567e-01 1.3123199343681335e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1374 -1.3060000492259860e-03</internalNodes>\n          <leafValues>\n            4.6007998287677765e-02 -5.2011597156524658e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1375 -4.4558998197317123e-02</internalNodes>\n          <leafValues>\n            -1.9423669576644897e+00 1.3200700283050537e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1376 5.1033001393079758e-02</internalNodes>\n          <leafValues>\n            -2.1480999886989594e-01 4.8673900961875916e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1377 -3.1578000634908676e-02</internalNodes>\n          <leafValues>\n            5.9989798069000244e-01 7.9159997403621674e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1378 2.1020000800490379e-02</internalNodes>\n          <leafValues>\n            -2.2069500386714935e-01 5.4046201705932617e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1379 -1.3824200630187988e-01</internalNodes>\n          <leafValues>\n            6.2957501411437988e-01 -2.1712999790906906e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1380 5.2228998392820358e-02</internalNodes>\n          <leafValues>\n            -2.3360900580883026e-01 4.9760800600051880e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1381 2.5884000584483147e-02</internalNodes>\n          <leafValues>\n            1.8041999638080597e-01 -2.2039200365543365e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1382 -1.2138999998569489e-02</internalNodes>\n          <leafValues>\n            -6.9731897115707397e-01 1.5712000429630280e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1383 -2.4237999692559242e-02</internalNodes>\n          <leafValues>\n            3.4593299031257629e-01 7.1469999849796295e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1384 -2.5272000581026077e-02</internalNodes>\n          <leafValues>\n            -8.7583297491073608e-01 -9.8240002989768982e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1385 1.2597000226378441e-02</internalNodes>\n          <leafValues>\n            2.3649999499320984e-01 -2.8731200098991394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1386 5.7330999523401260e-02</internalNodes>\n          <leafValues>\n            -6.1530999839305878e-02 -2.2326040267944336e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1387 1.6671000048518181e-02</internalNodes>\n          <leafValues>\n            -1.9850100576877594e-01 4.0810701251029968e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1388 -2.2818999364972115e-02</internalNodes>\n          <leafValues>\n            9.6487599611282349e-01 -2.0245699584484100e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1389 3.7000001611886546e-05</internalNodes>\n          <leafValues>\n            -5.8908998966217041e-02 2.7055400609970093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1390 -7.6700001955032349e-03</internalNodes>\n          <leafValues>\n            -4.5317101478576660e-01 8.9628003537654877e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1391 9.4085998833179474e-02</internalNodes>\n          <leafValues>\n            1.1604599654674530e-01 -1.0951169729232788e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1392 -6.2267001718282700e-02</internalNodes>\n          <leafValues>\n            1.8096530437469482e+00 -1.4773200452327728e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1393 1.7416000366210938e-02</internalNodes>\n          <leafValues>\n            2.3068200051784515e-01 -4.2417600750923157e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1394 -2.2066000849008560e-02</internalNodes>\n          <leafValues>\n            4.9270299077033997e-01 -2.0630900561809540e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1395 -1.0404000058770180e-02</internalNodes>\n          <leafValues>\n            6.0924297571182251e-01 2.8130000457167625e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1396 -9.3670003116130829e-03</internalNodes>\n          <leafValues>\n            4.0171200037002563e-01 -2.1681700646877289e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1397 -2.9039999470114708e-02</internalNodes>\n          <leafValues>\n            -8.4876501560211182e-01 1.4246800541877747e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1398 -2.1061999723315239e-02</internalNodes>\n          <leafValues>\n            -7.9198300838470459e-01 -1.2595999985933304e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1399 -3.7000998854637146e-02</internalNodes>\n          <leafValues>\n            -6.7488902807235718e-01 1.2830400466918945e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1400 1.0735999792814255e-02</internalNodes>\n          <leafValues>\n            3.6779999732971191e-02 -6.3393002748489380e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1401 1.6367599368095398e-01</internalNodes>\n          <leafValues>\n            1.3803899288177490e-01 -4.7189000248908997e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1402 9.4917997717857361e-02</internalNodes>\n          <leafValues>\n            -1.3855700194835663e-01 1.9492419958114624e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1403 3.5261999815702438e-02</internalNodes>\n          <leafValues>\n            1.3721899688243866e-01 -2.1186530590057373e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1404 1.2811000458896160e-02</internalNodes>\n          <leafValues>\n            -2.0008100569248199e-01 4.9507799744606018e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>155</maxWeakCount>\n      <stageThreshold>-3.3933560848236084e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1405 1.3904400169849396e-01</internalNodes>\n          <leafValues>\n            -4.6581199765205383e-01 7.6431602239608765e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1406 1.1916999705135822e-02</internalNodes>\n          <leafValues>\n            -9.4398999214172363e-01 3.9726299047470093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1407 -1.0006999596953392e-02</internalNodes>\n          <leafValues>\n            3.2718798518180847e-01 -6.3367402553558350e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1408 -6.0479999519884586e-03</internalNodes>\n          <leafValues>\n            2.7427899837493896e-01 -5.7446998357772827e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1409 -1.2489999644458294e-03</internalNodes>\n          <leafValues>\n            2.3629300296306610e-01 -6.8593502044677734e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1410 3.2382000237703323e-02</internalNodes>\n          <leafValues>\n            -5.7630199193954468e-01 2.7492699027061462e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1411 -1.3957999646663666e-02</internalNodes>\n          <leafValues>\n            -6.1061501502990723e-01 2.4541600048542023e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1412 1.1159999994561076e-03</internalNodes>\n          <leafValues>\n            -5.6539100408554077e-01 2.7179300785064697e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1413 2.7000000045518391e-05</internalNodes>\n          <leafValues>\n            -8.0235999822616577e-01 1.1509100347757339e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1414 -2.5700000696815550e-04</internalNodes>\n          <leafValues>\n            -8.1205898523330688e-01 2.3844699561595917e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1415 4.0460000745952129e-03</internalNodes>\n          <leafValues>\n            1.3909600675106049e-01 -6.6163200139999390e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1416 1.4356000348925591e-02</internalNodes>\n          <leafValues>\n            -1.6485199332237244e-01 4.1901698708534241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1417 -5.5374998599290848e-02</internalNodes>\n          <leafValues>\n            1.4425870180130005e+00 -1.8820199370384216e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1418 9.3594998121261597e-02</internalNodes>\n          <leafValues>\n            1.3548299670219421e-01 -9.1636097431182861e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1419 2.6624999940395355e-02</internalNodes>\n          <leafValues>\n            -3.3748298883438110e-01 3.9233601093292236e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1420 3.7469998933374882e-03</internalNodes>\n          <leafValues>\n            -1.1615400016307831e-01 4.4399300217628479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1421 -3.1886000186204910e-02</internalNodes>\n          <leafValues>\n            -9.9498301744461060e-01 1.6120000509545207e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1422 -2.2600000724196434e-02</internalNodes>\n          <leafValues>\n            -4.8067399859428406e-01 1.7007300257682800e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1423 2.5202000513672829e-02</internalNodes>\n          <leafValues>\n            3.5580001771450043e-02 -8.0215400457382202e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1424 -3.1036999076604843e-02</internalNodes>\n          <leafValues>\n            -1.0895340442657471e+00 1.8081900477409363e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1425 -2.6475999504327774e-02</internalNodes>\n          <leafValues>\n            9.5671200752258301e-01 -2.1049399673938751e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1426 -1.3853999786078930e-02</internalNodes>\n          <leafValues>\n            -1.0370320081710815e+00 2.2166700661182404e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1427 -6.2925003468990326e-02</internalNodes>\n          <leafValues>\n            9.0199398994445801e-01 -1.9085299968719482e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1428 -4.4750999659299850e-02</internalNodes>\n          <leafValues>\n            -1.0119110345840454e+00 1.4691199362277985e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1429 -2.0428000018000603e-02</internalNodes>\n          <leafValues>\n            6.1624497175216675e-01 -2.3552699387073517e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1430 -8.0329999327659607e-03</internalNodes>\n          <leafValues>\n            -8.3279997110366821e-02 2.1728700399398804e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1431 8.7280003353953362e-03</internalNodes>\n          <leafValues>\n            6.5458998084068298e-02 -6.0318702459335327e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1432 -2.7202000841498375e-02</internalNodes>\n          <leafValues>\n            -9.3447399139404297e-01 1.5270000696182251e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1433 -1.6471000388264656e-02</internalNodes>\n          <leafValues>\n            -8.4177100658416748e-01 1.3332000002264977e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1434 -1.3744000345468521e-02</internalNodes>\n          <leafValues>\n            6.0567200183868408e-01 -9.2021003365516663e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1435 2.9164999723434448e-02</internalNodes>\n          <leafValues>\n            -2.8114000335335732e-02 -1.4014569520950317e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1436 3.7457000464200974e-02</internalNodes>\n          <leafValues>\n            1.3080599904060364e-01 -4.9382498860359192e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1437 -2.5070000439882278e-02</internalNodes>\n          <leafValues>\n            -1.1289390325546265e+00 -1.4600000344216824e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1438 -6.3812002539634705e-02</internalNodes>\n          <leafValues>\n            7.5871598720550537e-01 -1.8200000049546361e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1439 -9.3900002539157867e-03</internalNodes>\n          <leafValues>\n            2.9936400055885315e-01 -2.9487800598144531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1440 -7.6000002445653081e-04</internalNodes>\n          <leafValues>\n            1.9725000485777855e-02 1.9993899762630463e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1441 -2.1740999072790146e-02</internalNodes>\n          <leafValues>\n            -8.5247898101806641e-01 4.9169998615980148e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1442 -1.7869999632239342e-02</internalNodes>\n          <leafValues>\n            -5.9985999017953873e-02 1.5222500264644623e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1443 -2.4831000715494156e-02</internalNodes>\n          <leafValues>\n            3.5603401064872742e-01 -2.6259899139404297e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1444 1.5715500712394714e-01</internalNodes>\n          <leafValues>\n            1.5599999460391700e-04 1.0428730249404907e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1445 6.9026999175548553e-02</internalNodes>\n          <leafValues>\n            -3.3006999641656876e-02 -1.1796669960021973e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1446 -1.1021999642252922e-02</internalNodes>\n          <leafValues>\n            5.8987700939178467e-01 -5.7647999376058578e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1447 -1.3834999874234200e-02</internalNodes>\n          <leafValues>\n            5.9502798318862915e-01 -2.4418599903583527e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1448 -3.0941000208258629e-02</internalNodes>\n          <leafValues>\n            -1.1723799705505371e+00 1.6907000541687012e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1449 2.1258000284433365e-02</internalNodes>\n          <leafValues>\n            -1.8900999799370766e-02 -1.0684759616851807e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1450 9.3079999089241028e-02</internalNodes>\n          <leafValues>\n            1.6305600106716156e-01 -1.3375270366668701e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1451 2.9635999351739883e-02</internalNodes>\n          <leafValues>\n            -2.2524799406528473e-01 4.5400100946426392e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1452 -1.2199999764561653e-04</internalNodes>\n          <leafValues>\n            2.7409100532531738e-01 -3.7371399998664856e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1453 -4.2098000645637512e-02</internalNodes>\n          <leafValues>\n            -7.5828802585601807e-01 1.7137000337243080e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1454 -2.2505000233650208e-02</internalNodes>\n          <leafValues>\n            -2.2759300470352173e-01 2.3698699474334717e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1455 -1.2862999923527241e-02</internalNodes>\n          <leafValues>\n            1.9252400100231171e-01 -3.2127100229263306e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1456 2.7860000729560852e-02</internalNodes>\n          <leafValues>\n            1.6723699867725372e-01 -1.0209059715270996e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1457 -2.7807999402284622e-02</internalNodes>\n          <leafValues>\n            1.2824759483337402e+00 -1.7225299775600433e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1458 -6.1630001291632652e-03</internalNodes>\n          <leafValues>\n            -5.4072898626327515e-01 2.3885700106620789e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1459 -2.0436000078916550e-02</internalNodes>\n          <leafValues>\n            6.3355398178100586e-01 -2.1090599894523621e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1460 -1.2307999655604362e-02</internalNodes>\n          <leafValues>\n            -4.9778199195861816e-01 1.7402599751949310e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1461 -4.0493998676538467e-02</internalNodes>\n          <leafValues>\n            -1.1848740577697754e+00 -3.3890999853610992e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1462 2.9657000675797462e-02</internalNodes>\n          <leafValues>\n            2.1740999072790146e-02 1.0069919824600220e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1463 6.8379999138414860e-03</internalNodes>\n          <leafValues>\n            2.9217999428510666e-02 -5.9906297922134399e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1464 1.6164999455213547e-02</internalNodes>\n          <leafValues>\n            -2.1000799536705017e-01 3.7637299299240112e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1465 5.0193000584840775e-02</internalNodes>\n          <leafValues>\n            2.5319999549537897e-03 -7.1668201684951782e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1466 1.9680000841617584e-03</internalNodes>\n          <leafValues>\n            -2.1921400725841522e-01 3.2298699021339417e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1467 2.4979999288916588e-02</internalNodes>\n          <leafValues>\n            -9.6840001642704010e-03 -7.7572900056838989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1468 -1.5809999778866768e-02</internalNodes>\n          <leafValues>\n            4.4637501239776611e-01 -6.1760000884532928e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1469 3.7206999957561493e-02</internalNodes>\n          <leafValues>\n            -2.0495399832725525e-01 5.7722198963165283e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1470 -7.9264998435974121e-02</internalNodes>\n          <leafValues>\n            -7.6745402812957764e-01 1.2550400197505951e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1471 -1.7152000218629837e-02</internalNodes>\n          <leafValues>\n            -1.4121830463409424e+00 -5.1704000681638718e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1472 3.2740000635385513e-02</internalNodes>\n          <leafValues>\n            1.9334000349044800e-01 -6.3633698225021362e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1473 -1.1756999790668488e-01</internalNodes>\n          <leafValues>\n            8.4325402975082397e-01 -1.8018600344657898e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1474 1.2057200074195862e-01</internalNodes>\n          <leafValues>\n            1.2530000507831573e-01 -2.1213600635528564e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1475 4.2779999785125256e-03</internalNodes>\n          <leafValues>\n            -4.6604400873184204e-01 8.9643999934196472e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1476 -7.2544999420642853e-02</internalNodes>\n          <leafValues>\n            5.1826500892639160e-01 1.6823999583721161e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1477 1.7710599303245544e-01</internalNodes>\n          <leafValues>\n            -3.0910000205039978e-02 -1.1046639680862427e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1478 8.4229996427893639e-03</internalNodes>\n          <leafValues>\n            2.4445800483226776e-01 -3.8613098859786987e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1479 -1.3035000301897526e-02</internalNodes>\n          <leafValues>\n            9.8004400730133057e-01 -1.7016500234603882e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1480 1.8912000581622124e-02</internalNodes>\n          <leafValues>\n            2.0248499512672424e-01 -3.8545900583267212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1481 2.1447999402880669e-02</internalNodes>\n          <leafValues>\n            -2.5717198848724365e-01 3.5181200504302979e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1482 6.3357003033161163e-02</internalNodes>\n          <leafValues>\n            1.6994799673557281e-01 -9.1383802890777588e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1483 -3.2435998320579529e-02</internalNodes>\n          <leafValues>\n            -8.5681599378585815e-01 -2.1680999547243118e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1484 -2.3564999923110008e-02</internalNodes>\n          <leafValues>\n            5.6115597486495972e-01 -2.2400000307243317e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1485 1.8789000809192657e-02</internalNodes>\n          <leafValues>\n            -2.5459799170494080e-01 3.4512901306152344e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1486 3.1042000278830528e-02</internalNodes>\n          <leafValues>\n            7.5719999149441719e-03 3.4800198674201965e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1487 -1.1226999573409557e-02</internalNodes>\n          <leafValues>\n            -6.0219800472259521e-01 4.2814999818801880e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1488 -1.2845999561250210e-02</internalNodes>\n          <leafValues>\n            4.2020401358604431e-01 -5.3801000118255615e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1489 -1.2791999615728855e-02</internalNodes>\n          <leafValues>\n            2.2724500298500061e-01 -3.2398000359535217e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1490 6.8651996552944183e-02</internalNodes>\n          <leafValues>\n            9.3532003462314606e-02 10.</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1491 5.2789999172091484e-03</internalNodes>\n          <leafValues>\n            -2.6926299929618835e-01 3.3303201198577881e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1492 -3.8779001682996750e-02</internalNodes>\n          <leafValues>\n            -7.2365301847457886e-01 1.7806500196456909e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1493 6.1820000410079956e-03</internalNodes>\n          <leafValues>\n            -3.5119399428367615e-01 1.6586300730705261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1494 1.7515200376510620e-01</internalNodes>\n          <leafValues>\n            1.1623100191354752e-01 -1.5419290065765381e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1495 1.1627999693155289e-01</internalNodes>\n          <leafValues>\n            -9.1479998081922531e-03 -9.9842602014541626e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1496 -2.2964000701904297e-02</internalNodes>\n          <leafValues>\n            2.0565399527549744e-01 1.5432000160217285e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1497 -5.1410000771284103e-02</internalNodes>\n          <leafValues>\n            5.8072400093078613e-01 -2.0118400454521179e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1498 2.2474199533462524e-01</internalNodes>\n          <leafValues>\n            1.8728999421000481e-02 1.0829299688339233e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1499 9.4860000535845757e-03</internalNodes>\n          <leafValues>\n            -3.3171299099922180e-01 1.9902999699115753e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1500 -1.1846300214529037e-01</internalNodes>\n          <leafValues>\n            1.3711010217666626e+00 6.8926997482776642e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1501 3.7810999900102615e-02</internalNodes>\n          <leafValues>\n            -9.3600002583116293e-04 -8.3996999263763428e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1502 2.2202000021934509e-02</internalNodes>\n          <leafValues>\n            -1.1963999830186367e-02 3.6673998832702637e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1503 -3.6366000771522522e-02</internalNodes>\n          <leafValues>\n            3.7866500020027161e-01 -2.7714800834655762e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1504 -1.3184699416160583e-01</internalNodes>\n          <leafValues>\n            -2.7481179237365723e+00 1.0666900128126144e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1505 -4.1655998677015305e-02</internalNodes>\n          <leafValues>\n            4.7524300217628479e-01 -2.3249800503253937e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1506 -3.3151999115943909e-02</internalNodes>\n          <leafValues>\n            -5.7929402589797974e-01 1.7434400320053101e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1507 1.5769999474287033e-02</internalNodes>\n          <leafValues>\n            -1.1284000240266323e-02 -8.3701401948928833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1508 -3.9363000541925430e-02</internalNodes>\n          <leafValues>\n            3.4821599721908569e-01 -1.7455400526523590e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1509 -6.7849002778530121e-02</internalNodes>\n          <leafValues>\n            1.4225699901580811e+00 -1.4765599370002747e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1510 -2.6775000616908073e-02</internalNodes>\n          <leafValues>\n            2.3947000503540039e-01 1.3271999545395374e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1511 3.9919000118970871e-02</internalNodes>\n          <leafValues>\n            -8.9999996125698090e-03 -7.5938898324966431e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1512 1.0065600275993347e-01</internalNodes>\n          <leafValues>\n            -1.8685000017285347e-02 7.6245301961898804e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1513 -8.1022001802921295e-02</internalNodes>\n          <leafValues>\n            -9.0439099073410034e-01 -8.5880002006888390e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1514 -2.1258000284433365e-02</internalNodes>\n          <leafValues>\n            -2.1319599449634552e-01 2.1919700503349304e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1515 -1.0630999691784382e-02</internalNodes>\n          <leafValues>\n            1.9598099589347839e-01 -3.5768100619316101e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1516 8.1300002057105303e-04</internalNodes>\n          <leafValues>\n            -9.2794999480247498e-02 2.6145899295806885e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1517 3.4650000743567944e-03</internalNodes>\n          <leafValues>\n            -5.5336099863052368e-01 2.7386000379920006e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1518 1.8835999071598053e-02</internalNodes>\n          <leafValues>\n            1.8446099758148193e-01 -6.6934299468994141e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1519 -2.5631999596953392e-02</internalNodes>\n          <leafValues>\n            1.9382879734039307e+00 -1.4708900451660156e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1520 -4.0939999744296074e-03</internalNodes>\n          <leafValues>\n            -2.6451599597930908e-01 2.0733200013637543e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1521 -8.9199998183175921e-04</internalNodes>\n          <leafValues>\n            -5.5031597614288330e-01 5.0374999642372131e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1522 -4.9518000334501266e-02</internalNodes>\n          <leafValues>\n            -2.5615389347076416e+00 1.3141700625419617e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1523 1.1680999770760536e-02</internalNodes>\n          <leafValues>\n            -2.4819800257682800e-01 3.9982700347900391e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1524 3.4563999623060226e-02</internalNodes>\n          <leafValues>\n            1.6178800165653229e-01 -7.1418899297714233e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1525 -8.2909995689988136e-03</internalNodes>\n          <leafValues>\n            2.2180099785327911e-01 -2.9181700944900513e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1526 -2.2358000278472900e-02</internalNodes>\n          <leafValues>\n            3.1044098734855652e-01 -2.7280000504106283e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1527 -3.0801000073552132e-02</internalNodes>\n          <leafValues>\n            -9.5672702789306641e-01 -8.3400001749396324e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1528 4.3779000639915466e-02</internalNodes>\n          <leafValues>\n            1.2556900084018707e-01 -1.1759619712829590e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1529 4.3046001344919205e-02</internalNodes>\n          <leafValues>\n            -5.8876998722553253e-02 -1.8568470478057861e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1530 2.7188999578356743e-02</internalNodes>\n          <leafValues>\n            4.2858000844717026e-02 3.9036700129508972e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1531 9.4149997457861900e-03</internalNodes>\n          <leafValues>\n            -4.3567001819610596e-02 -1.1094470024108887e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1532 9.4311997294425964e-02</internalNodes>\n          <leafValues>\n            4.0256999433040619e-02 9.8442298173904419e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1533 1.7025099694728851e-01</internalNodes>\n          <leafValues>\n            2.9510000720620155e-02 -6.9509297609329224e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1534 -4.7148000448942184e-02</internalNodes>\n          <leafValues>\n            1.0338569879531860e+00 6.7602001130580902e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1535 1.1186300218105316e-01</internalNodes>\n          <leafValues>\n            -6.8682998418807983e-02 -2.4985830783843994e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1536 -1.4353999868035316e-02</internalNodes>\n          <leafValues>\n            -5.9481900930404663e-01 1.5001699328422546e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1537 3.4024000167846680e-02</internalNodes>\n          <leafValues>\n            -6.4823001623153687e-02 -2.1382639408111572e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1538 2.1601999178528786e-02</internalNodes>\n          <leafValues>\n            5.5309999734163284e-02 7.8292900323867798e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1539 2.1771999076008797e-02</internalNodes>\n          <leafValues>\n            -7.1279997937381268e-03 -7.2148102521896362e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1540 8.2416996359825134e-02</internalNodes>\n          <leafValues>\n            1.4609499275684357e-01 -1.3636670112609863e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1541 8.4671996533870697e-02</internalNodes>\n          <leafValues>\n            -1.7784699797630310e-01 7.2857701778411865e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1542 -5.5128000676631927e-02</internalNodes>\n          <leafValues>\n            -5.9402400255203247e-01 1.9357800483703613e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1543 -6.4823001623153687e-02</internalNodes>\n          <leafValues>\n            -1.0783840417861938e+00 -4.0734000504016876e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1544 -2.2769000381231308e-02</internalNodes>\n          <leafValues>\n            7.7900201082229614e-01 3.4960000775754452e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1545 5.4756000638008118e-02</internalNodes>\n          <leafValues>\n            -6.5683998167514801e-02 -1.8188409805297852e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1546 -8.9000001025851816e-05</internalNodes>\n          <leafValues>\n            -1.7891999334096909e-02 2.0768299698829651e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1547 9.8361998796463013e-02</internalNodes>\n          <leafValues>\n            -5.5946998298168182e-02 -1.4153920412063599e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1548 -7.0930002257227898e-03</internalNodes>\n          <leafValues>\n            3.4135299921035767e-01 -1.2089899927377701e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1549 5.0278000533580780e-02</internalNodes>\n          <leafValues>\n            -2.6286700367927551e-01 2.5797298550605774e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1550 -5.7870000600814819e-03</internalNodes>\n          <leafValues>\n            -1.3178600370883942e-01 1.7350199818611145e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1551 1.3973999768495560e-02</internalNodes>\n          <leafValues>\n            2.8518000617623329e-02 -6.1152201890945435e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1552 2.1449999883770943e-02</internalNodes>\n          <leafValues>\n            2.6181999593973160e-02 3.0306598544120789e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1553 -2.9214000329375267e-02</internalNodes>\n          <leafValues>\n            4.4940599799156189e-01 -2.2803099453449249e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1554 4.8099999548867345e-04</internalNodes>\n          <leafValues>\n            -1.9879999756813049e-01 2.0744499564170837e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1555 1.7109999898821115e-03</internalNodes>\n          <leafValues>\n            -5.4037201404571533e-01 6.7865997552871704e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1556 8.6660003289580345e-03</internalNodes>\n          <leafValues>\n            -1.3128000311553478e-02 5.2297902107238770e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1557 6.3657999038696289e-02</internalNodes>\n          <leafValues>\n            6.8299002945423126e-02 -4.9235099554061890e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1558 -2.7968000620603561e-02</internalNodes>\n          <leafValues>\n            6.8183898925781250e-01 7.8781001269817352e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1559 4.8953998833894730e-02</internalNodes>\n          <leafValues>\n            -2.0622399449348450e-01 5.0388097763061523e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>169</maxWeakCount>\n      <stageThreshold>-3.2396929264068604e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1560 -2.9312999919056892e-02</internalNodes>\n          <leafValues>\n            7.1284699440002441e-01 -5.8230698108673096e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1561 1.2415099889039993e-01</internalNodes>\n          <leafValues>\n            -3.6863499879837036e-01 6.0067200660705566e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1562 7.9349996522068977e-03</internalNodes>\n          <leafValues>\n            -8.6008298397064209e-01 2.1724699437618256e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1563 3.0365999788045883e-02</internalNodes>\n          <leafValues>\n            -2.7186998724937439e-01 6.1247897148132324e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1564 2.5218000635504723e-02</internalNodes>\n          <leafValues>\n            -3.4748300909996033e-01 5.0427699089050293e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1565 1.0014000348746777e-02</internalNodes>\n          <leafValues>\n            -3.1898999214172363e-01 4.1376799345016479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1566 -1.6775000840425491e-02</internalNodes>\n          <leafValues>\n            -6.9048100709915161e-01 9.4830997288227081e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1567 -2.6950000319629908e-03</internalNodes>\n          <leafValues>\n            -2.0829799771308899e-01 2.3737199604511261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1568 4.2257998138666153e-02</internalNodes>\n          <leafValues>\n            -4.9366700649261475e-01 1.8170599639415741e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1569 -4.8505000770092010e-02</internalNodes>\n          <leafValues>\n            1.3429640531539917e+00 3.9769001305103302e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1570 2.8992999345064163e-02</internalNodes>\n          <leafValues>\n            4.6496000140905380e-02 -8.1643497943878174e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1571 -4.0089000016450882e-02</internalNodes>\n          <leafValues>\n            -7.1197801828384399e-01 2.2553899884223938e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1572 -4.1021998971700668e-02</internalNodes>\n          <leafValues>\n            1.0057929754257202e+00 -1.9690200686454773e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1573 1.1838000267744064e-02</internalNodes>\n          <leafValues>\n            -1.2600000016391277e-02 8.0767101049423218e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1574 -2.1328000351786613e-02</internalNodes>\n          <leafValues>\n            -8.2023900747299194e-01 2.0524999126791954e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1575 -2.3904999718070030e-02</internalNodes>\n          <leafValues>\n            5.4210501909255981e-01 -7.4767000973224640e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1576 1.8008999526500702e-02</internalNodes>\n          <leafValues>\n            -3.3827701210975647e-01 4.2358601093292236e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1577 -4.3614000082015991e-02</internalNodes>\n          <leafValues>\n            -1.1983489990234375e+00 1.5566200017929077e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1578 -9.2449998483061790e-03</internalNodes>\n          <leafValues>\n            -8.9029997587203979e-01 1.1003999970853329e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1579 4.7485001385211945e-02</internalNodes>\n          <leafValues>\n            1.6664099693298340e-01 -9.0764498710632324e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1580 -1.4233999885618687e-02</internalNodes>\n          <leafValues>\n            6.2695199251174927e-01 -2.5791200995445251e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1581 3.8010000716894865e-03</internalNodes>\n          <leafValues>\n            -2.8229999542236328e-01 2.6624599099159241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1582 3.4330000635236502e-03</internalNodes>\n          <leafValues>\n            -6.3771998882293701e-01 9.8422996699810028e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1583 -2.9221000149846077e-02</internalNodes>\n          <leafValues>\n            -7.6769900321960449e-01 2.2634500265121460e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1584 -6.4949998632073402e-03</internalNodes>\n          <leafValues>\n            4.5600101351737976e-01 -2.6528900861740112e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1585 -3.0034000054001808e-02</internalNodes>\n          <leafValues>\n            -7.6551097631454468e-01 1.4009299874305725e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1586 7.8360000625252724e-03</internalNodes>\n          <leafValues>\n            4.6755999326705933e-02 -7.2356200218200684e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1587 8.8550001382827759e-03</internalNodes>\n          <leafValues>\n            -4.9141999334096909e-02 5.1472699642181396e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1588 9.5973998308181763e-02</internalNodes>\n          <leafValues>\n            -2.0068999379873276e-02 -1.0850950479507446e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1589 -3.2876998186111450e-02</internalNodes>\n          <leafValues>\n            -9.5875298976898193e-01 1.4543600380420685e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1590 -1.3384000398218632e-02</internalNodes>\n          <leafValues>\n            -7.0013600587844849e-01 2.9157999902963638e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1591 1.5235999599099159e-02</internalNodes>\n          <leafValues>\n            -2.8235700726509094e-01 2.5367999076843262e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1592 1.2054000049829483e-02</internalNodes>\n          <leafValues>\n            -2.5303399562835693e-01 4.6526700258255005e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1593 -7.6295003294944763e-02</internalNodes>\n          <leafValues>\n            -6.9915801286697388e-01 1.3217200338840485e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1594 -1.2040000408887863e-02</internalNodes>\n          <leafValues>\n            4.5894598960876465e-01 -2.3856499791145325e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1595 2.1916000172495842e-02</internalNodes>\n          <leafValues>\n            1.8268600106239319e-01 -6.1629700660705566e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1596 -2.7330000884830952e-03</internalNodes>\n          <leafValues>\n            -6.3257902860641479e-01 3.4219000488519669e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1597 -4.8652000725269318e-02</internalNodes>\n          <leafValues>\n            -1.0297729969024658e+00 1.7386500537395477e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1598 -1.0463999584317207e-02</internalNodes>\n          <leafValues>\n            3.4757301211357117e-01 -2.7464100718498230e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1599 -6.6550001502037048e-03</internalNodes>\n          <leafValues>\n            -2.8980299830436707e-01 2.4037900567054749e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1600 8.5469996556639671e-03</internalNodes>\n          <leafValues>\n            -4.4340500235557556e-01 1.4267399907112122e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1601 1.9913999363780022e-02</internalNodes>\n          <leafValues>\n            1.7740400135517120e-01 -2.4096299707889557e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1602 2.2012999281287193e-02</internalNodes>\n          <leafValues>\n            -1.0812000371515751e-02 -9.4690799713134766e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1603 -5.2179001271724701e-02</internalNodes>\n          <leafValues>\n            1.6547499895095825e+00 9.6487000584602356e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1604 1.9698999822139740e-02</internalNodes>\n          <leafValues>\n            -6.7560002207756042e-03 -8.6311501264572144e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1605 2.3040000349283218e-02</internalNodes>\n          <leafValues>\n            -2.3519999813288450e-03 3.8531300425529480e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1606 -1.5038000419735909e-02</internalNodes>\n          <leafValues>\n            -6.1905699968338013e-01 3.1077999621629715e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1607 -4.9956001341342926e-02</internalNodes>\n          <leafValues>\n            7.0657497644424438e-01 4.7880999743938446e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1608 -6.9269999861717224e-02</internalNodes>\n          <leafValues>\n            3.9212900400161743e-01 -2.3848000168800354e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1609 4.7399997711181641e-03</internalNodes>\n          <leafValues>\n            -2.4309000000357628e-02 2.5386300683021545e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1610 -3.3923998475074768e-02</internalNodes>\n          <leafValues>\n            4.6930399537086487e-01 -2.3321899771690369e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1611 -1.6231000423431396e-02</internalNodes>\n          <leafValues>\n            3.2319200038909912e-01 -2.0545600354671478e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1612 -5.0193000584840775e-02</internalNodes>\n          <leafValues>\n            -1.2277870178222656e+00 -4.0798000991344452e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1613 5.6944001466035843e-02</internalNodes>\n          <leafValues>\n            4.5184001326560974e-02 6.0197502374649048e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1614 4.0936999022960663e-02</internalNodes>\n          <leafValues>\n            -1.6772800683975220e-01 8.9819300174713135e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1615 -3.0839999672025442e-03</internalNodes>\n          <leafValues>\n            3.3716198801994324e-01 -2.7240800857543945e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1616 -3.2600000500679016e-02</internalNodes>\n          <leafValues>\n            -8.5446500778198242e-01 1.9664999097585678e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1617 9.8480999469757080e-02</internalNodes>\n          <leafValues>\n            5.4742000997066498e-02 6.3827300071716309e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1618 -3.8185000419616699e-02</internalNodes>\n          <leafValues>\n            5.2274698019027710e-01 -2.3384800553321838e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1619 -4.5917000621557236e-02</internalNodes>\n          <leafValues>\n            6.2829202413558960e-01 3.2859001308679581e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1620 -1.1955499649047852e-01</internalNodes>\n          <leafValues>\n            -6.1572700738906860e-01 3.4680001437664032e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1621 -1.2044399976730347e-01</internalNodes>\n          <leafValues>\n            -8.4380000829696655e-01 1.6530700027942657e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1622 7.0619001984596252e-02</internalNodes>\n          <leafValues>\n            -6.3261002302169800e-02 -1.9863929748535156e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1623 8.4889996796846390e-03</internalNodes>\n          <leafValues>\n            -1.7663399875164032e-01 3.8011199235916138e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1624 2.2710999473929405e-02</internalNodes>\n          <leafValues>\n            -2.7605999261140823e-02 -9.1921401023864746e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1625 4.9700000090524554e-04</internalNodes>\n          <leafValues>\n            -2.4293200671672821e-01 2.2878900170326233e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1626 3.4651998430490494e-02</internalNodes>\n          <leafValues>\n            -2.3705999553203583e-01 5.4010999202728271e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1627 -4.4700000435113907e-03</internalNodes>\n          <leafValues>\n            3.9078998565673828e-01 -1.2693800032138824e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1628 2.3643000051379204e-02</internalNodes>\n          <leafValues>\n            -2.6663699746131897e-01 3.2312598824501038e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1629 1.2813000008463860e-02</internalNodes>\n          <leafValues>\n            1.7540800571441650e-01 -6.0787999629974365e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1630 -1.1250999756157398e-02</internalNodes>\n          <leafValues>\n            -1.0852589607238770e+00 -2.8046000748872757e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1631 -4.1535001248121262e-02</internalNodes>\n          <leafValues>\n            7.1887397766113281e-01 2.7982000261545181e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1632 -9.3470998108386993e-02</internalNodes>\n          <leafValues>\n            -1.1906319856643677e+00 -4.4810999184846878e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1633 -2.7249999344348907e-02</internalNodes>\n          <leafValues>\n            6.2942498922348022e-01 9.5039997249841690e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1634 -2.1759999915957451e-02</internalNodes>\n          <leafValues>\n            1.3233649730682373e+00 -1.5027000010013580e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1635 -9.6890004351735115e-03</internalNodes>\n          <leafValues>\n            -3.3947101235389709e-01 1.7085799574851990e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1636 6.9395996630191803e-02</internalNodes>\n          <leafValues>\n            -2.5657799839973450e-01 4.7652098536491394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1637 3.1208999454975128e-02</internalNodes>\n          <leafValues>\n            1.4154000580310822e-01 -3.4942001104354858e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1638 -4.9727000296115875e-02</internalNodes>\n          <leafValues>\n            -1.1675560474395752e+00 -4.0757998824119568e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1639 -2.0301999524235725e-02</internalNodes>\n          <leafValues>\n            -3.9486399292945862e-01 1.5814900398254395e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1640 -1.5367000363767147e-02</internalNodes>\n          <leafValues>\n            4.9300000071525574e-01 -2.0092099905014038e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1641 -5.0735000520944595e-02</internalNodes>\n          <leafValues>\n            1.8736059665679932e+00 8.6730003356933594e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1642 -2.0726000890135765e-02</internalNodes>\n          <leafValues>\n            -8.8938397169113159e-01 -7.3199998587369919e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1643 -3.0993999913334846e-02</internalNodes>\n          <leafValues>\n            -1.1664899587631226e+00 1.4274600148200989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1644 -4.4269999489188194e-03</internalNodes>\n          <leafValues>\n            -6.6815102100372314e-01 4.4120000675320625e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1645 -4.5743998140096664e-02</internalNodes>\n          <leafValues>\n            -4.7955200076103210e-01 1.5121999382972717e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1646 1.6698999330401421e-02</internalNodes>\n          <leafValues>\n            1.2048599869012833e-01 -4.5235899090766907e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1647 3.2210000790655613e-03</internalNodes>\n          <leafValues>\n            -7.7615000307559967e-02 2.7846598625183105e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1648 2.4434000253677368e-02</internalNodes>\n          <leafValues>\n            -1.9987100362777710e-01 6.7253702878952026e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1649 -7.9677999019622803e-02</internalNodes>\n          <leafValues>\n            9.2222398519515991e-01 9.2557996511459351e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1650 4.4530000537633896e-02</internalNodes>\n          <leafValues>\n            -2.6690500974655151e-01 3.3320501446723938e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1651 -1.2528300285339355e-01</internalNodes>\n          <leafValues>\n            -5.4253101348876953e-01 1.3976299762725830e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1652 1.7971999943256378e-02</internalNodes>\n          <leafValues>\n            1.8219999969005585e-02 -6.8048501014709473e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1653 1.9184000790119171e-02</internalNodes>\n          <leafValues>\n            -1.2583999894559383e-02 5.4126697778701782e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1654 4.0024001151323318e-02</internalNodes>\n          <leafValues>\n            -1.7638799548149109e-01 7.8810399770736694e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1655 1.3558999635279179e-02</internalNodes>\n          <leafValues>\n            2.0737600326538086e-01 -4.7744300961494446e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1656 1.6220999881625175e-02</internalNodes>\n          <leafValues>\n            2.3076999932527542e-02 -6.1182099580764771e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1657 1.1229000054299831e-02</internalNodes>\n          <leafValues>\n            -1.7728000879287720e-02 4.1764199733734131e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1658 3.9193000644445419e-02</internalNodes>\n          <leafValues>\n            -1.8948499858379364e-01 7.4019300937652588e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1659 -9.5539996400475502e-03</internalNodes>\n          <leafValues>\n            4.0947100520133972e-01 -1.3508899509906769e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1660 2.7878999710083008e-02</internalNodes>\n          <leafValues>\n            -2.0350700616836548e-01 6.1625397205352783e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1661 -2.3600999265909195e-02</internalNodes>\n          <leafValues>\n            -1.6967060565948486e+00 1.4633199572563171e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1662 2.6930000633001328e-02</internalNodes>\n          <leafValues>\n            -3.0401999130845070e-02 -1.0909470319747925e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1663 2.8999999631196260e-04</internalNodes>\n          <leafValues>\n            -2.0076000690460205e-01 2.2314099967479706e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1664 -4.1124999523162842e-02</internalNodes>\n          <leafValues>\n            -4.5242199301719666e-01 5.7392001152038574e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1665 6.6789998672902584e-03</internalNodes>\n          <leafValues>\n            2.3824900388717651e-01 -2.1262100338935852e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1666 4.7864999622106552e-02</internalNodes>\n          <leafValues>\n            -1.8194800615310669e-01 6.1918401718139648e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1667 -3.1679999083280563e-03</internalNodes>\n          <leafValues>\n            -2.7393200993537903e-01 2.5017300248146057e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1668 -8.6230002343654633e-03</internalNodes>\n          <leafValues>\n            -4.6280300617218018e-01 4.2397998273372650e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1669 -7.4350000359117985e-03</internalNodes>\n          <leafValues>\n            4.1796800494194031e-01 -1.7079999670386314e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1670 -1.8769999733194709e-03</internalNodes>\n          <leafValues>\n            1.4602300524711609e-01 -3.3721101284027100e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1671 -8.6226001381874084e-02</internalNodes>\n          <leafValues>\n            7.5143402814865112e-01 1.0711999610066414e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1672 4.6833999454975128e-02</internalNodes>\n          <leafValues>\n            -1.9119599461555481e-01 4.8414900898933411e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1673 -9.2000002041459084e-05</internalNodes>\n          <leafValues>\n            3.5220399498939514e-01 -1.7333300411701202e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1674 -1.6343999654054642e-02</internalNodes>\n          <leafValues>\n            -6.4397698640823364e-01 9.0680001303553581e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1675 4.5703999698162079e-02</internalNodes>\n          <leafValues>\n            1.8216000869870186e-02 3.1970798969268799e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1676 -2.7382999658584595e-02</internalNodes>\n          <leafValues>\n            1.0564049482345581e+00 -1.7276400327682495e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1677 -2.7602000162005424e-02</internalNodes>\n          <leafValues>\n            2.9715499281883240e-01 -9.4600003212690353e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1678 7.6939999125897884e-03</internalNodes>\n          <leafValues>\n            -2.1660299599170685e-01 4.7385200858116150e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1679 -7.0500001311302185e-04</internalNodes>\n          <leafValues>\n            2.4048799276351929e-01 -2.6776000857353210e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1680 1.1054199934005737e-01</internalNodes>\n          <leafValues>\n            -3.3539000898599625e-02 -1.0233880281448364e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1681 6.8765997886657715e-02</internalNodes>\n          <leafValues>\n            -4.3239998631179333e-03 5.7153397798538208e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1682 1.7999999690800905e-03</internalNodes>\n          <leafValues>\n            7.7574998140335083e-02 -4.2092698812484741e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1683 1.9232000410556793e-01</internalNodes>\n          <leafValues>\n            8.2021996378898621e-02 2.8810169696807861e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1684 1.5742099285125732e-01</internalNodes>\n          <leafValues>\n            -1.3708199560642242e-01 2.0890059471130371e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1685 -4.9387000501155853e-02</internalNodes>\n          <leafValues>\n            -1.8610910177230835e+00 1.4332099258899689e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1686 5.1929000765085220e-02</internalNodes>\n          <leafValues>\n            -1.8737000226974487e-01 5.4231601953506470e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1687 4.9965001642704010e-02</internalNodes>\n          <leafValues>\n            1.4175300300121307e-01 -1.5625779628753662e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1688 -4.2633000761270523e-02</internalNodes>\n          <leafValues>\n            1.6059479713439941e+00 -1.4712899923324585e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1689 -3.7553999572992325e-02</internalNodes>\n          <leafValues>\n            -8.0974900722503662e-01 1.3256999850273132e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1690 -3.7174999713897705e-02</internalNodes>\n          <leafValues>\n            -1.3945020437240601e+00 -5.7055000215768814e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1691 1.3945999555289745e-02</internalNodes>\n          <leafValues>\n            3.3427000045776367e-02 5.7474797964096069e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1692 -4.4800000614486635e-04</internalNodes>\n          <leafValues>\n            -5.5327498912811279e-01 2.1952999755740166e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1693 3.1993001699447632e-02</internalNodes>\n          <leafValues>\n            2.0340999588370323e-02 3.7459200620651245e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1694 -4.2799999937415123e-03</internalNodes>\n          <leafValues>\n            4.4428700208663940e-01 -2.2999699413776398e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1695 9.8550003021955490e-03</internalNodes>\n          <leafValues>\n            1.8315799534320831e-01 -4.0964999794960022e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1696 9.3356996774673462e-02</internalNodes>\n          <leafValues>\n            -6.3661001622676849e-02 -1.6929290294647217e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1697 1.7209999263286591e-02</internalNodes>\n          <leafValues>\n            2.0153899490833282e-01 -4.6061098575592041e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1698 8.4319999441504478e-03</internalNodes>\n          <leafValues>\n            -3.2003998756408691e-01 1.5312199294567108e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1699 -1.4054999686777592e-02</internalNodes>\n          <leafValues>\n            8.6882400512695312e-01 3.2575000077486038e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1700 -7.7180000953376293e-03</internalNodes>\n          <leafValues>\n            6.3686698675155640e-01 -1.8425500392913818e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1701 2.8005000203847885e-02</internalNodes>\n          <leafValues>\n            1.7357499897480011e-01 -4.7883599996566772e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1702 -1.8884999677538872e-02</internalNodes>\n          <leafValues>\n            2.4101600050926208e-01 -2.6547598838806152e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1703 -1.8585000187158585e-02</internalNodes>\n          <leafValues>\n            5.4232501983642578e-01 5.3633000701665878e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1704 -3.6437001079320908e-02</internalNodes>\n          <leafValues>\n            2.3908898830413818e+00 -1.3634699583053589e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1705 3.2455001026391983e-02</internalNodes>\n          <leafValues>\n            1.5910699963569641e-01 -6.7581498622894287e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1706 5.9781998395919800e-02</internalNodes>\n          <leafValues>\n            -2.3479999508708715e-03 -7.3053699731826782e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1707 9.8209995776414871e-03</internalNodes>\n          <leafValues>\n            -1.1444099992513657e-01 3.0570301413536072e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1708 -3.5163998603820801e-02</internalNodes>\n          <leafValues>\n            -1.0511469841003418e+00 -3.3103000372648239e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1709 2.7429999317973852e-03</internalNodes>\n          <leafValues>\n            -2.0135399699211121e-01 3.2754099369049072e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1710 8.1059997901320457e-03</internalNodes>\n          <leafValues>\n            -2.1383500099182129e-01 4.3362098932266235e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1711 8.8942997157573700e-02</internalNodes>\n          <leafValues>\n            1.0940899699926376e-01 -4.7609338760375977e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1712 -3.0054999515414238e-02</internalNodes>\n          <leafValues>\n            -1.7169300317764282e+00 -6.0919001698493958e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1713 -2.1734999492764473e-02</internalNodes>\n          <leafValues>\n            6.4778900146484375e-01 -3.2830998301506042e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1714 3.7648998200893402e-02</internalNodes>\n          <leafValues>\n            -1.0060000233352184e-02 -7.6569098234176636e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1715 2.7189999818801880e-03</internalNodes>\n          <leafValues>\n            1.9888900220394135e-01 -8.2479000091552734e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1716 -1.0548000223934650e-02</internalNodes>\n          <leafValues>\n            -8.6613601446151733e-01 -2.5986000895500183e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1717 1.2966300547122955e-01</internalNodes>\n          <leafValues>\n            1.3911999762058258e-01 -2.2271950244903564e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1718 -1.7676999792456627e-02</internalNodes>\n          <leafValues>\n            3.3967700600624084e-01 -2.3989599943161011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1719 -7.7051997184753418e-02</internalNodes>\n          <leafValues>\n            -2.5017969608306885e+00 1.2841999530792236e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1720 -1.9230000674724579e-02</internalNodes>\n          <leafValues>\n            5.0641202926635742e-01 -1.9751599431037903e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1721 -5.1222998648881912e-02</internalNodes>\n          <leafValues>\n            -2.9333369731903076e+00 1.3858500123023987e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1722 2.0830000285059214e-03</internalNodes>\n          <leafValues>\n            -6.0043597221374512e-01 2.9718000441789627e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1723 2.5418000295758247e-02</internalNodes>\n          <leafValues>\n            3.3915799856185913e-01 -1.4392000436782837e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1724 -2.3905999958515167e-02</internalNodes>\n          <leafValues>\n            -1.1082680225372314e+00 -4.7377001494169235e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1725 -6.3740001060068607e-03</internalNodes>\n          <leafValues>\n            4.4533699750900269e-01 -6.7052997648715973e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1726 -3.7698999047279358e-02</internalNodes>\n          <leafValues>\n            -1.0406579971313477e+00 -4.1790001094341278e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1727 2.1655100584030151e-01</internalNodes>\n          <leafValues>\n            3.3863000571727753e-02 8.2017302513122559e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1728 -1.3400999829173088e-02</internalNodes>\n          <leafValues>\n            5.2903497219085693e-01 -1.9133000075817108e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>196</maxWeakCount>\n      <stageThreshold>-3.2103500366210938e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1729 7.1268998086452484e-02</internalNodes>\n          <leafValues>\n            -5.3631198406219482e-01 6.0715299844741821e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1730 5.6111000478267670e-02</internalNodes>\n          <leafValues>\n            -5.0141602754592896e-01 4.3976101279258728e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1731 4.0463998913764954e-02</internalNodes>\n          <leafValues>\n            -3.2922199368476868e-01 5.4834699630737305e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1732 6.3155002892017365e-02</internalNodes>\n          <leafValues>\n            -3.1701698899269104e-01 4.6152999997138977e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1733 1.0320999659597874e-02</internalNodes>\n          <leafValues>\n            1.0694999992847443e-01 -9.8243898153305054e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1734 6.2606997787952423e-02</internalNodes>\n          <leafValues>\n            -1.4329700171947479e-01 7.1095001697540283e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1735 -3.9416000247001648e-02</internalNodes>\n          <leafValues>\n            9.4380199909210205e-01 -2.1572099626064301e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1736 -5.3960001096129417e-03</internalNodes>\n          <leafValues>\n            -5.4611998796463013e-01 2.5303798913955688e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1737 1.0773199796676636e-01</internalNodes>\n          <leafValues>\n            1.2496000155806541e-02 -1.0809199810028076e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1738 1.6982000321149826e-02</internalNodes>\n          <leafValues>\n            -3.1536400318145752e-01 5.1239997148513794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1739 3.1216999515891075e-02</internalNodes>\n          <leafValues>\n            -4.5199999585747719e-03 -1.2443480491638184e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1740 -2.3106999695301056e-02</internalNodes>\n          <leafValues>\n            -7.6492899656295776e-01 2.0640599727630615e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1741 -1.1203999631106853e-02</internalNodes>\n          <leafValues>\n            2.4092699587345123e-01 -3.5142099857330322e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1742 -4.7479998320341110e-03</internalNodes>\n          <leafValues>\n            -9.7007997334003448e-02 2.0638099312782288e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1743 -1.7358999699354172e-02</internalNodes>\n          <leafValues>\n            -7.9020297527313232e-01 2.1852999925613403e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1744 1.8851999193429947e-02</internalNodes>\n          <leafValues>\n            -1.0394600033760071e-01 5.4844200611114502e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1745 7.2249998338520527e-03</internalNodes>\n          <leafValues>\n            -4.0409401059150696e-01 2.6763799786567688e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1746 1.8915999680757523e-02</internalNodes>\n          <leafValues>\n            2.0508000254631042e-01 -1.0206340551376343e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1747 3.1156999990344048e-02</internalNodes>\n          <leafValues>\n            1.2400000123307109e-03 -8.7293499708175659e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1748 2.0951999351382256e-02</internalNodes>\n          <leafValues>\n            -5.5559999309480190e-03 8.0356198549270630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1749 1.1291000060737133e-02</internalNodes>\n          <leafValues>\n            -3.6478400230407715e-01 2.2767899930477142e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1750 -5.7011000812053680e-02</internalNodes>\n          <leafValues>\n            -1.4295619726181030e+00 1.4322000741958618e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1751 7.2194002568721771e-02</internalNodes>\n          <leafValues>\n            -4.1850000619888306e-02 -1.9111829996109009e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1752 -1.9874000921845436e-02</internalNodes>\n          <leafValues>\n            2.6425498723983765e-01 -3.2617700099945068e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1753 -1.6692999750375748e-02</internalNodes>\n          <leafValues>\n            -8.3907800912857056e-01 4.0799999260343611e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1754 -3.9834998548030853e-02</internalNodes>\n          <leafValues>\n            -4.8858499526977539e-01 1.6436100006103516e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1755 2.7009999379515648e-02</internalNodes>\n          <leafValues>\n            -1.8862499296665192e-01 8.3419400453567505e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1756 -3.9420002140104771e-03</internalNodes>\n          <leafValues>\n            2.3231500387191772e-01 -7.2360001504421234e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1757 2.2833000868558884e-02</internalNodes>\n          <leafValues>\n            -3.5884000360965729e-02 -1.1549400091171265e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1758 -6.8888001143932343e-02</internalNodes>\n          <leafValues>\n            -1.7837309837341309e+00 1.5159000456333160e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1759 4.3097000569105148e-02</internalNodes>\n          <leafValues>\n            -2.1608099341392517e-01 5.0624102354049683e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1760 8.6239995434880257e-03</internalNodes>\n          <leafValues>\n            -1.7795599997043610e-01 2.8957900404930115e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1761 1.4561000280082226e-02</internalNodes>\n          <leafValues>\n            -1.1408000253140926e-02 -8.9402002096176147e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1762 -1.1501000262796879e-02</internalNodes>\n          <leafValues>\n            3.0171999335289001e-01 -4.3659001588821411e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1763 -1.0971499979496002e-01</internalNodes>\n          <leafValues>\n            -9.5147097110748291e-01 -1.9973000511527061e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1764 4.5228000730276108e-02</internalNodes>\n          <leafValues>\n            3.3110998570919037e-02 9.6619802713394165e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1765 -2.7047999203205109e-02</internalNodes>\n          <leafValues>\n            9.7963601350784302e-01 -1.7261900007724762e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1766 1.8030999228358269e-02</internalNodes>\n          <leafValues>\n            -2.0801000297069550e-02 2.7385899424552917e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1767 5.0524998456239700e-02</internalNodes>\n          <leafValues>\n            -5.6802999228239059e-02 -1.7775089740753174e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1768 -2.9923999682068825e-02</internalNodes>\n          <leafValues>\n            6.5329200029373169e-01 -2.3537000641226768e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1769 3.8058001548051834e-02</internalNodes>\n          <leafValues>\n            2.6317000389099121e-02 -7.0665699243545532e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1770 1.8563899397850037e-01</internalNodes>\n          <leafValues>\n            -5.6039998307824135e-03 3.2873699069023132e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1771 -4.0670000016689301e-03</internalNodes>\n          <leafValues>\n            3.4204798936843872e-01 -3.0171599984169006e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1772 1.0108999907970428e-02</internalNodes>\n          <leafValues>\n            -7.3600001633167267e-03 5.7981598377227783e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1773 -1.1567000299692154e-02</internalNodes>\n          <leafValues>\n            -5.2722197771072388e-01 4.6447999775409698e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1774 -6.5649999305605888e-03</internalNodes>\n          <leafValues>\n            -5.8529102802276611e-01 1.9101899862289429e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1775 1.0582000017166138e-02</internalNodes>\n          <leafValues>\n            2.1073000505566597e-02 -6.8892598152160645e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1776 -2.0304000005125999e-02</internalNodes>\n          <leafValues>\n            -3.6400699615478516e-01 1.5338799357414246e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1777 2.3529999889433384e-03</internalNodes>\n          <leafValues>\n            3.6164000630378723e-02 -5.9825098514556885e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1778 -1.4690000098198652e-03</internalNodes>\n          <leafValues>\n            -1.4707699418067932e-01 3.7507998943328857e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1779 8.6449999362230301e-03</internalNodes>\n          <leafValues>\n            -2.1708500385284424e-01 5.1936799287796021e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1780 -2.4326000362634659e-02</internalNodes>\n          <leafValues>\n            -1.0846769809722900e+00 1.4084799587726593e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1781 7.4418999254703522e-02</internalNodes>\n          <leafValues>\n            -1.5513800084590912e-01 1.1822769641876221e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1782 1.7077999189496040e-02</internalNodes>\n          <leafValues>\n            4.4231001287698746e-02 9.1561102867126465e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1783 -2.4577999487519264e-02</internalNodes>\n          <leafValues>\n            -1.5504100322723389e+00 -5.4745998233556747e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1784 3.0205000191926956e-02</internalNodes>\n          <leafValues>\n            1.6662800312042236e-01 -1.0001239776611328e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1785 1.2136000208556652e-02</internalNodes>\n          <leafValues>\n            -7.7079099416732788e-01 -4.8639997839927673e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1786 8.6717002093791962e-02</internalNodes>\n          <leafValues>\n            1.1061699688434601e-01 -1.6857999563217163e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1787 -4.2309001088142395e-02</internalNodes>\n          <leafValues>\n            1.1075930595397949e+00 -1.5438599884510040e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1788 -2.6420000940561295e-03</internalNodes>\n          <leafValues>\n            2.7451899647712708e-01 -1.8456199765205383e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1789 -5.6662000715732574e-02</internalNodes>\n          <leafValues>\n            -8.0625599622726440e-01 -1.6928000375628471e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1790 2.3475000634789467e-02</internalNodes>\n          <leafValues>\n            1.4187699556350708e-01 -2.5500899553298950e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1791 -2.0803000777959824e-02</internalNodes>\n          <leafValues>\n            1.9826300442218781e-01 -3.1171199679374695e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1792 7.2599998675286770e-03</internalNodes>\n          <leafValues>\n            -5.0590999424457550e-02 4.1923800110816956e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1793 3.4160000085830688e-01</internalNodes>\n          <leafValues>\n            -1.6674900054931641e-01 9.2748600244522095e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1794 6.2029999680817127e-03</internalNodes>\n          <leafValues>\n            -1.2625899910926819e-01 4.0445300936698914e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1795 3.2692000269889832e-02</internalNodes>\n          <leafValues>\n            -3.2634999603033066e-02 -9.8939800262451172e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1796 2.1100000594742596e-04</internalNodes>\n          <leafValues>\n            -6.4534001052379608e-02 2.5473698973655701e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1797 7.2100001852959394e-04</internalNodes>\n          <leafValues>\n            -3.6618599295616150e-01 1.1973100155591965e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1798 5.4490998387336731e-02</internalNodes>\n          <leafValues>\n            1.2073499709367752e-01 -1.0291390419006348e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1799 -1.0141000151634216e-02</internalNodes>\n          <leafValues>\n            -5.2177202701568604e-01 3.3734999597072601e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1800 -1.8815999850630760e-02</internalNodes>\n          <leafValues>\n            6.5181797742843628e-01 1.3399999588727951e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1801 -5.3480002097785473e-03</internalNodes>\n          <leafValues>\n            1.7370699346065521e-01 -3.4132000803947449e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1802 -1.0847000405192375e-02</internalNodes>\n          <leafValues>\n            -1.9699899852275848e-01 1.5045499801635742e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1803 -4.9926001578569412e-02</internalNodes>\n          <leafValues>\n            -5.0888502597808838e-01 3.0762000009417534e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1804 1.2160000391304493e-02</internalNodes>\n          <leafValues>\n            -6.9251999258995056e-02 1.8745499849319458e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1805 -2.2189998999238014e-03</internalNodes>\n          <leafValues>\n            -4.0849098563194275e-01 7.9954996705055237e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1806 3.1580000650137663e-03</internalNodes>\n          <leafValues>\n            -2.1124599874019623e-01 2.2366400063037872e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1807 4.1439998894929886e-03</internalNodes>\n          <leafValues>\n            -4.9900299310684204e-01 6.2917001545429230e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1808 -7.3730000294744968e-03</internalNodes>\n          <leafValues>\n            -2.0553299784660339e-01 2.2096699476242065e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1809 5.1812000572681427e-02</internalNodes>\n          <leafValues>\n            1.8096800148487091e-01 -4.3495801091194153e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1810 1.8340000882744789e-02</internalNodes>\n          <leafValues>\n            1.5200000256299973e-02 3.7991699576377869e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1811 1.7490799725055695e-01</internalNodes>\n          <leafValues>\n            -2.0920799672603607e-01 4.0013000369071960e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1812 5.3993999958038330e-02</internalNodes>\n          <leafValues>\n            2.4751600623130798e-01 -2.6712900400161743e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1813 -3.2033199071884155e-01</internalNodes>\n          <leafValues>\n            -1.9094380140304565e+00 -6.6960997879505157e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1814 -2.7060000225901604e-02</internalNodes>\n          <leafValues>\n            -7.1371299028396606e-01 1.5904599428176880e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1815 7.7463999390602112e-02</internalNodes>\n          <leafValues>\n            -1.6970199346542358e-01 7.7552998065948486e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1816 2.3771999403834343e-02</internalNodes>\n          <leafValues>\n            1.9021899998188019e-01 -6.0162097215652466e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1817 1.1501000262796879e-02</internalNodes>\n          <leafValues>\n            7.7039999887347221e-03 -6.1730301380157471e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1818 3.2616000622510910e-02</internalNodes>\n          <leafValues>\n            1.7159199714660645e-01 -7.0978200435638428e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1819 -4.4383000582456589e-02</internalNodes>\n          <leafValues>\n            -2.2606229782104492e+00 -7.3276996612548828e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1820 -5.8476001024246216e-02</internalNodes>\n          <leafValues>\n            2.4087750911712646e+00 8.3091996610164642e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1821 1.9303999841213226e-02</internalNodes>\n          <leafValues>\n            -2.7082300186157227e-01 2.7369999885559082e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1822 -4.4705998152494431e-02</internalNodes>\n          <leafValues>\n            3.1355598568916321e-01 -6.2492001801729202e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1823 -6.0334999114274979e-02</internalNodes>\n          <leafValues>\n            -1.4515119791030884e+00 -5.8761000633239746e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1824 1.1667000129818916e-02</internalNodes>\n          <leafValues>\n            -1.8084999173879623e-02 5.0479698181152344e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1825 2.8009999543428421e-02</internalNodes>\n          <leafValues>\n            -2.3302899301052094e-01 3.0708700418472290e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1826 6.5397001802921295e-02</internalNodes>\n          <leafValues>\n            1.4135900139808655e-01 -5.0010901689529419e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1827 9.6239997074007988e-03</internalNodes>\n          <leafValues>\n            -2.2054600715637207e-01 3.9191201329231262e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1828 2.5510000996291637e-03</internalNodes>\n          <leafValues>\n            -1.1381500214338303e-01 2.0032300055027008e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1829 3.1847000122070312e-02</internalNodes>\n          <leafValues>\n            2.5476999580860138e-02 -5.3326398134231567e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1830 3.3055000007152557e-02</internalNodes>\n          <leafValues>\n            1.7807699739933014e-01 -6.2793898582458496e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1831 4.7600999474525452e-02</internalNodes>\n          <leafValues>\n            -1.4747899770736694e-01 1.4204180240631104e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1832 -1.9571999087929726e-02</internalNodes>\n          <leafValues>\n            -5.2693498134613037e-01 1.5838600695133209e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1833 -5.4730001837015152e-02</internalNodes>\n          <leafValues>\n            8.8231599330902100e-01 -1.6627800464630127e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1834 -2.2686000913381577e-02</internalNodes>\n          <leafValues>\n            -4.8386898636817932e-01 1.5000100433826447e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1835 1.0713200271129608e-01</internalNodes>\n          <leafValues>\n            -2.1336199343204498e-01 4.2333900928497314e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1836 -3.6380000412464142e-02</internalNodes>\n          <leafValues>\n            -7.4198000133037567e-02 1.4589400589466095e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1837 1.3935999944806099e-02</internalNodes>\n          <leafValues>\n            -2.4911600351333618e-01 2.6771199703216553e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1838 2.0991999655961990e-02</internalNodes>\n          <leafValues>\n            8.7959999218583107e-03 4.3064999580383301e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1839 4.9118999391794205e-02</internalNodes>\n          <leafValues>\n            -1.7591999471187592e-01 6.9282901287078857e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1840 3.6315999925136566e-02</internalNodes>\n          <leafValues>\n            1.3145299255847931e-01 -3.3597299456596375e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1841 4.1228000074625015e-02</internalNodes>\n          <leafValues>\n            -4.5692000538110733e-02 -1.3515930175781250e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1842 1.5672000125050545e-02</internalNodes>\n          <leafValues>\n            1.7544099688529968e-01 -6.0550000518560410e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1843 -1.6286000609397888e-02</internalNodes>\n          <leafValues>\n            -1.1308189630508423e+00 -3.9533000439405441e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1844 -3.0229999683797359e-03</internalNodes>\n          <leafValues>\n            -2.2454300522804260e-01 2.3628099262714386e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1845 -1.3786299526691437e-01</internalNodes>\n          <leafValues>\n            4.5376899838447571e-01 -2.1098700165748596e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1846 -9.6760001033544540e-03</internalNodes>\n          <leafValues>\n            -1.5105099976062775e-01 2.0781700313091278e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1847 -2.4839999154210091e-02</internalNodes>\n          <leafValues>\n            -6.8350297212600708e-01 -8.0040004104375839e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1848 -1.3964399695396423e-01</internalNodes>\n          <leafValues>\n            6.5011298656463623e-01 4.6544000506401062e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1849 -8.2153998315334320e-02</internalNodes>\n          <leafValues>\n            4.4887199997901917e-01 -2.3591999709606171e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1850 3.8449999410659075e-03</internalNodes>\n          <leafValues>\n            -8.8173002004623413e-02 2.7346798777580261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1851 -6.6579999402165413e-03</internalNodes>\n          <leafValues>\n            -4.6866598725318909e-01 7.7001996338367462e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1852 -1.5898000448942184e-02</internalNodes>\n          <leafValues>\n            2.9268398880958557e-01 -2.1941000595688820e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1853 -5.0946000963449478e-02</internalNodes>\n          <leafValues>\n            -1.2093789577484131e+00 -4.2109999805688858e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1854 1.6837999224662781e-02</internalNodes>\n          <leafValues>\n            -4.5595999807119370e-02 5.0180697441101074e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1855 1.5918999910354614e-02</internalNodes>\n          <leafValues>\n            -2.6904299855232239e-01 2.6516300439834595e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1856 3.6309999413788319e-03</internalNodes>\n          <leafValues>\n            -1.3046100735664368e-01 3.1807100772857666e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1857 -8.6144998669624329e-02</internalNodes>\n          <leafValues>\n            1.9443659782409668e+00 -1.3978299498558044e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1858 3.3140998333692551e-02</internalNodes>\n          <leafValues>\n            1.5266799926757812e-01 -3.0866000801324844e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1859 -3.9679999463260174e-03</internalNodes>\n          <leafValues>\n            -7.1202301979064941e-01 -1.3844000175595284e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1860 -2.4008000269532204e-02</internalNodes>\n          <leafValues>\n            9.2007797956466675e-01 4.6723999083042145e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1861 8.7320003658533096e-03</internalNodes>\n          <leafValues>\n            -2.2567300498485565e-01 3.1931799650192261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1862 -2.7786999940872192e-02</internalNodes>\n          <leafValues>\n            -7.2337102890014648e-01 1.7018599808216095e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1863 -1.9455300271511078e-01</internalNodes>\n          <leafValues>\n            1.2461860179901123e+00 -1.4736199378967285e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1864 -1.0869699716567993e-01</internalNodes>\n          <leafValues>\n            -1.4465179443359375e+00 1.2145300209522247e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1865 -1.9494999200105667e-02</internalNodes>\n          <leafValues>\n            -7.8153097629547119e-01 -2.3732999339699745e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1866 3.0650000553578138e-03</internalNodes>\n          <leafValues>\n            -8.5471397638320923e-01 1.6686999797821045e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1867 5.9193998575210571e-02</internalNodes>\n          <leafValues>\n            -1.4853699505329132e-01 1.1273469924926758e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1868 -5.4207999259233475e-02</internalNodes>\n          <leafValues>\n            5.4726999998092651e-01 3.5523999482393265e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1869 -3.9324998855590820e-02</internalNodes>\n          <leafValues>\n            3.6642599105834961e-01 -2.0543999969959259e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1870 8.2278996706008911e-02</internalNodes>\n          <leafValues>\n            -3.5007998347282410e-02 5.3994202613830566e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1871 -7.4479999020695686e-03</internalNodes>\n          <leafValues>\n            -6.1537498235702515e-01 -3.5319998860359192e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1872 7.3770000599324703e-03</internalNodes>\n          <leafValues>\n            -6.5591000020503998e-02 4.1961398720741272e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1873 7.0779998786747456e-03</internalNodes>\n          <leafValues>\n            -3.4129500389099121e-01 1.2536799907684326e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1874 -1.5581999905407429e-02</internalNodes>\n          <leafValues>\n            -3.0240398645401001e-01 2.1511000394821167e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1875 -2.7399999089539051e-03</internalNodes>\n          <leafValues>\n            7.6553001999855042e-02 -4.1060501337051392e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1876 -7.0600003004074097e-02</internalNodes>\n          <leafValues>\n            -9.7356200218200684e-01 1.1241800338029861e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1877 -1.1706000193953514e-02</internalNodes>\n          <leafValues>\n            1.8560700118541718e-01 -2.9755198955535889e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1878 7.1499997284263372e-04</internalNodes>\n          <leafValues>\n            -5.9650000184774399e-02 2.4824699759483337e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1879 -3.6866001784801483e-02</internalNodes>\n          <leafValues>\n            3.2751700282096863e-01 -2.3059600591659546e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1880 -3.2526999711990356e-02</internalNodes>\n          <leafValues>\n            -2.9320299625396729e-01 1.5427699685096741e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1881 -7.4813999235630035e-02</internalNodes>\n          <leafValues>\n            -1.2143570184707642e+00 -5.2244000136852264e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1882 4.1469998657703400e-02</internalNodes>\n          <leafValues>\n            1.3062499463558197e-01 -2.3274369239807129e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1883 -2.8880000114440918e-02</internalNodes>\n          <leafValues>\n            -6.6074597835540771e-01 -9.0960003435611725e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1884 4.6381998807191849e-02</internalNodes>\n          <leafValues>\n            1.6630199551582336e-01 -6.6949498653411865e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1885 2.5424998998641968e-01</internalNodes>\n          <leafValues>\n            -5.4641999304294586e-02 -1.2676080465316772e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1886 2.4000001139938831e-03</internalNodes>\n          <leafValues>\n            2.0276799798011780e-01 1.4667999930679798e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1887 -8.2805998623371124e-02</internalNodes>\n          <leafValues>\n            -7.8713601827621460e-01 -2.4468999356031418e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1888 -1.1438000015914440e-02</internalNodes>\n          <leafValues>\n            2.8623399138450623e-01 -3.0894000083208084e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1889 -1.2913399934768677e-01</internalNodes>\n          <leafValues>\n            1.7292929887771606e+00 -1.4293900132179260e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1890 3.8552999496459961e-02</internalNodes>\n          <leafValues>\n            1.9232999533414841e-02 3.7732601165771484e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1891 1.0191400349140167e-01</internalNodes>\n          <leafValues>\n            -7.4533998966217041e-02 -3.3868899345397949e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1892 -1.9068000838160515e-02</internalNodes>\n          <leafValues>\n            3.1814101338386536e-01 1.9261000677943230e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1893 -6.0775000602006912e-02</internalNodes>\n          <leafValues>\n            7.6936298608779907e-01 -1.7644000053405762e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1894 2.4679999798536301e-02</internalNodes>\n          <leafValues>\n            1.8396499752998352e-01 -3.0868801474571228e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1895 2.6759000495076180e-02</internalNodes>\n          <leafValues>\n            -2.3454900085926056e-01 3.3056598901748657e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1896 1.4969999901950359e-02</internalNodes>\n          <leafValues>\n            1.7213599383831024e-01 -1.8248899281024933e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1897 2.6142999529838562e-02</internalNodes>\n          <leafValues>\n            -4.6463999897241592e-02 -1.1318379640579224e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1898 -3.7512000650167465e-02</internalNodes>\n          <leafValues>\n            8.0404001474380493e-01 6.9660000503063202e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1899 -5.3229997865855694e-03</internalNodes>\n          <leafValues>\n            -8.1884402036666870e-01 -1.8224999308586121e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1900 1.7813000828027725e-02</internalNodes>\n          <leafValues>\n            1.4957800507545471e-01 -1.8667200207710266e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1901 -3.4010000526905060e-02</internalNodes>\n          <leafValues>\n            -7.2852301597595215e-01 -1.6615999862551689e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1902 -1.5953000634908676e-02</internalNodes>\n          <leafValues>\n            5.6944000720977783e-01 1.3832000084221363e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1903 1.9743999466300011e-02</internalNodes>\n          <leafValues>\n            4.0525000542402267e-02 -4.1773399710655212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1904 -1.0374800115823746e-01</internalNodes>\n          <leafValues>\n            -1.9825149774551392e+00 1.1960200220346451e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1905 -1.9285000860691071e-02</internalNodes>\n          <leafValues>\n            5.0230598449707031e-01 -1.9745899736881256e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1906 -1.2780000455677509e-02</internalNodes>\n          <leafValues>\n            4.0195000171661377e-01 -2.6957999914884567e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1907 -1.6352999955415726e-02</internalNodes>\n          <leafValues>\n            -7.6608800888061523e-01 -2.4209000170230865e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1908 -1.2763699889183044e-01</internalNodes>\n          <leafValues>\n            8.6578500270843506e-01 6.4205996692180634e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1909 1.9068999215960503e-02</internalNodes>\n          <leafValues>\n            -5.5929797887802124e-01 -1.6880000475794077e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1910 3.2480999827384949e-02</internalNodes>\n          <leafValues>\n            4.0722001343965530e-02 4.8925098776817322e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1911 9.4849998131394386e-03</internalNodes>\n          <leafValues>\n            -1.9231900572776794e-01 5.1139700412750244e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1912 5.0470000132918358e-03</internalNodes>\n          <leafValues>\n            1.8706800043582916e-01 -1.6113600134849548e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1913 4.1267998516559601e-02</internalNodes>\n          <leafValues>\n            -4.8817999660968781e-02 -1.1326299905776978e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1914 -7.6358996331691742e-02</internalNodes>\n          <leafValues>\n            1.4169390201568604e+00 8.7319999933242798e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1915 -7.2834998369216919e-02</internalNodes>\n          <leafValues>\n            1.3189860582351685e+00 -1.4819100499153137e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1916 5.9576999396085739e-02</internalNodes>\n          <leafValues>\n            4.8376999795436859e-02 8.5611802339553833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1917 2.0263999700546265e-02</internalNodes>\n          <leafValues>\n            -2.1044099330902100e-01 3.3858999609947205e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1918 -8.0301001667976379e-02</internalNodes>\n          <leafValues>\n            -1.2464400529861450e+00 1.1857099831104279e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1919 -1.7835000529885292e-02</internalNodes>\n          <leafValues>\n            2.5782299041748047e-01 -2.4564799666404724e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1920 1.1431000195443630e-02</internalNodes>\n          <leafValues>\n            2.2949799895286560e-01 -2.9497599601745605e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1921 -2.5541000068187714e-02</internalNodes>\n          <leafValues>\n            -8.6252999305725098e-01 -7.0400000549852848e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1922 -7.6899997657164931e-04</internalNodes>\n          <leafValues>\n            3.1511399149894714e-01 -1.4349000155925751e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1923 -1.4453999698162079e-02</internalNodes>\n          <leafValues>\n            2.5148499011993408e-01 -2.8232899308204651e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1924 8.6730001494288445e-03</internalNodes>\n          <leafValues>\n            2.6601400971412659e-01 -2.8190800547599792e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>197</maxWeakCount>\n      <stageThreshold>-3.2772979736328125e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 1925 5.4708998650312424e-02</internalNodes>\n          <leafValues>\n            -5.4144299030303955e-01 6.1043000221252441e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1926 -1.0838799923658371e-01</internalNodes>\n          <leafValues>\n            7.1739900112152100e-01 -4.1196098923683167e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1927 2.2996999323368073e-02</internalNodes>\n          <leafValues>\n            -5.8269798755645752e-01 2.9645600914955139e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1928 2.7540000155568123e-03</internalNodes>\n          <leafValues>\n            -7.4243897199630737e-01 1.4183300733566284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1929 -2.1520000882446766e-03</internalNodes>\n          <leafValues>\n            1.7879900336265564e-01 -6.8548601865768433e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1930 -2.2559000179171562e-02</internalNodes>\n          <leafValues>\n            -1.0775549411773682e+00 1.2388999760150909e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1931 8.3025000989437103e-02</internalNodes>\n          <leafValues>\n            2.4500999599695206e-02 -1.0251879692077637e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1932 -6.6740000620484352e-03</internalNodes>\n          <leafValues>\n            -4.5283100008964539e-01 2.1230199933052063e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1933 7.6485000550746918e-02</internalNodes>\n          <leafValues>\n            -2.6972699165344238e-01 4.8580199480056763e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1934 5.4910001344978809e-03</internalNodes>\n          <leafValues>\n            -4.8871201276779175e-01 3.1616398692131042e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1935 -1.0414999909698963e-02</internalNodes>\n          <leafValues>\n            4.1512900590896606e-01 -3.0044800043106079e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1936 2.7607999742031097e-02</internalNodes>\n          <leafValues>\n            1.6203799843788147e-01 -9.9868500232696533e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1937 -2.3272000253200531e-02</internalNodes>\n          <leafValues>\n            -1.1024399995803833e+00 2.1124999970197678e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1938 -5.5619999766349792e-02</internalNodes>\n          <leafValues>\n            6.5033102035522461e-01 -2.7938000857830048e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1939 -4.0631998330354691e-02</internalNodes>\n          <leafValues>\n            4.2117300629615784e-01 -2.6763799786567688e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1940 -7.3560001328587532e-03</internalNodes>\n          <leafValues>\n            3.5277798771858215e-01 -3.7854000926017761e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1941 1.7007000744342804e-02</internalNodes>\n          <leafValues>\n            -2.9189500212669373e-01 4.1053798794746399e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1942 -3.7034001201391220e-02</internalNodes>\n          <leafValues>\n            -1.3216309547424316e+00 1.2966500222682953e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1943 -1.9633000716567039e-02</internalNodes>\n          <leafValues>\n            -8.7702298164367676e-01 1.0799999581649899e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1944 -2.3546999320387840e-02</internalNodes>\n          <leafValues>\n            2.6106101274490356e-01 -2.1481400728225708e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1945 -4.3352998793125153e-02</internalNodes>\n          <leafValues>\n            -9.9089699983596802e-01 -9.9560003727674484e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1946 -2.2183999419212341e-02</internalNodes>\n          <leafValues>\n            6.3454401493072510e-01 -5.6547001004219055e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1947 1.6530999913811684e-02</internalNodes>\n          <leafValues>\n            2.4664999917149544e-02 -7.3326802253723145e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1948 -3.2744001597166061e-02</internalNodes>\n          <leafValues>\n            -5.6297200918197632e-01 1.6640299558639526e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1949 7.1415998041629791e-02</internalNodes>\n          <leafValues>\n            -3.0000001424923539e-04 -9.3286401033401489e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1950 8.0999999772757292e-04</internalNodes>\n          <leafValues>\n            -9.5380000770092010e-02 2.5184699892997742e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1951 -8.4090000018477440e-03</internalNodes>\n          <leafValues>\n            -6.5496802330017090e-01 6.7300997674465179e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1952 -1.7254000529646873e-02</internalNodes>\n          <leafValues>\n            -4.6492999792098999e-01 1.6070899367332458e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1953 -1.8641000613570213e-02</internalNodes>\n          <leafValues>\n            -1.0594010353088379e+00 -1.9617000594735146e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1954 -9.1979997232556343e-03</internalNodes>\n          <leafValues>\n            5.0716197490692139e-01 -1.5339200198650360e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1955 1.8538000062108040e-02</internalNodes>\n          <leafValues>\n            -3.0498200654983521e-01 7.3506200313568115e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1956 -5.0335001200437546e-02</internalNodes>\n          <leafValues>\n            -1.1140480041503906e+00 1.8000100553035736e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1957 -2.3529000580310822e-02</internalNodes>\n          <leafValues>\n            -8.6907899379730225e-01 -1.2459999881684780e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1958 -2.7100000530481339e-02</internalNodes>\n          <leafValues>\n            6.5942901372909546e-01 -3.5323999822139740e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1959 6.5879998728632927e-03</internalNodes>\n          <leafValues>\n            -2.2953400015830994e-01 4.2425099015235901e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1960 2.3360000923275948e-02</internalNodes>\n          <leafValues>\n            1.8356199562549591e-01 -9.8587298393249512e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1961 1.2946999631822109e-02</internalNodes>\n          <leafValues>\n            -3.3147400617599487e-01 2.1323199570178986e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1962 -6.6559999249875546e-03</internalNodes>\n          <leafValues>\n            -1.1951400339603424e-01 2.9752799868583679e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1963 -2.2570999339222908e-02</internalNodes>\n          <leafValues>\n            3.8499400019645691e-01 -2.4434499442577362e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1964 -6.3813999295234680e-02</internalNodes>\n          <leafValues>\n            -8.9383500814437866e-01 1.4217500388622284e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1965 -4.9945000559091568e-02</internalNodes>\n          <leafValues>\n            5.3864401578903198e-01 -2.0485299825668335e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1966 6.8319998681545258e-03</internalNodes>\n          <leafValues>\n            -5.6678999215364456e-02 3.9970999956130981e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1967 -5.5835999548435211e-02</internalNodes>\n          <leafValues>\n            -1.5239470005035400e+00 -5.1183000206947327e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1968 3.1957000494003296e-01</internalNodes>\n          <leafValues>\n            7.4574001133441925e-02 1.2447799444198608e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1969 8.0955997109413147e-02</internalNodes>\n          <leafValues>\n            -1.9665500521659851e-01 5.9889698028564453e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1970 -1.4911999925971031e-02</internalNodes>\n          <leafValues>\n            -6.4020597934722900e-01 1.5807600319385529e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1971 4.6709001064300537e-02</internalNodes>\n          <leafValues>\n            8.5239000618457794e-02 -4.5487201213836670e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1972 6.0539999976754189e-03</internalNodes>\n          <leafValues>\n            -4.3184000253677368e-01 2.2452600300312042e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1973 -3.4375999122858047e-02</internalNodes>\n          <leafValues>\n            4.0202501416206360e-01 -2.3903599381446838e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1974 -3.4924000501632690e-02</internalNodes>\n          <leafValues>\n            5.2870100736618042e-01 3.9709001779556274e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1975 3.0030000489205122e-03</internalNodes>\n          <leafValues>\n            -3.8754299283027649e-01 1.4192600548267365e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1976 -1.4132999815046787e-02</internalNodes>\n          <leafValues>\n            8.7528401613235474e-01 8.5507996380329132e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1977 -6.7940000444650650e-03</internalNodes>\n          <leafValues>\n            -1.1649219989776611e+00 -3.3943001180887222e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1978 -5.2886001765727997e-02</internalNodes>\n          <leafValues>\n            1.0930680036544800e+00 5.1187001168727875e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1979 -2.1079999860376120e-03</internalNodes>\n          <leafValues>\n            1.3696199655532837e-01 -3.3849999308586121e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1980 1.8353000283241272e-02</internalNodes>\n          <leafValues>\n            1.3661600649356842e-01 -4.0777799487113953e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1981 1.2671999633312225e-02</internalNodes>\n          <leafValues>\n            -1.4936000108718872e-02 -8.1707501411437988e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1982 1.2924999929964542e-02</internalNodes>\n          <leafValues>\n            1.7625099420547485e-01 -3.2491698861122131e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1983 -1.7921000719070435e-02</internalNodes>\n          <leafValues>\n            -5.2745401859283447e-01 4.4443000108003616e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1984 1.9160000374540687e-03</internalNodes>\n          <leafValues>\n            -1.0978599637746811e-01 2.2067500650882721e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1985 -1.4697999693453312e-02</internalNodes>\n          <leafValues>\n            3.9067798852920532e-01 -2.2224999964237213e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1986 -1.4972999691963196e-02</internalNodes>\n          <leafValues>\n            -2.5450900197029114e-01 1.7790000140666962e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1987 1.4636999927461147e-02</internalNodes>\n          <leafValues>\n            -2.5125000625848770e-02 -8.7121301889419556e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1988 -1.0974000208079815e-02</internalNodes>\n          <leafValues>\n            7.9082798957824707e-01 2.0121000707149506e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1989 -9.1599998995661736e-03</internalNodes>\n          <leafValues>\n            -4.7906899452209473e-01 5.2232000976800919e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1990 4.6179997734725475e-03</internalNodes>\n          <leafValues>\n            -1.7244599759578705e-01 3.4527799487113953e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1991 2.3476999253034592e-02</internalNodes>\n          <leafValues>\n            3.7760001141577959e-03 -6.5333700180053711e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1992 3.1766999512910843e-02</internalNodes>\n          <leafValues>\n            1.6364000737667084e-02 5.8723700046539307e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1993 -1.8419999629259109e-02</internalNodes>\n          <leafValues>\n            1.9993899762630463e-01 -3.2056498527526855e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1994 1.9543999806046486e-02</internalNodes>\n          <leafValues>\n            1.8450200557708740e-01 -2.3793600499629974e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1995 4.1159498691558838e-01</internalNodes>\n          <leafValues>\n            -6.0382001101970673e-02 -1.6072119474411011e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1996 -4.1595999151468277e-02</internalNodes>\n          <leafValues>\n            -3.2756200432777405e-01 1.5058000385761261e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1997 -1.0335999540984631e-02</internalNodes>\n          <leafValues>\n            -6.2394398450851440e-01 1.3112000189721584e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1998 1.2392999604344368e-02</internalNodes>\n          <leafValues>\n            -3.3114999532699585e-02 5.5579900741577148e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 1999 -8.7270000949501991e-03</internalNodes>\n          <leafValues>\n            1.9883200526237488e-01 -3.7635600566864014e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2000 1.6295000910758972e-02</internalNodes>\n          <leafValues>\n            2.0373000204563141e-01 -4.2800799012184143e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2001 -1.0483999736607075e-02</internalNodes>\n          <leafValues>\n            -5.6847000122070312e-01 4.4199001044034958e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2002 -1.2431999668478966e-02</internalNodes>\n          <leafValues>\n            7.4641901254653931e-01 4.3678998947143555e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2003 -5.0374999642372131e-02</internalNodes>\n          <leafValues>\n            8.5090100765228271e-01 -1.7773799598217010e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2004 4.9548000097274780e-02</internalNodes>\n          <leafValues>\n            1.6784900426864624e-01 -2.9877498745918274e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2005 -4.1085001081228256e-02</internalNodes>\n          <leafValues>\n            -1.3302919864654541e+00 -4.9182001501321793e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2006 1.0069999843835831e-03</internalNodes>\n          <leafValues>\n            -6.0538999736309052e-02 1.8483200669288635e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2007 -5.0142999738454819e-02</internalNodes>\n          <leafValues>\n            7.6447701454162598e-01 -1.8356999754905701e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2008 -8.7879998609423637e-03</internalNodes>\n          <leafValues>\n            2.2655999660491943e-01 -6.3156999647617340e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2009 -5.0170999020338058e-02</internalNodes>\n          <leafValues>\n            -1.5899070501327515e+00 -6.1255000531673431e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2010 1.0216099768877029e-01</internalNodes>\n          <leafValues>\n            1.2071800231933594e-01 -1.4120110273361206e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2011 -1.4372999779880047e-02</internalNodes>\n          <leafValues>\n            -1.3116970062255859e+00 -5.1936000585556030e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2012 1.0281999595463276e-02</internalNodes>\n          <leafValues>\n            -2.1639999467879534e-03 4.4247201085090637e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2013 -1.1814000084996223e-02</internalNodes>\n          <leafValues>\n            6.5378099679946899e-01 -1.8723699450492859e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2014 7.2114996612071991e-02</internalNodes>\n          <leafValues>\n            7.1846999228000641e-02 8.1496298313140869e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2015 -1.9001999869942665e-02</internalNodes>\n          <leafValues>\n            -6.7427200078964233e-01 -4.3200000072829425e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2016 -4.6990001574158669e-03</internalNodes>\n          <leafValues>\n            3.3311501145362854e-01 5.5794000625610352e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2017 -5.8157000690698624e-02</internalNodes>\n          <leafValues>\n            4.5572298765182495e-01 -2.0305100083351135e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2018 1.1360000353306532e-03</internalNodes>\n          <leafValues>\n            -4.4686999171972275e-02 2.2681899368762970e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2019 -4.9414999783039093e-02</internalNodes>\n          <leafValues>\n            2.6694598793983459e-01 -2.6116999983787537e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2020 -1.1913800239562988e-01</internalNodes>\n          <leafValues>\n            -8.3017998933792114e-01 1.3248500227928162e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2021 -1.8303999677300453e-02</internalNodes>\n          <leafValues>\n            -6.7499202489852905e-01 1.7092000693082809e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2022 -7.9199997708201408e-03</internalNodes>\n          <leafValues>\n            -7.2287000715732574e-02 1.4425800740718842e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2023 5.1925998181104660e-02</internalNodes>\n          <leafValues>\n            3.0921999365091324e-02 -5.5860602855682373e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2024 6.6724002361297607e-02</internalNodes>\n          <leafValues>\n            1.3666400313377380e-01 -2.9411000013351440e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2025 -1.3778000138700008e-02</internalNodes>\n          <leafValues>\n            -5.9443902969360352e-01 1.5300000086426735e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2026 -1.7760999500751495e-02</internalNodes>\n          <leafValues>\n            4.0496501326560974e-01 -3.3559999428689480e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2027 -4.2234998196363449e-02</internalNodes>\n          <leafValues>\n            -1.0897940397262573e+00 -4.0224999189376831e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2028 -1.3524999842047691e-02</internalNodes>\n          <leafValues>\n            2.8921899199485779e-01 -2.5194799900054932e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2029 -1.1106000281870365e-02</internalNodes>\n          <leafValues>\n            6.5312802791595459e-01 -1.8053700029850006e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2030 -1.2284599989652634e-01</internalNodes>\n          <leafValues>\n            -1.9570649862289429e+00 1.4815400540828705e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2031 4.7715999186038971e-02</internalNodes>\n          <leafValues>\n            -2.2875599563121796e-01 3.4233701229095459e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2032 3.1817000359296799e-02</internalNodes>\n          <leafValues>\n            1.5976299345493317e-01 -1.0091969966888428e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2033 4.2570000514388084e-03</internalNodes>\n          <leafValues>\n            -3.8881298899650574e-01 8.4210000932216644e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2034 -6.1372999101877213e-02</internalNodes>\n          <leafValues>\n            1.7152810096740723e+00 5.9324998408555984e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2035 -2.7030000928789377e-03</internalNodes>\n          <leafValues>\n            -3.8161700963973999e-01 8.5127003490924835e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2036 -6.8544000387191772e-02</internalNodes>\n          <leafValues>\n            -3.0925889015197754e+00 1.1788000166416168e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2037 1.0372500121593475e-01</internalNodes>\n          <leafValues>\n            -1.3769300282001495e-01 1.9009410142898560e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2038 1.5799000859260559e-02</internalNodes>\n          <leafValues>\n            -6.2660001218318939e-02 2.5917699933052063e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2039 -9.8040001466870308e-03</internalNodes>\n          <leafValues>\n            -5.6291598081588745e-01 4.3923001736402512e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2040 -9.0229995548725128e-03</internalNodes>\n          <leafValues>\n            2.5287100672721863e-01 -4.1225999593734741e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2041 -6.3754998147487640e-02</internalNodes>\n          <leafValues>\n            -2.6178569793701172e+00 -7.4005998671054840e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2042 3.8954999297857285e-02</internalNodes>\n          <leafValues>\n            5.9032998979091644e-02 8.5945600271224976e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2043 -3.9802998304367065e-02</internalNodes>\n          <leafValues>\n            9.3600499629974365e-01 -1.5639400482177734e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2044 5.0301998853683472e-02</internalNodes>\n          <leafValues>\n            1.3725900650024414e-01 -2.5549728870391846e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2045 4.6250000596046448e-02</internalNodes>\n          <leafValues>\n            -1.3964000158011913e-02 -7.1026200056076050e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2046 6.2196001410484314e-02</internalNodes>\n          <leafValues>\n            5.9526000171899796e-02 1.6509100198745728e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2047 -6.4776003360748291e-02</internalNodes>\n          <leafValues>\n            7.1368998289108276e-01 -1.7270000278949738e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2048 2.7522999793291092e-02</internalNodes>\n          <leafValues>\n            1.4631600677967072e-01 -8.1428997218608856e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2049 3.9900001138448715e-04</internalNodes>\n          <leafValues>\n            -3.7144500017166138e-01 1.0152699798345566e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2050 -4.3299999088048935e-03</internalNodes>\n          <leafValues>\n            -2.3756299912929535e-01 2.6798400282859802e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2051 4.7297000885009766e-02</internalNodes>\n          <leafValues>\n            -2.7682000771164894e-02 -8.4910297393798828e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2052 1.2508999556303024e-02</internalNodes>\n          <leafValues>\n            1.8730199337005615e-01 -5.6001102924346924e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2053 4.5899000018835068e-02</internalNodes>\n          <leafValues>\n            -1.5601199865341187e-01 9.7073000669479370e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2054 1.9853399693965912e-01</internalNodes>\n          <leafValues>\n            1.4895500242710114e-01 -1.1015529632568359e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2055 1.6674999147653580e-02</internalNodes>\n          <leafValues>\n            -1.6615299880504608e-01 8.2210999727249146e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2056 1.9829999655485153e-03</internalNodes>\n          <leafValues>\n            -7.1249999105930328e-02 2.8810900449752808e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2057 2.2447999566793442e-02</internalNodes>\n          <leafValues>\n            -2.0981000736355782e-02 -7.8416502475738525e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2058 -1.3913000002503395e-02</internalNodes>\n          <leafValues>\n            -1.8165799975395203e-01 2.0491799712181091e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2059 -7.7659999951720238e-03</internalNodes>\n          <leafValues>\n            -4.5595899224281311e-01 6.3576996326446533e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2060 -1.3209000229835510e-02</internalNodes>\n          <leafValues>\n            2.6632300019264221e-01 -1.7795999348163605e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2061 4.9052998423576355e-02</internalNodes>\n          <leafValues>\n            -1.5476800501346588e-01 1.1069979667663574e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2062 2.0263999700546265e-02</internalNodes>\n          <leafValues>\n            6.8915002048015594e-02 6.9867497682571411e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2063 -1.6828000545501709e-02</internalNodes>\n          <leafValues>\n            2.7607199549674988e-01 -2.5139200687408447e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2064 -1.6939499974250793e-01</internalNodes>\n          <leafValues>\n            -3.0767529010772705e+00 1.1617500334978104e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2065 -1.1336100101470947e-01</internalNodes>\n          <leafValues>\n            -1.4639229774475098e+00 -5.1447000354528427e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2066 -7.7685996890068054e-02</internalNodes>\n          <leafValues>\n            8.8430202007293701e-01 4.3306998908519745e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2067 -1.5568000264465809e-02</internalNodes>\n          <leafValues>\n            1.3672499358654022e-01 -3.4505501389503479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2068 -6.6018998622894287e-02</internalNodes>\n          <leafValues>\n            -1.0300110578536987e+00 1.1601399630308151e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2069 8.3699999377131462e-03</internalNodes>\n          <leafValues>\n            7.6429001986980438e-02 -4.4002500176429749e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2070 3.5402998328208923e-02</internalNodes>\n          <leafValues>\n            1.1979500204324722e-01 -7.2668302059173584e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2071 -3.9051000028848648e-02</internalNodes>\n          <leafValues>\n            6.7375302314758301e-01 -1.8196000158786774e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2072 -9.7899995744228363e-03</internalNodes>\n          <leafValues>\n            2.1264599263668060e-01 3.6756001412868500e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2073 -2.3047000169754028e-02</internalNodes>\n          <leafValues>\n            4.4742199778556824e-01 -2.0986700057983398e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2074 3.1169999856501818e-03</internalNodes>\n          <leafValues>\n            3.7544000893831253e-02 2.7808201313018799e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2075 1.3136000372469425e-02</internalNodes>\n          <leafValues>\n            -1.9842399656772614e-01 5.4335701465606689e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2076 1.4782000333070755e-02</internalNodes>\n          <leafValues>\n            1.3530600070953369e-01 -1.1153600364923477e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2077 -6.0139000415802002e-02</internalNodes>\n          <leafValues>\n            8.4039300680160522e-01 -1.6711600124835968e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2078 5.1998998969793320e-02</internalNodes>\n          <leafValues>\n            1.7372000217437744e-01 -7.8547602891921997e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2079 2.4792000651359558e-02</internalNodes>\n          <leafValues>\n            -1.7739200592041016e-01 6.6752600669860840e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2080 -1.2014999985694885e-02</internalNodes>\n          <leafValues>\n            -1.4263699948787689e-01 1.6070500016212463e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2081 -9.8655998706817627e-02</internalNodes>\n          <leafValues>\n            1.0429769754409790e+00 -1.5770199894905090e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2082 1.1758299916982651e-01</internalNodes>\n          <leafValues>\n            1.0955700278282166e-01 -4.4920377731323242e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2083 -1.8922999501228333e-02</internalNodes>\n          <leafValues>\n            -7.8543400764465332e-01 1.2984000146389008e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2084 -2.8390999883413315e-02</internalNodes>\n          <leafValues>\n            -6.0569900274276733e-01 1.2903499603271484e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2085 1.3182999566197395e-02</internalNodes>\n          <leafValues>\n            -1.4415999874472618e-02 -7.3210501670837402e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2086 -1.1653000116348267e-01</internalNodes>\n          <leafValues>\n            -2.0442469120025635e+00 1.4053100347518921e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2087 -3.8880000356584787e-03</internalNodes>\n          <leafValues>\n            -4.1861599683761597e-01 7.8704997897148132e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2088 3.1229000538587570e-02</internalNodes>\n          <leafValues>\n            2.4632999673485756e-02 4.1870400309562683e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2089 2.5198999792337418e-02</internalNodes>\n          <leafValues>\n            -1.7557799816131592e-01 6.4710599184036255e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2090 -2.8124000877141953e-02</internalNodes>\n          <leafValues>\n            -2.2005599737167358e-01 1.4121000468730927e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2091 3.6499001085758209e-02</internalNodes>\n          <leafValues>\n            -6.8426996469497681e-02 -2.3410849571228027e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2092 -7.2292998433113098e-02</internalNodes>\n          <leafValues>\n            1.2898750305175781e+00 8.4875002503395081e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2093 -4.1671000421047211e-02</internalNodes>\n          <leafValues>\n            -1.1630970239639282e+00 -5.3752999752759933e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2094 4.7703001648187637e-02</internalNodes>\n          <leafValues>\n            7.0101000368595123e-02 7.3676502704620361e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2095 6.5793000161647797e-02</internalNodes>\n          <leafValues>\n            -1.7755299806594849e-01 6.9780498743057251e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2096 1.3904999941587448e-02</internalNodes>\n          <leafValues>\n            2.1936799585819244e-01 -2.0390799641609192e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2097 -2.7730999514460564e-02</internalNodes>\n          <leafValues>\n            6.1867898702621460e-01 -1.7804099619388580e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2098 -1.5879999846220016e-02</internalNodes>\n          <leafValues>\n            -4.6484100818634033e-01 1.8828600645065308e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2099 7.4128001928329468e-02</internalNodes>\n          <leafValues>\n            -1.2858100235462189e-01 3.2792479991912842e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2100 -8.9000002481043339e-04</internalNodes>\n          <leafValues>\n            -3.0117601156234741e-01 2.3818799853324890e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2101 1.7965000122785568e-02</internalNodes>\n          <leafValues>\n            -2.2284999489784241e-01 2.9954001307487488e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2102 -2.5380000006407499e-03</internalNodes>\n          <leafValues>\n            2.5064399838447571e-01 -1.3665600121021271e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2103 -9.0680001303553581e-03</internalNodes>\n          <leafValues>\n            2.9017499089241028e-01 -2.8929701447486877e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2104 4.9169998615980148e-02</internalNodes>\n          <leafValues>\n            1.9156399369239807e-01 -6.8328702449798584e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2105 -3.0680999159812927e-02</internalNodes>\n          <leafValues>\n            -7.5677001476287842e-01 -1.3279999606311321e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2106 1.0017400234937668e-01</internalNodes>\n          <leafValues>\n            8.4453999996185303e-02 1.0888710021972656e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2107 3.1950001139193773e-03</internalNodes>\n          <leafValues>\n            -2.6919400691986084e-01 1.9537900388240814e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2108 3.5503000020980835e-02</internalNodes>\n          <leafValues>\n            1.3632300496101379e-01 -5.6917202472686768e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2109 4.5900000259280205e-04</internalNodes>\n          <leafValues>\n            -4.0443998575210571e-01 1.4074799418449402e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2110 2.5258999317884445e-02</internalNodes>\n          <leafValues>\n            1.6243200004100800e-01 -5.5741798877716064e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2111 -5.1549999043345451e-03</internalNodes>\n          <leafValues>\n            3.1132599711418152e-01 -2.2756099700927734e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2112 1.5869999770075083e-03</internalNodes>\n          <leafValues>\n            -2.6867699623107910e-01 1.9565400481224060e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2113 -1.6204999759793282e-02</internalNodes>\n          <leafValues>\n            1.5486499667167664e-01 -3.4057798981666565e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2114 -2.9624000191688538e-02</internalNodes>\n          <leafValues>\n            1.1466799974441528e+00 9.0557999908924103e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2115 -1.5930000226944685e-03</internalNodes>\n          <leafValues>\n            -7.1257501840591431e-01 -7.0400000549852848e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2116 -5.4019000381231308e-02</internalNodes>\n          <leafValues>\n            4.1537499427795410e-01 2.7246000245213509e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2117 -6.6211000084877014e-02</internalNodes>\n          <leafValues>\n            -1.3340090513229370e+00 -4.7352999448776245e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2118 2.7940999716520309e-02</internalNodes>\n          <leafValues>\n            1.4446300268173218e-01 -5.1518398523330688e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2119 2.8957000002264977e-02</internalNodes>\n          <leafValues>\n            -4.9966000020503998e-02 -1.1929039955139160e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2120 -2.0424999296665192e-02</internalNodes>\n          <leafValues>\n            6.3881301879882812e-01 3.8141001015901566e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2121 1.2416999787092209e-02</internalNodes>\n          <leafValues>\n            -2.1547000110149384e-01 4.9477699398994446e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>181</maxWeakCount>\n      <stageThreshold>-3.3196411132812500e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 2122 4.3274000287055969e-02</internalNodes>\n          <leafValues>\n            -8.0494397878646851e-01 3.9897298812866211e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2123 1.8615500628948212e-01</internalNodes>\n          <leafValues>\n            -3.1655299663543701e-01 6.8877297639846802e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2124 3.1860999763011932e-02</internalNodes>\n          <leafValues>\n            -6.4266198873519897e-01 2.5550898909568787e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2125 1.4022000133991241e-02</internalNodes>\n          <leafValues>\n            -4.5926600694656372e-01 3.1171199679374695e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2126 -6.3029997982084751e-03</internalNodes>\n          <leafValues>\n            4.6026900410652161e-01 -2.7438500523567200e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2127 -5.4310001432895660e-03</internalNodes>\n          <leafValues>\n            3.6608600616455078e-01 -2.7205801010131836e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2128 1.6822999343276024e-02</internalNodes>\n          <leafValues>\n            2.3476999253034592e-02 -8.8443797826766968e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2129 2.6039000600576401e-02</internalNodes>\n          <leafValues>\n            1.7488799989223480e-01 -5.4564702510833740e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2130 -2.6720000430941582e-02</internalNodes>\n          <leafValues>\n            -9.6396499872207642e-01 2.3524999618530273e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2131 -1.7041999846696854e-02</internalNodes>\n          <leafValues>\n            -7.0848798751831055e-01 2.1468099951744080e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2132 5.9569999575614929e-03</internalNodes>\n          <leafValues>\n            7.3601000010967255e-02 -6.8225598335266113e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2133 -2.8679999522864819e-03</internalNodes>\n          <leafValues>\n            -7.4935001134872437e-01 2.3803399503231049e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2134 -4.3774999678134918e-02</internalNodes>\n          <leafValues>\n            6.8323302268981934e-01 -2.1380299329757690e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2135 5.1633000373840332e-02</internalNodes>\n          <leafValues>\n            -1.2566499412059784e-01 6.7523801326751709e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2136 8.1780003383755684e-03</internalNodes>\n          <leafValues>\n            7.0689998567104340e-02 -8.0665898323059082e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2137 -5.2841998636722565e-02</internalNodes>\n          <leafValues>\n            9.5433902740478516e-01 1.6548000276088715e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2138 5.2583999931812286e-02</internalNodes>\n          <leafValues>\n            -2.8414401412010193e-01 4.7129800915718079e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2139 -1.2659000232815742e-02</internalNodes>\n          <leafValues>\n            3.8445401191711426e-01 -6.2288001179695129e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2140 1.1694000102579594e-02</internalNodes>\n          <leafValues>\n            5.6000000768108293e-05 -1.0173139572143555e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2141 -2.3918999359011650e-02</internalNodes>\n          <leafValues>\n            8.4921300411224365e-01 5.7399999350309372e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2142 -6.1673998832702637e-02</internalNodes>\n          <leafValues>\n            -9.2571401596069336e-01 -1.7679999582469463e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2143 -1.8279999494552612e-03</internalNodes>\n          <leafValues>\n            -5.4372298717498779e-01 2.4932399392127991e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2144 3.5257998853921890e-02</internalNodes>\n          <leafValues>\n            -7.3719997890293598e-03 -9.3963998556137085e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2145 -1.8438000231981277e-02</internalNodes>\n          <leafValues>\n            7.2136700153350830e-01 1.0491999797523022e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2146 -3.8389001041650772e-02</internalNodes>\n          <leafValues>\n            1.9272600114345551e-01 -3.5832101106643677e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2147 9.9720999598503113e-02</internalNodes>\n          <leafValues>\n            1.1354199796915054e-01 -1.6304190158843994e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2148 8.4462001919746399e-02</internalNodes>\n          <leafValues>\n            -5.3420998156070709e-02 -1.6981120109558105e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2149 4.0270000696182251e-02</internalNodes>\n          <leafValues>\n            -1.0783199965953827e-01 5.1926600933074951e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2150 5.8935999870300293e-02</internalNodes>\n          <leafValues>\n            -1.8053700029850006e-01 9.5119798183441162e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2151 1.4957000315189362e-01</internalNodes>\n          <leafValues>\n            1.6785299777984619e-01 -1.1591869592666626e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2152 6.9399998756125569e-04</internalNodes>\n          <leafValues>\n            2.0491400361061096e-01 -3.3118200302124023e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2153 -3.3369001001119614e-02</internalNodes>\n          <leafValues>\n            9.3468099832534790e-01 -2.9639999847859144e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2154 9.3759996816515923e-03</internalNodes>\n          <leafValues>\n            3.7000000011175871e-03 -7.7549797296524048e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2155 4.3193999677896500e-02</internalNodes>\n          <leafValues>\n            -2.2040000185370445e-03 7.4589699506759644e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2156 -6.7555002868175507e-02</internalNodes>\n          <leafValues>\n            7.2292101383209229e-01 -1.8404200673103333e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2157 -3.1168600916862488e-01</internalNodes>\n          <leafValues>\n            1.0014270544052124e+00 3.4003000706434250e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2158 2.9743999242782593e-02</internalNodes>\n          <leafValues>\n            -4.6356000006198883e-02 -1.2781809568405151e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2159 1.0737000033259392e-02</internalNodes>\n          <leafValues>\n            1.4812000095844269e-02 6.6649997234344482e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2160 -2.8841000050306320e-02</internalNodes>\n          <leafValues>\n            -9.4222599267959595e-01 -2.0796999335289001e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2161 -5.7649998925626278e-03</internalNodes>\n          <leafValues>\n            -4.3541899323463440e-01 2.3386000096797943e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2162 2.8410999104380608e-02</internalNodes>\n          <leafValues>\n            -1.7615799605846405e-01 8.5765302181243896e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2163 -2.9007999226450920e-02</internalNodes>\n          <leafValues>\n            5.7978099584579468e-01 2.8565999120473862e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2164 2.4965999647974968e-02</internalNodes>\n          <leafValues>\n            -2.2729000076651573e-02 -9.6773099899291992e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2165 1.2036000378429890e-02</internalNodes>\n          <leafValues>\n            -1.4214700460433960e-01 5.1687997579574585e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2166 -4.2514000087976456e-02</internalNodes>\n          <leafValues>\n            9.7273802757263184e-01 -1.8119800090789795e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2167 1.0276000015437603e-02</internalNodes>\n          <leafValues>\n            -8.3099998533725739e-02 3.1762799620628357e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2168 -6.9191999733448029e-02</internalNodes>\n          <leafValues>\n            -2.0668580532073975e+00 -6.0173999518156052e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2169 -4.6769999898970127e-03</internalNodes>\n          <leafValues>\n            4.4131800532341003e-01 2.3209000006318092e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2170 -1.3923999853432178e-02</internalNodes>\n          <leafValues>\n            2.8606700897216797e-01 -2.9152700304985046e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2171 -1.5333999879658222e-02</internalNodes>\n          <leafValues>\n            -5.7414501905441284e-01 2.3063300549983978e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2172 -1.0239000432193279e-02</internalNodes>\n          <leafValues>\n            3.4479200839996338e-01 -2.6080399751663208e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2173 -5.0988998264074326e-02</internalNodes>\n          <leafValues>\n            5.6154102087020874e-01 6.1218999326229095e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2174 3.0689999461174011e-02</internalNodes>\n          <leafValues>\n            -1.4772799611091614e-01 1.6378489732742310e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2175 -1.1223999783396721e-02</internalNodes>\n          <leafValues>\n            2.4006199836730957e-01 -4.4864898920059204e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2176 -6.2899999320507050e-03</internalNodes>\n          <leafValues>\n            4.3119499087333679e-01 -2.3808999359607697e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2177 7.8590996563434601e-02</internalNodes>\n          <leafValues>\n            1.9865000620484352e-02 8.0853801965713501e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2178 -1.0178999975323677e-02</internalNodes>\n          <leafValues>\n            1.8193200230598450e-01 -3.2877799868583679e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2179 3.1227000057697296e-02</internalNodes>\n          <leafValues>\n            1.4973899722099304e-01 -1.4180339574813843e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2180 4.0196999907493591e-02</internalNodes>\n          <leafValues>\n            -1.9760499894618988e-01 5.8508199453353882e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2181 1.6138000413775444e-02</internalNodes>\n          <leafValues>\n            5.0000002374872565e-04 3.9050000905990601e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2182 -4.5519001781940460e-02</internalNodes>\n          <leafValues>\n            1.2646820545196533e+00 -1.5632599592208862e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2183 -1.8130000680685043e-02</internalNodes>\n          <leafValues>\n            6.5148502588272095e-01 1.0235999710857868e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2184 -1.4001999981701374e-02</internalNodes>\n          <leafValues>\n            -1.0344820022583008e+00 -3.2182998955249786e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2185 -3.8816001266241074e-02</internalNodes>\n          <leafValues>\n            -4.7874298691749573e-01 1.6290700435638428e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2186 3.1656000763177872e-02</internalNodes>\n          <leafValues>\n            -2.0983399450778961e-01 5.4575902223587036e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2187 -1.0839999653398991e-02</internalNodes>\n          <leafValues>\n            5.1898801326751709e-01 -1.5080000273883343e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2188 1.2032999657094479e-02</internalNodes>\n          <leafValues>\n            -2.1107600629329681e-01 7.5937002897262573e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2189 7.0772998034954071e-02</internalNodes>\n          <leafValues>\n            1.8048800528049469e-01 -7.4048501253128052e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2190 5.3139799833297729e-01</internalNodes>\n          <leafValues>\n            -1.4491699635982513e-01 1.5360039472579956e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2191 -1.4774000272154808e-02</internalNodes>\n          <leafValues>\n            -2.8153699636459351e-01 2.0407299697399139e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2192 -2.2410000674426556e-03</internalNodes>\n          <leafValues>\n            -4.4876301288604736e-01 5.3989000618457794e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2193 4.9968000501394272e-02</internalNodes>\n          <leafValues>\n            4.1514001786708832e-02 2.9417100548744202e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2194 -4.7701999545097351e-02</internalNodes>\n          <leafValues>\n            3.9674299955368042e-01 -2.8301799297332764e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2195 -9.1311000287532806e-02</internalNodes>\n          <leafValues>\n            2.1994259357452393e+00 8.7964996695518494e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2196 3.8070000708103180e-02</internalNodes>\n          <leafValues>\n            -2.8025600314140320e-01 2.5156199932098389e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2197 -1.5538999810814857e-02</internalNodes>\n          <leafValues>\n            3.4157499670982361e-01 1.7924999818205833e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2198 -1.5445999801158905e-02</internalNodes>\n          <leafValues>\n            2.8680199384689331e-01 -2.5135898590087891e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2199 -5.7388000190258026e-02</internalNodes>\n          <leafValues>\n            6.3830000162124634e-01 8.8597998023033142e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2200 -5.9440000914037228e-03</internalNodes>\n          <leafValues>\n            7.9016998410224915e-02 -4.0774899721145630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2201 -6.9968998432159424e-02</internalNodes>\n          <leafValues>\n            -4.4644200801849365e-01 1.7219600081443787e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2202 -2.5064999237656593e-02</internalNodes>\n          <leafValues>\n            -9.8270201683044434e-01 -3.5388000309467316e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2203 1.7216000705957413e-02</internalNodes>\n          <leafValues>\n            2.2705900669097900e-01 -8.0550098419189453e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2204 -4.4279001653194427e-02</internalNodes>\n          <leafValues>\n            8.3951997756958008e-01 -1.7429600656032562e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2205 4.3988998979330063e-02</internalNodes>\n          <leafValues>\n            1.1557199805974960e-01 -1.9666889905929565e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2206 1.5907000750303268e-02</internalNodes>\n          <leafValues>\n            -3.7576001137495041e-02 -1.0311100482940674e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2207 -9.2754997313022614e-02</internalNodes>\n          <leafValues>\n            -1.3530019521713257e+00 1.2141299992799759e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2208 7.1037001907825470e-02</internalNodes>\n          <leafValues>\n            -1.7684300243854523e-01 7.4485200643539429e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2209 5.7762000709772110e-02</internalNodes>\n          <leafValues>\n            1.2835599482059479e-01 -4.4444200396537781e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2210 -1.6432000324130058e-02</internalNodes>\n          <leafValues>\n            8.0152702331542969e-01 -1.7491699755191803e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2211 2.3939000442624092e-02</internalNodes>\n          <leafValues>\n            1.6144999861717224e-01 -1.2364500015974045e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2212 1.2636000290513039e-02</internalNodes>\n          <leafValues>\n            1.5411999821662903e-01 -3.3293798565864563e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2213 -5.4347999393939972e-02</internalNodes>\n          <leafValues>\n            -1.8400700092315674e+00 1.4835999906063080e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2214 -1.3261999934911728e-02</internalNodes>\n          <leafValues>\n            -8.0838799476623535e-01 -2.7726000174880028e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2215 6.1340001411736012e-03</internalNodes>\n          <leafValues>\n            -1.3785000145435333e-01 3.2858499884605408e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2216 2.8991000726819038e-02</internalNodes>\n          <leafValues>\n            -2.5516999885439873e-02 -8.3387202024459839e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2217 -2.1986000239849091e-02</internalNodes>\n          <leafValues>\n            -7.3739999532699585e-01 1.7887100577354431e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2218 5.3269998170435429e-03</internalNodes>\n          <leafValues>\n            -4.5449298620223999e-01 6.8791002035140991e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2219 8.6047999560832977e-02</internalNodes>\n          <leafValues>\n            2.1008500456809998e-01 -3.7808901071548462e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2220 -8.5549997165799141e-03</internalNodes>\n          <leafValues>\n            4.0134999155998230e-01 -2.1074099838733673e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2221 6.7790001630783081e-03</internalNodes>\n          <leafValues>\n            -2.1648999303579330e-02 4.5421499013900757e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2222 -6.3959998078644276e-03</internalNodes>\n          <leafValues>\n            -4.9818599224090576e-01 7.5907997786998749e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2223 8.9469999074935913e-03</internalNodes>\n          <leafValues>\n            1.7857700586318970e-01 -2.8454899787902832e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2224 3.2589999027550220e-03</internalNodes>\n          <leafValues>\n            4.6624999493360519e-02 -5.5206298828125000e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2225 4.1476998478174210e-02</internalNodes>\n          <leafValues>\n            1.7550499737262726e-01 -2.0703999698162079e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2226 -6.7449999041855335e-03</internalNodes>\n          <leafValues>\n            -4.6392598748207092e-01 6.9303996860980988e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2227 3.0564999207854271e-02</internalNodes>\n          <leafValues>\n            5.1734998822212219e-02 7.5550502538681030e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2228 -7.4780001305043697e-03</internalNodes>\n          <leafValues>\n            1.4893899857997894e-01 -3.1906801462173462e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2229 8.9088998734951019e-02</internalNodes>\n          <leafValues>\n            1.3738800585269928e-01 -1.1379710435867310e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2230 7.3230001144111156e-03</internalNodes>\n          <leafValues>\n            -2.8829199075698853e-01 1.9088600575923920e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2231 -1.8205000087618828e-02</internalNodes>\n          <leafValues>\n            -3.0178600549697876e-01 1.6795800626277924e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2232 -2.5828000158071518e-02</internalNodes>\n          <leafValues>\n            -9.8137998580932617e-01 -1.9860999658703804e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2233 1.0936199873685837e-01</internalNodes>\n          <leafValues>\n            4.8790000379085541e-02 5.3118300437927246e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2234 -1.1424999684095383e-02</internalNodes>\n          <leafValues>\n            2.3705999553203583e-01 -2.7925300598144531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2235 -5.7565998286008835e-02</internalNodes>\n          <leafValues>\n            4.7255399823188782e-01 6.5171003341674805e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2236 1.0278300195932388e-01</internalNodes>\n          <leafValues>\n            -2.0765100419521332e-01 5.0947701930999756e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2237 2.7041999623179436e-02</internalNodes>\n          <leafValues>\n            1.6421200335025787e-01 -1.4508620500564575e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2238 -1.3635000213980675e-02</internalNodes>\n          <leafValues>\n            -5.6543898582458496e-01 2.3788999766111374e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2239 -3.2158198952674866e-01</internalNodes>\n          <leafValues>\n            -3.5602829456329346e+00 1.1801300197839737e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2240 2.0458100736141205e-01</internalNodes>\n          <leafValues>\n            -3.7016000598669052e-02 -1.0225499868392944e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2241 -7.0347003638744354e-02</internalNodes>\n          <leafValues>\n            -5.6491899490356445e-01 1.8525199592113495e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2242 3.7831000983715057e-02</internalNodes>\n          <leafValues>\n            -2.9901999980211258e-02 -8.2921499013900757e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2243 -7.0298001170158386e-02</internalNodes>\n          <leafValues>\n            -5.3172302246093750e-01 1.4430199563503265e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2244 6.3221000134944916e-02</internalNodes>\n          <leafValues>\n            -2.2041200101375580e-01 4.7952198982238770e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2245 3.6393001675605774e-02</internalNodes>\n          <leafValues>\n            1.4222699403762817e-01 -6.1193901300430298e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2246 4.0099998004734516e-03</internalNodes>\n          <leafValues>\n            -3.4560799598693848e-01 1.1738699674606323e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2247 -4.9106001853942871e-02</internalNodes>\n          <leafValues>\n            9.5984101295471191e-01 6.4934998750686646e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2248 -7.1583002805709839e-02</internalNodes>\n          <leafValues>\n            1.7385669946670532e+00 -1.4252899587154388e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2249 -3.8008999079465866e-02</internalNodes>\n          <leafValues>\n            1.3872820138931274e+00 6.6188000142574310e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2250 -3.1570000573992729e-03</internalNodes>\n          <leafValues>\n            5.3677000105381012e-02 -5.4048001766204834e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2251 1.9458999857306480e-02</internalNodes>\n          <leafValues>\n            -9.3620002269744873e-02 3.9131000638008118e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2252 1.1293999850749969e-02</internalNodes>\n          <leafValues>\n            3.7223998457193375e-02 -5.4251801967620850e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2253 -3.3495001494884491e-02</internalNodes>\n          <leafValues>\n            9.5307898521423340e-01 3.7696998566389084e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2254 9.2035003006458282e-02</internalNodes>\n          <leafValues>\n            -1.3488399982452393e-01 2.2897069454193115e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2255 3.7529999390244484e-03</internalNodes>\n          <leafValues>\n            2.2824199497699738e-01 -5.9983700513839722e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2256 1.2848000042140484e-02</internalNodes>\n          <leafValues>\n            -2.2005200386047363e-01 3.7221899628639221e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2257 -1.4316199719905853e-01</internalNodes>\n          <leafValues>\n            1.2855789661407471e+00 4.7237001359462738e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2258 -9.6879996359348297e-02</internalNodes>\n          <leafValues>\n            -3.9550929069519043e+00 -7.2903998196125031e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2259 -8.8459998369216919e-03</internalNodes>\n          <leafValues>\n            3.7674999237060547e-01 -4.6484000980854034e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2260 1.5900000929832458e-02</internalNodes>\n          <leafValues>\n            -2.4457000195980072e-02 -8.0034798383712769e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2261 7.0372000336647034e-02</internalNodes>\n          <leafValues>\n            1.7019000649452209e-01 -6.3068997859954834e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2262 -3.7953998893499374e-02</internalNodes>\n          <leafValues>\n            -9.3667197227478027e-01 -4.1214000433683395e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2263 5.1597899198532104e-01</internalNodes>\n          <leafValues>\n            1.3080599904060364e-01 -1.5802290439605713e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2264 -3.2843001186847687e-02</internalNodes>\n          <leafValues>\n            -1.1441620588302612e+00 -4.9173999577760696e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2265 -3.6357000470161438e-02</internalNodes>\n          <leafValues>\n            4.9606400728225708e-01 -3.4458998590707779e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2266 6.8080001510679722e-03</internalNodes>\n          <leafValues>\n            -3.0997800827026367e-01 1.7054800689220428e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2267 -1.6114000231027603e-02</internalNodes>\n          <leafValues>\n            -3.7904599308967590e-01 1.6078999638557434e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2268 8.4530003368854523e-03</internalNodes>\n          <leafValues>\n            -1.8655499815940857e-01 5.6367701292037964e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2269 -1.3752399384975433e-01</internalNodes>\n          <leafValues>\n            -5.8989900350570679e-01 1.1749500036239624e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2270 1.7688000202178955e-01</internalNodes>\n          <leafValues>\n            -1.5424899756908417e-01 9.2911100387573242e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2271 7.9309996217489243e-03</internalNodes>\n          <leafValues>\n            3.2190701365470886e-01 -1.6392600536346436e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2272 1.0971800237894058e-01</internalNodes>\n          <leafValues>\n            -1.5876500308513641e-01 1.0186259746551514e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2273 -3.0293000862002373e-02</internalNodes>\n          <leafValues>\n            7.5587302446365356e-01 3.1794998794794083e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2274 -2.3118000477552414e-02</internalNodes>\n          <leafValues>\n            -8.8451498746871948e-01 -9.5039997249841690e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2275 -3.0900000128895044e-03</internalNodes>\n          <leafValues>\n            2.3838299512863159e-01 -1.1606200039386749e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2276 -3.3392000943422318e-02</internalNodes>\n          <leafValues>\n            -1.8738139867782593e+00 -6.8502999842166901e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2277 1.3190000317990780e-02</internalNodes>\n          <leafValues>\n            1.2919899821281433e-01 -6.7512202262878418e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2278 1.4661000110208988e-02</internalNodes>\n          <leafValues>\n            -2.4829000234603882e-02 -7.4396800994873047e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2279 -1.3248000293970108e-02</internalNodes>\n          <leafValues>\n            4.6820199489593506e-01 -2.4165000766515732e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2280 -1.6218999400734901e-02</internalNodes>\n          <leafValues>\n            4.0083798766136169e-01 -2.1255700290203094e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2281 -2.9052000492811203e-02</internalNodes>\n          <leafValues>\n            -1.5650019645690918e+00 1.4375899732112885e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2282 -1.0153199732303619e-01</internalNodes>\n          <leafValues>\n            -1.9220689535140991e+00 -6.9559998810291290e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2283 3.7753999233245850e-02</internalNodes>\n          <leafValues>\n            1.3396799564361572e-01 -2.2639141082763672e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2284 -2.8555598855018616e-01</internalNodes>\n          <leafValues>\n            1.0215270519256592e+00 -1.5232199430465698e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2285 1.5360699594020844e-01</internalNodes>\n          <leafValues>\n            -9.7409002482891083e-02 4.1662400960922241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2286 -2.1199999901000410e-04</internalNodes>\n          <leafValues>\n            1.1271899938583374e-01 -4.1653999686241150e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2287 -2.0597999915480614e-02</internalNodes>\n          <leafValues>\n            6.0540497303009033e-01 6.2467999756336212e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2288 3.7353999912738800e-02</internalNodes>\n          <leafValues>\n            -1.8919000029563904e-01 4.6464699506759644e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2289 5.7275000959634781e-02</internalNodes>\n          <leafValues>\n            1.1565300077199936e-01 -1.3213009834289551e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2290 5.1029999740421772e-03</internalNodes>\n          <leafValues>\n            -2.8061500191688538e-01 1.9313399493694305e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2291 -5.4644998162984848e-02</internalNodes>\n          <leafValues>\n            7.2428500652313232e-01 7.5447998940944672e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2292 2.5349000468850136e-02</internalNodes>\n          <leafValues>\n            -1.9481800496578217e-01 4.6032801270484924e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2293 2.4311000481247902e-02</internalNodes>\n          <leafValues>\n            1.5564100444316864e-01 -4.9913901090621948e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2294 3.5962000489234924e-02</internalNodes>\n          <leafValues>\n            -5.8573000133037567e-02 -1.5418399572372437e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2295 -1.0000699758529663e-01</internalNodes>\n          <leafValues>\n            -1.6100039482116699e+00 1.1450500041246414e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2296 8.4435999393463135e-02</internalNodes>\n          <leafValues>\n            -6.1406999826431274e-02 -1.4673349857330322e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2297 1.5947999432682991e-02</internalNodes>\n          <leafValues>\n            1.6287900507450104e-01 -1.1026400327682495e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2298 3.3824000507593155e-02</internalNodes>\n          <leafValues>\n            -1.7932699620723724e-01 5.7218402624130249e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2299 -6.1996001750230789e-02</internalNodes>\n          <leafValues>\n            4.6511812210083008e+00 9.4534002244472504e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2300 6.9876998662948608e-02</internalNodes>\n          <leafValues>\n            -1.6985900700092316e-01 8.7028998136520386e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2301 -2.7916999533772469e-02</internalNodes>\n          <leafValues>\n            9.1042500734329224e-01 5.6827001273632050e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2302 -1.2764000333845615e-02</internalNodes>\n          <leafValues>\n            2.2066700458526611e-01 -2.7769100666046143e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>199</maxWeakCount>\n      <stageThreshold>-3.2573320865631104e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 2303 2.1662000566720963e-02</internalNodes>\n          <leafValues>\n            -8.9868897199630737e-01 2.9436299204826355e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2304 1.0044500231742859e-01</internalNodes>\n          <leafValues>\n            -3.7659201025962830e-01 6.0891002416610718e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2305 2.6003999635577202e-02</internalNodes>\n          <leafValues>\n            -3.8128501176834106e-01 3.9217400550842285e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2306 2.8441000729799271e-02</internalNodes>\n          <leafValues>\n            -1.8182300031185150e-01 5.8927202224731445e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2307 3.8612000644207001e-02</internalNodes>\n          <leafValues>\n            -2.2399599850177765e-01 6.3779997825622559e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2308 -4.6594999730587006e-02</internalNodes>\n          <leafValues>\n            7.0812201499938965e-01 -1.4666199684143066e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2309 -4.2791999876499176e-02</internalNodes>\n          <leafValues>\n            4.7680398821830750e-01 -2.9233199357986450e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2310 3.7960000336170197e-03</internalNodes>\n          <leafValues>\n            -1.8510299921035767e-01 5.2626699209213257e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2311 4.2348999530076981e-02</internalNodes>\n          <leafValues>\n            3.9244998246431351e-02 -8.9197701215744019e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2312 1.9598999992012978e-02</internalNodes>\n          <leafValues>\n            -2.3358400166034698e-01 4.4146499037742615e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2313 8.7400001939386129e-04</internalNodes>\n          <leafValues>\n            -4.6063598990440369e-01 1.7689600586891174e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2314 -4.3629999272525311e-03</internalNodes>\n          <leafValues>\n            3.3493199944496155e-01 -2.9893401265144348e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2315 1.6973000019788742e-02</internalNodes>\n          <leafValues>\n            -1.6408699750900269e-01 1.5993679761886597e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2316 3.6063998937606812e-02</internalNodes>\n          <leafValues>\n            2.2601699829101562e-01 -5.3186100721359253e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2317 -7.0864997804164886e-02</internalNodes>\n          <leafValues>\n            1.5220500528812408e-01 -4.1914600133895874e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2318 -6.3075996935367584e-02</internalNodes>\n          <leafValues>\n            -1.4874019622802734e+00 1.2953700125217438e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2319 2.9670000076293945e-02</internalNodes>\n          <leafValues>\n            -1.9145900011062622e-01 9.8184901475906372e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2320 3.7873998284339905e-02</internalNodes>\n          <leafValues>\n            1.3459500670433044e-01 -5.6316298246383667e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2321 -3.3289000391960144e-02</internalNodes>\n          <leafValues>\n            -1.0828030109405518e+00 -1.1504000052809715e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2322 -3.1608998775482178e-02</internalNodes>\n          <leafValues>\n            -5.9224498271942139e-01 1.3394799828529358e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2323 1.0740000288933516e-03</internalNodes>\n          <leafValues>\n            -4.9185800552368164e-01 9.4446003437042236e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2324 -7.1556001901626587e-02</internalNodes>\n          <leafValues>\n            5.9710198640823364e-01 -3.9553001523017883e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2325 -8.1170000135898590e-02</internalNodes>\n          <leafValues>\n            -1.1817820072174072e+00 -2.8254000470042229e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2326 4.4860001653432846e-03</internalNodes>\n          <leafValues>\n            -6.1028099060058594e-01 2.2619099915027618e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2327 -4.2176000773906708e-02</internalNodes>\n          <leafValues>\n            -1.1435619592666626e+00 -2.9001999646425247e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2328 -6.5640002489089966e-02</internalNodes>\n          <leafValues>\n            -1.6470279693603516e+00 1.2810300290584564e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2329 1.8188999965786934e-02</internalNodes>\n          <leafValues>\n            -3.1149399280548096e-01 2.5739601254463196e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2330 -5.1520001143217087e-02</internalNodes>\n          <leafValues>\n            -6.9206899404525757e-01 1.5270799398422241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2331 -4.7150999307632446e-02</internalNodes>\n          <leafValues>\n            -7.1868300437927246e-01 2.6879999786615372e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2332 1.7488999292254448e-02</internalNodes>\n          <leafValues>\n            2.2371199727058411e-01 -5.5381798744201660e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2333 -2.5264000520110130e-02</internalNodes>\n          <leafValues>\n            1.0319819450378418e+00 -1.7496499419212341e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2334 -4.0745001286268234e-02</internalNodes>\n          <leafValues>\n            4.4961598515510559e-01 3.9349000900983810e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2335 -3.7666998803615570e-02</internalNodes>\n          <leafValues>\n            -8.5475701093673706e-01 -1.2463999912142754e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2336 -1.3411000370979309e-02</internalNodes>\n          <leafValues>\n            5.7845598459243774e-01 -1.7467999830842018e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2337 -7.8999997640494257e-05</internalNodes>\n          <leafValues>\n            -3.7749201059341431e-01 1.3961799442768097e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2338 -1.1415000073611736e-02</internalNodes>\n          <leafValues>\n            -2.6186600327491760e-01 2.3712499439716339e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2339 3.7200000137090683e-02</internalNodes>\n          <leafValues>\n            -2.8626000508666039e-02 -1.2945239543914795e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2340 3.4050000831484795e-03</internalNodes>\n          <leafValues>\n            2.0531399548053741e-01 -1.8747499585151672e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2341 -2.2483000531792641e-02</internalNodes>\n          <leafValues>\n            6.7027199268341064e-01 -1.9594000279903412e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2342 2.3274999111890793e-02</internalNodes>\n          <leafValues>\n            1.7405399680137634e-01 -3.2746300101280212e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2343 -1.3917000032961369e-02</internalNodes>\n          <leafValues>\n            -8.3954298496246338e-01 -6.3760001212358475e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2344 7.5429999269545078e-03</internalNodes>\n          <leafValues>\n            -3.4194998443126678e-02 5.8998197317123413e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2345 -1.1539000086486340e-02</internalNodes>\n          <leafValues>\n            4.2142799496650696e-01 -2.3510499298572540e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2346 5.2501998841762543e-02</internalNodes>\n          <leafValues>\n            6.9303996860980988e-02 7.3226499557495117e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2347 5.2715998142957687e-02</internalNodes>\n          <leafValues>\n            -1.5688100457191467e-01 1.0907289981842041e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2348 -1.1726000346243382e-02</internalNodes>\n          <leafValues>\n            -7.0934301614761353e-01 1.6828800737857819e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2349 9.5945999026298523e-02</internalNodes>\n          <leafValues>\n            -1.6192899644374847e-01 1.0072519779205322e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2350 -1.5871999785304070e-02</internalNodes>\n          <leafValues>\n            3.9008399844169617e-01 -5.3777001798152924e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2351 3.4818001091480255e-02</internalNodes>\n          <leafValues>\n            1.7179999500513077e-02 -9.3941801786422729e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2352 3.4791998565196991e-02</internalNodes>\n          <leafValues>\n            5.0462998449802399e-02 5.4465699195861816e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2353 1.6284000128507614e-02</internalNodes>\n          <leafValues>\n            -2.6981300115585327e-01 4.0365299582481384e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2354 -4.4319000095129013e-02</internalNodes>\n          <leafValues>\n            8.4399998188018799e-01 3.2882999628782272e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2355 -5.5689997971057892e-03</internalNodes>\n          <leafValues>\n            1.5309399366378784e-01 -3.4959799051284790e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2356 -6.5842002630233765e-02</internalNodes>\n          <leafValues>\n            -9.2711198329925537e-01 1.6800999641418457e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2357 -7.3337003588676453e-02</internalNodes>\n          <leafValues>\n            5.1614499092102051e-01 -2.0236000418663025e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2358 1.6450000926852226e-02</internalNodes>\n          <leafValues>\n            1.3950599730014801e-01 -4.9301299452781677e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2359 -9.2630004510283470e-03</internalNodes>\n          <leafValues>\n            -9.0101999044418335e-01 -1.6116000711917877e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2360 5.9139998629689217e-03</internalNodes>\n          <leafValues>\n            1.9858199357986450e-01 -1.6731299459934235e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2361 -8.4699998842552304e-04</internalNodes>\n          <leafValues>\n            9.4005003571510315e-02 -4.1570898890495300e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2362 2.0532900094985962e-01</internalNodes>\n          <leafValues>\n            -6.0022000223398209e-02 7.0993602275848389e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2363 -1.6883000731468201e-02</internalNodes>\n          <leafValues>\n            2.4392199516296387e-01 -3.0551800131797791e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2364 -1.9111000001430511e-02</internalNodes>\n          <leafValues>\n            6.1229902505874634e-01 2.4252999573945999e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2365 -2.5962999090552330e-02</internalNodes>\n          <leafValues>\n            9.0764999389648438e-01 -1.6722099483013153e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2366 -2.1762000396847725e-02</internalNodes>\n          <leafValues>\n            -3.1384700536727905e-01 2.0134599506855011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2367 -2.4119999259710312e-02</internalNodes>\n          <leafValues>\n            -6.6588401794433594e-01 7.4559999629855156e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2368 4.7129999846220016e-02</internalNodes>\n          <leafValues>\n            5.9533998370170593e-02 8.7804502248764038e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2369 -4.5984998345375061e-02</internalNodes>\n          <leafValues>\n            8.0067998170852661e-01 -1.7252300679683685e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2370 2.6507999747991562e-02</internalNodes>\n          <leafValues>\n            1.8774099647998810e-01 -6.0850602388381958e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2371 -4.8615001142024994e-02</internalNodes>\n          <leafValues>\n            5.8644098043441772e-01 -1.9427700340747833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2372 -1.8562000244855881e-02</internalNodes>\n          <leafValues>\n            -2.5587901473045349e-01 1.6326199471950531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2373 1.2678000144660473e-02</internalNodes>\n          <leafValues>\n            -1.4228000305593014e-02 -7.6738101243972778e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2374 -1.1919999960809946e-03</internalNodes>\n          <leafValues>\n            2.0495000481605530e-01 -1.1404299736022949e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2375 -4.9088999629020691e-02</internalNodes>\n          <leafValues>\n            -1.0740849971771240e+00 -3.8940999656915665e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2376 -1.7436999827623367e-02</internalNodes>\n          <leafValues>\n            -5.7973802089691162e-01 1.8584500253200531e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2377 -1.4770000241696835e-02</internalNodes>\n          <leafValues>\n            -6.6150301694869995e-01 5.3119999356567860e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2378 -2.2905200719833374e-01</internalNodes>\n          <leafValues>\n            -4.8305100202560425e-01 1.2326399981975555e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2379 -1.2707099318504333e-01</internalNodes>\n          <leafValues>\n            5.7452601194381714e-01 -1.9420400261878967e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2380 1.0339000262320042e-02</internalNodes>\n          <leafValues>\n            -5.4641999304294586e-02 2.4501800537109375e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2381 6.9010001607239246e-03</internalNodes>\n          <leafValues>\n            1.2180600315332413e-01 -3.8797399401664734e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2382 2.9025399684906006e-01</internalNodes>\n          <leafValues>\n            1.0966199636459351e-01 -30.</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2383 -2.3804999887943268e-01</internalNodes>\n          <leafValues>\n            -1.7352679967880249e+00 -6.3809998333454132e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2384 6.2481001019477844e-02</internalNodes>\n          <leafValues>\n            1.3523000478744507e-01 -7.0301097631454468e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2385 4.7109997831285000e-03</internalNodes>\n          <leafValues>\n            -4.6984100341796875e-01 6.0341998934745789e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2386 -2.7815999463200569e-02</internalNodes>\n          <leafValues>\n            6.9807600975036621e-01 1.3719999697059393e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2387 -1.7020000144839287e-02</internalNodes>\n          <leafValues>\n            1.6870440244674683e+00 -1.4314800500869751e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2388 -4.9754999577999115e-02</internalNodes>\n          <leafValues>\n            7.9497700929641724e-01 7.7199999941512942e-04</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2389 -7.4732996523380280e-02</internalNodes>\n          <leafValues>\n            -1.0132360458374023e+00 -1.9388999789953232e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2390 3.2009001821279526e-02</internalNodes>\n          <leafValues>\n            1.4412100613117218e-01 -4.2139101028442383e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2391 -9.4463996589183807e-02</internalNodes>\n          <leafValues>\n            5.0682598352432251e-01 -2.0478899776935577e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2392 -1.5426999889314175e-02</internalNodes>\n          <leafValues>\n            -1.5811300277709961e-01 1.7806899547576904e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2393 -4.0540001355111599e-03</internalNodes>\n          <leafValues>\n            -5.4366701841354370e-01 3.1235000118613243e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2394 3.0080000869929790e-03</internalNodes>\n          <leafValues>\n            -1.7376799881458282e-01 3.0441701412200928e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2395 -1.0091999545693398e-02</internalNodes>\n          <leafValues>\n            2.5103801488876343e-01 -2.6224100589752197e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2396 -3.8818001747131348e-02</internalNodes>\n          <leafValues>\n            9.3226701021194458e-01 7.2659999132156372e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2397 3.4651998430490494e-02</internalNodes>\n          <leafValues>\n            -3.3934999257326126e-02 -8.5707902908325195e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2398 -4.6729999594390392e-03</internalNodes>\n          <leafValues>\n            3.4969300031661987e-01 -4.8517998307943344e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2399 6.8499997723847628e-04</internalNodes>\n          <leafValues>\n            6.6573001444339752e-02 -4.4973799586296082e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2400 3.5317000001668930e-02</internalNodes>\n          <leafValues>\n            1.4275799691677094e-01 -4.6726399660110474e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2401 -2.3569999262690544e-02</internalNodes>\n          <leafValues>\n            -1.0286079645156860e+00 -4.5288000255823135e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2402 -1.9109999993816018e-03</internalNodes>\n          <leafValues>\n            -1.9652199745178223e-01 2.8661000728607178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2403 -1.6659000888466835e-02</internalNodes>\n          <leafValues>\n            -7.7532202005386353e-01 -8.3280000835657120e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2404 6.6062200069427490e-01</internalNodes>\n          <leafValues>\n            1.3232499361038208e-01 -3.5266680717468262e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2405 1.0970599949359894e-01</internalNodes>\n          <leafValues>\n            -1.5547199547290802e-01 1.4674140214920044e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2406 1.3500999659299850e-02</internalNodes>\n          <leafValues>\n            1.5233400464057922e-01 -1.3020930290222168e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2407 -2.2871999070048332e-02</internalNodes>\n          <leafValues>\n            -7.1325999498367310e-01 -8.7040001526474953e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2408 -8.1821002066135406e-02</internalNodes>\n          <leafValues>\n            1.1127580404281616e+00 8.3219997584819794e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2409 -5.2728001028299332e-02</internalNodes>\n          <leafValues>\n            9.3165099620819092e-01 -1.7103999853134155e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2410 -2.5242000818252563e-02</internalNodes>\n          <leafValues>\n            -1.9733799993991852e-01 2.5359401106834412e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2411 -4.3818999081850052e-02</internalNodes>\n          <leafValues>\n            4.1815200448036194e-01 -2.4585500359535217e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2412 -1.8188999965786934e-02</internalNodes>\n          <leafValues>\n            -5.1743197441101074e-01 2.0174199342727661e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2413 2.3466000333428383e-02</internalNodes>\n          <leafValues>\n            -4.3071001768112183e-02 -1.0636579990386963e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2414 3.4216001629829407e-02</internalNodes>\n          <leafValues>\n            5.3780999034643173e-02 4.9707201123237610e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2415 2.5692999362945557e-02</internalNodes>\n          <leafValues>\n            -2.3800100386142731e-01 4.1651499271392822e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2416 -2.6565000414848328e-02</internalNodes>\n          <leafValues>\n            -8.8574802875518799e-01 1.3365900516510010e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2417 6.0942001640796661e-02</internalNodes>\n          <leafValues>\n            -2.0669700205326080e-01 5.8309000730514526e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2418 1.4474500715732574e-01</internalNodes>\n          <leafValues>\n            1.3282300531864166e-01 -3.1449348926544189e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2419 5.3410999476909637e-02</internalNodes>\n          <leafValues>\n            -1.7325200140476227e-01 6.9190698862075806e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2420 1.1408000253140926e-02</internalNodes>\n          <leafValues>\n            5.4822001606225967e-02 3.0240398645401001e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2421 -2.3179999552667141e-03</internalNodes>\n          <leafValues>\n            1.5820899605751038e-01 -3.1973201036453247e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2422 -2.9695000499486923e-02</internalNodes>\n          <leafValues>\n            7.1274799108505249e-01 5.8136001229286194e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2423 2.7249999344348907e-02</internalNodes>\n          <leafValues>\n            -1.5754100680351257e-01 9.2143797874450684e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2424 -3.6200000904500484e-03</internalNodes>\n          <leafValues>\n            -3.4548398852348328e-01 2.0220999419689178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2425 -1.2578999623656273e-02</internalNodes>\n          <leafValues>\n            -5.5650299787521362e-01 2.0388999953866005e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2426 -8.8849000632762909e-02</internalNodes>\n          <leafValues>\n            -3.6100010871887207e+00 1.3164199888706207e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2427 -1.9256999716162682e-02</internalNodes>\n          <leafValues>\n            5.1908999681472778e-01 -1.9284300506114960e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2428 -1.6666999086737633e-02</internalNodes>\n          <leafValues>\n            -8.7499998509883881e-02 1.5812499821186066e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2429 1.2931999750435352e-02</internalNodes>\n          <leafValues>\n            2.7405999600887299e-02 -5.5123901367187500e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2430 -1.3431999832391739e-02</internalNodes>\n          <leafValues>\n            2.3457799851894379e-01 -4.3235000222921371e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2431 1.8810000270605087e-02</internalNodes>\n          <leafValues>\n            -3.9680998772382736e-02 -9.4373297691345215e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2432 -6.4349998719990253e-03</internalNodes>\n          <leafValues>\n            4.5703700184822083e-01 -4.0520001202821732e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2433 -2.4249000474810600e-02</internalNodes>\n          <leafValues>\n            -7.6248002052307129e-01 -1.9857000559568405e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2434 -2.9667999595403671e-02</internalNodes>\n          <leafValues>\n            -3.7412509918212891e+00 1.1250600218772888e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2435 5.1150000654160976e-03</internalNodes>\n          <leafValues>\n            -6.3781797885894775e-01 1.1223999783396721e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2436 -5.7819997891783714e-03</internalNodes>\n          <leafValues>\n            1.9374400377273560e-01 -8.2042001187801361e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2437 1.6606999561190605e-02</internalNodes>\n          <leafValues>\n            -1.6192099452018738e-01 1.1334990262985229e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2438 3.8228001445531845e-02</internalNodes>\n          <leafValues>\n            2.1105000749230385e-02 7.6264202594757080e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2439 -5.7094000279903412e-02</internalNodes>\n          <leafValues>\n            -1.6974929571151733e+00 -5.9762001037597656e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2440 -5.3883001208305359e-02</internalNodes>\n          <leafValues>\n            1.1850190162658691e+00 9.0966999530792236e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2441 -2.6110000908374786e-03</internalNodes>\n          <leafValues>\n            -4.0941199660301208e-01 8.3820998668670654e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2442 2.9714399576187134e-01</internalNodes>\n          <leafValues>\n            1.5529899299144745e-01 -1.0995409488677979e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2443 -8.9063003659248352e-02</internalNodes>\n          <leafValues>\n            4.8947200179100037e-01 -2.0041200518608093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2444 -5.6193001568317413e-02</internalNodes>\n          <leafValues>\n            -2.4581399559974670e-01 1.4365500211715698e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2445 3.7004999816417694e-02</internalNodes>\n          <leafValues>\n            -4.8168998211622238e-02 -1.2310709953308105e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2446 -8.4840003401041031e-03</internalNodes>\n          <leafValues>\n            4.3372601270675659e-01 1.3779999688267708e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2447 -2.4379999376833439e-03</internalNodes>\n          <leafValues>\n            1.8949699401855469e-01 -3.2294198870658875e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2448 -7.1639999747276306e-02</internalNodes>\n          <leafValues>\n            -4.3979001045227051e-01 2.2730199992656708e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2449 5.2260002121329308e-03</internalNodes>\n          <leafValues>\n            -2.0548400282859802e-01 5.0933301448822021e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2450 -6.1360001564025879e-03</internalNodes>\n          <leafValues>\n            3.1157198548316956e-01 7.0680998265743256e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2451 1.5595000237226486e-02</internalNodes>\n          <leafValues>\n            -3.0934798717498779e-01 1.5627700090408325e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2452 2.5995999574661255e-02</internalNodes>\n          <leafValues>\n            1.3821600377559662e-01 -1.7616599798202515e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2453 -1.2085000053048134e-02</internalNodes>\n          <leafValues>\n            -5.1070201396942139e-01 5.8440998196601868e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2454 -6.7836001515388489e-02</internalNodes>\n          <leafValues>\n            4.7757101058959961e-01 -7.1446001529693604e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2455 -1.4715000055730343e-02</internalNodes>\n          <leafValues>\n            4.5238900184631348e-01 -1.9861400127410889e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2456 2.5118999183177948e-02</internalNodes>\n          <leafValues>\n            1.2954899668693542e-01 -8.6266398429870605e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2457 1.8826000392436981e-02</internalNodes>\n          <leafValues>\n            -4.1570000350475311e-02 -1.1354700326919556e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2458 -2.1263999864459038e-02</internalNodes>\n          <leafValues>\n            -3.4738001227378845e-01 1.5779499709606171e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2459 9.4609996303915977e-03</internalNodes>\n          <leafValues>\n            4.8639997839927673e-03 -6.1654800176620483e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2460 2.2957700490951538e-01</internalNodes>\n          <leafValues>\n            8.1372998654842377e-02 6.9841402769088745e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2461 -3.8061998784542084e-02</internalNodes>\n          <leafValues>\n            1.1616369485855103e+00 -1.4976699650287628e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2462 -1.3484999537467957e-02</internalNodes>\n          <leafValues>\n            -3.2036399841308594e-01 1.7365099489688873e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2463 3.6238998174667358e-02</internalNodes>\n          <leafValues>\n            -1.8158499896526337e-01 6.1956697702407837e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2464 6.7210001870989799e-03</internalNodes>\n          <leafValues>\n            7.9600000753998756e-04 4.2441400885581970e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2465 9.6525996923446655e-02</internalNodes>\n          <leafValues>\n            -1.4696800708770752e-01 1.2525680065155029e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2466 -3.5656999796628952e-02</internalNodes>\n          <leafValues>\n            -3.9781698584556580e-01 1.4191399514675140e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2467 1.0772000066936016e-02</internalNodes>\n          <leafValues>\n            -1.8194000422954559e-01 5.9762197732925415e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2468 7.9279996454715729e-02</internalNodes>\n          <leafValues>\n            1.4642499387264252e-01 -7.8836899995803833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2469 3.2841000705957413e-02</internalNodes>\n          <leafValues>\n            -6.2408000230789185e-02 -1.4227490425109863e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2470 -2.7781000360846519e-02</internalNodes>\n          <leafValues>\n            3.4033098816871643e-01 3.0670000240206718e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2471 -4.0339999832212925e-03</internalNodes>\n          <leafValues>\n            3.1084701418876648e-01 -2.2595700621604919e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2472 7.4260002002120018e-03</internalNodes>\n          <leafValues>\n            -3.8936998695135117e-02 3.1702101230621338e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2473 1.1213999986648560e-01</internalNodes>\n          <leafValues>\n            -1.7578299343585968e-01 6.5056598186492920e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2474 -1.1878100037574768e-01</internalNodes>\n          <leafValues>\n            -1.0092990398406982e+00 1.1069700121879578e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2475 -4.1584998369216919e-02</internalNodes>\n          <leafValues>\n            -5.3806400299072266e-01 1.9905000925064087e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2476 -2.7966000139713287e-02</internalNodes>\n          <leafValues>\n            4.8143199086189270e-01 3.3590998500585556e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2477 -1.2506400048732758e-01</internalNodes>\n          <leafValues>\n            2.6352199912071228e-01 -2.5737899541854858e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2478 2.3666900396347046e-01</internalNodes>\n          <leafValues>\n            3.6508001387119293e-02 9.0655601024627686e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2479 -2.9475999996066093e-02</internalNodes>\n          <leafValues>\n            -6.0048800706863403e-01 9.5880003646016121e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2480 3.7792999297380447e-02</internalNodes>\n          <leafValues>\n            1.5506200492382050e-01 -9.5733499526977539e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2481 7.2044000029563904e-02</internalNodes>\n          <leafValues>\n            -1.4525899291038513e-01 1.3676730394363403e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2482 9.7759999334812164e-03</internalNodes>\n          <leafValues>\n            1.2915999628603458e-02 2.1640899777412415e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2483 5.2154000848531723e-02</internalNodes>\n          <leafValues>\n            -1.6359999775886536e-02 -8.8356298208236694e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2484 -4.3790999799966812e-02</internalNodes>\n          <leafValues>\n            3.5829600691795349e-01 6.5131001174449921e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2485 -3.8378998637199402e-02</internalNodes>\n          <leafValues>\n            1.1961040496826172e+00 -1.4971500635147095e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2486 -9.8838999867439270e-02</internalNodes>\n          <leafValues>\n            -6.1834001541137695e-01 1.2786200642585754e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2487 -1.2190700322389603e-01</internalNodes>\n          <leafValues>\n            -1.8276120424270630e+00 -6.4862996339797974e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2488 -1.1981700360774994e-01</internalNodes>\n          <leafValues>\n            -30. 1.1323300004005432e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2489 3.0910000205039978e-02</internalNodes>\n          <leafValues>\n            -2.3934000730514526e-01 3.6332899332046509e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2490 1.0800999589264393e-02</internalNodes>\n          <leafValues>\n            -3.5140000283718109e-02 2.7707898616790771e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2491 5.6844998151063919e-02</internalNodes>\n          <leafValues>\n            -1.5524299442768097e-01 1.0802700519561768e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2492 1.0280000278726220e-03</internalNodes>\n          <leafValues>\n            -6.1202999204397202e-02 2.0508000254631042e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2493 -2.8273999691009521e-02</internalNodes>\n          <leafValues>\n            -6.4778000116348267e-01 2.3917000740766525e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2494 -1.6013599932193756e-01</internalNodes>\n          <leafValues>\n            1.0892050266265869e+00 5.8389000594615936e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2495 4.9629998393356800e-03</internalNodes>\n          <leafValues>\n            -2.5806298851966858e-01 2.0834599435329437e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2496 4.6937000006437302e-02</internalNodes>\n          <leafValues>\n            1.3886299729347229e-01 -1.5662620067596436e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2497 2.4286000058054924e-02</internalNodes>\n          <leafValues>\n            -2.0728300511837006e-01 5.2430999279022217e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2498 7.0202000439167023e-02</internalNodes>\n          <leafValues>\n            1.4796899259090424e-01 -1.3095090389251709e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2499 9.8120002076029778e-03</internalNodes>\n          <leafValues>\n            2.7906000614166260e-02 -5.0864601135253906e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2500 -5.6200999766588211e-02</internalNodes>\n          <leafValues>\n            1.2618130445480347e+00 6.3801996409893036e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2501 1.0982800275087357e-01</internalNodes>\n          <leafValues>\n            -1.2850099802017212e-01 3.0776169300079346e+00</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>211</maxWeakCount>\n      <stageThreshold>-3.3703000545501709e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 2502 2.0910000428557396e-02</internalNodes>\n          <leafValues>\n            -6.8559402227401733e-01 3.8984298706054688e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2503 3.5032000392675400e-02</internalNodes>\n          <leafValues>\n            -4.7724398970603943e-01 4.5027199387550354e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2504 3.9799001067876816e-02</internalNodes>\n          <leafValues>\n            -4.7011101245880127e-01 4.2702499032020569e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2505 -4.8409998416900635e-03</internalNodes>\n          <leafValues>\n            2.5614300370216370e-01 -6.6556298732757568e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2506 2.3439999204128981e-03</internalNodes>\n          <leafValues>\n            -4.8083499073982239e-01 2.8013798594474792e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2507 2.5312999263405800e-02</internalNodes>\n          <leafValues>\n            -2.3948200047016144e-01 4.4191798567771912e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2508 -3.2193001359701157e-02</internalNodes>\n          <leafValues>\n            7.6086699962615967e-01 -2.5059100985527039e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2509 7.5409002602100372e-02</internalNodes>\n          <leafValues>\n            -3.4974598884582520e-01 3.4380298852920532e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2510 -1.8469000235199928e-02</internalNodes>\n          <leafValues>\n            -7.9085600376129150e-01 3.4788001328706741e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2511 -1.2802000157535076e-02</internalNodes>\n          <leafValues>\n            4.7107800841331482e-01 -6.0006000101566315e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2512 -2.6598000898957253e-02</internalNodes>\n          <leafValues>\n            6.7116099596023560e-01 -2.4257500469684601e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2513 2.1988999098539352e-02</internalNodes>\n          <leafValues>\n            2.4717499315738678e-01 -4.8301699757575989e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2514 1.4654099941253662e-01</internalNodes>\n          <leafValues>\n            -2.1504099667072296e-01 7.2055900096893311e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2515 3.5310001112520695e-03</internalNodes>\n          <leafValues>\n            2.7930998802185059e-01 -3.4339898824691772e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2516 9.4010001048445702e-03</internalNodes>\n          <leafValues>\n            5.5861998349428177e-02 -8.2143598794937134e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2517 -8.6390003561973572e-03</internalNodes>\n          <leafValues>\n            -9.9620598554611206e-01 1.8874999880790710e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2518 -3.9193000644445419e-02</internalNodes>\n          <leafValues>\n            -1.1945559978485107e+00 -2.9198000207543373e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2519 2.4855000898241997e-02</internalNodes>\n          <leafValues>\n            1.4987599849700928e-01 -5.4137802124023438e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2520 -3.4995000809431076e-02</internalNodes>\n          <leafValues>\n            -1.4210180044174194e+00 -4.2314000427722931e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2521 -1.8378999084234238e-02</internalNodes>\n          <leafValues>\n            -2.8242599964141846e-01 1.5581800043582916e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2522 -1.3592000119388103e-02</internalNodes>\n          <leafValues>\n            4.7317099571228027e-01 -2.1937200427055359e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2523 6.2629999592900276e-03</internalNodes>\n          <leafValues>\n            -5.9714000672101974e-02 6.0625898838043213e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2524 -1.8478000536561012e-02</internalNodes>\n          <leafValues>\n            -8.5647201538085938e-01 -1.3783999718725681e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2525 1.4236000366508961e-02</internalNodes>\n          <leafValues>\n            1.6654799878597260e-01 -2.7713999152183533e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2526 -3.2547000795602798e-02</internalNodes>\n          <leafValues>\n            -1.1728240251541138e+00 -4.0185000747442245e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2527 -2.6410000864416361e-03</internalNodes>\n          <leafValues>\n            2.6514300704002380e-01 -5.6343000382184982e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2528 -8.7799999164417386e-04</internalNodes>\n          <leafValues>\n            3.6556001752614975e-02 -5.5075198411941528e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2529 4.7371998429298401e-02</internalNodes>\n          <leafValues>\n            -4.2614001780748367e-02 4.8194900155067444e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2530 -7.0790001191198826e-03</internalNodes>\n          <leafValues>\n            2.8698998689651489e-01 -3.2923001050949097e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2531 -4.3145999312400818e-02</internalNodes>\n          <leafValues>\n            -1.4065419435501099e+00 1.2836399674415588e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2532 2.0592000335454941e-02</internalNodes>\n          <leafValues>\n            -2.1435299515724182e-01 5.3981798887252808e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2533 -2.2367000579833984e-02</internalNodes>\n          <leafValues>\n            3.3718299865722656e-01 4.5212000608444214e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2534 5.0039999186992645e-02</internalNodes>\n          <leafValues>\n            -2.5121700763702393e-01 4.1750499606132507e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2535 6.1794999986886978e-02</internalNodes>\n          <leafValues>\n            4.0084999054670334e-02 6.8779802322387695e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2536 -4.1861999779939651e-02</internalNodes>\n          <leafValues>\n            5.3027397394180298e-01 -2.2901999950408936e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2537 -3.1959998887032270e-03</internalNodes>\n          <leafValues>\n            2.5161498785018921e-01 -2.1514600515365601e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2538 2.4255000054836273e-02</internalNodes>\n          <leafValues>\n            7.2320001199841499e-03 -7.2519099712371826e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2539 -1.7303999513387680e-02</internalNodes>\n          <leafValues>\n            -4.9958199262619019e-01 1.8394500017166138e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2540 -4.1470001451671124e-03</internalNodes>\n          <leafValues>\n            8.5211999714374542e-02 -4.6364700794219971e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2541 -1.4369999989867210e-02</internalNodes>\n          <leafValues>\n            -5.2258902788162231e-01 2.3892599344253540e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2542 -9.0399999171495438e-03</internalNodes>\n          <leafValues>\n            -6.3250398635864258e-01 3.2551001757383347e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2543 -1.2373100221157074e-01</internalNodes>\n          <leafValues>\n            1.2856210470199585e+00 7.6545000076293945e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2544 -8.2221999764442444e-02</internalNodes>\n          <leafValues>\n            8.3208197355270386e-01 -1.8590599298477173e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2545 6.5659001469612122e-02</internalNodes>\n          <leafValues>\n            1.1298800259828568e-01 -30.</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2546 -3.1582999974489212e-02</internalNodes>\n          <leafValues>\n            -1.3485900163650513e+00 -4.7097001224756241e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2547 -7.9636000096797943e-02</internalNodes>\n          <leafValues>\n            -1.3533639907836914e+00 1.5668800473213196e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2548 -1.8880000337958336e-02</internalNodes>\n          <leafValues>\n            4.0300300717353821e-01 -2.5148901343345642e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2549 -5.0149997696280479e-03</internalNodes>\n          <leafValues>\n            -2.6287099719047546e-01 1.8582500517368317e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2550 -1.2218000367283821e-02</internalNodes>\n          <leafValues>\n            5.8692401647567749e-01 -1.9427700340747833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2551 1.2710000155493617e-03</internalNodes>\n          <leafValues>\n            -1.6688999533653259e-01 2.3006899654865265e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2552 2.9743999242782593e-02</internalNodes>\n          <leafValues>\n            1.2520000338554382e-02 -6.6723597049713135e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2553 2.8175000101327896e-02</internalNodes>\n          <leafValues>\n            -1.7060000449419022e-02 6.4579397439956665e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2554 3.0345000326633453e-02</internalNodes>\n          <leafValues>\n            -2.4178700149059296e-01 3.4878900647163391e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2555 -1.7325999215245247e-02</internalNodes>\n          <leafValues>\n            -5.3599399328231812e-01 2.0995999872684479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2556 -8.4178000688552856e-02</internalNodes>\n          <leafValues>\n            7.5093299150466919e-01 -1.7593200504779816e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2557 7.4950000271201134e-03</internalNodes>\n          <leafValues>\n            -1.6188099980354309e-01 3.0657500028610229e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2558 5.6494999676942825e-02</internalNodes>\n          <leafValues>\n            -1.7318800091743469e-01 1.0016150474548340e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2559 -5.2939997985959053e-03</internalNodes>\n          <leafValues>\n            2.3417599499225616e-01 -6.5347000956535339e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2560 -1.4945000410079956e-02</internalNodes>\n          <leafValues>\n            2.5018900632858276e-01 -3.0591198801994324e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2561 5.4919000715017319e-02</internalNodes>\n          <leafValues>\n            1.3121999800205231e-01 -9.3765097856521606e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2562 -1.9721999764442444e-02</internalNodes>\n          <leafValues>\n            -8.3978497982025146e-01 -2.3473000153899193e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2563 -6.7158997058868408e-02</internalNodes>\n          <leafValues>\n            2.3586840629577637e+00 8.2970999181270599e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2564 -1.4325999654829502e-02</internalNodes>\n          <leafValues>\n            1.8814499676227570e-01 -3.1221601366996765e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2565 2.9841000214219093e-02</internalNodes>\n          <leafValues>\n            1.4825099706649780e-01 -8.4681701660156250e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2566 5.1883000880479813e-02</internalNodes>\n          <leafValues>\n            -4.3731000274419785e-02 -1.3366169929504395e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2567 4.1127000004053116e-02</internalNodes>\n          <leafValues>\n            1.7660099267959595e-01 -6.0904097557067871e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2568 -1.2865099310874939e-01</internalNodes>\n          <leafValues>\n            -9.8701000213623047e-01 -3.7785001099109650e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2569 2.4170000106096268e-03</internalNodes>\n          <leafValues>\n            -1.6119599342346191e-01 3.2675701379776001e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2570 7.7030002139508724e-03</internalNodes>\n          <leafValues>\n            -2.3841500282287598e-01 2.9319399595260620e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2571 4.5520000159740448e-02</internalNodes>\n          <leafValues>\n            1.4424599707126617e-01 -1.5010160207748413e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2572 -7.8700996935367584e-02</internalNodes>\n          <leafValues>\n            -1.0394560098648071e+00 -4.5375999063253403e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2573 7.8619997948408127e-03</internalNodes>\n          <leafValues>\n            1.9633600115776062e-01 -1.4472399652004242e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2574 -1.3458999805152416e-02</internalNodes>\n          <leafValues>\n            -9.0634697675704956e-01 -3.8049001246690750e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2575 2.8827000409364700e-02</internalNodes>\n          <leafValues>\n            -2.9473999515175819e-02 6.0058397054672241e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2576 -2.7365999296307564e-02</internalNodes>\n          <leafValues>\n            -9.9804002046585083e-01 -3.8653001189231873e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2577 -7.2917997837066650e-02</internalNodes>\n          <leafValues>\n            7.3361498117446899e-01 5.7440001517534256e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2578 -1.3988999649882317e-02</internalNodes>\n          <leafValues>\n            2.7892601490020752e-01 -2.6516300439834595e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2579 4.3242998421192169e-02</internalNodes>\n          <leafValues>\n            4.7760000452399254e-03 3.5925900936126709e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2580 2.9533000662922859e-02</internalNodes>\n          <leafValues>\n            -2.0083999633789062e-01 5.1202899217605591e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2581 -3.1897000968456268e-02</internalNodes>\n          <leafValues>\n            6.4721697568893433e-01 -1.3760000001639128e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2582 3.7868998944759369e-02</internalNodes>\n          <leafValues>\n            -1.8363800644874573e-01 6.1343097686767578e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2583 -2.2417999804019928e-02</internalNodes>\n          <leafValues>\n            -2.9187899827957153e-01 1.8194800615310669e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2584 5.8958999812602997e-02</internalNodes>\n          <leafValues>\n            -6.6451996564865112e-02 -1.9290030002593994e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2585 3.1222999095916748e-02</internalNodes>\n          <leafValues>\n            -1.2732000090181828e-02 6.1560797691345215e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2586 3.7484999746084213e-02</internalNodes>\n          <leafValues>\n            -2.0856900513172150e-01 4.4363999366760254e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2587 -2.0966000854969025e-02</internalNodes>\n          <leafValues>\n            -3.5712799429893494e-01 2.4252200126647949e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2588 -2.5477999821305275e-02</internalNodes>\n          <leafValues>\n            1.0846560001373291e+00 -1.5054400265216827e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2589 -7.2570000775158405e-03</internalNodes>\n          <leafValues>\n            2.1302600204944611e-01 -1.8308199942111969e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2590 -5.0983000546693802e-02</internalNodes>\n          <leafValues>\n            5.1736801862716675e-01 -1.8833099305629730e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2591 -2.0640000700950623e-02</internalNodes>\n          <leafValues>\n            -4.4030201435089111e-01 2.2745999693870544e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2592 1.0672999545931816e-02</internalNodes>\n          <leafValues>\n            3.5059999674558640e-02 -5.1665002107620239e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2593 3.1895998865365982e-02</internalNodes>\n          <leafValues>\n            1.3228000141680241e-02 3.4915199875831604e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2594 -2.3824999108910561e-02</internalNodes>\n          <leafValues>\n            3.4118801355361938e-01 -2.1510200202465057e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2595 -6.0680001042783260e-03</internalNodes>\n          <leafValues>\n            3.2937398552894592e-01 -2.8523799777030945e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2596 2.3881999775767326e-02</internalNodes>\n          <leafValues>\n            -2.5333800911903381e-01 2.6296100020408630e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2597 2.7966000139713287e-02</internalNodes>\n          <leafValues>\n            1.4049099385738373e-01 -4.9887099862098694e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2598 1.4603000134229660e-02</internalNodes>\n          <leafValues>\n            -1.5395999886095524e-02 -7.6958000659942627e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2599 1.0872399806976318e-01</internalNodes>\n          <leafValues>\n            1.9069600105285645e-01 -3.2393100857734680e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2600 -1.4038000255823135e-02</internalNodes>\n          <leafValues>\n            3.4924700856208801e-01 -2.2358700633049011e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2601 4.0440000593662262e-03</internalNodes>\n          <leafValues>\n            -3.8329001516103745e-02 5.1177299022674561e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2602 -4.9769999459385872e-03</internalNodes>\n          <leafValues>\n            -4.2888298630714417e-01 4.9173999577760696e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2603 -8.5183002054691315e-02</internalNodes>\n          <leafValues>\n            6.6624599695205688e-01 7.8079998493194580e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2604 2.1559998858720064e-03</internalNodes>\n          <leafValues>\n            -4.9135199189186096e-01 6.9555997848510742e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2605 3.6384499073028564e-01</internalNodes>\n          <leafValues>\n            1.2997099757194519e-01 -1.8949509859085083e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2606 2.2082500159740448e-01</internalNodes>\n          <leafValues>\n            -5.7211998850107193e-02 -1.4281120300292969e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2607 -1.6140000894665718e-02</internalNodes>\n          <leafValues>\n            -5.7589399814605713e-01 1.8062500655651093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2608 -4.8330001533031464e-02</internalNodes>\n          <leafValues>\n            9.7308498620986938e-01 -1.6513000428676605e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2609 1.7529999837279320e-02</internalNodes>\n          <leafValues>\n            1.7932699620723724e-01 -2.7948901057243347e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2610 -3.4309998154640198e-02</internalNodes>\n          <leafValues>\n            -8.1072497367858887e-01 -1.6596000641584396e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2611 -4.5830002054572105e-03</internalNodes>\n          <leafValues>\n            2.7908998727798462e-01 -7.4519999325275421e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2612 1.2896400690078735e-01</internalNodes>\n          <leafValues>\n            -1.3508500158786774e-01 2.5411539077758789e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2613 3.0361000448465347e-02</internalNodes>\n          <leafValues>\n            -6.8419001996517181e-02 2.8734099864959717e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2614 4.4086001813411713e-02</internalNodes>\n          <leafValues>\n            -1.8135899305343628e-01 6.5413200855255127e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2615 3.0159999150782824e-03</internalNodes>\n          <leafValues>\n            -1.5690499544143677e-01 2.6963800191879272e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2616 -2.6336999610066414e-02</internalNodes>\n          <leafValues>\n            2.9175600409507751e-01 -2.5274100899696350e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2617 -2.7866000309586525e-02</internalNodes>\n          <leafValues>\n            4.4387501478195190e-01 5.5038001388311386e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2618 1.1725000105798244e-02</internalNodes>\n          <leafValues>\n            -1.9346499443054199e-01 4.6656700968742371e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2619 1.5689999563619494e-03</internalNodes>\n          <leafValues>\n            -8.2360003143548965e-03 2.5700899958610535e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2620 -3.5550000611692667e-03</internalNodes>\n          <leafValues>\n            -4.2430898547172546e-01 7.1174003183841705e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2621 -3.1695000827312469e-02</internalNodes>\n          <leafValues>\n            -8.5393500328063965e-01 1.6916200518608093e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2622 -3.2097000628709793e-02</internalNodes>\n          <leafValues>\n            8.3784902095794678e-01 -1.7597299814224243e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2623 1.5544199943542480e-01</internalNodes>\n          <leafValues>\n            9.9550001323223114e-02 2.3873300552368164e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2624 8.8045999407768250e-02</internalNodes>\n          <leafValues>\n            -1.8725299835205078e-01 6.2384301424026489e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2625 -1.6720000421628356e-03</internalNodes>\n          <leafValues>\n            2.5008699297904968e-01 -6.5118998289108276e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2626 9.3409996479749680e-03</internalNodes>\n          <leafValues>\n            -3.5378900170326233e-01 1.0715000331401825e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2627 3.7138000130653381e-02</internalNodes>\n          <leafValues>\n            1.6387000679969788e-01 -9.1718399524688721e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2628 8.0183997750282288e-02</internalNodes>\n          <leafValues>\n            -1.4812999963760376e-01 1.4895190000534058e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2629 -7.9100002767518163e-04</internalNodes>\n          <leafValues>\n            -2.1326899528503418e-01 1.9676400721073151e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2630 -5.0400001928210258e-03</internalNodes>\n          <leafValues>\n            -7.1318697929382324e-01 1.8240000354126096e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2631 1.1962399631738663e-01</internalNodes>\n          <leafValues>\n            3.3098999410867691e-02 1.0441709756851196e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2632 -4.5280000194907188e-03</internalNodes>\n          <leafValues>\n            -2.7308499813079834e-01 2.7229800820350647e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2633 -2.9639000073075294e-02</internalNodes>\n          <leafValues>\n            3.6225798726081848e-01 5.6795001029968262e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2634 2.6650000363588333e-02</internalNodes>\n          <leafValues>\n            -4.8041000962257385e-02 -9.6723502874374390e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2635 4.4422000646591187e-02</internalNodes>\n          <leafValues>\n            1.3052900135517120e-01 -3.5077300667762756e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2636 -2.4359999224543571e-02</internalNodes>\n          <leafValues>\n            -1.0766899585723877e+00 -5.1222998648881912e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2637 1.9734999164938927e-02</internalNodes>\n          <leafValues>\n            2.6238000020384789e-02 2.8070500493049622e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2638 5.4930001497268677e-03</internalNodes>\n          <leafValues>\n            -2.6111298799514771e-01 2.1011400222778320e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2639 -2.3200300335884094e-01</internalNodes>\n          <leafValues>\n            -1.7748440504074097e+00 1.1482600122690201e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2640 -2.5614000856876373e-02</internalNodes>\n          <leafValues>\n            2.9900801181793213e-01 -2.2502499818801880e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2641 -6.4949998632073402e-03</internalNodes>\n          <leafValues>\n            1.9563800096511841e-01 -9.9762998521327972e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2642 3.9840000681579113e-03</internalNodes>\n          <leafValues>\n            -4.3021500110626221e-01 8.1261001527309418e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2643 -3.5813000053167343e-02</internalNodes>\n          <leafValues>\n            -5.0987398624420166e-01 1.6345900297164917e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2644 -1.4169000089168549e-02</internalNodes>\n          <leafValues>\n            7.7978098392486572e-01 -1.7476299405097961e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2645 -1.2642100453376770e-01</internalNodes>\n          <leafValues>\n            -6.3047897815704346e-01 1.2728300690650940e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2646 6.8677999079227448e-02</internalNodes>\n          <leafValues>\n            -4.6447999775409698e-02 -1.1128979921340942e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2647 8.5864998400211334e-02</internalNodes>\n          <leafValues>\n            1.1835400015115738e-01 -4.8235158920288086e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2648 1.5511999838054180e-02</internalNodes>\n          <leafValues>\n            -1.7467999830842018e-02 -6.3693398237228394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2649 8.1091001629829407e-02</internalNodes>\n          <leafValues>\n            8.6133003234863281e-02 2.4559431076049805e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2650 1.8495000898838043e-02</internalNodes>\n          <leafValues>\n            4.0229000151157379e-02 -5.0858199596405029e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2651 -8.6320996284484863e-02</internalNodes>\n          <leafValues>\n            -1.9006760120391846e+00 1.1019100248813629e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2652 7.2355002164840698e-02</internalNodes>\n          <leafValues>\n            -6.2111999839544296e-02 -1.4165179729461670e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2653 -7.8179001808166504e-02</internalNodes>\n          <leafValues>\n            8.8849300146102905e-01 4.2369998991489410e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2654 9.6681997179985046e-02</internalNodes>\n          <leafValues>\n            -2.2094200551509857e-01 3.3575099706649780e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2655 -3.9875999093055725e-02</internalNodes>\n          <leafValues>\n            5.7804799079895020e-01 4.5347999781370163e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2656 -9.5349997282028198e-03</internalNodes>\n          <leafValues>\n            -5.4175698757171631e-01 3.2399999909102917e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2657 4.0600000647827983e-04</internalNodes>\n          <leafValues>\n            -8.1549003720283508e-02 3.5837900638580322e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2658 1.2107999995350838e-02</internalNodes>\n          <leafValues>\n            -2.0280399918556213e-01 4.3768000602722168e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2659 -2.0873999223113060e-02</internalNodes>\n          <leafValues>\n            4.1469898819923401e-01 -4.5568000525236130e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2660 5.7888001203536987e-02</internalNodes>\n          <leafValues>\n            -2.9009999707341194e-02 -9.1822302341461182e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2661 1.3200000103097409e-04</internalNodes>\n          <leafValues>\n            -1.1772400140762329e-01 2.0000000298023224e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2662 -1.7137000337243080e-02</internalNodes>\n          <leafValues>\n            3.3004799485206604e-01 -2.3055200278759003e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2663 3.0655000358819962e-02</internalNodes>\n          <leafValues>\n            -2.1545000374317169e-02 2.6878198981285095e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2664 -7.8699999721720815e-04</internalNodes>\n          <leafValues>\n            -4.4100698828697205e-01 4.9157999455928802e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2665 8.8036999106407166e-02</internalNodes>\n          <leafValues>\n            1.1782000213861465e-01 -2.8293309211730957e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2666 -3.9028998464345932e-02</internalNodes>\n          <leafValues>\n            9.1777199506759644e-01 -1.5827399492263794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2667 8.0105997622013092e-02</internalNodes>\n          <leafValues>\n            1.1289200186729431e-01 -1.9937280416488647e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2668 3.9538998156785965e-02</internalNodes>\n          <leafValues>\n            -1.4357399940490723e-01 1.3085240125656128e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2669 2.0684000104665756e-02</internalNodes>\n          <leafValues>\n            2.0048099756240845e-01 -4.4186998158693314e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2670 -6.7037999629974365e-02</internalNodes>\n          <leafValues>\n            3.2618600130081177e-01 -2.0550400018692017e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2671 4.6815000474452972e-02</internalNodes>\n          <leafValues>\n            1.5825299918651581e-01 -9.5535099506378174e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2672 7.8443996608257294e-02</internalNodes>\n          <leafValues>\n            -7.4651002883911133e-02 -2.1161499023437500e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2673 6.6380001604557037e-02</internalNodes>\n          <leafValues>\n            1.1641900241374969e-01 -1.6113519668579102e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2674 3.0053999274969101e-02</internalNodes>\n          <leafValues>\n            -1.6562600433826447e-01 7.0025402307510376e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2675 1.7119999974966049e-02</internalNodes>\n          <leafValues>\n            2.2627699375152588e-01 -4.0114998817443848e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2676 2.0073000341653824e-02</internalNodes>\n          <leafValues>\n            -1.9389699399471283e-01 4.4420298933982849e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2677 3.3101998269557953e-02</internalNodes>\n          <leafValues>\n            1.1637499928474426e-01 -1.5771679878234863e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2678 -1.4882000163197517e-02</internalNodes>\n          <leafValues>\n            -8.9680302143096924e-01 -4.2010001838207245e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2679 -1.0281000286340714e-02</internalNodes>\n          <leafValues>\n            3.5602998733520508e-01 -1.3124000281095505e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2680 -2.8695000335574150e-02</internalNodes>\n          <leafValues>\n            -4.6039599180221558e-01 2.6801999658346176e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2681 -4.7189998440444469e-03</internalNodes>\n          <leafValues>\n            2.3788799345493317e-01 -6.5518997609615326e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2682 3.2201600074768066e-01</internalNodes>\n          <leafValues>\n            -2.8489999473094940e-02 -8.4234601259231567e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2683 -1.7045000568032265e-02</internalNodes>\n          <leafValues>\n            -5.0938802957534790e-01 1.6057600080966949e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2684 -7.3469998314976692e-03</internalNodes>\n          <leafValues>\n            -5.4154998064041138e-01 4.7320001758635044e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2685 -3.0001999810338020e-02</internalNodes>\n          <leafValues>\n            -8.8785797357559204e-01 1.3621799647808075e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2686 -1.1292999610304832e-02</internalNodes>\n          <leafValues>\n            8.0615198612213135e-01 -1.6159500181674957e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2687 4.7749998047947884e-03</internalNodes>\n          <leafValues>\n            1.2968000024557114e-02 5.5079901218414307e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2688 5.0710001960396767e-03</internalNodes>\n          <leafValues>\n            -4.5728001743555069e-02 -1.0766259431838989e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2689 1.9344100356101990e-01</internalNodes>\n          <leafValues>\n            7.1262001991271973e-02 1.1694519519805908e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2690 5.3750001825392246e-03</internalNodes>\n          <leafValues>\n            -1.9736200571060181e-01 3.8206899166107178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2691 -6.8276003003120422e-02</internalNodes>\n          <leafValues>\n            -5.4372339248657227e+00 1.1151900142431259e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2692 -3.4933000802993774e-02</internalNodes>\n          <leafValues>\n            4.4793400168418884e-01 -1.8657900393009186e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2693 5.1219998858869076e-03</internalNodes>\n          <leafValues>\n            -1.4871999621391296e-02 1.8413899838924408e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2694 9.5311999320983887e-02</internalNodes>\n          <leafValues>\n            -1.5117099881172180e-01 9.4991499185562134e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2695 -6.2849000096321106e-02</internalNodes>\n          <leafValues>\n            4.6473601460456848e-01 3.8405001163482666e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2696 -1.7040699720382690e-01</internalNodes>\n          <leafValues>\n            -1.6499999761581421e+00 -6.3236996531486511e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2697 1.0583999566733837e-02</internalNodes>\n          <leafValues>\n            -3.8348998874425888e-02 4.1913801431655884e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2698 -4.1579000651836395e-02</internalNodes>\n          <leafValues>\n            3.4461900591850281e-01 -2.1187700331211090e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2699 1.2718600034713745e-01</internalNodes>\n          <leafValues>\n            1.2398199737071991e-01 -2.1254889965057373e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2700 8.2557000219821930e-02</internalNodes>\n          <leafValues>\n            -6.2024001032114029e-02 -1.4875819683074951e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2701 8.5293002426624298e-02</internalNodes>\n          <leafValues>\n            1.7087999731302261e-02 3.2076600193977356e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2702 5.5544000118970871e-02</internalNodes>\n          <leafValues>\n            -2.7414000034332275e-01 1.8976399302482605e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2703 4.5650000683963299e-03</internalNodes>\n          <leafValues>\n            -1.7920200526714325e-01 2.7967301011085510e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2704 1.2997999787330627e-02</internalNodes>\n          <leafValues>\n            -3.2297500967979431e-01 2.6941800117492676e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2705 5.7891998440027237e-02</internalNodes>\n          <leafValues>\n            1.2644399702548981e-01 -6.0713499784469604e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2706 -2.2824000567197800e-02</internalNodes>\n          <leafValues>\n            -4.9682098627090454e-01 2.2376999258995056e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2707 4.8312000930309296e-02</internalNodes>\n          <leafValues>\n            4.3607000261545181e-02 4.8537799715995789e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2708 2.5714000687003136e-02</internalNodes>\n          <leafValues>\n            -4.2950998991727829e-02 -9.3023502826690674e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2709 6.9269998930394650e-03</internalNodes>\n          <leafValues>\n            -2.9680000152438879e-03 3.4296301007270813e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2710 -3.4446999430656433e-02</internalNodes>\n          <leafValues>\n            -1.5299769639968872e+00 -6.1014998704195023e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2711 2.9387999325990677e-02</internalNodes>\n          <leafValues>\n            3.7595998495817184e-02 6.4172399044036865e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2712 -2.4319998919963837e-03</internalNodes>\n          <leafValues>\n            9.9088996648788452e-02 -3.9688101410865784e-01</leafValues></_></weakClassifiers></_>\n    <_>\n      <maxWeakCount>200</maxWeakCount>\n      <stageThreshold>-2.9928278923034668e+00</stageThreshold>\n      <weakClassifiers>\n        <_>\n          <internalNodes>\n            0 -1 2713 -9.5944002270698547e-02</internalNodes>\n          <leafValues>\n            6.2419098615646362e-01 -4.5875200629234314e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2714 1.6834000125527382e-02</internalNodes>\n          <leafValues>\n            -9.3072801828384399e-01 2.1563600003719330e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2715 2.6049999520182610e-02</internalNodes>\n          <leafValues>\n            -4.0532299876213074e-01 4.2256599664688110e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2716 3.6500001442618668e-04</internalNodes>\n          <leafValues>\n            9.5288001000881195e-02 -6.3298100233078003e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2717 -6.6940002143383026e-03</internalNodes>\n          <leafValues>\n            3.7243801355361938e-01 -3.0332401394844055e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2718 1.8874000757932663e-02</internalNodes>\n          <leafValues>\n            -2.3357200622558594e-01 4.0330699086189270e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2719 -1.6300000424962491e-04</internalNodes>\n          <leafValues>\n            4.2886998504400253e-02 -7.7796798944473267e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2720 -7.6259002089500427e-02</internalNodes>\n          <leafValues>\n            -4.9628499150276184e-01 1.6335399448871613e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2721 5.0149001181125641e-02</internalNodes>\n          <leafValues>\n            3.2747000455856323e-02 -8.0047899484634399e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2722 -2.9239999130368233e-03</internalNodes>\n          <leafValues>\n            -5.0002801418304443e-01 2.5480601191520691e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2723 1.6243999823927879e-02</internalNodes>\n          <leafValues>\n            3.8913000375032425e-02 -7.0724898576736450e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2724 3.7811998277902603e-02</internalNodes>\n          <leafValues>\n            -6.6267997026443481e-02 7.3868799209594727e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2725 -1.2319999746978283e-02</internalNodes>\n          <leafValues>\n            4.8696398735046387e-01 -2.4485599994659424e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2726 5.8003999292850494e-02</internalNodes>\n          <leafValues>\n            1.3459099829196930e-01 -1.3232100009918213e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2727 4.8630000092089176e-03</internalNodes>\n          <leafValues>\n            -4.4172900915145874e-01 1.4005599915981293e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2728 4.5690998435020447e-02</internalNodes>\n          <leafValues>\n            3.1217999756336212e-02 8.9818298816680908e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2729 2.1321000531315804e-02</internalNodes>\n          <leafValues>\n            1.2008000165224075e-02 -8.6066198348999023e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2730 1.5679100155830383e-01</internalNodes>\n          <leafValues>\n            1.4055999927222729e-02 8.5332900285720825e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2731 -1.0328999720513821e-02</internalNodes>\n          <leafValues>\n            2.9022800922393799e-01 -2.9478800296783447e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2732 2.4290001019835472e-03</internalNodes>\n          <leafValues>\n            -4.0439900755882263e-01 1.9400200247764587e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2733 -2.3338999599218369e-02</internalNodes>\n          <leafValues>\n            3.2945200800895691e-01 -2.5712698698043823e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2734 -6.8970001302659512e-03</internalNodes>\n          <leafValues>\n            -5.3352999687194824e-01 2.1635200083255768e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2735 -3.4403000026941299e-02</internalNodes>\n          <leafValues>\n            -1.4425489902496338e+00 -4.4682998210191727e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2736 -2.1235000342130661e-02</internalNodes>\n          <leafValues>\n            -7.9017502069473267e-01 1.9084100425243378e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2737 2.0620001014322042e-03</internalNodes>\n          <leafValues>\n            -2.6931199431419373e-01 3.1488001346588135e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2738 -4.2190002277493477e-03</internalNodes>\n          <leafValues>\n            -5.4464399814605713e-01 1.6574600338935852e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2739 -1.4334999956190586e-02</internalNodes>\n          <leafValues>\n            2.2105000913143158e-02 -6.2342500686645508e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2740 -8.2120001316070557e-03</internalNodes>\n          <leafValues>\n            -4.9884998798370361e-01 1.9237099587917328e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2741 -9.3350000679492950e-03</internalNodes>\n          <leafValues>\n            -7.9131197929382324e-01 -1.4143999665975571e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2742 -3.7937998771667480e-02</internalNodes>\n          <leafValues>\n            7.9841297864913940e-01 -3.3799000084400177e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2743 4.7059999778866768e-03</internalNodes>\n          <leafValues>\n            -3.3163401484489441e-01 2.0726299285888672e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2744 -4.4499998912215233e-03</internalNodes>\n          <leafValues>\n            -2.7256301045417786e-01 1.8402199447154999e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2745 5.2189999260008335e-03</internalNodes>\n          <leafValues>\n            -5.3096002340316772e-01 5.2607998251914978e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2746 -9.5399999991059303e-03</internalNodes>\n          <leafValues>\n            -5.6485402584075928e-01 1.9269399344921112e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2747 4.4969998300075531e-02</internalNodes>\n          <leafValues>\n            -1.7411500215530396e-01 9.5382601022720337e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2748 1.4209000393748283e-02</internalNodes>\n          <leafValues>\n            -9.1949000954627991e-02 2.4836100637912750e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2749 1.6380199790000916e-01</internalNodes>\n          <leafValues>\n            -5.8497000485658646e-02 -1.6404409408569336e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2750 2.5579999200999737e-03</internalNodes>\n          <leafValues>\n            2.3447999358177185e-01 -9.2734001576900482e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2751 -3.8499999791383743e-03</internalNodes>\n          <leafValues>\n            1.7880700528621674e-01 -3.5844099521636963e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2752 -2.5221999734640121e-02</internalNodes>\n          <leafValues>\n            -4.2903000116348267e-01 2.0244500041007996e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2753 -1.9415000453591347e-02</internalNodes>\n          <leafValues>\n            5.8016300201416016e-01 -1.8806399405002594e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2754 1.4419999904930592e-02</internalNodes>\n          <leafValues>\n            3.2846998423337936e-02 8.1980502605438232e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2755 5.1582999527454376e-02</internalNodes>\n          <leafValues>\n            6.9176003336906433e-02 -4.5866298675537109e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2756 -3.7960000336170197e-02</internalNodes>\n          <leafValues>\n            -1.2553000450134277e+00 1.4332899451255798e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2757 -2.9560999944806099e-02</internalNodes>\n          <leafValues>\n            5.3151798248291016e-01 -2.0596499741077423e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2758 -3.9110999554395676e-02</internalNodes>\n          <leafValues>\n            1.1658719778060913e+00 5.3897000849246979e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2759 -2.9159000143408775e-02</internalNodes>\n          <leafValues>\n            3.9307600259780884e-01 -2.2184500098228455e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2760 -8.3617001771926880e-02</internalNodes>\n          <leafValues>\n            -7.3744499683380127e-01 1.4268200099468231e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2761 4.2004001140594482e-01</internalNodes>\n          <leafValues>\n            -1.4277400076389313e-01 1.7894840240478516e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2762 6.0005001723766327e-02</internalNodes>\n          <leafValues>\n            1.1976700276136398e-01 -1.8886189460754395e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2763 -1.8981000408530235e-02</internalNodes>\n          <leafValues>\n            -1.4148449897766113e+00 -5.6522998958826065e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2764 -6.0049998573958874e-03</internalNodes>\n          <leafValues>\n            4.4170799851417542e-01 -1.0200800001621246e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2765 -5.8214001357555389e-02</internalNodes>\n          <leafValues>\n            -1.3918470144271851e+00 -4.8268999904394150e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2766 -1.2271000072360039e-02</internalNodes>\n          <leafValues>\n            5.1317697763442993e-01 -9.3696996569633484e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2767 4.6585999429225922e-02</internalNodes>\n          <leafValues>\n            -5.7484000921249390e-02 -1.4283169507980347e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2768 1.2110000243410468e-03</internalNodes>\n          <leafValues>\n            -8.0891996622085571e-02 3.2333201169967651e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2769 -8.8642001152038574e-02</internalNodes>\n          <leafValues>\n            -8.6449098587036133e-01 -3.3146999776363373e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2770 -2.3184999823570251e-02</internalNodes>\n          <leafValues>\n            5.2162200212478638e-01 -1.6168000176548958e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2771 4.3090000748634338e-02</internalNodes>\n          <leafValues>\n            -1.6153800487518311e-01 1.0915000438690186e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2772 2.0599999697878957e-04</internalNodes>\n          <leafValues>\n            -1.7091499269008636e-01 3.1236699223518372e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2773 8.9159999042749405e-03</internalNodes>\n          <leafValues>\n            -6.7039998248219490e-03 -6.8810397386550903e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2774 -1.7752999439835548e-02</internalNodes>\n          <leafValues>\n            6.3292801380157471e-01 -4.2360001243650913e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2775 6.2299999408423901e-03</internalNodes>\n          <leafValues>\n            -3.3637198805809021e-01 1.2790599465370178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2776 2.2770000621676445e-02</internalNodes>\n          <leafValues>\n            -3.4703999757766724e-02 3.9141800999641418e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2777 -2.1534999832510948e-02</internalNodes>\n          <leafValues>\n            6.4765101671218872e-01 -2.0097799599170685e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2778 6.1758998781442642e-02</internalNodes>\n          <leafValues>\n            5.4297000169754028e-02 9.0700101852416992e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2779 -7.8069999814033508e-02</internalNodes>\n          <leafValues>\n            6.5523397922515869e-01 -1.9754399359226227e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2780 1.1315000243484974e-02</internalNodes>\n          <leafValues>\n            1.9385300576686859e-01 -5.1707297563552856e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2781 -2.5590000674128532e-02</internalNodes>\n          <leafValues>\n            -9.3096500635147095e-01 -3.1546998769044876e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2782 -3.8058999925851822e-02</internalNodes>\n          <leafValues>\n            -6.8326902389526367e-01 1.2709100544452667e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2783 9.7970003262162209e-03</internalNodes>\n          <leafValues>\n            1.5523999929428101e-02 -6.3347899913787842e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2784 -1.3841999694705009e-02</internalNodes>\n          <leafValues>\n            1.0060529708862305e+00 6.2812998890876770e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2785 8.3459997549653053e-03</internalNodes>\n          <leafValues>\n            -2.3383200168609619e-01 3.0982699990272522e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2786 -7.1439996361732483e-02</internalNodes>\n          <leafValues>\n            -7.2505402565002441e-01 1.7148299515247345e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2787 1.0006000287830830e-02</internalNodes>\n          <leafValues>\n            -2.2071999311447144e-01 3.5266199707984924e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2788 1.1005300283432007e-01</internalNodes>\n          <leafValues>\n            1.6662000119686127e-01 -7.4318999052047729e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2789 3.5310998558998108e-02</internalNodes>\n          <leafValues>\n            -2.3982700705528259e-01 4.1435998678207397e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2790 -1.1174699664115906e-01</internalNodes>\n          <leafValues>\n            5.1045399904251099e-01 2.2319999989122152e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2791 -1.1367800086736679e-01</internalNodes>\n          <leafValues>\n            9.0475201606750488e-01 -1.6615299880504608e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2792 1.6667999327182770e-02</internalNodes>\n          <leafValues>\n            1.4024500548839569e-01 -5.2178502082824707e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2793 -8.0340001732110977e-03</internalNodes>\n          <leafValues>\n            -6.6178399324417114e-01 3.7640000227838755e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2794 -3.3096998929977417e-02</internalNodes>\n          <leafValues>\n            8.0185902118682861e-01 5.9385001659393311e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2795 1.2547999620437622e-02</internalNodes>\n          <leafValues>\n            -3.3545500040054321e-01 1.4578600227832794e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2796 -4.2073998600244522e-02</internalNodes>\n          <leafValues>\n            -5.5509102344512939e-01 1.3266600668430328e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2797 2.5221999734640121e-02</internalNodes>\n          <leafValues>\n            -6.1631999909877777e-02 -1.3678770065307617e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2798 -2.4268999695777893e-02</internalNodes>\n          <leafValues>\n            3.4185099601745605e-01 -7.4160001240670681e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2799 -1.2280000373721123e-02</internalNodes>\n          <leafValues>\n            2.7745801210403442e-01 -3.1033900380134583e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2800 -1.1377099901437759e-01</internalNodes>\n          <leafValues>\n            1.1719540357589722e+00 8.3681002259254456e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2801 -8.4771998226642609e-02</internalNodes>\n          <leafValues>\n            8.1694799661636353e-01 -1.7837500572204590e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2802 -2.4552000686526299e-02</internalNodes>\n          <leafValues>\n            -1.8627299368381500e-01 1.4340099692344666e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2803 -9.0269995853304863e-03</internalNodes>\n          <leafValues>\n            3.2659199833869934e-01 -2.3541299998760223e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2804 1.1177999898791313e-02</internalNodes>\n          <leafValues>\n            1.9761200249195099e-01 -2.1701000630855560e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2805 -2.9366999864578247e-02</internalNodes>\n          <leafValues>\n            -9.3414801359176636e-01 -2.1704999729990959e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2806 6.3640000298619270e-03</internalNodes>\n          <leafValues>\n            2.5573000311851501e-02 4.6412798762321472e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2807 1.4026000164449215e-02</internalNodes>\n          <leafValues>\n            -2.1228599548339844e-01 4.0078800916671753e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2808 -1.3341999612748623e-02</internalNodes>\n          <leafValues>\n            7.4202698469161987e-01 2.9001999646425247e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2809 2.8422799706459045e-01</internalNodes>\n          <leafValues>\n            -1.9243599474430084e-01 4.3631199002265930e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2810 -2.3724000155925751e-01</internalNodes>\n          <leafValues>\n            6.9736397266387939e-01 6.9307997822761536e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2811 -1.1169700324535370e-01</internalNodes>\n          <leafValues>\n            3.9147201180458069e-01 -2.0922000706195831e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2812 1.2787500023841858e-01</internalNodes>\n          <leafValues>\n            -7.2555996477603912e-02 3.6088201403617859e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2813 -6.2900997698307037e-02</internalNodes>\n          <leafValues>\n            9.5424997806549072e-01 -1.5402799844741821e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2814 1.7439000308513641e-02</internalNodes>\n          <leafValues>\n            -5.1134999841451645e-02 2.7750301361083984e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2815 1.2319999514147639e-03</internalNodes>\n          <leafValues>\n            7.5627997517585754e-02 -3.6456099152565002e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2816 2.7495000511407852e-02</internalNodes>\n          <leafValues>\n            5.1844000816345215e-02 4.1562598943710327e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2817 -4.3543998152017593e-02</internalNodes>\n          <leafValues>\n            7.1969997882843018e-01 -1.7132200300693512e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2818 1.1025999672710896e-02</internalNodes>\n          <leafValues>\n            1.4354600012302399e-01 -6.5403002500534058e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2819 2.0865999162197113e-02</internalNodes>\n          <leafValues>\n            4.0089000016450882e-02 -4.5743298530578613e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2820 -2.2304000332951546e-02</internalNodes>\n          <leafValues>\n            5.3855001926422119e-01 7.1662999689579010e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2821 3.2492000609636307e-02</internalNodes>\n          <leafValues>\n            -4.5991998165845871e-02 -1.0047069787979126e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2822 1.2269999831914902e-02</internalNodes>\n          <leafValues>\n            3.4334998577833176e-02 4.2431798577308655e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2823 8.3820000290870667e-03</internalNodes>\n          <leafValues>\n            -2.5850600004196167e-01 2.6263499259948730e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2824 3.7353999912738800e-02</internalNodes>\n          <leafValues>\n            1.5692499279975891e-01 -1.0429090261459351e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2825 -1.4111000113189220e-02</internalNodes>\n          <leafValues>\n            -7.3177701234817505e-01 -2.0276999101042747e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2826 5.7066999375820160e-02</internalNodes>\n          <leafValues>\n            8.3360001444816589e-02 1.5661499500274658e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2827 4.9680001102387905e-03</internalNodes>\n          <leafValues>\n            -3.5318198800086975e-01 1.4698399603366852e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2828 -2.4492999538779259e-02</internalNodes>\n          <leafValues>\n            2.8325900435447693e-01 -3.4640000667423010e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2829 -1.1254999786615372e-02</internalNodes>\n          <leafValues>\n            -8.4017497301101685e-01 -3.6251999437808990e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2830 3.4533001482486725e-02</internalNodes>\n          <leafValues>\n            1.4998500049114227e-01 -8.7367099523544312e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2831 2.4303000420331955e-02</internalNodes>\n          <leafValues>\n            -1.8787500262260437e-01 5.9483999013900757e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2832 -7.8790001571178436e-03</internalNodes>\n          <leafValues>\n            4.4315698742866516e-01 -5.6570999324321747e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2833 3.5142000764608383e-02</internalNodes>\n          <leafValues>\n            -5.6494999676942825e-02 -1.3617190122604370e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2834 4.6259998343884945e-03</internalNodes>\n          <leafValues>\n            -3.1161698698997498e-01 2.5447699427604675e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2835 -8.3131000399589539e-02</internalNodes>\n          <leafValues>\n            1.6424349546432495e+00 -1.4429399371147156e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2836 -1.4015999622642994e-02</internalNodes>\n          <leafValues>\n            -7.7819502353668213e-01 1.7173300683498383e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2837 1.2450000504031777e-03</internalNodes>\n          <leafValues>\n            -2.3191399872303009e-01 2.8527900576591492e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2838 -1.6803000122308731e-02</internalNodes>\n          <leafValues>\n            -3.5965099930763245e-01 2.0412999391555786e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2839 -7.6747998595237732e-02</internalNodes>\n          <leafValues>\n            7.8050500154495239e-01 -1.5612800419330597e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2840 -2.3671999573707581e-01</internalNodes>\n          <leafValues>\n            1.1813700199127197e+00 7.8111998736858368e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2841 -1.0057400166988373e-01</internalNodes>\n          <leafValues>\n            -4.7104099392890930e-01 7.9172998666763306e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2842 1.3239999534562230e-03</internalNodes>\n          <leafValues>\n            2.2262699902057648e-01 -3.7099799513816833e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2843 2.2152999415993690e-02</internalNodes>\n          <leafValues>\n            -3.8649000227451324e-02 -9.2274999618530273e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2844 -1.1246199905872345e-01</internalNodes>\n          <leafValues>\n            4.1899600625038147e-01 8.0411002039909363e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2845 1.6481000930070877e-02</internalNodes>\n          <leafValues>\n            -1.6756699979305267e-01 7.1842402219772339e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2846 6.8113997578620911e-02</internalNodes>\n          <leafValues>\n            1.5719899535179138e-01 -8.7681102752685547e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2847 1.6011999920010567e-02</internalNodes>\n          <leafValues>\n            -4.1600000113248825e-03 -5.9327799081802368e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2848 4.6640001237392426e-03</internalNodes>\n          <leafValues>\n            -3.0153999105095863e-02 4.8345300555229187e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2849 6.7579997703433037e-03</internalNodes>\n          <leafValues>\n            -2.2667400538921356e-01 3.3662301301956177e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2850 4.7289999201893806e-03</internalNodes>\n          <leafValues>\n            -6.0373999178409576e-02 3.1458100676536560e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2851 2.5869999080896378e-03</internalNodes>\n          <leafValues>\n            -2.9872599244117737e-01 1.7787499725818634e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2852 2.8989999555051327e-03</internalNodes>\n          <leafValues>\n            2.1890200674533844e-01 -2.9567098617553711e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2853 -3.0053999274969101e-02</internalNodes>\n          <leafValues>\n            1.2150429487228394e+00 -1.4354999363422394e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2854 1.4181000180542469e-02</internalNodes>\n          <leafValues>\n            1.2451999820768833e-02 5.5490100383758545e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2855 -6.0527000576257706e-02</internalNodes>\n          <leafValues>\n            -1.4933999776840210e+00 -6.5227001905441284e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2856 -1.9882999360561371e-02</internalNodes>\n          <leafValues>\n            -3.8526400923728943e-01 1.9761200249195099e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2857 3.1218999996781349e-02</internalNodes>\n          <leafValues>\n            -2.1281200647354126e-01 2.9446500539779663e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2858 1.8271999433636665e-02</internalNodes>\n          <leafValues>\n            9.7200000891461968e-04 6.6814202070236206e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2859 1.1089999461546540e-03</internalNodes>\n          <leafValues>\n            -6.2467902898788452e-01 -1.6599999507889152e-03</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2860 -3.6713998764753342e-02</internalNodes>\n          <leafValues>\n            -4.2333900928497314e-01 1.2084700167179108e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2861 1.2044000439345837e-02</internalNodes>\n          <leafValues>\n            2.5882000103592873e-02 -5.0732398033142090e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2862 7.4749000370502472e-02</internalNodes>\n          <leafValues>\n            1.3184699416160583e-01 -2.1739600598812103e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2863 -2.3473200201988220e-01</internalNodes>\n          <leafValues>\n            1.1775610446929932e+00 -1.5114699304103851e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2864 1.4096499979496002e-01</internalNodes>\n          <leafValues>\n            3.3991001546382904e-02 3.9923098683357239e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2865 6.1789997853338718e-03</internalNodes>\n          <leafValues>\n            -3.1806701421737671e-01 1.1681699752807617e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2866 -5.7216998189687729e-02</internalNodes>\n          <leafValues>\n            8.4399098157882690e-01 8.3889000117778778e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2867 -5.5227000266313553e-02</internalNodes>\n          <leafValues>\n            3.6888301372528076e-01 -1.8913400173187256e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2868 -2.1583000198006630e-02</internalNodes>\n          <leafValues>\n            -5.2161800861358643e-01 1.5772600471973419e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2869 2.5747999548912048e-02</internalNodes>\n          <leafValues>\n            -5.9921998530626297e-02 -1.0674990415573120e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2870 -1.3098999857902527e-02</internalNodes>\n          <leafValues>\n            7.8958398103713989e-01 5.2099999040365219e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2871 2.2799998987466097e-03</internalNodes>\n          <leafValues>\n            -1.1704430580139160e+00 -5.9356998652219772e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2872 8.8060004636645317e-03</internalNodes>\n          <leafValues>\n            4.1717998683452606e-02 6.6352599859237671e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2873 -8.9699998497962952e-03</internalNodes>\n          <leafValues>\n            -3.5862699151039124e-01 6.0458000749349594e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2874 4.0230001322925091e-03</internalNodes>\n          <leafValues>\n            2.0979399979114532e-01 -2.4806000292301178e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2875 2.5017000734806061e-02</internalNodes>\n          <leafValues>\n            -1.8795900046825409e-01 3.9547100663185120e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2876 -5.9009999968111515e-03</internalNodes>\n          <leafValues>\n            2.5663900375366211e-01 -9.4919003546237946e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2877 4.3850000947713852e-03</internalNodes>\n          <leafValues>\n            3.3139001578092575e-02 -4.6075400710105896e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2878 -3.3771999180316925e-02</internalNodes>\n          <leafValues>\n            -9.8881602287292480e-01 1.4636899530887604e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2879 4.4523000717163086e-02</internalNodes>\n          <leafValues>\n            -1.3286699354648590e-01 1.5796790122985840e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2880 -4.0929000824689865e-02</internalNodes>\n          <leafValues>\n            3.3877098560333252e-01 7.4970997869968414e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2881 3.9351999759674072e-02</internalNodes>\n          <leafValues>\n            -1.8327899277210236e-01 4.6980699896812439e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2882 -7.0322997868061066e-02</internalNodes>\n          <leafValues>\n            -9.8322701454162598e-01 1.1808100342750549e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2883 3.5743001848459244e-02</internalNodes>\n          <leafValues>\n            -3.3050999045372009e-02 -8.3610898256301880e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2884 -4.2961999773979187e-02</internalNodes>\n          <leafValues>\n            1.1670809984207153e+00 8.0692000687122345e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2885 -2.1007999777793884e-02</internalNodes>\n          <leafValues>\n            6.3869798183441162e-01 -1.7626300454139709e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2886 -1.5742200613021851e-01</internalNodes>\n          <leafValues>\n            -2.3302499949932098e-01 1.2517499923706055e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2887 7.8659998252987862e-03</internalNodes>\n          <leafValues>\n            -2.2037999331951141e-01 2.7196800708770752e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2888 2.3622000589966774e-02</internalNodes>\n          <leafValues>\n            1.6127300262451172e-01 -4.3329000473022461e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2889 7.4692003428936005e-02</internalNodes>\n          <leafValues>\n            -1.6991999745368958e-01 5.8884900808334351e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2890 -6.4799998654052615e-04</internalNodes>\n          <leafValues>\n            2.5842899084091187e-01 -3.5911999642848969e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2891 -1.6290999948978424e-02</internalNodes>\n          <leafValues>\n            -7.6764398813247681e-01 -2.0472999662160873e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2892 -3.3133998513221741e-02</internalNodes>\n          <leafValues>\n            -2.7180099487304688e-01 1.4325700700283051e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2893 4.8797998577356339e-02</internalNodes>\n          <leafValues>\n            7.6408997178077698e-02 -4.1445198655128479e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2894 2.2869999520480633e-03</internalNodes>\n          <leafValues>\n            -3.8628999143838882e-02 2.0753799378871918e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2895 4.5304000377655029e-02</internalNodes>\n          <leafValues>\n            -1.7777900397777557e-01 6.3461399078369141e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2896 1.0705800354480743e-01</internalNodes>\n          <leafValues>\n            1.8972299993038177e-01 -5.1236200332641602e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2897 -4.0525000542402267e-02</internalNodes>\n          <leafValues>\n            7.0614999532699585e-01 -1.7803299427032471e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2898 3.1968999654054642e-02</internalNodes>\n          <leafValues>\n            6.8149998784065247e-02 6.8733102083206177e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2899 -5.7617001235485077e-02</internalNodes>\n          <leafValues>\n            7.5170499086380005e-01 -1.5764999389648438e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2900 1.3593999668955803e-02</internalNodes>\n          <leafValues>\n            1.9411900639533997e-01 -2.4561899900436401e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2901 7.1396000683307648e-02</internalNodes>\n          <leafValues>\n            -4.6881001442670822e-02 -8.8198298215866089e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2902 -1.4895999804139137e-02</internalNodes>\n          <leafValues>\n            -4.4532400369644165e-01 1.7679899930953979e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2903 -1.0026000440120697e-02</internalNodes>\n          <leafValues>\n            6.5122699737548828e-01 -1.6709999740123749e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2904 3.7589999847114086e-03</internalNodes>\n          <leafValues>\n            -5.8301001787185669e-02 3.4483298659324646e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2905 1.6263000667095184e-02</internalNodes>\n          <leafValues>\n            -1.5581500530242920e-01 8.6432701349258423e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2906 -4.0176000446081161e-02</internalNodes>\n          <leafValues>\n            -6.1028599739074707e-01 1.1796399950981140e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2907 2.7080999687314034e-02</internalNodes>\n          <leafValues>\n            -4.9601998180150986e-02 -8.9990001916885376e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2908 5.2420001477003098e-02</internalNodes>\n          <leafValues>\n            1.1297199875116348e-01 -1.0833640098571777e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2909 -1.9160000607371330e-02</internalNodes>\n          <leafValues>\n            -7.9880100488662720e-01 -3.4079000353813171e-02</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2910 -3.7730000913143158e-03</internalNodes>\n          <leafValues>\n            -1.9124099612236023e-01 2.1535199880599976e-01</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2911 7.5762003660202026e-02</internalNodes>\n          <leafValues>\n            -1.3421699404716492e-01 1.6807060241699219e+00</leafValues></_>\n        <_>\n          <internalNodes>\n            0 -1 2912 -2.2173000499606133e-02</internalNodes>\n          <leafValues>\n            4.8600998520851135e-01 3.6160000599920750e-03</leafValues></_></weakClassifiers></_></stages>\n  <features>\n    <_>\n      <rects>\n        <_>\n          6 4 12 9 -1.</_>\n        <_>\n          6 7 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 7 -1.</_>\n        <_>\n          10 4 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 9 -1.</_>\n        <_>\n          3 12 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 9 6 -1.</_>\n        <_>\n          8 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 4 19 -1.</_>\n        <_>\n          5 5 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 16 -1.</_>\n        <_>\n          6 13 12 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 12 6 -1.</_>\n        <_>\n          5 11 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 4 10 -1.</_>\n        <_>\n          11 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 7 6 -1.</_>\n        <_>\n          4 3 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 6 -1.</_>\n        <_>\n          6 8 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 7 -1.</_>\n        <_>\n          10 4 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 19 12 -1.</_>\n        <_>\n          1 12 19 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 3 -1.</_>\n        <_>\n          8 2 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 15 -1.</_>\n        <_>\n          9 14 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 10 -1.</_>\n        <_>\n          5 11 14 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 14 9 -1.</_>\n        <_>\n          5 3 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 9 6 -1.</_>\n        <_>\n          16 11 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 10 -1.</_>\n        <_>\n          9 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 6 10 -1.</_>\n        <_>\n          12 8 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 4 9 -1.</_>\n        <_>\n          4 5 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 11 -1.</_>\n        <_>\n          20 0 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 13 -1.</_>\n        <_>\n          8 6 8 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 18 10 6 -1.</_>\n        <_>\n          7 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 14 12 -1.</_>\n        <_>\n          5 13 14 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 3 -1.</_>\n        <_>\n          8 3 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 15 6 -1.</_>\n        <_>\n          5 11 15 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 5 14 -1.</_>\n        <_>\n          9 13 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 6 10 -1.</_>\n        <_>\n          11 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 3 12 -1.</_>\n        <_>\n          6 12 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          9 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 13 6 -1.</_>\n        <_>\n          5 8 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 15 -1.</_>\n        <_>\n          18 1 3 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 6 15 -1.</_>\n        <_>\n          4 1 3 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 24 15 -1.</_>\n        <_>\n          8 8 8 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 12 -1.</_>\n        <_>\n          5 6 7 6 2.</_>\n        <_>\n          12 12 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 21 12 -1.</_>\n        <_>\n          2 16 21 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 4 10 -1.</_>\n        <_>\n          10 1 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 20 10 -1.</_>\n        <_>\n          2 13 10 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 13 -1.</_>\n        <_>\n          2 1 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 2 4 13 -1.</_>\n        <_>\n          20 2 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 22 19 -1.</_>\n        <_>\n          11 5 11 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 9 -1.</_>\n        <_>\n          20 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 11 -1.</_>\n        <_>\n          2 3 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 4 9 -1.</_>\n        <_>\n          12 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 19 3 -1.</_>\n        <_>\n          0 7 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 4 9 -1.</_>\n        <_>\n          12 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 4 9 -1.</_>\n        <_>\n          10 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 14 14 -1.</_>\n        <_>\n          12 5 7 7 2.</_>\n        <_>\n          5 12 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 2 -1.</_>\n        <_>\n          1 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 13 4 11 -1.</_>\n        <_>\n          17 13 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 6 9 -1.</_>\n        <_>\n          0 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 9 -1.</_>\n        <_>\n          6 7 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 6 -1.</_>\n        <_>\n          10 5 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 5 -1.</_>\n        <_>\n          8 1 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 18 6 -1.</_>\n        <_>\n          4 12 18 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 17 12 6 -1.</_>\n        <_>\n          2 17 6 3 2.</_>\n        <_>\n          8 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 3 4 13 -1.</_>\n        <_>\n          19 3 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 4 13 -1.</_>\n        <_>\n          3 3 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 23 -1.</_>\n        <_>\n          8 1 8 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 8 12 -1.</_>\n        <_>\n          1 11 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 7 3 14 -1.</_>\n        <_>\n          14 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 16 6 -1.</_>\n        <_>\n          3 12 8 3 2.</_>\n        <_>\n          11 15 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 6 -1.</_>\n        <_>\n          6 8 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 6 12 -1.</_>\n        <_>\n          8 13 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 18 3 -1.</_>\n        <_>\n          1 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 16 12 -1.</_>\n        <_>\n          4 10 16 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 4 20 -1.</_>\n        <_>\n          2 1 2 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 2 -1.</_>\n        <_>\n          3 1 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 20 14 -1.</_>\n        <_>\n          1 5 10 7 2.</_>\n        <_>\n          11 12 10 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 14 12 -1.</_>\n        <_>\n          5 12 14 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 7 9 -1.</_>\n        <_>\n          3 17 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 9 6 -1.</_>\n        <_>\n          14 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 9 6 -1.</_>\n        <_>\n          1 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 8 10 -1.</_>\n        <_>\n          15 6 4 5 2.</_>\n        <_>\n          11 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 14 14 -1.</_>\n        <_>\n          5 5 7 7 2.</_>\n        <_>\n          12 12 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 5 -1.</_>\n        <_>\n          10 0 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          9 3 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 18 4 -1.</_>\n        <_>\n          9 8 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 9 -1.</_>\n        <_>\n          6 3 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 6 -1.</_>\n        <_>\n          8 0 8 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 16 12 -1.</_>\n        <_>\n          4 11 16 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 6 6 -1.</_>\n        <_>\n          11 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 24 3 -1.</_>\n        <_>\n          8 20 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 15 4 -1.</_>\n        <_>\n          9 13 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 12 -1.</_>\n        <_>\n          9 18 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 22 18 2 -1.</_>\n        <_>\n          1 23 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 4 10 -1.</_>\n        <_>\n          10 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 8 10 -1.</_>\n        <_>\n          6 12 8 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 10 4 -1.</_>\n        <_>\n          0 16 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 2 -1.</_>\n        <_>\n          6 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 22 3 -1.</_>\n        <_>\n          1 2 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 6 15 -1.</_>\n        <_>\n          5 4 3 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 4 4 10 -1.</_>\n        <_>\n          20 4 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 4 10 -1.</_>\n        <_>\n          2 4 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 20 6 -1.</_>\n        <_>\n          12 16 10 3 2.</_>\n        <_>\n          2 19 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 8 9 -1.</_>\n        <_>\n          4 12 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 6 6 -1.</_>\n        <_>\n          8 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 8 12 6 -1.</_>\n        <_>\n          17 8 6 3 2.</_>\n        <_>\n          11 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 12 6 -1.</_>\n        <_>\n          0 8 6 3 2.</_>\n        <_>\n          6 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 9 6 -1.</_>\n        <_>\n          8 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 6 -1.</_>\n        <_>\n          0 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 6 10 -1.</_>\n        <_>\n          12 8 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 19 12 3 -1.</_>\n        <_>\n          9 19 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 20 2 -1.</_>\n        <_>\n          2 11 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 18 12 -1.</_>\n        <_>\n          2 9 9 6 2.</_>\n        <_>\n          11 15 9 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 24 -1.</_>\n        <_>\n          3 0 9 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 10 -1.</_>\n        <_>\n          5 6 7 5 2.</_>\n        <_>\n          12 11 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 10 12 -1.</_>\n        <_>\n          14 5 5 6 2.</_>\n        <_>\n          9 11 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 12 12 -1.</_>\n        <_>\n          4 5 6 6 2.</_>\n        <_>\n          10 11 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 18 3 -1.</_>\n        <_>\n          4 15 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 13 8 8 -1.</_>\n        <_>\n          6 17 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 18 6 -1.</_>\n        <_>\n          3 19 18 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 6 -1.</_>\n        <_>\n          3 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 18 -1.</_>\n        <_>\n          10 6 4 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 4 14 -1.</_>\n        <_>\n          8 1 2 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 19 2 -1.</_>\n        <_>\n          3 3 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 22 13 -1.</_>\n        <_>\n          12 8 11 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 11 4 -1.</_>\n        <_>\n          8 11 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 15 10 -1.</_>\n        <_>\n          5 12 5 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 12 6 -1.</_>\n        <_>\n          16 16 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 12 6 -1.</_>\n        <_>\n          4 16 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 1 5 12 -1.</_>\n        <_>\n          19 5 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          8 2 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 4 -1.</_>\n        <_>\n          6 10 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 9 6 -1.</_>\n        <_>\n          10 5 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 17 6 6 -1.</_>\n        <_>\n          9 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 22 15 -1.</_>\n        <_>\n          0 12 22 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 17 9 -1.</_>\n        <_>\n          4 4 17 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 10 -1.</_>\n        <_>\n          9 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 8 -1.</_>\n        <_>\n          18 1 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 7 -1.</_>\n        <_>\n          3 1 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 22 -1.</_>\n        <_>\n          18 0 3 22 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 22 -1.</_>\n        <_>\n          3 0 3 22 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 7 8 16 -1.</_>\n        <_>\n          16 7 4 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 19 6 -1.</_>\n        <_>\n          2 12 19 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 12 -1.</_>\n        <_>\n          9 13 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 17 6 -1.</_>\n        <_>\n          2 17 17 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 7 3 14 -1.</_>\n        <_>\n          14 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 8 10 -1.</_>\n        <_>\n          5 6 4 5 2.</_>\n        <_>\n          9 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 9 11 -1.</_>\n        <_>\n          18 8 3 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 9 11 -1.</_>\n        <_>\n          3 8 3 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 10 18 -1.</_>\n        <_>\n          8 15 10 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 3 14 -1.</_>\n        <_>\n          7 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 24 8 -1.</_>\n        <_>\n          8 14 8 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 14 -1.</_>\n        <_>\n          10 10 9 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 6 6 -1.</_>\n        <_>\n          14 15 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 16 -1.</_>\n        <_>\n          7 0 5 8 2.</_>\n        <_>\n          12 8 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 9 6 -1.</_>\n        <_>\n          13 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 4 -1.</_>\n        <_>\n          12 3 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 9 6 -1.</_>\n        <_>\n          13 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 20 4 -1.</_>\n        <_>\n          1 1 10 2 2.</_>\n        <_>\n          11 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 9 6 -1.</_>\n        <_>\n          13 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 9 6 -1.</_>\n        <_>\n          8 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 10 6 -1.</_>\n        <_>\n          8 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 6 9 -1.</_>\n        <_>\n          8 3 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 12 6 -1.</_>\n        <_>\n          7 5 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 18 3 -1.</_>\n        <_>\n          0 11 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 22 3 -1.</_>\n        <_>\n          1 11 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 8 8 -1.</_>\n        <_>\n          9 11 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 11 6 6 -1.</_>\n        <_>\n          12 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 6 6 -1.</_>\n        <_>\n          9 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 10 11 6 -1.</_>\n        <_>\n          7 12 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 24 4 -1.</_>\n        <_>\n          0 13 12 2 2.</_>\n        <_>\n          12 15 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 22 12 -1.</_>\n        <_>\n          13 4 11 6 2.</_>\n        <_>\n          2 10 11 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 20 17 -1.</_>\n        <_>\n          12 0 10 17 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 2 24 -1.</_>\n        <_>\n          14 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 2 24 -1.</_>\n        <_>\n          9 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 1 2 22 -1.</_>\n        <_>\n          14 1 1 22 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 2 22 -1.</_>\n        <_>\n          9 1 1 22 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 6 3 18 -1.</_>\n        <_>\n          18 6 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 14 9 6 -1.</_>\n        <_>\n          6 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 14 9 4 -1.</_>\n        <_>\n          13 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 18 3 -1.</_>\n        <_>\n          3 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 8 18 -1.</_>\n        <_>\n          13 4 4 9 2.</_>\n        <_>\n          9 13 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 12 4 -1.</_>\n        <_>\n          6 2 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 14 6 -1.</_>\n        <_>\n          6 11 14 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 6 -1.</_>\n        <_>\n          10 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 6 16 -1.</_>\n        <_>\n          10 13 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 9 16 -1.</_>\n        <_>\n          4 4 3 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 18 9 -1.</_>\n        <_>\n          5 3 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 5 8 -1.</_>\n        <_>\n          9 19 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 0 4 9 -1.</_>\n        <_>\n          20 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 18 3 -1.</_>\n        <_>\n          2 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 22 19 2 -1.</_>\n        <_>\n          5 23 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 4 9 -1.</_>\n        <_>\n          2 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 19 18 -1.</_>\n        <_>\n          5 12 19 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 9 -1.</_>\n        <_>\n          2 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 14 12 -1.</_>\n        <_>\n          13 5 7 6 2.</_>\n        <_>\n          6 11 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 20 2 -1.</_>\n        <_>\n          0 2 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 3 -1.</_>\n        <_>\n          1 3 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 7 9 -1.</_>\n        <_>\n          2 11 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 22 4 -1.</_>\n        <_>\n          13 12 11 2 2.</_>\n        <_>\n          2 14 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 22 4 -1.</_>\n        <_>\n          0 12 11 2 2.</_>\n        <_>\n          11 14 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 6 11 -1.</_>\n        <_>\n          11 7 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 9 6 -1.</_>\n        <_>\n          10 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 4 10 -1.</_>\n        <_>\n          11 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 12 -1.</_>\n        <_>\n          6 10 12 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 15 -1.</_>\n        <_>\n          18 6 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 18 3 -1.</_>\n        <_>\n          3 16 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 5 6 9 -1.</_>\n        <_>\n          18 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 16 6 -1.</_>\n        <_>\n          1 5 8 3 2.</_>\n        <_>\n          9 8 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 24 14 -1.</_>\n        <_>\n          0 4 12 7 2.</_>\n        <_>\n          12 11 12 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 13 -1.</_>\n        <_>\n          13 0 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 13 -1.</_>\n        <_>\n          9 0 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 6 9 -1.</_>\n        <_>\n          13 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 6 9 -1.</_>\n        <_>\n          10 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 17 9 6 -1.</_>\n        <_>\n          13 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 14 6 -1.</_>\n        <_>\n          2 18 7 3 2.</_>\n        <_>\n          9 21 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 18 4 -1.</_>\n        <_>\n          12 18 9 2 2.</_>\n        <_>\n          3 20 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 15 4 -1.</_>\n        <_>\n          5 20 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 15 9 -1.</_>\n        <_>\n          14 15 5 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 16 4 -1.</_>\n        <_>\n          4 6 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 15 10 -1.</_>\n        <_>\n          5 14 5 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 10 14 -1.</_>\n        <_>\n          12 9 5 7 2.</_>\n        <_>\n          7 16 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 6 9 -1.</_>\n        <_>\n          9 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 3 -1.</_>\n        <_>\n          3 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 18 3 -1.</_>\n        <_>\n          0 11 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 18 4 -1.</_>\n        <_>\n          12 16 9 2 2.</_>\n        <_>\n          3 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 14 6 -1.</_>\n        <_>\n          4 6 7 3 2.</_>\n        <_>\n          11 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 2 18 -1.</_>\n        <_>\n          13 0 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 2 18 -1.</_>\n        <_>\n          10 0 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 15 10 -1.</_>\n        <_>\n          10 7 5 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 21 4 -1.</_>\n        <_>\n          8 20 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 5 18 -1.</_>\n        <_>\n          10 14 5 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 6 -1.</_>\n        <_>\n          0 2 12 3 2.</_>\n        <_>\n          12 5 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 22 8 -1.</_>\n        <_>\n          12 1 11 4 2.</_>\n        <_>\n          1 5 11 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 15 9 -1.</_>\n        <_>\n          4 3 15 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 19 -1.</_>\n        <_>\n          8 0 8 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 21 18 3 -1.</_>\n        <_>\n          11 21 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 10 4 -1.</_>\n        <_>\n          9 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 10 4 -1.</_>\n        <_>\n          10 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 8 6 16 -1.</_>\n        <_>\n          20 8 3 8 2.</_>\n        <_>\n          17 16 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 20 4 -1.</_>\n        <_>\n          1 15 10 2 2.</_>\n        <_>\n          11 17 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 10 6 -1.</_>\n        <_>\n          14 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 16 9 -1.</_>\n        <_>\n          3 3 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 7 15 -1.</_>\n        <_>\n          15 11 7 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 13 -1.</_>\n        <_>\n          11 1 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 2 6 14 -1.</_>\n        <_>\n          17 2 3 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 12 10 -1.</_>\n        <_>\n          3 14 6 5 2.</_>\n        <_>\n          9 19 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 6 14 -1.</_>\n        <_>\n          4 2 3 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 4 5 12 -1.</_>\n        <_>\n          10 8 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 24 5 -1.</_>\n        <_>\n          8 17 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 7 5 12 -1.</_>\n        <_>\n          15 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 6 12 -1.</_>\n        <_>\n          3 1 3 6 2.</_>\n        <_>\n          6 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 13 6 6 -1.</_>\n        <_>\n          12 16 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 13 6 6 -1.</_>\n        <_>\n          6 16 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 6 3 16 -1.</_>\n        <_>\n          14 14 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 13 6 -1.</_>\n        <_>\n          1 14 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 4 9 -1.</_>\n        <_>\n          13 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 9 6 -1.</_>\n        <_>\n          10 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 6 9 -1.</_>\n        <_>\n          12 2 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 6 9 -1.</_>\n        <_>\n          9 2 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 12 6 -1.</_>\n        <_>\n          6 20 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 6 9 -1.</_>\n        <_>\n          9 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 12 3 -1.</_>\n        <_>\n          7 7 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 8 21 -1.</_>\n        <_>\n          8 10 8 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 10 12 -1.</_>\n        <_>\n          7 8 10 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 9 -1.</_>\n        <_>\n          0 4 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 2 2 20 -1.</_>\n        <_>\n          15 2 1 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          0 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 3 2 21 -1.</_>\n        <_>\n          15 3 1 21 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 2 23 -1.</_>\n        <_>\n          8 0 1 23 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 9 4 -1.</_>\n        <_>\n          15 10 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 9 4 -1.</_>\n        <_>\n          0 10 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 9 6 -1.</_>\n        <_>\n          8 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 6 -1.</_>\n        <_>\n          0 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 18 4 -1.</_>\n        <_>\n          9 10 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 19 -1.</_>\n        <_>\n          8 0 8 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 8 12 -1.</_>\n        <_>\n          9 7 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 10 -1.</_>\n        <_>\n          12 6 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 10 12 -1.</_>\n        <_>\n          12 9 5 6 2.</_>\n        <_>\n          7 15 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 3 19 -1.</_>\n        <_>\n          6 0 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 10 -1.</_>\n        <_>\n          16 0 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 6 12 -1.</_>\n        <_>\n          2 0 3 6 2.</_>\n        <_>\n          5 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 24 2 -1.</_>\n        <_>\n          0 12 24 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 9 13 4 -1.</_>\n        <_>\n          4 11 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 6 9 -1.</_>\n        <_>\n          9 11 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 16 4 -1.</_>\n        <_>\n          0 14 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 12 6 9 -1.</_>\n        <_>\n          18 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 6 9 -1.</_>\n        <_>\n          0 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 10 4 -1.</_>\n        <_>\n          8 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 6 9 -1.</_>\n        <_>\n          10 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 3 6 15 -1.</_>\n        <_>\n          14 3 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 6 15 -1.</_>\n        <_>\n          8 3 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 2 9 4 -1.</_>\n        <_>\n          15 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 6 7 -1.</_>\n        <_>\n          8 10 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 6 10 -1.</_>\n        <_>\n          9 19 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 5 8 -1.</_>\n        <_>\n          7 17 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 3 16 -1.</_>\n        <_>\n          14 13 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 17 18 3 -1.</_>\n        <_>\n          2 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 18 19 3 -1.</_>\n        <_>\n          5 19 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 4 3 18 -1.</_>\n        <_>\n          13 4 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 3 18 -1.</_>\n        <_>\n          10 4 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 18 9 -1.</_>\n        <_>\n          9 3 6 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 6 14 -1.</_>\n        <_>\n          8 1 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 9 6 -1.</_>\n        <_>\n          12 19 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 20 16 -1.</_>\n        <_>\n          1 3 10 8 2.</_>\n        <_>\n          11 11 10 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 5 6 12 -1.</_>\n        <_>\n          15 5 3 6 2.</_>\n        <_>\n          12 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 16 -1.</_>\n        <_>\n          1 2 11 8 2.</_>\n        <_>\n          12 10 11 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 5 10 -1.</_>\n        <_>\n          10 19 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          3 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 6 10 -1.</_>\n        <_>\n          12 14 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          8 2 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 9 -1.</_>\n        <_>\n          6 7 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 5 -1.</_>\n        <_>\n          10 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 14 12 -1.</_>\n        <_>\n          5 12 14 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 8 10 -1.</_>\n        <_>\n          4 14 4 5 2.</_>\n        <_>\n          8 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 5 14 -1.</_>\n        <_>\n          11 13 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 3 16 -1.</_>\n        <_>\n          7 14 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 8 -1.</_>\n        <_>\n          9 7 6 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 20 2 -1.</_>\n        <_>\n          2 4 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 19 6 -1.</_>\n        <_>\n          3 14 19 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 6 6 14 -1.</_>\n        <_>\n          16 6 3 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 6 12 -1.</_>\n        <_>\n          9 9 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 6 6 18 -1.</_>\n        <_>\n          21 6 3 9 2.</_>\n        <_>\n          18 15 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 6 18 -1.</_>\n        <_>\n          0 6 3 9 2.</_>\n        <_>\n          3 15 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          18 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 15 6 -1.</_>\n        <_>\n          3 20 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          18 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 9 -1.</_>\n        <_>\n          0 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 18 2 -1.</_>\n        <_>\n          5 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 6 -1.</_>\n        <_>\n          6 2 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 9 -1.</_>\n        <_>\n          12 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 6 9 -1.</_>\n        <_>\n          10 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 13 6 -1.</_>\n        <_>\n          3 8 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 6 15 -1.</_>\n        <_>\n          5 5 3 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 9 6 -1.</_>\n        <_>\n          11 8 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 3 14 -1.</_>\n        <_>\n          8 13 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 10 4 -1.</_>\n        <_>\n          9 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 4 19 -1.</_>\n        <_>\n          13 1 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 4 19 -1.</_>\n        <_>\n          9 1 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 9 6 9 -1.</_>\n        <_>\n          18 12 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 21 18 3 -1.</_>\n        <_>\n          1 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 10 9 -1.</_>\n        <_>\n          14 16 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 22 4 -1.</_>\n        <_>\n          1 13 11 2 2.</_>\n        <_>\n          12 15 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 16 6 -1.</_>\n        <_>\n          12 6 8 3 2.</_>\n        <_>\n          4 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 18 22 -1.</_>\n        <_>\n          1 0 9 11 2.</_>\n        <_>\n          10 11 9 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 8 14 -1.</_>\n        <_>\n          14 7 4 7 2.</_>\n        <_>\n          10 14 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 6 20 -1.</_>\n        <_>\n          0 4 3 10 2.</_>\n        <_>\n          3 14 3 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 9 -1.</_>\n        <_>\n          17 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 9 -1.</_>\n        <_>\n          5 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 6 12 -1.</_>\n        <_>\n          18 12 3 6 2.</_>\n        <_>\n          15 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 6 12 -1.</_>\n        <_>\n          3 12 3 6 2.</_>\n        <_>\n          6 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 9 6 -1.</_>\n        <_>\n          0 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 19 3 -1.</_>\n        <_>\n          4 15 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 19 3 -1.</_>\n        <_>\n          2 14 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 10 6 -1.</_>\n        <_>\n          14 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 10 12 -1.</_>\n        <_>\n          6 0 5 6 2.</_>\n        <_>\n          11 6 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 1 6 12 -1.</_>\n        <_>\n          20 1 3 6 2.</_>\n        <_>\n          17 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 6 12 -1.</_>\n        <_>\n          1 1 3 6 2.</_>\n        <_>\n          4 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 14 6 9 -1.</_>\n        <_>\n          16 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 9 12 -1.</_>\n        <_>\n          7 9 9 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 4 12 -1.</_>\n        <_>\n          12 7 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 14 8 -1.</_>\n        <_>\n          4 4 14 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 18 3 -1.</_>\n        <_>\n          8 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 21 23 -1.</_>\n        <_>\n          7 1 7 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 17 4 -1.</_>\n        <_>\n          6 11 17 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 11 18 -1.</_>\n        <_>\n          1 6 11 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 15 13 6 -1.</_>\n        <_>\n          6 17 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 6 -1.</_>\n        <_>\n          0 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 15 4 -1.</_>\n        <_>\n          13 7 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 9 -1.</_>\n        <_>\n          9 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 18 3 -1.</_>\n        <_>\n          12 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 24 4 -1.</_>\n        <_>\n          8 14 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 10 3 12 -1.</_>\n        <_>\n          16 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 3 -1.</_>\n        <_>\n          0 4 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 17 10 6 -1.</_>\n        <_>\n          14 19 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 18 3 -1.</_>\n        <_>\n          7 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 18 9 -1.</_>\n        <_>\n          5 3 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 9 -1.</_>\n        <_>\n          4 6 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 5 3 12 -1.</_>\n        <_>\n          16 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 18 4 -1.</_>\n        <_>\n          6 7 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 6 10 -1.</_>\n        <_>\n          11 8 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 6 9 -1.</_>\n        <_>\n          11 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 21 -1.</_>\n        <_>\n          12 1 9 21 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 7 -1.</_>\n        <_>\n          6 8 6 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 6 9 -1.</_>\n        <_>\n          10 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          8 2 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 7 5 12 -1.</_>\n        <_>\n          14 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 5 12 -1.</_>\n        <_>\n          5 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 17 -1.</_>\n        <_>\n          3 1 3 17 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 19 9 -1.</_>\n        <_>\n          3 4 19 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 12 6 -1.</_>\n        <_>\n          3 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 4 4 19 -1.</_>\n        <_>\n          20 4 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 10 7 -1.</_>\n        <_>\n          5 16 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 10 12 -1.</_>\n        <_>\n          13 7 5 6 2.</_>\n        <_>\n          8 13 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 12 -1.</_>\n        <_>\n          6 7 5 6 2.</_>\n        <_>\n          11 13 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 9 6 -1.</_>\n        <_>\n          12 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 21 4 -1.</_>\n        <_>\n          8 20 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 9 6 -1.</_>\n        <_>\n          9 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 9 6 -1.</_>\n        <_>\n          10 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 14 -1.</_>\n        <_>\n          13 0 2 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 14 -1.</_>\n        <_>\n          9 0 2 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 9 6 -1.</_>\n        <_>\n          14 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 18 5 -1.</_>\n        <_>\n          8 8 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 3 6 11 -1.</_>\n        <_>\n          20 3 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 11 14 -1.</_>\n        <_>\n          6 12 11 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 9 -1.</_>\n        <_>\n          18 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 9 6 -1.</_>\n        <_>\n          7 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 9 -1.</_>\n        <_>\n          18 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 6 9 -1.</_>\n        <_>\n          0 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 9 4 -1.</_>\n        <_>\n          9 6 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 22 19 2 -1.</_>\n        <_>\n          0 23 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 14 6 9 -1.</_>\n        <_>\n          17 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 14 6 9 -1.</_>\n        <_>\n          1 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 11 4 9 -1.</_>\n        <_>\n          14 11 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 4 9 -1.</_>\n        <_>\n          8 11 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 7 -1.</_>\n        <_>\n          9 9 6 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 10 -1.</_>\n        <_>\n          9 17 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 17 18 3 -1.</_>\n        <_>\n          6 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 18 3 -1.</_>\n        <_>\n          1 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 11 12 -1.</_>\n        <_>\n          10 12 11 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          5 6 7 3 2.</_>\n        <_>\n          12 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 15 4 -1.</_>\n        <_>\n          5 6 15 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 22 2 -1.</_>\n        <_>\n          0 1 22 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 24 -1.</_>\n        <_>\n          8 0 8 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 18 4 -1.</_>\n        <_>\n          10 15 9 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 9 -1.</_>\n        <_>\n          6 11 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 7 12 -1.</_>\n        <_>\n          4 16 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 6 -1.</_>\n        <_>\n          12 2 11 3 2.</_>\n        <_>\n          1 5 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 20 14 3 -1.</_>\n        <_>\n          12 20 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 16 -1.</_>\n        <_>\n          12 0 12 8 2.</_>\n        <_>\n          0 8 12 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 13 18 4 -1.</_>\n        <_>\n          3 13 9 2 2.</_>\n        <_>\n          12 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 22 2 -1.</_>\n        <_>\n          2 11 22 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 11 8 -1.</_>\n        <_>\n          6 7 11 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 6 6 -1.</_>\n        <_>\n          14 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 24 6 -1.</_>\n        <_>\n          0 9 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 10 10 -1.</_>\n        <_>\n          19 0 5 5 2.</_>\n        <_>\n          14 5 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 10 10 -1.</_>\n        <_>\n          0 0 5 5 2.</_>\n        <_>\n          5 5 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 4 -1.</_>\n        <_>\n          12 1 12 2 2.</_>\n        <_>\n          0 3 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 15 16 6 -1.</_>\n        <_>\n          13 15 8 3 2.</_>\n        <_>\n          5 18 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 16 6 -1.</_>\n        <_>\n          3 15 8 3 2.</_>\n        <_>\n          11 18 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 21 10 -1.</_>\n        <_>\n          0 18 21 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 24 -1.</_>\n        <_>\n          15 0 2 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 6 11 -1.</_>\n        <_>\n          9 4 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 9 6 -1.</_>\n        <_>\n          12 5 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 2 20 -1.</_>\n        <_>\n          1 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 24 -1.</_>\n        <_>\n          15 0 2 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 24 -1.</_>\n        <_>\n          7 0 2 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 7 6 14 -1.</_>\n        <_>\n          19 7 3 7 2.</_>\n        <_>\n          16 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 4 12 -1.</_>\n        <_>\n          6 7 2 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 24 14 -1.</_>\n        <_>\n          8 5 8 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 13 10 6 -1.</_>\n        <_>\n          5 15 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 6 14 -1.</_>\n        <_>\n          2 7 3 7 2.</_>\n        <_>\n          5 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 2 9 15 -1.</_>\n        <_>\n          18 2 3 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 9 -1.</_>\n        <_>\n          2 2 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 10 14 -1.</_>\n        <_>\n          17 2 5 7 2.</_>\n        <_>\n          12 9 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 2 18 -1.</_>\n        <_>\n          12 6 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 15 6 -1.</_>\n        <_>\n          14 5 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 10 -1.</_>\n        <_>\n          10 6 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 9 7 -1.</_>\n        <_>\n          6 3 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 14 3 -1.</_>\n        <_>\n          6 7 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 8 6 -1.</_>\n        <_>\n          11 7 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 7 7 12 -1.</_>\n        <_>\n          12 13 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          10 6 2 9 2.</_>\n        <_>\n          12 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 14 6 9 -1.</_>\n        <_>\n          16 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 6 13 -1.</_>\n        <_>\n          6 0 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 21 3 -1.</_>\n        <_>\n          9 2 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 5 12 -1.</_>\n        <_>\n          5 8 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 3 4 10 -1.</_>\n        <_>\n          10 8 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 5 8 -1.</_>\n        <_>\n          8 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 11 9 -1.</_>\n        <_>\n          6 3 11 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 5 -1.</_>\n        <_>\n          10 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 5 -1.</_>\n        <_>\n          8 0 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 23 6 -1.</_>\n        <_>\n          1 12 23 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          9 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 21 6 -1.</_>\n        <_>\n          3 8 21 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 6 12 -1.</_>\n        <_>\n          2 5 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 8 10 -1.</_>\n        <_>\n          8 12 8 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 15 12 -1.</_>\n        <_>\n          10 7 5 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 10 6 -1.</_>\n        <_>\n          0 19 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 18 9 6 -1.</_>\n        <_>\n          14 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 16 -1.</_>\n        <_>\n          9 14 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 18 9 6 -1.</_>\n        <_>\n          14 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 9 6 -1.</_>\n        <_>\n          1 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 9 9 6 -1.</_>\n        <_>\n          15 11 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 9 6 -1.</_>\n        <_>\n          0 11 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 6 9 -1.</_>\n        <_>\n          19 3 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 17 18 3 -1.</_>\n        <_>\n          2 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 21 6 -1.</_>\n        <_>\n          3 17 21 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 17 6 6 -1.</_>\n        <_>\n          9 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 3 6 9 -1.</_>\n        <_>\n          18 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          0 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 16 10 -1.</_>\n        <_>\n          12 0 8 5 2.</_>\n        <_>\n          4 5 8 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 10 16 -1.</_>\n        <_>\n          2 0 5 8 2.</_>\n        <_>\n          7 8 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 10 5 -1.</_>\n        <_>\n          14 0 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 10 5 -1.</_>\n        <_>\n          5 0 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 3 6 10 -1.</_>\n        <_>\n          18 3 3 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 12 6 -1.</_>\n        <_>\n          5 11 6 3 2.</_>\n        <_>\n          11 14 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          21 0 3 18 -1.</_>\n        <_>\n          22 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 9 7 -1.</_>\n        <_>\n          11 8 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 12 8 10 -1.</_>\n        <_>\n          7 12 4 5 2.</_>\n        <_>\n          11 17 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          21 0 3 18 -1.</_>\n        <_>\n          22 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          12 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 9 6 -1.</_>\n        <_>\n          15 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 3 -1.</_>\n        <_>\n          0 3 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 7 6 9 -1.</_>\n        <_>\n          13 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 6 10 -1.</_>\n        <_>\n          9 6 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 6 12 -1.</_>\n        <_>\n          14 1 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 12 -1.</_>\n        <_>\n          6 10 12 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 3 2 21 -1.</_>\n        <_>\n          14 3 1 21 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 12 8 -1.</_>\n        <_>\n          6 5 12 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 8 -1.</_>\n        <_>\n          3 4 18 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 3 -1.</_>\n        <_>\n          3 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 24 4 -1.</_>\n        <_>\n          12 13 12 2 2.</_>\n        <_>\n          0 15 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 9 -1.</_>\n        <_>\n          12 5 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 6 9 -1.</_>\n        <_>\n          13 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 6 22 -1.</_>\n        <_>\n          8 2 2 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 10 8 14 -1.</_>\n        <_>\n          20 10 4 7 2.</_>\n        <_>\n          16 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 16 15 -1.</_>\n        <_>\n          3 9 16 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 10 8 14 -1.</_>\n        <_>\n          20 10 4 7 2.</_>\n        <_>\n          16 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 8 14 -1.</_>\n        <_>\n          0 10 4 7 2.</_>\n        <_>\n          4 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 11 6 -1.</_>\n        <_>\n          10 17 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 24 9 -1.</_>\n        <_>\n          8 7 8 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 4 16 -1.</_>\n        <_>\n          13 1 2 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 4 16 -1.</_>\n        <_>\n          9 1 2 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 16 8 -1.</_>\n        <_>\n          13 5 8 4 2.</_>\n        <_>\n          5 9 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 6 9 -1.</_>\n        <_>\n          0 12 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 6 9 -1.</_>\n        <_>\n          3 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 9 6 -1.</_>\n        <_>\n          8 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 8 10 -1.</_>\n        <_>\n          2 13 4 5 2.</_>\n        <_>\n          6 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 5 3 18 -1.</_>\n        <_>\n          15 11 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 18 3 -1.</_>\n        <_>\n          3 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 5 6 11 -1.</_>\n        <_>\n          19 5 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 6 11 -1.</_>\n        <_>\n          3 5 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 1 4 9 -1.</_>\n        <_>\n          19 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 4 9 -1.</_>\n        <_>\n          3 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 15 18 9 -1.</_>\n        <_>\n          4 15 9 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 12 4 -1.</_>\n        <_>\n          6 11 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 2 9 6 -1.</_>\n        <_>\n          15 4 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 9 6 -1.</_>\n        <_>\n          0 4 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 17 -1.</_>\n        <_>\n          17 0 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 17 -1.</_>\n        <_>\n          5 0 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 17 9 4 -1.</_>\n        <_>\n          8 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 3 18 -1.</_>\n        <_>\n          6 11 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 14 12 -1.</_>\n        <_>\n          5 8 14 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 3 12 -1.</_>\n        <_>\n          10 8 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 14 15 -1.</_>\n        <_>\n          10 12 14 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 14 15 -1.</_>\n        <_>\n          0 12 14 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 9 6 -1.</_>\n        <_>\n          15 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 9 6 -1.</_>\n        <_>\n          0 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 6 14 -1.</_>\n        <_>\n          14 6 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 6 9 -1.</_>\n        <_>\n          11 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 6 15 -1.</_>\n        <_>\n          14 6 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 6 15 -1.</_>\n        <_>\n          8 6 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 3 8 9 -1.</_>\n        <_>\n          15 3 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 9 21 -1.</_>\n        <_>\n          3 0 3 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 8 12 -1.</_>\n        <_>\n          11 13 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 12 -1.</_>\n        <_>\n          6 7 5 6 2.</_>\n        <_>\n          11 13 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          12 6 2 9 2.</_>\n        <_>\n          10 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 9 -1.</_>\n        <_>\n          0 3 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 18 3 -1.</_>\n        <_>\n          3 15 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 8 10 -1.</_>\n        <_>\n          3 14 4 5 2.</_>\n        <_>\n          7 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 24 4 -1.</_>\n        <_>\n          12 12 12 2 2.</_>\n        <_>\n          0 14 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 3 20 -1.</_>\n        <_>\n          1 2 1 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 10 8 -1.</_>\n        <_>\n          17 16 5 4 2.</_>\n        <_>\n          12 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 10 8 -1.</_>\n        <_>\n          2 16 5 4 2.</_>\n        <_>\n          7 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 9 -1.</_>\n        <_>\n          7 3 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 3 -1.</_>\n        <_>\n          8 0 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 15 4 -1.</_>\n        <_>\n          3 10 15 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 6 -1.</_>\n        <_>\n          10 5 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 13 14 6 -1.</_>\n        <_>\n          5 16 14 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 4 10 -1.</_>\n        <_>\n          11 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 6 7 -1.</_>\n        <_>\n          3 6 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 6 -1.</_>\n        <_>\n          18 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 3 -1.</_>\n        <_>\n          3 2 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 14 18 -1.</_>\n        <_>\n          9 12 14 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 6 -1.</_>\n        <_>\n          3 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 6 -1.</_>\n        <_>\n          13 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 24 3 -1.</_>\n        <_>\n          8 20 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 7 -1.</_>\n        <_>\n          13 11 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 10 6 -1.</_>\n        <_>\n          4 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 6 -1.</_>\n        <_>\n          13 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 7 -1.</_>\n        <_>\n          8 11 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 11 12 -1.</_>\n        <_>\n          7 8 11 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 15 10 4 -1.</_>\n        <_>\n          6 17 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 9 -1.</_>\n        <_>\n          16 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 6 9 -1.</_>\n        <_>\n          6 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 4 15 -1.</_>\n        <_>\n          11 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 20 3 -1.</_>\n        <_>\n          0 1 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 18 10 6 -1.</_>\n        <_>\n          13 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 6 11 -1.</_>\n        <_>\n          5 7 3 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 10 9 -1.</_>\n        <_>\n          10 17 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 4 9 -1.</_>\n        <_>\n          10 2 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 3 10 4 -1.</_>\n        <_>\n          14 3 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 6 -1.</_>\n        <_>\n          6 6 6 3 2.</_>\n        <_>\n          12 9 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 8 10 -1.</_>\n        <_>\n          12 8 4 5 2.</_>\n        <_>\n          8 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 4 16 -1.</_>\n        <_>\n          7 12 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 9 4 -1.</_>\n        <_>\n          8 10 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 14 9 -1.</_>\n        <_>\n          5 5 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 19 8 -1.</_>\n        <_>\n          3 20 19 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 10 8 -1.</_>\n        <_>\n          5 0 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 16 18 -1.</_>\n        <_>\n          5 2 8 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 24 11 -1.</_>\n        <_>\n          8 11 8 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 18 5 -1.</_>\n        <_>\n          3 3 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 18 3 -1.</_>\n        <_>\n          1 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 17 18 3 -1.</_>\n        <_>\n          5 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 9 6 -1.</_>\n        <_>\n          1 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 23 10 -1.</_>\n        <_>\n          1 14 23 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 3 -1.</_>\n        <_>\n          3 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 3 -1.</_>\n        <_>\n          6 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 3 22 -1.</_>\n        <_>\n          7 2 1 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 17 10 6 -1.</_>\n        <_>\n          14 19 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 10 6 -1.</_>\n        <_>\n          1 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 3 6 12 -1.</_>\n        <_>\n          13 3 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          12 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 9 6 -1.</_>\n        <_>\n          15 10 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 6 9 -1.</_>\n        <_>\n          5 11 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 3 19 -1.</_>\n        <_>\n          15 5 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 9 6 -1.</_>\n        <_>\n          6 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 3 19 -1.</_>\n        <_>\n          15 5 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          0 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 21 18 3 -1.</_>\n        <_>\n          5 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 4 -1.</_>\n        <_>\n          7 10 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 4 8 10 -1.</_>\n        <_>\n          17 4 4 5 2.</_>\n        <_>\n          13 9 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 9 6 -1.</_>\n        <_>\n          10 8 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 9 9 8 -1.</_>\n        <_>\n          15 9 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 5 12 -1.</_>\n        <_>\n          0 10 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 14 6 -1.</_>\n        <_>\n          14 6 7 3 2.</_>\n        <_>\n          7 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 3 19 -1.</_>\n        <_>\n          8 5 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 15 20 -1.</_>\n        <_>\n          13 4 5 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 15 20 -1.</_>\n        <_>\n          6 4 5 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 6 6 -1.</_>\n        <_>\n          13 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 6 6 -1.</_>\n        <_>\n          8 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 2 6 14 -1.</_>\n        <_>\n          17 2 3 7 2.</_>\n        <_>\n          14 9 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 6 14 -1.</_>\n        <_>\n          4 2 3 7 2.</_>\n        <_>\n          7 9 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 4 6 7 -1.</_>\n        <_>\n          12 4 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 6 9 -1.</_>\n        <_>\n          11 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 4 8 10 -1.</_>\n        <_>\n          11 4 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 8 10 -1.</_>\n        <_>\n          9 4 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 10 6 -1.</_>\n        <_>\n          8 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 21 6 -1.</_>\n        <_>\n          1 20 21 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 12 6 -1.</_>\n        <_>\n          9 2 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 12 6 -1.</_>\n        <_>\n          9 2 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 5 12 6 -1.</_>\n        <_>\n          18 5 6 3 2.</_>\n        <_>\n          12 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 6 9 -1.</_>\n        <_>\n          8 11 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 20 6 -1.</_>\n        <_>\n          2 9 20 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 12 6 -1.</_>\n        <_>\n          0 5 6 3 2.</_>\n        <_>\n          6 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 8 10 -1.</_>\n        <_>\n          18 14 4 5 2.</_>\n        <_>\n          14 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 14 8 10 -1.</_>\n        <_>\n          2 14 4 5 2.</_>\n        <_>\n          6 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 20 13 -1.</_>\n        <_>\n          2 11 10 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 12 5 -1.</_>\n        <_>\n          12 9 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 16 6 -1.</_>\n        <_>\n          13 6 8 3 2.</_>\n        <_>\n          5 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 19 9 4 -1.</_>\n        <_>\n          1 21 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 12 5 -1.</_>\n        <_>\n          11 5 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 14 12 -1.</_>\n        <_>\n          3 5 7 6 2.</_>\n        <_>\n          10 11 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 9 6 -1.</_>\n        <_>\n          12 4 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 6 19 3 -1.</_>\n        <_>\n          2 7 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 10 6 9 -1.</_>\n        <_>\n          18 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 2 -1.</_>\n        <_>\n          3 8 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 2 4 18 -1.</_>\n        <_>\n          22 2 2 9 2.</_>\n        <_>\n          20 11 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 20 3 -1.</_>\n        <_>\n          2 19 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 22 3 -1.</_>\n        <_>\n          1 10 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 4 18 -1.</_>\n        <_>\n          0 2 2 9 2.</_>\n        <_>\n          2 11 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 0 4 23 -1.</_>\n        <_>\n          19 0 2 23 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 19 -1.</_>\n        <_>\n          3 3 3 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          20 2 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 10 6 -1.</_>\n        <_>\n          0 7 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 12 12 -1.</_>\n        <_>\n          13 0 6 6 2.</_>\n        <_>\n          7 6 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 6 -1.</_>\n        <_>\n          0 3 12 3 2.</_>\n        <_>\n          12 6 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 4 10 -1.</_>\n        <_>\n          10 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 4 15 -1.</_>\n        <_>\n          8 14 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 11 17 6 -1.</_>\n        <_>\n          4 14 17 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 18 8 -1.</_>\n        <_>\n          2 5 9 4 2.</_>\n        <_>\n          11 9 9 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 14 6 -1.</_>\n        <_>\n          14 6 7 3 2.</_>\n        <_>\n          7 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 14 6 -1.</_>\n        <_>\n          3 6 7 3 2.</_>\n        <_>\n          10 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 5 3 18 -1.</_>\n        <_>\n          17 5 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 3 18 -1.</_>\n        <_>\n          6 5 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 10 14 4 -1.</_>\n        <_>\n          10 12 14 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 9 4 -1.</_>\n        <_>\n          4 12 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 18 9 -1.</_>\n        <_>\n          2 3 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 12 8 -1.</_>\n        <_>\n          10 3 4 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 8 5 -1.</_>\n        <_>\n          5 1 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 7 7 8 -1.</_>\n        <_>\n          12 11 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 22 4 -1.</_>\n        <_>\n          0 14 22 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 4 15 -1.</_>\n        <_>\n          15 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 7 8 -1.</_>\n        <_>\n          5 11 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 9 4 -1.</_>\n        <_>\n          8 20 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 4 -1.</_>\n        <_>\n          1 4 22 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 6 17 -1.</_>\n        <_>\n          19 3 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 8 18 -1.</_>\n        <_>\n          8 11 8 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 6 12 -1.</_>\n        <_>\n          20 0 3 6 2.</_>\n        <_>\n          17 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 5 9 12 -1.</_>\n        <_>\n          15 11 9 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 22 18 2 -1.</_>\n        <_>\n          2 23 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 10 12 6 -1.</_>\n        <_>\n          16 10 6 3 2.</_>\n        <_>\n          10 13 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 4 11 -1.</_>\n        <_>\n          2 1 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 0 4 10 -1.</_>\n        <_>\n          20 0 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 6 17 -1.</_>\n        <_>\n          3 3 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 8 9 -1.</_>\n        <_>\n          0 16 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 8 6 12 -1.</_>\n        <_>\n          16 12 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 6 12 -1.</_>\n        <_>\n          2 12 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 19 3 -1.</_>\n        <_>\n          1 6 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 8 9 7 -1.</_>\n        <_>\n          14 8 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 12 9 -1.</_>\n        <_>\n          3 11 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 3 -1.</_>\n        <_>\n          3 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 4 12 -1.</_>\n        <_>\n          10 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 14 -1.</_>\n        <_>\n          3 9 9 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 4 9 -1.</_>\n        <_>\n          2 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 5 4 18 -1.</_>\n        <_>\n          12 5 2 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 4 18 -1.</_>\n        <_>\n          10 5 2 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 6 10 -1.</_>\n        <_>\n          12 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 4 11 -1.</_>\n        <_>\n          11 4 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 16 18 3 -1.</_>\n        <_>\n          4 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 20 3 -1.</_>\n        <_>\n          0 17 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 12 -1.</_>\n        <_>\n          9 13 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 13 8 8 -1.</_>\n        <_>\n          8 17 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 3 12 -1.</_>\n        <_>\n          13 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 14 14 -1.</_>\n        <_>\n          5 9 7 7 2.</_>\n        <_>\n          12 16 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 10 -1.</_>\n        <_>\n          12 0 12 5 2.</_>\n        <_>\n          0 5 12 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 11 18 2 -1.</_>\n        <_>\n          1 12 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 5 5 12 -1.</_>\n        <_>\n          19 9 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 5 12 -1.</_>\n        <_>\n          0 9 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 6 8 18 -1.</_>\n        <_>\n          20 6 4 9 2.</_>\n        <_>\n          16 15 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 8 18 -1.</_>\n        <_>\n          0 6 4 9 2.</_>\n        <_>\n          4 15 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 5 12 12 -1.</_>\n        <_>\n          18 5 6 6 2.</_>\n        <_>\n          12 11 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 6 9 -1.</_>\n        <_>\n          9 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 13 6 11 -1.</_>\n        <_>\n          11 13 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 12 12 -1.</_>\n        <_>\n          0 5 6 6 2.</_>\n        <_>\n          6 11 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 23 3 -1.</_>\n        <_>\n          1 3 23 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 19 3 -1.</_>\n        <_>\n          1 16 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 17 11 4 -1.</_>\n        <_>\n          13 19 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 8 5 -1.</_>\n        <_>\n          4 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 10 4 -1.</_>\n        <_>\n          12 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 9 9 -1.</_>\n        <_>\n          4 9 9 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 9 6 -1.</_>\n        <_>\n          15 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 9 6 -1.</_>\n        <_>\n          1 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 20 8 -1.</_>\n        <_>\n          13 10 10 4 2.</_>\n        <_>\n          3 14 10 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 9 18 -1.</_>\n        <_>\n          5 0 3 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 9 10 -1.</_>\n        <_>\n          16 11 3 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 8 5 -1.</_>\n        <_>\n          5 2 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 21 6 -1.</_>\n        <_>\n          10 4 7 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 14 -1.</_>\n        <_>\n          7 0 5 7 2.</_>\n        <_>\n          12 7 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 12 4 -1.</_>\n        <_>\n          12 19 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 23 4 -1.</_>\n        <_>\n          0 8 23 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 8 10 -1.</_>\n        <_>\n          17 10 4 5 2.</_>\n        <_>\n          13 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 16 9 4 -1.</_>\n        <_>\n          15 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 4 -1.</_>\n        <_>\n          0 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 6 -1.</_>\n        <_>\n          13 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 6 -1.</_>\n        <_>\n          8 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 6 -1.</_>\n        <_>\n          12 3 12 3 2.</_>\n        <_>\n          0 6 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 18 3 -1.</_>\n        <_>\n          2 5 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 4 -1.</_>\n        <_>\n          12 0 12 2 2.</_>\n        <_>\n          0 2 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 18 3 -1.</_>\n        <_>\n          1 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 6 -1.</_>\n        <_>\n          0 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 17 18 3 -1.</_>\n        <_>\n          6 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 6 10 -1.</_>\n        <_>\n          10 8 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 5 8 -1.</_>\n        <_>\n          8 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 6 8 -1.</_>\n        <_>\n          12 12 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 6 11 -1.</_>\n        <_>\n          8 5 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 6 8 9 -1.</_>\n        <_>\n          13 9 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 21 6 -1.</_>\n        <_>\n          1 9 21 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 5 3 12 -1.</_>\n        <_>\n          15 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 11 12 -1.</_>\n        <_>\n          6 13 11 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 8 10 8 -1.</_>\n        <_>\n          18 8 5 4 2.</_>\n        <_>\n          13 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 12 3 -1.</_>\n        <_>\n          11 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 18 4 -1.</_>\n        <_>\n          12 11 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 22 22 -1.</_>\n        <_>\n          0 11 22 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 6 8 -1.</_>\n        <_>\n          11 6 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 9 -1.</_>\n        <_>\n          12 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 6 14 -1.</_>\n        <_>\n          8 3 3 7 2.</_>\n        <_>\n          11 10 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 18 8 -1.</_>\n        <_>\n          9 10 6 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 3 14 -1.</_>\n        <_>\n          10 7 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 20 -1.</_>\n        <_>\n          4 13 16 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 6 10 -1.</_>\n        <_>\n          11 4 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 16 4 -1.</_>\n        <_>\n          5 2 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 18 4 -1.</_>\n        <_>\n          8 5 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 9 -1.</_>\n        <_>\n          15 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 8 5 -1.</_>\n        <_>\n          12 4 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 10 4 -1.</_>\n        <_>\n          12 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 10 4 -1.</_>\n        <_>\n          7 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 11 12 5 -1.</_>\n        <_>\n          11 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 8 10 -1.</_>\n        <_>\n          3 10 4 5 2.</_>\n        <_>\n          7 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 9 8 -1.</_>\n        <_>\n          14 12 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 21 24 3 -1.</_>\n        <_>\n          8 21 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 20 18 4 -1.</_>\n        <_>\n          9 20 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 9 6 -1.</_>\n        <_>\n          1 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 17 10 4 -1.</_>\n        <_>\n          11 19 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 4 12 -1.</_>\n        <_>\n          9 18 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 9 6 -1.</_>\n        <_>\n          12 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 6 9 -1.</_>\n        <_>\n          1 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 12 4 -1.</_>\n        <_>\n          6 18 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 20 3 -1.</_>\n        <_>\n          1 6 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 9 9 -1.</_>\n        <_>\n          8 4 9 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 19 9 4 -1.</_>\n        <_>\n          2 21 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 18 -1.</_>\n        <_>\n          11 7 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 8 12 -1.</_>\n        <_>\n          7 2 4 6 2.</_>\n        <_>\n          11 8 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 10 9 8 -1.</_>\n        <_>\n          14 10 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 12 5 -1.</_>\n        <_>\n          9 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 9 6 -1.</_>\n        <_>\n          14 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 6 9 -1.</_>\n        <_>\n          7 10 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 5 12 -1.</_>\n        <_>\n          4 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 21 6 -1.</_>\n        <_>\n          9 0 7 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 15 -1.</_>\n        <_>\n          11 0 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 18 2 -1.</_>\n        <_>\n          2 3 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 17 8 6 -1.</_>\n        <_>\n          8 20 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 2 -1.</_>\n        <_>\n          3 1 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 9 6 -1.</_>\n        <_>\n          11 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 5 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          2 3 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 2 4 9 -1.</_>\n        <_>\n          20 2 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 4 9 -1.</_>\n        <_>\n          2 2 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 4 -1.</_>\n        <_>\n          12 1 12 2 2.</_>\n        <_>\n          0 3 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 6 -1.</_>\n        <_>\n          0 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 9 6 -1.</_>\n        <_>\n          14 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 19 3 -1.</_>\n        <_>\n          0 16 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 22 12 -1.</_>\n        <_>\n          12 5 11 6 2.</_>\n        <_>\n          1 11 11 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 13 6 6 -1.</_>\n        <_>\n          8 13 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 20 3 -1.</_>\n        <_>\n          4 3 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 6 10 -1.</_>\n        <_>\n          10 14 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 12 16 6 -1.</_>\n        <_>\n          14 12 8 3 2.</_>\n        <_>\n          6 15 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 8 9 -1.</_>\n        <_>\n          2 16 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 8 6 14 -1.</_>\n        <_>\n          14 8 3 7 2.</_>\n        <_>\n          11 15 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 16 6 -1.</_>\n        <_>\n          2 12 8 3 2.</_>\n        <_>\n          10 15 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 16 16 8 -1.</_>\n        <_>\n          5 20 16 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 4 12 -1.</_>\n        <_>\n          9 7 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 8 10 -1.</_>\n        <_>\n          12 2 4 5 2.</_>\n        <_>\n          8 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 6 -1.</_>\n        <_>\n          6 6 6 3 2.</_>\n        <_>\n          12 9 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 6 9 -1.</_>\n        <_>\n          12 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 8 12 -1.</_>\n        <_>\n          0 0 4 6 2.</_>\n        <_>\n          4 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 6 9 -1.</_>\n        <_>\n          18 11 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 6 6 -1.</_>\n        <_>\n          5 12 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 21 3 -1.</_>\n        <_>\n          10 21 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 16 6 -1.</_>\n        <_>\n          2 3 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 6 7 6 -1.</_>\n        <_>\n          13 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 4 14 -1.</_>\n        <_>\n          6 11 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 6 9 -1.</_>\n        <_>\n          11 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 6 14 -1.</_>\n        <_>\n          7 8 3 7 2.</_>\n        <_>\n          10 15 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 4 16 -1.</_>\n        <_>\n          18 16 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 6 10 -1.</_>\n        <_>\n          11 14 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 12 5 -1.</_>\n        <_>\n          10 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 23 3 -1.</_>\n        <_>\n          0 13 23 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 12 -1.</_>\n        <_>\n          15 0 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 12 5 -1.</_>\n        <_>\n          4 10 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 2 10 4 -1.</_>\n        <_>\n          13 4 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 12 -1.</_>\n        <_>\n          7 0 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 9 6 -1.</_>\n        <_>\n          14 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 9 6 -1.</_>\n        <_>\n          7 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 18 13 -1.</_>\n        <_>\n          12 11 6 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 18 13 -1.</_>\n        <_>\n          6 11 6 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 12 6 -1.</_>\n        <_>\n          16 16 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 21 3 -1.</_>\n        <_>\n          0 7 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 12 6 -1.</_>\n        <_>\n          16 16 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 6 14 -1.</_>\n        <_>\n          5 14 6 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 19 2 -1.</_>\n        <_>\n          5 11 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 14 4 -1.</_>\n        <_>\n          5 6 14 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 18 4 -1.</_>\n        <_>\n          9 18 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 9 -1.</_>\n        <_>\n          9 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 3 11 4 -1.</_>\n        <_>\n          13 5 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 9 6 -1.</_>\n        <_>\n          5 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 1 4 23 -1.</_>\n        <_>\n          19 1 2 23 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 4 23 -1.</_>\n        <_>\n          3 1 2 23 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 16 18 3 -1.</_>\n        <_>\n          5 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 11 4 -1.</_>\n        <_>\n          0 5 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 20 3 -1.</_>\n        <_>\n          2 17 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 3 13 4 -1.</_>\n        <_>\n          5 5 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 22 15 -1.</_>\n        <_>\n          1 9 11 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 14 3 -1.</_>\n        <_>\n          10 4 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 10 4 -1.</_>\n        <_>\n          8 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 4 -1.</_>\n        <_>\n          11 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 4 6 9 -1.</_>\n        <_>\n          12 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 9 6 -1.</_>\n        <_>\n          4 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 8 10 -1.</_>\n        <_>\n          12 3 4 5 2.</_>\n        <_>\n          8 8 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 16 6 -1.</_>\n        <_>\n          3 6 8 3 2.</_>\n        <_>\n          11 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          5 9 14 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 9 6 -1.</_>\n        <_>\n          4 5 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 18 2 -1.</_>\n        <_>\n          6 4 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 9 6 -1.</_>\n        <_>\n          10 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 3 -1.</_>\n        <_>\n          0 2 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 10 6 -1.</_>\n        <_>\n          0 19 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 18 3 -1.</_>\n        <_>\n          3 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 6 16 -1.</_>\n        <_>\n          2 5 3 8 2.</_>\n        <_>\n          5 13 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 11 6 -1.</_>\n        <_>\n          7 8 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 12 22 -1.</_>\n        <_>\n          5 13 12 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 4 10 -1.</_>\n        <_>\n          10 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 4 18 -1.</_>\n        <_>\n          9 6 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 6 9 -1.</_>\n        <_>\n          18 11 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 15 10 -1.</_>\n        <_>\n          9 7 5 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 6 9 -1.</_>\n        <_>\n          12 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 10 -1.</_>\n        <_>\n          11 9 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 6 10 -1.</_>\n        <_>\n          13 14 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 14 6 10 -1.</_>\n        <_>\n          9 14 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 8 16 9 -1.</_>\n        <_>\n          4 11 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 20 3 -1.</_>\n        <_>\n          2 12 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 13 -1.</_>\n        <_>\n          13 0 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 13 -1.</_>\n        <_>\n          9 0 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 7 -1.</_>\n        <_>\n          9 1 6 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 11 6 9 -1.</_>\n        <_>\n          1 14 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 9 6 -1.</_>\n        <_>\n          8 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 15 6 -1.</_>\n        <_>\n          3 11 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 19 2 -1.</_>\n        <_>\n          5 11 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 7 16 -1.</_>\n        <_>\n          8 14 7 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 9 6 -1.</_>\n        <_>\n          9 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 8 12 -1.</_>\n        <_>\n          0 11 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 18 3 -1.</_>\n        <_>\n          6 5 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 12 6 -1.</_>\n        <_>\n          4 16 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 13 9 4 -1.</_>\n        <_>\n          13 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 14 14 -1.</_>\n        <_>\n          5 8 7 7 2.</_>\n        <_>\n          12 15 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 22 6 -1.</_>\n        <_>\n          12 16 11 3 2.</_>\n        <_>\n          1 19 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 10 10 -1.</_>\n        <_>\n          14 5 5 5 2.</_>\n        <_>\n          9 10 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 10 10 -1.</_>\n        <_>\n          5 5 5 5 2.</_>\n        <_>\n          10 10 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 16 6 -1.</_>\n        <_>\n          12 6 8 3 2.</_>\n        <_>\n          4 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 6 9 -1.</_>\n        <_>\n          0 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 10 8 14 -1.</_>\n        <_>\n          20 10 4 7 2.</_>\n        <_>\n          16 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 12 -1.</_>\n        <_>\n          9 18 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 10 8 12 -1.</_>\n        <_>\n          12 10 4 6 2.</_>\n        <_>\n          8 16 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 4 9 -1.</_>\n        <_>\n          10 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 4 8 16 -1.</_>\n        <_>\n          14 4 4 8 2.</_>\n        <_>\n          10 12 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 10 10 6 -1.</_>\n        <_>\n          7 12 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 14 -1.</_>\n        <_>\n          12 6 7 7 2.</_>\n        <_>\n          5 13 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 20 2 -1.</_>\n        <_>\n          2 12 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 4 16 -1.</_>\n        <_>\n          18 16 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 11 12 10 -1.</_>\n        <_>\n          1 11 6 5 2.</_>\n        <_>\n          7 16 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 12 4 -1.</_>\n        <_>\n          6 11 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 7 -1.</_>\n        <_>\n          12 12 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 4 8 16 -1.</_>\n        <_>\n          14 4 4 8 2.</_>\n        <_>\n          10 12 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 8 16 -1.</_>\n        <_>\n          6 4 4 8 2.</_>\n        <_>\n          10 12 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 9 6 -1.</_>\n        <_>\n          11 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 16 12 -1.</_>\n        <_>\n          1 5 8 6 2.</_>\n        <_>\n          9 11 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 8 -1.</_>\n        <_>\n          9 9 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 3 18 -1.</_>\n        <_>\n          7 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 9 5 14 -1.</_>\n        <_>\n          17 16 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 5 14 -1.</_>\n        <_>\n          2 16 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 10 6 -1.</_>\n        <_>\n          7 7 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 23 18 -1.</_>\n        <_>\n          1 9 23 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 21 3 -1.</_>\n        <_>\n          8 1 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 12 6 -1.</_>\n        <_>\n          3 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 8 8 16 -1.</_>\n        <_>\n          20 8 4 8 2.</_>\n        <_>\n          16 16 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 19 24 4 -1.</_>\n        <_>\n          8 19 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 8 8 16 -1.</_>\n        <_>\n          20 8 4 8 2.</_>\n        <_>\n          16 16 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 8 16 -1.</_>\n        <_>\n          0 8 4 8 2.</_>\n        <_>\n          4 16 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 12 8 10 -1.</_>\n        <_>\n          8 17 8 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 5 8 -1.</_>\n        <_>\n          5 11 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 19 2 -1.</_>\n        <_>\n          4 2 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 24 9 -1.</_>\n        <_>\n          8 12 8 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 13 8 -1.</_>\n        <_>\n          6 4 13 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 3 -1.</_>\n        <_>\n          0 1 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 3 4 11 -1.</_>\n        <_>\n          20 3 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 12 8 -1.</_>\n        <_>\n          12 11 6 4 2.</_>\n        <_>\n          6 15 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 12 6 -1.</_>\n        <_>\n          0 8 6 3 2.</_>\n        <_>\n          6 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 17 18 3 -1.</_>\n        <_>\n          6 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 6 -1.</_>\n        <_>\n          0 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 3 4 9 -1.</_>\n        <_>\n          20 3 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 4 9 -1.</_>\n        <_>\n          2 3 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 9 19 -1.</_>\n        <_>\n          18 0 3 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 9 19 -1.</_>\n        <_>\n          3 0 3 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 8 -1.</_>\n        <_>\n          13 11 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 8 -1.</_>\n        <_>\n          8 11 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 19 3 -1.</_>\n        <_>\n          5 12 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 20 18 4 -1.</_>\n        <_>\n          9 20 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 16 6 -1.</_>\n        <_>\n          6 8 16 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 9 6 -1.</_>\n        <_>\n          9 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 3 4 14 -1.</_>\n        <_>\n          10 10 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 15 12 -1.</_>\n        <_>\n          1 11 15 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 8 5 -1.</_>\n        <_>\n          11 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 9 -1.</_>\n        <_>\n          7 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 12 8 -1.</_>\n        <_>\n          5 5 6 4 2.</_>\n        <_>\n          11 9 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 12 11 6 -1.</_>\n        <_>\n          13 14 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 21 3 -1.</_>\n        <_>\n          0 14 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 8 12 -1.</_>\n        <_>\n          12 1 4 6 2.</_>\n        <_>\n          8 7 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 6 12 -1.</_>\n        <_>\n          1 0 3 6 2.</_>\n        <_>\n          4 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 21 2 -1.</_>\n        <_>\n          2 3 21 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 19 3 -1.</_>\n        <_>\n          2 3 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 10 6 14 -1.</_>\n        <_>\n          20 10 3 7 2.</_>\n        <_>\n          17 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 6 14 -1.</_>\n        <_>\n          1 10 3 7 2.</_>\n        <_>\n          4 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 14 14 -1.</_>\n        <_>\n          14 6 7 7 2.</_>\n        <_>\n          7 13 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 9 6 -1.</_>\n        <_>\n          0 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 8 9 -1.</_>\n        <_>\n          15 17 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 22 4 -1.</_>\n        <_>\n          1 1 11 2 2.</_>\n        <_>\n          12 3 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 9 6 -1.</_>\n        <_>\n          9 13 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 18 3 -1.</_>\n        <_>\n          0 16 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 14 7 9 -1.</_>\n        <_>\n          16 17 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 4 -1.</_>\n        <_>\n          12 3 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 5 -1.</_>\n        <_>\n          7 6 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 4 10 -1.</_>\n        <_>\n          12 1 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 4 10 -1.</_>\n        <_>\n          10 1 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 6 9 -1.</_>\n        <_>\n          15 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 6 9 -1.</_>\n        <_>\n          3 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 3 19 -1.</_>\n        <_>\n          16 1 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 6 9 -1.</_>\n        <_>\n          3 3 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 3 19 -1.</_>\n        <_>\n          16 0 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 12 4 -1.</_>\n        <_>\n          12 3 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 9 -1.</_>\n        <_>\n          10 5 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 3 19 -1.</_>\n        <_>\n          7 0 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 3 12 -1.</_>\n        <_>\n          11 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 5 -1.</_>\n        <_>\n          11 7 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 3 3 18 -1.</_>\n        <_>\n          12 3 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 3 6 12 -1.</_>\n        <_>\n          11 3 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 19 3 -1.</_>\n        <_>\n          3 8 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 18 3 -1.</_>\n        <_>\n          2 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 13 18 4 -1.</_>\n        <_>\n          12 13 9 2 2.</_>\n        <_>\n          3 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 6 9 -1.</_>\n        <_>\n          5 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 20 4 -1.</_>\n        <_>\n          14 1 10 2 2.</_>\n        <_>\n          4 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 20 4 -1.</_>\n        <_>\n          0 1 10 2 2.</_>\n        <_>\n          10 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 6 -1.</_>\n        <_>\n          10 15 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 8 -1.</_>\n        <_>\n          8 2 8 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 18 3 -1.</_>\n        <_>\n          5 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 6 6 -1.</_>\n        <_>\n          11 15 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 8 5 -1.</_>\n        <_>\n          11 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 12 8 5 -1.</_>\n        <_>\n          9 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 14 6 -1.</_>\n        <_>\n          5 2 14 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 5 12 -1.</_>\n        <_>\n          10 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 8 14 -1.</_>\n        <_>\n          7 9 4 7 2.</_>\n        <_>\n          11 16 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 22 6 -1.</_>\n        <_>\n          12 5 11 3 2.</_>\n        <_>\n          1 8 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 6 6 -1.</_>\n        <_>\n          0 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 4 -1.</_>\n        <_>\n          12 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 19 3 -1.</_>\n        <_>\n          2 19 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 4 -1.</_>\n        <_>\n          12 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 18 3 -1.</_>\n        <_>\n          1 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 4 -1.</_>\n        <_>\n          12 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 3 -1.</_>\n        <_>\n          0 1 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 14 4 -1.</_>\n        <_>\n          5 2 14 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 14 9 6 -1.</_>\n        <_>\n          6 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 6 9 -1.</_>\n        <_>\n          14 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 20 13 4 -1.</_>\n        <_>\n          5 22 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 12 -1.</_>\n        <_>\n          9 13 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 21 3 -1.</_>\n        <_>\n          8 10 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 9 6 -1.</_>\n        <_>\n          11 8 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 9 7 -1.</_>\n        <_>\n          6 10 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 10 8 -1.</_>\n        <_>\n          17 10 5 4 2.</_>\n        <_>\n          12 14 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 24 3 -1.</_>\n        <_>\n          8 15 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 9 6 -1.</_>\n        <_>\n          8 7 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 6 9 -1.</_>\n        <_>\n          4 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 4 -1.</_>\n        <_>\n          12 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 6 -1.</_>\n        <_>\n          9 15 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 14 10 -1.</_>\n        <_>\n          16 9 7 5 2.</_>\n        <_>\n          9 14 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 14 10 -1.</_>\n        <_>\n          1 9 7 5 2.</_>\n        <_>\n          8 14 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 9 17 -1.</_>\n        <_>\n          11 7 3 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 6 20 -1.</_>\n        <_>\n          3 4 3 10 2.</_>\n        <_>\n          6 14 3 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 4 9 -1.</_>\n        <_>\n          12 7 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 9 -1.</_>\n        <_>\n          12 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 6 16 -1.</_>\n        <_>\n          3 8 3 8 2.</_>\n        <_>\n          6 16 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 4 -1.</_>\n        <_>\n          12 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 9 4 -1.</_>\n        <_>\n          3 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 9 6 -1.</_>\n        <_>\n          13 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 4 10 -1.</_>\n        <_>\n          5 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 12 6 -1.</_>\n        <_>\n          11 5 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 9 8 -1.</_>\n        <_>\n          9 4 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 10 8 -1.</_>\n        <_>\n          17 16 5 4 2.</_>\n        <_>\n          12 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 10 8 -1.</_>\n        <_>\n          2 16 5 4 2.</_>\n        <_>\n          7 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 4 -1.</_>\n        <_>\n          12 0 12 2 2.</_>\n        <_>\n          0 2 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 9 6 -1.</_>\n        <_>\n          0 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 24 6 -1.</_>\n        <_>\n          12 4 12 3 2.</_>\n        <_>\n          0 7 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 11 4 -1.</_>\n        <_>\n          5 2 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 22 4 -1.</_>\n        <_>\n          12 1 11 2 2.</_>\n        <_>\n          1 3 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 18 -1.</_>\n        <_>\n          9 15 6 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 20 4 -1.</_>\n        <_>\n          2 11 20 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 14 14 -1.</_>\n        <_>\n          5 9 14 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 16 6 -1.</_>\n        <_>\n          4 5 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 19 3 -1.</_>\n        <_>\n          2 4 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 10 4 -1.</_>\n        <_>\n          7 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 4 15 -1.</_>\n        <_>\n          0 14 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 21 3 -1.</_>\n        <_>\n          2 11 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 6 -1.</_>\n        <_>\n          6 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 14 9 -1.</_>\n        <_>\n          6 7 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 9 -1.</_>\n        <_>\n          11 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 9 9 -1.</_>\n        <_>\n          15 11 9 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 4 21 -1.</_>\n        <_>\n          8 7 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 22 19 2 -1.</_>\n        <_>\n          3 23 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 20 3 -1.</_>\n        <_>\n          2 16 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 0 4 13 -1.</_>\n        <_>\n          19 0 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 8 8 -1.</_>\n        <_>\n          1 11 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 6 9 -1.</_>\n        <_>\n          14 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 6 9 -1.</_>\n        <_>\n          4 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 4 10 -1.</_>\n        <_>\n          14 5 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 4 10 -1.</_>\n        <_>\n          8 5 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 6 6 -1.</_>\n        <_>\n          14 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 6 6 -1.</_>\n        <_>\n          4 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 21 -1.</_>\n        <_>\n          8 2 8 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 6 13 -1.</_>\n        <_>\n          3 2 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 0 4 21 -1.</_>\n        <_>\n          20 0 2 21 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 4 20 -1.</_>\n        <_>\n          2 4 2 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 16 9 6 -1.</_>\n        <_>\n          8 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 12 7 9 -1.</_>\n        <_>\n          16 15 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 21 14 3 -1.</_>\n        <_>\n          12 21 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 5 6 9 -1.</_>\n        <_>\n          11 5 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 10 -1.</_>\n        <_>\n          12 5 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 9 -1.</_>\n        <_>\n          10 5 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 10 4 -1.</_>\n        <_>\n          14 16 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 14 14 -1.</_>\n        <_>\n          5 5 7 7 2.</_>\n        <_>\n          12 12 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 12 6 -1.</_>\n        <_>\n          18 8 6 3 2.</_>\n        <_>\n          12 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 12 -1.</_>\n        <_>\n          6 6 6 6 2.</_>\n        <_>\n          12 12 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 13 6 10 -1.</_>\n        <_>\n          13 13 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 20 8 -1.</_>\n        <_>\n          1 10 10 4 2.</_>\n        <_>\n          11 14 10 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 13 9 6 -1.</_>\n        <_>\n          15 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          9 3 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 5 14 -1.</_>\n        <_>\n          10 8 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 16 6 -1.</_>\n        <_>\n          3 6 16 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 3 8 9 -1.</_>\n        <_>\n          16 6 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 6 10 -1.</_>\n        <_>\n          9 13 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 13 9 6 -1.</_>\n        <_>\n          15 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 9 6 -1.</_>\n        <_>\n          0 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 16 9 6 -1.</_>\n        <_>\n          13 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 9 6 -1.</_>\n        <_>\n          2 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 16 18 3 -1.</_>\n        <_>\n          5 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 18 3 -1.</_>\n        <_>\n          1 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 18 3 -1.</_>\n        <_>\n          5 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 19 2 -1.</_>\n        <_>\n          1 2 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 2 6 11 -1.</_>\n        <_>\n          16 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 15 15 6 -1.</_>\n        <_>\n          9 15 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 2 6 11 -1.</_>\n        <_>\n          16 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 6 11 -1.</_>\n        <_>\n          6 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          18 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 4 -1.</_>\n        <_>\n          1 2 11 2 2.</_>\n        <_>\n          12 4 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 21 12 -1.</_>\n        <_>\n          9 0 7 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 18 3 -1.</_>\n        <_>\n          0 13 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 6 9 -1.</_>\n        <_>\n          14 2 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 18 3 -1.</_>\n        <_>\n          3 11 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 3 8 9 -1.</_>\n        <_>\n          16 6 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 3 -1.</_>\n        <_>\n          3 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 6 9 -1.</_>\n        <_>\n          11 11 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 6 9 -1.</_>\n        <_>\n          11 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 2 18 -1.</_>\n        <_>\n          15 0 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 2 18 -1.</_>\n        <_>\n          8 0 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 7 9 -1.</_>\n        <_>\n          17 6 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 9 6 -1.</_>\n        <_>\n          3 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 21 3 -1.</_>\n        <_>\n          3 19 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 7 9 -1.</_>\n        <_>\n          0 6 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 22 3 -1.</_>\n        <_>\n          2 8 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 16 -1.</_>\n        <_>\n          0 3 12 8 2.</_>\n        <_>\n          12 11 12 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 17 9 4 -1.</_>\n        <_>\n          13 19 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 12 8 -1.</_>\n        <_>\n          5 5 6 4 2.</_>\n        <_>\n          11 9 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          12 6 7 3 2.</_>\n        <_>\n          5 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 16 14 6 -1.</_>\n        <_>\n          5 16 7 3 2.</_>\n        <_>\n          12 19 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          18 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 9 -1.</_>\n        <_>\n          0 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 20 10 -1.</_>\n        <_>\n          13 4 10 5 2.</_>\n        <_>\n          3 9 10 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 9 8 -1.</_>\n        <_>\n          5 13 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 21 15 -1.</_>\n        <_>\n          9 1 7 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 12 14 8 -1.</_>\n        <_>\n          12 12 7 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 4 -1.</_>\n        <_>\n          6 7 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 9 6 -1.</_>\n        <_>\n          9 5 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 6 -1.</_>\n        <_>\n          13 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 6 -1.</_>\n        <_>\n          8 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 18 2 -1.</_>\n        <_>\n          6 5 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 11 -1.</_>\n        <_>\n          2 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 15 -1.</_>\n        <_>\n          20 0 2 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 13 -1.</_>\n        <_>\n          2 0 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          8 2 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 13 18 4 -1.</_>\n        <_>\n          12 13 9 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 10 4 -1.</_>\n        <_>\n          9 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 12 3 -1.</_>\n        <_>\n          11 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 19 3 -1.</_>\n        <_>\n          4 15 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 4 20 -1.</_>\n        <_>\n          10 10 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 9 6 -1.</_>\n        <_>\n          8 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 15 4 -1.</_>\n        <_>\n          7 9 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 12 7 -1.</_>\n        <_>\n          12 4 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 6 9 -1.</_>\n        <_>\n          0 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 5 6 9 -1.</_>\n        <_>\n          18 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 16 6 -1.</_>\n        <_>\n          0 18 8 3 2.</_>\n        <_>\n          8 21 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 18 14 6 -1.</_>\n        <_>\n          16 18 7 3 2.</_>\n        <_>\n          9 21 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 20 4 -1.</_>\n        <_>\n          1 20 10 2 2.</_>\n        <_>\n          11 22 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 20 6 -1.</_>\n        <_>\n          12 8 10 3 2.</_>\n        <_>\n          2 11 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 6 9 -1.</_>\n        <_>\n          9 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 12 8 -1.</_>\n        <_>\n          12 5 4 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 12 8 -1.</_>\n        <_>\n          8 5 4 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 6 16 -1.</_>\n        <_>\n          4 0 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 4 6 12 -1.</_>\n        <_>\n          15 8 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 6 12 -1.</_>\n        <_>\n          3 8 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 15 22 -1.</_>\n        <_>\n          4 11 15 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 9 6 -1.</_>\n        <_>\n          0 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 6 -1.</_>\n        <_>\n          0 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 8 10 -1.</_>\n        <_>\n          14 0 4 5 2.</_>\n        <_>\n          10 5 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 4 16 -1.</_>\n        <_>\n          3 0 2 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 12 4 10 -1.</_>\n        <_>\n          10 17 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 10 6 -1.</_>\n        <_>\n          8 6 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 22 18 2 -1.</_>\n        <_>\n          12 22 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 11 6 -1.</_>\n        <_>\n          7 9 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 12 10 -1.</_>\n        <_>\n          0 0 6 5 2.</_>\n        <_>\n          6 5 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 12 6 -1.</_>\n        <_>\n          16 1 6 3 2.</_>\n        <_>\n          10 4 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 16 9 4 -1.</_>\n        <_>\n          7 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 15 16 -1.</_>\n        <_>\n          10 7 5 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 12 13 -1.</_>\n        <_>\n          11 10 6 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 12 6 -1.</_>\n        <_>\n          12 2 6 3 2.</_>\n        <_>\n          6 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 12 9 -1.</_>\n        <_>\n          3 12 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 2 8 6 -1.</_>\n        <_>\n          16 5 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 8 6 -1.</_>\n        <_>\n          0 5 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 11 -1.</_>\n        <_>\n          0 3 12 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 8 10 -1.</_>\n        <_>\n          0 13 4 5 2.</_>\n        <_>\n          4 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 4 10 -1.</_>\n        <_>\n          10 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 21 -1.</_>\n        <_>\n          10 9 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 15 9 -1.</_>\n        <_>\n          4 7 15 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 6 -1.</_>\n        <_>\n          8 1 8 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 5 16 -1.</_>\n        <_>\n          9 14 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          9 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 3 12 -1.</_>\n        <_>\n          6 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 9 8 -1.</_>\n        <_>\n          8 6 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 20 2 -1.</_>\n        <_>\n          4 4 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 18 3 -1.</_>\n        <_>\n          8 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 15 10 6 -1.</_>\n        <_>\n          7 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 4 18 -1.</_>\n        <_>\n          1 4 2 9 2.</_>\n        <_>\n          3 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 9 -1.</_>\n        <_>\n          15 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 9 -1.</_>\n        <_>\n          7 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 9 6 -1.</_>\n        <_>\n          9 7 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 2 -1.</_>\n        <_>\n          3 1 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 20 4 -1.</_>\n        <_>\n          0 10 10 2 2.</_>\n        <_>\n          10 12 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 12 -1.</_>\n        <_>\n          10 8 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 6 12 -1.</_>\n        <_>\n          6 5 3 6 2.</_>\n        <_>\n          9 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 22 -1.</_>\n        <_>\n          15 0 9 11 2.</_>\n        <_>\n          6 11 9 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 18 22 -1.</_>\n        <_>\n          0 0 9 11 2.</_>\n        <_>\n          9 11 9 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 11 -1.</_>\n        <_>\n          20 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 11 -1.</_>\n        <_>\n          2 2 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 20 3 -1.</_>\n        <_>\n          0 1 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 20 2 -1.</_>\n        <_>\n          2 3 20 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 2 -1.</_>\n        <_>\n          1 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 7 6 9 -1.</_>\n        <_>\n          18 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 22 9 -1.</_>\n        <_>\n          0 3 22 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 6 9 -1.</_>\n        <_>\n          17 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 6 9 -1.</_>\n        <_>\n          0 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 6 -1.</_>\n        <_>\n          0 8 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 10 -1.</_>\n        <_>\n          2 2 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 9 -1.</_>\n        <_>\n          17 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 9 -1.</_>\n        <_>\n          5 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 9 6 -1.</_>\n        <_>\n          15 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 23 6 -1.</_>\n        <_>\n          0 17 23 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 15 18 3 -1.</_>\n        <_>\n          5 16 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 6 -1.</_>\n        <_>\n          0 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 8 10 -1.</_>\n        <_>\n          13 8 4 5 2.</_>\n        <_>\n          9 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 15 6 -1.</_>\n        <_>\n          8 7 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 8 10 -1.</_>\n        <_>\n          13 8 4 5 2.</_>\n        <_>\n          9 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 12 -1.</_>\n        <_>\n          8 0 3 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 8 10 -1.</_>\n        <_>\n          13 8 4 5 2.</_>\n        <_>\n          9 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 6 9 -1.</_>\n        <_>\n          10 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          12 6 2 9 2.</_>\n        <_>\n          10 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 12 4 -1.</_>\n        <_>\n          11 7 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 8 10 -1.</_>\n        <_>\n          13 8 4 5 2.</_>\n        <_>\n          9 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 8 10 -1.</_>\n        <_>\n          7 8 4 5 2.</_>\n        <_>\n          11 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 10 6 14 -1.</_>\n        <_>\n          14 10 3 7 2.</_>\n        <_>\n          11 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 6 19 -1.</_>\n        <_>\n          12 5 3 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 12 12 6 -1.</_>\n        <_>\n          12 12 6 3 2.</_>\n        <_>\n          6 15 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 18 6 -1.</_>\n        <_>\n          1 9 9 3 2.</_>\n        <_>\n          10 12 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 14 8 10 -1.</_>\n        <_>\n          20 14 4 5 2.</_>\n        <_>\n          16 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 22 8 -1.</_>\n        <_>\n          0 9 11 4 2.</_>\n        <_>\n          11 13 11 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 12 6 -1.</_>\n        <_>\n          14 18 6 3 2.</_>\n        <_>\n          8 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 20 18 -1.</_>\n        <_>\n          0 6 10 9 2.</_>\n        <_>\n          10 15 10 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 20 12 -1.</_>\n        <_>\n          13 6 10 6 2.</_>\n        <_>\n          3 12 10 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 10 8 -1.</_>\n        <_>\n          0 16 5 4 2.</_>\n        <_>\n          5 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 19 3 -1.</_>\n        <_>\n          0 12 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 6 6 9 -1.</_>\n        <_>\n          14 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 22 4 -1.</_>\n        <_>\n          1 7 11 2 2.</_>\n        <_>\n          12 9 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 6 7 12 -1.</_>\n        <_>\n          13 10 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 11 9 -1.</_>\n        <_>\n          4 10 11 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 10 8 -1.</_>\n        <_>\n          17 10 5 4 2.</_>\n        <_>\n          12 14 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 9 7 -1.</_>\n        <_>\n          5 12 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 14 6 9 -1.</_>\n        <_>\n          16 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 6 12 -1.</_>\n        <_>\n          3 16 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 6 6 -1.</_>\n        <_>\n          14 16 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 6 9 -1.</_>\n        <_>\n          10 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 23 -1.</_>\n        <_>\n          11 1 2 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 6 -1.</_>\n        <_>\n          0 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 17 18 3 -1.</_>\n        <_>\n          4 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 13 14 -1.</_>\n        <_>\n          5 9 13 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 8 12 -1.</_>\n        <_>\n          19 0 4 6 2.</_>\n        <_>\n          15 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 8 12 -1.</_>\n        <_>\n          0 0 4 6 2.</_>\n        <_>\n          4 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 8 7 -1.</_>\n        <_>\n          8 2 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 6 9 -1.</_>\n        <_>\n          3 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 8 6 12 -1.</_>\n        <_>\n          17 8 3 6 2.</_>\n        <_>\n          14 14 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 8 6 12 -1.</_>\n        <_>\n          4 8 3 6 2.</_>\n        <_>\n          7 14 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 5 5 15 -1.</_>\n        <_>\n          16 10 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 5 15 -1.</_>\n        <_>\n          3 10 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 9 -1.</_>\n        <_>\n          18 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 6 15 -1.</_>\n        <_>\n          1 12 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 15 12 8 -1.</_>\n        <_>\n          17 15 6 4 2.</_>\n        <_>\n          11 19 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          0 2 12 2 2.</_>\n        <_>\n          12 4 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 2 19 -1.</_>\n        <_>\n          15 1 1 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 2 19 -1.</_>\n        <_>\n          8 1 1 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          22 1 2 20 -1.</_>\n        <_>\n          22 1 1 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 2 20 -1.</_>\n        <_>\n          1 1 1 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 11 6 12 -1.</_>\n        <_>\n          20 11 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 6 12 -1.</_>\n        <_>\n          2 11 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 14 -1.</_>\n        <_>\n          3 13 18 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 10 7 8 -1.</_>\n        <_>\n          6 14 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 12 12 -1.</_>\n        <_>\n          7 13 12 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 18 5 -1.</_>\n        <_>\n          11 18 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 21 20 3 -1.</_>\n        <_>\n          4 22 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 12 -1.</_>\n        <_>\n          9 12 3 6 2.</_>\n        <_>\n          12 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 18 3 -1.</_>\n        <_>\n          4 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 3 -1.</_>\n        <_>\n          3 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 9 -1.</_>\n        <_>\n          18 7 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 9 6 -1.</_>\n        <_>\n          2 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 18 4 -1.</_>\n        <_>\n          13 14 9 2 2.</_>\n        <_>\n          4 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 6 14 -1.</_>\n        <_>\n          7 7 3 7 2.</_>\n        <_>\n          10 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 12 6 -1.</_>\n        <_>\n          13 13 6 3 2.</_>\n        <_>\n          7 16 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 9 -1.</_>\n        <_>\n          10 7 4 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 12 6 6 -1.</_>\n        <_>\n          12 12 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 4 10 -1.</_>\n        <_>\n          0 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 9 6 -1.</_>\n        <_>\n          11 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 12 6 -1.</_>\n        <_>\n          2 12 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 6 9 -1.</_>\n        <_>\n          13 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 6 9 -1.</_>\n        <_>\n          5 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 9 6 -1.</_>\n        <_>\n          9 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 16 12 6 -1.</_>\n        <_>\n          5 19 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 20 3 -1.</_>\n        <_>\n          3 3 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 12 6 -1.</_>\n        <_>\n          6 5 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 3 24 -1.</_>\n        <_>\n          12 0 1 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 15 4 -1.</_>\n        <_>\n          8 16 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 12 -1.</_>\n        <_>\n          9 18 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 12 8 -1.</_>\n        <_>\n          1 15 6 4 2.</_>\n        <_>\n          7 19 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 10 8 14 -1.</_>\n        <_>\n          19 10 4 7 2.</_>\n        <_>\n          15 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 8 14 -1.</_>\n        <_>\n          1 9 4 7 2.</_>\n        <_>\n          5 16 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 9 10 -1.</_>\n        <_>\n          9 16 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 6 -1.</_>\n        <_>\n          6 9 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 9 -1.</_>\n        <_>\n          12 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 9 7 -1.</_>\n        <_>\n          10 8 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 4 8 10 -1.</_>\n        <_>\n          14 4 4 5 2.</_>\n        <_>\n          10 9 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 6 9 -1.</_>\n        <_>\n          4 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 12 -1.</_>\n        <_>\n          8 6 8 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 6 14 -1.</_>\n        <_>\n          6 7 3 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 8 5 8 -1.</_>\n        <_>\n          19 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 5 8 -1.</_>\n        <_>\n          0 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 6 6 -1.</_>\n        <_>\n          17 6 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 6 6 -1.</_>\n        <_>\n          1 6 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 9 -1.</_>\n        <_>\n          18 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 9 -1.</_>\n        <_>\n          0 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 18 6 -1.</_>\n        <_>\n          3 5 18 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 9 6 -1.</_>\n        <_>\n          2 5 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 3 10 8 -1.</_>\n        <_>\n          14 3 5 4 2.</_>\n        <_>\n          9 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 3 10 8 -1.</_>\n        <_>\n          5 3 5 4 2.</_>\n        <_>\n          10 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 11 6 12 -1.</_>\n        <_>\n          10 11 3 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 11 6 11 -1.</_>\n        <_>\n          11 11 3 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 7 -1.</_>\n        <_>\n          12 6 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 18 18 3 -1.</_>\n        <_>\n          5 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 6 9 -1.</_>\n        <_>\n          10 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 9 7 -1.</_>\n        <_>\n          11 1 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 6 6 -1.</_>\n        <_>\n          9 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 4 11 -1.</_>\n        <_>\n          14 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 12 4 11 -1.</_>\n        <_>\n          8 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 12 18 -1.</_>\n        <_>\n          12 0 4 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 10 5 -1.</_>\n        <_>\n          7 12 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 20 22 3 -1.</_>\n        <_>\n          2 21 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 2 20 -1.</_>\n        <_>\n          1 4 1 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 4 -1.</_>\n        <_>\n          8 2 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 10 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 8 10 -1.</_>\n        <_>\n          6 7 4 5 2.</_>\n        <_>\n          10 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 14 -1.</_>\n        <_>\n          17 0 3 7 2.</_>\n        <_>\n          14 7 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 11 5 8 -1.</_>\n        <_>\n          4 15 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 20 9 -1.</_>\n        <_>\n          2 3 20 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 8 -1.</_>\n        <_>\n          6 7 6 4 2.</_>\n        <_>\n          12 11 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 17 6 6 -1.</_>\n        <_>\n          9 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 10 10 4 -1.</_>\n        <_>\n          7 12 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 9 -1.</_>\n        <_>\n          10 5 4 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 8 -1.</_>\n        <_>\n          8 11 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 4 17 -1.</_>\n        <_>\n          18 4 2 17 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 6 -1.</_>\n        <_>\n          3 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 4 17 -1.</_>\n        <_>\n          18 4 2 17 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 4 17 -1.</_>\n        <_>\n          4 4 2 17 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 18 19 3 -1.</_>\n        <_>\n          5 19 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 2 18 -1.</_>\n        <_>\n          11 9 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 4 2 18 -1.</_>\n        <_>\n          15 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 2 18 -1.</_>\n        <_>\n          7 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 11 10 8 -1.</_>\n        <_>\n          12 11 5 4 2.</_>\n        <_>\n          7 15 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          12 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 9 -1.</_>\n        <_>\n          12 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 16 8 -1.</_>\n        <_>\n          2 9 8 4 2.</_>\n        <_>\n          10 13 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 6 9 -1.</_>\n        <_>\n          14 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 6 9 -1.</_>\n        <_>\n          10 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 6 9 -1.</_>\n        <_>\n          14 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 12 6 -1.</_>\n        <_>\n          3 14 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 9 6 -1.</_>\n        <_>\n          14 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 9 6 -1.</_>\n        <_>\n          1 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 3 -1.</_>\n        <_>\n          3 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 22 6 -1.</_>\n        <_>\n          1 9 22 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 4 6 6 -1.</_>\n        <_>\n          18 7 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 6 6 -1.</_>\n        <_>\n          0 7 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 16 6 -1.</_>\n        <_>\n          5 14 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 9 4 -1.</_>\n        <_>\n          6 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 6 9 -1.</_>\n        <_>\n          14 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 15 6 9 -1.</_>\n        <_>\n          4 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 6 23 -1.</_>\n        <_>\n          17 1 2 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 21 24 3 -1.</_>\n        <_>\n          8 21 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 24 4 -1.</_>\n        <_>\n          8 20 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 6 23 -1.</_>\n        <_>\n          5 1 2 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 18 3 -1.</_>\n        <_>\n          3 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 22 4 -1.</_>\n        <_>\n          12 16 11 2 2.</_>\n        <_>\n          1 18 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 6 -1.</_>\n        <_>\n          0 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 21 3 -1.</_>\n        <_>\n          9 10 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 12 6 -1.</_>\n        <_>\n          2 18 6 3 2.</_>\n        <_>\n          8 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 24 4 -1.</_>\n        <_>\n          0 7 24 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 6 12 -1.</_>\n        <_>\n          10 13 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 6 9 -1.</_>\n        <_>\n          8 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 6 9 -1.</_>\n        <_>\n          11 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 20 3 -1.</_>\n        <_>\n          2 2 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 12 6 -1.</_>\n        <_>\n          1 18 6 3 2.</_>\n        <_>\n          7 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 2 4 13 -1.</_>\n        <_>\n          13 2 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 4 -1.</_>\n        <_>\n          12 7 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 4 13 -1.</_>\n        <_>\n          10 1 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 3 18 -1.</_>\n        <_>\n          7 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 3 10 5 -1.</_>\n        <_>\n          14 3 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 15 12 8 -1.</_>\n        <_>\n          10 15 4 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 9 -1.</_>\n        <_>\n          11 10 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 4 9 -1.</_>\n        <_>\n          10 3 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 6 14 -1.</_>\n        <_>\n          20 0 3 7 2.</_>\n        <_>\n          17 7 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 6 14 -1.</_>\n        <_>\n          1 0 3 7 2.</_>\n        <_>\n          4 7 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 16 -1.</_>\n        <_>\n          17 0 3 8 2.</_>\n        <_>\n          14 8 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 4 10 -1.</_>\n        <_>\n          9 4 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 18 6 -1.</_>\n        <_>\n          12 17 9 3 2.</_>\n        <_>\n          3 20 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 22 4 -1.</_>\n        <_>\n          12 20 11 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 3 10 5 -1.</_>\n        <_>\n          14 3 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 10 5 -1.</_>\n        <_>\n          5 3 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 12 16 -1.</_>\n        <_>\n          16 6 4 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 12 16 -1.</_>\n        <_>\n          4 6 4 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 9 5 15 -1.</_>\n        <_>\n          10 14 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 21 2 -1.</_>\n        <_>\n          1 19 21 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 9 6 -1.</_>\n        <_>\n          15 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 12 4 -1.</_>\n        <_>\n          12 1 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 12 -1.</_>\n        <_>\n          12 0 6 6 2.</_>\n        <_>\n          6 6 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 10 8 12 -1.</_>\n        <_>\n          8 10 4 6 2.</_>\n        <_>\n          12 16 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 16 10 8 -1.</_>\n        <_>\n          19 16 5 4 2.</_>\n        <_>\n          14 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 10 8 -1.</_>\n        <_>\n          0 16 5 4 2.</_>\n        <_>\n          5 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 12 12 5 -1.</_>\n        <_>\n          14 12 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 10 8 -1.</_>\n        <_>\n          6 16 5 4 2.</_>\n        <_>\n          11 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 6 -1.</_>\n        <_>\n          13 6 6 3 2.</_>\n        <_>\n          7 9 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 4 18 -1.</_>\n        <_>\n          9 6 2 9 2.</_>\n        <_>\n          11 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 9 6 14 -1.</_>\n        <_>\n          13 9 3 7 2.</_>\n        <_>\n          10 16 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 6 14 -1.</_>\n        <_>\n          8 9 3 7 2.</_>\n        <_>\n          11 16 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 11 12 -1.</_>\n        <_>\n          7 10 11 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 8 6 16 -1.</_>\n        <_>\n          4 8 3 8 2.</_>\n        <_>\n          7 16 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 3 4 21 -1.</_>\n        <_>\n          17 10 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 4 21 -1.</_>\n        <_>\n          3 10 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 8 18 -1.</_>\n        <_>\n          14 1 4 9 2.</_>\n        <_>\n          10 10 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 16 8 -1.</_>\n        <_>\n          2 5 8 4 2.</_>\n        <_>\n          10 9 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 12 -1.</_>\n        <_>\n          3 10 18 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 16 12 -1.</_>\n        <_>\n          4 14 16 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 4 8 20 -1.</_>\n        <_>\n          19 4 4 10 2.</_>\n        <_>\n          15 14 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 9 6 -1.</_>\n        <_>\n          10 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 4 8 20 -1.</_>\n        <_>\n          19 4 4 10 2.</_>\n        <_>\n          15 14 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 8 20 -1.</_>\n        <_>\n          1 4 4 10 2.</_>\n        <_>\n          5 14 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 8 8 14 -1.</_>\n        <_>\n          15 8 4 7 2.</_>\n        <_>\n          11 15 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 8 14 -1.</_>\n        <_>\n          5 8 4 7 2.</_>\n        <_>\n          9 15 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 13 5 8 -1.</_>\n        <_>\n          10 17 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 7 9 -1.</_>\n        <_>\n          4 16 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 24 10 -1.</_>\n        <_>\n          0 18 24 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 8 11 -1.</_>\n        <_>\n          8 2 4 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 8 16 -1.</_>\n        <_>\n          14 2 4 8 2.</_>\n        <_>\n          10 10 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 6 -1.</_>\n        <_>\n          0 2 12 3 2.</_>\n        <_>\n          12 5 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 9 -1.</_>\n        <_>\n          6 3 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 12 12 -1.</_>\n        <_>\n          1 2 6 6 2.</_>\n        <_>\n          7 8 6 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 5 6 9 -1.</_>\n        <_>\n          18 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 8 10 -1.</_>\n        <_>\n          4 3 4 5 2.</_>\n        <_>\n          8 8 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 21 18 3 -1.</_>\n        <_>\n          6 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 2 -1.</_>\n        <_>\n          1 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 22 3 -1.</_>\n        <_>\n          1 11 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 12 9 -1.</_>\n        <_>\n          2 11 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 12 6 -1.</_>\n        <_>\n          18 8 6 3 2.</_>\n        <_>\n          12 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 12 6 -1.</_>\n        <_>\n          0 8 6 3 2.</_>\n        <_>\n          6 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 9 -1.</_>\n        <_>\n          12 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 9 6 -1.</_>\n        <_>\n          7 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 7 12 -1.</_>\n        <_>\n          9 14 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 9 6 -1.</_>\n        <_>\n          7 13 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 15 18 4 -1.</_>\n        <_>\n          12 15 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 4 16 -1.</_>\n        <_>\n          7 4 2 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 9 -1.</_>\n        <_>\n          12 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 6 9 -1.</_>\n        <_>\n          10 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 12 10 -1.</_>\n        <_>\n          15 11 6 5 2.</_>\n        <_>\n          9 16 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 14 6 -1.</_>\n        <_>\n          3 8 14 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 17 8 -1.</_>\n        <_>\n          4 6 17 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 12 21 -1.</_>\n        <_>\n          6 9 12 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 9 9 -1.</_>\n        <_>\n          8 4 9 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 24 3 -1.</_>\n        <_>\n          12 7 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 9 10 -1.</_>\n        <_>\n          11 11 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 18 3 -1.</_>\n        <_>\n          2 12 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 16 9 4 -1.</_>\n        <_>\n          8 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 9 6 -1.</_>\n        <_>\n          0 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 24 6 -1.</_>\n        <_>\n          0 13 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 9 20 6 -1.</_>\n        <_>\n          2 12 20 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 16 12 -1.</_>\n        <_>\n          12 5 8 6 2.</_>\n        <_>\n          4 11 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 10 4 -1.</_>\n        <_>\n          7 5 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 6 8 -1.</_>\n        <_>\n          9 19 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 7 10 -1.</_>\n        <_>\n          17 5 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 7 10 -1.</_>\n        <_>\n          0 5 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 1 6 12 -1.</_>\n        <_>\n          19 1 3 6 2.</_>\n        <_>\n          16 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 19 8 -1.</_>\n        <_>\n          1 4 19 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 9 4 -1.</_>\n        <_>\n          12 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 9 4 -1.</_>\n        <_>\n          3 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 10 6 -1.</_>\n        <_>\n          12 4 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 18 2 -1.</_>\n        <_>\n          12 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 4 9 -1.</_>\n        <_>\n          12 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 4 9 -1.</_>\n        <_>\n          10 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 8 10 -1.</_>\n        <_>\n          14 5 4 5 2.</_>\n        <_>\n          10 10 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 13 -1.</_>\n        <_>\n          10 4 4 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 5 6 6 -1.</_>\n        <_>\n          13 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 12 3 -1.</_>\n        <_>\n          7 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 10 6 -1.</_>\n        <_>\n          7 7 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 21 5 -1.</_>\n        <_>\n          9 0 7 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 9 9 -1.</_>\n        <_>\n          0 11 9 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 7 -1.</_>\n        <_>\n          3 3 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 18 12 6 -1.</_>\n        <_>\n          15 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 20 6 -1.</_>\n        <_>\n          2 8 10 3 2.</_>\n        <_>\n          12 11 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 2 10 4 -1.</_>\n        <_>\n          13 4 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 5 18 -1.</_>\n        <_>\n          4 11 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 4 4 9 -1.</_>\n        <_>\n          20 4 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 8 14 -1.</_>\n        <_>\n          8 13 8 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 6 -1.</_>\n        <_>\n          12 1 12 3 2.</_>\n        <_>\n          0 4 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 4 9 -1.</_>\n        <_>\n          2 4 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 3 -1.</_>\n        <_>\n          3 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 16 6 -1.</_>\n        <_>\n          3 19 16 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 6 6 9 -1.</_>\n        <_>\n          13 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          5 6 7 3 2.</_>\n        <_>\n          12 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 5 8 10 -1.</_>\n        <_>\n          17 5 4 5 2.</_>\n        <_>\n          13 10 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 20 3 -1.</_>\n        <_>\n          2 3 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 9 6 -1.</_>\n        <_>\n          12 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 3 4 11 -1.</_>\n        <_>\n          12 3 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 4 11 -1.</_>\n        <_>\n          10 3 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 8 10 -1.</_>\n        <_>\n          12 3 4 5 2.</_>\n        <_>\n          8 8 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 2 18 -1.</_>\n        <_>\n          12 1 1 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 9 6 -1.</_>\n        <_>\n          12 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 19 3 -1.</_>\n        <_>\n          0 3 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 9 6 -1.</_>\n        <_>\n          9 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 18 5 -1.</_>\n        <_>\n          7 8 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 6 4 15 -1.</_>\n        <_>\n          13 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 18 3 -1.</_>\n        <_>\n          1 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 14 6 -1.</_>\n        <_>\n          9 9 14 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 18 3 -1.</_>\n        <_>\n          2 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 12 6 -1.</_>\n        <_>\n          0 8 6 3 2.</_>\n        <_>\n          6 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 13 7 8 -1.</_>\n        <_>\n          9 17 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 17 20 3 -1.</_>\n        <_>\n          2 18 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 15 4 -1.</_>\n        <_>\n          4 2 15 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 2 6 6 -1.</_>\n        <_>\n          17 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          0 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 9 6 -1.</_>\n        <_>\n          0 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 18 12 6 -1.</_>\n        <_>\n          15 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 6 9 -1.</_>\n        <_>\n          3 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 13 8 10 -1.</_>\n        <_>\n          20 13 4 5 2.</_>\n        <_>\n          16 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 24 4 -1.</_>\n        <_>\n          8 14 8 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 18 6 6 -1.</_>\n        <_>\n          13 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 8 10 -1.</_>\n        <_>\n          0 13 4 5 2.</_>\n        <_>\n          4 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 24 6 -1.</_>\n        <_>\n          0 17 24 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 12 8 -1.</_>\n        <_>\n          5 2 6 4 2.</_>\n        <_>\n          11 6 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 9 6 -1.</_>\n        <_>\n          11 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 4 -1.</_>\n        <_>\n          4 5 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 10 -1.</_>\n        <_>\n          10 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 4 5 8 -1.</_>\n        <_>\n          8 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 5 9 12 -1.</_>\n        <_>\n          11 9 9 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 9 12 -1.</_>\n        <_>\n          4 9 9 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 6 6 9 -1.</_>\n        <_>\n          14 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 20 12 -1.</_>\n        <_>\n          2 8 20 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 17 16 -1.</_>\n        <_>\n          4 12 17 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 7 6 -1.</_>\n        <_>\n          8 10 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 23 2 -1.</_>\n        <_>\n          1 10 23 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 3 4 9 -1.</_>\n        <_>\n          13 3 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 6 13 -1.</_>\n        <_>\n          10 1 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 22 18 2 -1.</_>\n        <_>\n          4 23 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 9 6 -1.</_>\n        <_>\n          6 10 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 2 24 -1.</_>\n        <_>\n          14 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 2 24 -1.</_>\n        <_>\n          9 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 18 10 -1.</_>\n        <_>\n          9 2 6 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 15 6 -1.</_>\n        <_>\n          9 13 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          9 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 4 11 -1.</_>\n        <_>\n          11 1 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 10 4 -1.</_>\n        <_>\n          9 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 18 -1.</_>\n        <_>\n          12 0 5 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 6 16 -1.</_>\n        <_>\n          14 1 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 6 16 -1.</_>\n        <_>\n          8 1 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 6 -1.</_>\n        <_>\n          18 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 18 2 -1.</_>\n        <_>\n          3 6 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 6 -1.</_>\n        <_>\n          18 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 6 -1.</_>\n        <_>\n          0 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 11 6 -1.</_>\n        <_>\n          13 13 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 10 4 -1.</_>\n        <_>\n          10 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 10 7 -1.</_>\n        <_>\n          11 9 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 10 7 -1.</_>\n        <_>\n          8 9 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 4 6 6 -1.</_>\n        <_>\n          16 4 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 10 8 -1.</_>\n        <_>\n          5 6 5 4 2.</_>\n        <_>\n          10 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 21 16 3 -1.</_>\n        <_>\n          7 21 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 21 16 3 -1.</_>\n        <_>\n          9 21 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 22 14 -1.</_>\n        <_>\n          13 5 11 7 2.</_>\n        <_>\n          2 12 11 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 8 10 -1.</_>\n        <_>\n          3 10 4 5 2.</_>\n        <_>\n          7 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 6 12 -1.</_>\n        <_>\n          20 0 3 6 2.</_>\n        <_>\n          17 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 6 18 -1.</_>\n        <_>\n          7 2 2 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 9 -1.</_>\n        <_>\n          15 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 7 9 -1.</_>\n        <_>\n          0 15 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 13 8 10 -1.</_>\n        <_>\n          19 13 4 5 2.</_>\n        <_>\n          15 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 6 12 -1.</_>\n        <_>\n          1 0 3 6 2.</_>\n        <_>\n          4 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 8 10 -1.</_>\n        <_>\n          1 13 4 5 2.</_>\n        <_>\n          5 18 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 19 2 -1.</_>\n        <_>\n          3 22 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 4 13 -1.</_>\n        <_>\n          8 3 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 18 3 -1.</_>\n        <_>\n          5 11 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 3 5 12 -1.</_>\n        <_>\n          9 7 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 4 15 -1.</_>\n        <_>\n          11 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 16 4 -1.</_>\n        <_>\n          4 3 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 3 -1.</_>\n        <_>\n          6 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 10 8 -1.</_>\n        <_>\n          5 1 5 4 2.</_>\n        <_>\n          10 5 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 18 12 6 -1.</_>\n        <_>\n          17 18 6 3 2.</_>\n        <_>\n          11 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 15 12 3 -1.</_>\n        <_>\n          11 15 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 22 4 -1.</_>\n        <_>\n          1 10 11 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 9 6 -1.</_>\n        <_>\n          10 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 12 5 -1.</_>\n        <_>\n          10 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 7 -1.</_>\n        <_>\n          11 7 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 8 10 -1.</_>\n        <_>\n          11 2 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 8 10 -1.</_>\n        <_>\n          9 2 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 18 6 -1.</_>\n        <_>\n          15 4 9 3 2.</_>\n        <_>\n          6 7 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 10 9 -1.</_>\n        <_>\n          0 8 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 21 6 -1.</_>\n        <_>\n          2 9 21 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 22 16 -1.</_>\n        <_>\n          0 4 11 8 2.</_>\n        <_>\n          11 12 11 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 22 -1.</_>\n        <_>\n          9 11 6 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 3 12 -1.</_>\n        <_>\n          9 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 12 18 -1.</_>\n        <_>\n          18 0 6 9 2.</_>\n        <_>\n          12 9 6 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 12 18 -1.</_>\n        <_>\n          0 0 6 9 2.</_>\n        <_>\n          6 9 6 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 22 4 -1.</_>\n        <_>\n          12 1 11 2 2.</_>\n        <_>\n          1 3 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 4 -1.</_>\n        <_>\n          3 2 18 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 22 6 -1.</_>\n        <_>\n          2 7 22 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 9 -1.</_>\n        <_>\n          5 3 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 6 9 -1.</_>\n        <_>\n          12 14 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 6 9 -1.</_>\n        <_>\n          10 14 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 18 18 3 -1.</_>\n        <_>\n          5 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 13 -1.</_>\n        <_>\n          9 0 3 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 4 12 4 -1.</_>\n        <_>\n          7 4 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 12 6 -1.</_>\n        <_>\n          9 2 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 18 3 -1.</_>\n        <_>\n          4 2 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 6 12 -1.</_>\n        <_>\n          0 12 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 6 9 -1.</_>\n        <_>\n          11 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 13 -1.</_>\n        <_>\n          11 10 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 17 18 2 -1.</_>\n        <_>\n          6 18 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 6 9 -1.</_>\n        <_>\n          11 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 9 -1.</_>\n        <_>\n          12 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 10 8 -1.</_>\n        <_>\n          5 6 5 4 2.</_>\n        <_>\n          10 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 9 5 8 -1.</_>\n        <_>\n          14 13 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 5 8 -1.</_>\n        <_>\n          5 13 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 11 9 6 -1.</_>\n        <_>\n          14 13 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 23 15 -1.</_>\n        <_>\n          0 7 23 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 8 12 -1.</_>\n        <_>\n          16 6 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 15 6 9 -1.</_>\n        <_>\n          4 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 9 4 -1.</_>\n        <_>\n          8 20 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 11 6 -1.</_>\n        <_>\n          13 13 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 11 6 -1.</_>\n        <_>\n          0 13 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 24 6 -1.</_>\n        <_>\n          12 9 12 3 2.</_>\n        <_>\n          0 12 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 8 8 -1.</_>\n        <_>\n          6 20 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 16 14 6 -1.</_>\n        <_>\n          10 18 14 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 21 3 -1.</_>\n        <_>\n          1 2 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 3 -1.</_>\n        <_>\n          0 2 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 8 5 -1.</_>\n        <_>\n          6 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 21 3 -1.</_>\n        <_>\n          9 11 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 12 6 -1.</_>\n        <_>\n          1 18 6 3 2.</_>\n        <_>\n          7 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 4 10 -1.</_>\n        <_>\n          10 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 4 10 -1.</_>\n        <_>\n          7 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 6 12 -1.</_>\n        <_>\n          9 12 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 9 6 -1.</_>\n        <_>\n          10 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 19 2 -1.</_>\n        <_>\n          3 15 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 10 10 -1.</_>\n        <_>\n          7 7 5 5 2.</_>\n        <_>\n          12 12 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 18 12 -1.</_>\n        <_>\n          3 12 9 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 6 12 -1.</_>\n        <_>\n          10 0 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 17 9 -1.</_>\n        <_>\n          3 3 17 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 11 -1.</_>\n        <_>\n          10 0 4 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 6 13 -1.</_>\n        <_>\n          4 0 3 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 16 6 -1.</_>\n        <_>\n          5 11 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 5 12 -1.</_>\n        <_>\n          8 14 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          9 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 6 -1.</_>\n        <_>\n          3 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 20 3 -1.</_>\n        <_>\n          2 1 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 15 10 -1.</_>\n        <_>\n          9 6 5 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 9 -1.</_>\n        <_>\n          16 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 16 9 6 -1.</_>\n        <_>\n          7 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 9 -1.</_>\n        <_>\n          16 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 6 9 -1.</_>\n        <_>\n          6 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 1 6 16 -1.</_>\n        <_>\n          19 1 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 6 16 -1.</_>\n        <_>\n          3 1 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 6 9 -1.</_>\n        <_>\n          14 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 9 -1.</_>\n        <_>\n          0 3 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 6 6 -1.</_>\n        <_>\n          9 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 9 6 -1.</_>\n        <_>\n          6 10 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 7 3 16 -1.</_>\n        <_>\n          14 15 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 14 12 -1.</_>\n        <_>\n          4 10 7 6 2.</_>\n        <_>\n          11 16 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 6 -1.</_>\n        <_>\n          7 8 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 4 20 -1.</_>\n        <_>\n          9 2 2 20 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 6 9 -1.</_>\n        <_>\n          14 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          12 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 6 9 -1.</_>\n        <_>\n          14 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 20 14 4 -1.</_>\n        <_>\n          5 22 14 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 16 12 -1.</_>\n        <_>\n          4 10 16 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 21 4 -1.</_>\n        <_>\n          3 2 21 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 6 9 -1.</_>\n        <_>\n          4 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 16 5 8 -1.</_>\n        <_>\n          16 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 16 16 -1.</_>\n        <_>\n          4 0 8 8 2.</_>\n        <_>\n          12 8 8 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 14 6 -1.</_>\n        <_>\n          13 6 7 3 2.</_>\n        <_>\n          6 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 15 -1.</_>\n        <_>\n          10 10 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 12 8 -1.</_>\n        <_>\n          15 15 6 4 2.</_>\n        <_>\n          9 19 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 4 -1.</_>\n        <_>\n          12 7 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          12 6 7 3 2.</_>\n        <_>\n          5 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 10 -1.</_>\n        <_>\n          3 6 9 5 2.</_>\n        <_>\n          12 11 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 21 -1.</_>\n        <_>\n          12 0 6 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 21 -1.</_>\n        <_>\n          8 0 8 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 3 -1.</_>\n        <_>\n          6 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 6 -1.</_>\n        <_>\n          0 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 19 2 -1.</_>\n        <_>\n          4 4 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 2 -1.</_>\n        <_>\n          0 4 24 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 9 4 -1.</_>\n        <_>\n          15 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 4 -1.</_>\n        <_>\n          0 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 15 18 2 -1.</_>\n        <_>\n          6 16 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 18 3 -1.</_>\n        <_>\n          3 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 3 23 -1.</_>\n        <_>\n          13 0 1 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 8 6 -1.</_>\n        <_>\n          6 3 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 3 23 -1.</_>\n        <_>\n          10 0 1 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 4 10 -1.</_>\n        <_>\n          10 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 12 -1.</_>\n        <_>\n          7 12 10 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 9 6 14 -1.</_>\n        <_>\n          17 9 3 7 2.</_>\n        <_>\n          14 16 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 10 9 -1.</_>\n        <_>\n          2 3 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 5 12 -1.</_>\n        <_>\n          11 7 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 12 10 -1.</_>\n        <_>\n          1 4 6 5 2.</_>\n        <_>\n          7 9 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 9 4 -1.</_>\n        <_>\n          15 3 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 8 10 -1.</_>\n        <_>\n          1 2 4 5 2.</_>\n        <_>\n          5 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 5 12 -1.</_>\n        <_>\n          10 5 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 14 24 -1.</_>\n        <_>\n          11 0 7 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 17 10 4 -1.</_>\n        <_>\n          7 19 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 4 10 -1.</_>\n        <_>\n          10 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 15 6 9 -1.</_>\n        <_>\n          15 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          3 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 15 6 9 -1.</_>\n        <_>\n          15 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 15 6 9 -1.</_>\n        <_>\n          7 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          12 6 2 9 2.</_>\n        <_>\n          10 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 6 11 -1.</_>\n        <_>\n          9 3 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 9 4 -1.</_>\n        <_>\n          15 3 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 14 8 -1.</_>\n        <_>\n          5 8 14 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 15 9 -1.</_>\n        <_>\n          8 4 15 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 8 10 -1.</_>\n        <_>\n          7 2 4 5 2.</_>\n        <_>\n          11 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 6 12 -1.</_>\n        <_>\n          12 2 3 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 6 12 -1.</_>\n        <_>\n          9 2 3 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 12 4 -1.</_>\n        <_>\n          7 7 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 12 10 -1.</_>\n        <_>\n          10 3 4 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 16 6 -1.</_>\n        <_>\n          13 6 8 3 2.</_>\n        <_>\n          5 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 9 -1.</_>\n        <_>\n          9 1 6 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 18 5 -1.</_>\n        <_>\n          9 8 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 22 -1.</_>\n        <_>\n          0 0 12 11 2.</_>\n        <_>\n          12 11 12 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 16 9 6 -1.</_>\n        <_>\n          14 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 24 8 -1.</_>\n        <_>\n          0 20 24 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 19 22 4 -1.</_>\n        <_>\n          12 19 11 2 2.</_>\n        <_>\n          1 21 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 9 6 -1.</_>\n        <_>\n          1 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 6 9 -1.</_>\n        <_>\n          11 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 18 12 6 -1.</_>\n        <_>\n          16 18 6 3 2.</_>\n        <_>\n          10 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 12 6 -1.</_>\n        <_>\n          2 18 6 3 2.</_>\n        <_>\n          8 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 16 9 -1.</_>\n        <_>\n          8 6 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 10 6 -1.</_>\n        <_>\n          0 7 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 18 3 -1.</_>\n        <_>\n          5 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 6 9 6 -1.</_>\n        <_>\n          2 9 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 2 10 9 -1.</_>\n        <_>\n          14 5 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 3 -1.</_>\n        <_>\n          3 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 15 6 -1.</_>\n        <_>\n          9 4 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 8 15 6 -1.</_>\n        <_>\n          4 10 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 24 4 -1.</_>\n        <_>\n          12 5 12 2 2.</_>\n        <_>\n          0 7 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 6 12 -1.</_>\n        <_>\n          9 8 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 6 12 -1.</_>\n        <_>\n          0 12 3 6 2.</_>\n        <_>\n          3 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 10 6 -1.</_>\n        <_>\n          14 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 18 9 -1.</_>\n        <_>\n          2 10 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 10 9 -1.</_>\n        <_>\n          11 17 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 8 -1.</_>\n        <_>\n          7 6 5 4 2.</_>\n        <_>\n          12 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 14 6 -1.</_>\n        <_>\n          13 6 7 3 2.</_>\n        <_>\n          6 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 9 7 -1.</_>\n        <_>\n          7 13 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 10 6 12 -1.</_>\n        <_>\n          17 10 3 6 2.</_>\n        <_>\n          14 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 6 12 -1.</_>\n        <_>\n          4 10 3 6 2.</_>\n        <_>\n          7 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 9 8 6 -1.</_>\n        <_>\n          13 9 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 4 14 -1.</_>\n        <_>\n          10 3 2 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 3 18 -1.</_>\n        <_>\n          18 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 16 12 -1.</_>\n        <_>\n          12 12 8 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 14 -1.</_>\n        <_>\n          17 0 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 14 -1.</_>\n        <_>\n          5 0 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 12 20 -1.</_>\n        <_>\n          16 2 4 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 12 20 -1.</_>\n        <_>\n          4 2 4 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 6 17 -1.</_>\n        <_>\n          18 0 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 6 17 -1.</_>\n        <_>\n          4 0 2 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 9 6 -1.</_>\n        <_>\n          15 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 9 6 -1.</_>\n        <_>\n          0 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 13 -1.</_>\n        <_>\n          20 1 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 13 -1.</_>\n        <_>\n          2 1 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 4 9 -1.</_>\n        <_>\n          16 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 12 7 -1.</_>\n        <_>\n          9 10 4 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 9 12 6 -1.</_>\n        <_>\n          12 11 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 12 6 -1.</_>\n        <_>\n          0 11 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 14 9 -1.</_>\n        <_>\n          5 10 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 20 3 -1.</_>\n        <_>\n          0 16 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 10 8 10 -1.</_>\n        <_>\n          12 10 4 5 2.</_>\n        <_>\n          8 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 13 9 -1.</_>\n        <_>\n          5 7 13 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 6 18 -1.</_>\n        <_>\n          10 8 6 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 12 4 -1.</_>\n        <_>\n          6 11 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 15 12 -1.</_>\n        <_>\n          3 6 15 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 12 5 -1.</_>\n        <_>\n          16 0 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 18 3 -1.</_>\n        <_>\n          6 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 24 5 -1.</_>\n        <_>\n          8 14 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 3 18 -1.</_>\n        <_>\n          6 1 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 4 14 -1.</_>\n        <_>\n          10 0 2 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 3 4 9 -1.</_>\n        <_>\n          11 3 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 12 6 -1.</_>\n        <_>\n          14 2 6 3 2.</_>\n        <_>\n          8 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 17 4 -1.</_>\n        <_>\n          0 6 17 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 16 5 8 -1.</_>\n        <_>\n          16 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 5 8 -1.</_>\n        <_>\n          3 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 2 -1.</_>\n        <_>\n          6 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 12 5 -1.</_>\n        <_>\n          4 0 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 3 6 12 -1.</_>\n        <_>\n          17 3 3 6 2.</_>\n        <_>\n          14 9 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 6 12 -1.</_>\n        <_>\n          2 12 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 21 3 -1.</_>\n        <_>\n          2 4 21 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 6 12 -1.</_>\n        <_>\n          4 3 3 6 2.</_>\n        <_>\n          7 9 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 12 6 -1.</_>\n        <_>\n          18 8 6 3 2.</_>\n        <_>\n          12 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 16 9 -1.</_>\n        <_>\n          8 15 8 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 13 18 5 -1.</_>\n        <_>\n          6 13 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 15 6 -1.</_>\n        <_>\n          6 6 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 9 6 -1.</_>\n        <_>\n          14 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 15 11 -1.</_>\n        <_>\n          8 0 5 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 3 3 18 -1.</_>\n        <_>\n          15 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 3 18 -1.</_>\n        <_>\n          6 9 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 10 8 -1.</_>\n        <_>\n          14 5 5 4 2.</_>\n        <_>\n          9 9 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 16 8 -1.</_>\n        <_>\n          4 4 8 4 2.</_>\n        <_>\n          12 8 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 12 3 -1.</_>\n        <_>\n          7 7 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 9 13 -1.</_>\n        <_>\n          8 0 3 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 10 9 -1.</_>\n        <_>\n          8 4 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 18 2 -1.</_>\n        <_>\n          0 3 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 13 14 6 -1.</_>\n        <_>\n          17 13 7 3 2.</_>\n        <_>\n          10 16 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 14 6 -1.</_>\n        <_>\n          0 13 7 3 2.</_>\n        <_>\n          7 16 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 2 3 21 -1.</_>\n        <_>\n          21 2 1 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 5 12 -1.</_>\n        <_>\n          0 13 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 12 6 -1.</_>\n        <_>\n          12 8 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 20 3 -1.</_>\n        <_>\n          1 9 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 19 3 -1.</_>\n        <_>\n          5 8 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 9 6 -1.</_>\n        <_>\n          1 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 10 14 12 -1.</_>\n        <_>\n          6 14 14 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 18 -1.</_>\n        <_>\n          5 12 14 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 9 7 -1.</_>\n        <_>\n          14 12 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 18 4 -1.</_>\n        <_>\n          1 17 18 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 6 9 -1.</_>\n        <_>\n          11 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 18 4 -1.</_>\n        <_>\n          0 8 9 2 2.</_>\n        <_>\n          9 10 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 20 6 -1.</_>\n        <_>\n          13 10 10 3 2.</_>\n        <_>\n          3 13 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 20 6 -1.</_>\n        <_>\n          1 10 10 3 2.</_>\n        <_>\n          11 13 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 24 2 -1.</_>\n        <_>\n          0 9 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 20 8 -1.</_>\n        <_>\n          1 12 10 4 2.</_>\n        <_>\n          11 16 10 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 9 7 -1.</_>\n        <_>\n          14 12 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 9 7 -1.</_>\n        <_>\n          7 12 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 12 8 5 -1.</_>\n        <_>\n          12 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 8 5 -1.</_>\n        <_>\n          8 12 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 4 10 -1.</_>\n        <_>\n          13 10 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 20 2 -1.</_>\n        <_>\n          11 15 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 6 -1.</_>\n        <_>\n          9 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 21 3 -1.</_>\n        <_>\n          7 1 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 13 9 -1.</_>\n        <_>\n          6 7 13 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 5 -1.</_>\n        <_>\n          10 5 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 10 10 6 -1.</_>\n        <_>\n          10 12 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 12 5 8 -1.</_>\n        <_>\n          6 16 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 9 -1.</_>\n        <_>\n          15 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 10 18 6 -1.</_>\n        <_>\n          8 10 6 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 9 4 -1.</_>\n        <_>\n          11 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 21 3 -1.</_>\n        <_>\n          8 20 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 22 2 -1.</_>\n        <_>\n          1 11 22 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 9 -1.</_>\n        <_>\n          15 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 9 -1.</_>\n        <_>\n          7 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 20 -1.</_>\n        <_>\n          20 2 2 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 20 -1.</_>\n        <_>\n          2 2 2 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 7 6 14 -1.</_>\n        <_>\n          14 7 3 7 2.</_>\n        <_>\n          11 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 4 9 -1.</_>\n        <_>\n          2 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 14 9 4 -1.</_>\n        <_>\n          12 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 9 4 -1.</_>\n        <_>\n          1 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 15 6 -1.</_>\n        <_>\n          7 8 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 3 18 -1.</_>\n        <_>\n          8 8 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 6 -1.</_>\n        <_>\n          12 6 6 3 2.</_>\n        <_>\n          6 9 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 19 20 4 -1.</_>\n        <_>\n          2 19 10 2 2.</_>\n        <_>\n          12 21 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 6 9 -1.</_>\n        <_>\n          14 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 18 14 -1.</_>\n        <_>\n          3 5 9 7 2.</_>\n        <_>\n          12 12 9 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 4 18 -1.</_>\n        <_>\n          17 6 2 9 2.</_>\n        <_>\n          15 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 4 18 -1.</_>\n        <_>\n          5 6 2 9 2.</_>\n        <_>\n          7 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 6 9 -1.</_>\n        <_>\n          13 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 5 6 9 -1.</_>\n        <_>\n          13 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 6 6 -1.</_>\n        <_>\n          12 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 16 6 -1.</_>\n        <_>\n          12 1 8 3 2.</_>\n        <_>\n          4 4 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 13 6 11 -1.</_>\n        <_>\n          11 13 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 1 6 12 -1.</_>\n        <_>\n          20 1 3 6 2.</_>\n        <_>\n          17 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 18 3 -1.</_>\n        <_>\n          1 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 10 8 -1.</_>\n        <_>\n          7 17 10 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 10 6 -1.</_>\n        <_>\n          6 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 9 4 -1.</_>\n        <_>\n          9 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 6 12 -1.</_>\n        <_>\n          1 1 3 6 2.</_>\n        <_>\n          4 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 4 5 12 -1.</_>\n        <_>\n          19 8 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 8 8 -1.</_>\n        <_>\n          4 0 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 19 3 -1.</_>\n        <_>\n          3 6 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 12 6 -1.</_>\n        <_>\n          1 5 6 3 2.</_>\n        <_>\n          7 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 21 8 -1.</_>\n        <_>\n          9 1 7 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 16 8 -1.</_>\n        <_>\n          4 5 16 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 3 -1.</_>\n        <_>\n          6 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 10 14 -1.</_>\n        <_>\n          4 11 10 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 4 10 -1.</_>\n        <_>\n          15 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 18 3 -1.</_>\n        <_>\n          9 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 12 6 -1.</_>\n        <_>\n          12 18 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 6 9 -1.</_>\n        <_>\n          6 15 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 7 6 8 -1.</_>\n        <_>\n          15 11 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 6 8 -1.</_>\n        <_>\n          3 11 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 18 6 -1.</_>\n        <_>\n          14 9 9 3 2.</_>\n        <_>\n          5 12 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 12 6 -1.</_>\n        <_>\n          1 15 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 10 6 -1.</_>\n        <_>\n          14 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 10 6 -1.</_>\n        <_>\n          0 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 13 6 9 -1.</_>\n        <_>\n          15 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 13 6 9 -1.</_>\n        <_>\n          3 16 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 8 8 -1.</_>\n        <_>\n          9 5 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 18 12 6 -1.</_>\n        <_>\n          1 18 6 3 2.</_>\n        <_>\n          7 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 19 10 4 -1.</_>\n        <_>\n          13 21 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 19 10 4 -1.</_>\n        <_>\n          1 21 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 19 18 3 -1.</_>\n        <_>\n          6 20 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 4 10 -1.</_>\n        <_>\n          8 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 6 -1.</_>\n        <_>\n          0 2 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 9 -1.</_>\n        <_>\n          0 4 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 9 20 6 -1.</_>\n        <_>\n          14 9 10 3 2.</_>\n        <_>\n          4 12 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 15 19 8 -1.</_>\n        <_>\n          1 19 19 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 10 6 -1.</_>\n        <_>\n          14 2 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 21 14 -1.</_>\n        <_>\n          8 10 7 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 10 8 8 -1.</_>\n        <_>\n          10 10 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 10 4 -1.</_>\n        <_>\n          11 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 9 -1.</_>\n        <_>\n          10 5 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 10 -1.</_>\n        <_>\n          9 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 4 4 13 -1.</_>\n        <_>\n          14 4 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 4 13 -1.</_>\n        <_>\n          8 4 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 9 6 -1.</_>\n        <_>\n          11 7 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 16 6 -1.</_>\n        <_>\n          3 6 8 3 2.</_>\n        <_>\n          11 9 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 16 14 -1.</_>\n        <_>\n          13 4 8 7 2.</_>\n        <_>\n          5 11 8 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 4 -1.</_>\n        <_>\n          0 0 12 2 2.</_>\n        <_>\n          12 2 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 9 6 -1.</_>\n        <_>\n          12 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 14 4 -1.</_>\n        <_>\n          11 1 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 7 9 -1.</_>\n        <_>\n          10 17 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 3 8 10 -1.</_>\n        <_>\n          8 3 4 5 2.</_>\n        <_>\n          12 8 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 12 5 -1.</_>\n        <_>\n          11 3 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 4 13 -1.</_>\n        <_>\n          10 2 2 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 3 19 -1.</_>\n        <_>\n          12 2 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 9 6 -1.</_>\n        <_>\n          10 7 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 22 20 2 -1.</_>\n        <_>\n          4 22 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 24 4 -1.</_>\n        <_>\n          0 16 12 2 2.</_>\n        <_>\n          12 18 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 12 5 -1.</_>\n        <_>\n          11 3 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 8 14 -1.</_>\n        <_>\n          1 10 4 7 2.</_>\n        <_>\n          5 17 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 16 6 6 -1.</_>\n        <_>\n          11 19 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 10 24 -1.</_>\n        <_>\n          6 0 5 12 2.</_>\n        <_>\n          11 12 5 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 14 14 -1.</_>\n        <_>\n          14 5 7 7 2.</_>\n        <_>\n          7 12 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 8 -1.</_>\n        <_>\n          7 8 5 4 2.</_>\n        <_>\n          12 12 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 9 6 -1.</_>\n        <_>\n          12 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 3 -1.</_>\n        <_>\n          12 6 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 12 5 -1.</_>\n        <_>\n          11 3 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 22 4 -1.</_>\n        <_>\n          1 13 11 2 2.</_>\n        <_>\n          12 15 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 12 6 -1.</_>\n        <_>\n          9 14 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 9 6 -1.</_>\n        <_>\n          0 7 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 23 6 -1.</_>\n        <_>\n          1 7 23 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 19 12 -1.</_>\n        <_>\n          1 10 19 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 21 -1.</_>\n        <_>\n          9 8 6 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 19 18 3 -1.</_>\n        <_>\n          9 19 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 14 6 9 -1.</_>\n        <_>\n          11 14 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 4 12 -1.</_>\n        <_>\n          11 6 2 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 6 9 -1.</_>\n        <_>\n          18 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 6 9 -1.</_>\n        <_>\n          4 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 4 22 -1.</_>\n        <_>\n          15 1 2 11 2.</_>\n        <_>\n          13 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 8 12 -1.</_>\n        <_>\n          1 14 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 7 7 9 -1.</_>\n        <_>\n          14 10 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 18 4 -1.</_>\n        <_>\n          3 12 9 2 2.</_>\n        <_>\n          12 14 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 4 22 -1.</_>\n        <_>\n          15 1 2 11 2.</_>\n        <_>\n          13 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 4 22 -1.</_>\n        <_>\n          7 1 2 11 2.</_>\n        <_>\n          9 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 20 4 -1.</_>\n        <_>\n          14 7 10 2 2.</_>\n        <_>\n          4 9 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 7 -1.</_>\n        <_>\n          12 10 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 10 4 -1.</_>\n        <_>\n          7 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 4 15 -1.</_>\n        <_>\n          0 8 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 8 12 -1.</_>\n        <_>\n          19 0 4 6 2.</_>\n        <_>\n          15 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 8 12 -1.</_>\n        <_>\n          1 0 4 6 2.</_>\n        <_>\n          5 6 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 6 16 -1.</_>\n        <_>\n          16 5 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 6 16 -1.</_>\n        <_>\n          6 5 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 16 -1.</_>\n        <_>\n          17 0 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 16 -1.</_>\n        <_>\n          5 0 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 24 3 -1.</_>\n        <_>\n          0 3 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 10 4 -1.</_>\n        <_>\n          7 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 23 8 -1.</_>\n        <_>\n          1 4 23 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 19 3 -1.</_>\n        <_>\n          1 18 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 2 -1.</_>\n        <_>\n          6 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 17 9 6 -1.</_>\n        <_>\n          1 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 6 9 -1.</_>\n        <_>\n          15 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 6 9 -1.</_>\n        <_>\n          3 18 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 20 6 -1.</_>\n        <_>\n          4 17 20 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 6 14 -1.</_>\n        <_>\n          0 10 3 7 2.</_>\n        <_>\n          3 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 3 -1.</_>\n        <_>\n          6 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 9 7 -1.</_>\n        <_>\n          7 12 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 10 18 5 -1.</_>\n        <_>\n          12 10 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 18 5 -1.</_>\n        <_>\n          6 10 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 18 9 -1.</_>\n        <_>\n          9 2 6 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 10 10 -1.</_>\n        <_>\n          4 6 5 5 2.</_>\n        <_>\n          9 11 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 14 4 9 -1.</_>\n        <_>\n          20 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 4 9 -1.</_>\n        <_>\n          2 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 20 -1.</_>\n        <_>\n          13 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 21 12 3 -1.</_>\n        <_>\n          12 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 20 -1.</_>\n        <_>\n          13 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 16 10 8 -1.</_>\n        <_>\n          1 16 5 4 2.</_>\n        <_>\n          6 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 20 -1.</_>\n        <_>\n          13 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 3 19 -1.</_>\n        <_>\n          2 0 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 20 -1.</_>\n        <_>\n          13 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 9 -1.</_>\n        <_>\n          2 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 19 4 -1.</_>\n        <_>\n          3 9 19 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 14 9 6 -1.</_>\n        <_>\n          7 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 1 7 6 -1.</_>\n        <_>\n          17 4 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 14 8 -1.</_>\n        <_>\n          5 4 14 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 1 8 6 -1.</_>\n        <_>\n          16 4 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 8 6 -1.</_>\n        <_>\n          0 4 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 4 -1.</_>\n        <_>\n          15 0 9 2 2.</_>\n        <_>\n          6 2 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 6 -1.</_>\n        <_>\n          0 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 8 -1.</_>\n        <_>\n          9 7 6 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 6 9 -1.</_>\n        <_>\n          4 11 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 6 9 -1.</_>\n        <_>\n          12 5 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          10 6 2 9 2.</_>\n        <_>\n          12 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 1 4 20 -1.</_>\n        <_>\n          13 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 4 20 -1.</_>\n        <_>\n          9 1 2 10 2.</_>\n        <_>\n          11 11 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 18 6 -1.</_>\n        <_>\n          14 9 9 3 2.</_>\n        <_>\n          5 12 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 6 9 -1.</_>\n        <_>\n          8 4 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 16 8 6 -1.</_>\n        <_>\n          10 16 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 18 8 -1.</_>\n        <_>\n          0 0 9 4 2.</_>\n        <_>\n          9 4 9 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 14 12 -1.</_>\n        <_>\n          13 5 7 6 2.</_>\n        <_>\n          6 11 7 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 15 7 -1.</_>\n        <_>\n          9 3 5 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 10 6 -1.</_>\n        <_>\n          14 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 4 10 -1.</_>\n        <_>\n          0 16 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 22 3 -1.</_>\n        <_>\n          1 11 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 6 10 -1.</_>\n        <_>\n          10 9 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 2 6 12 -1.</_>\n        <_>\n          16 2 3 6 2.</_>\n        <_>\n          13 8 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          10 6 2 9 2.</_>\n        <_>\n          12 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 16 -1.</_>\n        <_>\n          12 8 5 8 2.</_>\n        <_>\n          7 16 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 8 12 -1.</_>\n        <_>\n          8 1 4 6 2.</_>\n        <_>\n          12 7 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 12 14 -1.</_>\n        <_>\n          13 1 6 7 2.</_>\n        <_>\n          7 8 6 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 14 12 6 -1.</_>\n        <_>\n          2 16 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 16 6 6 -1.</_>\n        <_>\n          11 19 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 16 6 6 -1.</_>\n        <_>\n          7 19 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 4 4 10 -1.</_>\n        <_>\n          13 4 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 19 19 3 -1.</_>\n        <_>\n          0 20 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 6 8 -1.</_>\n        <_>\n          12 12 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 8 22 -1.</_>\n        <_>\n          8 12 8 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 6 8 -1.</_>\n        <_>\n          12 12 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 6 8 -1.</_>\n        <_>\n          6 12 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 6 9 -1.</_>\n        <_>\n          14 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 4 -1.</_>\n        <_>\n          0 8 24 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 10 6 -1.</_>\n        <_>\n          14 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 10 6 -1.</_>\n        <_>\n          0 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 19 3 -1.</_>\n        <_>\n          4 7 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 19 3 -1.</_>\n        <_>\n          1 7 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 16 9 -1.</_>\n        <_>\n          4 3 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 5 -1.</_>\n        <_>\n          8 1 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 6 15 -1.</_>\n        <_>\n          3 11 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 22 18 2 -1.</_>\n        <_>\n          6 23 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 6 9 -1.</_>\n        <_>\n          2 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 12 6 9 -1.</_>\n        <_>\n          18 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 6 9 -1.</_>\n        <_>\n          0 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 4 10 -1.</_>\n        <_>\n          11 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 16 -1.</_>\n        <_>\n          9 14 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 10 10 -1.</_>\n        <_>\n          7 12 10 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 6 13 -1.</_>\n        <_>\n          3 3 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 13 -1.</_>\n        <_>\n          18 1 3 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 6 9 -1.</_>\n        <_>\n          7 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 2 6 11 -1.</_>\n        <_>\n          18 2 3 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 11 -1.</_>\n        <_>\n          3 2 3 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 15 6 -1.</_>\n        <_>\n          9 14 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 20 3 -1.</_>\n        <_>\n          2 3 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          10 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 12 14 -1.</_>\n        <_>\n          5 6 6 7 2.</_>\n        <_>\n          11 13 6 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 9 6 -1.</_>\n        <_>\n          10 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 9 -1.</_>\n        <_>\n          12 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 12 20 -1.</_>\n        <_>\n          4 1 6 10 2.</_>\n        <_>\n          10 11 6 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 18 3 -1.</_>\n        <_>\n          6 7 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 18 3 -1.</_>\n        <_>\n          9 7 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 20 18 3 -1.</_>\n        <_>\n          9 20 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 12 15 -1.</_>\n        <_>\n          10 2 4 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 18 3 -1.</_>\n        <_>\n          2 4 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 4 4 18 -1.</_>\n        <_>\n          21 4 2 9 2.</_>\n        <_>\n          19 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 19 3 -1.</_>\n        <_>\n          0 2 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 15 4 -1.</_>\n        <_>\n          5 2 15 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 14 5 -1.</_>\n        <_>\n          12 2 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 22 14 -1.</_>\n        <_>\n          1 2 11 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 6 9 -1.</_>\n        <_>\n          10 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 17 18 3 -1.</_>\n        <_>\n          6 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 3 18 -1.</_>\n        <_>\n          9 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 20 3 -1.</_>\n        <_>\n          2 1 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 5 12 -1.</_>\n        <_>\n          5 8 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 12 5 -1.</_>\n        <_>\n          12 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 12 -1.</_>\n        <_>\n          9 12 3 6 2.</_>\n        <_>\n          12 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 8 10 -1.</_>\n        <_>\n          18 14 4 5 2.</_>\n        <_>\n          14 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 14 8 10 -1.</_>\n        <_>\n          2 14 4 5 2.</_>\n        <_>\n          6 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 18 12 6 -1.</_>\n        <_>\n          16 18 6 3 2.</_>\n        <_>\n          10 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 6 9 -1.</_>\n        <_>\n          1 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 3 3 20 -1.</_>\n        <_>\n          12 3 1 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 14 6 -1.</_>\n        <_>\n          4 6 7 3 2.</_>\n        <_>\n          11 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 13 -1.</_>\n        <_>\n          10 5 4 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 4 15 -1.</_>\n        <_>\n          5 9 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 16 15 4 -1.</_>\n        <_>\n          14 16 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 6 14 -1.</_>\n        <_>\n          7 8 3 7 2.</_>\n        <_>\n          10 15 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 6 -1.</_>\n        <_>\n          7 8 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 18 3 -1.</_>\n        <_>\n          2 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 15 8 -1.</_>\n        <_>\n          5 5 15 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 8 18 -1.</_>\n        <_>\n          7 10 8 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 24 3 -1.</_>\n        <_>\n          0 11 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 13 -1.</_>\n        <_>\n          2 2 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 8 10 -1.</_>\n        <_>\n          20 0 4 5 2.</_>\n        <_>\n          16 5 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 10 9 -1.</_>\n        <_>\n          5 4 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 18 3 -1.</_>\n        <_>\n          5 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 3 -1.</_>\n        <_>\n          0 2 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 4 6 11 -1.</_>\n        <_>\n          13 4 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 8 10 -1.</_>\n        <_>\n          0 0 4 5 2.</_>\n        <_>\n          4 5 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 16 18 3 -1.</_>\n        <_>\n          4 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 18 3 -1.</_>\n        <_>\n          2 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 18 10 -1.</_>\n        <_>\n          12 0 9 5 2.</_>\n        <_>\n          3 5 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 3 20 21 -1.</_>\n        <_>\n          12 3 10 21 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 14 3 -1.</_>\n        <_>\n          6 7 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 12 6 -1.</_>\n        <_>\n          0 9 6 3 2.</_>\n        <_>\n          6 12 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 21 4 -1.</_>\n        <_>\n          10 14 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 21 4 -1.</_>\n        <_>\n          7 14 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 21 18 3 -1.</_>\n        <_>\n          11 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 21 18 3 -1.</_>\n        <_>\n          7 21 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 4 4 18 -1.</_>\n        <_>\n          21 4 2 9 2.</_>\n        <_>\n          19 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 7 18 3 -1.</_>\n        <_>\n          3 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 4 4 18 -1.</_>\n        <_>\n          21 4 2 9 2.</_>\n        <_>\n          19 13 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 15 10 6 -1.</_>\n        <_>\n          7 17 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 13 11 9 -1.</_>\n        <_>\n          9 16 11 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 4 10 -1.</_>\n        <_>\n          0 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 16 9 6 -1.</_>\n        <_>\n          15 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 4 18 -1.</_>\n        <_>\n          1 5 2 9 2.</_>\n        <_>\n          3 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 8 10 -1.</_>\n        <_>\n          13 8 4 5 2.</_>\n        <_>\n          9 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 8 10 -1.</_>\n        <_>\n          7 8 4 5 2.</_>\n        <_>\n          11 13 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 12 5 -1.</_>\n        <_>\n          13 8 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 9 7 -1.</_>\n        <_>\n          10 8 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 12 5 -1.</_>\n        <_>\n          13 8 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 9 7 -1.</_>\n        <_>\n          10 6 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 12 5 -1.</_>\n        <_>\n          13 8 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 18 -1.</_>\n        <_>\n          10 11 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 14 12 -1.</_>\n        <_>\n          5 11 14 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 11 4 -1.</_>\n        <_>\n          0 3 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 10 -1.</_>\n        <_>\n          11 10 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 17 11 6 -1.</_>\n        <_>\n          2 19 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 16 9 6 -1.</_>\n        <_>\n          15 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 18 2 -1.</_>\n        <_>\n          1 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 13 -1.</_>\n        <_>\n          10 4 4 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 18 3 -1.</_>\n        <_>\n          0 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 18 3 -1.</_>\n        <_>\n          6 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 9 6 -1.</_>\n        <_>\n          0 18 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 15 9 6 -1.</_>\n        <_>\n          13 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 9 6 -1.</_>\n        <_>\n          2 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 1 6 16 -1.</_>\n        <_>\n          13 1 3 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 6 16 -1.</_>\n        <_>\n          8 1 3 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 5 6 10 -1.</_>\n        <_>\n          13 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 10 -1.</_>\n        <_>\n          9 5 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 24 -1.</_>\n        <_>\n          12 0 2 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 4 20 -1.</_>\n        <_>\n          3 4 2 10 2.</_>\n        <_>\n          5 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 9 -1.</_>\n        <_>\n          16 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 6 9 -1.</_>\n        <_>\n          6 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 18 5 -1.</_>\n        <_>\n          10 5 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 6 9 -1.</_>\n        <_>\n          7 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 15 8 -1.</_>\n        <_>\n          12 2 5 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 15 8 -1.</_>\n        <_>\n          7 2 5 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 4 9 -1.</_>\n        <_>\n          10 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 6 12 -1.</_>\n        <_>\n          3 4 3 6 2.</_>\n        <_>\n          6 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 8 18 -1.</_>\n        <_>\n          16 0 4 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 8 18 -1.</_>\n        <_>\n          4 0 4 18 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 24 6 -1.</_>\n        <_>\n          0 9 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 14 3 -1.</_>\n        <_>\n          11 7 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 8 15 -1.</_>\n        <_>\n          10 8 4 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 14 -1.</_>\n        <_>\n          12 0 5 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 10 8 10 -1.</_>\n        <_>\n          17 10 4 5 2.</_>\n        <_>\n          13 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 4 9 -1.</_>\n        <_>\n          5 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 1 6 8 -1.</_>\n        <_>\n          16 1 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 6 8 -1.</_>\n        <_>\n          5 1 3 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 12 -1.</_>\n        <_>\n          3 10 18 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 16 4 -1.</_>\n        <_>\n          4 14 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 9 16 15 -1.</_>\n        <_>\n          4 14 16 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 8 10 -1.</_>\n        <_>\n          3 10 4 5 2.</_>\n        <_>\n          7 15 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 16 6 -1.</_>\n        <_>\n          16 18 8 3 2.</_>\n        <_>\n          8 21 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 12 5 -1.</_>\n        <_>\n          6 16 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 9 4 -1.</_>\n        <_>\n          14 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 14 9 6 -1.</_>\n        <_>\n          7 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 16 12 -1.</_>\n        <_>\n          4 14 16 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 19 6 -1.</_>\n        <_>\n          0 15 19 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 13 9 6 -1.</_>\n        <_>\n          10 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 3 23 -1.</_>\n        <_>\n          6 0 1 23 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 24 6 -1.</_>\n        <_>\n          0 10 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 5 12 -1.</_>\n        <_>\n          0 9 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 19 18 -1.</_>\n        <_>\n          3 9 19 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 6 12 -1.</_>\n        <_>\n          9 11 3 6 2.</_>\n        <_>\n          12 17 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 24 8 -1.</_>\n        <_>\n          12 5 12 4 2.</_>\n        <_>\n          0 9 12 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 18 9 4 -1.</_>\n        <_>\n          6 20 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 10 6 -1.</_>\n        <_>\n          8 10 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 20 3 -1.</_>\n        <_>\n          2 8 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 7 20 -1.</_>\n        <_>\n          12 10 7 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 7 20 -1.</_>\n        <_>\n          5 10 7 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 2 2 18 -1.</_>\n        <_>\n          14 11 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 10 12 -1.</_>\n        <_>\n          10 8 5 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 12 8 -1.</_>\n        <_>\n          12 9 6 4 2.</_>\n        <_>\n          6 13 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 3 14 -1.</_>\n        <_>\n          7 14 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 12 16 -1.</_>\n        <_>\n          17 2 6 8 2.</_>\n        <_>\n          11 10 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 6 9 -1.</_>\n        <_>\n          9 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 14 9 4 -1.</_>\n        <_>\n          13 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 22 4 -1.</_>\n        <_>\n          0 12 11 2 2.</_>\n        <_>\n          11 14 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 22 6 -1.</_>\n        <_>\n          12 12 11 3 2.</_>\n        <_>\n          1 15 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 9 6 -1.</_>\n        <_>\n          9 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 4 9 -1.</_>\n        <_>\n          10 0 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 18 7 -1.</_>\n        <_>\n          9 8 6 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 6 -1.</_>\n        <_>\n          0 8 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 24 10 -1.</_>\n        <_>\n          8 11 8 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 18 21 -1.</_>\n        <_>\n          9 3 6 21 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 12 4 10 -1.</_>\n        <_>\n          9 12 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 16 10 8 -1.</_>\n        <_>\n          15 16 5 4 2.</_>\n        <_>\n          10 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 6 12 -1.</_>\n        <_>\n          15 10 3 6 2.</_>\n        <_>\n          12 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 10 6 12 -1.</_>\n        <_>\n          6 10 3 6 2.</_>\n        <_>\n          9 16 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 12 6 12 -1.</_>\n        <_>\n          19 12 3 6 2.</_>\n        <_>\n          16 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 6 12 -1.</_>\n        <_>\n          2 12 3 6 2.</_>\n        <_>\n          5 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 6 9 -1.</_>\n        <_>\n          12 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 6 9 -1.</_>\n        <_>\n          10 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 20 10 4 -1.</_>\n        <_>\n          14 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 10 4 -1.</_>\n        <_>\n          5 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 17 9 6 -1.</_>\n        <_>\n          11 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 14 4 -1.</_>\n        <_>\n          3 4 14 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 10 4 -1.</_>\n        <_>\n          10 3 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 10 4 -1.</_>\n        <_>\n          5 15 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 2 3 19 -1.</_>\n        <_>\n          20 2 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 9 8 -1.</_>\n        <_>\n          7 12 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 5 12 -1.</_>\n        <_>\n          4 11 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 3 -1.</_>\n        <_>\n          8 1 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 4 -1.</_>\n        <_>\n          6 10 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 3 4 10 -1.</_>\n        <_>\n          19 3 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 9 6 -1.</_>\n        <_>\n          3 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 22 -1.</_>\n        <_>\n          20 0 2 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 22 -1.</_>\n        <_>\n          2 0 2 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 15 19 3 -1.</_>\n        <_>\n          5 16 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 7 4 15 -1.</_>\n        <_>\n          10 12 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 21 18 3 -1.</_>\n        <_>\n          0 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 10 15 -1.</_>\n        <_>\n          7 8 10 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 18 3 -1.</_>\n        <_>\n          1 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 9 6 -1.</_>\n        <_>\n          11 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 24 14 -1.</_>\n        <_>\n          0 17 24 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 9 8 10 -1.</_>\n        <_>\n          17 9 4 5 2.</_>\n        <_>\n          13 14 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 4 9 -1.</_>\n        <_>\n          12 5 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 9 8 10 -1.</_>\n        <_>\n          17 9 4 5 2.</_>\n        <_>\n          13 14 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 11 10 10 -1.</_>\n        <_>\n          7 11 5 5 2.</_>\n        <_>\n          12 16 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 18 4 -1.</_>\n        <_>\n          13 13 9 2 2.</_>\n        <_>\n          4 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 19 2 -1.</_>\n        <_>\n          0 1 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 24 6 -1.</_>\n        <_>\n          8 18 8 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 8 16 -1.</_>\n        <_>\n          6 12 8 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 10 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 9 -1.</_>\n        <_>\n          0 6 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 15 7 9 -1.</_>\n        <_>\n          13 18 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 12 6 -1.</_>\n        <_>\n          3 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 14 6 9 -1.</_>\n        <_>\n          12 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 15 8 -1.</_>\n        <_>\n          2 19 15 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 16 -1.</_>\n        <_>\n          9 14 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 7 12 -1.</_>\n        <_>\n          6 10 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 6 6 9 -1.</_>\n        <_>\n          14 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 14 6 9 -1.</_>\n        <_>\n          5 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 6 9 -1.</_>\n        <_>\n          12 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 4 18 -1.</_>\n        <_>\n          6 6 2 9 2.</_>\n        <_>\n          8 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 9 6 12 -1.</_>\n        <_>\n          17 9 3 6 2.</_>\n        <_>\n          14 15 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 9 6 12 -1.</_>\n        <_>\n          4 9 3 6 2.</_>\n        <_>\n          7 15 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 15 9 6 -1.</_>\n        <_>\n          14 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 18 4 -1.</_>\n        <_>\n          0 20 9 2 2.</_>\n        <_>\n          9 22 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 18 9 6 -1.</_>\n        <_>\n          13 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 9 6 -1.</_>\n        <_>\n          2 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 2 4 22 -1.</_>\n        <_>\n          21 2 2 11 2.</_>\n        <_>\n          19 13 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 2 4 22 -1.</_>\n        <_>\n          1 2 2 11 2.</_>\n        <_>\n          3 13 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 2 24 -1.</_>\n        <_>\n          15 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 20 16 4 -1.</_>\n        <_>\n          11 20 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 4 18 -1.</_>\n        <_>\n          13 6 2 9 2.</_>\n        <_>\n          11 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 10 14 -1.</_>\n        <_>\n          7 9 5 7 2.</_>\n        <_>\n          12 16 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 6 6 9 -1.</_>\n        <_>\n          14 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 7 9 -1.</_>\n        <_>\n          3 9 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 4 4 20 -1.</_>\n        <_>\n          22 4 2 10 2.</_>\n        <_>\n          20 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 6 9 -1.</_>\n        <_>\n          7 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 14 -1.</_>\n        <_>\n          12 0 5 7 2.</_>\n        <_>\n          7 7 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 18 6 -1.</_>\n        <_>\n          11 1 9 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 2 24 -1.</_>\n        <_>\n          15 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 2 24 -1.</_>\n        <_>\n          8 0 1 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 12 6 7 -1.</_>\n        <_>\n          13 12 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 12 6 7 -1.</_>\n        <_>\n          8 12 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 18 19 -1.</_>\n        <_>\n          9 5 6 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 9 6 -1.</_>\n        <_>\n          8 6 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 9 6 -1.</_>\n        <_>\n          12 5 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 10 8 -1.</_>\n        <_>\n          3 16 5 4 2.</_>\n        <_>\n          8 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 8 5 15 -1.</_>\n        <_>\n          19 13 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 5 15 -1.</_>\n        <_>\n          0 13 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 4 4 20 -1.</_>\n        <_>\n          22 4 2 10 2.</_>\n        <_>\n          20 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 4 20 -1.</_>\n        <_>\n          0 4 2 10 2.</_>\n        <_>\n          2 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 10 4 -1.</_>\n        <_>\n          7 7 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 19 14 4 -1.</_>\n        <_>\n          11 19 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 11 12 3 -1.</_>\n        <_>\n          10 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 3 -1.</_>\n        <_>\n          0 2 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 14 20 -1.</_>\n        <_>\n          14 2 7 10 2.</_>\n        <_>\n          7 12 7 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 6 9 -1.</_>\n        <_>\n          2 13 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 19 -1.</_>\n        <_>\n          13 0 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 11 14 3 -1.</_>\n        <_>\n          8 11 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 16 20 -1.</_>\n        <_>\n          15 1 8 10 2.</_>\n        <_>\n          7 11 8 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 21 9 -1.</_>\n        <_>\n          7 10 7 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 19 15 5 -1.</_>\n        <_>\n          11 19 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 10 6 6 -1.</_>\n        <_>\n          11 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 1 16 20 -1.</_>\n        <_>\n          15 1 8 10 2.</_>\n        <_>\n          7 11 8 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 16 20 -1.</_>\n        <_>\n          1 1 8 10 2.</_>\n        <_>\n          9 11 8 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 4 3 12 -1.</_>\n        <_>\n          16 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 3 12 -1.</_>\n        <_>\n          5 10 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 8 -1.</_>\n        <_>\n          12 6 5 4 2.</_>\n        <_>\n          7 10 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 9 6 6 -1.</_>\n        <_>\n          4 12 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 4 -1.</_>\n        <_>\n          6 7 12 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 5 15 -1.</_>\n        <_>\n          9 7 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 9 6 -1.</_>\n        <_>\n          15 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 11 10 -1.</_>\n        <_>\n          6 5 11 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 7 4 12 -1.</_>\n        <_>\n          12 13 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 9 4 -1.</_>\n        <_>\n          7 4 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 13 6 -1.</_>\n        <_>\n          6 2 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          10 6 2 9 2.</_>\n        <_>\n          12 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 6 9 -1.</_>\n        <_>\n          12 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 18 10 6 -1.</_>\n        <_>\n          3 20 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 20 3 -1.</_>\n        <_>\n          4 15 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 9 6 -1.</_>\n        <_>\n          2 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 19 -1.</_>\n        <_>\n          13 0 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 19 -1.</_>\n        <_>\n          9 0 2 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 22 2 -1.</_>\n        <_>\n          1 5 22 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 9 6 -1.</_>\n        <_>\n          0 2 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 24 18 -1.</_>\n        <_>\n          0 9 24 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 16 8 -1.</_>\n        <_>\n          3 6 16 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 6 18 6 -1.</_>\n        <_>\n          3 8 18 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 6 10 -1.</_>\n        <_>\n          5 1 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 9 6 -1.</_>\n        <_>\n          16 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 9 6 -1.</_>\n        <_>\n          5 0 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 7 10 -1.</_>\n        <_>\n          6 5 7 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 20 4 -1.</_>\n        <_>\n          12 2 10 2 2.</_>\n        <_>\n          2 4 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 19 3 -1.</_>\n        <_>\n          2 12 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 8 6 9 -1.</_>\n        <_>\n          12 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 6 9 -1.</_>\n        <_>\n          10 8 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 8 4 9 -1.</_>\n        <_>\n          13 8 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 11 9 9 -1.</_>\n        <_>\n          6 11 3 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 5 -1.</_>\n        <_>\n          9 9 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 2 20 -1.</_>\n        <_>\n          2 14 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 17 8 6 -1.</_>\n        <_>\n          14 20 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 2 -1.</_>\n        <_>\n          3 22 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 15 6 -1.</_>\n        <_>\n          10 4 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 15 12 6 -1.</_>\n        <_>\n          2 17 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 8 6 9 -1.</_>\n        <_>\n          17 11 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 20 4 -1.</_>\n        <_>\n          2 12 10 2 2.</_>\n        <_>\n          12 14 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 24 6 -1.</_>\n        <_>\n          0 19 24 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 16 9 4 -1.</_>\n        <_>\n          7 18 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 4 22 -1.</_>\n        <_>\n          17 1 2 11 2.</_>\n        <_>\n          15 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 4 22 -1.</_>\n        <_>\n          5 1 2 11 2.</_>\n        <_>\n          7 12 2 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 13 8 9 -1.</_>\n        <_>\n          11 16 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 6 9 -1.</_>\n        <_>\n          8 1 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 4 3 18 -1.</_>\n        <_>\n          11 10 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 12 6 -1.</_>\n        <_>\n          5 8 6 3 2.</_>\n        <_>\n          11 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 7 5 8 -1.</_>\n        <_>\n          15 11 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 5 8 -1.</_>\n        <_>\n          4 11 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 6 12 -1.</_>\n        <_>\n          15 6 3 6 2.</_>\n        <_>\n          12 12 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 6 12 -1.</_>\n        <_>\n          6 6 3 6 2.</_>\n        <_>\n          9 12 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 14 8 -1.</_>\n        <_>\n          12 9 7 4 2.</_>\n        <_>\n          5 13 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 3 14 -1.</_>\n        <_>\n          9 8 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 6 12 -1.</_>\n        <_>\n          12 10 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 5 4 18 -1.</_>\n        <_>\n          4 5 2 9 2.</_>\n        <_>\n          6 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 16 18 -1.</_>\n        <_>\n          4 12 16 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 7 20 -1.</_>\n        <_>\n          5 14 7 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 8 8 12 -1.</_>\n        <_>\n          14 14 8 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 6 14 -1.</_>\n        <_>\n          9 10 3 7 2.</_>\n        <_>\n          12 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 9 6 -1.</_>\n        <_>\n          12 5 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 4 3 18 -1.</_>\n        <_>\n          10 4 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 22 14 -1.</_>\n        <_>\n          12 4 11 7 2.</_>\n        <_>\n          1 11 11 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 18 2 -1.</_>\n        <_>\n          2 8 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 6 12 -1.</_>\n        <_>\n          12 10 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 9 7 -1.</_>\n        <_>\n          9 5 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 7 4 12 -1.</_>\n        <_>\n          12 13 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 4 12 -1.</_>\n        <_>\n          8 13 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 2 10 22 -1.</_>\n        <_>\n          7 13 10 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 3 20 -1.</_>\n        <_>\n          1 1 1 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 18 4 -1.</_>\n        <_>\n          13 13 9 2 2.</_>\n        <_>\n          4 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 13 18 4 -1.</_>\n        <_>\n          2 13 9 2 2.</_>\n        <_>\n          11 15 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 6 -1.</_>\n        <_>\n          15 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 6 -1.</_>\n        <_>\n          0 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 24 -1.</_>\n        <_>\n          15 0 9 12 2.</_>\n        <_>\n          6 12 9 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 6 12 -1.</_>\n        <_>\n          6 10 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 10 4 -1.</_>\n        <_>\n          8 9 10 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 9 18 6 -1.</_>\n        <_>\n          1 9 9 3 2.</_>\n        <_>\n          10 12 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 18 3 -1.</_>\n        <_>\n          6 7 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 9 8 -1.</_>\n        <_>\n          10 7 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 12 6 12 -1.</_>\n        <_>\n          12 12 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 18 3 -1.</_>\n        <_>\n          3 15 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 7 -1.</_>\n        <_>\n          18 17 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 10 6 -1.</_>\n        <_>\n          1 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 7 -1.</_>\n        <_>\n          18 17 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 3 3 19 -1.</_>\n        <_>\n          11 3 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 7 -1.</_>\n        <_>\n          18 17 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 11 9 -1.</_>\n        <_>\n          6 4 11 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 7 -1.</_>\n        <_>\n          18 17 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 11 6 -1.</_>\n        <_>\n          6 8 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 7 8 5 -1.</_>\n        <_>\n          16 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 20 19 -1.</_>\n        <_>\n          12 4 10 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 21 6 -1.</_>\n        <_>\n          9 1 7 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 14 -1.</_>\n        <_>\n          6 5 6 7 2.</_>\n        <_>\n          12 12 6 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 8 5 -1.</_>\n        <_>\n          6 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 7 8 5 -1.</_>\n        <_>\n          16 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 8 5 -1.</_>\n        <_>\n          4 7 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 7 -1.</_>\n        <_>\n          18 17 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 8 10 -1.</_>\n        <_>\n          8 6 4 5 2.</_>\n        <_>\n          12 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 15 9 9 -1.</_>\n        <_>\n          18 15 3 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 9 9 -1.</_>\n        <_>\n          3 15 3 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 10 9 7 -1.</_>\n        <_>\n          15 10 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 9 7 -1.</_>\n        <_>\n          6 10 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 15 10 8 -1.</_>\n        <_>\n          18 15 5 4 2.</_>\n        <_>\n          13 19 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 12 -1.</_>\n        <_>\n          0 1 3 6 2.</_>\n        <_>\n          3 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 12 -1.</_>\n        <_>\n          13 0 3 6 2.</_>\n        <_>\n          10 6 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 10 12 -1.</_>\n        <_>\n          7 0 5 6 2.</_>\n        <_>\n          12 6 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 1 16 8 -1.</_>\n        <_>\n          4 1 8 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 21 19 3 -1.</_>\n        <_>\n          0 22 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 18 4 -1.</_>\n        <_>\n          15 9 9 2 2.</_>\n        <_>\n          6 11 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 9 6 -1.</_>\n        <_>\n          3 6 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 15 -1.</_>\n        <_>\n          9 6 6 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 6 6 -1.</_>\n        <_>\n          8 9 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 1 14 9 -1.</_>\n        <_>\n          5 4 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 8 20 -1.</_>\n        <_>\n          3 0 4 10 2.</_>\n        <_>\n          7 10 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 7 9 -1.</_>\n        <_>\n          5 3 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 12 5 -1.</_>\n        <_>\n          10 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 8 14 -1.</_>\n        <_>\n          4 1 4 14 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 12 22 4 -1.</_>\n        <_>\n          2 14 22 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 17 6 6 -1.</_>\n        <_>\n          8 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 7 -1.</_>\n        <_>\n          18 1 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 6 -1.</_>\n        <_>\n          3 0 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 17 18 -1.</_>\n        <_>\n          4 12 17 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 12 6 -1.</_>\n        <_>\n          6 0 6 3 2.</_>\n        <_>\n          12 3 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 18 4 -1.</_>\n        <_>\n          13 7 9 2 2.</_>\n        <_>\n          4 9 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 10 6 -1.</_>\n        <_>\n          4 14 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 10 12 -1.</_>\n        <_>\n          12 9 5 6 2.</_>\n        <_>\n          7 15 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 3 -1.</_>\n        <_>\n          8 1 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 6 6 -1.</_>\n        <_>\n          13 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 6 6 -1.</_>\n        <_>\n          8 11 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 19 3 -1.</_>\n        <_>\n          3 11 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 9 -1.</_>\n        <_>\n          0 5 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 16 10 6 -1.</_>\n        <_>\n          14 18 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 10 6 -1.</_>\n        <_>\n          0 18 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 9 6 -1.</_>\n        <_>\n          14 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 9 6 -1.</_>\n        <_>\n          0 20 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 9 6 -1.</_>\n        <_>\n          14 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 6 9 -1.</_>\n        <_>\n          8 2 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 4 12 -1.</_>\n        <_>\n          15 8 2 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 13 8 8 -1.</_>\n        <_>\n          8 17 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 20 18 3 -1.</_>\n        <_>\n          10 20 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 4 12 -1.</_>\n        <_>\n          7 8 2 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 12 3 -1.</_>\n        <_>\n          7 7 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 9 -1.</_>\n        <_>\n          12 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 20 18 3 -1.</_>\n        <_>\n          11 20 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 18 3 -1.</_>\n        <_>\n          7 20 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 1 6 20 -1.</_>\n        <_>\n          21 1 3 10 2.</_>\n        <_>\n          18 11 3 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 6 20 -1.</_>\n        <_>\n          0 1 3 10 2.</_>\n        <_>\n          3 11 3 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 3 4 18 -1.</_>\n        <_>\n          15 3 2 9 2.</_>\n        <_>\n          13 12 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 6 12 -1.</_>\n        <_>\n          0 6 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 9 12 6 -1.</_>\n        <_>\n          18 9 6 3 2.</_>\n        <_>\n          12 12 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 3 4 18 -1.</_>\n        <_>\n          7 3 2 9 2.</_>\n        <_>\n          9 12 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 6 9 -1.</_>\n        <_>\n          16 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 12 6 -1.</_>\n        <_>\n          0 9 6 3 2.</_>\n        <_>\n          6 12 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 4 8 20 -1.</_>\n        <_>\n          18 4 4 10 2.</_>\n        <_>\n          14 14 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 8 20 -1.</_>\n        <_>\n          2 4 4 10 2.</_>\n        <_>\n          6 14 4 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 13 9 6 -1.</_>\n        <_>\n          14 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 9 6 -1.</_>\n        <_>\n          1 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 18 3 -1.</_>\n        <_>\n          9 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 13 9 6 -1.</_>\n        <_>\n          5 15 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 18 3 -1.</_>\n        <_>\n          5 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 6 7 -1.</_>\n        <_>\n          11 2 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 9 6 -1.</_>\n        <_>\n          12 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 9 6 -1.</_>\n        <_>\n          9 1 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 14 6 -1.</_>\n        <_>\n          12 6 7 3 2.</_>\n        <_>\n          5 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 6 13 -1.</_>\n        <_>\n          10 2 2 13 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 12 6 -1.</_>\n        <_>\n          12 11 6 3 2.</_>\n        <_>\n          6 14 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 15 -1.</_>\n        <_>\n          9 1 6 15 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 6 7 -1.</_>\n        <_>\n          13 0 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 16 6 -1.</_>\n        <_>\n          3 6 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 6 9 -1.</_>\n        <_>\n          9 7 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 0 4 24 -1.</_>\n        <_>\n          13 0 2 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 4 24 -1.</_>\n        <_>\n          9 0 2 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 5 12 -1.</_>\n        <_>\n          11 13 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 15 9 6 -1.</_>\n        <_>\n          7 17 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 7 18 6 -1.</_>\n        <_>\n          5 9 18 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 5 12 -1.</_>\n        <_>\n          8 13 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 17 17 6 -1.</_>\n        <_>\n          4 19 17 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 18 14 -1.</_>\n        <_>\n          0 3 9 7 2.</_>\n        <_>\n          9 10 9 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 24 2 -1.</_>\n        <_>\n          0 2 24 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 15 18 3 -1.</_>\n        <_>\n          0 16 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 9 -1.</_>\n        <_>\n          11 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 3 14 12 -1.</_>\n        <_>\n          3 9 14 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 6 9 -1.</_>\n        <_>\n          10 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 6 10 -1.</_>\n        <_>\n          12 6 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 6 9 -1.</_>\n        <_>\n          7 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 21 7 -1.</_>\n        <_>\n          9 0 7 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 12 5 -1.</_>\n        <_>\n          10 11 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 9 8 -1.</_>\n        <_>\n          11 7 3 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 18 -1.</_>\n        <_>\n          9 6 3 9 2.</_>\n        <_>\n          12 15 3 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 8 10 -1.</_>\n        <_>\n          19 14 4 5 2.</_>\n        <_>\n          15 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 14 8 10 -1.</_>\n        <_>\n          1 14 4 5 2.</_>\n        <_>\n          5 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 0 8 10 -1.</_>\n        <_>\n          15 0 4 5 2.</_>\n        <_>\n          11 5 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 8 10 -1.</_>\n        <_>\n          5 0 4 5 2.</_>\n        <_>\n          9 5 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 12 5 -1.</_>\n        <_>\n          6 1 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 12 18 2 -1.</_>\n        <_>\n          10 12 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 20 6 -1.</_>\n        <_>\n          12 8 10 3 2.</_>\n        <_>\n          2 11 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 9 7 -1.</_>\n        <_>\n          10 6 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 8 16 -1.</_>\n        <_>\n          14 5 4 8 2.</_>\n        <_>\n          10 13 4 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 16 8 -1.</_>\n        <_>\n          3 9 8 4 2.</_>\n        <_>\n          11 13 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 10 4 -1.</_>\n        <_>\n          7 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 12 10 8 -1.</_>\n        <_>\n          7 12 5 4 2.</_>\n        <_>\n          12 16 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 19 15 4 -1.</_>\n        <_>\n          14 19 5 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 18 9 -1.</_>\n        <_>\n          7 0 6 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 4 10 8 -1.</_>\n        <_>\n          18 4 5 4 2.</_>\n        <_>\n          13 8 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 16 18 4 -1.</_>\n        <_>\n          9 16 6 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 7 10 12 -1.</_>\n        <_>\n          13 7 5 6 2.</_>\n        <_>\n          8 13 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 10 12 -1.</_>\n        <_>\n          6 7 5 6 2.</_>\n        <_>\n          11 13 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 18 7 -1.</_>\n        <_>\n          10 6 6 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 18 3 -1.</_>\n        <_>\n          0 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 18 3 -1.</_>\n        <_>\n          3 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 4 6 10 -1.</_>\n        <_>\n          4 4 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 8 24 -1.</_>\n        <_>\n          16 0 4 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 8 15 -1.</_>\n        <_>\n          8 0 4 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 8 24 -1.</_>\n        <_>\n          16 0 4 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 4 18 9 -1.</_>\n        <_>\n          7 4 6 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 12 9 6 -1.</_>\n        <_>\n          15 14 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 6 -1.</_>\n        <_>\n          3 9 9 3 2.</_>\n        <_>\n          12 12 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 5 6 9 -1.</_>\n        <_>\n          18 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 6 9 -1.</_>\n        <_>\n          0 8 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 18 4 -1.</_>\n        <_>\n          13 7 9 2 2.</_>\n        <_>\n          4 9 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 12 20 -1.</_>\n        <_>\n          2 1 6 10 2.</_>\n        <_>\n          8 11 6 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 6 23 -1.</_>\n        <_>\n          17 0 3 23 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 2 18 -1.</_>\n        <_>\n          1 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 8 10 6 -1.</_>\n        <_>\n          8 10 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 20 6 -1.</_>\n        <_>\n          0 6 10 3 2.</_>\n        <_>\n          10 9 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 12 12 5 -1.</_>\n        <_>\n          15 12 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 3 19 -1.</_>\n        <_>\n          1 4 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 1 3 18 -1.</_>\n        <_>\n          20 1 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 3 18 -1.</_>\n        <_>\n          3 1 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 18 3 -1.</_>\n        <_>\n          9 10 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 10 9 -1.</_>\n        <_>\n          9 4 5 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 13 14 7 -1.</_>\n        <_>\n          7 13 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 13 14 7 -1.</_>\n        <_>\n          10 13 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 9 6 -1.</_>\n        <_>\n          11 15 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 14 8 10 -1.</_>\n        <_>\n          4 14 4 5 2.</_>\n        <_>\n          8 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 14 4 10 -1.</_>\n        <_>\n          10 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 5 16 -1.</_>\n        <_>\n          3 16 5 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 10 9 6 -1.</_>\n        <_>\n          15 12 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 10 9 6 -1.</_>\n        <_>\n          0 12 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 12 9 -1.</_>\n        <_>\n          6 10 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 10 5 8 -1.</_>\n        <_>\n          9 14 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 15 6 9 -1.</_>\n        <_>\n          10 15 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 6 7 6 -1.</_>\n        <_>\n          16 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 1 4 22 -1.</_>\n        <_>\n          10 1 2 22 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 14 3 -1.</_>\n        <_>\n          6 6 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 19 3 -1.</_>\n        <_>\n          0 19 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 6 24 -1.</_>\n        <_>\n          17 0 3 24 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 15 6 -1.</_>\n        <_>\n          5 13 5 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 10 14 -1.</_>\n        <_>\n          14 6 5 7 2.</_>\n        <_>\n          9 13 5 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 8 10 -1.</_>\n        <_>\n          1 6 4 5 2.</_>\n        <_>\n          5 11 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 5 -1.</_>\n        <_>\n          7 6 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 9 6 -1.</_>\n        <_>\n          10 7 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 8 14 14 -1.</_>\n        <_>\n          14 8 7 7 2.</_>\n        <_>\n          7 15 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 14 14 -1.</_>\n        <_>\n          3 8 7 7 2.</_>\n        <_>\n          10 15 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 13 4 -1.</_>\n        <_>\n          9 10 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 6 12 -1.</_>\n        <_>\n          3 2 3 6 2.</_>\n        <_>\n          6 8 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 10 17 6 -1.</_>\n        <_>\n          6 13 17 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 17 6 -1.</_>\n        <_>\n          1 13 17 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 7 8 9 -1.</_>\n        <_>\n          16 10 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 7 8 9 -1.</_>\n        <_>\n          0 10 8 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 9 24 10 -1.</_>\n        <_>\n          12 9 12 5 2.</_>\n        <_>\n          0 14 12 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 15 8 -1.</_>\n        <_>\n          8 2 5 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 18 8 -1.</_>\n        <_>\n          10 2 6 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 1 18 4 -1.</_>\n        <_>\n          0 1 9 2 2.</_>\n        <_>\n          9 3 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          20 2 3 18 -1.</_>\n        <_>\n          21 2 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 3 3 19 -1.</_>\n        <_>\n          2 3 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 6 16 -1.</_>\n        <_>\n          20 8 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 6 16 -1.</_>\n        <_>\n          2 8 2 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 18 11 6 -1.</_>\n        <_>\n          8 20 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 12 5 -1.</_>\n        <_>\n          8 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 5 -1.</_>\n        <_>\n          11 6 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 9 6 -1.</_>\n        <_>\n          9 3 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 12 5 -1.</_>\n        <_>\n          7 6 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 8 6 7 -1.</_>\n        <_>\n          12 8 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 9 6 -1.</_>\n        <_>\n          11 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 6 9 -1.</_>\n        <_>\n          8 17 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 2 9 6 -1.</_>\n        <_>\n          11 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 16 20 -1.</_>\n        <_>\n          4 3 8 10 2.</_>\n        <_>\n          12 13 8 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 10 12 -1.</_>\n        <_>\n          12 6 5 6 2.</_>\n        <_>\n          7 12 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 7 12 -1.</_>\n        <_>\n          0 6 7 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 11 6 -1.</_>\n        <_>\n          12 19 11 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 12 8 -1.</_>\n        <_>\n          4 7 6 4 2.</_>\n        <_>\n          10 11 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 11 8 10 -1.</_>\n        <_>\n          12 11 4 5 2.</_>\n        <_>\n          8 16 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 4 9 -1.</_>\n        <_>\n          11 1 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 3 22 -1.</_>\n        <_>\n          15 0 1 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 0 3 22 -1.</_>\n        <_>\n          8 0 1 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 7 18 4 -1.</_>\n        <_>\n          13 7 9 2 2.</_>\n        <_>\n          4 9 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 4 15 -1.</_>\n        <_>\n          10 7 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 18 13 -1.</_>\n        <_>\n          9 0 9 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 0 3 24 -1.</_>\n        <_>\n          17 0 1 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 3 24 -1.</_>\n        <_>\n          6 0 1 24 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 15 5 8 -1.</_>\n        <_>\n          10 19 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 18 18 2 -1.</_>\n        <_>\n          2 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 8 20 3 -1.</_>\n        <_>\n          2 9 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 6 9 6 -1.</_>\n        <_>\n          7 8 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 19 10 -1.</_>\n        <_>\n          3 7 19 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 7 19 3 -1.</_>\n        <_>\n          2 8 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 6 9 4 -1.</_>\n        <_>\n          15 8 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 2 18 8 -1.</_>\n        <_>\n          8 2 6 8 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 9 14 4 -1.</_>\n        <_>\n          10 9 7 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 6 16 -1.</_>\n        <_>\n          7 4 3 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 9 16 -1.</_>\n        <_>\n          18 8 3 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 9 16 -1.</_>\n        <_>\n          3 8 3 16 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 0 6 14 -1.</_>\n        <_>\n          20 0 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 6 14 -1.</_>\n        <_>\n          2 0 2 14 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 0 6 22 -1.</_>\n        <_>\n          17 0 2 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 6 22 -1.</_>\n        <_>\n          5 0 2 22 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 2 12 20 -1.</_>\n        <_>\n          16 2 4 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 2 12 20 -1.</_>\n        <_>\n          4 2 4 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 4 9 -1.</_>\n        <_>\n          11 6 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 6 16 -1.</_>\n        <_>\n          12 0 3 16 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 1 3 12 -1.</_>\n        <_>\n          12 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 4 18 6 -1.</_>\n        <_>\n          3 4 9 3 2.</_>\n        <_>\n          12 7 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 5 16 8 -1.</_>\n        <_>\n          13 5 8 4 2.</_>\n        <_>\n          5 9 8 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 10 6 -1.</_>\n        <_>\n          0 15 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 9 6 -1.</_>\n        <_>\n          8 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 2 9 6 -1.</_>\n        <_>\n          9 2 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 1 10 8 -1.</_>\n        <_>\n          19 1 5 4 2.</_>\n        <_>\n          14 5 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 3 12 -1.</_>\n        <_>\n          9 7 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 9 -1.</_>\n        <_>\n          6 7 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 12 6 -1.</_>\n        <_>\n          10 5 4 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 1 8 5 -1.</_>\n        <_>\n          5 1 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 12 6 8 -1.</_>\n        <_>\n          12 16 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 12 12 6 -1.</_>\n        <_>\n          3 14 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 18 12 6 -1.</_>\n        <_>\n          15 18 6 3 2.</_>\n        <_>\n          9 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 13 6 6 -1.</_>\n        <_>\n          4 16 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 3 7 18 -1.</_>\n        <_>\n          11 12 7 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 18 3 -1.</_>\n        <_>\n          9 9 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 3 19 2 -1.</_>\n        <_>\n          5 4 19 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 2 12 6 -1.</_>\n        <_>\n          4 2 6 3 2.</_>\n        <_>\n          10 5 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 6 9 -1.</_>\n        <_>\n          11 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 6 9 -1.</_>\n        <_>\n          10 6 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 9 5 15 -1.</_>\n        <_>\n          16 14 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 9 5 15 -1.</_>\n        <_>\n          3 14 5 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 6 14 6 -1.</_>\n        <_>\n          13 6 7 3 2.</_>\n        <_>\n          6 9 7 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 3 14 -1.</_>\n        <_>\n          8 13 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 24 5 -1.</_>\n        <_>\n          8 16 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 20 20 3 -1.</_>\n        <_>\n          10 20 10 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 10 18 2 -1.</_>\n        <_>\n          5 11 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 6 10 -1.</_>\n        <_>\n          2 6 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 1 20 3 -1.</_>\n        <_>\n          2 2 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 13 6 11 -1.</_>\n        <_>\n          11 13 2 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 15 6 8 -1.</_>\n        <_>\n          9 19 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 9 -1.</_>\n        <_>\n          9 15 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 18 2 -1.</_>\n        <_>\n          5 12 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 6 15 6 -1.</_>\n        <_>\n          2 8 15 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 18 3 -1.</_>\n        <_>\n          6 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 3 18 -1.</_>\n        <_>\n          6 0 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 3 6 10 -1.</_>\n        <_>\n          20 3 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 6 10 -1.</_>\n        <_>\n          2 3 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 8 9 -1.</_>\n        <_>\n          10 5 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 5 8 9 -1.</_>\n        <_>\n          10 5 4 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 2 20 3 -1.</_>\n        <_>\n          3 3 20 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 13 4 -1.</_>\n        <_>\n          5 4 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          17 0 7 14 -1.</_>\n        <_>\n          17 7 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 7 14 -1.</_>\n        <_>\n          0 7 7 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 11 10 6 -1.</_>\n        <_>\n          9 11 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 10 6 -1.</_>\n        <_>\n          10 11 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 6 3 18 -1.</_>\n        <_>\n          11 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 16 18 3 -1.</_>\n        <_>\n          6 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 9 10 -1.</_>\n        <_>\n          4 11 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 7 15 4 -1.</_>\n        <_>\n          9 9 15 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 6 12 6 -1.</_>\n        <_>\n          5 6 6 3 2.</_>\n        <_>\n          11 9 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 1 12 9 -1.</_>\n        <_>\n          6 4 12 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 9 6 12 -1.</_>\n        <_>\n          7 9 3 6 2.</_>\n        <_>\n          10 15 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 5 13 6 -1.</_>\n        <_>\n          11 7 13 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 11 22 13 -1.</_>\n        <_>\n          12 11 11 13 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 8 6 6 -1.</_>\n        <_>\n          18 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 6 6 -1.</_>\n        <_>\n          0 11 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 6 24 3 -1.</_>\n        <_>\n          0 7 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 10 6 -1.</_>\n        <_>\n          0 7 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 7 18 3 -1.</_>\n        <_>\n          6 8 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 10 6 -1.</_>\n        <_>\n          0 2 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 0 3 19 -1.</_>\n        <_>\n          20 0 1 19 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 6 12 16 -1.</_>\n        <_>\n          4 6 6 8 2.</_>\n        <_>\n          10 14 6 8 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          19 6 4 18 -1.</_>\n        <_>\n          21 6 2 9 2.</_>\n        <_>\n          19 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 4 18 -1.</_>\n        <_>\n          1 6 2 9 2.</_>\n        <_>\n          3 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 21 18 3 -1.</_>\n        <_>\n          3 22 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 19 9 4 -1.</_>\n        <_>\n          0 21 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 18 12 6 -1.</_>\n        <_>\n          18 18 6 3 2.</_>\n        <_>\n          12 21 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 18 9 4 -1.</_>\n        <_>\n          7 20 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 16 10 8 -1.</_>\n        <_>\n          17 16 5 4 2.</_>\n        <_>\n          12 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 16 10 8 -1.</_>\n        <_>\n          2 16 5 4 2.</_>\n        <_>\n          7 20 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 0 10 12 -1.</_>\n        <_>\n          19 0 5 6 2.</_>\n        <_>\n          14 6 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 10 12 -1.</_>\n        <_>\n          0 0 5 6 2.</_>\n        <_>\n          5 6 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 14 9 6 -1.</_>\n        <_>\n          15 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 9 6 -1.</_>\n        <_>\n          0 16 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 14 10 6 -1.</_>\n        <_>\n          14 16 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 10 6 -1.</_>\n        <_>\n          0 16 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 18 18 2 -1.</_>\n        <_>\n          5 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 18 3 -1.</_>\n        <_>\n          0 19 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 5 18 12 -1.</_>\n        <_>\n          12 5 9 6 2.</_>\n        <_>\n          3 11 9 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 3 7 9 -1.</_>\n        <_>\n          5 6 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 19 15 -1.</_>\n        <_>\n          4 5 19 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 0 16 4 -1.</_>\n        <_>\n          3 2 16 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 12 16 12 -1.</_>\n        <_>\n          4 12 8 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 3 12 15 -1.</_>\n        <_>\n          10 3 6 15 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 4 2 19 -1.</_>\n        <_>\n          16 4 1 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 2 19 -1.</_>\n        <_>\n          7 4 1 19 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 14 8 10 -1.</_>\n        <_>\n          17 14 4 5 2.</_>\n        <_>\n          13 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 14 8 10 -1.</_>\n        <_>\n          3 14 4 5 2.</_>\n        <_>\n          7 19 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 3 18 -1.</_>\n        <_>\n          12 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 11 12 6 -1.</_>\n        <_>\n          5 11 6 3 2.</_>\n        <_>\n          11 14 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 8 10 -1.</_>\n        <_>\n          14 5 4 5 2.</_>\n        <_>\n          10 10 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 4 12 10 -1.</_>\n        <_>\n          6 4 6 5 2.</_>\n        <_>\n          12 9 6 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 18 10 -1.</_>\n        <_>\n          15 8 9 5 2.</_>\n        <_>\n          6 13 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 18 10 -1.</_>\n        <_>\n          0 8 9 5 2.</_>\n        <_>\n          9 13 9 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 3 18 -1.</_>\n        <_>\n          12 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 14 18 3 -1.</_>\n        <_>\n          0 15 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 6 3 18 -1.</_>\n        <_>\n          12 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 6 3 18 -1.</_>\n        <_>\n          9 12 3 6 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 14 18 3 -1.</_>\n        <_>\n          6 15 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 5 18 3 -1.</_>\n        <_>\n          0 6 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 5 22 3 -1.</_>\n        <_>\n          2 6 22 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 21 10 -1.</_>\n        <_>\n          7 0 7 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 3 18 17 -1.</_>\n        <_>\n          12 3 6 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 18 17 -1.</_>\n        <_>\n          6 3 6 17 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 24 11 -1.</_>\n        <_>\n          8 12 8 11 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 10 16 6 -1.</_>\n        <_>\n          4 13 16 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 8 6 8 -1.</_>\n        <_>\n          12 12 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 14 8 7 -1.</_>\n        <_>\n          10 14 4 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 10 6 14 -1.</_>\n        <_>\n          18 10 3 7 2.</_>\n        <_>\n          15 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 6 14 -1.</_>\n        <_>\n          3 10 3 7 2.</_>\n        <_>\n          6 17 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 12 18 2 -1.</_>\n        <_>\n          6 13 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 10 6 -1.</_>\n        <_>\n          5 10 10 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 11 9 4 -1.</_>\n        <_>\n          12 13 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 11 9 6 -1.</_>\n        <_>\n          0 13 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 2 3 18 -1.</_>\n        <_>\n          12 2 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 2 3 18 -1.</_>\n        <_>\n          11 2 1 18 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 12 6 10 -1.</_>\n        <_>\n          11 12 2 10 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 10 6 9 -1.</_>\n        <_>\n          1 13 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 16 6 -1.</_>\n        <_>\n          14 9 8 3 2.</_>\n        <_>\n          6 12 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 8 9 6 -1.</_>\n        <_>\n          1 10 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 7 16 6 -1.</_>\n        <_>\n          7 9 16 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 0 18 3 -1.</_>\n        <_>\n          0 1 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 0 6 9 -1.</_>\n        <_>\n          12 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 5 6 6 -1.</_>\n        <_>\n          12 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          12 6 2 9 2.</_>\n        <_>\n          10 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 0 6 9 -1.</_>\n        <_>\n          10 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 9 -1.</_>\n        <_>\n          9 4 6 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 0 18 9 -1.</_>\n        <_>\n          1 3 18 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 3 24 3 -1.</_>\n        <_>\n          0 4 24 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 14 9 4 -1.</_>\n        <_>\n          6 16 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 9 8 10 -1.</_>\n        <_>\n          12 9 4 5 2.</_>\n        <_>\n          8 14 4 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 13 9 -1.</_>\n        <_>\n          5 5 13 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 16 9 -1.</_>\n        <_>\n          4 7 16 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 4 14 9 -1.</_>\n        <_>\n          4 7 14 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 9 6 -1.</_>\n        <_>\n          8 7 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 7 16 6 -1.</_>\n        <_>\n          1 9 16 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 5 13 9 -1.</_>\n        <_>\n          10 8 13 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 5 13 9 -1.</_>\n        <_>\n          1 8 13 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 4 24 6 -1.</_>\n        <_>\n          12 4 12 3 2.</_>\n        <_>\n          0 7 12 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 14 10 9 -1.</_>\n        <_>\n          1 17 10 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 17 18 3 -1.</_>\n        <_>\n          5 18 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 18 3 -1.</_>\n        <_>\n          0 17 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 17 9 6 -1.</_>\n        <_>\n          9 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 20 22 4 -1.</_>\n        <_>\n          1 20 11 2 2.</_>\n        <_>\n          12 22 11 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 14 8 6 -1.</_>\n        <_>\n          8 17 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 6 8 15 -1.</_>\n        <_>\n          8 11 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 4 18 3 -1.</_>\n        <_>\n          5 5 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 3 5 10 -1.</_>\n        <_>\n          9 8 5 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 8 12 3 -1.</_>\n        <_>\n          6 8 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 6 18 6 -1.</_>\n        <_>\n          2 6 9 3 2.</_>\n        <_>\n          11 9 9 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 6 4 18 -1.</_>\n        <_>\n          12 6 2 9 2.</_>\n        <_>\n          10 15 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          7 5 6 6 -1.</_>\n        <_>\n          10 5 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 5 2 18 -1.</_>\n        <_>\n          14 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          8 5 2 18 -1.</_>\n        <_>\n          8 14 2 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 2 10 6 -1.</_>\n        <_>\n          9 2 5 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 18 12 -1.</_>\n        <_>\n          12 1 9 12 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 2 17 22 -1.</_>\n        <_>\n          5 13 17 11 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          4 0 12 6 -1.</_>\n        <_>\n          4 2 12 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 9 16 6 -1.</_>\n        <_>\n          14 9 8 3 2.</_>\n        <_>\n          6 12 8 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 0 5 18 -1.</_>\n        <_>\n          9 9 5 9 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 0 6 9 -1.</_>\n        <_>\n          14 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 0 6 9 -1.</_>\n        <_>\n          8 0 2 9 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 12 -1.</_>\n        <_>\n          11 1 2 12 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 9 13 4 -1.</_>\n        <_>\n          5 11 13 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 19 3 -1.</_>\n        <_>\n          5 9 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 9 6 8 -1.</_>\n        <_>\n          9 13 6 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 9 4 15 -1.</_>\n        <_>\n          11 14 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 0 6 14 -1.</_>\n        <_>\n          2 0 3 7 2.</_>\n        <_>\n          5 7 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 1 6 14 -1.</_>\n        <_>\n          18 1 3 7 2.</_>\n        <_>\n          15 8 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 1 6 14 -1.</_>\n        <_>\n          3 1 3 7 2.</_>\n        <_>\n          6 8 3 7 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 20 18 4 -1.</_>\n        <_>\n          12 20 9 2 2.</_>\n        <_>\n          3 22 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 0 4 20 -1.</_>\n        <_>\n          5 0 2 10 2.</_>\n        <_>\n          7 10 2 10 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 8 8 12 -1.</_>\n        <_>\n          20 8 4 6 2.</_>\n        <_>\n          16 14 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 8 8 12 -1.</_>\n        <_>\n          0 8 4 6 2.</_>\n        <_>\n          4 14 4 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 13 10 8 -1.</_>\n        <_>\n          18 13 5 4 2.</_>\n        <_>\n          13 17 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 13 10 8 -1.</_>\n        <_>\n          1 13 5 4 2.</_>\n        <_>\n          6 17 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 8 4 15 -1.</_>\n        <_>\n          15 13 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          5 8 4 15 -1.</_>\n        <_>\n          5 13 4 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 11 16 12 -1.</_>\n        <_>\n          6 15 16 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          2 11 16 12 -1.</_>\n        <_>\n          2 15 16 4 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          14 12 7 9 -1.</_>\n        <_>\n          14 15 7 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          10 1 3 21 -1.</_>\n        <_>\n          10 8 3 7 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 11 9 4 -1.</_>\n        <_>\n          13 13 9 2 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 10 17 9 -1.</_>\n        <_>\n          3 13 17 3 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          13 8 8 15 -1.</_>\n        <_>\n          13 13 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 8 8 15 -1.</_>\n        <_>\n          3 13 8 5 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          11 14 10 8 -1.</_>\n        <_>\n          16 14 5 4 2.</_>\n        <_>\n          11 18 5 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 22 6 -1.</_>\n        <_>\n          0 18 11 3 2.</_>\n        <_>\n          11 21 11 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 16 24 4 -1.</_>\n        <_>\n          0 16 12 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          6 20 12 3 -1.</_>\n        <_>\n          12 20 6 3 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          18 12 6 12 -1.</_>\n        <_>\n          21 12 3 6 2.</_>\n        <_>\n          18 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 12 6 12 -1.</_>\n        <_>\n          0 12 3 6 2.</_>\n        <_>\n          3 18 3 6 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          1 6 22 10 -1.</_>\n        <_>\n          1 6 11 5 2.</_>\n        <_>\n          12 11 11 5 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 18 18 2 -1.</_>\n        <_>\n          0 19 18 1 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 15 19 3 -1.</_>\n        <_>\n          3 16 19 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 18 3 -1.</_>\n        <_>\n          0 14 18 1 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          15 17 9 6 -1.</_>\n        <_>\n          15 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 17 9 6 -1.</_>\n        <_>\n          0 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          12 17 9 6 -1.</_>\n        <_>\n          12 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          3 17 9 6 -1.</_>\n        <_>\n          3 19 9 2 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          16 2 3 20 -1.</_>\n        <_>\n          17 2 1 20 3.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          0 13 24 8 -1.</_>\n        <_>\n          0 17 24 4 2.</_></rects></_>\n    <_>\n      <rects>\n        <_>\n          9 1 6 22 -1.</_>\n        <_>\n          12 1 3 11 2.</_>\n        <_>\n          9 12 3 11 2.</_></rects></_></features></cascade>\n</opencv_storage>\n"
  },
  {
    "path": "dnn.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_dnn)\n\n#include \"dnn.h\"\n\nNet Net_ReadNet(const char* model, const char* config) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNet(model, config));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetBytes(const char* framework, struct ByteArray model, struct ByteArray config) {\n    try {\n        std::vector<uchar> modelv(model.data, model.data + model.length);\n        std::vector<uchar> configv(config.data, config.data + config.length);\n        Net n = new cv::dnn::Net(cv::dnn::readNet(framework, modelv, configv));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromCaffe(const char* prototxt, const char* caffeModel) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromCaffe(prototxt, caffeModel));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromCaffeBytes(struct ByteArray prototxt, struct ByteArray caffeModel) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromCaffe(prototxt.data, prototxt.length,\n            caffeModel.data, caffeModel.length));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromTensorflow(const char* model) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromTensorflow(model));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromTensorflowBytes(struct ByteArray model) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromTensorflow(model.data, model.length));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromTorch(const char* model) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromTorch(model));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromONNX(const char* model) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromONNX(model));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nNet Net_ReadNetFromONNXBytes(struct ByteArray model) {\n    try {\n        Net n = new cv::dnn::Net(cv::dnn::readNetFromONNX(model.data, model.length));\n        return n;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid Net_Close(Net net) {\n    delete net;\n}\n\nbool Net_Empty(Net net) {\n    try {\n        return net->empty();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nvoid Net_SetInput(Net net, Mat blob, const char* name) {\n    try {\n        net->setInput(*blob, name);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nMat Net_Forward(Net net, const char* outputName) {\n    try {\n        return new cv::Mat(net->forward(outputName));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nvoid Net_ForwardLayers(Net net, struct Mats* outputBlobs, struct CStrings outBlobNames) {\n    try {\n        std::vector< cv::Mat > blobs;\n\n        std::vector< cv::String > names;\n        for (int i = 0; i < outBlobNames.length; ++i) {\n            names.push_back(cv::String(outBlobNames.strs[i]));\n        }\n        net->forward(blobs, names);\n    \n        // copy blobs into outputBlobs\n        outputBlobs->mats = new Mat[blobs.size()];\n    \n        for (size_t i = 0; i < blobs.size(); ++i) {\n            outputBlobs->mats[i] = new cv::Mat(blobs[i]);\n        }\n    \n        outputBlobs->length = (int)blobs.size();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Net_SetPreferableBackend(Net net, int backend) {\n    try {\n        net->setPreferableBackend(backend);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Net_SetPreferableTarget(Net net, int target) {\n    try {\n        net->setPreferableTarget(target);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint64_t Net_GetPerfProfile(Net net) {\n    try {\n        std::vector<double> layersTimes;\n        return net->getPerfProfile(layersTimes);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nvoid Net_GetUnconnectedOutLayers(Net net, IntVector* res) {\n    try {\n        std::vector< int > cids(net->getUnconnectedOutLayers());\n        int* ids = new int[cids.size()];\n        \n        for (size_t i = 0; i < cids.size(); ++i) {\n            ids[i] = cids[i];\n        }\n    \n        res->length = cids.size();\n        res->val = ids;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Net_GetLayerNames(Net net, CStrings* names) {\n    try {\n        std::vector< cv::String > cstrs(net->getLayerNames());\n        size_t totalStrLen = 0;\n        for (cv::String str : cstrs) {\n            totalStrLen += str.size();\n        }\n\n        // Compute 1D buffer size required to store\n        // 2D array of null-terminated strings\n        size_t numStrings = cstrs.size();\n        size_t bufferLen = numStrings * sizeof(char*) + (totalStrLen + numStrings) * sizeof(char);\n\n        const char **strs = (const char**)new char[bufferLen];\n        memset(strs, 0, bufferLen);\n\n        char* it = (char*)(strs + cstrs.size());\n        const char* end = (char*)(strs) + bufferLen;\n\n        for (size_t i = 0; i < numStrings; ++i, ++it) {\n            strs[i] = it;\n            size_t strlen = cstrs[i].size();\n\n            // Avoid buffer overrun\n            if(end < it + strlen + 1) {\n                break;\n            }\n\n            memcpy(it, cstrs[i].c_str(), strlen);\n            it += strlen;\n        }\n\n        names->length = cstrs.size();\n        names->strs = strs;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nstruct Rect Net_BlobRectToImageRect(struct Rect rect, Size originalSize, double scalefactor, Size size, Scalar mean, bool swapRB,\n                    int ddepth, int dataLayout, int paddingMode, Scalar borderValue) {\n    try {\n        cv::Scalar sf(scalefactor);\n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4);\n        cv::dnn::DataLayout dl = static_cast<cv::dnn::DataLayout>(dataLayout);\n        cv::dnn::ImagePaddingMode pm = static_cast<cv::dnn::ImagePaddingMode>(paddingMode);\n        cv::Scalar bv(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv);\n    \n        cv::Rect bRect = params.blobRectToImageRect(cv::Rect(rect.x, rect.y, rect.width, rect.height), cv::Size(originalSize.width, originalSize.height));\n        Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n        return r;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rect r = {0, 0, 0, 0};\n        return r;\n    }\n}\n\nstruct Rects Net_BlobRectsToImageRects(struct Rects rects, Size originalSize, double scalefactor, Size size, Scalar mean, bool swapRB,\n                    int ddepth, int dataLayout, int paddingMode, Scalar borderValue) {\n    try {\n        std::vector<cv::Rect> _cRects;\n        for (int i = 0; i < rects.length; ++i) {\n            _cRects.push_back(cv::Rect(\n                rects.rects[i].x,\n                rects.rects[i].y,\n                rects.rects[i].width,\n                rects.rects[i].height\n            ));\n        }\n    \n        cv::Scalar sf(scalefactor);\n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4);\n        cv::dnn::DataLayout dl = static_cast<cv::dnn::DataLayout>(dataLayout);\n        cv::dnn::ImagePaddingMode pm = static_cast<cv::dnn::ImagePaddingMode>(paddingMode);\n        cv::Scalar bv(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv);\n    \n        std::vector<cv::Rect> detected;\n        params.blobRectsToImageRects(_cRects, detected, cv::Size(originalSize.width, originalSize.height));\n        Rect* drects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            drects[i] = r;\n        }\n    \n        Rects ret = {drects, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\nMat Net_BlobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB,\n                      bool crop) {\n    try {\n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4);\n        // use the default target ddepth here.\n        return new cv::Mat(cv::dnn::blobFromImage(*image, scalefactor, sz, cm, swapRB, crop));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat Net_BlobFromImageWithParams(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB,\n                      int ddepth, int dataLayout, int paddingMode, Scalar borderValue) {\n    try {\n        cv::Scalar sf(scalefactor);\n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4);\n        cv::dnn::DataLayout dl = static_cast<cv::dnn::DataLayout>(dataLayout);\n        cv::dnn::ImagePaddingMode pm = static_cast<cv::dnn::ImagePaddingMode>(paddingMode);\n        cv::Scalar bv(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv);\n    \n        return new cv::Mat(cv::dnn::blobFromImageWithParams(*image, params));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nvoid Net_BlobFromImages(struct Mats images, Mat blob, double scalefactor, Size size,\n                       Scalar mean, bool swapRB, bool crop, int ddepth) {\n    try {\n        std::vector<cv::Mat> imgs;\n    \n        for (int i = 0; i < images.length; ++i) {\n            imgs.push_back(*images.mats[i]);\n        }\n    \n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm = cv::Scalar(mean.val1, mean.val2, mean.val3, mean.val4);\n    \n        // ignore the passed in ddepth, just use default.\n        cv::dnn::blobFromImages(imgs, *blob, scalefactor, sz, cm, swapRB, crop);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Net_BlobFromImagesWithParams(struct Mats images, Mat blob, double scalefactor, Size size,\n                       Scalar mean, bool swapRB, int ddepth, int dataLayout, int paddingMode, Scalar borderValue) {\n    try {\n        std::vector<cv::Mat> imgs;\n    \n        for (int i = 0; i < images.length; ++i) {\n            imgs.push_back(*images.mats[i]);\n        }\n    \n        cv::Scalar sf(scalefactor);\n        cv::Size sz(size.width, size.height);\n        cv::Scalar cm(mean.val1, mean.val2, mean.val3, mean.val4);\n        cv::dnn::DataLayout dl = static_cast<cv::dnn::DataLayout>(dataLayout);\n        cv::dnn::ImagePaddingMode pm = static_cast<cv::dnn::ImagePaddingMode>(paddingMode);\n        cv::Scalar bv(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv);\n    \n        cv::dnn::blobFromImagesWithParams(imgs, *blob, params);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Net_ImagesFromBlob(Mat blob_, struct Mats* images_) {\n    try {\n        std::vector<cv::Mat> imgs;\n        cv::dnn::imagesFromBlob(*blob_, imgs);\n        images_->mats = new Mat[imgs.size()];\n    \n        for (size_t i = 0; i < imgs.size(); ++i) {\n            images_->mats[i] = new cv::Mat(imgs[i]);\n        }\n        images_->length = (int) imgs.size();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nMat Net_GetBlobChannel(Mat blob, int imgidx, int chnidx) {\n    size_t w = blob->size[3];\n    size_t h = blob->size[2];\n    return new cv::Mat(h, w, CV_32F, blob->ptr<float>(imgidx, chnidx));\n}\n\nScalar Net_GetBlobSize(Mat blob) {\n    Scalar scal = Scalar();\n    scal.val1 = blob->size[0];\n    scal.val2 = blob->size[1];\n    scal.val3 = blob->size[2];\n    scal.val4 = blob->size[3];\n    return scal;\n}\n\nLayer Net_GetLayer(Net net, int layerid) {\n    try {\n        return new cv::Ptr<cv::dnn::Layer>(net->getLayer(layerid));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid Layer_Close(Layer layer) {\n    delete layer;\n}\n\nint Layer_InputNameToIndex(Layer layer, const char* name) {\n    try {\n        return (*layer)->inputNameToIndex(name);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nint Layer_OutputNameToIndex(Layer layer, const char* name) {\n    try {\n        return (*layer)->outputNameToIndex(name);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nconst char* Layer_GetName(Layer layer) {\n    try {\n        return (*layer)->name.c_str();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return \"\";\n    }\n}\n\nconst char* Layer_GetType(Layer layer) {\n    try {\n        return (*layer)->type.c_str();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return \"\";\n    }\n}\n\nvoid NMSBoxes(struct Rects bboxes, FloatVector scores, float score_threshold, float nms_threshold, IntVector* indices) {\n    try {\n        std::vector<cv::Rect> _bboxes;\n\n        for (int i = 0; i < bboxes.length; ++i) {\n            _bboxes.push_back(cv::Rect(\n                bboxes.rects[i].x,\n                bboxes.rects[i].y,\n                bboxes.rects[i].width,\n                bboxes.rects[i].height\n            ));\n        }\n    \n        std::vector<float> _scores;\n    \n        float* f;\n        int i;\n        for (i = 0, f = scores.val; i < scores.length; ++f, ++i) {\n            _scores.push_back(*f);\n        }\n    \n        std::vector<int> _indices(indices->length);\n    \n        cv::dnn::NMSBoxes(_bboxes, _scores, score_threshold, nms_threshold, _indices, 1.f, 0);\n    \n        int* ptr = new int[_indices.size()];\n    \n        for (size_t i=0; i<_indices.size(); ++i) {\n            ptr[i] = _indices[i];\n        }\n    \n        indices->length = _indices.size();\n        indices->val = ptr;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid NMSBoxesWithParams(struct Rects bboxes, FloatVector scores, const float score_threshold, const float nms_threshold, IntVector* indices, const float eta, const int top_k) {\n    try {\n        std::vector<cv::Rect> _bboxes;\n\n        for (int i = 0; i < bboxes.length; ++i) {\n            _bboxes.push_back(cv::Rect(\n                bboxes.rects[i].x,\n                bboxes.rects[i].y,\n                bboxes.rects[i].width,\n                bboxes.rects[i].height\n            ));\n        }\n    \n        std::vector<float> _scores;\n    \n        float* f;\n        int i;\n        for (i = 0, f = scores.val; i < scores.length; ++f, ++i) {\n            _scores.push_back(*f);\n        }\n    \n        std::vector<int> _indices(indices->length);\n    \n        cv::dnn::NMSBoxes(_bboxes, _scores, score_threshold, nms_threshold, _indices, eta, top_k);\n    \n        int* ptr = new int[_indices.size()];\n    \n        for (size_t i=0; i<_indices.size(); ++i) {\n            ptr[i] = _indices[i];\n        }\n    \n        indices->length = _indices.size();\n        indices->val = ptr;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}"
  },
  {
    "path": "dnn.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_dnn)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"dnn.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// Net allows you to create and manipulate comprehensive artificial neural networks.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html\ntype Net struct {\n\t// C.Net\n\tp unsafe.Pointer\n}\n\n// NetBackendType is the type for the various different kinds of DNN backends.\ntype NetBackendType int\n\nconst (\n\t// NetBackendDefault is the default backend.\n\tNetBackendDefault NetBackendType = 0\n\n\t// NetBackendHalide is the Halide backend.\n\tNetBackendHalide NetBackendType = 1\n\n\t// NetBackendOpenVINO is the OpenVINO backend.\n\tNetBackendOpenVINO NetBackendType = 2\n\n\t// NetBackendOpenCV is the OpenCV backend.\n\tNetBackendOpenCV NetBackendType = 3\n\n\t// NetBackendVKCOM is the Vulkan backend.\n\tNetBackendVKCOM NetBackendType = 4\n\n\t// NetBackendCUDA is the Cuda backend.\n\tNetBackendCUDA NetBackendType = 5\n)\n\n// ParseNetBackend returns a valid NetBackendType given a string. Valid values are:\n// - halide\n// - openvino\n// - opencv\n// - vulkan\n// - cuda\n// - default\nfunc ParseNetBackend(backend string) NetBackendType {\n\tswitch backend {\n\tcase \"halide\":\n\t\treturn NetBackendHalide\n\tcase \"openvino\":\n\t\treturn NetBackendOpenVINO\n\tcase \"opencv\":\n\t\treturn NetBackendOpenCV\n\tcase \"vulkan\":\n\t\treturn NetBackendVKCOM\n\tcase \"cuda\":\n\t\treturn NetBackendCUDA\n\tdefault:\n\t\treturn NetBackendDefault\n\t}\n}\n\n// NetTargetType is the type for the various different kinds of DNN device targets.\ntype NetTargetType int\n\nconst (\n\t// NetTargetCPU is the default CPU device target.\n\tNetTargetCPU NetTargetType = 0\n\n\t// NetTargetFP32 is the 32-bit OpenCL target.\n\tNetTargetFP32 NetTargetType = 1\n\n\t// NetTargetFP16 is the 16-bit OpenCL target.\n\tNetTargetFP16 NetTargetType = 2\n\n\t// NetTargetVPU is the Movidius VPU target.\n\tNetTargetVPU NetTargetType = 3\n\n\t// NetTargetVulkan is the NVIDIA Vulkan target.\n\tNetTargetVulkan NetTargetType = 4\n\n\t// NetTargetFPGA is the FPGA target.\n\tNetTargetFPGA NetTargetType = 5\n\n\t// NetTargetCUDA is the CUDA target.\n\tNetTargetCUDA NetTargetType = 6\n\n\t// NetTargetCUDAFP16 is the CUDA target.\n\tNetTargetCUDAFP16 NetTargetType = 7\n)\n\n// ParseNetTarget returns a valid NetTargetType given a string. Valid values are:\n// - cpu\n// - fp32\n// - fp16\n// - vpu\n// - vulkan\n// - fpga\n// - cuda\n// - cudafp16\nfunc ParseNetTarget(target string) NetTargetType {\n\tswitch target {\n\tcase \"cpu\":\n\t\treturn NetTargetCPU\n\tcase \"fp32\":\n\t\treturn NetTargetFP32\n\tcase \"fp16\":\n\t\treturn NetTargetFP16\n\tcase \"vpu\":\n\t\treturn NetTargetVPU\n\tcase \"vulkan\":\n\t\treturn NetTargetVulkan\n\tcase \"fpga\":\n\t\treturn NetTargetFPGA\n\tcase \"cuda\":\n\t\treturn NetTargetCUDA\n\tcase \"cudafp16\":\n\t\treturn NetTargetCUDAFP16\n\tdefault:\n\t\treturn NetTargetCPU\n\t}\n}\n\ntype DataLayoutType int\n\nconst (\n\tDataLayoutUnknown DataLayoutType = iota\n\tDataLayoutND\n\tDataLayoutNCHW\n\tDataLayoutNCDHW\n\tDataLayoutNHWC\n\tDataLayoutNDHWC\n\tDataLayoutPLANAR\n)\n\ntype PaddingModeType int\n\nconst (\n\tPaddingModeNull PaddingModeType = iota\n\tPaddingModeCropCenter\n\tPaddingModeLetterbox\n)\n\ntype ImageToBlobParams struct {\n\tScaleFactor float64\n\tSize        image.Point\n\tMean        Scalar\n\tSwapRB      bool\n\tDdepth      MatType\n\tDataLayout  DataLayoutType\n\tPaddingMode PaddingModeType\n\tBorderValue Scalar\n}\n\nfunc NewImageToBlobParams(scale float64, size image.Point, mean Scalar,\n\tswapRB bool, ddepth MatType, dataLayout DataLayoutType, paddingMode PaddingModeType, border Scalar) ImageToBlobParams {\n\treturn ImageToBlobParams{\n\t\tScaleFactor: scale,\n\t\tSize:        size,\n\t\tMean:        mean,\n\t\tSwapRB:      swapRB,\n\t\tDdepth:      ddepth,\n\t\tDataLayout:  dataLayout,\n\t\tPaddingMode: paddingMode,\n\t\tBorderValue: border,\n\t}\n}\n\n// BlobRectToImageRect gets rectangle coordinates in original image system from rectangle in blob coordinates.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.10.0/d9/d3c/structcv_1_1dnn_1_1Image2BlobParams.html#a40b2b5a731da82f042279650ffb3c3ee\nfunc (p *ImageToBlobParams) BlobRectToImageRect(rect image.Rectangle, size image.Point) image.Rectangle {\n\tcRect := C.struct_Rect{\n\t\tx:      C.int(rect.Min.X),\n\t\ty:      C.int(rect.Min.Y),\n\t\twidth:  C.int(rect.Size().X),\n\t\theight: C.int(rect.Size().Y),\n\t}\n\n\tcSize := C.struct_Size{width: C.int(size.X), height: C.int(size.Y)}\n\n\tsz := C.struct_Size{\n\t\twidth:  C.int(p.Size.X),\n\t\theight: C.int(p.Size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(p.Mean.Val1),\n\t\tval2: C.double(p.Mean.Val2),\n\t\tval3: C.double(p.Mean.Val3),\n\t\tval4: C.double(p.Mean.Val4),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(p.BorderValue.Val1),\n\t\tval2: C.double(p.BorderValue.Val2),\n\t\tval3: C.double(p.BorderValue.Val3),\n\t\tval4: C.double(p.BorderValue.Val4),\n\t}\n\n\treturn toRect(C.Net_BlobRectToImageRect(cRect, cSize, C.double(p.ScaleFactor), sz, sMean, C.bool(p.SwapRB), C.int(p.Ddepth), C.int(p.DataLayout), C.int(p.PaddingMode), bv))\n}\n\n// BlobRectsToImageRects converts rectangle coordinates in original image system from rectangles in blob coordinates.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.10.0/d9/d3c/structcv_1_1dnn_1_1Image2BlobParams.html#a822728804c0d35fc3b743644ee192f60\nfunc (p *ImageToBlobParams) BlobRectsToImageRects(rects []image.Rectangle, size image.Point) []image.Rectangle {\n\tcRectArr := []C.struct_Rect{}\n\tfor _, v := range rects {\n\t\trect := C.struct_Rect{\n\t\t\tx:      C.int(v.Min.X),\n\t\t\ty:      C.int(v.Min.Y),\n\t\t\twidth:  C.int(v.Size().X),\n\t\t\theight: C.int(v.Size().Y),\n\t\t}\n\t\tcRectArr = append(cRectArr, rect)\n\t}\n\n\tcRects := C.Rects{\n\t\trects:  (*C.Rect)(&cRectArr[0]),\n\t\tlength: C.int(len(rects)),\n\t}\n\n\tcSize := C.struct_Size{width: C.int(size.X), height: C.int(size.Y)}\n\n\tsz := C.struct_Size{\n\t\twidth:  C.int(p.Size.X),\n\t\theight: C.int(p.Size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(p.Mean.Val1),\n\t\tval2: C.double(p.Mean.Val2),\n\t\tval3: C.double(p.Mean.Val3),\n\t\tval4: C.double(p.Mean.Val4),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(p.BorderValue.Val1),\n\t\tval2: C.double(p.BorderValue.Val2),\n\t\tval3: C.double(p.BorderValue.Val3),\n\t\tval4: C.double(p.BorderValue.Val4),\n\t}\n\n\treturn toRectangles(C.Net_BlobRectsToImageRects(cRects, cSize, C.double(p.ScaleFactor), sz, sMean, C.bool(p.SwapRB), C.int(p.Ddepth), C.int(p.DataLayout), C.int(p.PaddingMode), bv))\n}\n\n// Close Net\nfunc (net *Net) Close() error {\n\tC.Net_Close((C.Net)(net.p))\n\tnet.p = nil\n\treturn nil\n}\n\n// Empty returns true if there are no layers in the network.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a6a5778787d5b8770deab5eda6968e66c\nfunc (net *Net) Empty() bool {\n\treturn bool(C.Net_Empty((C.Net)(net.p)))\n}\n\n// SetInput sets the new value for the layer output blob.\n//\n// For further details, please see:\n// https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a672a08ae76444d75d05d7bfea3e4a328\nfunc (net *Net) SetInput(blob Mat, name string) {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tC.Net_SetInput((C.Net)(net.p), blob.p, cName)\n}\n\n// Forward runs forward pass to compute output of layer with name outputName.\n//\n// For further details, please see:\n// https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a98ed94cb6ef7063d3697259566da310b\nfunc (net *Net) Forward(outputName string) Mat {\n\tcName := C.CString(outputName)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn newMat(C.Net_Forward((C.Net)(net.p), cName))\n}\n\n// ForwardLayers forward pass to compute outputs of layers listed in outBlobNames.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4.1/db/d30/classcv_1_1dnn_1_1Net.html#adb34d7650e555264c7da3b47d967311b\nfunc (net *Net) ForwardLayers(outBlobNames []string) (blobs []Mat) {\n\tcMats := C.struct_Mats{}\n\tC.Net_ForwardLayers((C.Net)(net.p), &(cMats), toCStrings(outBlobNames))\n\tblobs = make([]Mat, cMats.length)\n\tfor i := C.int(0); i < cMats.length; i++ {\n\t\tblobs[i].p = C.Mats_get(cMats, i)\n\t\taddMatToProfile(blobs[i].p)\n\t}\n\treturn\n}\n\n// SetPreferableBackend ask network to use specific computation backend.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/db/d30/classcv_1_1dnn_1_1Net.html#a7f767df11386d39374db49cd8df8f59e\nfunc (net *Net) SetPreferableBackend(backend NetBackendType) error {\n\tC.Net_SetPreferableBackend((C.Net)(net.p), C.int(backend))\n\treturn nil\n}\n\n// SetPreferableTarget ask network to make computations on specific target device.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/db/d30/classcv_1_1dnn_1_1Net.html#a9dddbefbc7f3defbe3eeb5dc3d3483f4\nfunc (net *Net) SetPreferableTarget(target NetTargetType) error {\n\tC.Net_SetPreferableTarget((C.Net)(net.p), C.int(target))\n\treturn nil\n}\n\n// ReadNet reads a deep learning network represented in one of the supported formats.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/d6/d0f/group__dnn.html#ga3b34fe7a29494a6a4295c169a7d32422\nfunc ReadNet(model string, config string) Net {\n\tcModel := C.CString(model)\n\tdefer C.free(unsafe.Pointer(cModel))\n\n\tcConfig := C.CString(config)\n\tdefer C.free(unsafe.Pointer(cConfig))\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNet(cModel, cConfig))}\n}\n\n// ReadNetBytes reads a deep learning network represented in one of the supported formats.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga138439da76f26266fdefec9723f6c5cd\nfunc ReadNetBytes(framework string, model []byte, config []byte) (Net, error) {\n\tcFramework := C.CString(framework)\n\tdefer C.free(unsafe.Pointer(cFramework))\n\tbModel, err := toByteArray(model)\n\tif err != nil {\n\t\treturn Net{}, err\n\t}\n\n\tvar bConfig C.ByteArray\n\tif len(config) > 0 {\n\t\tpbConfig, err := toByteArray(config)\n\t\tif err != nil {\n\t\t\treturn Net{}, err\n\t\t}\n\t\tbConfig = *pbConfig\n\t}\n\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetBytes(cFramework, *bModel, bConfig))}, nil\n}\n\n// ReadNetFromCaffe reads a network model stored in Caffe framework's format.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga29d0ea5e52b1d1a6c2681e3f7d68473a\nfunc ReadNetFromCaffe(prototxt string, caffeModel string) Net {\n\tcprototxt := C.CString(prototxt)\n\tdefer C.free(unsafe.Pointer(cprototxt))\n\n\tcmodel := C.CString(caffeModel)\n\tdefer C.free(unsafe.Pointer(cmodel))\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromCaffe(cprototxt, cmodel))}\n}\n\n// ReadNetFromCaffeBytes reads a network model stored in Caffe model in memory.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga946b342af1355185a7107640f868b64a\nfunc ReadNetFromCaffeBytes(prototxt []byte, caffeModel []byte) (Net, error) {\n\tbPrototxt, err := toByteArray(prototxt)\n\tif err != nil {\n\t\treturn Net{}, err\n\t}\n\tbCaffeModel, err := toByteArray(caffeModel)\n\tif err != nil {\n\t\treturn Net{}, err\n\t}\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromCaffeBytes(*bPrototxt, *bCaffeModel))}, nil\n}\n\n// ReadNetFromTensorflow reads a network model stored in Tensorflow framework's format.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#gad820b280978d06773234ba6841e77e8d\nfunc ReadNetFromTensorflow(model string) Net {\n\tcmodel := C.CString(model)\n\tdefer C.free(unsafe.Pointer(cmodel))\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromTensorflow(cmodel))}\n}\n\n// ReadNetFromTensorflowBytes reads a network model stored in Tensorflow framework's format.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#gacdba30a7c20db2788efbf5bb16a7884d\nfunc ReadNetFromTensorflowBytes(model []byte) (Net, error) {\n\tbModel, err := toByteArray(model)\n\tif err != nil {\n\t\treturn Net{}, err\n\t}\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromTensorflowBytes(*bModel))}, nil\n}\n\n// ReadNetFromTorch reads a network model stored in Torch framework's format (t7).\n//\n//\tcheck net.Empty() for read failure\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#gaaaed8c8530e9e92fe6647700c13d961e\nfunc ReadNetFromTorch(model string) Net {\n\tcmodel := C.CString(model)\n\tdefer C.free(unsafe.Pointer(cmodel))\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromTorch(cmodel))}\n}\n\n// ReadNetFromONNX reads a network model stored in ONNX framework's format.\n//\n//\tcheck net.Empty() for read failure\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga7faea56041d10c71dbbd6746ca854197\nfunc ReadNetFromONNX(model string) Net {\n\tcmodel := C.CString(model)\n\tdefer C.free(unsafe.Pointer(cmodel))\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromONNX(cmodel))}\n}\n\n// ReadNetFromONNXBytes reads a network model stored in ONNX framework's format.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga9198ecaac7c32ddf0aa7a1bcbd359567\nfunc ReadNetFromONNXBytes(model []byte) (Net, error) {\n\tbModel, err := toByteArray(model)\n\tif err != nil {\n\t\treturn Net{}, err\n\t}\n\treturn Net{p: unsafe.Pointer(C.Net_ReadNetFromONNXBytes(*bModel))}, nil\n}\n\n// BlobFromImage creates 4-dimensional blob from image. Optionally resizes and crops\n// image from center, subtract mean values, scales values by scalefactor,\n// swap Blue and Red channels.\n//\n// For further details, please see:\n// https://docs.opencv.org/trunk/d6/d0f/group__dnn.html#ga152367f253c81b53fe6862b299f5c5cd\nfunc BlobFromImage(img Mat, scaleFactor float64, size image.Point, mean Scalar,\n\tswapRB bool, crop bool) Mat {\n\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(mean.Val1),\n\t\tval2: C.double(mean.Val2),\n\t\tval3: C.double(mean.Val3),\n\t\tval4: C.double(mean.Val4),\n\t}\n\n\treturn newMat(C.Net_BlobFromImage(img.p, C.double(scaleFactor), sz, sMean, C.bool(swapRB), C.bool(crop)))\n}\n\n// BlobFromImageWithParams creates 4-dimensional blob from image. Optionally resizes and crops\n// image from center, subtract mean values, scales values by scalefactor,\n// swap Blue and Red channels.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.10.0/d6/d0f/group__dnn.html#gadc12e5f4a801fd3c1d802f4c8c5d311c\nfunc BlobFromImageWithParams(img Mat, params ImageToBlobParams) Mat {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(params.Size.X),\n\t\theight: C.int(params.Size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(params.Mean.Val1),\n\t\tval2: C.double(params.Mean.Val2),\n\t\tval3: C.double(params.Mean.Val3),\n\t\tval4: C.double(params.Mean.Val4),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(params.BorderValue.Val1),\n\t\tval2: C.double(params.BorderValue.Val2),\n\t\tval3: C.double(params.BorderValue.Val3),\n\t\tval4: C.double(params.BorderValue.Val4),\n\t}\n\n\treturn newMat(C.Net_BlobFromImageWithParams(img.p, C.double(params.ScaleFactor), sz, sMean, C.bool(params.SwapRB), C.int(params.Ddepth), C.int(params.DataLayout), C.int(params.PaddingMode), bv))\n}\n\n// BlobFromImages Creates 4-dimensional blob from series of images.\n// Optionally resizes and crops images from center, subtract mean values,\n// scales values by scalefactor, swap Blue and Red channels.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga2b89ed84432e4395f5a1412c2926293c\nfunc BlobFromImages(imgs []Mat, blob *Mat, scaleFactor float64, size image.Point, mean Scalar,\n\tswapRB bool, crop bool, ddepth MatType) {\n\n\tcMatArray := make([]C.Mat, len(imgs))\n\tfor i, r := range imgs {\n\t\tcMatArray[i] = r.p\n\t}\n\n\tcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(imgs)),\n\t}\n\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(mean.Val1),\n\t\tval2: C.double(mean.Val2),\n\t\tval3: C.double(mean.Val3),\n\t\tval4: C.double(mean.Val4),\n\t}\n\n\tC.Net_BlobFromImages(cMats, blob.p, C.double(scaleFactor), sz, sMean, C.bool(swapRB), C.bool(crop), C.int(ddepth))\n}\n\n// BlobFromImagesWithParams Creates 4-dimensional blob from series of images.\n// Optionally resizes and crops images from center, subtract mean values,\n// scales values by scalefactor, swap Blue and Red channels.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga2b89ed84432e4395f5a1412c2926293c\nfunc BlobFromImagesWithParams(imgs []Mat, blob *Mat, params ImageToBlobParams) {\n\tcMatArray := make([]C.Mat, len(imgs))\n\tfor i, r := range imgs {\n\t\tcMatArray[i] = r.p\n\t}\n\n\tcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(imgs)),\n\t}\n\n\tsz := C.struct_Size{\n\t\twidth:  C.int(params.Size.X),\n\t\theight: C.int(params.Size.Y),\n\t}\n\n\tsMean := C.struct_Scalar{\n\t\tval1: C.double(params.Mean.Val1),\n\t\tval2: C.double(params.Mean.Val2),\n\t\tval3: C.double(params.Mean.Val3),\n\t\tval4: C.double(params.Mean.Val4),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(params.BorderValue.Val1),\n\t\tval2: C.double(params.BorderValue.Val2),\n\t\tval3: C.double(params.BorderValue.Val3),\n\t\tval4: C.double(params.BorderValue.Val4),\n\t}\n\n\tC.Net_BlobFromImagesWithParams(cMats, blob.p, C.double(params.ScaleFactor), sz, sMean, C.bool(params.SwapRB), C.int(params.Ddepth), C.int(params.DataLayout), C.int(params.PaddingMode), bv)\n}\n\n// ImagesFromBlob Parse a 4D blob and output the images it contains as\n// 2D arrays through a simpler data structure (std::vector<cv::Mat>).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d0f/group__dnn.html#ga4051b5fa2ed5f54b76c059a8625df9f5\nfunc ImagesFromBlob(blob Mat, imgs []Mat) {\n\tcMats := C.struct_Mats{}\n\tC.Net_ImagesFromBlob(blob.p, &(cMats))\n\t// mv = make([]Mat, cMats.length)\n\tfor i := C.int(0); i < cMats.length; i++ {\n\t\timgs[i].p = C.Mats_get(cMats, i)\n\t}\n}\n\n// GetBlobChannel extracts a single (2d)channel from a 4 dimensional blob structure\n// (this might e.g. contain the results of a SSD or YOLO detection,\n//\n//\ta bones structure from pose detection, or a color plane from Colorization)\nfunc GetBlobChannel(blob Mat, imgidx int, chnidx int) Mat {\n\treturn newMat(C.Net_GetBlobChannel(blob.p, C.int(imgidx), C.int(chnidx)))\n}\n\n// GetBlobSize retrieves the 4 dimensional size information in (N,C,H,W) order\nfunc GetBlobSize(blob Mat) Scalar {\n\ts := C.Net_GetBlobSize(blob.p)\n\treturn NewScalar(float64(s.val1), float64(s.val2), float64(s.val3), float64(s.val4))\n}\n\n// Layer is a wrapper around the cv::dnn::Layer algorithm.\ntype Layer struct {\n\t// C.Layer\n\tp unsafe.Pointer\n}\n\n// GetLayer returns pointer to layer with specified id from the network.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a70aec7f768f38c32b1ee25f3a56526df\nfunc (net *Net) GetLayer(layer int) Layer {\n\treturn Layer{p: unsafe.Pointer(C.Net_GetLayer((C.Net)(net.p), C.int(layer)))}\n}\n\n// GetPerfProfile returns overall time for inference and timings (in ticks) for layers\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#a06ce946f675f75d1c020c5ddbc78aedc\nfunc (net *Net) GetPerfProfile() float64 {\n\treturn float64(C.Net_GetPerfProfile((C.Net)(net.p)))\n}\n\n// GetUnconnectedOutLayers returns indexes of layers with unconnected outputs.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#ae62a73984f62c49fd3e8e689405b056a\nfunc (net *Net) GetUnconnectedOutLayers() (ids []int) {\n\tcids := C.IntVector{}\n\tC.Net_GetUnconnectedOutLayers((C.Net)(net.p), &cids)\n\tdefer C.free(unsafe.Pointer(cids.val))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cids.val)),\n\t\tLen:  int(cids.length),\n\t\tCap:  int(cids.length),\n\t}\n\tpcids := *(*[]C.int)(unsafe.Pointer(h))\n\n\tfor i := 0; i < int(cids.length); i++ {\n\t\tids = append(ids, int(pcids[i]))\n\t}\n\treturn\n}\n\n// GetLayerNames returns all layer names.\n//\n// For furtherdetails, please see:\n// https://docs.opencv.org/master/db/d30/classcv_1_1dnn_1_1Net.html#ae8be9806024a0d1d41aba687cce99e6b\nfunc (net *Net) GetLayerNames() (names []string) {\n\tcstrs := C.CStrings{}\n\tdefer C.CStrings_Close(cstrs)\n\tC.Net_GetLayerNames((C.Net)(net.p), &cstrs)\n\treturn toGoStrings(cstrs)\n}\n\n// Close Layer\nfunc (l *Layer) Close() error {\n\tC.Layer_Close((C.Layer)(l.p))\n\tl.p = nil\n\treturn nil\n}\n\n// GetName returns name for this layer.\nfunc (l *Layer) GetName() string {\n\treturn C.GoString(C.Layer_GetName((C.Layer)(l.p)))\n}\n\n// GetType returns type for this layer.\nfunc (l *Layer) GetType() string {\n\treturn C.GoString(C.Layer_GetType((C.Layer)(l.p)))\n}\n\n// InputNameToIndex returns index of input blob in input array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d6c/classcv_1_1dnn_1_1Layer.html#a60ffc8238f3fa26cd3f49daa7ac0884b\nfunc (l *Layer) InputNameToIndex(name string) int {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn int(C.Layer_InputNameToIndex((C.Layer)(l.p), cName))\n}\n\n// OutputNameToIndex returns index of output blob in output array.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d6c/classcv_1_1dnn_1_1Layer.html#a60ffc8238f3fa26cd3f49daa7ac0884b\nfunc (l *Layer) OutputNameToIndex(name string) int {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn int(C.Layer_OutputNameToIndex((C.Layer)(l.p), cName))\n}\n\n// NMSBoxes performs non maximum suppression given boxes and corresponding scores.\n//\n// For futher details, please see:\n// https://docs.opencv.org/4.4.0/d6/d0f/group__dnn.html#ga9d118d70a1659af729d01b10233213ee\nfunc NMSBoxes(bboxes []image.Rectangle, scores []float32, scoreThreshold float32, nmsThreshold float32) (indices []int) {\n\tbboxesRectArr := []C.struct_Rect{}\n\tfor _, v := range bboxes {\n\t\tbbox := C.struct_Rect{\n\t\t\tx:      C.int(v.Min.X),\n\t\t\ty:      C.int(v.Min.Y),\n\t\t\twidth:  C.int(v.Size().X),\n\t\t\theight: C.int(v.Size().Y),\n\t\t}\n\t\tbboxesRectArr = append(bboxesRectArr, bbox)\n\t}\n\n\tbboxesRects := C.Rects{\n\t\trects:  (*C.Rect)(&bboxesRectArr[0]),\n\t\tlength: C.int(len(bboxes)),\n\t}\n\n\tscoresFloats := []C.float{}\n\tfor _, v := range scores {\n\t\tscoresFloats = append(scoresFloats, C.float(v))\n\t}\n\tscoresVector := C.struct_FloatVector{}\n\tscoresVector.val = (*C.float)(&scoresFloats[0])\n\tscoresVector.length = (C.int)(len(scoresFloats))\n\n\tindicesVector := C.IntVector{}\n\n\tC.NMSBoxes(bboxesRects, scoresVector, C.float(scoreThreshold), C.float(nmsThreshold), &indicesVector)\n\tdefer C.free(unsafe.Pointer(indicesVector.val))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(indicesVector.val)),\n\t\tLen:  int(indicesVector.length),\n\t\tCap:  int(indicesVector.length),\n\t}\n\n\tptr := *(*[]C.int)(unsafe.Pointer(h))\n\n\tindices = make([]int, indicesVector.length)\n\tfor i := 0; i < int(indicesVector.length); i++ {\n\t\tindices[i] = int(ptr[i])\n\t}\n\treturn\n}\n\n// NMSBoxesWithParams performs non maximum suppression given boxes and corresponding scores.\n//\n// For futher details, please see:\n// https://docs.opencv.org/4.4.0/d6/d0f/group__dnn.html#ga9d118d70a1659af729d01b10233213ee\nfunc NMSBoxesWithParams(bboxes []image.Rectangle, scores []float32, scoreThreshold float32, nmsThreshold float32, eta float32, topK int) (indices []int) {\n\tbboxesRectArr := []C.struct_Rect{}\n\tfor _, v := range bboxes {\n\t\tbbox := C.struct_Rect{\n\t\t\tx:      C.int(v.Min.X),\n\t\t\ty:      C.int(v.Min.Y),\n\t\t\twidth:  C.int(v.Size().X),\n\t\t\theight: C.int(v.Size().Y),\n\t\t}\n\t\tbboxesRectArr = append(bboxesRectArr, bbox)\n\t}\n\n\tbboxesRects := C.Rects{\n\t\trects:  (*C.Rect)(&bboxesRectArr[0]),\n\t\tlength: C.int(len(bboxes)),\n\t}\n\n\tscoresFloats := []C.float{}\n\tfor _, v := range scores {\n\t\tscoresFloats = append(scoresFloats, C.float(v))\n\t}\n\tscoresVector := C.struct_FloatVector{}\n\tscoresVector.val = (*C.float)(&scoresFloats[0])\n\tscoresVector.length = (C.int)(len(scoresFloats))\n\n\tindicesVector := C.IntVector{}\n\n\tC.NMSBoxesWithParams(bboxesRects, scoresVector, C.float(scoreThreshold), C.float(nmsThreshold), &indicesVector, C.float(eta), C.int(topK))\n\tdefer C.free(unsafe.Pointer(indicesVector.val))\n\n\th := &reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(indicesVector.val)),\n\t\tLen:  int(indicesVector.length),\n\t\tCap:  int(indicesVector.length),\n\t}\n\n\tptr := *(*[]C.int)(unsafe.Pointer(h))\n\n\tindices = make([]int, indicesVector.length)\n\tfor i := 0; i < int(indicesVector.length); i++ {\n\t\tindices[i] = int(ptr[i])\n\t}\n\treturn\n}\n"
  },
  {
    "path": "dnn.h",
    "content": "#ifndef _OPENCV3_DNN_H_\n#define _OPENCV3_DNN_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/dnn.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::dnn::Net* Net;\ntypedef cv::Ptr<cv::dnn::Layer>* Layer;\n#else\ntypedef void* Net;\ntypedef void* Layer;\n#endif\n\nNet Net_ReadNet(const char* model, const char* config);\nNet Net_ReadNetBytes(const char* framework, struct ByteArray model, struct ByteArray config);\nNet Net_ReadNetFromCaffe(const char* prototxt, const char* caffeModel);\nNet Net_ReadNetFromCaffeBytes(struct ByteArray prototxt, struct ByteArray caffeModel);\nNet Net_ReadNetFromTensorflow(const char* model);\nNet Net_ReadNetFromTensorflowBytes(struct ByteArray model);\nNet Net_ReadNetFromTorch(const char* model);\nNet Net_ReadNetFromONNX(const char* model);\nNet Net_ReadNetFromONNXBytes(struct ByteArray model);\nstruct Rect Net_BlobRectToImageRect(struct Rect rect, Size originalSize, double scalefactor, Size size, Scalar mean, bool swapRB,\n                    int ddepth, int dataLayout, int paddingMode, Scalar borderValue);\nstruct Rects Net_BlobRectsToImageRects(struct Rects rects, Size originalSize, double scalefactor, Size size, Scalar mean, bool swapRB,\n                    int ddepth, int dataLayout, int paddingMode, Scalar borderValue);\nMat Net_BlobFromImage(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB,\n                      bool crop);\nMat Net_BlobFromImageWithParams(Mat image, double scalefactor, Size size, Scalar mean, bool swapRB,\n                      int ddepth, int dataLayout, int paddingMode, Scalar borderValue);\nvoid Net_BlobFromImages(struct Mats images, Mat blob,  double scalefactor, Size size, \n                        Scalar mean, bool swapRB, bool crop, int ddepth);\nvoid Net_BlobFromImagesWithParams(struct Mats images, Mat blob, double scalefactor, Size size, \n                        Scalar mean, bool swapRB, int ddepth, int dataLayout, int paddingMode, Scalar borderValue);\nvoid Net_ImagesFromBlob(Mat blob_, struct Mats* images_);\nvoid Net_Close(Net net);\nbool Net_Empty(Net net);\nvoid Net_SetInput(Net net, Mat blob, const char* name);\nMat Net_Forward(Net net, const char* outputName);\nvoid Net_ForwardLayers(Net net, struct Mats* outputBlobs, struct CStrings outBlobNames);\nvoid Net_SetPreferableBackend(Net net, int backend);\nvoid Net_SetPreferableTarget(Net net, int target);\nint64_t Net_GetPerfProfile(Net net);\nvoid Net_GetUnconnectedOutLayers(Net net, IntVector* res);\nvoid Net_GetLayerNames(Net net, CStrings* names);\n\nMat Net_GetBlobChannel(Mat blob, int imgidx, int chnidx);\nScalar Net_GetBlobSize(Mat blob);\n\nLayer Net_GetLayer(Net net, int layerid);\nvoid Layer_Close(Layer layer);\nint Layer_InputNameToIndex(Layer layer, const char* name);\nint Layer_OutputNameToIndex(Layer layer, const char* name);\nconst char* Layer_GetName(Layer layer);\nconst char* Layer_GetType(Layer layer);\n\nvoid NMSBoxes(struct Rects bboxes, FloatVector scores, float score_threshold, float nms_threshold, IntVector* indices);\nvoid NMSBoxesWithParams(struct Rects bboxes, FloatVector scores, const float score_threshold, const float nms_threshold, IntVector* indices, const float eta, const int top_k);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_DNN_H_\n"
  },
  {
    "path": "dnn_async_openvino.go",
    "content": "//go:build openvino\n// +build openvino\n\npackage gocv\n\nimport (\n\t\"unsafe\"\n)\n\n/*\n#include <stdlib.h>\n#include \"dnn.h\"\n#include \"asyncarray.h\"\n*/\nimport \"C\"\n\n// ForwardAsync runs forward pass to compute output of layer with name outputName.\n//\n// For further details, please see:\n// https://docs.opencv.org/trunk/db/d30/classcv_1_1dnn_1_1Net.html#a814890154ea9e10b132fec00b6f6ba30\nfunc (net *Net) ForwardAsync(outputName string) AsyncArray {\n\tcName := C.CString(outputName)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn newAsyncArray(C.Net_forwardAsync((C.Net)(net.p), cName))\n}\n"
  },
  {
    "path": "dnn_ext.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_dnn)\n\npackage gocv\n\nimport (\n\t\"image\"\n)\n\n// FP16BlobFromImage is an extended helper function to convert an Image to a half-float blob, as used by\n// the Movidius Neural Compute Stick.\nfunc FP16BlobFromImage(img Mat, scaleFactor float32, size image.Point, mean float32,\n\tswapRB bool, crop bool) []byte {\n\n\t// resizes image so it maintains aspect ratio\n\twidth := float32(img.Cols())\n\theight := float32(img.Rows())\n\n\tsquare := NewMatWithSize(size.Y, size.X, img.Type())\n\tdefer square.Close()\n\n\tmaxDim := height\n\tvar scale float32 = 1.0\n\tif width > height {\n\t\tmaxDim = width\n\t\tscale = float32(size.X) / float32(maxDim)\n\t}\n\tif width < height {\n\t\tscale = float32(size.Y) / float32(maxDim)\n\t}\n\n\tvar roi image.Rectangle\n\tif width >= height {\n\t\troi.Min.X = 0\n\t\troi.Min.Y = int(float32(size.Y)-height*scale) / 2\n\t\troi.Max.X = size.X\n\t\troi.Max.Y = int(height * scale)\n\t} else {\n\t\troi.Min.X = int(float32(size.X)-width*scale) / 2\n\t\troi.Min.Y = 0\n\t\troi.Max.X = int(width * scale)\n\t\troi.Max.Y = size.Y\n\t}\n\n\tResize(img, &square, roi.Max, 0, 0, InterpolationDefault)\n\n\tif swapRB {\n\t\tCvtColor(square, &square, ColorBGRToRGB)\n\t}\n\n\tfp32Image := NewMat()\n\tdefer fp32Image.Close()\n\n\tsquare.ConvertTo(&fp32Image, MatTypeCV32F)\n\n\tif mean != 0 {\n\t\t// subtract mean\n\t\tfp32Image.SubtractFloat(mean)\n\t}\n\n\tif scaleFactor != 1.0 {\n\t\t// multiply by scale factor\n\t\tfp32Image.MultiplyFloat(scaleFactor)\n\t}\n\n\tfp16Blob := fp32Image.ConvertFp16()\n\tdefer fp16Blob.Close()\n\n\treturn fp16Blob.ToBytes()\n}\n"
  },
  {
    "path": "dnn_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_dnn)\n\npackage gocv\n\nfunc (c NetBackendType) String() string {\n\tswitch c {\n\tcase NetBackendDefault:\n\t\treturn \"\"\n\tcase NetBackendHalide:\n\t\treturn \"halide\"\n\tcase NetBackendOpenVINO:\n\t\treturn \"openvino\"\n\tcase NetBackendOpenCV:\n\t\treturn \"opencv\"\n\tcase NetBackendVKCOM:\n\t\treturn \"vulkan\"\n\tcase NetBackendCUDA:\n\t\treturn \"cuda\"\n\t}\n\treturn \"\"\n}\n\nfunc (c NetTargetType) String() string {\n\tswitch c {\n\tcase NetTargetCPU:\n\t\treturn \"cpu\"\n\tcase NetTargetFP32:\n\t\treturn \"fp32\"\n\tcase NetTargetFP16:\n\t\treturn \"fp16\"\n\tcase NetTargetVPU:\n\t\treturn \"vpu\"\n\tcase NetTargetVulkan:\n\t\treturn \"vulkan\"\n\tcase NetTargetFPGA:\n\t\treturn \"fpga\"\n\tcase NetTargetCUDA:\n\t\treturn \"cuda\"\n\tcase NetTargetCUDAFP16:\n\t\treturn \"cudafp16\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "dnn_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_dnn)\n\npackage gocv\n\nimport (\n\t\"image\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestReadNetDiskFromTensorflow(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_TENSORFLOW_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Tensorflow model files for tests\")\n\t}\n\n\tnet := ReadNet(path+\"/tensorflow_inception_graph.pb\", \"\")\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Tensorflow model using ReadNet\")\n\t}\n\tdefer net.Close()\n\n\tcheckTensorflowNet(t, net)\n}\n\nfunc TestReadNetMemoryFromTensorflow(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_TENSORFLOW_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Tensorflow model files for tests\")\n\t}\n\n\tbModel, err := os.ReadFile(path + \"/tensorflow_inception_graph.pb\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load model from file: %v\", err)\n\t}\n\n\t_, err = ReadNetBytes(\"tensorflow\", nil, nil)\n\tif err == nil {\n\t\tt.Errorf(\"Should have error for reading nil model bytes\")\n\t}\n\n\tnet, err := ReadNetBytes(\"tensorflow\", bModel, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to read net bytes: %v\", err)\n\t}\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Tensorflow model using ReadNetBytes\")\n\t}\n\tdefer net.Close()\n\n\tcheckTensorflowNet(t, net)\n}\n\nfunc TestReadNetDiskFromONNX(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_ONNX_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate ONNX model files for tests\")\n\t}\n\n\tnet := ReadNet(filepath.Join(path, \"googlenet-9.onnx\"), \"\")\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load ONNX model using ReadNet\")\n\t}\n\tdefer net.Close()\n\n\tm := map[int]string{\n\t\t0:   \"onnx_node_output_0!conv1/7x7_s2_1\",\n\t\t10:  \"onnx_node_output_0!inception_3a/1x1_1\",\n\t\t20:  \"onnx_node_output_0!inception_3a/pool_1\",\n\t\t30:  \"onnx_node_output_0!inception_3b/5x5_reduce_1\",\n\t\t40:  \"onnx_node_output_0!inception_4a/1x1_2\",\n\t\t50:  \"onnx_node_output_0!inception_4a/pool_proj_1\",\n\t\t60:  \"onnx_node_output_0!inception_4b/5x5_reduce_2\",\n\t\t70:  \"onnx_node_output_0!inception_4c/3x3_reduce_2\",\n\t\t80:  \"onnx_node_output_0!inception_4c/output_1\",\n\t\t90:  \"onnx_node_output_0!inception_4d/5x5_2\",\n\t\t100: \"onnx_node_output_0!inception_4e/3x3_2\",\n\t\t110: \"onnx_node_output_0!inception_5a/1x1_1\",\n\t\t120: \"onnx_node_output_0!inception_5a/pool_1\",\n\t\t130: \"onnx_node_output_0!inception_5b/5x5_reduce_1\",\n\t\t140: \"onnx_node_output_0!OC2_DUMMY_0\"}\n\n\tcheckONNXNet(t, net, m, 144)\n}\n\nfunc TestReadNetMemoryFromONNX(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_ONNX_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate ONNX model files for tests\")\n\t}\n\n\tbModel, err := os.ReadFile(filepath.Join(path, \"googlenet-9.onnx\"))\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load model from file: %v\", err)\n\t}\n\n\t_, err = ReadNetBytes(\"onnx\", nil, nil)\n\tif err == nil {\n\t\tt.Errorf(\"Should have error for reading nil model bytes\")\n\t}\n\n\tnet, err := ReadNetBytes(\"onnx\", bModel, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to read net bytes: %v\", err)\n\t}\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Caffe model using ReadNetBytes\")\n\t}\n\tdefer net.Close()\n\n\tm := map[int]string{\n\t\t0:   \"onnx_node_output_0!conv1/7x7_s2_1\",\n\t\t10:  \"onnx_node_output_0!inception_3a/1x1_1\",\n\t\t20:  \"onnx_node_output_0!inception_3a/pool_1\",\n\t\t30:  \"onnx_node_output_0!inception_3b/5x5_reduce_1\",\n\t\t40:  \"onnx_node_output_0!inception_4a/1x1_2\",\n\t\t50:  \"onnx_node_output_0!inception_4a/pool_proj_1\",\n\t\t60:  \"onnx_node_output_0!inception_4b/5x5_reduce_2\",\n\t\t70:  \"onnx_node_output_0!inception_4c/3x3_reduce_2\",\n\t\t80:  \"onnx_node_output_0!inception_4c/output_1\",\n\t\t90:  \"onnx_node_output_0!inception_4d/5x5_2\",\n\t\t100: \"onnx_node_output_0!inception_4e/3x3_2\",\n\t\t110: \"onnx_node_output_0!inception_5a/1x1_1\",\n\t\t120: \"onnx_node_output_0!inception_5a/pool_1\",\n\t\t130: \"onnx_node_output_0!inception_5b/5x5_reduce_1\",\n\t\t140: \"onnx_node_output_0!OC2_DUMMY_0\"}\n\n\tcheckONNXNet(t, net, m, 144)\n}\n\nfunc checkTensorflowNet(t *testing.T, net Net) {\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in Tensorflow test\")\n\t}\n\tdefer img.Close()\n\n\tblob := BlobFromImage(img, 1.0, image.Pt(224, 224), NewScalar(0, 0, 0, 0), true, false)\n\tif blob.Empty() {\n\t\tt.Error(\"Invalid blob in Tensorflow test\")\n\t}\n\tdefer blob.Close()\n\n\tnet.SetInput(blob, \"input\")\n\tprob := net.Forward(\"softmax2\")\n\tdefer prob.Close()\n\tif prob.Empty() {\n\t\tt.Error(\"Invalid softmax2 in Tensorflow test\")\n\t}\n\n\tprobMat := prob.Reshape(1, 1)\n\tdefer probMat.Close()\n\t_, maxVal, minLoc, maxLoc := MinMaxLoc(probMat)\n\n\tif round(float64(maxVal), 0.00005) != 1.0 {\n\t\tt.Errorf(\"Tensorflow maxVal incorrect: %v\\n\", round(float64(maxVal), 0.00005))\n\t}\n\n\tif minLoc.X != 481 || minLoc.Y != 0 {\n\t\tt.Errorf(\"Tensorflow minLoc incorrect: %v\\n\", minLoc)\n\t}\n\n\tif maxLoc.X != 234 || maxLoc.Y != 0 {\n\t\tt.Errorf(\"Tensorflow maxLoc incorrect: %v\\n\", maxLoc)\n\t}\n}\n\nfunc TestTensorflowDisk(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_TENSORFLOW_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Tensorflow model file for tests\")\n\t}\n\n\tnet := ReadNetFromTensorflow(path + \"/tensorflow_inception_graph.pb\")\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Tensorflow model\")\n\t}\n\tdefer net.Close()\n\n\tcheckTensorflowNet(t, net)\n}\n\nfunc TestTensorflowMemory(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_TENSORFLOW_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate Tensorflow model file for tests\")\n\t}\n\n\tb, err := os.ReadFile(path + \"/tensorflow_inception_graph.pb\")\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load tensorflow model from file: %v\", err)\n\t}\n\tnet, err := ReadNetFromTensorflowBytes(b)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load Tensorflow model from bytes: %v\", err)\n\t}\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Tensorflow model\")\n\t}\n\tdefer net.Close()\n\n\tcheckTensorflowNet(t, net)\n}\n\nfunc TestOnnxMemory(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_ONNX_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate ONNX model file for tests\")\n\t}\n\n\tb, err := os.ReadFile(filepath.Join(path, \"googlenet-9.onnx\"))\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load ONNX from file: %v\", err)\n\t}\n\n\tnet, err := ReadNetFromONNXBytes(b)\n\tif err != nil {\n\t\tt.Errorf(\"Failed to load Tensorflow model from bytes: %v\", err)\n\t}\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load Tensorflow model\")\n\t}\n\tdefer net.Close()\n\n\tm := map[int]string{\n\t\t0:   \"onnx_node_output_0!conv1/7x7_s2_1\",\n\t\t10:  \"onnx_node_output_0!inception_3a/1x1_1\",\n\t\t20:  \"onnx_node_output_0!inception_3a/pool_1\",\n\t\t30:  \"onnx_node_output_0!inception_3b/5x5_reduce_1\",\n\t\t40:  \"onnx_node_output_0!inception_4a/1x1_2\",\n\t\t50:  \"onnx_node_output_0!inception_4a/pool_proj_1\",\n\t\t60:  \"onnx_node_output_0!inception_4b/5x5_reduce_2\",\n\t\t70:  \"onnx_node_output_0!inception_4c/3x3_reduce_2\",\n\t\t80:  \"onnx_node_output_0!inception_4c/output_1\",\n\t\t90:  \"onnx_node_output_0!inception_4d/5x5_2\",\n\t\t100: \"onnx_node_output_0!inception_4e/3x3_2\",\n\t\t110: \"onnx_node_output_0!inception_5a/1x1_1\",\n\t\t120: \"onnx_node_output_0!inception_5a/pool_1\",\n\t\t130: \"onnx_node_output_0!inception_5b/5x5_reduce_1\",\n\t\t140: \"onnx_node_output_0!OC2_DUMMY_0\"}\n\n\tcheckONNXNet(t, net, m, 144)\n}\n\nfunc TestOnnxDisk(t *testing.T) {\n\tpath := os.Getenv(\"GOCV_ONNX_TEST_FILES\")\n\tif path == \"\" {\n\t\tt.Skip(\"Unable to locate ONNX model file for tests\")\n\t}\n\n\tnet := ReadNetFromONNX(filepath.Join(path, \"googlenet-9.onnx\"))\n\tif net.Empty() {\n\t\tt.Errorf(\"Unable to load ONNX model\")\n\t}\n\tdefer net.Close()\n\n\tm := map[int]string{\n\t\t0:   \"onnx_node_output_0!conv1/7x7_s2_1\",\n\t\t10:  \"onnx_node_output_0!inception_3a/1x1_1\",\n\t\t20:  \"onnx_node_output_0!inception_3a/pool_1\",\n\t\t30:  \"onnx_node_output_0!inception_3b/5x5_reduce_1\",\n\t\t40:  \"onnx_node_output_0!inception_4a/1x1_2\",\n\t\t50:  \"onnx_node_output_0!inception_4a/pool_proj_1\",\n\t\t60:  \"onnx_node_output_0!inception_4b/5x5_reduce_2\",\n\t\t70:  \"onnx_node_output_0!inception_4c/3x3_reduce_2\",\n\t\t80:  \"onnx_node_output_0!inception_4c/output_1\",\n\t\t90:  \"onnx_node_output_0!inception_4d/5x5_2\",\n\t\t100: \"onnx_node_output_0!inception_4e/3x3_2\",\n\t\t110: \"onnx_node_output_0!inception_5a/1x1_1\",\n\t\t120: \"onnx_node_output_0!inception_5a/pool_1\",\n\t\t130: \"onnx_node_output_0!inception_5b/5x5_reduce_1\",\n\t\t140: \"onnx_node_output_0!OC2_DUMMY_0\"}\n\n\tcheckONNXNet(t, net, m, 144)\n}\n\nfunc checkONNXNet(t *testing.T, net Net, expectedLayers map[int]string, expectedLayerCount int) {\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in ONNX test\")\n\t}\n\tdefer img.Close()\n\n\tblob := BlobFromImage(img, 1.0, image.Pt(224, 224), NewScalar(0, 0, 0, 0), true, false)\n\tif blob.Empty() {\n\t\tt.Error(\"Invalid blob in ONNX test\")\n\t}\n\tdefer blob.Close()\n\n\tlnames := net.GetLayerNames()\n\tif len(lnames) != expectedLayerCount {\n\t\tt.Errorf(\"Invalid len layer names in test: %d\\n\", len(lnames))\n\t}\n\t\n\tm := expectedLayers\n\tfor k, v := range m {\n\t\tif lnames[k] != v {\n\t\t\tt.Errorf(\"Invalid layer name in test: \\\"%s\\\" (expected=\\\"%s\\\")\\n\", lnames[k], v)\n\t\t}\n\t}\n\n\tnet.SetInput(blob, \"data_0\")\n\tprob := net.Forward(\"prob_1\")\n\tdefer prob.Close()\n\tif prob.Empty() {\n\t\tt.Error(\"Invalid output in ONNX test\")\n\t}\n\n\tprobMat := prob.Reshape(1, 1)\n\tdefer probMat.Close()\n\t_, maxVal, minLoc, maxLoc := MinMaxLoc(probMat)\n\n\tif round(float64(maxVal), 0.0005) != 0.9965 {\n\t\tt.Errorf(\"ONNX maxVal incorrect: %v\\n\", round(float64(maxVal), 0.0005))\n\t}\n\n\tif minLoc.X != 955 || minLoc.Y != 0 {\n\t\tt.Errorf(\"ONNX minLoc incorrect: %v\\n\", minLoc)\n\t}\n\n\tif maxLoc.X != 812 || maxLoc.Y != 0 {\n\t\tt.Errorf(\"ONNX maxLoc incorrect: %v\\n\", maxLoc)\n\t}\n}\n\nfunc TestBlobFromImages(t *testing.T) {\n\timgs := make([]Mat, 0)\n\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BlobFromImages test\")\n\t}\n\tdefer img.Close()\n\n\timgs = append(imgs, img)\n\timgs = append(imgs, img)\n\n\tblob := NewMat()\n\tBlobFromImages(imgs, &blob, 1.0, image.Pt(25, 25), NewScalar(0, 0, 0, 0), false, false, MatTypeCV32F)\n\tdefer blob.Close()\n\n\tsz := GetBlobSize(blob)\n\tif sz.Val1 != 2 || sz.Val2 != 3 || sz.Val3 != 25 || sz.Val4 != 25 {\n\t\tt.Errorf(\"GetBlobSize in BlobFromImages retrieved wrong values\")\n\t}\n}\n\nfunc TestBlobFromImageGreyscale(t *testing.T) {\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in TestBlobFromImageGreyscale test\")\n\t}\n\tdefer img.Close()\n\n\tblob := BlobFromImage(img, 1.0, image.Pt(100, 100), NewScalar(0, 0, 0, 0), false, false)\n\tdefer blob.Close()\n\n\tif blob.Empty() {\n\t\tt.Errorf(\"BlobFromImageGreyscale failed to create blob\")\n\t}\n}\n\nfunc TestBlobFromImageWithParams(t *testing.T) {\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BlobFromImages test\")\n\t}\n\tdefer img.Close()\n\n\tparams := NewImageToBlobParams(1.0, image.Pt(25, 25), NewScalar(0, 0, 0, 0), false, MatTypeCV32F, DataLayoutNCHW, PaddingModeCropCenter, NewScalar(0, 0, 0, 0))\n\tblob := BlobFromImageWithParams(img, params)\n\tdefer blob.Close()\n\n\tsz := GetBlobSize(blob)\n\tif sz.Val1 != 1 || sz.Val2 != 3 || sz.Val3 != 25 || sz.Val4 != 25 {\n\t\tt.Errorf(\"GetBlobSize in BlobFromImagesWithParams retrieved wrong values: %v\\n\", sz)\n\t}\n}\n\nfunc TestBlobFromImagesWithParams(t *testing.T) {\n\timgs := make([]Mat, 0)\n\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BlobFromImagesWithParams test\")\n\t}\n\tdefer img.Close()\n\n\timgs = append(imgs, img)\n\timgs = append(imgs, img)\n\n\tparams := NewImageToBlobParams(1.0, image.Pt(25, 25), NewScalar(0, 0, 0, 0), false, MatTypeCV32F, DataLayoutNCHW, PaddingModeCropCenter, NewScalar(0, 0, 0, 0))\n\tblob := NewMat()\n\tBlobFromImagesWithParams(imgs, &blob, params)\n\tdefer blob.Close()\n\n\tsz := GetBlobSize(blob)\n\tif sz.Val1 != 2 || sz.Val2 != 3 || sz.Val3 != 25 || sz.Val4 != 25 {\n\t\tt.Errorf(\"GetBlobSize in BlobFromImagesWithParams retrieved wrong values: %v\\n\", sz)\n\t}\n}\n\nfunc TestImagesFromBlob(t *testing.T) {\n\timgs := make([]Mat, 0)\n\n\timg := IMRead(\"images/space_shuttle.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BlobFromImages test\")\n\t}\n\tdefer img.Close()\n\n\timgs = append(imgs, img)\n\timgs = append(imgs, img)\n\n\tblob := NewMat()\n\tdefer blob.Close()\n\tBlobFromImages(imgs, &blob, 1.0, image.Pt(img.Size()[0], img.Size()[1]), NewScalar(0, 0, 0, 0), false, false, MatTypeCV32F)\n\n\timgsFromBlob := make([]Mat, len(imgs))\n\tImagesFromBlob(blob, imgsFromBlob)\n\n\tfor i := 0; i < len(imgs); i++ {\n\t\tfunc() {\n\t\t\timgFromBlob := NewMat()\n\t\t\tdefer imgFromBlob.Close()\n\t\t\timgsFromBlob[i].ConvertTo(&imgFromBlob, imgs[i].Type())\n\t\t\tdiff := NewMat()\n\t\t\tdefer diff.Close()\n\t\t\tCompare(imgs[i], imgFromBlob, &diff, CompareNE)\n\t\t\tnz := CountNonZero(diff)\n\t\t\tif nz != 0 {\n\t\t\t\tt.Error(\"imgFromBlob is different from img!\")\n\t\t\t}\n\t\t}()\n\t}\n}\n\nfunc TestGetBlobChannel(t *testing.T) {\n\timg := NewMatWithSize(100, 100, 5+16)\n\tdefer img.Close()\n\n\tblob := BlobFromImage(img, 1.0, image.Pt(0, 0), NewScalar(0, 0, 0, 0), true, false)\n\tdefer blob.Close()\n\n\tch2 := GetBlobChannel(blob, 0, 1)\n\tdefer ch2.Close()\n\n\tif ch2.Empty() {\n\t\tt.Errorf(\"GetBlobChannel failed to retrieve 2nd chan of a 3channel blob\")\n\t}\n\tif ch2.Rows() != img.Rows() || ch2.Cols() != img.Cols() {\n\t\tt.Errorf(\"GetBlobChannel: retrieved image size does not match original\")\n\t}\n}\n\nfunc TestGetBlobSize(t *testing.T) {\n\timg := NewMatWithSize(100, 100, 5+16)\n\tdefer img.Close()\n\n\tblob := BlobFromImage(img, 1.0, image.Pt(0, 0), NewScalar(0, 0, 0, 0), true, false)\n\tdefer blob.Close()\n\n\tsz := GetBlobSize(blob)\n\tif sz.Val1 != 1 || sz.Val2 != 3 || sz.Val3 != 100 || sz.Val4 != 100 {\n\t\tt.Errorf(\"GetBlobSize retrieved wrong values\")\n\t}\n}\n\nfunc TestParseNetBackend(t *testing.T) {\n\tval := ParseNetBackend(\"halide\")\n\tif val != NetBackendHalide {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n\tval = ParseNetBackend(\"openvino\")\n\tif val != NetBackendOpenVINO {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n\tval = ParseNetBackend(\"opencv\")\n\tif val != NetBackendOpenCV {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n\tval = ParseNetBackend(\"vulkan\")\n\tif val != NetBackendVKCOM {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n\tval = ParseNetBackend(\"cuda\")\n\tif val != NetBackendCUDA {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n\tval = ParseNetBackend(\"crazytrain\")\n\tif val != NetBackendDefault {\n\t\tt.Errorf(\"ParseNetBackend invalid\")\n\t}\n}\n\nfunc TestParseNetTarget(t *testing.T) {\n\tval := ParseNetTarget(\"cpu\")\n\tif val != NetTargetCPU {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"fp32\")\n\tif val != NetTargetFP32 {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"fp16\")\n\tif val != NetTargetFP16 {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"vpu\")\n\tif val != NetTargetVPU {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"cuda\")\n\tif val != NetTargetCUDA {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"vulkan\")\n\tif val != NetTargetVulkan {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"fpga\")\n\tif val != NetTargetFPGA {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"cudafp16\")\n\tif val != NetTargetCUDAFP16 {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n\tval = ParseNetTarget(\"idk\")\n\tif val != NetTargetCPU {\n\t\tt.Errorf(\"ParseNetTarget invalid\")\n\t}\n}\n\nfunc TestFP16BlobFromImage(t *testing.T) {\n\timg := NewMatWithSize(100, 100, 5+16)\n\tdefer img.Close()\n\n\tdata := FP16BlobFromImage(img, 1.0, image.Pt(100, 100), 0, false, false)\n\n\tif len(data) != 60000 {\n\t\tt.Errorf(\"FP16BlobFromImage incorrect length: %v\\n\", len(data))\n\t}\n\n\timg2 := NewMatWithSize(100, 50, 5+16)\n\tdefer img2.Close()\n\n\tdata = FP16BlobFromImage(img2, 2.0, image.Pt(50, 100), -0.1, true, false)\n\n\tif len(data) != 30000 {\n\t\tt.Errorf(\"FP16BlobFromImage incorrect length: %v\\n\", len(data))\n\t}\n}\n\nfunc TestNMSBoxes(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in NMSBoxes test\")\n\t}\n\tdefer img.Close()\n\n\timg.ConvertTo(&img, MatTypeCV32F)\n\n\tbboxes := []image.Rectangle{\n\t\timage.Rect(53, 47, 589, 451),\n\t\timage.Rect(118, 54, 618, 450),\n\t\timage.Rect(53, 66, 605, 480),\n\t\timage.Rect(111, 65, 630, 480),\n\t\timage.Rect(156, 51, 640, 480),\n\t}\n\tscores := []float32{0.82094115, 0.7998236, 0.9809663, 0.99717456, 0.89628726}\n\tscoreThreshold := float32(0.5)\n\tnmsThreshold := float32(0.4)\n\n\tindices := NMSBoxes(bboxes, scores, scoreThreshold, nmsThreshold)\n\n\tif indices[0] != 3 {\n\t\tt.Errorf(\"Invalid NMSBoxes test indices: %v\", indices)\n\t}\n}\n\nfunc TestNMSBoxesWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in NMSBoxesWithParams test\")\n\t}\n\tdefer img.Close()\n\n\timg.ConvertTo(&img, MatTypeCV32F)\n\n\tbboxes := []image.Rectangle{\n\t\timage.Rect(53, 47, 589, 451),\n\t\timage.Rect(118, 54, 618, 450),\n\t\timage.Rect(53, 66, 605, 480),\n\t\timage.Rect(111, 65, 630, 480),\n\t\timage.Rect(156, 51, 640, 480),\n\t}\n\tscores := []float32{0.82094115, 0.7998236, 0.9809663, 0.99717456, 0.89628726}\n\tscoreThreshold := float32(0.5)\n\tnmsThreshold := float32(0.4)\n\n\tindices := NMSBoxesWithParams(bboxes, scores, scoreThreshold, nmsThreshold, float32(1.0), 0)\n\n\tif indices[0] != 3 {\n\t\tt.Errorf(\"Invalid NMSBoxesWithParams test indices: %v\", indices)\n\t}\n}\n"
  },
  {
    "path": "env.cmd",
    "content": "ECHO This script is no longer necessary and has been deprecated.\r\nECHO See the Custom Environment section of the README if you need to customize your environment.\r\n"
  },
  {
    "path": "env.sh",
    "content": "echo \"This script is no longer necessary and has been deprecated.\"\necho \"See the Custom Environment section of the README if you need to customize your environment.\"\n"
  },
  {
    "path": "features2d.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_features2d)\n\n#include \"features2d.h\"\n\nAKAZE AKAZE_Create() {\n    try {\n        return new cv::Ptr<cv::AKAZE>(cv::AKAZE::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\nAKAZE AKAZE_CreateWithParams(int descriptor_type, int descriptor_size, int descriptor_channels,\n                             float threshold, int nOctaves, int nOctaveLayers, int diffusivity) {\n    try {\n        cv::AKAZE::DescriptorType type = static_cast<cv::AKAZE::DescriptorType>(descriptor_type);\n\n        return new cv::Ptr<cv::AKAZE>(cv::AKAZE::create(type, descriptor_size, descriptor_channels,threshold, nOctaves, nOctaveLayers, static_cast<cv::KAZE::DiffusivityType>(diffusivity)));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\n\nvoid AKAZE_Close(AKAZE a) {\n    delete a;\n}\n\nstruct KeyPoints AKAZE_Detect(AKAZE a, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints AKAZE_Compute(AKAZE a, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*a)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints AKAZE_DetectAndCompute(AKAZE a, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detectAndCompute(*src, *mask, detected, *desc);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nAgastFeatureDetector AgastFeatureDetector_Create() {\n    try {\n        return new cv::Ptr<cv::AgastFeatureDetector>(cv::AgastFeatureDetector::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nAgastFeatureDetector AgastFeatureDetector_CreateWithParams(int threshold, bool nonmaxSuppression, int type) {\n    try {\n        cv::AgastFeatureDetector::DetectorType detectorType = static_cast<cv::AgastFeatureDetector::DetectorType>(type);\n        return new cv::Ptr<cv::AgastFeatureDetector>(cv::AgastFeatureDetector::create(threshold, nonmaxSuppression, detectorType));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid AgastFeatureDetector_Close(AgastFeatureDetector a) {\n    delete a;\n}\n\nstruct KeyPoints AgastFeatureDetector_Detect(AgastFeatureDetector a, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nBRISK BRISK_Create() {\n    try {\n        return new cv::Ptr<cv::BRISK>(cv::BRISK::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nBRISK BRISK_CreateWithParams(int thresh, int octaves, float patternScale) {\n    try {\n        return new cv::Ptr<cv::BRISK>(cv::BRISK::create(thresh, octaves, patternScale));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid BRISK_Close(BRISK b) {\n    delete b;\n}\n\nstruct KeyPoints BRISK_Detect(BRISK b, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*b)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints BRISK_Compute(BRISK b, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*b)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints BRISK_DetectAndCompute(BRISK b, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*b)->detectAndCompute(*src, *mask, detected, *desc);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;    \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nGFTTDetector GFTTDetector_Create() {\n    try {\n        return new cv::Ptr<cv::GFTTDetector>(cv::GFTTDetector::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nGFTTDetector GFTTDetector_Create_WithParams(const GFTTDetectorParams* params) {\n    try {\n        // Create the GFTTDetector and return it wrapped in a smart pointer\n        return new cv::Ptr<cv::GFTTDetector>(cv::GFTTDetector::create(params->maxCorners, params->qualityLevel, params->minDistance,\n            params->blockSize, params->useHarrisDetector, params->k));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\n\n\nvoid GFTTDetector_Close(GFTTDetector a) {\n    delete a;\n}\n\nstruct KeyPoints GFTTDetector_Detect(GFTTDetector a, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nKAZE KAZE_Create() {\n    try {\n        return new cv::Ptr<cv::KAZE>(cv::KAZE::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nKAZE KAZE_CreateWithParams(bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers, int diffusivity) {\n    try {\n        return new cv::Ptr<cv::KAZE>(cv::KAZE::create(extended, upright, threshold, nOctaves, nOctaveLayers, static_cast<cv::KAZE::DiffusivityType>(diffusivity)));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid KAZE_Close(KAZE a) {\n    delete a;\n}\n\nstruct KeyPoints KAZE_Detect(KAZE a, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints KAZE_Compute(KAZE a, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*a)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints KAZE_DetectAndCompute(KAZE a, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detectAndCompute(*src, *mask, detected, *desc);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nMSER MSER_Create() {\n    try {\n        return new cv::Ptr<cv::MSER>(cv::MSER::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nMSER MSER_CreateWithParams(int delta, int min_area, int max_area, double max_variation, double min_diversity,\n                 int max_evolution, double area_threshold, double min_margin, int edge_blur_size) {\n    try {\n        return new cv::Ptr<cv::MSER>(cv::MSER::create(delta, min_area, max_area, max_variation, min_diversity,\n            max_evolution, area_threshold, min_margin, edge_blur_size));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }                \n}\n\nvoid MSER_Close(MSER a) {\n    delete a;\n}\n\nstruct KeyPoints MSER_Detect(MSER a, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*a)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nFastFeatureDetector FastFeatureDetector_Create() {\n    try {\n        return new cv::Ptr<cv::FastFeatureDetector>(cv::FastFeatureDetector::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FastFeatureDetector_Close(FastFeatureDetector f) {\n    delete f;\n}\n\nFastFeatureDetector FastFeatureDetector_CreateWithParams(int threshold, bool nonmaxSuppression, int type) {\n    try {\n        return new cv::Ptr<cv::FastFeatureDetector>(cv::FastFeatureDetector::create(threshold,nonmaxSuppression,static_cast<cv::FastFeatureDetector::DetectorType>(type)));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nstruct KeyPoints FastFeatureDetector_Detect(FastFeatureDetector f, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*f)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nORB ORB_Create() {\n    try {\n        return new cv::Ptr<cv::ORB>(cv::ORB::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nORB ORB_CreateWithParams(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize, int fastThreshold) {\n    try {\n        return new cv::Ptr<cv::ORB>(cv::ORB::create(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K, static_cast<cv::ORB::ScoreType>(scoreType), patchSize, fastThreshold));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid ORB_Close(ORB o) {\n    delete o;\n}\n\nstruct KeyPoints ORB_Detect(ORB o, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*o)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints ORB_Compute(ORB o, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*o)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints ORB_DetectAndCompute(ORB o, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*o)->detectAndCompute(*src, *mask, detected, *desc);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\ncv::SimpleBlobDetector::Params ConvertCParamsToCPPParams(SimpleBlobDetectorParams params) {\n    cv::SimpleBlobDetector::Params converted;\n\n    converted.blobColor = params.blobColor;\n    converted.filterByArea = params.filterByArea;\n    converted.filterByCircularity = params.filterByCircularity;\n    converted.filterByColor = params.filterByColor;\n    converted.filterByConvexity = params.filterByConvexity;\n    converted.filterByInertia = params.filterByInertia;\n    converted.maxArea = params.maxArea;\n    converted.maxCircularity = params.maxCircularity;\n    converted.maxConvexity = params.maxConvexity;\n    converted.maxInertiaRatio = params.maxInertiaRatio;\n    converted.maxThreshold = params.maxThreshold;\n    converted.minArea = params.minArea;\n    converted.minCircularity = params.minCircularity;\n    converted.minConvexity = params.minConvexity;\n    converted.minDistBetweenBlobs = params.minDistBetweenBlobs;\n    converted.minInertiaRatio = params.minInertiaRatio;\n    converted.minRepeatability = params.minRepeatability;\n    converted.minThreshold = params.minThreshold;\n    converted.thresholdStep = params.thresholdStep;\n\n    return converted;\n}\n\nSimpleBlobDetectorParams ConvertCPPParamsToCParams(cv::SimpleBlobDetector::Params params) {\n    SimpleBlobDetectorParams converted;\n\n    converted.blobColor = params.blobColor;\n    converted.filterByArea = params.filterByArea;\n    converted.filterByCircularity = params.filterByCircularity;\n    converted.filterByColor = params.filterByColor;\n    converted.filterByConvexity = params.filterByConvexity;\n    converted.filterByInertia = params.filterByInertia;\n    converted.maxArea = params.maxArea;\n    converted.maxCircularity = params.maxCircularity;\n    converted.maxConvexity = params.maxConvexity;\n    converted.maxInertiaRatio = params.maxInertiaRatio;\n    converted.maxThreshold = params.maxThreshold;\n    converted.minArea = params.minArea;\n    converted.minCircularity = params.minCircularity;\n    converted.minConvexity = params.minConvexity;\n    converted.minDistBetweenBlobs = params.minDistBetweenBlobs;\n    converted.minInertiaRatio = params.minInertiaRatio;\n    converted.minRepeatability = params.minRepeatability;\n    converted.minThreshold = params.minThreshold;\n    converted.thresholdStep = params.thresholdStep;\n\n    return converted;\n}\n\nSimpleBlobDetector SimpleBlobDetector_Create_WithParams(SimpleBlobDetectorParams params){\n    try {\n        cv::SimpleBlobDetector::Params actualParams;\n        return new cv::Ptr<cv::SimpleBlobDetector>(cv::SimpleBlobDetector::create(ConvertCParamsToCPPParams(params)));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nSimpleBlobDetector SimpleBlobDetector_Create() {\n    try {\n        return new cv::Ptr<cv::SimpleBlobDetector>(cv::SimpleBlobDetector::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nSimpleBlobDetectorParams SimpleBlobDetectorParams_Create() {\n    try {\n        return ConvertCPPParamsToCParams(cv::SimpleBlobDetector::Params());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return SimpleBlobDetectorParams();\n    }\n}\n\nvoid SimpleBlobDetector_Close(SimpleBlobDetector b) {\n    delete b;\n}\n\nstruct KeyPoints SimpleBlobDetector_Detect(SimpleBlobDetector b, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*b)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nBFMatcher BFMatcher_Create() {\n    try {\n        return new cv::Ptr<cv::BFMatcher>(cv::BFMatcher::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nBFMatcher BFMatcher_CreateWithParams(int normType, bool crossCheck) {\n    try {\n        return new cv::Ptr<cv::BFMatcher>(cv::BFMatcher::create(normType, crossCheck));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid BFMatcher_Close(BFMatcher b) {\n    delete b;\n}\n\nstruct DMatches BFMatcher_Match(BFMatcher b, Mat query, Mat train) {\n    try {\n        std::vector<cv::DMatch> matches;\n        (*b)->match(*query, *train, matches);\n    \n        DMatch *dmatches = new DMatch[matches.size()];\n        for (size_t i = 0; i < matches.size(); ++i) {\n            DMatch dmatch = {matches[i].queryIdx, matches[i].trainIdx, matches[i].imgIdx, matches[i].distance};\n            dmatches[i] = dmatch;\n        }\n        DMatches ret = {dmatches, (int) matches.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        DMatch *dmatches = new DMatch[0];\n        DMatches ret = {dmatches, 0};\n        return ret;\n    }\n}\n\nstruct MultiDMatches BFMatcher_KnnMatch(BFMatcher b, Mat query, Mat train, int k) {\n    try {\n        std::vector< std::vector<cv::DMatch> > matches;\n        (*b)->knnMatch(*query, *train, matches, k);\n    \n        DMatches *dms = new DMatches[matches.size()];\n        for (size_t i = 0; i < matches.size(); ++i) {\n            DMatch *dmatches = new DMatch[matches[i].size()];\n            for (size_t j = 0; j < matches[i].size(); ++j) {\n                DMatch dmatch = {matches[i][j].queryIdx, matches[i][j].trainIdx, matches[i][j].imgIdx,\n                                 matches[i][j].distance};\n                dmatches[j] = dmatch;\n            }\n            dms[i] = {dmatches, (int) matches[i].size()};\n        }\n        MultiDMatches ret = {dms, (int) matches.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        DMatch *dmatches = new DMatch[0];\n        DMatches *dms = new DMatches[0];\n        MultiDMatches ret = {dms, 0};\n        return ret;\n    }\n}\n\nstruct MultiDMatches BFMatcher_KnnMatchWithParams(BFMatcher b, Mat query, Mat train, int k, Mat mask, bool compactResult) {\n    try {\n        std::vector< std::vector<cv::DMatch> > matches;\n        (*b)->knnMatch(*query, *train, matches, k, *mask, compactResult);\n    \n        DMatches *dms = new DMatches[matches.size()];\n        for (size_t i = 0; i < matches.size(); ++i) {\n            DMatch *dmatches = new DMatch[matches[i].size()];\n            for (size_t j = 0; j < matches[i].size(); ++j) {\n                DMatch dmatch = {matches[i][j].queryIdx, matches[i][j].trainIdx, matches[i][j].imgIdx,\n                                 matches[i][j].distance};\n                dmatches[j] = dmatch;\n            }\n            dms[i] = {dmatches, (int) matches[i].size()};\n        }\n        MultiDMatches ret = {dms, (int) matches.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        DMatch *dmatches = new DMatch[0];\n        DMatches *dms = new DMatches[0];\n        MultiDMatches ret = {dms, 0};\n        return ret;\n    }\n}\n\nFlannBasedMatcher FlannBasedMatcher_Create() {\n    try {\n        return new cv::Ptr<cv::FlannBasedMatcher>(cv::FlannBasedMatcher::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FlannBasedMatcher_Close(FlannBasedMatcher f) {\n    delete f;\n}\n\nstruct MultiDMatches FlannBasedMatcher_KnnMatch(FlannBasedMatcher f, Mat query, Mat train, int k) {\n    try {\n        std::vector< std::vector<cv::DMatch> > matches;\n        (*f)->knnMatch(*query, *train, matches, k);\n    \n        DMatches *dms = new DMatches[matches.size()];\n        for (size_t i = 0; i < matches.size(); ++i) {\n            DMatch *dmatches = new DMatch[matches[i].size()];\n            for (size_t j = 0; j < matches[i].size(); ++j) {\n                DMatch dmatch = {matches[i][j].queryIdx, matches[i][j].trainIdx, matches[i][j].imgIdx,\n                                 matches[i][j].distance};\n                dmatches[j] = dmatch;\n            }\n            dms[i] = {dmatches, (int) matches[i].size()};\n        }\n        MultiDMatches ret = {dms, (int) matches.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        DMatch *dmatches = new DMatch[0];\n        DMatches *dms = new DMatches[0];\n        MultiDMatches ret = {dms, 0};\n        return ret;\n    }\n}\n\nstruct MultiDMatches FlannBasedMatcher_KnnMatchWithParams(FlannBasedMatcher f, Mat query, Mat train, int k, Mat mask, bool compactResult) {\n    try {\n        std::vector< std::vector<cv::DMatch> > matches;\n        (*f)->knnMatch(*query, *train, matches, k, *mask, compactResult);\n    \n        DMatches *dms = new DMatches[matches.size()];\n        for (size_t i = 0; i < matches.size(); ++i) {\n            DMatch *dmatches = new DMatch[matches[i].size()];\n            for (size_t j = 0; j < matches[i].size(); ++j) {\n                DMatch dmatch = {matches[i][j].queryIdx, matches[i][j].trainIdx, matches[i][j].imgIdx,\n                                 matches[i][j].distance};\n                dmatches[j] = dmatch;\n            }\n            dms[i] = {dmatches, (int) matches[i].size()};\n        }\n        MultiDMatches ret = {dms, (int) matches.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        DMatch *dmatches = new DMatch[0];\n        DMatches *dms = new DMatches[0];\n        MultiDMatches ret = {dms, 0};\n        return ret;\n    }\n}\n\nvoid DrawKeyPoints(Mat src, struct KeyPoints kp, Mat dst, Scalar s, int flags) {\n    try {\n        std::vector<cv::KeyPoint> keypts;\n        cv::KeyPoint keypt;\n    \n        for (int i = 0; i < kp.length; ++i) {\n                keypt = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                                kp.keypoints[i].octave, kp.keypoints[i].classID);\n                keypts.push_back(keypt);\n        }\n    \n        cv::Scalar color = cv::Scalar(s.val1, s.val2, s.val3, s.val4);    \n        cv::drawKeypoints(*src, keypts, *dst, color, static_cast<cv::DrawMatchesFlags>(flags));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nSIFT SIFT_Create() {\n    try {\n        return new cv::Ptr<cv::SIFT>(cv::SIFT::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nSIFT SIFT_CreateWithParams(int nfeatures, int nOctaveLayers, double contrastThreshold, double edgeThreshold, double sigma) {\n    try {\n        return new cv::Ptr<cv::SIFT>(cv::SIFT::create(nfeatures, nOctaveLayers, contrastThreshold, edgeThreshold, sigma));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\n\nvoid SIFT_Close(SIFT d) {\n    delete d;\n}\n\nstruct KeyPoints SIFT_Detect(SIFT d, Mat src) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*d)->detect(*src, detected);\n    \n        KeyPoint* kps = new KeyPoint[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints SIFT_Compute(SIFT d, Mat src, struct KeyPoints kp, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> computed;\n        for (size_t i = 0; i < kp.length; i++) {\n            cv::KeyPoint k = cv::KeyPoint(kp.keypoints[i].x, kp.keypoints[i].y,\n                kp.keypoints[i].size, kp.keypoints[i].angle, kp.keypoints[i].response,\n                kp.keypoints[i].octave, kp.keypoints[i].classID);\n            computed.push_back(k);\n        }\n    \n        (*d)->compute(*src, computed, *desc);\n    \n        KeyPoint* kps = new KeyPoint[computed.size()];\n    \n        for (size_t i = 0; i < computed.size(); ++i) {\n            KeyPoint k = {computed[i].pt.x, computed[i].pt.y, computed[i].size, computed[i].angle,\n                          computed[i].response, computed[i].octave, computed[i].class_id\n                         };\n            kps[i] = k;\n        }\n    \n        KeyPoints ret = {kps, (int)computed.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nstruct KeyPoints SIFT_DetectAndCompute(SIFT d, Mat src, Mat mask, Mat desc) {\n    try {\n        std::vector<cv::KeyPoint> detected;\n        (*d)->detectAndCompute(*src, *mask, detected, *desc);\n\n        KeyPoint* kps = new KeyPoint[detected.size()];\n\n        for (size_t i = 0; i < detected.size(); ++i) {\n            KeyPoint k = {detected[i].pt.x, detected[i].pt.y, detected[i].size, detected[i].angle,\n                          detected[i].response, detected[i].octave, detected[i].class_id\n                         };\n            kps[i] = k;\n        }\n\n        KeyPoints ret = {kps, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        KeyPoint* kps = new KeyPoint[0];\n        KeyPoints ret = {kps, 0};\n        return ret;\n    }\n}\n\nvoid DrawMatches(Mat img1, struct KeyPoints kp1, Mat img2, struct KeyPoints kp2, struct DMatches matches1to2, Mat outImg, const Scalar matchesColor, const Scalar pointColor, struct ByteArray matchesMask, int flags) {\n    try {\n        std::vector<cv::KeyPoint> kp1vec, kp2vec;\n        cv::KeyPoint keypt;\n\n        for (int i = 0; i < kp1.length; ++i) {\n            keypt = cv::KeyPoint(kp1.keypoints[i].x, kp1.keypoints[i].y,\n                                kp1.keypoints[i].size, kp1.keypoints[i].angle, kp1.keypoints[i].response,\n                                kp1.keypoints[i].octave, kp1.keypoints[i].classID);\n            kp1vec.push_back(keypt);\n        }\n\n        for (int i = 0; i < kp2.length; ++i) {\n            keypt = cv::KeyPoint(kp2.keypoints[i].x, kp2.keypoints[i].y,\n                                kp2.keypoints[i].size, kp2.keypoints[i].angle, kp2.keypoints[i].response,\n                                kp2.keypoints[i].octave, kp2.keypoints[i].classID);\n            kp2vec.push_back(keypt);\n        }\n\n        cv::Scalar cvmatchescolor = cv::Scalar(matchesColor.val1, matchesColor.val2, matchesColor.val3, matchesColor.val4);\n        cv::Scalar cvpointcolor = cv::Scalar(pointColor.val1, pointColor.val2, pointColor.val3, pointColor.val4);\n\n        std::vector<cv::DMatch> dmatchvec;\n        cv::DMatch dm;\n\n        for (int i = 0; i < matches1to2.length; i++) {\n            dm = cv::DMatch(matches1to2.dmatches[i].queryIdx, matches1to2.dmatches[i].trainIdx,\n                            matches1to2.dmatches[i].imgIdx, matches1to2.dmatches[i].distance);\n            dmatchvec.push_back(dm);\n        }\n\n        std::vector<char> maskvec;\n\n        for (int i = 0; i < matchesMask.length; i++) {\n            maskvec.push_back(matchesMask.data[i]);\n        }\n\n        cv::drawMatches(*img1, kp1vec, *img2, kp2vec, dmatchvec, *outImg, cvmatchescolor, cvpointcolor, maskvec, static_cast<cv::DrawMatchesFlags>(flags));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "features2d.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_features2d)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"features2d.h\"\n*/\nimport \"C\"\nimport (\n\t\"image/color\"\n\t\"io\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\ntype Feature2DDetector interface {\n\tDetect(src Mat) []KeyPoint\n}\n\ntype Feature2DComputer interface {\n\tCompute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat)\n}\n\ntype Feature2DDetectComputer interface {\n\tDetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat)\n}\n\ntype Feature2D interface {\n\tio.Closer\n\tFeature2DDetector\n\tFeature2DComputer\n\tFeature2DDetectComputer\n}\n\n// AKAZE is a wrapper around the cv::AKAZE algorithm.\ntype AKAZE struct {\n\t// C.AKAZE\n\tp unsafe.Pointer\n}\n\nvar _ Feature2D = (*AKAZE)(nil)\n\n// NewAKAZE returns a new AKAZE algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d8/d30/classcv_1_1AKAZE.html\nfunc NewAKAZE() AKAZE {\n\treturn AKAZE{p: unsafe.Pointer(C.AKAZE_Create())}\n}\n\n// NewAKAZEWithParams creates a new AKAZE detector with custom parameters.\nfunc NewAKAZEWithParams(descriptorType, descriptorSize, descriptorChannels int, threshold float32, nOctaves, nOctaveLayers, diffusivity int) AKAZE {\n\tptr := C.AKAZE_CreateWithParams(\n\t\tC.int(descriptorType), C.int(descriptorSize), C.int(descriptorChannels),\n\t\tC.float(threshold), C.int(nOctaves), C.int(nOctaveLayers), C.int(diffusivity))\n\treturn AKAZE{p: unsafe.Pointer(ptr)}\n}\n\n// Close AKAZE.\nfunc (a *AKAZE) Close() error {\n\tC.AKAZE_Close((C.AKAZE)(a.p))\n\ta.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using AKAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (a *AKAZE) Detect(src Mat) []KeyPoint {\n\tret := C.AKAZE_Detect((C.AKAZE)(a.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using AKAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (a *AKAZE) Compute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\n\tret := C.AKAZE_Compute((C.AKAZE)(a.p), src.p, cKeyPoints, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute keypoints and compute in an image using AKAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (a *AKAZE) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tret := C.AKAZE_DetectAndCompute((C.AKAZE)(a.p), src.p, mask.p, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// AgastFeatureDetector is a wrapper around the cv::AgastFeatureDetector.\ntype AgastFeatureDetector struct {\n\t// C.AgastFeatureDetector\n\tp unsafe.Pointer\n}\n\n// NewAgastFeatureDetector returns a new AgastFeatureDetector algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d19/classcv_1_1AgastFeatureDetector.html\nfunc NewAgastFeatureDetector() AgastFeatureDetector {\n\treturn AgastFeatureDetector{p: unsafe.Pointer(C.AgastFeatureDetector_Create())}\n}\n\n// NewAgastFeatureDetectorWithParams creates a new AGAST feature detector with custom parameters.\nfunc NewAgastFeatureDetectorWithParams(threshold int, nonmaxSuppression bool, detectorType int) AgastFeatureDetector {\n\treturn AgastFeatureDetector{\n\t\tp: unsafe.Pointer(C.AgastFeatureDetector_CreateWithParams(\n\t\t\tC.int(threshold), C.bool(nonmaxSuppression), C.int(detectorType),\n\t\t)),\n\t}\n}\n\n// Close AgastFeatureDetector.\nfunc (a *AgastFeatureDetector) Close() error {\n\tC.AgastFeatureDetector_Close((C.AgastFeatureDetector)(a.p))\n\ta.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using AgastFeatureDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (a *AgastFeatureDetector) Detect(src Mat) []KeyPoint {\n\tret := C.AgastFeatureDetector_Detect((C.AgastFeatureDetector)(a.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// BRISK is a wrapper around the cv::BRISK algorithm.\ntype BRISK struct {\n\t// C.BRISK\n\tp unsafe.Pointer\n}\n\nvar _ Feature2D = (*BRISK)(nil)\n\n// NewBRISK returns a new BRISK algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/dbf/classcv_1_1BRISK.html\nfunc NewBRISK() BRISK {\n\treturn BRISK{p: unsafe.Pointer(C.BRISK_Create())}\n}\n\n// NewBRISKWithParams returns a new BRISK algorithm with parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/dbf/classcv_1_1BRISK.html\nfunc NewBRISKWithParams(thresh int, octaves int, patternScale float32) BRISK {\n\treturn BRISK{p: unsafe.Pointer(C.BRISK_CreateWithParams(C.int(thresh), C.int(octaves), C.float(patternScale)))}\n}\n\n// Close BRISK.\nfunc (b *BRISK) Close() error {\n\tC.BRISK_Close((C.BRISK)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using BRISK.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (b *BRISK) Detect(src Mat) []KeyPoint {\n\tret := C.BRISK_Detect((C.BRISK)(b.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using BRISK.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (b *BRISK) Compute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\n\tret := C.BRISK_Compute((C.BRISK)(b.p), src.p, cKeyPoints, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute keypoints and compute in an image using BRISK.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (b *BRISK) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tret := C.BRISK_DetectAndCompute((C.BRISK)(b.p), src.p, mask.p, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// FastFeatureDetectorType defines the detector type\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d74/classcv_1_1FastFeatureDetector.html#a4654f6fb0aa4b8e9123b223bfa0e2a08\ntype FastFeatureDetectorType int\n\nconst (\n\t//FastFeatureDetectorType58 is an alias of FastFeatureDetector::TYPE_5_8\n\tFastFeatureDetectorType58 FastFeatureDetectorType = 0\n\t//FastFeatureDetectorType712 is an alias of FastFeatureDetector::TYPE_7_12\n\tFastFeatureDetectorType712 FastFeatureDetectorType = 1\n\t//FastFeatureDetectorType916 is an alias of FastFeatureDetector::TYPE_9_16\n\tFastFeatureDetectorType916 FastFeatureDetectorType = 2\n)\n\n// FastFeatureDetector is a wrapper around the cv::FastFeatureDetector.\ntype FastFeatureDetector struct {\n\t// C.FastFeatureDetector\n\tp unsafe.Pointer\n}\n\n// NewFastFeatureDetector returns a new FastFeatureDetector algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d74/classcv_1_1FastFeatureDetector.html\nfunc NewFastFeatureDetector() FastFeatureDetector {\n\treturn FastFeatureDetector{p: unsafe.Pointer(C.FastFeatureDetector_Create())}\n}\n\n// NewFastFeatureDetectorWithParams returns a new FastFeatureDetector algorithm with parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d74/classcv_1_1FastFeatureDetector.html#ab986f2ff8f8778aab1707e2642bc7f8e\nfunc NewFastFeatureDetectorWithParams(threshold int, nonmaxSuppression bool, typ FastFeatureDetectorType) FastFeatureDetector {\n\treturn FastFeatureDetector{p: unsafe.Pointer(C.FastFeatureDetector_CreateWithParams(C.int(threshold), C.bool(nonmaxSuppression), C.int(typ)))}\n}\n\n// Close FastFeatureDetector.\nfunc (f *FastFeatureDetector) Close() error {\n\tC.FastFeatureDetector_Close((C.FastFeatureDetector)(f.p))\n\tf.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using FastFeatureDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (f *FastFeatureDetector) Detect(src Mat) []KeyPoint {\n\tret := C.FastFeatureDetector_Detect((C.FastFeatureDetector)(f.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// GFTTDetector is a wrapper around the cv::GFTTDetector algorithm.\ntype GFTTDetector struct {\n\t// C.GFTTDetector\n\tp unsafe.Pointer\n}\n\n// GFTTDetectorParams holds parameters to create a GFTTDetector\ntype GFTTDetectorParams struct {\n\tMaxCorners        int\n\tQualityLevel      float64\n\tMinDistance       float64\n\tBlockSize         int\n\tUseHarrisDetector bool\n\tK                 float64\n}\n\n// NewGFTTDetector returns a new GFTTDetector algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d21/classcv_1_1GFTTDetector.html\nfunc NewGFTTDetector() GFTTDetector {\n\treturn GFTTDetector{p: unsafe.Pointer(C.GFTTDetector_Create())}\n}\n\n// NewGFTTDetectorWithParams returns a new GFTTDetector algorithm with custom parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/d21/classcv_1_1GFTTDetector.html\nfunc NewGFTTDetectorWithParams(params GFTTDetectorParams) GFTTDetector {\n\tcParams := C.GFTTDetectorParams{\n\t\tmaxCorners:        C.int(params.MaxCorners),\n\t\tqualityLevel:      C.double(params.QualityLevel),\n\t\tminDistance:       C.double(params.MinDistance),\n\t\tblockSize:         C.int(params.BlockSize),\n\t\tuseHarrisDetector: C.bool(params.UseHarrisDetector),\n\t\tk:                 C.double(params.K),\n\t}\n\treturn GFTTDetector{p: unsafe.Pointer(C.GFTTDetector_Create_WithParams(&cParams))}\n}\n\n// Close GFTTDetector.\nfunc (a *GFTTDetector) Close() error {\n\tC.GFTTDetector_Close((C.GFTTDetector)(a.p))\n\ta.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using GFTTDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (a *GFTTDetector) Detect(src Mat) []KeyPoint {\n\tret := C.GFTTDetector_Detect((C.GFTTDetector)(a.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// KAZE is a wrapper around the cv::KAZE algorithm.\ntype KAZE struct {\n\t// C.KAZE\n\tp unsafe.Pointer\n}\n\nvar _ Feature2D = (*KAZE)(nil)\n\n// NewKAZE returns a new KAZE algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d61/classcv_1_1KAZE.html\nfunc NewKAZE() KAZE {\n\treturn KAZE{p: unsafe.Pointer(C.KAZE_Create())}\n}\n\n// NewKazeWithParams returns a new KAZE algorithm with the specified parameters.\nfunc NewKazeWithParams(extended bool, upright bool, threshold float32, nOctaves int, nOctaveLayers int, diffusivity int) KAZE {\n\tcExtended := C.bool(extended)\n\tcUpright := C.bool(upright)\n\tcThreshold := C.float(threshold)\n\tcNOctaves := C.int(nOctaves)\n\tcNOctaveLayers := C.int(nOctaveLayers)\n\tcDiffusivity := C.int(diffusivity)\n\n\treturn KAZE{p: unsafe.Pointer(C.KAZE_CreateWithParams(cExtended, cUpright, cThreshold, cNOctaves, cNOctaveLayers, cDiffusivity))}\n}\n\n// Close KAZE.\nfunc (a *KAZE) Close() error {\n\tC.KAZE_Close((C.KAZE)(a.p))\n\ta.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using KAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (a *KAZE) Detect(src Mat) []KeyPoint {\n\tret := C.KAZE_Detect((C.KAZE)(a.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using KAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (a *KAZE) Compute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\n\tret := C.KAZE_Compute((C.KAZE)(a.p), src.p, cKeyPoints, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute keypoints and compute in an image using KAZE.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (a *KAZE) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tret := C.KAZE_DetectAndCompute((C.KAZE)(a.p), src.p, mask.p, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// MSER is a wrapper around the cv::MSER algorithm.\ntype MSER struct {\n\t// C.MSER\n\tp unsafe.Pointer\n}\n\n// NewMSER returns a new MSER algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d28/classcv_1_1MSER.html\nfunc NewMSER() MSER {\n\treturn MSER{p: unsafe.Pointer(C.MSER_Create())}\n}\n\n// NewMSERWithParams returns a new MSER algorithm with the specified parameters.\nfunc NewMSERWithParams(delta int, minArea int, maxArea int, maxVariation float64, minDiversity float64,\n\tmaxEvolution int, areaThreshold float64, minMargin float64, edgeBlurSize int) MSER {\n\n\tcDelta := C.int(delta)\n\tcMinArea := C.int(minArea)\n\tcMaxArea := C.int(maxArea)\n\tcMaxVariation := C.double(maxVariation)\n\tcMinDiversity := C.double(minDiversity)\n\tcMaxEvolution := C.int(maxEvolution)\n\tcAreaThreshold := C.double(areaThreshold)\n\tcMinMargin := C.double(minMargin)\n\tcEdgeBlurSize := C.int(edgeBlurSize)\n\n\treturn MSER{p: unsafe.Pointer(C.MSER_CreateWithParams(cDelta, cMinArea, cMaxArea, cMaxVariation, cMinDiversity,\n\t\tcMaxEvolution, cAreaThreshold, cMinMargin, cEdgeBlurSize))}\n}\n\n// Close MSER.\nfunc (a *MSER) Close() error {\n\tC.MSER_Close((C.MSER)(a.p))\n\ta.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using MSER.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (a *MSER) Detect(src Mat) []KeyPoint {\n\tret := C.MSER_Detect((C.MSER)(a.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// ORB is a wrapper around the cv::ORB.\ntype ORB struct {\n\t// C.ORB\n\tp unsafe.Pointer\n}\n\nvar _ Feature2D = (*ORB)(nil)\n\n// NewORB returns a new ORB algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d95/classcv_1_1ORB.html\nfunc NewORB() ORB {\n\treturn ORB{p: unsafe.Pointer(C.ORB_Create())}\n}\n\n// NewORBWithParams returns a new ORB algorithm with parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d95/classcv_1_1ORB.html#aeff0cbe668659b7ca14bb85ff1c4073b\nfunc NewORBWithParams(nFeatures int, scaleFactor float32, nLevels int, edgeThreshold int, firstLevel int, WTAK int, scoreType ORBScoreType, patchSize int, fastThreshold int) ORB {\n\treturn ORB{p: unsafe.Pointer(C.ORB_CreateWithParams(\n\t\tC.int(nFeatures),\n\t\tC.float(scaleFactor),\n\t\tC.int(nLevels),\n\t\tC.int(edgeThreshold),\n\t\tC.int(firstLevel),\n\t\tC.int(WTAK),\n\t\tC.int(scoreType),\n\t\tC.int(patchSize),\n\t\tC.int(fastThreshold),\n\t))}\n}\n\ntype ORBScoreType int\n\nconst (\n\tORBScoreTypeHarris ORBScoreType = 0\n\tORBScoreTypeFAST   ORBScoreType = 1\n)\n\n// Close ORB.\nfunc (o *ORB) Close() error {\n\tC.ORB_Close((C.ORB)(o.p))\n\to.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using ORB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (o *ORB) Detect(src Mat) []KeyPoint {\n\tret := C.ORB_Detect((C.ORB)(o.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using ORB.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (o *ORB) Compute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\n\tret := C.ORB_Compute((C.ORB)(o.p), src.p, cKeyPoints, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute detects keypoints and computes from an image using ORB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (o *ORB) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tret := C.ORB_DetectAndCompute((C.ORB)(o.p), src.p, mask.p, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// SimpleBlobDetector is a wrapper around the cv::SimpleBlobDetector.\ntype SimpleBlobDetector struct {\n\t// C.SimpleBlobDetector\n\tp unsafe.Pointer\n}\n\n// SimpleBlobDetector_Params is a wrapper around the cv::SimpleBlobdetector::Params\ntype SimpleBlobDetectorParams struct {\n\tp C.SimpleBlobDetectorParams\n}\n\n// NewSimpleBlobDetector returns a new SimpleBlobDetector algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d7a/classcv_1_1SimpleBlobDetector.html\nfunc NewSimpleBlobDetector() SimpleBlobDetector {\n\treturn SimpleBlobDetector{p: unsafe.Pointer(C.SimpleBlobDetector_Create())}\n}\n\n// NewSimpleBlobDetectorWithParams returns a new SimpleBlobDetector with custom parameters\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d7a/classcv_1_1SimpleBlobDetector.html\nfunc NewSimpleBlobDetectorWithParams(params SimpleBlobDetectorParams) SimpleBlobDetector {\n\treturn SimpleBlobDetector{p: unsafe.Pointer(C.SimpleBlobDetector_Create_WithParams(params.p))}\n}\n\n// Close SimpleBlobDetector.\nfunc (b *SimpleBlobDetector) Close() error {\n\tC.SimpleBlobDetector_Close((C.SimpleBlobDetector)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// NewSimpleBlobDetectorParams returns the default parameters for the SimpleBobDetector\nfunc NewSimpleBlobDetectorParams() SimpleBlobDetectorParams {\n\treturn SimpleBlobDetectorParams{p: C.SimpleBlobDetectorParams_Create()}\n}\n\n// SetBlobColor sets the blobColor field\nfunc (p *SimpleBlobDetectorParams) SetBlobColor(blobColor int) {\n\tp.p.blobColor = C.uchar(blobColor)\n}\n\n// GetBlobColor gets the blobColor field\nfunc (p *SimpleBlobDetectorParams) GetBlobColor() int {\n\treturn int(p.p.blobColor)\n}\n\n// SetFilterByArea sets the filterByArea field\nfunc (p *SimpleBlobDetectorParams) SetFilterByArea(filterByArea bool) {\n\tp.p.filterByArea = C.bool(filterByArea)\n}\n\n// GetFilterByArea gets the filterByArea field\nfunc (p *SimpleBlobDetectorParams) GetFilterByArea() bool {\n\treturn bool(p.p.filterByArea)\n}\n\n// SetFilterByCircularity sets the filterByCircularity field\nfunc (p *SimpleBlobDetectorParams) SetFilterByCircularity(filterByCircularity bool) {\n\tp.p.filterByCircularity = C.bool(filterByCircularity)\n}\n\n// GetFilterByCircularity gets the filterByCircularity field\nfunc (p *SimpleBlobDetectorParams) GetFilterByCircularity() bool {\n\treturn bool(p.p.filterByCircularity)\n}\n\n// SetFilterByColor sets the filterByColor field\nfunc (p *SimpleBlobDetectorParams) SetFilterByColor(filterByColor bool) {\n\tp.p.filterByColor = C.bool(filterByColor)\n}\n\n// GetFilterByColor gets the filterByColor field\nfunc (p *SimpleBlobDetectorParams) GetFilterByColor() bool {\n\treturn bool(p.p.filterByColor)\n}\n\n// SetFilterByConvexity sets the filterByConvexity field\nfunc (p *SimpleBlobDetectorParams) SetFilterByConvexity(filterByConvexity bool) {\n\tp.p.filterByConvexity = C.bool(filterByConvexity)\n}\n\n// GetFilterByConvexity gets the filterByConvexity field\nfunc (p *SimpleBlobDetectorParams) GetFilterByConvexity() bool {\n\treturn bool(p.p.filterByConvexity)\n}\n\n// SetFilterByInertia sets the filterByInertia field\nfunc (p *SimpleBlobDetectorParams) SetFilterByInertia(filterByInertia bool) {\n\tp.p.filterByInertia = C.bool(filterByInertia)\n}\n\n// GetFilterByInertia gets the filterByInertia field\nfunc (p *SimpleBlobDetectorParams) GetFilterByInertia() bool {\n\treturn bool(p.p.filterByInertia)\n}\n\n// SetMaxArea sets the maxArea parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMaxArea(maxArea float64) {\n\tp.p.maxArea = C.float(maxArea)\n}\n\n// GetMaxArea sets the maxArea parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMaxArea() float64 {\n\treturn float64(p.p.maxArea)\n}\n\n// SetMaxCircularity sets the maxCircularity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMaxCircularity(maxCircularity float64) {\n\tp.p.maxCircularity = C.float(maxCircularity)\n}\n\n// GetMaxCircularity sets the maxCircularity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMaxCircularity() float64 {\n\treturn float64(p.p.maxCircularity)\n}\n\n// SetMaxConvexity sets the maxConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMaxConvexity(maxConvexity float64) {\n\tp.p.maxConvexity = C.float(maxConvexity)\n}\n\n// GetMaxConvexity sets the maxConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMaxConvexity() float64 {\n\treturn float64(p.p.maxConvexity)\n}\n\n// SetMaxInertiaRatio sets the maxInertiaRatio parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMaxInertiaRatio(maxInertiaRatio float64) {\n\tp.p.maxInertiaRatio = C.float(maxInertiaRatio)\n}\n\n// GetMaxInertiaRatio sets the maxCConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMaxInertiaRatio() float64 {\n\treturn float64(p.p.maxInertiaRatio)\n}\n\n// SetMaxThreshold sets the maxThreshold parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMaxThreshold(maxThreshold float64) {\n\tp.p.maxThreshold = C.float(maxThreshold)\n}\n\n// GetMaxThreshold sets the maxCConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMaxThreshold() float64 {\n\treturn float64(p.p.maxThreshold)\n}\n\n// SetMinArea sets the minArea parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinArea(minArea float64) {\n\tp.p.minArea = C.float(minArea)\n}\n\n// GetMinArea sets theinArea parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinArea() float64 {\n\treturn float64(p.p.minArea)\n}\n\n// SetMinCircularity sets the minCircularity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinCircularity(minCircularity float64) {\n\tp.p.minCircularity = C.float(minCircularity)\n}\n\n// GetMinCircularity sets the minCircularity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinCircularity() float64 {\n\treturn float64(p.p.minCircularity)\n}\n\n// SetMinConvexity sets the minConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinConvexity(minConvexity float64) {\n\tp.p.minConvexity = C.float(minConvexity)\n}\n\n// GetMinConvexity sets the minConvexity parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinConvexity() float64 {\n\treturn float64(p.p.minConvexity)\n}\n\n// SetMinDistBetweenBlobs sets the minDistBetweenBlobs parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinDistBetweenBlobs(minDistBetweenBlobs float64) {\n\tp.p.minDistBetweenBlobs = C.float(minDistBetweenBlobs)\n}\n\n// GetMinDistBetweenBlobs sets the minDistBetweenBlobs parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinDistBetweenBlobs() float64 {\n\treturn float64(p.p.minDistBetweenBlobs)\n}\n\n// SetMinInertiaRatio sets the minInertiaRatio parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinInertiaRatio(minInertiaRatio float64) {\n\tp.p.minInertiaRatio = C.float(minInertiaRatio)\n}\n\n// GetMinInertiaRatio sets the minInertiaRatio parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinInertiaRatio() float64 {\n\treturn float64(p.p.minInertiaRatio)\n}\n\n// SetMinRepeatability sets the minRepeatability parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinRepeatability(minRepeatability int) {\n\tp.p.minRepeatability = C.size_t(minRepeatability)\n}\n\n// GetMinInertiaRatio sets the minRepeatability parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinRepeatability() int {\n\treturn int(p.p.minRepeatability)\n}\n\n// SetMinThreshold sets the minThreshold parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetMinThreshold(minThreshold float64) {\n\tp.p.minThreshold = C.float(minThreshold)\n}\n\n// GetMinThreshold sets the minInertiaRatio parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetMinThreshold() float64 {\n\treturn float64(p.p.minThreshold)\n}\n\n// SetMinThreshold sets the minThreshold parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) SetThresholdStep(thresholdStep float64) {\n\tp.p.thresholdStep = C.float(thresholdStep)\n}\n\n// GetMinThreshold sets the minInertiaRatio parameter for SimpleBlobDetector_Params\nfunc (p *SimpleBlobDetectorParams) GetThresholdStep() float64 {\n\treturn float64(p.p.thresholdStep)\n}\n\n// Detect keypoints in an image using SimpleBlobDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (b *SimpleBlobDetector) Detect(src Mat) []KeyPoint {\n\tret := C.SimpleBlobDetector_Detect((C.SimpleBlobDetector)(b.p), src.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// getKeyPoints returns a slice of KeyPoint given a pointer to a C.KeyPoints\nfunc getKeyPoints(ret C.KeyPoints) []KeyPoint {\n\tcArray := ret.keypoints\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.KeyPoint)(unsafe.Pointer(&hdr))\n\n\tkeys := make([]KeyPoint, length)\n\tfor i, r := range s {\n\t\tkeys[i] = KeyPoint{float64(r.x), float64(r.y), float64(r.size), float64(r.angle), float64(r.response),\n\t\t\tint(r.octave), int(r.classID)}\n\t}\n\treturn keys\n}\n\n// BFMatcher is a wrapper around the the cv::BFMatcher algorithm\ntype BFMatcher struct {\n\t// C.BFMatcher\n\tp unsafe.Pointer\n}\n\n// NewBFMatcher returns a new BFMatcher\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd\nfunc NewBFMatcher() BFMatcher {\n\treturn BFMatcher{p: unsafe.Pointer(C.BFMatcher_Create())}\n}\n\n// NewBFMatcherWithParams creates a new BFMatchers but allows setting parameters\n// to values other than just the defaults.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/da1/classcv_1_1BFMatcher.html#abe0bb11749b30d97f60d6ade665617bd\nfunc NewBFMatcherWithParams(normType NormType, crossCheck bool) BFMatcher {\n\treturn BFMatcher{p: unsafe.Pointer(C.BFMatcher_CreateWithParams(C.int(normType), C.bool(crossCheck)))}\n}\n\n// Close BFMatcher\nfunc (b *BFMatcher) Close() error {\n\tC.BFMatcher_Close((C.BFMatcher)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Match Finds the best match for each descriptor from a query set.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/db/d39/classcv_1_1DescriptorMatcher.html#a0f046f47b68ec7074391e1e85c750cba\nfunc (b *BFMatcher) Match(query, train Mat) []DMatch {\n\tret := C.BFMatcher_Match((C.BFMatcher)(b.p), query.p, train.p)\n\tdefer C.DMatches_Close(ret)\n\n\treturn getDMatches(ret)\n}\n\n// KnnMatch Finds the k best matches for each descriptor from a query set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a\nfunc (b *BFMatcher) KnnMatch(query, train Mat, k int) [][]DMatch {\n\tret := C.BFMatcher_KnnMatch((C.BFMatcher)(b.p), query.p, train.p, C.int(k))\n\tdefer C.MultiDMatches_Close(ret)\n\n\treturn getMultiDMatches(ret)\n}\n\n// FlannBasedMatcher is a wrapper around the the cv::FlannBasedMatcher algorithm\ntype FlannBasedMatcher struct {\n\t// C.FlannBasedMatcher\n\tp unsafe.Pointer\n}\n\n// NewFlannBasedMatcher returns a new FlannBasedMatcher\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/de2/classcv_1_1FlannBasedMatcher.html#ab9114a6471e364ad221f89068ca21382\nfunc NewFlannBasedMatcher() FlannBasedMatcher {\n\treturn FlannBasedMatcher{p: unsafe.Pointer(C.FlannBasedMatcher_Create())}\n}\n\n// Close FlannBasedMatcher\nfunc (f *FlannBasedMatcher) Close() error {\n\tC.FlannBasedMatcher_Close((C.FlannBasedMatcher)(f.p))\n\tf.p = nil\n\treturn nil\n}\n\n// KnnMatch Finds the k best matches for each descriptor from a query set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/db/d39/classcv_1_1DescriptorMatcher.html#aa880f9353cdf185ccf3013e08210483a\nfunc (f *FlannBasedMatcher) KnnMatch(query, train Mat, k int) [][]DMatch {\n\tret := C.FlannBasedMatcher_KnnMatch((C.FlannBasedMatcher)(f.p), query.p, train.p, C.int(k))\n\tdefer C.MultiDMatches_Close(ret)\n\n\treturn getMultiDMatches(ret)\n}\n\nfunc getMultiDMatches(ret C.MultiDMatches) [][]DMatch {\n\tcArray := ret.dmatches\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.DMatches)(unsafe.Pointer(&hdr))\n\n\tkeys := make([][]DMatch, length)\n\tfor i := range s {\n\t\tkeys[i] = getDMatches(C.MultiDMatches_get(ret, C.int(i)))\n\t}\n\treturn keys\n}\n\nfunc getDMatches(ret C.DMatches) []DMatch {\n\tcArray := ret.dmatches\n\tlength := int(ret.length)\n\thdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(cArray)),\n\t\tLen:  length,\n\t\tCap:  length,\n\t}\n\ts := *(*[]C.DMatch)(unsafe.Pointer(&hdr))\n\n\tkeys := make([]DMatch, length)\n\tfor i, r := range s {\n\t\tkeys[i] = DMatch{int(r.queryIdx), int(r.trainIdx), int(r.imgIdx),\n\t\t\tfloat64(r.distance)}\n\t}\n\treturn keys\n}\n\n// DrawMatchesFlag are the flags setting drawing feature\n//\n// For further details please see:\n// https://docs.opencv.org/master/de/d30/structcv_1_1DrawMatchesFlags.html\ntype DrawMatchesFlag int\n\nconst (\n\t// DrawDefault creates new image and for each keypoint only the center point will be drawn\n\tDrawDefault DrawMatchesFlag = 0\n\t// DrawOverOutImg draws matches on existing content of image\n\tDrawOverOutImg DrawMatchesFlag = 1\n\t// NotDrawSinglePoints will not draw single points\n\tNotDrawSinglePoints DrawMatchesFlag = 2\n\t// DrawRichKeyPoints draws the circle around each keypoint with keypoint size and orientation\n\tDrawRichKeyPoints DrawMatchesFlag = 3\n)\n\n// DrawKeyPoints draws keypoints\n//\n// For further details please see:\n// https://docs.opencv.org/master/d4/d5d/group__features2d__draw.html#gab958f8900dd10f14316521c149a60433\nfunc DrawKeyPoints(src Mat, keyPoints []KeyPoint, dst *Mat, color color.RGBA, flag DrawMatchesFlag) {\n\tcKeyPointArray := make([]C.struct_KeyPoint, len(keyPoints))\n\n\tfor i, kp := range keyPoints {\n\t\tcKeyPointArray[i].x = C.double(kp.X)\n\t\tcKeyPointArray[i].y = C.double(kp.Y)\n\t\tcKeyPointArray[i].size = C.double(kp.Size)\n\t\tcKeyPointArray[i].angle = C.double(kp.Angle)\n\t\tcKeyPointArray[i].response = C.double(kp.Response)\n\t\tcKeyPointArray[i].octave = C.int(kp.Octave)\n\t\tcKeyPointArray[i].classID = C.int(kp.ClassID)\n\t}\n\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&cKeyPointArray[0]),\n\t\tlength:    (C.int)(len(keyPoints)),\n\t}\n\n\tscalar := C.struct_Scalar{\n\t\tval1: C.double(color.B),\n\t\tval2: C.double(color.G),\n\t\tval3: C.double(color.R),\n\t\tval4: C.double(color.A),\n\t}\n\n\tC.DrawKeyPoints(src.p, cKeyPoints, dst.p, scalar, C.int(flag))\n}\n\n// SIFT is a wrapper around the cv::SIFT algorithm.\n// Due to the patent having expired, this is now in the main OpenCV code modules.\ntype SIFT struct {\n\t// C.SIFT\n\tp unsafe.Pointer\n}\n\nvar _ Feature2D = (*SIFT)(nil)\n\n// NewSIFT returns a new SIFT algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html\nfunc NewSIFT() SIFT {\n\treturn SIFT{p: unsafe.Pointer(C.SIFT_Create())}\n}\n\nfunc NewSIFTWithParams(nfeatures *int, nOctaveLayers *int, contrastThreshold *float64, edgeThreshold *float64, sigma *float64) SIFT {\n\tnumFeatures := 0\n\tif nfeatures != nil {\n\t\tnumFeatures = *nfeatures\n\t}\n\n\tnumOctaveLayers := 3\n\n\tif nOctaveLayers != nil {\n\t\tnumOctaveLayers = *nOctaveLayers\n\t}\n\n\tvar numContrastThreshold float64 = 0.04\n\n\tif contrastThreshold != nil {\n\t\tnumContrastThreshold = *contrastThreshold\n\t}\n\n\tvar numEdgeThreshold float64 = 10\n\n\tif edgeThreshold != nil {\n\t\tnumEdgeThreshold = *edgeThreshold\n\t}\n\n\tvar numSigma float64 = 1.6\n\n\tif sigma != nil {\n\t\tnumSigma = *sigma\n\t}\n\n\treturn SIFT{p: unsafe.Pointer(C.SIFT_CreateWithParams(C.int(numFeatures), C.int(numOctaveLayers), C.double(numContrastThreshold), C.double(numEdgeThreshold), C.double(numSigma)))}\n}\n\n// Close SIFT.\nfunc (d *SIFT) Close() error {\n\tC.SIFT_Close((C.SIFT)(d.p))\n\td.p = nil\n\treturn nil\n}\n\n// Detect keypoints in an image using SIFT.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#aa4e9a7082ec61ebc108806704fbd7887\nfunc (d *SIFT) Detect(src Mat) []KeyPoint {\n\tret := C.SIFT_Detect((C.SIFT)(d.p), C.Mat(src.Ptr()))\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret)\n}\n\n// Compute keypoints in an image using SIFT.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d0/d13/classcv_1_1Feature2D.html#ab3cce8d56f4fc5e1d530b5931e1e8dc0\nfunc (d *SIFT) Compute(src Mat, mask Mat, kps []KeyPoint) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tkp2arr := make([]C.struct_KeyPoint, len(kps))\n\tfor i, kp := range kps {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\tcKeyPoints := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kps)),\n\t}\n\n\tret := C.SIFT_Compute((C.SIFT)(d.p), src.p, cKeyPoints, desc.p)\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DetectAndCompute detects and computes keypoints in an image using SIFT.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d13/classcv_1_1Feature2D.html#a8be0d1c20b08eb867184b8d74c15a677\nfunc (d *SIFT) DetectAndCompute(src Mat, mask Mat) ([]KeyPoint, Mat) {\n\tdesc := NewMat()\n\tret := C.SIFT_DetectAndCompute((C.SIFT)(d.p), C.Mat(src.Ptr()), C.Mat(mask.Ptr()),\n\t\tC.Mat(desc.Ptr()))\n\tdefer C.KeyPoints_Close(ret)\n\n\treturn getKeyPoints(ret), desc\n}\n\n// DrawMatches draws matches on combined train and querry images.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d5d/group__features2d__draw.html#gad8f463ccaf0dc6f61083abd8717c261a\nfunc DrawMatches(img1 Mat, kp1 []KeyPoint, img2 Mat, kp2 []KeyPoint, matches1to2 []DMatch, outImg *Mat, matchColor color.RGBA, singlePointColor color.RGBA, matchesMask []byte, flags DrawMatchesFlag) {\n\tkp1arr := make([]C.struct_KeyPoint, len(kp1))\n\tkp2arr := make([]C.struct_KeyPoint, len(kp2))\n\n\tfor i, kp := range kp1 {\n\t\tkp1arr[i].x = C.double(kp.X)\n\t\tkp1arr[i].y = C.double(kp.Y)\n\t\tkp1arr[i].size = C.double(kp.Size)\n\t\tkp1arr[i].angle = C.double(kp.Angle)\n\t\tkp1arr[i].response = C.double(kp.Response)\n\t\tkp1arr[i].octave = C.int(kp.Octave)\n\t\tkp1arr[i].classID = C.int(kp.ClassID)\n\t}\n\n\tfor i, kp := range kp2 {\n\t\tkp2arr[i].x = C.double(kp.X)\n\t\tkp2arr[i].y = C.double(kp.Y)\n\t\tkp2arr[i].size = C.double(kp.Size)\n\t\tkp2arr[i].angle = C.double(kp.Angle)\n\t\tkp2arr[i].response = C.double(kp.Response)\n\t\tkp2arr[i].octave = C.int(kp.Octave)\n\t\tkp2arr[i].classID = C.int(kp.ClassID)\n\t}\n\n\tcKeyPoints1 := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp1arr[0]),\n\t\tlength:    (C.int)(len(kp1)),\n\t}\n\n\tcKeyPoints2 := C.struct_KeyPoints{\n\t\tkeypoints: (*C.struct_KeyPoint)(&kp2arr[0]),\n\t\tlength:    (C.int)(len(kp2)),\n\t}\n\n\tdMatchArr := make([]C.struct_DMatch, len(matches1to2))\n\n\tfor i, dm := range matches1to2 {\n\t\tdMatchArr[i].queryIdx = C.int(dm.QueryIdx)\n\t\tdMatchArr[i].trainIdx = C.int(dm.TrainIdx)\n\t\tdMatchArr[i].imgIdx = C.int(dm.ImgIdx)\n\t\tdMatchArr[i].distance = C.float(dm.Distance)\n\t}\n\n\tcDMatches := C.struct_DMatches{\n\t\tdmatches: (*C.struct_DMatch)(&dMatchArr[0]),\n\t\tlength:   (C.int)(len(matches1to2)),\n\t}\n\n\tscalarMatchColor := C.struct_Scalar{\n\t\tval1: C.double(matchColor.R),\n\t\tval2: C.double(matchColor.G),\n\t\tval3: C.double(matchColor.B),\n\t\tval4: C.double(matchColor.A),\n\t}\n\n\tscalarPointColor := C.struct_Scalar{\n\t\tval1: C.double(singlePointColor.B),\n\t\tval2: C.double(singlePointColor.G),\n\t\tval3: C.double(singlePointColor.R),\n\t\tval4: C.double(singlePointColor.A),\n\t}\n\n\tmask := make([]C.char, len(matchesMask))\n\n\tcByteArray := C.struct_ByteArray{\n\t\tlength: (C.int)(len(matchesMask)),\n\t}\n\n\tif len(matchesMask) > 0 {\n\t\tcByteArray = C.struct_ByteArray{\n\t\t\tdata:   (*C.char)(&mask[0]),\n\t\t\tlength: (C.int)(len(matchesMask)),\n\t\t}\n\t}\n\n\tC.DrawMatches(img1.p, cKeyPoints1, img2.p, cKeyPoints2, cDMatches, outImg.p, scalarMatchColor, scalarPointColor, cByteArray, C.int(flags))\n}\n"
  },
  {
    "path": "features2d.h",
    "content": "#ifndef _OPENCV3_FEATURES2D_H_\n#define _OPENCV3_FEATURES2D_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::AKAZE>* AKAZE;\ntypedef cv::Ptr<cv::AgastFeatureDetector>* AgastFeatureDetector;\ntypedef cv::Ptr<cv::BRISK>* BRISK;\ntypedef cv::Ptr<cv::FastFeatureDetector>* FastFeatureDetector;\ntypedef cv::Ptr<cv::GFTTDetector>* GFTTDetector;\ntypedef cv::Ptr<cv::KAZE>* KAZE;\ntypedef cv::Ptr<cv::MSER>* MSER;\ntypedef cv::Ptr<cv::ORB>* ORB;\ntypedef cv::Ptr<cv::SimpleBlobDetector>* SimpleBlobDetector;\ntypedef cv::Ptr<cv::BFMatcher>* BFMatcher;\ntypedef cv::Ptr<cv::FlannBasedMatcher>* FlannBasedMatcher;\ntypedef cv::Ptr<cv::SIFT>* SIFT;\n#else\ntypedef void* AKAZE;\ntypedef void* AgastFeatureDetector;\ntypedef void* BRISK;\ntypedef void* FastFeatureDetector;\ntypedef void* GFTTDetector;\ntypedef void* KAZE;\ntypedef void* MSER;\ntypedef void* ORB;\ntypedef void* SimpleBlobDetector;\ntypedef void* BFMatcher;\ntypedef void* FlannBasedMatcher;\ntypedef void* SIFT;\n#endif\n\nAKAZE AKAZE_Create();\nAKAZE AKAZE_CreateWithParams(int descriptor_type, int descriptor_size, int descriptor_channels,\n                             float threshold, int nOctaves, int nOctaveLayers, int diffusivity);\nvoid AKAZE_Close(AKAZE a);\nstruct KeyPoints AKAZE_Detect(AKAZE a, Mat src);\nstruct KeyPoints AKAZE_Compute(AKAZE a, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints AKAZE_DetectAndCompute(AKAZE a, Mat src, Mat mask, Mat desc);\n\nAgastFeatureDetector AgastFeatureDetector_Create();\nAgastFeatureDetector AgastFeatureDetector_CreateWithParams(int threshold, bool nonmaxSuppression, int type);\nvoid AgastFeatureDetector_Close(AgastFeatureDetector a);\nstruct KeyPoints AgastFeatureDetector_Detect(AgastFeatureDetector a, Mat src);\n\nBRISK BRISK_Create();\nBRISK BRISK_CreateWithParams(int thresh, int octaves, float patternScale);\nvoid BRISK_Close(BRISK b);\nstruct KeyPoints BRISK_Detect(BRISK b, Mat src);\nstruct KeyPoints BRISK_Compute(BRISK b, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints BRISK_DetectAndCompute(BRISK b, Mat src, Mat mask, Mat desc);\n\nFastFeatureDetector FastFeatureDetector_Create();\nFastFeatureDetector FastFeatureDetector_CreateWithParams(int threshold, bool nonmaxSuppression, int type);\nvoid FastFeatureDetector_Close(FastFeatureDetector f);\nstruct KeyPoints FastFeatureDetector_Detect(FastFeatureDetector f, Mat src);\n\nGFTTDetector GFTTDetector_Create();\nGFTTDetector GFTTDetector_Create_WithParams(const struct GFTTDetectorParams* params);\nvoid GFTTDetector_Close(GFTTDetector a);\nstruct KeyPoints GFTTDetector_Detect(GFTTDetector a, Mat src);\n\nKAZE KAZE_Create();\nKAZE KAZE_CreateWithParams(bool extended, bool upright, float threshold, int nOctaves, int nOctaveLayers, int diffusivity);\n\nvoid KAZE_Close(KAZE a);\nstruct KeyPoints KAZE_Detect(KAZE a, Mat src);\nstruct KeyPoints KAZE_Compute(KAZE a, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints KAZE_DetectAndCompute(KAZE a, Mat src, Mat mask, Mat desc);\n\nMSER MSER_Create();\nMSER MSER_CreateWithParams(int delta, int min_area, int max_area, double max_variation, double min_diversity,\n                 int max_evolution, double area_threshold, double min_margin, int edge_blur_size);\nvoid MSER_Close(MSER a);\nstruct KeyPoints MSER_Detect(MSER a, Mat src);\n\nORB ORB_Create();\nORB ORB_CreateWithParams(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize, int fastThreshold);\nvoid ORB_Close(ORB o);\nstruct KeyPoints ORB_Detect(ORB o, Mat src);\nstruct KeyPoints ORB_Compute(ORB o, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints ORB_DetectAndCompute(ORB o, Mat src, Mat mask, Mat desc);\n\nSimpleBlobDetector SimpleBlobDetector_Create();\nSimpleBlobDetector SimpleBlobDetector_Create_WithParams(SimpleBlobDetectorParams params);\nvoid SimpleBlobDetector_Close(SimpleBlobDetector b);\nstruct KeyPoints SimpleBlobDetector_Detect(SimpleBlobDetector b, Mat src);\nSimpleBlobDetectorParams SimpleBlobDetectorParams_Create();\n\nBFMatcher BFMatcher_Create();\nBFMatcher BFMatcher_CreateWithParams(int normType, bool crossCheck);\nvoid BFMatcher_Close(BFMatcher b);\nstruct DMatches BFMatcher_Match(BFMatcher b, Mat query, Mat train);\nstruct MultiDMatches BFMatcher_KnnMatch(BFMatcher b, Mat query, Mat train, int k);\n\nFlannBasedMatcher FlannBasedMatcher_Create();\nvoid FlannBasedMatcher_Close(FlannBasedMatcher f);\nstruct MultiDMatches FlannBasedMatcher_KnnMatch(FlannBasedMatcher f, Mat query, Mat train, int k);\n\nvoid DrawKeyPoints(Mat src, struct KeyPoints kp, Mat dst, const Scalar s, int flags);\n\nSIFT SIFT_Create();\nSIFT SIFT_CreateWithParams(int nfeatures, int nOctaveLayers, double contrastThreshold, double edgeThreshold, double sigma);\nvoid SIFT_Close(SIFT f);\nstruct KeyPoints SIFT_Detect(SIFT f, Mat src);\nstruct KeyPoints SIFT_Compute(SIFT f, Mat src, struct KeyPoints kp, Mat desc);\nstruct KeyPoints SIFT_DetectAndCompute(SIFT f, Mat src, Mat mask, Mat desc);\n\nvoid DrawMatches(Mat img1, struct KeyPoints kp1, Mat img2, struct KeyPoints kp2, struct DMatches matches1to2, Mat outImg, const Scalar matchesColor, const Scalar pointColor, struct ByteArray matchesMask, int flags);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_FEATURES2D_H_\n"
  },
  {
    "path": "features2d_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_features2d)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"features2d.h\"\n*/\nimport \"C\"\n\nfunc (c FastFeatureDetectorType) String() string {\n\tswitch c {\n\tcase FastFeatureDetectorType58:\n\t\treturn \"fast-feature-detector-type-58\"\n\tcase FastFeatureDetectorType712:\n\t\treturn \"fast-feature-detector-type-712\"\n\tcase FastFeatureDetectorType916:\n\t\treturn \"fast-feature-detector-type-916\"\n\t}\n\treturn \"\"\n}\n\nfunc (c DrawMatchesFlag) String() string {\n\tswitch c {\n\tcase DrawDefault:\n\t\treturn \"draw-default\"\n\tcase DrawOverOutImg:\n\t\treturn \"draw-over-out-imt\"\n\tcase NotDrawSinglePoints:\n\t\treturn \"draw-single-points\"\n\tcase DrawRichKeyPoints:\n\t\treturn \"draw-rich-key-points\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "features2d_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_features2d)\n\npackage gocv\n\nimport (\n\t\"image/color\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestAKAZE(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in AKAZE test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tak := NewAKAZE()\n\tdefer ak.Close()\n\n\tkp := ak.Detect(img)\n\tif len(kp) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := ak.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in AKAZE Compute\")\n\t}\n\n\tkpdc, desc2 := ak.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in AKAZE DetectAndCompute\")\n\t}\n}\n\nfunc TestAKAZEWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in AKAZE test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tak := NewAKAZEWithParams(3, 0, 3, 0.001, 4, 4, 1)\n\tdefer ak.Close()\n\n\t// Test Detect method\n\tkp := ak.Detect(img)\n\tif len(kp) < 473 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := ak.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 473 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in AKAZE Compute\")\n\t}\n\n\tkpdc, desc2 := ak.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 473 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AKAZE DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in AKAZE DetectAndCompute\")\n\t}\n}\n\nfunc TestAgastFeatureDetector(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in AgastFeatureDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tad := NewAgastFeatureDetector()\n\tdefer ad.Close()\n\n\tkp := ad.Detect(img)\n\tif len(kp) < 2800 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AgastFeatureDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestAgastFeatureDetectorWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in AgastFeatureDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tad := NewAgastFeatureDetectorWithParams(10, true, 0)\n\tdefer ad.Close()\n\n\tkp := ad.Detect(img)\n\tif len(kp) < 2137 {\n\t\tt.Errorf(\"Invalid KeyPoint array in AgastFeatureDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestBRISK(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BRISK test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tbr := NewBRISK()\n\tdefer br.Close()\n\n\tkp := br.Detect(img)\n\tif len(kp) < 513 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK Detect: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := br.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BRISK Compute\")\n\t}\n\n\tkpdc, desc2 := br.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BRISK DetectAndCompute\")\n\t}\n}\n\nfunc TestBRISKWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in BRISK test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\t// Create BRISK with custom parameters (e.g., threshold = 30, octaves = 3, patternScale = 1.0)\n\tbr := NewBRISKWithParams(30, 3, 1.0)\n\tdefer br.Close()\n\n\tkp := br.Detect(img)\n\tif len(kp) < 513 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK Detect: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := br.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BRISK Compute\")\n\t}\n\n\tkpdc, desc2 := br.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in BRISK DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in BRISK DetectAndCompute\")\n\t}\n}\n\nfunc TestFastFeatureDetector(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in FastFeatureDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfd := NewFastFeatureDetector()\n\tdefer fd.Close()\n\n\tkp := fd.Detect(img)\n\tif len(kp) < 2690 {\n\t\tt.Errorf(\"Invalid KeyPoint array in FastFeatureDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestFastFeatureDetectorWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in FastFeatureDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tfd := NewFastFeatureDetectorWithParams(10, true, FastFeatureDetectorType916)\n\tdefer fd.Close()\n\n\tkp := fd.Detect(img)\n\tif len(kp) < 2690 {\n\t\tt.Errorf(\"Invalid KeyPoint array in FastFeatureDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestGFTTDetector(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in GFTTDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tgft := NewGFTTDetector()\n\tdefer gft.Close()\n\n\tkp := gft.Detect(img)\n\tif len(kp) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in GFTTDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestGFTTDetectorWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in GFTTDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tparams := GFTTDetectorParams{\n\t\tMaxCorners:        500,\n\t\tQualityLevel:      0.01,\n\t\tMinDistance:       10,\n\t\tBlockSize:         3,\n\t\tUseHarrisDetector: false,\n\t\tK:                 0.04,\n\t}\n\n\tgft := NewGFTTDetectorWithParams(params)\n\tdefer gft.Close()\n\n\tkp := gft.Detect(img)\n\n\tif len(kp) < 323 {\n\t\tt.Errorf(\"Invalid KeyPoint array in GFTTDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestKAZE(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in KAZE test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tk := NewKAZE()\n\tdefer k.Close()\n\n\tkp := k.Detect(img)\n\tif len(kp) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := k.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in KAZE Compute\")\n\t}\n\n\tkpdc, desc2 := k.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in KAZE DetectAndCompute\")\n\t}\n}\n\nfunc TestKAZEWithParams(t *testing.T) {\n\t// Load the image for testing\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in KAZE With Params test\")\n\t}\n\tdefer img.Close()\n\n\t// Create a destination matrix\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\t// Set up the parameters for KAZE with the function NewKazeWithParams\n\textended := true\n\tupright := false\n\tthreshold := float32(0.001)\n\tnOctaves := 4\n\tnOctaveLayers := 4\n\tdiffusivity := 1 // Based on your input parameter options (e.g., 1 could be for `cv::KAZE::DIFF_PM_G2`)\n\n\t// Create a KAZE object with the specified parameters\n\tk := NewKazeWithParams(extended, upright, threshold, nOctaves, nOctaveLayers, diffusivity)\n\tdefer k.Close()\n\n\t// Detect keypoints\n\tkp := k.Detect(img)\n\tif len(kp) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE With Params test: %d\", len(kp))\n\t}\n\n\t// Create a mask (optional)\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\t// Compute descriptors for the keypoints\n\tkpc, desc := k.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE With Params Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in KAZE With Params Compute\")\n\t}\n\n\t// Perform DetectAndCompute\n\tkpdc, desc2 := k.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in KAZE With Params DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in KAZE With Params DetectAndCompute\")\n\t}\n}\n\nfunc TestMSER(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MSER test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmser := NewMSER()\n\tdefer mser.Close()\n\n\tkp := mser.Detect(img)\n\tif len(kp) == 0 {\n\t\tt.Errorf(\"Invalid KeyPoint array in MSER test: %d\", len(kp))\n\t}\n}\n\nfunc TestMSERWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MSER With Params test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tdelta := 5\n\tminArea := 60\n\tmaxArea := 14400\n\tmaxVariation := 0.25\n\tminDiversity := 0.2\n\tmaxEvolution := 200\n\tareaThreshold := 1.01\n\tminMargin := 0.003\n\tedgeBlurSize := 5\n\n\tmser := NewMSERWithParams(delta, minArea, maxArea, maxVariation, minDiversity, maxEvolution, areaThreshold, minMargin, edgeBlurSize)\n\tdefer mser.Close()\n\n\tregions := mser.Detect(img)\n\tif len(regions) == 0 {\n\t\tt.Errorf(\"Invalid region detection in MSER With Params test: %d\", len(regions))\n\t}\n}\n\nfunc TestORB(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in AgastFeatureDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tod := NewORB()\n\tdefer od.Close()\n\n\tkp := od.Detect(img)\n\tif len(kp) != 500 {\n\t\tt.Errorf(\"Invalid KeyPoint array in ORB test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := od.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 500 {\n\t\tt.Errorf(\"Invalid KeyPoint array in ORB Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in ORB Compute\")\n\t}\n\n\tkpdc, desc2 := od.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 500 {\n\t\tt.Errorf(\"Invalid KeyPoint array in ORB DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in ORB DetectAndCompute\")\n\t}\n}\n\nfunc TestSimpleBlobDetector(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SimpleBlobDetector test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tbd := NewSimpleBlobDetector()\n\tdefer bd.Close()\n\n\tkp := bd.Detect(img)\n\tif len(kp) != 2 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SimpleBlobDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestSimpleBlobDetectorWithParams(t *testing.T) {\n\timg := IMRead(\"images/circles.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SimpleBlobDetector test\")\n\t}\n\tdefer img.Close()\n\n\tparams := NewSimpleBlobDetectorParams()\n\tparams.SetMaxArea(27500.0)\n\n\tbdp := NewSimpleBlobDetectorWithParams(params)\n\tdefer bdp.Close()\n\n\tkp := bdp.Detect(img)\n\tif len(kp) != 4 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SimpleBlobDetector test: %d\", len(kp))\n\t}\n}\n\nfunc TestSimpleBlobDetectorParams(t *testing.T) {\n\tfloat64EqualityThreshold := 1e-5\n\tknownBlobColor := 235\n\tknownFilterByArea := false\n\tknownFilterByCircularity := true\n\tknownFilterByColor := false\n\tknownFilterByConvexity := false\n\tknownFilterByInertia := false\n\tknownMaxArea := 20000.0\n\tknownMaxCircularity := 0.99\n\tknownMaxConvexity := 0.98\n\tknownMaxInertiaRatio := 0.97\n\tknownMaxThreshold := 233.0\n\tknownMinArea := 230.0\n\tknownMinCircularity := 0.9\n\tknownMinConvexity := 0.89\n\tknownMinDistBetweenBlobs := 15.5\n\tknownMinInertiaRatio := 0.88\n\tknownMinRepeatability := 5\n\tknownMinThreshold := 200.0\n\tknownThresholdStep := 2.0\n\n\tparams := NewSimpleBlobDetectorParams()\n\tparams.SetBlobColor(knownBlobColor)\n\tparams.SetFilterByArea(knownFilterByArea)\n\tparams.SetFilterByCircularity(knownFilterByCircularity)\n\tparams.SetFilterByColor(knownFilterByColor)\n\tparams.SetFilterByConvexity(knownFilterByConvexity)\n\tparams.SetFilterByInertia(knownFilterByInertia)\n\tparams.SetMaxArea(knownMaxArea)\n\tparams.SetMaxCircularity(knownMaxCircularity)\n\tparams.SetMaxConvexity(knownMaxConvexity)\n\tparams.SetMaxInertiaRatio(knownMaxInertiaRatio)\n\tparams.SetMaxThreshold(knownMaxThreshold)\n\tparams.SetMinArea(knownMinArea)\n\tparams.SetMinCircularity(knownMinCircularity)\n\tparams.SetMinConvexity(knownMinConvexity)\n\tparams.SetMinDistBetweenBlobs(knownMinDistBetweenBlobs)\n\tparams.SetMinInertiaRatio(knownMinInertiaRatio)\n\tparams.SetMinRepeatability(knownMinRepeatability)\n\tparams.SetMinThreshold(knownMinThreshold)\n\tparams.SetThresholdStep(knownThresholdStep)\n\n\tif params.GetBlobColor() != knownBlobColor {\n\t\tt.Error(\"BlobColor incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetFilterByArea() != knownFilterByArea {\n\t\tt.Error(\"FilterByArea incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetFilterByCircularity() != knownFilterByCircularity {\n\t\tt.Error(\"FilterByCircularity incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetFilterByColor() != knownFilterByColor {\n\t\tt.Error(\"FilterByColor incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetFilterByConvexity() != knownFilterByConvexity {\n\t\tt.Error(\"FilterByConvexity incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetFilterByInertia() != knownFilterByInertia {\n\t\tt.Error(\"FilterByInertia incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetMaxArea() != knownMaxArea {\n\t\tt.Error(\"MaxArea incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tdiffMaxCircularity := params.GetMaxCircularity() - knownMaxCircularity\n\tif diffMaxCircularity > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMaxCircularity greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff: %f\", diffMaxCircularity)\n\t}\n\n\tdiffMaxConvexity := params.GetMaxConvexity() - knownMaxConvexity\n\tif diffMaxConvexity > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMaxConvexity greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff: %f\", diffMaxConvexity)\n\t}\n\n\tdiffMaxInertiaRatio := params.GetMaxInertiaRatio() - knownMaxInertiaRatio\n\tif diffMaxInertiaRatio > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMaxInertiaRatio greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff: %f\", diffMaxInertiaRatio)\n\t}\n\n\tif params.GetMaxThreshold() != knownMaxThreshold {\n\t\tt.Error(\"MaxThreshold incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetMinArea() != knownMinArea {\n\t\tt.Error(\"MinArea incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tdiffMinCircularity := params.GetMinCircularity() - knownMinCircularity\n\tif diffMinCircularity > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMinCircularity greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff %f\", diffMinCircularity)\n\t}\n\n\tdiffMinConvexity := params.GetMinConvexity() - knownMinConvexity\n\tif diffMinConvexity > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMinConvexity greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff: %f\", diffMinConvexity)\n\t}\n\n\tif params.GetMinDistBetweenBlobs() != knownMinDistBetweenBlobs {\n\t\tt.Error(\"MinDistBetweenBlobs incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tdiffMinInertiaRatio := params.GetMinInertiaRatio() - knownMinInertiaRatio\n\tif diffMinInertiaRatio > float64EqualityThreshold {\n\t\tt.Errorf(\"DiffMinInertiaRatio greater than float64EqualityThreshold in SimpleBlobDetectorParams test. Diff: %f\", diffMinInertiaRatio)\n\t}\n\n\tif params.GetMinRepeatability() != knownMinRepeatability {\n\t\tt.Error(\"MinRepeatability incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetMinThreshold() != knownMinThreshold {\n\t\tt.Error(\"MinThreshold incorrect in SimpleBlobDetectorParams test\")\n\t}\n\n\tif params.GetThresholdStep() != knownThresholdStep {\n\t\tt.Error(\"ThresholdStep incorrect in SimpleBlobDetectorParams test\")\n\t}\n}\n\nfunc TestBFMatcher(t *testing.T) {\n\tdescriptorFile := \"images/sift_descriptor.png\"\n\tdesc1 := IMRead(descriptorFile, IMReadGrayScale)\n\tif desc1.Empty() {\n\t\tt.Error(\"descriptor one is empty in BFMatcher test\")\n\t}\n\tdefer desc1.Close()\n\n\tdesc2 := IMRead(descriptorFile, IMReadGrayScale)\n\tif desc2.Empty() {\n\t\tt.Error(\"descriptor two is empty in BFMatcher test\")\n\t}\n\tdefer desc2.Close()\n\n\tbf := NewBFMatcher()\n\tdefer bf.Close()\n\n\tk := 2\n\tdMatches := bf.KnnMatch(desc1, desc2, k)\n\tif len(dMatches) < 1 {\n\t\tt.Errorf(\"DMatches was excepted to have at least one element\")\n\t}\n\tfor i := range dMatches {\n\t\tif len(dMatches[i]) != k {\n\t\t\tt.Errorf(\"Length does not match k cluster amount in BFMatcher\")\n\t\t}\n\t}\n\n\tmatches := bf.Match(desc1, desc2)\n\tif len(matches) != 890 {\n\t\tt.Errorf(\"Matches was excepted to have 890 elements, but it has %d\", len(matches))\n\t}\n\n\tbfParams := NewBFMatcherWithParams(NormHamming, false)\n\tdefer bfParams.Close()\n\n\tdMatches = bfParams.KnnMatch(desc1, desc2, k)\n\tif len(dMatches) < 1 {\n\t\tt.Errorf(\"DMatches was excepted to have at least one element\")\n\t}\n\tfor i := range dMatches {\n\t\tif len(dMatches[i]) != k {\n\t\t\tt.Errorf(\"Length does not match k cluster amount in BFMatcher\")\n\t\t}\n\t}\n}\n\nfunc TestFlannBasedMatcher(t *testing.T) {\n\tdescriptorFile := \"images/sift_descriptor.png\"\n\tdesc1 := IMRead(descriptorFile, IMReadGrayScale)\n\tif desc1.Empty() {\n\t\tt.Error(\"descriptor one is empty in FlannBasedMatcher test\")\n\t}\n\tdefer desc1.Close()\n\tdesc1.ConvertTo(&desc1, MatTypeCV32F)\n\n\tdesc2 := IMRead(descriptorFile, IMReadGrayScale)\n\tif desc2.Empty() {\n\t\tt.Error(\"descriptor two is empty in FlannBasedMatcher test\")\n\t}\n\tdefer desc2.Close()\n\tdesc2.ConvertTo(&desc2, MatTypeCV32F)\n\n\tf := NewFlannBasedMatcher()\n\tdefer f.Close()\n\n\tk := 2\n\tdMatches := f.KnnMatch(desc1, desc2, k)\n\tif len(dMatches) < 1 {\n\t\tt.Errorf(\"DMatches was excepted to have at least one element\")\n\t}\n\tfor i := range dMatches {\n\t\tif len(dMatches[i]) != k {\n\t\t\tt.Errorf(\"Length does not match k cluster amount in FlannBasedMatcher\")\n\t\t}\n\t}\n}\n\nfunc TestDrawKeyPoints(t *testing.T) {\n\tkeypointsFile := \"images/simple.jpg\"\n\timg := IMRead(keypointsFile, IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"keypoints file is empty in DrawKeyPoints test\")\n\t}\n\tdefer img.Close()\n\n\tffd := NewFastFeatureDetector()\n\tkp := ffd.Detect(img)\n\n\tsimpleKP := NewMat()\n\tdefer simpleKP.Close()\n\tDrawKeyPoints(img, kp, &simpleKP, color.RGBA{255, 0, 0, 0}, DrawDefault)\n\n\tif simpleKP.Rows() != img.Rows() || simpleKP.Cols() != img.Cols() {\n\t\tt.Error(\"Invalid DrawKeyPoints test\")\n\t}\n}\n\nfunc TestDrawMatches(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\tqueryFile := \"images/box.png\"\n\ttrainFile := \"images/box_in_scene.png\"\n\n\tquery := IMRead(queryFile, IMReadGrayScale)\n\ttrain := IMRead(trainFile, IMReadGrayScale)\n\n\tif query.Empty() || train.Empty() {\n\t\tt.Error(\"at least one of files is empty in DrawMatches test\")\n\t}\n\n\tdefer query.Close()\n\tdefer train.Close()\n\n\tsift := NewSIFT()\n\tdefer sift.Close()\n\n\tm1 := NewMat()\n\tm2 := NewMat()\n\tdefer m1.Close()\n\tdefer m2.Close()\n\n\tkp1, des1 := sift.DetectAndCompute(query, m1)\n\tkp2, des2 := sift.DetectAndCompute(train, m2)\n\tdefer des1.Close()\n\tdefer des2.Close()\n\n\tbf := NewBFMatcher()\n\tdefer bf.Close()\n\tmatches := bf.KnnMatch(des1, des2, 2)\n\n\tif len(matches) == 0 {\n\t\tt.Error(\"no matches found in DrawMatches test\")\n\t}\n\n\tvar good []DMatch\n\tfor _, m := range matches {\n\t\tif len(m) > 1 {\n\t\t\tif m[0].Distance < 0.75*m[1].Distance {\n\t\t\t\tgood = append(good, m[0])\n\t\t\t}\n\t\t}\n\t}\n\n\tc := color.RGBA{\n\t\tR: 255,\n\t\tG: 0,\n\t\tB: 0,\n\t\tA: 0,\n\t}\n\n\tmask := make([]byte, 0)\n\n\tout := NewMat()\n\tdefer out.Close()\n\n\tDrawMatches(query, kp1, train, kp2, good, &out, c, c, mask, DrawDefault)\n\n\tif out.Cols() != (query.Cols()+train.Cols()) || out.Rows() < train.Rows() || out.Rows() < query.Rows() {\n\t\tt.Error(\"Invalid DrawMatches test\")\n\t}\n\n\tmask = make([]byte, len(good))\n\n\tsmoke := NewMat()\n\tdefer smoke.Close()\n\n\tDrawMatches(query, kp1, train, kp2, good, &smoke, c, c, mask, DrawDefault)\n}\n\nfunc TestSIFT(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\timg := IMRead(\"./images/face.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SIFT test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tsi := NewSIFT()\n\tdefer si.Close()\n\n\tkp := si.Detect(img)\n\tif len(kp) == 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := si.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SIFT Compute\")\n\t}\n\n\tkpdc, desc2 := si.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) < 512 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SIFT DetectAndCompute\")\n\t}\n}\n\nfunc TestSIFTWithParams(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\timg := IMRead(\"./images/face.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in SIFT test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tnFeatures := 256\n\tnOctaveLayers := 3\n\tcontrastThreshold := 0.039\n\tvar edgeThreshold float64 = 11\n\tsigma := 1.55\n\tsi := NewSIFTWithParams(&nFeatures, &nOctaveLayers, &contrastThreshold, &edgeThreshold, &sigma)\n\tdefer si.Close()\n\n\tkp := si.Detect(img)\n\tif len(kp) != 256 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT test: %d\", len(kp))\n\t}\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tkpc, desc := si.Compute(img, mask, kp)\n\tdefer desc.Close()\n\tif len(kpc) != 256 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT Compute: %d\", len(kpc))\n\t}\n\tif desc.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SIFT Compute\")\n\t}\n\n\tkpdc, desc2 := si.DetectAndCompute(img, mask)\n\tdefer desc2.Close()\n\tif len(kpdc) != 256 {\n\t\tt.Errorf(\"Invalid KeyPoint array in SIFT DetectAndCompute: %d\", len(kpdc))\n\t}\n\tif desc2.Empty() {\n\t\tt.Error(\"Invalid Mat desc in SIFT DetectAndCompute\")\n\t}\n}\n"
  },
  {
    "path": "go.mod",
    "content": "module gocv.io/x/gocv\n\ngo 1.21\n\nrequire (\n\tgithub.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e\n\tgithub.com/pascaldekloe/goe v0.1.0\n\tgithub.com/subeshb1/wasm-go-image-to-ascii v0.0.0-20200725121413-d828986df340\n)\n\nrequire (\n\tgithub.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect\n\tgithub.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect\n)\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo=\ngithub.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e h1:xCcwD5FOXul+j1dn8xD16nbrhJkkum/Cn+jTd/u1LhY=\ngithub.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e/go.mod h1:eagM805MRKrioHYuU7iKLUyFPVKqVV6um5DAvCkUtXs=\ngithub.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=\ngithub.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=\ngithub.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=\ngithub.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=\ngithub.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/shurcooL/go v0.0.0-20200502201357-93f07166e636/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=\ngithub.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=\ngithub.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=\ngithub.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=\ngithub.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=\ngithub.com/subeshb1/wasm-go-image-to-ascii v0.0.0-20200725121413-d828986df340 h1:EN1NUPDAdhpWv9zNNdbovzqfJaRmnrwWaq0huRzQp9I=\ngithub.com/subeshb1/wasm-go-image-to-ascii v0.0.0-20200725121413-d828986df340/go.mod h1:A2X7CsJFb8jEdYaWeCbs2HydXC69J4Iaw4DM+bly5iw=\ngithub.com/wayneashleyberry/terminal-dimensions v1.0.0/go.mod h1:PW2XrtV6KmKOPhuf7wbtcmw1/IFnC39mryRET2XbxeE=\ngolang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\n"
  },
  {
    "path": "gocv.go",
    "content": "// Package gocv is a wrapper around the OpenCV 4.x computer vision library.\n// It provides a Go language interface to the latest version of OpenCV.\n//\n// OpenCV (Open Source Computer Vision Library: http://opencv.org) is an\n// open-source BSD-licensed library that includes several hundreds of\n// computer vision algorithms.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/dfb/intro.html\npackage gocv // import \"gocv.io/x/gocv\"\n"
  },
  {
    "path": "helpers_test.go",
    "content": "package gocv\n\nimport \"math\"\n\nvar eps = 0.00000001\n\nfunc floatEquals(a, b float64) bool {\n\tif math.Abs(a-b) < eps {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// round helper from https://stackoverflow.com/questions/39544571/golang-round-to-nearest-0-05\nfunc round(x, unit float64) float64 {\n\treturn float64(int64(x/unit+0.5)) * unit\n}\n"
  },
  {
    "path": "highgui.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_highgui)\n\n#include \"highgui_gocv.h\"\n\nvoid Window_SetMouseCallback(char* winname, mouse_callback on_mouse) {\n    try {\n        cv::setMouseCallback(winname, on_mouse, (void*)winname);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\n// Window\nvoid Window_New(const char* winname, int flags) {\n    try {\n        cv::namedWindow(winname, flags);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Window_Close(const char* winname) {\n    try {\n        cv::destroyWindow(winname);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nOpenCVResult Window_IMShow(const char* winname, Mat mat) {\n    try {\n        cv::imshow(winname, *mat);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Window_GetProperty(const char* winname, int flag) {\n    try {\n        return cv::getWindowProperty(winname, flag);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult Window_SetProperty(const char* winname, int flag, double value) {\n    try {\n        cv::setWindowProperty(winname, flag, value);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Window_SetTitle(const char* winname, const char* title) {\n    try {\n        cv::setWindowTitle(winname, title);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nint Window_WaitKey(int delay = 0) {\n    try {\n        return cv::waitKey(delay);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nint Window_WaitKeyEx(int delay = 0) {\n    try {\n        return cv::waitKeyEx(delay);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nint Window_PollKey(void) {\n    try {\n        return cv::pollKey();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nOpenCVResult Window_Move(const char* winname, int x, int y) {\n    try {\n        cv::moveWindow(winname, x, y);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Window_Resize(const char* winname, int width, int height) {\n    try {\n        cv::resizeWindow(winname, width, height);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nstruct Rect Window_SelectROI(const char* winname, Mat img) {\n    try {\n        cv::Rect bRect = cv::selectROI(winname, *img);\n        Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n        return r;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rect r = {0, 0, 0, 0};\n        return r;\n    }\n}\n\nstruct Rects Window_SelectROIs(const char* winname, Mat img) {\n    try {\n        std::vector<cv::Rect> rois;\n        cv::selectROIs(winname, *img, rois);\n        Rect* rects = new Rect[rois.size()];\n    \n        for (size_t i = 0; i < rois.size(); ++i) {\n            Rect r = {rois[i].x, rois[i].y, rois[i].width, rois[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)rois.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\n// Trackbar\nvoid Trackbar_Create(const char* winname, const char* trackname, int max) {\n    try {\n        cv::createTrackbar(trackname, winname, NULL, max);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Trackbar_CreateWithValue(const char* winname, const char* trackname, int* value, int max) {\n    try {\n        cv::createTrackbar(trackname, winname, value, max);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nint Trackbar_GetPos(const char* winname, const char* trackname) {\n    try {\n        return cv::getTrackbarPos(trackname, winname);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return -1;\n    }\n}\n\nvoid Trackbar_SetPos(const char* winname, const char* trackname, int pos) {\n    try {\n        cv::setTrackbarPos(trackname, winname, pos);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Trackbar_SetMin(const char* winname, const char* trackname, int pos) {\n    try {\n        cv::setTrackbarMin(trackname, winname, pos);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid Trackbar_SetMax(const char* winname, const char* trackname, int pos) {\n    try {\n        cv::setTrackbarMax(trackname, winname, pos);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "highgui.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_highgui)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"highgui_gocv.h\"\n\nvoid go_onmouse_dispatcher(int event, int x, int y, int flags, void *userdata);\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"runtime\"\n\t\"unsafe\"\n)\n\ntype MouseHandlerFunc func(event int, x int, y int, flags int, userdata interface{})\n\ntype mouseHandlerInfo struct {\n\tc_name_ptr *C.char\n\tfn         MouseHandlerFunc\n\tuserdata   interface{}\n}\n\nvar (\n\tonMouseHandlers = map[string]mouseHandlerInfo{}\n)\n\n// Window is a wrapper around OpenCV's \"HighGUI\" named windows.\n// While OpenCV was designed for use in full-scale applications and can be used\n// within functionally rich UI frameworks (such as Qt*, WinForms*, or Cocoa*)\n// or without any UI at all, sometimes there it is required to try functionality\n// quickly and visualize the results. This is what the HighGUI module has been designed for.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/dfc/group__highgui.html\ntype Window struct {\n\tname string\n\topen bool\n}\n\n// NewWindow creates a new named OpenCV window\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b\nfunc NewWindow(name string) *Window {\n\truntime.LockOSThread()\n\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tC.Window_New(cName, 0)\n\n\treturn &Window{name: name, open: true}\n}\n\n// Close closes and deletes a named OpenCV Window.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/dfc/group__highgui.html#ga851ccdd6961022d1d5b4c4f255dbab34\nfunc (w *Window) Close() error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tmcbInfo, exists := onMouseHandlers[w.name]\n\tif exists {\n\t\tmcbInfo.fn = nil\n\t\tmcbInfo.userdata = nil\n\t\tC.free(unsafe.Pointer(mcbInfo.c_name_ptr))\n\t\tdelete(onMouseHandlers, w.name)\n\t}\n\n\tC.Window_Close(cName)\n\tw.open = false\n\n\truntime.UnlockOSThread()\n\treturn nil\n}\n\n// IsOpen checks to see if the Window seems to be open.\nfunc (w *Window) IsOpen() bool {\n\treturn w.open\n}\n\n// WindowFlag value for SetWindowProperty / GetWindowProperty.\ntype WindowFlag float32\n\nconst (\n\t// WindowNormal indicates a normal window.\n\tWindowNormal WindowFlag = 0x00000000\n\n\t// WindowAutosize indicates a window sized based on the contents.\n\tWindowAutosize WindowFlag = 0x00000001\n\n\t// WindowFullscreen indicates a full-screen window.\n\tWindowFullscreen WindowFlag = 1\n\n\t// WindowFreeRatio indicates allow the user to resize without maintaining aspect ratio.\n\tWindowFreeRatio WindowFlag = 0x00000100\n\n\t// WindowKeepRatio indicates always maintain an aspect ratio that matches the contents.\n\tWindowKeepRatio WindowFlag = 0x00000000\n)\n\n// WindowPropertyFlag flags for SetWindowProperty / GetWindowProperty.\ntype WindowPropertyFlag int\n\nconst (\n\t// WindowPropertyFullscreen fullscreen property\n\t// (can be WINDOW_NORMAL or WINDOW_FULLSCREEN).\n\tWindowPropertyFullscreen WindowPropertyFlag = 0\n\n\t// WindowPropertyAutosize is autosize property\n\t// (can be WINDOW_NORMAL or WINDOW_AUTOSIZE).\n\tWindowPropertyAutosize WindowPropertyFlag = 1\n\n\t// WindowPropertyAspectRatio window's aspect ration\n\t// (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO).\n\tWindowPropertyAspectRatio WindowPropertyFlag = 2\n\n\t// WindowPropertyOpenGL opengl support.\n\tWindowPropertyOpenGL WindowPropertyFlag = 3\n\n\t// WindowPropertyVisible or not.\n\tWindowPropertyVisible WindowPropertyFlag = 4\n)\n\n// GetWindowProperty returns properties of a window.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#gaaf9504b8f9cf19024d9d44a14e461656\nfunc (w *Window) GetWindowProperty(flag WindowPropertyFlag) float64 {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn float64(C.Window_GetProperty(cName, C.int(flag)))\n}\n\n// SetWindowProperty changes parameters of a window dynamically.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga66e4a6db4d4e06148bcdfe0d70a5df27\nfunc (w *Window) SetWindowProperty(flag WindowPropertyFlag, value WindowFlag) error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn OpenCVResult(C.Window_SetProperty(cName, C.int(flag), C.double(value)))\n}\n\n// SetWindowTitle updates window title.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga56f8849295fd10d0c319724ddb773d96\nfunc (w *Window) SetWindowTitle(title string) error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tcTitle := C.CString(title)\n\tdefer C.free(unsafe.Pointer(cTitle))\n\n\treturn OpenCVResult(C.Window_SetTitle(cName, cTitle))\n}\n\n// IMShow displays an image Mat in the specified window.\n// This function should be followed by the WaitKey function which displays\n// the image for specified milliseconds. Otherwise, it won't display the image.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563\nfunc (w *Window) IMShow(img Mat) error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn OpenCVResult(C.Window_IMShow(cName, img.p))\n}\n\n// WaitKey waits for a pressed key.\n// This function is the only method in OpenCV's HighGUI that can fetch\n// and handle events, so it needs to be called periodically\n// for normal event processing\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7\nfunc (w *Window) WaitKey(delay int) int {\n\treturn int(C.Window_WaitKey(C.int(delay)))\n}\n\n// WaitKeyEx Similar to waitKey, but returns full key code.\n// Note\n// Key code is implementation specific and depends on used backend: QT/GTK/Win32/etc\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/dfc/group__highgui.html#gafa15c0501e0ddd90918f17aa071d3dd0\nfunc (w *Window) WaitKeyEx(delay int) int {\n\treturn int(C.Window_WaitKey(C.int(delay)))\n}\n\n// PollKey polls for a pressed key.\n// The function pollKey polls for a key event without waiting.\n// It returns the code of the pressed key or -1 if no key was pressed since\n// the last invocation. To wait until a key was pressed, use waitKey.\n//\n// The functions waitKey and pollKey are the only methods in HighGUI that can\n// fetch and handle GUI events, so one of them needs to be called periodically\n// for normal event processing unless HighGUI is used within an environment that\n// takes care of event processing.\n// The function only works if there is at least one HighGUI window created and\n// the window is active. If there are several HighGUI windows, any of them can\n// be active.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/dfc/group__highgui.html#ga6d20fbd3100ec3badc1eaa653aff99d7\nfunc (w *Window) PollKey() int {\n\treturn int(C.Window_PollKey())\n}\n\n// MoveWindow moves window to the specified position.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga8d86b207f7211250dbe6e28f76307ffb\nfunc (w *Window) MoveWindow(x, y int) error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn OpenCVResult(C.Window_Move(cName, C.int(x), C.int(y)))\n}\n\n// ResizeWindow resizes window to the specified size.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga9e80e080f7ef33f897e415358aee7f7e\nfunc (w *Window) ResizeWindow(width, height int) error {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn OpenCVResult(C.Window_Resize(cName, C.int(width), C.int(height)))\n}\n\n// SelectROI selects a Region Of Interest (ROI) on the given image.\n// It creates a window and allows user to select a ROI using mouse.\n//\n// Controls:\n// use space or enter to finish selection,\n// use key c to cancel selection (function will return a zero Rect).\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga8daf4730d3adf7035b6de9be4c469af5\nfunc (w *Window) SelectROI(img Mat) image.Rectangle {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tr := C.Window_SelectROI(cName, img.p)\n\trect := image.Rect(int(r.x), int(r.y), int(r.x+r.width), int(r.y+r.height))\n\treturn rect\n}\n\n// SelectROIs selects multiple Regions Of Interest (ROI) on the given image.\n// It creates a window and allows user to select ROIs using mouse.\n//\n// Controls:\n// use space or enter to finish current selection and start a new one\n// use esc to terminate multiple ROI selection process\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga0f11fad74a6432b8055fb21621a0f893\nfunc (w *Window) SelectROIs(img Mat) []image.Rectangle {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tret := C.Window_SelectROIs(cName, img.p)\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// Deprecated: use Window.SelectROI instead\nfunc SelectROI(name string, img Mat) image.Rectangle {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tr := C.Window_SelectROI(cName, img.p)\n\trect := image.Rect(int(r.x), int(r.y), int(r.x+r.width), int(r.y+r.height))\n\treturn rect\n}\n\n// Deprecated: use Window.SelectROIs instead\nfunc SelectROIs(name string, img Mat) []image.Rectangle {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tret := C.Window_SelectROIs(cName, img.p)\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// WaitKey that is not attached to a specific Window.\n// Only use when no Window exists in your application, e.g. command line app.\nfunc WaitKey(delay int) int {\n\treturn int(C.Window_WaitKey(C.int(delay)))\n}\n\n// Trackbar is a wrapper around OpenCV's \"HighGUI\" window Trackbars.\ntype Trackbar struct {\n\tname   string\n\tparent *Window\n}\n\n// CreateTrackbar creates a trackbar and attaches it to the specified window.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b\nfunc (w *Window) CreateTrackbar(name string, max int) *Trackbar {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\tC.Trackbar_Create(cName, tName, C.int(max))\n\treturn &Trackbar{name: name, parent: w}\n}\n\n// CreateTrackbarWithValue works like CreateTrackbar but also assigns a\n// variable value to be a position synchronized with the trackbar.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#gaf78d2155d30b728fc413803745b67a9b\nfunc (w *Window) CreateTrackbarWithValue(name string, value *int, max int) *Trackbar {\n\tcName := C.CString(w.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\tC.Trackbar_CreateWithValue(cName, tName, (*C.int)(unsafe.Pointer(value)), C.int(max))\n\treturn &Trackbar{name: name, parent: w}\n}\n\n// GetPos returns the trackbar position.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga122632e9e91b9ec06943472c55d9cda8\nfunc (t *Trackbar) GetPos() int {\n\tcName := C.CString(t.parent.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(t.name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\treturn int(C.Trackbar_GetPos(cName, tName))\n}\n\n// SetPos sets the trackbar position.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga67d73c4c9430f13481fd58410d01bd8d\nfunc (t *Trackbar) SetPos(pos int) {\n\tcName := C.CString(t.parent.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(t.name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\tC.Trackbar_SetPos(cName, tName, C.int(pos))\n}\n\n// SetMin sets the trackbar minimum position.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#gabe26ffe8d2b60cc678895595a581b7aa\nfunc (t *Trackbar) SetMin(pos int) {\n\tcName := C.CString(t.parent.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(t.name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\tC.Trackbar_SetMin(cName, tName, C.int(pos))\n}\n\n// SetMax sets the trackbar maximum position.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dfc/group__highgui.html#ga7e5437ccba37f1154b65210902fc4480\nfunc (t *Trackbar) SetMax(pos int) {\n\tcName := C.CString(t.parent.name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\ttName := C.CString(t.name)\n\tdefer C.free(unsafe.Pointer(tName))\n\n\tC.Trackbar_SetMax(cName, tName, C.int(pos))\n}\n\n//export go_onmouse_dispatcher\nfunc go_onmouse_dispatcher(event C.int, x C.int, y C.int, flags C.int, userdata unsafe.Pointer) {\n\n\tc_winname := (*C.char)(unsafe.Pointer(userdata))\n\twinName := C.GoString(c_winname)\n\tinfo, exists := onMouseHandlers[winName]\n\tif !exists {\n\t\treturn\n\t}\n\tinfo.fn(int(event), int(x), int(y), int(flags), info.userdata)\n}\n\nfunc (w *Window) SetMouseHandler(onMOuse MouseHandlerFunc, userdata interface{}) {\n\tc_winname := C.CString(w.name)\n\n\tonMouseHandlers[w.name] = mouseHandlerInfo{\n\t\tc_name_ptr: c_winname,\n\t\tfn:         onMOuse,\n\t\tuserdata:   userdata,\n\t}\n\n\tC.Window_SetMouseCallback(c_winname, C.mouse_callback(C.go_onmouse_dispatcher))\n}\n"
  },
  {
    "path": "highgui_gocv.h",
    "content": "#ifndef _OPENCV3_HIGHGUI_H_\n#define _OPENCV3_HIGHGUI_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\ntypedef void(*mouse_callback) (int event, int x, int y, int flags, void *userdata);\n\n/* typedef struct mouse_callback_userdata {\n    char* winname;\n    void* userdata;\n} mouse_callback_userdata; */\n\nvoid Window_SetMouseCallback(char* winname, mouse_callback on_mouse);\n\n// Window\nvoid Window_New(const char* winname, int flags);\nvoid Window_Close(const char* winname);\nOpenCVResult Window_IMShow(const char* winname, Mat mat);\ndouble Window_GetProperty(const char* winname, int flag);\nOpenCVResult Window_SetProperty(const char* winname, int flag, double value);\nOpenCVResult Window_SetTitle(const char* winname, const char* title);\nint Window_WaitKey(int);\nint Window_WaitKeyEx(int);\nint Window_PollKey(void);\nOpenCVResult Window_Move(const char* winname, int x, int y);\nOpenCVResult Window_Resize(const char* winname, int width, int height);\nstruct Rect Window_SelectROI(const char* winname, Mat img);\nstruct Rects Window_SelectROIs(const char* winname, Mat img);\n\n// Trackbar\nvoid Trackbar_Create(const char* winname, const char* trackname, int max);\nvoid Trackbar_CreateWithValue(const char* winname, const char* trackname, int* value, int max);\nint Trackbar_GetPos(const char* winname, const char* trackname);\nvoid Trackbar_SetPos(const char* winname, const char* trackname, int pos);\nvoid Trackbar_SetMin(const char* winname, const char* trackname, int pos);\nvoid Trackbar_SetMax(const char* winname, const char* trackname, int pos);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_HIGHGUI_H_\n"
  },
  {
    "path": "highgui_onmouse_test.go",
    "content": "// Do not run these tests on mac OS X. They fail with errors suggesting the GUI\n// should only be touched from the main thread.\n//go:build !darwin && (!gocv_specific_modules || (gocv_specific_modules && gocv_highgui))\n\npackage gocv\n\nimport (\n\t\"testing\"\n)\n\ntype mouseHandlerUserData struct {\n\tname string\n}\n\nfunc mouseHandler(event int, x int, y int, flags int, userdata interface{}) {}\n\nfunc TestMouseHandler(t *testing.T) {\n\twindowName := \"mouse\"\n\n\tw := NewWindow(windowName)\n\tdefer w.Close()\n\n\tudata := mouseHandlerUserData{\n\t\tname: \"gocv\",\n\t}\n\n\tw.SetMouseHandler(mouseHandler, &udata)\n}\n"
  },
  {
    "path": "highgui_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_highgui)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"highgui_gocv.h\"\n*/\nimport \"C\"\n\nfunc (c WindowFlag) String() string {\n\tswitch c {\n\tcase WindowNormal:\n\t\treturn \"window-normal\"\n\tcase WindowFullscreen:\n\t\treturn \"window-fullscreen\"\n\tcase WindowFreeRatio:\n\t\treturn \"window-free-ratio\"\n\t}\n\treturn \"\"\n}\n\nfunc (c WindowPropertyFlag) String() string {\n\tswitch c {\n\tcase WindowPropertyFullscreen:\n\t\treturn \"window-property-fullscreen\"\n\tcase WindowPropertyAutosize:\n\t\treturn \"window-property-autosize\"\n\tcase WindowPropertyAspectRatio:\n\t\treturn \"window-property-aspect-ratio\"\n\tcase WindowPropertyOpenGL:\n\t\treturn \"window-property-opengl\"\n\tcase WindowPropertyVisible:\n\t\treturn \"window-property-visible\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "highgui_test.go",
    "content": "// Do not run these tests on mac OS X. They fail with errors suggesting the GUI\n// should only be touched from the main thread.\n//go:build !darwin && (!gocv_specific_modules || (gocv_specific_modules && gocv_highgui))\n\npackage gocv\n\nimport (\n\t\"testing\"\n)\n\nfunc TestWindow(t *testing.T) {\n\twindow := NewWindow(\"test\")\n\tif window == nil {\n\t\tt.Error(\"Unable to create Window\")\n\t}\n\tif window.name != \"test\" {\n\t\tt.Error(\"Invalid Window name\")\n\t}\n\tval := window.WaitKey(1)\n\tif val != -1 {\n\t\tt.Error(\"Invalid WaitKey\")\n\t}\n\tif !window.IsOpen() {\n\t\tt.Error(\"Window should have been open\")\n\t}\n\n\twindow.SetWindowProperty(WindowPropertyFullscreen, WindowFullscreen)\n\n\tprop := WindowFlag(window.GetWindowProperty(WindowPropertyFullscreen))\n\tif prop != WindowFullscreen {\n\t\tt.Error(\"Window property should have been fullscreen\")\n\t}\n\n\twindow.SetWindowTitle(\"My new title\")\n\n\twindow.MoveWindow(100, 100)\n\n\twindow.ResizeWindow(100, 100)\n\n\twindow.Close()\n\tif window.IsOpen() {\n\t\tt.Error(\"Window should have been closed\")\n\t}\n}\n\nfunc TestIMShow(t *testing.T) {\n\twindow := NewWindow(\"imshow\")\n\tif window == nil {\n\t\tt.Error(\"Unable to create IMShow Window\")\n\t}\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMShow\")\n\t}\n\tdefer img.Close()\n\n\t// TODO: some way to determine if the call succeeded\n\twindow.IMShow(img)\n\n\tval := WaitKey(1)\n\tif val != -1 {\n\t\tt.Error(\"Invalid for IMShow\")\n\t}\n\n\twindow.Close()\n\tif window.IsOpen() {\n\t\tt.Error(\"IMShow window should have been closed\")\n\t}\n}\n\nfunc TestSelectROI(t *testing.T) {\n\tt.Skip(\"TODO: figure out how to implement a test that can exercise the GUI\")\n}\n\nfunc TestSelectROIs(t *testing.T) {\n\tt.Skip(\"TODO: figure out how to implement a test that can exercise the GUI\")\n}\n\nfunc TestTrackbar(t *testing.T) {\n\twindow := NewWindow(\"trackbar\")\n\tdefer window.Close()\n\n\ttracker := window.CreateTrackbar(\"trackme\", 100)\n\tif tracker.GetPos() != 0 {\n\t\tt.Error(\"Trackbar pos should have been 0\")\n\t}\n\n\ttracker.SetMin(10)\n\ttracker.SetMax(150)\n\ttracker.SetPos(50)\n\n\tif tracker.GetPos() != 50 {\n\t\tt.Error(\"Trackbar pos should have been 50\")\n\t}\n}\n\nfunc TestTrackbarWithValue(t *testing.T) {\n\twindow := NewWindow(\"trackbar\")\n\tdefer window.Close()\n\n\tvalue := 20\n\ttracker := window.CreateTrackbarWithValue(\"trackme\", &value, 100)\n\tif tracker.GetPos() != 20 {\n\t\tt.Error(\"Trackbar pos should have been 20\")\n\t}\n\n\ttracker.SetPos(50)\n\n\tif value != 50 {\n\t\tt.Error(\"Trackbar pos should have been 50\")\n\t}\n}\n\nfunc TestPollKey(t *testing.T) {\n\n\tw := NewWindow(\"polly\")\n\tdefer w.Close()\n\n\tif v := w.PollKey(); v != -1 {\n\t\tt.Errorf(\"got %d want -1\", v)\n\t}\n}\n\nfunc TestWaitKeyEx(t *testing.T) {\n\n\tw := NewWindow(\"wait\")\n\tdefer w.Close()\n\n\tif w.WaitKeyEx(1) != -1 {\n\t\tt.Error(\"WaitKeyEx failed!\")\n\t}\n}\n"
  },
  {
    "path": "imgcodecs.cpp",
    "content": "#include <stdlib.h>\n#include \"imgcodecs.h\"\n\n// Image\nMat Image_IMRead(const char* filename, int flags) {\n    try {\n        cv::Mat img = cv::imread(filename, flags);\n        return new cv::Mat(img);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMats Image_IMReadMulti(const char* filename, int flags) {\n    try {\n        std::vector<cv::Mat> dst;\n        Mats m = Mats();\n    \n        bool b = cv::imreadmulti(filename, dst, flags);\n        if (b) {\n            m.mats = new Mat[dst.size()];\n            for (size_t i = 0; i < dst.size(); ++i) {\n                m.mats[i] = new cv::Mat(dst[i]);\n            }\n            m.length = (int)dst.size();        \n        }\n    \n        return m;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return Mats();\n    }\n}\n\nMats Image_IMReadMulti_WithParams(const char* filename, int start, int count, int flags) {\n    try {\n        std::vector<cv::Mat> dst;\n        auto m = Mats();\n        \n        auto b = cv::imreadmulti(filename, dst, start, count, flags);\n        if (b) {\n            m.mats = new Mat[dst.size()];\n            for (size_t i = 0; i < dst.size(); ++i) {\n                m.mats[i] = new cv::Mat(dst[i]);\n            }\n            m.length = (int)dst.size();        \n        }\n    \n        return m;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return Mats();\n    }\n}\n\n\nbool Image_IMWrite(const char* filename, Mat img) {\n    try {\n        return cv::imwrite(filename, *img);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool Image_IMWrite_WithParams(const char* filename, Mat img, IntVector params) {\n    try {\n        std::vector<int> compression_params;\n\n        for (int i = 0, *v = params.val; i < params.length; ++v, ++i) {\n            compression_params.push_back(*v);\n        }\n    \n        return cv::imwrite(filename, *img, compression_params);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult Image_IMEncode(const char* fileExt, Mat img, void* vector) {\n    try {\n        auto vectorPtr = reinterpret_cast<std::vector<uchar> *>(vector);\n        cv::imencode(fileExt, *img, *vectorPtr);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Image_IMEncode_WithParams(const char* fileExt, Mat img, IntVector params, void* vector) {\n    try {\n        auto vectorPtr = reinterpret_cast<std::vector<uchar> *>(vector);\n        std::vector<int> compression_params;\n    \n        for (int i = 0, *v = params.val; i < params.length; ++v, ++i) {\n            compression_params.push_back(*v);\n        }\n    \n        cv::imencode(fileExt, *img, *vectorPtr, compression_params);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat Image_IMDecode(ByteArray buf, int flags) {\n    try {\n        std::vector<uchar> data(buf.data, buf.data + buf.length);\n        cv::Mat img = cv::imdecode(data, flags);\n        return new cv::Mat(img);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult Image_IMDecodeIntoMat(ByteArray buf, int flags, Mat dest) {\n    try {\n        std::vector<uchar> data(buf.data, buf.data + buf.length);\n        cv::imdecode(data, flags, dest);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "imgcodecs.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include \"imgcodecs.h\"\n*/\nimport \"C\"\nimport (\n\t\"unsafe\"\n)\n\n// IMReadFlag is one of the valid flags to use for the IMRead function.\ntype IMReadFlag int\n\nconst (\n\t// IMReadUnchanged return the loaded image as is (with alpha channel,\n\t// otherwise it gets cropped).\n\tIMReadUnchanged IMReadFlag = -1\n\n\t// IMReadGrayScale always convert image to the single channel\n\t// grayscale image.\n\tIMReadGrayScale IMReadFlag = 0\n\n\t// IMReadColor always converts image to the 3 channel BGR color image.\n\tIMReadColor IMReadFlag = 1\n\n\t// IMReadAnyDepth returns 16-bit/32-bit image when the input has the corresponding\n\t// depth, otherwise convert it to 8-bit.\n\tIMReadAnyDepth IMReadFlag = 2\n\n\t// IMReadAnyColor the image is read in any possible color format.\n\tIMReadAnyColor IMReadFlag = 4\n\n\t// IMReadLoadGDAL uses the gdal driver for loading the image.\n\tIMReadLoadGDAL IMReadFlag = 8\n\n\t// IMReadReducedGrayscale2 always converts image to the single channel grayscale image\n\t// and the image size reduced 1/2.\n\tIMReadReducedGrayscale2 IMReadFlag = 16\n\n\t// IMReadReducedColor2 always converts image to the 3 channel BGR color image and the\n\t// image size reduced 1/2.\n\tIMReadReducedColor2 IMReadFlag = 17\n\n\t// IMReadReducedGrayscale4 always converts image to the single channel grayscale image and\n\t// the image size reduced 1/4.\n\tIMReadReducedGrayscale4 IMReadFlag = 32\n\n\t// IMReadReducedColor4 always converts image to the 3 channel BGR color image and\n\t// the image size reduced 1/4.\n\tIMReadReducedColor4 IMReadFlag = 33\n\n\t// IMReadReducedGrayscale8 always convert image to the single channel grayscale image and\n\t// the image size reduced 1/8.\n\tIMReadReducedGrayscale8 IMReadFlag = 64\n\n\t// IMReadReducedColor8 always convert image to the 3 channel BGR color image and the\n\t// image size reduced 1/8.\n\tIMReadReducedColor8 IMReadFlag = 65\n\n\t// IMReadIgnoreOrientation do not rotate the image according to EXIF's orientation flag.\n\tIMReadIgnoreOrientation IMReadFlag = 128\n)\n\n// TODO: Define IMWriteFlag type?\n\nconst (\n\t//IMWriteJpegQuality is the quality from 0 to 100 for JPEG (the higher is the better). Default value is 95.\n\tIMWriteJpegQuality = 1\n\n\t// IMWriteJpegProgressive enables JPEG progressive feature, 0 or 1, default is False.\n\tIMWriteJpegProgressive = 2\n\n\t// IMWriteJpegOptimize enables JPEG optimization, 0 or 1, default is False.\n\tIMWriteJpegOptimize = 3\n\n\t// IMWriteJpegRstInterval is the JPEG restart interval, 0 - 65535, default is 0 - no restart.\n\tIMWriteJpegRstInterval = 4\n\n\t// IMWriteJpegLumaQuality separates luma quality level, 0 - 100, default is 0 - don't use.\n\tIMWriteJpegLumaQuality = 5\n\n\t// IMWriteJpegChromaQuality separates chroma quality level, 0 - 100, default is 0 - don't use.\n\tIMWriteJpegChromaQuality = 6\n\n\t// IMWritePngCompression is the compression level from 0 to 9 for PNG. A\n\t// higher value means a smaller size and longer compression time.\n\t// If specified, strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY).\n\t// Default value is 1 (best speed setting).\n\tIMWritePngCompression = 16\n\n\t// IMWritePngStrategy is one of cv::IMWritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE.\n\tIMWritePngStrategy = 17\n\n\t// IMWritePngBilevel is the binary level PNG, 0 or 1, default is 0.\n\tIMWritePngBilevel = 18\n\n\t// IMWritePxmBinary for PPM, PGM, or PBM can be a binary format flag, 0 or 1. Default value is 1.\n\tIMWritePxmBinary = 32\n\n\t// IMWriteWebpQuality is the quality from 1 to 100 for WEBP (the higher is\n\t// the better). By default (without any parameter) and for quality above\n\t// 100 the lossless compression is used.\n\tIMWriteWebpQuality = 64\n\n\t// IMWritePamTupletype sets the TUPLETYPE field to the corresponding string\n\t// value that is defined for the format.\n\tIMWritePamTupletype = 128\n\n\t// IMWritePngStrategyDefault is the value to use for normal data.\n\tIMWritePngStrategyDefault = 0\n\n\t// IMWritePngStrategyFiltered is the value to use for data produced by a\n\t// filter (or predictor). Filtered data consists mostly of small values\n\t// with a somewhat random distribution. In this case, the compression\n\t// algorithm is tuned to compress them better.\n\tIMWritePngStrategyFiltered = 1\n\n\t// IMWritePngStrategyHuffmanOnly forces Huffman encoding only (no string match).\n\tIMWritePngStrategyHuffmanOnly = 2\n\n\t// IMWritePngStrategyRle is the value to use to limit match distances to\n\t// one (run-length encoding).\n\tIMWritePngStrategyRle = 3\n\n\t// IMWritePngStrategyFixed is the value to prevent the use of dynamic\n\t// Huffman codes, allowing for a simpler decoder for special applications.\n\tIMWritePngStrategyFixed = 4\n)\n\n// IMRead reads an image from a file into a Mat.\n// The flags param is one of the IMReadFlag flags.\n// If the image cannot be read (because of missing file, improper permissions,\n// unsupported or invalid format), the function returns an empty Mat.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56\nfunc IMRead(name string, flags IMReadFlag) Mat {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn newMat(C.Image_IMRead(cName, C.int(flags)))\n}\n\n// IMReadMulti reads multi-page image from a file into a []Mat.\n// The flags param is one of the IMReadFlag flags.\n// If the image cannot be read (because of missing file, improper permissions,\n// unsupported or invalid format), the function returns an empty []Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html#gaaeb5e219c706fd6aa1ec6cf17b172080\nfunc IMReadMulti(name string, flags IMReadFlag) []Mat {\n\tvar mats []Mat\n\tmultiRead := C.struct_Mats{}\n\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tmultiRead = C.Image_IMReadMulti(cName, C.int(flags))\n\tdefer C.Mats_Close(multiRead)\n\n\tif multiRead.length > C.int(0) {\n\t\tmats = make([]Mat, multiRead.length)\n\t\tfor i := 0; i < int(multiRead.length); i++ {\n\t\t\tmats[i].p = C.Mats_get(multiRead, C.int(i))\n\t\t}\n\t}\n\treturn mats\n}\n\n// IMReadMulti reads multi-page image from a file into a []Mat.\n// The flags param is one of the IMReadFlag flags.\n// If the image cannot be read (because of missing file, improper permissions,\n// unsupported or invalid format), the function returns an empty []Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html#ga55e88dc40b65807cfbe2c62d27f7fdf9\nfunc IMReadMulti_WithParams(name string, start int, count int, flags IMReadFlag) []Mat {\n\tvar mats []Mat\n\tmultiRead := C.struct_Mats{}\n\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tmultiRead = C.Image_IMReadMulti_WithParams(cName, C.int(start), C.int(count), C.int(flags))\n\tdefer C.Mats_Close(multiRead)\n\n\tif multiRead.length > C.int(0) {\n\t\tmats = make([]Mat, multiRead.length)\n\t\tfor i := 0; i < int(multiRead.length); i++ {\n\t\t\tmats[i].p = C.Mats_get(multiRead, C.int(i))\n\t\t}\n\t}\n\treturn mats\n}\n\n// IMWrite writes a Mat to an image file.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce\nfunc IMWrite(name string, img Mat) bool {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\treturn bool(C.Image_IMWrite(cName, img.p))\n}\n\n// IMWriteWithParams writes a Mat to an image file. With that func you can\n// pass compression parameters.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#gabbc7ef1aa2edfaa87772f1202d67e0ce\nfunc IMWriteWithParams(name string, img Mat, params []int) bool {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tcparams := []C.int{}\n\n\tfor _, v := range params {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\n\tparamsVector := C.struct_IntVector{}\n\tparamsVector.val = (*C.int)(&cparams[0])\n\tparamsVector.length = (C.int)(len(cparams))\n\n\treturn bool(C.Image_IMWrite_WithParams(cName, img.p, paramsVector))\n}\n\n// FileExt represents a file extension.\ntype FileExt string\n\nconst (\n\t// PNGFileExt is the file extension for PNG.\n\tPNGFileExt FileExt = \".png\"\n\t// JPEGFileExt is the file extension for JPEG.\n\tJPEGFileExt FileExt = \".jpg\"\n\t// GIFFileExt is the file extension for GIF.\n\tGIFFileExt FileExt = \".gif\"\n)\n\n// IMEncode encodes an image Mat into a memory buffer.\n// This function compresses the image and stores it in the returned memory buffer,\n// using the image format passed in in the form of a file extension string.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63\nfunc IMEncode(fileExt FileExt, img Mat) (buf *NativeByteBuffer, err error) {\n\tcfileExt := C.CString(string(fileExt))\n\tdefer C.free(unsafe.Pointer(cfileExt))\n\n\tbuffer := newNativeByteBuffer()\n\tres := C.Image_IMEncode(cfileExt, img.Ptr(), buffer.nativePointer())\n\treturn buffer, OpenCVResult(res)\n}\n\n// IMEncodeWithParams encodes an image Mat into a memory buffer.\n// This function compresses the image and stores it in the returned memory buffer,\n// using the image format passed in in the form of a file extension string.\n//\n// Usage example:\n//\n//\tbuffer, err := gocv.IMEncodeWithParams(gocv.JPEGFileExt, img, []int{gocv.IMWriteJpegQuality, quality})\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga461f9ac09887e47797a54567df3b8b63\nfunc IMEncodeWithParams(fileExt FileExt, img Mat, params []int) (buf *NativeByteBuffer, err error) {\n\tcfileExt := C.CString(string(fileExt))\n\tdefer C.free(unsafe.Pointer(cfileExt))\n\n\tcparams := []C.int{}\n\n\tfor _, v := range params {\n\t\tcparams = append(cparams, C.int(v))\n\t}\n\n\tparamsVector := C.struct_IntVector{}\n\tparamsVector.val = (*C.int)(&cparams[0])\n\tparamsVector.length = (C.int)(len(cparams))\n\n\tb := newNativeByteBuffer()\n\tres := C.Image_IMEncode_WithParams(cfileExt, img.Ptr(), paramsVector, b.nativePointer())\n\treturn b, OpenCVResult(res)\n}\n\n// IMDecode reads an image from a buffer in memory.\n// The function IMDecode reads an image from the specified buffer in memory.\n// If the buffer is too short or contains invalid data, the function\n// returns an empty matrix.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e\nfunc IMDecode(buf []byte, flags IMReadFlag) (Mat, error) {\n\tdata, err := toByteArray(buf)\n\tif err != nil {\n\t\treturn Mat{}, err\n\t}\n\treturn newMat(C.Image_IMDecode(*data, C.int(flags))), LastExceptionError()\n}\n\n// IMDecodeIntoMat reads an image from a buffer in memory into a matrix.\n// The function IMDecodeIntoMat reads an image from the specified buffer in memory.\n// If the buffer is too short or contains invalid data, the function\n// returns an error\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html#ga5a0acefe5cbe0a81e904e452ec7ca733\nfunc IMDecodeIntoMat(buf []byte, flags IMReadFlag, dest *Mat) error {\n\tdata, err := toByteArray(buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn OpenCVResult(C.Image_IMDecodeIntoMat(*data, C.int(flags), dest.p))\n}\n"
  },
  {
    "path": "imgcodecs.h",
    "content": "#ifndef _OPENCV3_IMGCODECS_H_\n#define _OPENCV3_IMGCODECS_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\nMat Image_IMRead(const char* filename, int flags);\nMats Image_IMReadMulti(const char* filename, int flags);\nMats Image_IMReadMulti_WithParams(const char* filename, int start, int count, int flags);\nbool Image_IMWrite(const char* filename, Mat img);\nbool Image_IMWrite_WithParams(const char* filename, Mat img, IntVector params);\nOpenCVResult Image_IMEncode(const char* fileExt, Mat img, void* vector);\nOpenCVResult Image_IMEncode_WithParams(const char* fileExt, Mat img, IntVector params, void* vector);\nMat Image_IMDecode(ByteArray buf, int flags);\nOpenCVResult Image_IMDecodeIntoMat(ByteArray buf, int flag, Mat dest);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_IMGCODECS_H_\n"
  },
  {
    "path": "imgcodecs_test.go",
    "content": "package gocv\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"testing\"\n)\n\nfunc TestIMRead(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMRead\")\n\t}\n}\n\nfunc TestIMWrite(t *testing.T) {\n\tdir, _ := ioutil.TempDir(\"\", \"gocvtests\")\n\ttmpfn := filepath.Join(dir, \"test.jpg\")\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in IMWrite test\")\n\t}\n\n\tresult := IMWrite(tmpfn, img)\n\tif !result {\n\t\tt.Error(\"Invalid write of Mat in IMWrite test\")\n\t}\n}\n\nfunc TestIMWriteWithParams(t *testing.T) {\n\tdir, _ := ioutil.TempDir(\"\", \"gocvtests\")\n\ttmpfn := filepath.Join(dir, \"test.jpg\")\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in IMWrite test\")\n\t}\n\n\tresult := IMWriteWithParams(tmpfn, img, []int{IMWriteJpegQuality, 60})\n\tif !result {\n\t\tt.Error(\"Invalid write of Mat in IMWrite test\")\n\t}\n}\n\nfunc TestIMEncode(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMEncode test\")\n\t}\n\n\tbuf, err := IMEncode(PNGFileExt, img)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer buf.Close()\n\tbytes := buf.GetBytes()\n\tif len(bytes) < 43000 {\n\t\tt.Errorf(\"Wrong buffer size in IMEncode test. Should have been %v\\n\", len(bytes))\n\t}\n}\n\nfunc ExampleIMEncodeWithParams() {\n\timg := IMRead(path.Join(os.Getenv(\"GOPATH\"), \"src/gocv.io/x/gocv/images/face-detect.jpg\"), IMReadColor)\n\tif img.Empty() {\n\t\tlog.Fatal(\"Invalid Mat\")\n\t}\n\n\timgHandler := func(w http.ResponseWriter, req *http.Request) {\n\t\tquality := 75\n\t\tif q, err := strconv.Atoi(req.URL.Query().Get(\"q\")); err == nil {\n\t\t\tquality = q\n\t\t}\n\t\tbuffer, err := IMEncodeWithParams(JPEGFileExt, img, []int{IMWriteJpegQuality, quality})\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tio.WriteString(w, err.Error())\n\t\t\treturn\n\t\t}\n\t\tdefer buffer.Close()\n\t\tw.Header().Set(\"Content-Type\", \"image/jpeg\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tw.Write(buffer.GetBytes())\n\t}\n\n\thttp.HandleFunc(\"/img\", imgHandler)\n\tfmt.Println(\"Open in browser http://127.0.0.1:8080/img?q=10 where q is a JPEG quality parameter\")\n\tlog.Fatal(http.ListenAndServe(\"127.0.0.1:8080\", nil))\n}\n\nfunc TestIMEncodeWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tdefer img.Close()\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMEncode test\")\n\t}\n\n\tbuf, err := IMEncodeWithParams(JPEGFileExt, img, []int{IMWriteJpegQuality, 75})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer buf.Close()\n\tif buf.Len() < 18000 {\n\t\tt.Errorf(\"Wrong buffer size in IMEncode test. Should have been %v\\n\", buf.Len())\n\t}\n\n\tbuf2, err := IMEncodeWithParams(JPEGFileExt, img, []int{IMWriteJpegQuality, 100})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer buf2.Close()\n\tif buf2.Len() < 18000 {\n\t\tt.Errorf(\"Wrong buffer size in IMEncode test. Should have been %v\\n\", buf2.Len())\n\t}\n\n\tif buf.Len() >= buf2.Len() {\n\t\tt.Errorf(\"Jpeg quality parameter does not work correctly\\n\")\n\t}\n}\n\nfunc TestIMDecode(t *testing.T) {\n\tcontent, err := ioutil.ReadFile(\"images/face-detect.jpg\")\n\tif err != nil {\n\t\tt.Error(\"Invalid ReadFile in IMDecode\")\n\t}\n\n\tdec, err := IMDecode(content, IMReadColor)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\tif dec.Empty() {\n\t\tt.Error(\"Invalid Mat in IMDecode\")\n\t}\n\tdec.Close()\n\n\tdec, err = IMDecode([]byte{}, IMReadColor)\n\tif err == nil {\n\t\tt.Error(\"Should not decode empty array\")\n\t}\n}\n\nfunc TestIMDecodeIntoMat(t *testing.T) {\n\tmat := NewMat()\n\tdefer mat.Close()\n\tcontent, err := ioutil.ReadFile(\"images/face-detect.jpg\")\n\tif err != nil {\n\t\tt.Error(\"Invalid ReadFile in IMDecode\")\n\t}\n\n\terr = IMDecodeIntoMat(content, IMReadColor, &mat)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\tif mat.Empty() {\n\t\tt.Error(\"Invalid Mat in IMDecode\")\n\t}\n\n}\n\nfunc TestIMDecodeWebp(t *testing.T) {\n\tcontent, err := ioutil.ReadFile(\"images/sample.webp\")\n\tif err != nil {\n\t\tt.Error(\"Invalid ReadFile in IMDecodeWebp\")\n\t}\n\n\tdec, err := IMDecode(content, IMReadColor)\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\tif dec.Empty() {\n\t\tt.Error(\"Invalid Mat in IMDecodeWebp\")\n\t}\n\tdec.Close()\n\n}\n\nfunc TestIMReadMulti(t *testing.T) {\n\n\tmats := IMReadMulti(\"images/multipage.tif\", IMReadAnyColor)\n\n\tfor i, page := range mats {\n\t\tif page.Empty() {\n\t\t\tt.Errorf(\"page %d empty\", i)\n\t\t}\n\t}\n\n}\n\nfunc TestIMReadMulti_WithParams(t *testing.T) {\n\n\tmats := IMReadMulti_WithParams(\"images/multipage.tif\", 2, 3, IMReadAnyColor)\n\n\tfor i, page := range mats {\n\t\tif page.Empty() {\n\t\t\tt.Errorf(\"page %d empty\", i)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "imgproc.cpp",
    "content": "#include \"imgproc.h\"\n\ndouble ArcLength(PointVector curve, bool is_closed) {\n    try {\n        return cv::arcLength(*curve, is_closed);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nPointVector ApproxPolyDP(PointVector curve, double epsilon, bool closed) {\n    try {\n        PointVector approxCurvePts = new std::vector<cv::Point>;\n        cv::approxPolyDP(*curve, *approxCurvePts, epsilon, closed);\n\n        return approxCurvePts;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nOpenCVResult CvtColor(Mat src, Mat dst, int code) {\n    try {\n        cv::cvtColor(*src, *dst, code);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Demosaicing(Mat src, Mat dst, int code) {\n    try {\n        cv::demosaicing(*src, *dst, code);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult EqualizeHist(Mat src, Mat dst) {\n    try {\n        cv::equalizeHist(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CalcHist(struct Mats mats, IntVector chans, Mat mask, Mat hist, IntVector sz, FloatVector rng, bool acc) {\n    std::vector<cv::Mat> images;\n\n    for (int i = 0; i < mats.length; ++i) {\n        images.push_back(*mats.mats[i]);\n    }\n\n    std::vector<int> channels;\n\n    for (int i = 0, *v = chans.val; i < chans.length; ++v, ++i) {\n        channels.push_back(*v);\n    }\n\n    std::vector<int> histSize;\n\n    for (int i = 0, *v = sz.val; i < sz.length; ++v, ++i) {\n        histSize.push_back(*v);\n    }\n\n    std::vector<float> ranges;\n\n    float* f;\n    int i;\n    for (i = 0, f = rng.val; i < rng.length; ++f, ++i) {\n        ranges.push_back(*f);\n    }\n\n    try {\n        cv::calcHist(images, channels, *mask, *hist, histSize, ranges, acc);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CalcBackProject(struct Mats mats, IntVector chans, Mat hist, Mat backProject, FloatVector rng, bool uniform){\n    std::vector<cv::Mat> images;\n\n    for (int i = 0; i < mats.length; ++i) {\n        images.push_back(*mats.mats[i]);\n    }\n\n    std::vector<int> channels;\n    for (int i = 0, *v = chans.val; i < chans.length; ++v, ++i) {\n        channels.push_back(*v);\n    }\n\n    std::vector<float> ranges;\n\n    float* f;\n    int i;\n    for (i = 0, f = rng.val; i < rng.length; ++f, ++i) {\n        ranges.push_back(*f);\n    }\n\n    try {\n        cv::calcBackProject(images, channels, *hist, *backProject, ranges, uniform);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble CompareHist(Mat hist1, Mat hist2, int method) {\n    try {\n        return cv::compareHist(*hist1, *hist2, method);\n    } catch(const cv::Exception& e) {\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat EMD(Mat sig1, Mat sig2, int distType) {\n    try {\n        return cv::EMD(*sig1, *sig2, distType);\n    } catch(const cv::Exception& e) {\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nstruct RotatedRect FitEllipse(PointVector pts)\n{\n    cv::RotatedRect bRect;\n    try {\n        bRect = cv::fitEllipse(*pts);\n    } catch(const cv::Exception& e) {\n        setExceptionInfo(e.code, e.what());\n\n        RotatedRect emptyRect;\n        return emptyRect;\n    }\n\n    Rect r = {bRect.boundingRect().x, bRect.boundingRect().y, bRect.boundingRect().width, bRect.boundingRect().height};\n    Point centrpt = {int(lroundf(bRect.center.x)), int(lroundf(bRect.center.y))};\n    Size szsz = {int(lroundf(bRect.size.width)), int(lroundf(bRect.size.height))};\n\n    cv::Point2f* pts4 = new cv::Point2f[4];\n    bRect.points(pts4);\n    Point* rpts = new Point[4];\n    for (size_t j = 0; j < 4; j++) {\n        Point pt = {int(lroundf(pts4[j].x)), int(lroundf(pts4[j].y))};\n        rpts[j] = pt;\n    }\n\n    delete[] pts4;\n\n    RotatedRect rotRect = {Points{rpts, 4}, r, centrpt, szsz, bRect.angle};\n    return rotRect;\n}\n\nOpenCVResult ConvexHull(PointVector points, Mat hull, bool clockwise, bool returnPoints) {\n    try {\n        cv::convexHull(*points, *hull, clockwise, returnPoints);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ConvexityDefects(PointVector points, Mat hull, Mat result) {\n    try {\n        cv::convexityDefects(*points, *hull, *result);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BilateralFilter(Mat src, Mat dst, int d, double sc, double ss) {\n    try {\n        cv::bilateralFilter(*src, *dst, d, sc, ss);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Blur(Mat src, Mat dst, Size ps) {\n    try {\n        cv::Size sz(ps.width, ps.height);\n        cv::blur(*src, *dst, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BoxFilter(Mat src, Mat dst, int ddepth, Size ps) {\n    try {\n        cv::Size sz(ps.width, ps.height);\n        cv::boxFilter(*src, *dst, ddepth, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult SqBoxFilter(Mat src, Mat dst, int ddepth, Size ps) {\n    try {\n        cv::Size sz(ps.width, ps.height);\n        cv::sqrBoxFilter(*src, *dst, ddepth, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Dilate(Mat src, Mat dst, Mat kernel) {\n    try {\n        cv::dilate(*src, *dst, *kernel);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult DilateWithParams(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) {\n    try {\n        cv::Point pt1(anchor.x, anchor.y);\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n\n        cv::dilate(*src, *dst, *kernel, pt1, iterations, borderType, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult DistanceTransform(Mat src, Mat dst, Mat labels, int distanceType, int maskSize, int labelType) {\n    try {\n        cv::distanceTransform(*src, *dst, *labels, distanceType, maskSize, labelType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Erode(Mat src, Mat dst, Mat kernel) {\n    try {\n        cv::erode(*src, *dst, *kernel);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ErodeWithParams(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType) {\n    try {\n        cv::Point pt1(anchor.x, anchor.y);\n\n        cv::erode(*src, *dst, *kernel, pt1, iterations, borderType, cv::morphologyDefaultBorderValue());\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ErodeWithParamsAndBorderValue(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue) {\n    try {\n        cv::Point pt1(anchor.x, anchor.y);\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n\n        cv::erode(*src, *dst, *kernel, pt1, iterations, borderType, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult MatchTemplate(Mat image, Mat templ, Mat result, int method, Mat mask) {\n    try {\n        cv::matchTemplate(*image, *templ, *result, method, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nstruct Moment Moments(Mat src, bool binaryImage) {\n    try {\n        cv::Moments m = cv::moments(*src, binaryImage);\n        Moment mom = {m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03,\n                      m.mu20, m.mu11, m.mu02, m.mu30, m.mu21, m.mu12, m.mu03,\n                      m.nu20, m.nu11, m.nu02, m.nu30, m.nu21, m.nu12, m.nu03\n                     };\n        return mom;\n    } catch(const cv::Exception& e) {\n        setExceptionInfo(e.code, e.what());\n        Moment mom;\n        return mom;\n    }\n}\n\nOpenCVResult PyrDown(Mat src, Mat dst, Size size, int borderType) {\n    try {\n        cv::Size cvSize(size.width, size.height);\n        cv::pyrDown(*src, *dst, cvSize, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult PyrUp(Mat src, Mat dst, Size size, int borderType) {\n    try {\n        cv::Size cvSize(size.width, size.height);\n        cv::pyrUp(*src, *dst, cvSize, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nstruct Rect BoundingRect(PointVector pts) {\n    cv::Rect bRect;\n    try {\n        bRect = cv::boundingRect(*pts);\n        Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n        return r;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rect r;\n        return r;\n    }\n}\n\nOpenCVResult BoxPoints(RotatedRect rect, Mat boxPts){\n    try {\n        cv::Point2f centerPt(rect.center.x , rect.center.y);\n        cv::Size2f rSize(rect.size.width, rect.size.height);\n        cv::RotatedRect rotatedRectangle(centerPt, rSize, rect.angle);\n        cv::boxPoints(rotatedRectangle, *boxPts);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult BoxPoints2f(RotatedRect2f rect, Mat boxPts){\n    try {\n        cv::Point2f centerPt(rect.center.x , rect.center.y);\n        cv::Size2f rSize(rect.size.width, rect.size.height);\n        cv::RotatedRect rotatedRectangle(centerPt, rSize, rect.angle);\n        cv::boxPoints(rotatedRectangle, *boxPts);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble ContourArea(PointVector pts) {\n    try {\n        return cv::contourArea(*pts);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nstruct RotatedRect MinAreaRect(PointVector pts){\n    try {\n        cv::RotatedRect cvrect = cv::minAreaRect(*pts);\n\n        Point* rpts = new Point[4];\n        cv::Point2f* pts4 = new cv::Point2f[4];\n        cvrect.points(pts4);\n\n        for (size_t j = 0; j < 4; j++) {\n            Point pt = {int(lroundf(pts4[j].x)), int(lroundf(pts4[j].y))};\n            rpts[j] = pt;\n        }\n\n        delete[] pts4;\n\n        cv::Rect bRect = cvrect.boundingRect();\n        Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n        Point centrpt = {int(lroundf(cvrect.center.x)), int(lroundf(cvrect.center.y))};\n        Size szsz = {int(lroundf(cvrect.size.width)), int(lroundf(cvrect.size.height))};\n\n        RotatedRect retrect = {(Contour){rpts, 4}, r, centrpt, szsz, cvrect.angle};\n        return retrect;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        RotatedRect retrect;\n        return retrect;\n    }\n}\n\nstruct RotatedRect2f MinAreaRect2f(PointVector pts){\n    try {\n        cv::RotatedRect cvrect = cv::minAreaRect(*pts);\n\n        Point2f* rpts = new Point2f[4];\n        cv::Point2f* pts4 = new cv::Point2f[4];\n        cvrect.points(pts4);\n\n        for (size_t j = 0; j < 4; j++) {\n            Point2f pt = {pts4[j].x, pts4[j].y};\n            rpts[j] = pt;\n        }\n\n        delete[] pts4;\n\n        cv::Rect bRect = cvrect.boundingRect();\n        Rect r = {bRect.x, bRect.y, bRect.width, bRect.height};\n        Point2f centrpt = {cvrect.center.x, cvrect.center.y};\n        Size2f szsz = {cvrect.size.width, cvrect.size.height};\n\n        RotatedRect2f retrect = {(Contour2f){rpts, 4}, r, centrpt, szsz, cvrect.angle};\n        return retrect;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        RotatedRect2f retrect;\n        return retrect;\n    }\n}\n\nOpenCVResult MinEnclosingCircle(PointVector pts, Point2f* center, float* radius){\n    try {\n        cv::Point2f center2f;\n        cv::minEnclosingCircle(*pts, center2f, *radius);\n        center->x = center2f.x;\n        center->y = center2f.y;\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nPointsVector FindContours(Mat src, Mat hierarchy, int mode, int method) {\n    try {\n        PointsVector contours = new std::vector<std::vector<cv::Point> >;\n        cv::findContours(*src, *contours, *hierarchy, mode, method);\n\n        return contours;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\ndouble PointPolygonTest(PointVector pts, Point pt, bool measureDist) {\n    try {\n        cv::Point2f pt1(pt.x, pt.y);\n\n        return cv::pointPolygonTest(*pts, pt1, measureDist);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nint ConnectedComponents(Mat src, Mat labels, int connectivity, int ltype, int ccltype){\n    try {\n        return cv::connectedComponents(*src, *labels, connectivity, ltype, ccltype);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\n\nint ConnectedComponentsWithStats(Mat src, Mat labels, Mat stats, Mat centroids,\n    int connectivity, int ltype, int ccltype) {\n    try {\n        return cv::connectedComponentsWithStats(*src, *labels, *stats, *centroids, connectivity, ltype, ccltype);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nMat GetStructuringElement(int shape, Size ksize) {\n    try {\n        cv::Size sz(ksize.width, ksize.height);\n        return new cv::Mat(cv::getStructuringElement(shape, sz));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nScalar MorphologyDefaultBorderValue(){\n    try {\n        cv::Scalar cs = cv::morphologyDefaultBorderValue();\n        return (Scalar){cs[0],cs[1],cs[2],cs[3]};\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Scalar scal = Scalar();\n        return scal;\n    }\n}\n\nOpenCVResult MorphologyEx(Mat src, Mat dst, int op, Mat kernel) {\n    try {\n        cv::morphologyEx(*src, *dst, op, *kernel);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult MorphologyExWithParams(Mat src, Mat dst, int op, Mat kernel, Point pt, int iterations, int borderType) {\n    try {\n        cv::Point pt1(pt.x, pt.y);\n        cv::morphologyEx(*src, *dst, op, *kernel, pt1, iterations, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GaussianBlur(Mat src, Mat dst, Size ps, double sX, double sY, int bt) {\n    try {\n        cv::Size sz(ps.width, ps.height);\n        cv::GaussianBlur(*src, *dst, sz, sX, sY, bt);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat GetGaussianKernel(int ksize, double sigma, int ktype){\n    try {\n        return new cv::Mat(cv::getGaussianKernel(ksize, sigma, ktype));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult Laplacian(Mat src, Mat dst, int dDepth, int kSize, double scale, double delta, int borderType) {\n    try {\n        cv::Laplacian(*src, *dst, dDepth, kSize, scale, delta, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Scharr(Mat src, Mat dst, int dDepth, int dx, int dy, double scale, double delta, int borderType) {\n    try {\n        cv::Scharr(*src, *dst, dDepth, dx, dy, scale, delta, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult MedianBlur(Mat src, Mat dst, int ksize) {\n    try {\n        cv::medianBlur(*src, *dst, ksize);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Canny(Mat src, Mat edges, double t1, double t2) {\n    try {\n        cv::Canny(*src, *edges, t1, t2);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CornerSubPix(Mat img, Mat corners, Size winSize, Size zeroZone, TermCriteria criteria) {\n    try {\n        cv::Size wsz(winSize.width, winSize.height);\n        cv::Size zsz(zeroZone.width, zeroZone.height);\n        cv::cornerSubPix(*img, *corners, wsz, zsz, *criteria);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GoodFeaturesToTrack(Mat img, Mat corners, int maxCorners, double quality, double minDist) {\n    try {\n        cv::goodFeaturesToTrack(*img, *corners, maxCorners, quality, minDist);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GrabCut(Mat img, Mat mask, Rect r, Mat bgdModel, Mat fgdModel, int iterCount, int mode) {\n    try {\n        cv::Rect cvRect = cv::Rect(r.x, r.y, r.width, r.height);\n        cv::grabCut(*img, *mask, cvRect, *bgdModel, *fgdModel, iterCount, mode);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughCircles(Mat src, Mat circles, int method, double dp, double minDist) {\n    try {\n        cv::HoughCircles(*src, *circles, method, dp, minDist);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughCirclesWithParams(Mat src, Mat circles, int method, double dp, double minDist,\n                            double param1, double param2, int minRadius, int maxRadius) {\n    try {\n        cv::HoughCircles(*src, *circles, method, dp, minDist, param1, param2, minRadius, maxRadius);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughLines(Mat src, Mat lines, double rho, double theta, int threshold) {\n    try {\n        cv::HoughLines(*src, *lines, rho, theta, threshold);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughLinesP(Mat src, Mat lines, double rho, double theta, int threshold) {\n    try {\n        cv::HoughLinesP(*src, *lines, rho, theta, threshold);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughLinesPWithParams(Mat src, Mat lines, double rho, double theta, int threshold, double minLineLength, double maxLineGap) {\n    try {\n        cv::HoughLinesP(*src, *lines, rho, theta, threshold, minLineLength, maxLineGap);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult HoughLinesPointSet(Mat points, Mat lines, int linesMax, int threshold,\n                        double minRho, double  maxRho, double rhoStep,\n                        double minTheta, double maxTheta, double thetaStep) {\n    try {\n        cv::HoughLinesPointSet(*points, *lines, linesMax, threshold, minRho, maxRho, rhoStep, minTheta, maxTheta, thetaStep );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Integral(Mat src, Mat sum, Mat sqsum, Mat tilted) {\n    try {\n        cv::integral(*src, *sum, *sqsum, *tilted);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble Threshold(Mat src, Mat dst, double thresh, double maxvalue, int typ) {\n    try {\n        return cv::threshold(*src, *dst, thresh, maxvalue, typ);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nOpenCVResult AdaptiveThreshold(Mat src, Mat dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double c) {\n    try {\n        cv::adaptiveThreshold(*src, *dst, maxValue, adaptiveMethod, thresholdType, blockSize, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ArrowedLine(Mat img, Point pt1, Point pt2, Scalar color, int thickness) {\n    try {\n        cv::Point p1(pt1.x, pt1.y);\n        cv::Point p2(pt2.x, pt2.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::arrowedLine(*img, p1, p2, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nbool ClipLine(Size imgSize, Point pt1, Point pt2) {\n    try {\n        cv::Size sz(imgSize.width, imgSize.height);\n        cv::Point p1(pt1.x, pt1.y);\n        cv::Point p2(pt2.x, pt2.y);\n\n        return cv::clipLine(sz, p1, p2);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nOpenCVResult Circle(Mat img, Point center, int radius, Scalar color, int thickness) {\n    try {\n        cv::Point p1(center.x, center.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::circle(*img, p1, radius, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult CircleWithParams(Mat img, Point center, int radius, Scalar color, int thickness, int lineType, int shift) {\n    try {\n        cv::Point p1(center.x, center.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::circle(*img, p1, radius, c, thickness, lineType, shift);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Ellipse(Mat img, Point center, Point axes, double angle, double startAngle, double endAngle, Scalar color, int thickness) {\n    try {\n        cv::Point p1(center.x, center.y);\n        cv::Point p2(axes.x, axes.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::ellipse(*img, p1, p2, angle, startAngle, endAngle, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult EllipseWithParams(Mat img, Point center, Point axes, double angle, double startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift) {\n    try {\n        cv::Point p1(center.x, center.y);\n        cv::Point p2(axes.x, axes.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::ellipse(*img, p1, p2, angle, startAngle, endAngle, c, thickness, lineType, shift);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Line(Mat img, Point pt1, Point pt2, Scalar color, int thickness) {\n    try {\n        cv::Point p1(pt1.x, pt1.y);\n        cv::Point p2(pt2.x, pt2.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::line(*img, p1, p2, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Rectangle(Mat img, Rect r, Scalar color, int thickness) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::rectangle(\n            *img,\n            cv::Point(r.x, r.y),\n            cv::Point(r.x + r.width, r.y + r.height),\n            c,\n            thickness,\n            cv::LINE_AA\n        );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult RectangleWithParams(Mat img, Rect r, Scalar color, int thickness, int lineType, int shift) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::rectangle(\n            *img,\n            cv::Point(r.x, r.y),\n            cv::Point(r.x + r.width, r.y + r.height),\n            c,\n            thickness,\n            lineType,\n            shift\n        );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FillPoly(Mat img, PointsVector pts, Scalar color) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::fillPoly(*img, *pts, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FillPolyWithParams(Mat img, PointsVector pts, Scalar color, int lineType, int shift, Point offset) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::fillPoly(*img, *pts, c, lineType, shift, cv::Point(offset.x, offset.y));\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Polylines(Mat img, PointsVector pts, bool isClosed, Scalar color,int thickness) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n\n        cv::polylines(*img, *pts, isClosed, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nstruct Size GetTextSize(const char* text, int fontFace, double fontScale, int thickness) {\n    try {\n        return GetTextSizeWithBaseline(text, fontFace, fontScale, thickness, NULL);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Size size = {0, 0};\n        return size;\n    }\n}\n\nstruct Size GetTextSizeWithBaseline(const char* text, int fontFace, double fontScale, int thickness, int* baesline) {\n    try {\n        cv::Size sz = cv::getTextSize(text, fontFace, fontScale, thickness, baesline);\n        Size size = {sz.width, sz.height};\n        return size;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Size size = {0, 0};\n        return size;\n    }\n}\n\nOpenCVResult PutText(Mat img, const char* text, Point org, int fontFace, double fontScale, Scalar color, int thickness) {\n    try {\n        cv::Point pt(org.x, org.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::putText(*img, text, pt, fontFace, fontScale, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult PutTextWithParams(Mat img, const char* text, Point org, int fontFace, double fontScale,\n                       Scalar color, int thickness, int lineType, bool bottomLeftOrigin) {\n    try {\n        cv::Point pt(org.x, org.y);\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::putText(*img, text, pt, fontFace, fontScale, c, thickness, lineType, bottomLeftOrigin);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interp) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        cv::resize(*src, *dst, sz, fx, fy, interp);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult GetRectSubPix(Mat src, Size patchSize, Point center, Mat dst) {\n    try {\n        cv::Size sz(patchSize.width, patchSize.height);\n        cv::Point pt(center.x, center.y);\n        cv::getRectSubPix(*src, sz, pt, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat GetRotationMatrix2D(Point center, double angle, double scale) {\n    try {\n        cv::Point pt(center.x, center.y);\n        return new cv::Mat(cv::getRotationMatrix2D(pt, angle, scale));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult WarpAffine(Mat src, Mat dst, Mat m, Size dsize) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        cv::warpAffine(*src, *dst, *m, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult WarpAffineWithParams(Mat src, Mat dst, Mat rot_mat, Size dsize, int flags, int borderMode, Scalar borderValue) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::warpAffine(*src, *dst, *rot_mat, sz, flags, borderMode, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult WarpPerspective(Mat src, Mat dst, Mat m, Size dsize) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        cv::warpPerspective(*src, *dst, *m, sz);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult WarpPerspectiveWithParams(Mat src, Mat dst, Mat rot_mat, Size dsize, int flags, int borderMode, Scalar borderValue) {\n    try {\n        cv::Size sz(dsize.width, dsize.height);\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::warpPerspective(*src, *dst, *rot_mat, sz, flags, borderMode, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Watershed(Mat image, Mat markers) {\n    try {\n        cv::watershed(*image, *markers);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ApplyColorMap(Mat src, Mat dst, int colormap) {\n    try {\n        cv::applyColorMap(*src, *dst, colormap);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult ApplyCustomColorMap(Mat src, Mat dst, Mat colormap) {\n    try {\n        cv::applyColorMap(*src, *dst, *colormap);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMat GetPerspectiveTransform(PointVector src, PointVector dst) {\n    try {\n        std::vector<cv::Point2f> src_pts;\n        copyPointVectorToPoint2fVector(src, &src_pts);\n\n        std::vector<cv::Point2f> dst_pts;\n        copyPointVectorToPoint2fVector(dst, &dst_pts);\n\n        return new cv::Mat(cv::getPerspectiveTransform(src_pts, dst_pts));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat GetPerspectiveTransform2f(Point2fVector src, Point2fVector dst) {\n    try {\n        return new cv::Mat(cv::getPerspectiveTransform(*src, *dst));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat GetAffineTransform(PointVector src, PointVector dst) {\n    try {\n        std::vector<cv::Point2f> src_pts;\n        copyPointVectorToPoint2fVector(src, &src_pts);\n\n        std::vector<cv::Point2f> dst_pts;\n        copyPointVectorToPoint2fVector(dst, &dst_pts);\n\n        return new cv::Mat(cv::getAffineTransform(src_pts, dst_pts));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nMat GetAffineTransform2f(Point2fVector src, Point2fVector dst) {\n    try {\n        return new cv::Mat(cv::getAffineTransform(*src, *dst));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nOpenCVResult DrawContours(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::drawContours(*src, *contours, contourIdx, c, thickness);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult DrawContoursWithParams(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset) {\n    try {\n        cv::Scalar c = cv::Scalar(color.val1, color.val2, color.val3, color.val4);\n        cv::Point offsetPt(offset.x, offset.y);\n\n        std::vector<cv::Vec4i> vecHierarchy;\n        if (hierarchy->empty() == 0) {\n            for (int j = 0; j < hierarchy->cols; ++j) {\n                vecHierarchy.push_back(hierarchy->at<cv::Vec4i>(0, j));\n            }\n        }\n        cv::drawContours(*src, *contours, contourIdx, c, thickness, lineType, vecHierarchy, maxLevel, offsetPt);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) {\n    try {\n        cv::Sobel(*src, *dst, ddepth, dx, dy, ksize, scale, delta, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult SpatialGradient(Mat src, Mat dx, Mat dy, int ksize, int borderType) {\n    try {\n        cv::spatialGradient(*src, *dx, *dy, ksize, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation, int borderMode, Scalar borderValue) {\n    try {\n        cv::Scalar c = cv::Scalar(borderValue.val1, borderValue.val2, borderValue.val3, borderValue.val4);\n        cv::remap(*src, *dst, *map1, *map2, interpolation, borderMode, c);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta, int borderType) {\n    try {\n        cv::Point anchorPt(anchor.x, anchor.y);\n        cv::filter2D(*src, *dst, ddepth, *kernel, anchorPt, delta, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult SepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta, int borderType) {\n    try {\n        cv::Point anchorPt(anchor.x, anchor.y);\n        cv::sepFilter2D(*src, *dst, ddepth, *kernelX, *kernelY, anchorPt, delta, borderType);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult LogPolar(Mat src, Mat dst, Point center, double m, int flags) {\n    try {\n        cv::Point2f centerPt(center.x, center.y);\n        cv::logPolar(*src, *dst, centerPt, m, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FitLine(PointVector pts, Mat line, int distType, double param, double reps, double aeps) {\n    try {\n        cv::fitLine(*pts, *line, distType, param, reps, aeps);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult LinearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags) {\n    try {\n        cv::Point2f centerPt(center.x, center.y);\n        cv::linearPolar(*src, *dst, centerPt, maxRadius, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\ndouble MatchShapes(PointVector contour1, PointVector contour2, int method, double parameter) {\n    try {\n        return cv::matchShapes(*contour1, *contour2, method, parameter);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nCLAHE CLAHE_Create() {\n    try {\n        return new cv::Ptr<cv::CLAHE>(cv::createCLAHE());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nCLAHE CLAHE_CreateWithParams(double clipLimit, Size tileGridSize) {\n    try {\n        cv::Size sz(tileGridSize.width, tileGridSize.height);\n        return new cv::Ptr<cv::CLAHE>(cv::createCLAHE(clipLimit, sz));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid CLAHE_Close(CLAHE c) {\n    delete c;\n}\n\nOpenCVResult CLAHE_Apply(CLAHE c, Mat src, Mat dst) {\n    try {\n        (*c)->apply(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult InvertAffineTransform(Mat src, Mat dst) {\n    try {\n        cv::invertAffineTransform(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nPoint2f PhaseCorrelate(Mat src1, Mat src2, Mat window, double* response) {\n    try {\n        cv::Point2d result = cv::phaseCorrelate(*src1, *src2, *window, response);\n\n        Point2f result2f = {\n            .x = float(result.x),\n            .y = float(result.y),\n        };\n        return result2f;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Point2f result2f = {\n            .x = 0.0,\n            .y = 0.0,\n        };\n        return result2f;\n    }\n}\n\nOpenCVResult CreateHanningWindow(Mat dst, Size size, int typ) {\n    try {\n        cv::Size sz(size.width, size.height);\n        cv::createHanningWindow(*dst, sz, typ);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_Accumulate(Mat src, Mat dst) {\n    try {\n        cv::accumulate(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulateWithMask(Mat src, Mat dst, Mat mask) {\n    try {\n        cv::accumulate(*src, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulateSquare(Mat src, Mat dst) {\n    try {\n        cv::accumulateSquare(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulateSquareWithMask(Mat src, Mat dst, Mat mask) {\n    try {\n        cv::accumulateSquare(*src, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulateProduct(Mat src1, Mat src2, Mat dst) {\n    try {\n        cv::accumulateProduct(*src1, *src2, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulateProductWithMask(Mat src1, Mat src2, Mat dst, Mat mask) {\n    try {\n        cv::accumulateProduct(*src1, *src2, *dst, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulatedWeighted(Mat src, Mat dst, double alpha) {\n    try {\n        cv::accumulateWeighted(*src, *dst, alpha);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Mat_AccumulatedWeightedWithMask(Mat src, Mat dst, double alpha, Mat mask) {\n    try {\n        cv::accumulateWeighted(*src, *dst, alpha, *mask);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "imgproc.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include \"imgproc.h\"\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"image\"\n\t\"image/color\"\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// ArcLength calculates a contour perimeter or a curve length.\n//\n// For further details, please see:\n//\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga8d26483c636be6b35c3ec6335798a47c\nfunc ArcLength(curve PointVector, isClosed bool) float64 {\n\treturn float64(C.ArcLength(curve.p, C.bool(isClosed)))\n}\n\n// ApproxPolyDP approximates a polygonal curve(s) with the specified precision.\n//\n// For further details, please see:\n//\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga0012a5fdaea70b8a9970165d98722b4c\nfunc ApproxPolyDP(curve PointVector, epsilon float64, closed bool) PointVector {\n\treturn PointVector{p: C.ApproxPolyDP(curve.p, C.double(epsilon), C.bool(closed))}\n}\n\n// ConvexHull finds the convex hull of a point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga014b28e56cb8854c0de4a211cb2be656\nfunc ConvexHull(points PointVector, hull *Mat, clockwise bool, returnPoints bool) error {\n\treturn OpenCVResult(C.ConvexHull(points.p, hull.p, C.bool(clockwise), C.bool(returnPoints)))\n}\n\n// ConvexityDefects finds the convexity defects of a contour.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gada4437098113fd8683c932e0567f47ba\nfunc ConvexityDefects(contour PointVector, hull Mat, result *Mat) error {\n\treturn OpenCVResult(C.ConvexityDefects(contour.p, hull.p, result.p))\n}\n\n// CvtColor converts an image from one color space to another.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0\nfunc CvtColor(src Mat, dst *Mat, code ColorConversionCode) error {\n\treturn OpenCVResult(C.CvtColor(src.p, dst.p, C.int(code)))\n}\n\n// Demosaicing converts an image from Bayer pattern to RGB or grayscale.\n// It converts the src Mat image to the dst Mat using the\n// code param containing the desired ColorConversionCode color space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__color__conversions.html#ga57261f12fccf872a2b2d66daf29d5bd0\nfunc Demosaicing(src Mat, dst *Mat, code ColorConversionCode) error {\n\treturn OpenCVResult(C.Demosaicing(src.p, dst.p, C.int(code)))\n}\n\n// EqualizeHist normalizes the brightness and increases the contrast of the image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga7e54091f0c937d49bf84152a16f76d6e\nfunc EqualizeHist(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.EqualizeHist(src.p, dst.p))\n}\n\n// CalcHist Calculates a histogram of a set of images\n//\n// For futher details, please see:\n// https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga6ca1876785483836f72a77ced8ea759a\nfunc CalcHist(src []Mat, channels []int, mask Mat, hist *Mat, size []int, ranges []float64, acc bool) error {\n\tcMatArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcMatArray[i] = r.p\n\t}\n\n\tcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\n\tchansInts := []C.int{}\n\tfor _, v := range channels {\n\t\tchansInts = append(chansInts, C.int(v))\n\t}\n\tchansVector := C.struct_IntVector{}\n\tchansVector.val = (*C.int)(&chansInts[0])\n\tchansVector.length = (C.int)(len(chansInts))\n\n\tsizeInts := []C.int{}\n\tfor _, v := range size {\n\t\tsizeInts = append(sizeInts, C.int(v))\n\t}\n\tsizeVector := C.struct_IntVector{}\n\tsizeVector.val = (*C.int)(&sizeInts[0])\n\tsizeVector.length = (C.int)(len(sizeInts))\n\n\trangeFloats := []C.float{}\n\tfor _, v := range ranges {\n\t\trangeFloats = append(rangeFloats, C.float(v))\n\t}\n\trangeVector := C.struct_FloatVector{}\n\trangeVector.val = (*C.float)(&rangeFloats[0])\n\trangeVector.length = (C.int)(len(rangeFloats))\n\n\treturn OpenCVResult(C.CalcHist(cMats, chansVector, mask.p, hist.p, sizeVector, rangeVector, C.bool(acc)))\n}\n\n// CalcBackProject calculates the back projection of a histogram.\n//\n// For futher details, please see:\n// https://docs.opencv.org/3.4/d6/dc7/group__imgproc__hist.html#ga3a0af640716b456c3d14af8aee12e3ca\nfunc CalcBackProject(src []Mat, channels []int, hist Mat, backProject *Mat, ranges []float64, uniform bool) error {\n\tcMatArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcMatArray[i] = r.p\n\t}\n\n\tcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\n\tchansInts := []C.int{}\n\tfor _, v := range channels {\n\t\tchansInts = append(chansInts, C.int(v))\n\t}\n\tchansVector := C.struct_IntVector{}\n\tchansVector.val = (*C.int)(&chansInts[0])\n\tchansVector.length = (C.int)(len(chansInts))\n\n\trangeFloats := []C.float{}\n\tfor _, v := range ranges {\n\t\trangeFloats = append(rangeFloats, C.float(v))\n\t}\n\trangeVector := C.struct_FloatVector{}\n\trangeVector.val = (*C.float)(&rangeFloats[0])\n\trangeVector.length = (C.int)(len(rangeFloats))\n\n\treturn OpenCVResult(C.CalcBackProject(cMats, chansVector, hist.p, backProject.p, rangeVector, C.bool(uniform)))\n}\n\n// HistCompMethod is the method for Histogram comparison\n// For more information, see https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#ga994f53817d621e2e4228fc646342d386\ntype HistCompMethod int\n\nconst (\n\t// HistCmpCorrel calculates the Correlation\n\tHistCmpCorrel HistCompMethod = 0\n\n\t// HistCmpChiSqr calculates the Chi-Square\n\tHistCmpChiSqr HistCompMethod = 1\n\n\t// HistCmpIntersect calculates the Intersection\n\tHistCmpIntersect HistCompMethod = 2\n\n\t// HistCmpBhattacharya applies the HistCmpBhattacharya by calculating the Bhattacharya distance.\n\tHistCmpBhattacharya HistCompMethod = 3\n\n\t// HistCmpHellinger applies the HistCmpBhattacharya comparison. It is a synonym to HistCmpBhattacharya.\n\tHistCmpHellinger = HistCmpBhattacharya\n\n\t// HistCmpChiSqrAlt applies the Alternative Chi-Square (regularly used for texture comparsion).\n\tHistCmpChiSqrAlt HistCompMethod = 4\n\n\t// HistCmpKlDiv applies the Kullback-Liebler divergence comparison.\n\tHistCmpKlDiv HistCompMethod = 5\n)\n\n// CompareHist Compares two histograms.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd\nfunc CompareHist(hist1 Mat, hist2 Mat, method HistCompMethod) float32 {\n\treturn float32(C.CompareHist(hist1.p, hist2.p, C.int(method)))\n}\n\n// EMD Computes the \"minimal work\" distance between two weighted point configurations.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d6/dc7/group__imgproc__hist.html#ga902b8e60cc7075c8947345489221e0e0\nfunc EMD(signature1, signature2 Mat, typ DistanceTypes) float32 {\n\treturn float32(C.EMD(signature1.p, signature2.p, C.int(typ)))\n}\n\n// ClipLine clips the line against the image rectangle.\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf483cb46ad6b049bc35ec67052ef1c2c\nfunc ClipLine(imgSize image.Point, pt1 image.Point, pt2 image.Point) bool {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(imgSize.X),\n\t\theight: C.int(imgSize.Y),\n\t}\n\n\trPt1 := C.struct_Point{\n\t\tx: C.int(pt1.X),\n\t\ty: C.int(pt1.Y),\n\t}\n\n\trPt2 := C.struct_Point{\n\t\tx: C.int(pt2.X),\n\t\ty: C.int(pt2.Y),\n\t}\n\n\treturn bool(C.ClipLine(pSize, rPt1, rPt2))\n}\n\n// BilateralFilter applies a bilateral filter to an image.\n//\n// Bilateral filtering is described here:\n// http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html\n//\n// BilateralFilter can reduce unwanted noise very well while keeping edges\n// fairly sharp. However, it is very slow compared to most filters.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed\nfunc BilateralFilter(src Mat, dst *Mat, diameter int, sigmaColor float64, sigmaSpace float64) error {\n\treturn OpenCVResult(C.BilateralFilter(src.p, dst.p, C.int(diameter), C.double(sigmaColor), C.double(sigmaSpace)))\n}\n\n// Blur blurs an image Mat using a normalized box filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37\nfunc Blur(src Mat, dst *Mat, ksize image.Point) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(ksize.X),\n\t\theight: C.int(ksize.Y),\n\t}\n\n\treturn OpenCVResult(C.Blur(src.p, dst.p, pSize))\n}\n\n// BoxFilter blurs an image using the box filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3\nfunc BoxFilter(src Mat, dst *Mat, depth int, ksize image.Point) error {\n\tpSize := C.struct_Size{\n\t\theight: C.int(ksize.X),\n\t\twidth:  C.int(ksize.Y),\n\t}\n\treturn OpenCVResult(C.BoxFilter(src.p, dst.p, C.int(depth), pSize))\n}\n\n// SqBoxFilter calculates the normalized sum of squares of the pixel values overlapping the filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga045028184a9ef65d7d2579e5c4bff6c0\nfunc SqBoxFilter(src Mat, dst *Mat, depth int, ksize image.Point) error {\n\tpSize := C.struct_Size{\n\t\theight: C.int(ksize.X),\n\t\twidth:  C.int(ksize.Y),\n\t}\n\treturn OpenCVResult(C.SqBoxFilter(src.p, dst.p, C.int(depth), pSize))\n}\n\n// Dilate dilates an image by using a specific structuring element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c\nfunc Dilate(src Mat, dst *Mat, kernel Mat) error {\n\treturn OpenCVResult(C.Dilate(src.p, dst.p, kernel.p))\n}\n\n// DilateWithParams dilates an image by using a specific structuring element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c\nfunc DilateWithParams(src Mat, dst *Mat, kernel Mat, anchor image.Point, iterations int, borderType BorderType, borderValue color.RGBA) error {\n\tcAnchor := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\n\treturn OpenCVResult(C.DilateWithParams(src.p, dst.p, kernel.p, cAnchor, C.int(iterations), C.int(borderType), bv))\n}\n\n// DistanceTransformLabelTypes are the types of the DistanceTransform algorithm flag\ntype DistanceTransformLabelTypes int\n\nconst (\n\t// DistanceLabelCComp assigns the same label to each connected component of zeros in the source image\n\t// (as well as all the non-zero pixels closest to the connected component).\n\tDistanceLabelCComp DistanceTransformLabelTypes = 0\n\n\t// DistanceLabelPixel assigns its own label to each zero pixel (and all the non-zero pixels closest to it).\n\tDistanceLabelPixel\n)\n\n// DistanceTransformMasks are the marsk sizes for distance transform\ntype DistanceTransformMasks int\n\nconst (\n\t// DistanceMask3 is a mask of size 3\n\tDistanceMask3 DistanceTransformMasks = 0\n\n\t// DistanceMask5 is a mask of size 3\n\tDistanceMask5\n\n\t// DistanceMaskPrecise is not currently supported\n\tDistanceMaskPrecise\n)\n\n// DistanceTransform Calculates the distance to the closest zero pixel for each pixel of the source image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga8a0b7fdfcb7a13dde018988ba3a43042\nfunc DistanceTransform(src Mat, dst *Mat, labels *Mat, distType DistanceTypes, maskSize DistanceTransformMasks, labelType DistanceTransformLabelTypes) error {\n\treturn OpenCVResult(C.DistanceTransform(src.p, dst.p, labels.p, C.int(distType), C.int(maskSize), C.int(labelType)))\n}\n\n// Erode erodes an image by using a specific structuring element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb\nfunc Erode(src Mat, dst *Mat, kernel Mat) error {\n\treturn OpenCVResult(C.Erode(src.p, dst.p, kernel.p))\n}\n\n// ErodeWithParams erodes an image by using a specific structuring element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb\nfunc ErodeWithParams(src Mat, dst *Mat, kernel Mat, anchor image.Point, iterations int, borderType BorderType) error {\n\tcAnchor := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\n\treturn OpenCVResult(C.ErodeWithParams(src.p, dst.p, kernel.p, cAnchor, C.int(iterations), C.int(borderType)))\n}\n\n// ErodeWithParamsAndBorderValue erodes an image by using a specific structuring\n// element. Same as ErodeWithParams but requires an additional borderValue\n// parameter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb\nfunc ErodeWithParamsAndBorderValue(src Mat, dst *Mat, kernel Mat, anchor image.Point, iterations int, borderType BorderType, borderValue Scalar) error {\n\tcAnchor := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.Val1),\n\t\tval2: C.double(borderValue.Val2),\n\t\tval3: C.double(borderValue.Val3),\n\t\tval4: C.double(borderValue.Val4),\n\t}\n\n\treturn OpenCVResult(C.ErodeWithParamsAndBorderValue(src.p, dst.p, kernel.p, cAnchor, C.int(iterations), C.int(borderType), bv))\n}\n\n// RetrievalMode is the mode of the contour retrieval algorithm.\ntype RetrievalMode int\n\nconst (\n\t// RetrievalExternal retrieves only the extreme outer contours.\n\t// It sets `hierarchy[i][2]=hierarchy[i][3]=-1` for all the contours.\n\tRetrievalExternal RetrievalMode = 0\n\n\t// RetrievalList retrieves all of the contours without establishing\n\t// any hierarchical relationships.\n\tRetrievalList RetrievalMode = 1\n\n\t// RetrievalCComp retrieves all of the contours and organizes them into\n\t// a two-level hierarchy. At the top level, there are external boundaries\n\t// of the components. At the second level, there are boundaries of the holes.\n\t// If there is another contour inside a hole of a connected component, it\n\t// is still put at the top level.\n\tRetrievalCComp RetrievalMode = 2\n\n\t// RetrievalTree retrieves all of the contours and reconstructs a full\n\t// hierarchy of nested contours.\n\tRetrievalTree RetrievalMode = 3\n\n\t// RetrievalFloodfill lacks a description in the original header.\n\tRetrievalFloodfill RetrievalMode = 4\n)\n\n// ContourApproximationMode is the mode of the contour approximation algorithm.\ntype ContourApproximationMode int\n\nconst (\n\t// ChainApproxNone stores absolutely all the contour points. That is,\n\t// any 2 subsequent points (x1,y1) and (x2,y2) of the contour will be\n\t// either horizontal, vertical or diagonal neighbors, that is,\n\t// max(abs(x1-x2),abs(y2-y1))==1.\n\tChainApproxNone ContourApproximationMode = 1\n\n\t// ChainApproxSimple compresses horizontal, vertical, and diagonal segments\n\t// and leaves only their end points.\n\t// For example, an up-right rectangular contour is encoded with 4 points.\n\tChainApproxSimple ContourApproximationMode = 2\n\n\t// ChainApproxTC89L1 applies one of the flavors of the Teh-Chin chain\n\t// approximation algorithms.\n\tChainApproxTC89L1 ContourApproximationMode = 3\n\n\t// ChainApproxTC89KCOS applies one of the flavors of the Teh-Chin chain\n\t// approximation algorithms.\n\tChainApproxTC89KCOS ContourApproximationMode = 4\n)\n\n// BoundingRect calculates the up-right bounding rectangle of a point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#gacb413ddce8e48ff3ca61ed7cf626a366\nfunc BoundingRect(contour PointVector) image.Rectangle {\n\tr := C.BoundingRect(contour.p)\n\trect := image.Rect(int(r.x), int(r.y), int(r.x+r.width), int(r.y+r.height))\n\treturn rect\n}\n\n// BoxPoints finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.\n//\n// For further Details, please see:\n// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#gaf78d467e024b4d7936cf9397185d2f5c\nfunc BoxPoints(rect RotatedRect, pts *Mat) error {\n\trPoints := toCPoints(rect.Points)\n\n\trRect := C.struct_Rect{\n\t\tx:      C.int(rect.BoundingRect.Min.X),\n\t\ty:      C.int(rect.BoundingRect.Min.Y),\n\t\twidth:  C.int(rect.BoundingRect.Max.X - rect.BoundingRect.Min.X),\n\t\theight: C.int(rect.BoundingRect.Max.Y - rect.BoundingRect.Min.Y),\n\t}\n\n\trCenter := C.struct_Point{\n\t\tx: C.int(rect.Center.X),\n\t\ty: C.int(rect.Center.Y),\n\t}\n\n\trSize := C.struct_Size{\n\t\twidth:  C.int(rect.Width),\n\t\theight: C.int(rect.Height),\n\t}\n\n\tr := C.struct_RotatedRect{\n\t\tpts:          rPoints,\n\t\tboundingRect: rRect,\n\t\tcenter:       rCenter,\n\t\tsize:         rSize,\n\t\tangle:        C.double(rect.Angle),\n\t}\n\n\treturn OpenCVResult(C.BoxPoints(r, pts.p))\n}\n\n// BoxPoints finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.\n//\n// For further Details, please see:\n// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#gaf78d467e024b4d7936cf9397185d2f5c\nfunc BoxPoints2f(rect RotatedRect2f, pts *Mat) error {\n\trPoints := toCPoints2f(rect.Points)\n\n\trRect := C.struct_Rect{\n\t\tx:      C.int(rect.BoundingRect.Min.X),\n\t\ty:      C.int(rect.BoundingRect.Min.Y),\n\t\twidth:  C.int(rect.BoundingRect.Max.X - rect.BoundingRect.Min.X),\n\t\theight: C.int(rect.BoundingRect.Max.Y - rect.BoundingRect.Min.Y),\n\t}\n\n\trCenter := C.struct_Point2f{\n\t\tx: C.float(rect.Center.X),\n\t\ty: C.float(rect.Center.Y),\n\t}\n\n\trSize := C.struct_Size2f{\n\t\twidth:  C.float(rect.Width),\n\t\theight: C.float(rect.Height),\n\t}\n\n\tr := C.struct_RotatedRect2f{\n\t\tpts:          rPoints,\n\t\tboundingRect: rRect,\n\t\tcenter:       rCenter,\n\t\tsize:         rSize,\n\t\tangle:        C.double(rect.Angle),\n\t}\n\n\treturn OpenCVResult(C.BoxPoints2f(r, pts.p))\n}\n\n// ContourArea calculates a contour area.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#ga2c759ed9f497d4a618048a2f56dc97f1\nfunc ContourArea(contour PointVector) float64 {\n\tresult := C.ContourArea(contour.p)\n\treturn float64(result)\n}\n\ntype RotatedRect struct {\n\tPoints       []image.Point\n\tBoundingRect image.Rectangle\n\tCenter       image.Point\n\tWidth        int\n\tHeight       int\n\tAngle        float64\n}\n\ntype RotatedRect2f struct {\n\tPoints       []Point2f\n\tBoundingRect image.Rectangle\n\tCenter       Point2f\n\tWidth        float32\n\tHeight       float32\n\tAngle        float64\n}\n\n// toPoints converts C.Contour to []image.Points\nfunc toPoints(points C.Contour) []image.Point {\n\tpArray := points.points\n\tpLength := int(points.length)\n\n\tpHdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(pArray)),\n\t\tLen:  pLength,\n\t\tCap:  pLength,\n\t}\n\tsPoints := *(*[]C.Point)(unsafe.Pointer(&pHdr))\n\n\tpoints4 := make([]image.Point, pLength)\n\tfor j, pt := range sPoints {\n\t\tpoints4[j] = image.Pt(int(pt.x), int(pt.y))\n\t}\n\treturn points4\n}\n\n// toPoints2f converts C.Contour2f to []Point2f\nfunc toPoints2f(points C.Contour2f) []Point2f {\n\tpArray := points.points\n\tpLength := int(points.length)\n\n\tpHdr := reflect.SliceHeader{\n\t\tData: uintptr(unsafe.Pointer(pArray)),\n\t\tLen:  pLength,\n\t\tCap:  pLength,\n\t}\n\tsPoints := *(*[]C.Point)(unsafe.Pointer(&pHdr))\n\n\tpoints4 := make([]Point2f, pLength)\n\tfor j, pt := range sPoints {\n\t\tpoints4[j] = NewPoint2f(float32(pt.x), float32(pt.y))\n\t}\n\treturn points4\n}\n\n// MinAreaRect finds a rotated rectangle of the minimum area enclosing the input 2D point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga3d476a3417130ae5154aea421ca7ead9\nfunc MinAreaRect(points PointVector) RotatedRect {\n\tresult := C.MinAreaRect(points.p)\n\tdefer C.Points_Close(result.pts)\n\n\treturn RotatedRect{\n\t\tPoints:       toPoints(result.pts),\n\t\tBoundingRect: image.Rect(int(result.boundingRect.x), int(result.boundingRect.y), int(result.boundingRect.x)+int(result.boundingRect.width), int(result.boundingRect.y)+int(result.boundingRect.height)),\n\t\tCenter:       image.Pt(int(result.center.x), int(result.center.y)),\n\t\tWidth:        int(result.size.width),\n\t\tHeight:       int(result.size.height),\n\t\tAngle:        float64(result.angle),\n\t}\n}\n\n// MinAreaRect finds a rotated rectangle of the minimum area enclosing the input 2D point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga3d476a3417130ae5154aea421ca7ead9\nfunc MinAreaRect2f(points PointVector) RotatedRect2f {\n\tresult := C.MinAreaRect2f(points.p)\n\tdefer C.Points2f_Close(result.pts)\n\n\treturn RotatedRect2f{\n\t\tPoints:       toPoints2f(result.pts),\n\t\tBoundingRect: image.Rect(int(result.boundingRect.x), int(result.boundingRect.y), int(result.boundingRect.x)+int(result.boundingRect.width), int(result.boundingRect.y)+int(result.boundingRect.height)),\n\t\tCenter:       NewPoint2f(float32(result.center.x), float32(result.center.y)),\n\t\tWidth:        float32(result.size.width),\n\t\tHeight:       float32(result.size.height),\n\t\tAngle:        float64(result.angle),\n\t}\n}\n\n// FitEllipse Fits an ellipse around a set of 2D points.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaf259efaad93098103d6c27b9e4900ffa\nfunc FitEllipse(pts PointVector) RotatedRect {\n\tcRect := C.FitEllipse(pts.p)\n\tdefer C.Points_Close(cRect.pts)\n\n\treturn RotatedRect{\n\t\tPoints:       toPoints(cRect.pts),\n\t\tBoundingRect: image.Rect(int(cRect.boundingRect.x), int(cRect.boundingRect.y), int(cRect.boundingRect.x)+int(cRect.boundingRect.width), int(cRect.boundingRect.y)+int(cRect.boundingRect.height)),\n\t\tCenter:       image.Pt(int(cRect.center.x), int(cRect.center.y)),\n\t\tWidth:        int(cRect.size.width),\n\t\tHeight:       int(cRect.size.height),\n\t\tAngle:        float64(cRect.angle),\n\t}\n\n}\n\n// MinEnclosingCircle finds a circle of the minimum area enclosing the input 2D point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.4/d3/dc0/group__imgproc__shape.html#ga8ce13c24081bbc7151e9326f412190f1\nfunc MinEnclosingCircle(pts PointVector) (x, y, radius float32) {\n\tcCenterPoint := C.struct_Point2f{}\n\tvar cRadius C.float\n\tC.MinEnclosingCircle(pts.p, &cCenterPoint, &cRadius)\n\tx, y = float32(cCenterPoint.x), float32(cCenterPoint.y)\n\tradius = float32(cRadius)\n\treturn x, y, radius\n}\n\n// FindContours finds contours in a binary image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga95f5b48d01abc7c2e0732db24689837b\nfunc FindContours(src Mat, mode RetrievalMode, method ContourApproximationMode) PointsVector {\n\thierarchy := NewMat()\n\tdefer hierarchy.Close()\n\treturn FindContoursWithParams(src, &hierarchy, mode, method)\n}\n\n// FindContoursWithParams finds contours in a binary image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga17ed9f5d79ae97bd4c7cf18403e1689a\nfunc FindContoursWithParams(src Mat, hierarchy *Mat, mode RetrievalMode, method ContourApproximationMode) PointsVector {\n\treturn PointsVector{p: C.FindContours(src.p, hierarchy.p, C.int(mode), C.int(method))}\n}\n\n// PointPolygonTest performs a point-in-contour test.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga1a539e8db2135af2566103705d7a5722\nfunc PointPolygonTest(pts PointVector, pt image.Point, measureDist bool) float64 {\n\tcp := C.struct_Point{\n\t\tx: C.int(pt.X),\n\t\ty: C.int(pt.Y),\n\t}\n\treturn float64(C.PointPolygonTest(pts.p, cp, C.bool(measureDist)))\n}\n\n// ConnectedComponentsAlgorithmType specifies the type for ConnectedComponents\ntype ConnectedComponentsAlgorithmType int\n\nconst (\n\t// SAUF algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.\n\tCCL_WU ConnectedComponentsAlgorithmType = 0\n\n\t// BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity.\n\tCCL_DEFAULT ConnectedComponentsAlgorithmType = 1\n\n\t// BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity\n\tCCL_GRANA ConnectedComponentsAlgorithmType = 2\n)\n\n// ConnectedComponents computes the connected components labeled image of boolean image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaedef8c7340499ca391d459122e51bef5\nfunc ConnectedComponents(src Mat, labels *Mat) int {\n\treturn int(C.ConnectedComponents(src.p, labels.p, C.int(8), C.int(MatTypeCV32S), C.int(CCL_DEFAULT)))\n}\n\n// ConnectedComponents computes the connected components labeled image of boolean image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaedef8c7340499ca391d459122e51bef5\nfunc ConnectedComponentsWithParams(src Mat, labels *Mat, conn int, ltype MatType,\n\tccltype ConnectedComponentsAlgorithmType) int {\n\treturn int(C.ConnectedComponents(src.p, labels.p, C.int(conn), C.int(ltype), C.int(ccltype)))\n}\n\n// ConnectedComponentsTypes are the connected components algorithm output formats\ntype ConnectedComponentsTypes int\n\nconst (\n\t//The leftmost (x) coordinate which is the inclusive start of the bounding box in the horizontal direction.\n\tCC_STAT_LEFT ConnectedComponentsTypes = 0\n\n\t//The topmost (y) coordinate which is the inclusive start of the bounding box in the vertical direction.\n\tCC_STAT_TOP ConnectedComponentsTypes = 1\n\n\t// The horizontal size of the bounding box.\n\tCC_STAT_WIDTH ConnectedComponentsTypes = 2\n\n\t// The vertical size of the bounding box.\n\tCC_STAT_HEIGHT ConnectedComponentsTypes = 3\n\n\t// The total area (in pixels) of the connected component.\n\tCC_STAT_AREA ConnectedComponentsTypes = 4\n\n\tCC_STAT_MAX ConnectedComponentsTypes = 5\n)\n\n// ConnectedComponentsWithStats computes the connected components labeled image of boolean\n// image and also produces a statistics output for each label.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga107a78bf7cd25dec05fb4dfc5c9e765f\nfunc ConnectedComponentsWithStats(src Mat, labels *Mat, stats *Mat, centroids *Mat) int {\n\treturn int(C.ConnectedComponentsWithStats(src.p, labels.p, stats.p, centroids.p,\n\t\tC.int(8), C.int(MatTypeCV32S), C.int(CCL_DEFAULT)))\n}\n\n// ConnectedComponentsWithStats computes the connected components labeled image of boolean\n// image and also produces a statistics output for each label.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga107a78bf7cd25dec05fb4dfc5c9e765f\nfunc ConnectedComponentsWithStatsWithParams(src Mat, labels *Mat, stats *Mat, centroids *Mat,\n\tconn int, ltype MatType, ccltype ConnectedComponentsAlgorithmType) int {\n\treturn int(C.ConnectedComponentsWithStats(src.p, labels.p, stats.p, centroids.p, C.int(conn),\n\t\tC.int(ltype), C.int(ccltype)))\n}\n\n// TemplateMatchMode is the type of the template matching operation.\ntype TemplateMatchMode int\n\nconst (\n\t// TmSqdiff maps to TM_SQDIFF\n\tTmSqdiff TemplateMatchMode = 0\n\t// TmSqdiffNormed maps to TM_SQDIFF_NORMED\n\tTmSqdiffNormed TemplateMatchMode = 1\n\t// TmCcorr maps to TM_CCORR\n\tTmCcorr TemplateMatchMode = 2\n\t// TmCcorrNormed maps to TM_CCORR_NORMED\n\tTmCcorrNormed TemplateMatchMode = 3\n\t// TmCcoeff maps to TM_CCOEFF\n\tTmCcoeff TemplateMatchMode = 4\n\t// TmCcoeffNormed maps to TM_CCOEFF_NORMED\n\tTmCcoeffNormed TemplateMatchMode = 5\n)\n\n// MatchTemplate compares a template against overlapped image regions.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be\nfunc MatchTemplate(image Mat, templ Mat, result *Mat, method TemplateMatchMode, mask Mat) error {\n\treturn OpenCVResult(C.MatchTemplate(image.p, templ.p, result.p, C.int(method), mask.p))\n}\n\n// Moments calculates all of the moments up to the third order of a polygon\n// or rasterized shape.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga556a180f43cab22649c23ada36a8a139\nfunc Moments(src Mat, binaryImage bool) map[string]float64 {\n\tr := C.Moments(src.p, C.bool(binaryImage))\n\n\tresult := make(map[string]float64)\n\tresult[\"m00\"] = float64(r.m00)\n\tresult[\"m10\"] = float64(r.m10)\n\tresult[\"m01\"] = float64(r.m01)\n\tresult[\"m20\"] = float64(r.m20)\n\tresult[\"m11\"] = float64(r.m11)\n\tresult[\"m02\"] = float64(r.m02)\n\tresult[\"m30\"] = float64(r.m30)\n\tresult[\"m21\"] = float64(r.m21)\n\tresult[\"m12\"] = float64(r.m12)\n\tresult[\"m03\"] = float64(r.m03)\n\tresult[\"mu20\"] = float64(r.mu20)\n\tresult[\"mu11\"] = float64(r.mu11)\n\tresult[\"mu02\"] = float64(r.mu02)\n\tresult[\"mu30\"] = float64(r.mu30)\n\tresult[\"mu21\"] = float64(r.mu21)\n\tresult[\"mu12\"] = float64(r.mu12)\n\tresult[\"mu03\"] = float64(r.mu03)\n\tresult[\"nu20\"] = float64(r.nu20)\n\tresult[\"nu11\"] = float64(r.nu11)\n\tresult[\"nu02\"] = float64(r.nu02)\n\tresult[\"nu30\"] = float64(r.nu30)\n\tresult[\"nu21\"] = float64(r.nu21)\n\tresult[\"nu12\"] = float64(r.nu12)\n\tresult[\"nu03\"] = float64(r.nu03)\n\n\treturn result\n}\n\n// PyrDown blurs an image and downsamples it.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff\nfunc PyrDown(src Mat, dst *Mat, ksize image.Point, borderType BorderType) error {\n\tpSize := C.struct_Size{\n\t\theight: C.int(ksize.X),\n\t\twidth:  C.int(ksize.Y),\n\t}\n\treturn OpenCVResult(C.PyrDown(src.p, dst.p, pSize, C.int(borderType)))\n}\n\n// PyrUp upsamples an image and then blurs it.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gada75b59bdaaca411ed6fee10085eb784\nfunc PyrUp(src Mat, dst *Mat, ksize image.Point, borderType BorderType) error {\n\tpSize := C.struct_Size{\n\t\theight: C.int(ksize.X),\n\t\twidth:  C.int(ksize.Y),\n\t}\n\treturn OpenCVResult(C.PyrUp(src.p, dst.p, pSize, C.int(borderType)))\n}\n\n// MorphologyDefaultBorder returns \"magic\" border value for erosion and dilation.\n// It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a\nfunc MorphologyDefaultBorderValue() Scalar {\n\tvar scalar C.Scalar = C.MorphologyDefaultBorderValue()\n\treturn NewScalar(float64(scalar.val1), float64(scalar.val2), float64(scalar.val3), float64(scalar.val4))\n}\n\n// MorphologyEx performs advanced morphological transformations.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f\nfunc MorphologyEx(src Mat, dst *Mat, op MorphType, kernel Mat) error {\n\treturn OpenCVResult(C.MorphologyEx(src.p, dst.p, C.int(op), kernel.p))\n}\n\n// MorphologyExWithParams performs advanced morphological transformations.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f\nfunc MorphologyExWithParams(src Mat, dst *Mat, op MorphType, kernel Mat, iterations int, borderType BorderType) error {\n\tpt := C.struct_Point{\n\t\tx: C.int(-1),\n\t\ty: C.int(-1),\n\t}\n\treturn OpenCVResult(C.MorphologyExWithParams(src.p, dst.p, C.int(op), kernel.p, pt, C.int(iterations), C.int(borderType)))\n}\n\n// MorphShape is the shape of the structuring element used for Morphing operations.\ntype MorphShape int\n\nconst (\n\t// MorphRect is the rectangular morph shape.\n\tMorphRect MorphShape = 0\n\n\t// MorphCross is the cross morph shape.\n\tMorphCross MorphShape = 1\n\n\t// MorphEllipse is the ellipse morph shape.\n\tMorphEllipse MorphShape = 2\n)\n\n// GetStructuringElement returns a structuring element of the specified size\n// and shape for morphological operations.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc\nfunc GetStructuringElement(shape MorphShape, ksize image.Point) Mat {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(ksize.X),\n\t\theight: C.int(ksize.Y),\n\t}\n\n\treturn newMat(C.GetStructuringElement(C.int(shape), sz))\n}\n\n// MorphType type of morphological operation.\ntype MorphType int\n\nconst (\n\t// MorphErode operation\n\tMorphErode MorphType = 0\n\n\t// MorphDilate operation\n\tMorphDilate MorphType = 1\n\n\t// MorphOpen operation\n\tMorphOpen MorphType = 2\n\n\t// MorphClose operation\n\tMorphClose MorphType = 3\n\n\t// MorphGradient operation\n\tMorphGradient MorphType = 4\n\n\t// MorphTophat operation\n\tMorphTophat MorphType = 5\n\n\t// MorphBlackhat operation\n\tMorphBlackhat MorphType = 6\n\n\t// MorphHitmiss operation\n\tMorphHitmiss MorphType = 7\n)\n\n// BorderType type of border.\ntype BorderType int\n\nconst (\n\t// BorderConstant border type\n\tBorderConstant BorderType = 0\n\n\t// BorderReplicate border type\n\tBorderReplicate BorderType = 1\n\n\t// BorderReflect border type\n\tBorderReflect BorderType = 2\n\n\t// BorderWrap border type\n\tBorderWrap BorderType = 3\n\n\t// BorderReflect101 border type\n\tBorderReflect101 BorderType = 4\n\n\t// BorderTransparent border type\n\tBorderTransparent BorderType = 5\n\n\t// BorderDefault border type\n\tBorderDefault = BorderReflect101\n\n\t// BorderIsolated border type\n\tBorderIsolated BorderType = 16\n)\n\n// GaussianBlur blurs an image Mat using a Gaussian filter.\n// The function convolves the src Mat image into the dst Mat using\n// the specified Gaussian kernel params.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1\nfunc GaussianBlur(src Mat, dst *Mat, ksize image.Point, sigmaX float64,\n\tsigmaY float64, borderType BorderType) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(ksize.X),\n\t\theight: C.int(ksize.Y),\n\t}\n\n\treturn OpenCVResult(C.GaussianBlur(src.p, dst.p, pSize, C.double(sigmaX), C.double(sigmaY), C.int(borderType)))\n}\n\n// GetGaussianKernel returns Gaussian filter coefficients.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa\nfunc GetGaussianKernel(ksize int, sigma float64) Mat {\n\treturn newMat(C.GetGaussianKernel(C.int(ksize), C.double(sigma), C.int(MatTypeCV64F)))\n}\n\n// GetGaussianKernelWithParams returns Gaussian filter coefficients.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa\nfunc GetGaussianKernelWithParams(ksize int, sigma float64, ktype MatType) Mat {\n\treturn newMat(C.GetGaussianKernel(C.int(ksize), C.double(sigma), C.int(ktype)))\n}\n\n// Sobel calculates the first, second, third, or mixed image derivatives using an extended Sobel operator\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d\nfunc Sobel(src Mat, dst *Mat, ddepth MatType, dx, dy, ksize int, scale, delta float64, borderType BorderType) error {\n\treturn OpenCVResult(C.Sobel(src.p, dst.p, C.int(ddepth), C.int(dx), C.int(dy), C.int(ksize), C.double(scale), C.double(delta), C.int(borderType)))\n}\n\n// SpatialGradient calculates the first order image derivative in both x and y using a Sobel operator.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga405d03b20c782b65a4daf54d233239a2\nfunc SpatialGradient(src Mat, dx, dy *Mat, ksize MatType, borderType BorderType) error {\n\treturn OpenCVResult(C.SpatialGradient(src.p, dx.p, dy.p, C.int(ksize), C.int(borderType)))\n}\n\n// Laplacian calculates the Laplacian of an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6\nfunc Laplacian(src Mat, dst *Mat, dDepth MatType, size int, scale float64,\n\tdelta float64, borderType BorderType) error {\n\treturn OpenCVResult(C.Laplacian(src.p, dst.p, C.int(dDepth), C.int(size), C.double(scale), C.double(delta), C.int(borderType)))\n}\n\n// Scharr calculates the first x- or y- image derivative using Scharr operator.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9\nfunc Scharr(src Mat, dst *Mat, dDepth MatType, dx int, dy int, scale float64,\n\tdelta float64, borderType BorderType) error {\n\treturn OpenCVResult(C.Scharr(src.p, dst.p, C.int(dDepth), C.int(dx), C.int(dy), C.double(scale), C.double(delta), C.int(borderType)))\n}\n\n// MedianBlur blurs an image using the median filter.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9\nfunc MedianBlur(src Mat, dst *Mat, ksize int) error {\n\treturn OpenCVResult(C.MedianBlur(src.p, dst.p, C.int(ksize)))\n}\n\n// Canny finds edges in an image using the Canny algorithm.\n// The function finds edges in the input image image and marks\n// them in the output map edges using the Canny algorithm.\n// The smallest value between threshold1 and threshold2 is used\n// for edge linking. The largest value is used to\n// find initial segments of strong edges.\n// See http://en.wikipedia.org/wiki/Canny_edge_detector\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga04723e007ed888ddf11d9ba04e2232de\nfunc Canny(src Mat, edges *Mat, t1 float32, t2 float32) error {\n\treturn OpenCVResult(C.Canny(src.p, edges.p, C.double(t1), C.double(t2)))\n}\n\n// CornerSubPix Refines the corner locations. The function iterates to find\n// the sub-pixel accurate location of corners or radial saddle points.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga354e0d7c86d0d9da75de9b9701a9a87e\nfunc CornerSubPix(img Mat, corners *Mat, winSize image.Point, zeroZone image.Point, criteria TermCriteria) error {\n\twinSz := C.struct_Size{\n\t\twidth:  C.int(winSize.X),\n\t\theight: C.int(winSize.Y),\n\t}\n\n\tzeroSz := C.struct_Size{\n\t\twidth:  C.int(zeroZone.X),\n\t\theight: C.int(zeroZone.Y),\n\t}\n\n\treturn OpenCVResult(C.CornerSubPix(img.p, corners.p, winSz, zeroSz, criteria.p))\n}\n\n// GoodFeaturesToTrack determines strong corners on an image. The function\n// finds the most prominent corners in the image or in the specified image region.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga1d6bb77486c8f92d79c8793ad995d541\nfunc GoodFeaturesToTrack(img Mat, corners *Mat, maxCorners int, quality float64, minDist float64) error {\n\treturn OpenCVResult(C.GoodFeaturesToTrack(img.p, corners.p, C.int(maxCorners), C.double(quality), C.double(minDist)))\n}\n\n// GrabCutMode is the flag for GrabCut algorithm.\ntype GrabCutMode int\n\nconst (\n\t// GCInitWithRect makes the function initialize the state and the mask using the provided rectangle.\n\t// After that it runs the itercount iterations of the algorithm.\n\tGCInitWithRect GrabCutMode = 0\n\t// GCInitWithMask makes the function initialize the state using the provided mask.\n\t// GCInitWithMask and GCInitWithRect can be combined.\n\t// Then all the pixels outside of the ROI are automatically initialized with GC_BGD.\n\tGCInitWithMask GrabCutMode = 1\n\t// GCEval means that the algorithm should just resume.\n\tGCEval GrabCutMode = 2\n\t// GCEvalFreezeModel means that the algorithm should just run a single iteration of the GrabCut algorithm\n\t// with the fixed model\n\tGCEvalFreezeModel GrabCutMode = 3\n)\n\n// Grabcut runs the GrabCut algorithm.\n// The function implements the GrabCut image segmentation algorithm.\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga909c1dda50efcbeaa3ce126be862b37f\nfunc GrabCut(img Mat, mask *Mat, r image.Rectangle, bgdModel *Mat, fgdModel *Mat, iterCount int, mode GrabCutMode) error {\n\tcRect := C.struct_Rect{\n\t\tx:      C.int(r.Min.X),\n\t\ty:      C.int(r.Min.Y),\n\t\twidth:  C.int(r.Size().X),\n\t\theight: C.int(r.Size().Y),\n\t}\n\n\treturn OpenCVResult(C.GrabCut(img.p, mask.p, cRect, bgdModel.p, fgdModel.p, C.int(iterCount), C.int(mode)))\n}\n\n// HoughMode is the type for Hough transform variants.\ntype HoughMode int\n\nconst (\n\t// HoughStandard is the classical or standard Hough transform.\n\tHoughStandard HoughMode = 0\n\t// HoughProbabilistic is the probabilistic Hough transform (more efficient\n\t// in case if the picture contains a few long linear segments).\n\tHoughProbabilistic HoughMode = 1\n\t// HoughMultiScale is the multi-scale variant of the classical Hough\n\t// transform.\n\tHoughMultiScale HoughMode = 2\n\t// HoughGradient is basically 21HT, described in: HK Yuen, John Princen,\n\t// John Illingworth, and Josef Kittler. Comparative study of hough\n\t// transform methods for circle finding. Image and Vision Computing,\n\t// 8(1):71–77, 1990.\n\tHoughGradient HoughMode = 3\n)\n\n// HoughCircles finds circles in a grayscale image using the Hough transform.\n// The only \"method\" currently supported is HoughGradient. If you want to pass\n// more parameters, please see `HoughCirclesWithParams`.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d\nfunc HoughCircles(src Mat, circles *Mat, method HoughMode, dp, minDist float64) error {\n\treturn OpenCVResult(C.HoughCircles(src.p, circles.p, C.int(method), C.double(dp), C.double(minDist)))\n}\n\n// HoughCirclesWithParams finds circles in a grayscale image using the Hough\n// transform. The only \"method\" currently supported is HoughGradient.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d\nfunc HoughCirclesWithParams(src Mat, circles *Mat, method HoughMode, dp, minDist, param1, param2 float64, minRadius, maxRadius int) error {\n\treturn OpenCVResult(C.HoughCirclesWithParams(src.p, circles.p, C.int(method), C.double(dp), C.double(minDist), C.double(param1), C.double(param2), C.int(minRadius), C.int(maxRadius)))\n}\n\n// HoughLines implements the standard or standard multi-scale Hough transform\n// algorithm for line detection. For a good explanation of Hough transform, see:\n// http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga46b4e588934f6c8dfd509cc6e0e4545a\nfunc HoughLines(src Mat, lines *Mat, rho float32, theta float32, threshold int) error {\n\treturn OpenCVResult(C.HoughLines(src.p, lines.p, C.double(rho), C.double(theta), C.int(threshold)))\n}\n\n// HoughLinesP implements the probabilistic Hough transform\n// algorithm for line detection. For a good explanation of Hough transform, see:\n// http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga8618180a5948286384e3b7ca02f6feeb\nfunc HoughLinesP(src Mat, lines *Mat, rho float32, theta float32, threshold int) error {\n\treturn OpenCVResult(C.HoughLinesP(src.p, lines.p, C.double(rho), C.double(theta), C.int(threshold)))\n}\n\nfunc HoughLinesPWithParams(src Mat, lines *Mat, rho float32, theta float32, threshold int, minLineLength float32, maxLineGap float32) error {\n\treturn OpenCVResult(C.HoughLinesPWithParams(src.p, lines.p, C.double(rho), C.double(theta), C.int(threshold), C.double(minLineLength), C.double(maxLineGap)))\n}\n\n// HoughLinesPointSet implements the Hough transform algorithm for line\n// detection on a set of points. For a good explanation of Hough transform, see:\n// http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dd/d1a/group__imgproc__feature.html#ga2858ef61b4e47d1919facac2152a160e\nfunc HoughLinesPointSet(points Mat, lines *Mat, linesMax int, threshold int,\n\tminRho float32, maxRho float32, rhoStep float32,\n\tminTheta float32, maxTheta float32, thetaStep float32) error {\n\treturn OpenCVResult(C.HoughLinesPointSet(points.p, lines.p, C.int(linesMax), C.int(threshold),\n\t\tC.double(minRho), C.double(maxRho), C.double(rhoStep),\n\t\tC.double(minTheta), C.double(maxTheta), C.double(thetaStep)))\n}\n\n// Integral calculates one or more integral images for the source image.\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga97b87bec26908237e8ba0f6e96d23e28\nfunc Integral(src Mat, sum *Mat, sqsum *Mat, tilted *Mat) error {\n\treturn OpenCVResult(C.Integral(src.p, sum.p, sqsum.p, tilted.p))\n}\n\n// ThresholdType type of threshold operation.\ntype ThresholdType int\n\nconst (\n\t// ThresholdBinary threshold type\n\tThresholdBinary ThresholdType = 0\n\n\t// ThresholdBinaryInv threshold type\n\tThresholdBinaryInv ThresholdType = 1\n\n\t// ThresholdTrunc threshold type\n\tThresholdTrunc ThresholdType = 2\n\n\t// ThresholdToZero threshold type\n\tThresholdToZero ThresholdType = 3\n\n\t// ThresholdToZeroInv threshold type\n\tThresholdToZeroInv ThresholdType = 4\n\n\t// ThresholdMask threshold type\n\tThresholdMask ThresholdType = 7\n\n\t// ThresholdOtsu threshold type\n\tThresholdOtsu ThresholdType = 8\n\n\t// ThresholdTriangle threshold type\n\tThresholdTriangle ThresholdType = 16\n)\n\n// Threshold applies a fixed-level threshold to each array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/3.3.0/d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57\nfunc Threshold(src Mat, dst *Mat, thresh float32, maxvalue float32, typ ThresholdType) (threshold float32) {\n\treturn float32(C.Threshold(src.p, dst.p, C.double(thresh), C.double(maxvalue), C.int(typ)))\n}\n\n// AdaptiveThresholdType type of adaptive threshold operation.\ntype AdaptiveThresholdType int\n\nconst (\n\t// AdaptiveThresholdMean threshold type\n\tAdaptiveThresholdMean AdaptiveThresholdType = 0\n\n\t// AdaptiveThresholdGaussian threshold type\n\tAdaptiveThresholdGaussian AdaptiveThresholdType = 1\n)\n\n// AdaptiveThreshold applies a fixed-level threshold to each array element.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3\nfunc AdaptiveThreshold(src Mat, dst *Mat, maxValue float32, adaptiveTyp AdaptiveThresholdType, typ ThresholdType, blockSize int, c float32) error {\n\treturn OpenCVResult(C.AdaptiveThreshold(src.p, dst.p, C.double(maxValue), C.int(adaptiveTyp), C.int(typ), C.int(blockSize), C.double(c)))\n}\n\n// ArrowedLine draws a arrow segment pointing from the first point\n// to the second one.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga0a165a3ca093fd488ac709fdf10c05b2\nfunc ArrowedLine(img *Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int) error {\n\tsp1 := C.struct_Point{\n\t\tx: C.int(pt1.X),\n\t\ty: C.int(pt1.Y),\n\t}\n\n\tsp2 := C.struct_Point{\n\t\tx: C.int(pt2.X),\n\t\ty: C.int(pt2.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.ArrowedLine(img.p, sp1, sp2, sColor, C.int(thickness)))\n}\n\n// Circle draws a circle.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670\nfunc Circle(img *Mat, center image.Point, radius int, c color.RGBA, thickness int) error {\n\tpc := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.Circle(img.p, pc, C.int(radius), sColor, C.int(thickness)))\n}\n\n// CircleWithParams draws a circle.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670\nfunc CircleWithParams(img *Mat, center image.Point, radius int, c color.RGBA, thickness int, lineType LineType, shift int) error {\n\tpc := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.CircleWithParams(img.p, pc, C.int(radius), sColor, C.int(thickness), C.int(lineType), C.int(shift)))\n}\n\n// Ellipse draws a simple or thick elliptic arc or fills an ellipse sector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga28b2267d35786f5f890ca167236cbc69\nfunc Ellipse(img *Mat, center, axes image.Point, angle, startAngle, endAngle float64, c color.RGBA, thickness int) error {\n\tpc := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\tpa := C.struct_Point{\n\t\tx: C.int(axes.X),\n\t\ty: C.int(axes.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.Ellipse(img.p, pc, pa, C.double(angle), C.double(startAngle), C.double(endAngle), sColor, C.int(thickness)))\n}\n\n// Ellipse draws a simple or thick elliptic arc or fills an ellipse sector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga28b2267d35786f5f890ca167236cbc69\nfunc EllipseWithParams(img *Mat, center, axes image.Point, angle, startAngle, endAngle float64, c color.RGBA, thickness int, lineType LineType, shift int) error {\n\tpc := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\tpa := C.struct_Point{\n\t\tx: C.int(axes.X),\n\t\ty: C.int(axes.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.EllipseWithParams(img.p, pc, pa, C.double(angle), C.double(startAngle), C.double(endAngle), sColor, C.int(thickness), C.int(lineType), C.int(shift)))\n}\n\n// Line draws a line segment connecting two points.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga7078a9fae8c7e7d13d24dac2520ae4a2\nfunc Line(img *Mat, pt1 image.Point, pt2 image.Point, c color.RGBA, thickness int) error {\n\tsp1 := C.struct_Point{\n\t\tx: C.int(pt1.X),\n\t\ty: C.int(pt1.Y),\n\t}\n\n\tsp2 := C.struct_Point{\n\t\tx: C.int(pt2.X),\n\t\ty: C.int(pt2.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.Line(img.p, sp1, sp2, sColor, C.int(thickness)))\n}\n\n// Rectangle draws a simple, thick, or filled up-right rectangle.\n// It renders a rectangle with the desired characteristics to the target Mat image.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c\nfunc Rectangle(img *Mat, r image.Rectangle, c color.RGBA, thickness int) error {\n\tcRect := C.struct_Rect{\n\t\tx:      C.int(r.Min.X),\n\t\ty:      C.int(r.Min.Y),\n\t\twidth:  C.int(r.Size().X),\n\t\theight: C.int(r.Size().Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.Rectangle(img.p, cRect, sColor, C.int(thickness)))\n}\n\n// RectangleWithParams draws a simple, thick, or filled up-right rectangle.\n// It renders a rectangle with the desired characteristics to the target Mat image.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga346ac30b5c74e9b5137576c9ee9e0e8c\nfunc RectangleWithParams(img *Mat, r image.Rectangle, c color.RGBA, thickness int, lineType LineType, shift int) error {\n\tcRect := C.struct_Rect{\n\t\tx:      C.int(r.Min.X),\n\t\ty:      C.int(r.Min.Y),\n\t\twidth:  C.int(r.Size().X),\n\t\theight: C.int(r.Size().Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.RectangleWithParams(img.p, cRect, sColor, C.int(thickness), C.int(lineType), C.int(shift)))\n}\n\n// FillPoly fills the area bounded by one or more polygons.\n//\n// For more information, see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf30888828337aa4c6b56782b5dfbd4b7\nfunc FillPoly(img *Mat, pts PointsVector, c color.RGBA) error {\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.FillPoly(img.p, pts.p, sColor))\n}\n\n// FillPolyWithParams fills the area bounded by one or more polygons.\n//\n// For more information, see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf30888828337aa4c6b56782b5dfbd4b7\nfunc FillPolyWithParams(img *Mat, pts PointsVector, c color.RGBA, lineType LineType, shift int, offset image.Point) error {\n\toffsetP := C.struct_Point{\n\t\tx: C.int(offset.X),\n\t\ty: C.int(offset.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.FillPolyWithParams(img.p, pts.p, sColor, C.int(lineType), C.int(shift), offsetP))\n}\n\n// Polylines draws several polygonal curves.\n//\n// For more information, see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga1ea127ffbbb7e0bfc4fd6fd2eb64263c\nfunc Polylines(img *Mat, pts PointsVector, isClosed bool, c color.RGBA, thickness int) error {\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.Polylines(img.p, pts.p, C.bool(isClosed), sColor, C.int(thickness)))\n}\n\n// HersheyFont are the font libraries included in OpenCV.\n// Only a subset of the available Hershey fonts are supported by OpenCV.\n//\n// For more information, see:\n// http://sources.isc.org/utils/misc/hershey-font.txt\ntype HersheyFont int\n\nconst (\n\t// FontHersheySimplex is normal size sans-serif font.\n\tFontHersheySimplex HersheyFont = 0\n\t// FontHersheyPlain issmall size sans-serif font.\n\tFontHersheyPlain HersheyFont = 1\n\t// FontHersheyDuplex normal size sans-serif font\n\t// (more complex than FontHersheySIMPLEX).\n\tFontHersheyDuplex HersheyFont = 2\n\t// FontHersheyComplex i a normal size serif font.\n\tFontHersheyComplex HersheyFont = 3\n\t// FontHersheyTriplex is a normal size serif font\n\t// (more complex than FontHersheyCOMPLEX).\n\tFontHersheyTriplex HersheyFont = 4\n\t// FontHersheyComplexSmall is a smaller version of FontHersheyCOMPLEX.\n\tFontHersheyComplexSmall HersheyFont = 5\n\t// FontHersheyScriptSimplex is a hand-writing style font.\n\tFontHersheyScriptSimplex HersheyFont = 6\n\t// FontHersheyScriptComplex is a more complex variant of FontHersheyScriptSimplex.\n\tFontHersheyScriptComplex HersheyFont = 7\n\t// FontItalic is the flag for italic font.\n\tFontItalic HersheyFont = 16\n)\n\n// LineType are the line libraries included in OpenCV.\n//\n// For more information, see:\n// https://vovkos.github.io/doxyrest-showcase/opencv/sphinx_rtd_theme/enum_cv_LineTypes.html\ntype LineType int\n\nconst (\n\t// Filled line\n\tFilled LineType = -1\n\t// Line4 4-connected line\n\tLine4 LineType = 4\n\t// Line8 8-connected line\n\tLine8 LineType = 8\n\t// LineAA antialiased line\n\tLineAA LineType = 16\n)\n\n// GetTextSize calculates the width and height of a text string.\n// It returns an image.Point with the size required to draw text using\n// a specific font face, scale, and thickness.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82\nfunc GetTextSize(text string, fontFace HersheyFont, fontScale float64, thickness int) image.Point {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\n\tsz := C.GetTextSize(cText, C.int(fontFace), C.double(fontScale), C.int(thickness))\n\treturn image.Pt(int(sz.width), int(sz.height))\n}\n\n// GetTextSizeWithBaseline calculates the width and height of a text string including the basline of the text.\n// It returns an image.Point with the size required to draw text using\n// a specific font face, scale, and thickness as well as its baseline.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga3d2abfcb995fd2db908c8288199dba82\nfunc GetTextSizeWithBaseline(text string, fontFace HersheyFont, fontScale float64, thickness int) (image.Point, int) {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\tcBaseline := C.int(0)\n\n\tsz := C.GetTextSizeWithBaseline(cText, C.int(fontFace), C.double(fontScale), C.int(thickness), &cBaseline)\n\treturn image.Pt(int(sz.width), int(sz.height)), int(cBaseline)\n}\n\n// PutText draws a text string.\n// It renders the specified text string into the img Mat at the location\n// passed in the \"org\" param, using the desired font face, font scale,\n// color, and line thinkness.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576\nfunc PutText(img *Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, c color.RGBA, thickness int) error {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\n\tpOrg := C.struct_Point{\n\t\tx: C.int(org.X),\n\t\ty: C.int(org.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.PutText(img.p, cText, pOrg, C.int(fontFace), C.double(fontScale), sColor, C.int(thickness)))\n}\n\n// PutTextWithParams draws a text string.\n// It renders the specified text string into the img Mat at the location\n// passed in the \"org\" param, using the desired font face, font scale,\n// color, and line thinkness.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga5126f47f883d730f633d74f07456c576\nfunc PutTextWithParams(img *Mat, text string, org image.Point, fontFace HersheyFont, fontScale float64, c color.RGBA, thickness int, lineType LineType, bottomLeftOrigin bool) error {\n\tcText := C.CString(text)\n\tdefer C.free(unsafe.Pointer(cText))\n\n\tpOrg := C.struct_Point{\n\t\tx: C.int(org.X),\n\t\ty: C.int(org.Y),\n\t}\n\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.PutTextWithParams(img.p, cText, pOrg, C.int(fontFace), C.double(fontScale), sColor, C.int(thickness), C.int(lineType), C.bool(bottomLeftOrigin)))\n}\n\n// InterpolationFlags are bit flags that control the interpolation algorithm\n// that is used.\ntype InterpolationFlags int\n\nconst (\n\t// InterpolationNearestNeighbor is nearest neighbor. (fast but low quality)\n\tInterpolationNearestNeighbor InterpolationFlags = 0\n\n\t// InterpolationLinear is bilinear interpolation.\n\tInterpolationLinear InterpolationFlags = 1\n\n\t// InterpolationCubic is bicube interpolation.\n\tInterpolationCubic InterpolationFlags = 2\n\n\t// InterpolationArea uses pixel area relation. It is preferred for image\n\t// decimation as it gives moire-free results.\n\tInterpolationArea InterpolationFlags = 3\n\n\t// InterpolationLanczos4 is Lanczos interpolation over 8x8 neighborhood.\n\tInterpolationLanczos4 InterpolationFlags = 4\n\n\t// InterpolationDefault is an alias for InterpolationLinear.\n\tInterpolationDefault = InterpolationLinear\n\n\t// InterpolationMax indicates use maximum interpolation.\n\tInterpolationMax InterpolationFlags = 7\n\n\t// WarpFillOutliers fills all of the destination image pixels. If some of them correspond to outliers in the source image, they are set to zero.\n\tWarpFillOutliers = 8\n\n\t// WarpInverseMap, inverse transformation.\n\tWarpInverseMap = 16\n)\n\n// Resize resizes an image.\n// It resizes the image src down to or up to the specified size, storing the\n// result in dst. Note that src and dst may be the same image. If you wish to\n// scale by factor, an empty sz may be passed and non-zero fx and fy. Likewise,\n// if you wish to scale to an explicit size, a non-empty sz may be passed with\n// zero for both fx and fy.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga47a974309e9102f5f08231edc7e7529d\nfunc Resize(src Mat, dst *Mat, sz image.Point, fx, fy float64, interp InterpolationFlags) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.Resize(src.p, dst.p, pSize, C.double(fx), C.double(fy), C.int(interp)))\n}\n\n// GetRectSubPix retrieves a pixel rectangle from an image with sub-pixel accuracy.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga77576d06075c1a4b6ba1a608850cd614\nfunc GetRectSubPix(src Mat, patchSize image.Point, center image.Point, dst *Mat) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(patchSize.X),\n\t\theight: C.int(patchSize.Y),\n\t}\n\tpt := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\treturn OpenCVResult(C.GetRectSubPix(src.p, sz, pt, dst.p))\n}\n\n// GetRotationMatrix2D calculates an affine matrix of 2D rotation.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326\nfunc GetRotationMatrix2D(center image.Point, angle, scale float64) Mat {\n\tpc := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\treturn newMat(C.GetRotationMatrix2D(pc, C.double(angle), C.double(scale)))\n}\n\n// WarpAffine applies an affine transformation to an image. For more parameters please check WarpAffineWithParams\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983\nfunc WarpAffine(src Mat, dst *Mat, m Mat, sz image.Point) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.WarpAffine(src.p, dst.p, m.p, pSize))\n}\n\n// WarpAffineWithParams applies an affine transformation to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga0203d9ee5fcd28d40dbc4a1ea4451983\nfunc WarpAffineWithParams(src Mat, dst *Mat, m Mat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\treturn OpenCVResult(C.WarpAffineWithParams(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv))\n}\n\n// WarpPerspective applies a perspective transformation to an image.\n// For more parameters please check WarpPerspectiveWithParams.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaf73673a7e8e18ec6963e3774e6a94b87\nfunc WarpPerspective(src Mat, dst *Mat, m Mat, sz image.Point) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\n\treturn OpenCVResult(C.WarpPerspective(src.p, dst.p, m.p, pSize))\n}\n\n// WarpPerspectiveWithParams applies a perspective transformation to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaf73673a7e8e18ec6963e3774e6a94b87\nfunc WarpPerspectiveWithParams(src Mat, dst *Mat, m Mat, sz image.Point, flags InterpolationFlags, borderType BorderType, borderValue color.RGBA) error {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\treturn OpenCVResult(C.WarpPerspectiveWithParams(src.p, dst.p, m.p, pSize, C.int(flags), C.int(borderType), bv))\n}\n\n// Watershed performs a marker-based image segmentation using the watershed algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga3267243e4d3f95165d55a618c65ac6e1\nfunc Watershed(image Mat, markers *Mat) error {\n\treturn OpenCVResult(C.Watershed(image.p, markers.p))\n}\n\n// ColormapTypes are the 12 GNU Octave/MATLAB equivalent colormaps.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html\ntype ColormapTypes int\n\n// List of the available color maps\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#ga9a805d8262bcbe273f16be9ea2055a65\nconst (\n\tColormapAutumn          ColormapTypes = 0\n\tColormapBone            ColormapTypes = 1\n\tColormapJet             ColormapTypes = 2\n\tColormapWinter          ColormapTypes = 3\n\tColormapRainbow         ColormapTypes = 4\n\tColormapOcean           ColormapTypes = 5\n\tColormapSummer          ColormapTypes = 6\n\tColormapSpring          ColormapTypes = 7\n\tColormapCool            ColormapTypes = 8\n\tColormapHsv             ColormapTypes = 9\n\tColormapPink            ColormapTypes = 10\n\tColormapHot             ColormapTypes = 11\n\tColormapParula          ColormapTypes = 12\n\tColormapMagma           ColormapTypes = 13\n\tColormapInferno         ColormapTypes = 14\n\tColormapPlasma          ColormapTypes = 15\n\tColormapViridis         ColormapTypes = 16\n\tColormapCividis         ColormapTypes = 17\n\tColormapTwilight        ColormapTypes = 18\n\tColormapTwilightShifted ColormapTypes = 19\n\tColormapTurbo           ColormapTypes = 20\n\tColormapDeepGreen       ColormapTypes = 21\n)\n\n// ApplyColorMap applies a GNU Octave/MATLAB equivalent colormap on a given image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#gadf478a5e5ff49d8aa24e726ea6f65d15\nfunc ApplyColorMap(src Mat, dst *Mat, colormapType ColormapTypes) error {\n\treturn OpenCVResult(C.ApplyColorMap(src.p, dst.p, C.int(colormapType)))\n}\n\n// ApplyCustomColorMap applies a custom defined colormap on a given image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#gacb22288ddccc55f9bd9e6d492b409cae\nfunc ApplyCustomColorMap(src Mat, dst *Mat, customColormap Mat) error {\n\treturn OpenCVResult(C.ApplyCustomColorMap(src.p, dst.p, customColormap.p))\n}\n\n// GetPerspectiveTransform returns 3x3 perspective transformation for the\n// corresponding 4 point pairs as image.Point.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8c1ae0e3589a9d77fffc962c49b22043\nfunc GetPerspectiveTransform(src, dst PointVector) Mat {\n\treturn newMat(C.GetPerspectiveTransform(src.p, dst.p))\n}\n\n// GetPerspectiveTransform2f returns 3x3 perspective transformation for the\n// corresponding 4 point pairs as gocv.Point2f.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8c1ae0e3589a9d77fffc962c49b22043\nfunc GetPerspectiveTransform2f(src, dst Point2fVector) Mat {\n\treturn newMat(C.GetPerspectiveTransform2f(src.p, dst.p))\n}\n\n// GetAffineTransform returns a 2x3 affine transformation matrix for the\n// corresponding 3 point pairs as image.Point.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8f6d378f9f8eebb5cb55cd3ae295a999\nfunc GetAffineTransform(src, dst PointVector) Mat {\n\treturn newMat(C.GetAffineTransform(src.p, dst.p))\n}\n\n// GetAffineTransform2f returns a 2x3 affine transformation matrix for the\n// corresponding 3 point pairs as gocv.Point2f.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#ga8f6d378f9f8eebb5cb55cd3ae295a999\nfunc GetAffineTransform2f(src, dst Point2fVector) Mat {\n\treturn newMat(C.GetAffineTransform2f(src.p, dst.p))\n}\n\n// DrawContours draws contours outlines or filled contours.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc\nfunc DrawContours(img *Mat, contours PointsVector, contourIdx int, c color.RGBA, thickness int) error {\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\n\treturn OpenCVResult(C.DrawContours(img.p, contours.p, C.int(contourIdx), sColor, C.int(thickness)))\n}\n\n// DrawContoursWithParams draws contours outlines or filled contours.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc\nfunc DrawContoursWithParams(img *Mat, contours PointsVector, contourIdx int, c color.RGBA, thickness int, lineType LineType, hierarchy Mat, maxLevel int, offset image.Point) error {\n\tsColor := C.struct_Scalar{\n\t\tval1: C.double(c.B),\n\t\tval2: C.double(c.G),\n\t\tval3: C.double(c.R),\n\t\tval4: C.double(c.A),\n\t}\n\toffsetP := C.struct_Point{\n\t\tx: C.int(offset.X),\n\t\ty: C.int(offset.Y),\n\t}\n\n\treturn OpenCVResult(C.DrawContoursWithParams(img.p, contours.p, C.int(contourIdx), sColor, C.int(thickness), C.int(lineType), hierarchy.p, C.int(maxLevel), offsetP))\n}\n\n// Remap applies a generic geometrical transformation to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4\nfunc Remap(src Mat, dst, map1, map2 *Mat, interpolation InterpolationFlags, borderMode BorderType, borderValue color.RGBA) error {\n\tbv := C.struct_Scalar{\n\t\tval1: C.double(borderValue.B),\n\t\tval2: C.double(borderValue.G),\n\t\tval3: C.double(borderValue.R),\n\t\tval4: C.double(borderValue.A),\n\t}\n\treturn OpenCVResult(C.Remap(src.p, dst.p, map1.p, map2.p, C.int(interpolation), C.int(borderMode), bv))\n}\n\n// Filter2D applies an arbitrary linear filter to an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04\nfunc Filter2D(src Mat, dst *Mat, ddepth MatType, kernel Mat, anchor image.Point, delta float64, borderType BorderType) error {\n\tanchorP := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\treturn OpenCVResult(C.Filter2D(src.p, dst.p, C.int(ddepth), kernel.p, anchorP, C.double(delta), C.int(borderType)))\n}\n\n// SepFilter2D applies a separable linear filter to the image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d\nfunc SepFilter2D(src Mat, dst *Mat, ddepth MatType, kernelX, kernelY Mat, anchor image.Point, delta float64, borderType BorderType) error {\n\tanchorP := C.struct_Point{\n\t\tx: C.int(anchor.X),\n\t\ty: C.int(anchor.Y),\n\t}\n\treturn OpenCVResult(C.SepFilter2D(src.p, dst.p, C.int(ddepth), kernelX.p, kernelY.p, anchorP, C.double(delta), C.int(borderType)))\n}\n\n// LogPolar remaps an image to semilog-polar coordinates space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaec3a0b126a85b5ca2c667b16e0ae022d\nfunc LogPolar(src Mat, dst *Mat, center image.Point, m float64, flags InterpolationFlags) error {\n\tcenterP := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\treturn OpenCVResult(C.LogPolar(src.p, dst.p, centerP, C.double(m), C.int(flags)))\n}\n\n// LinearPolar remaps an image to polar coordinates space.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gaa38a6884ac8b6e0b9bed47939b5362f3\nfunc LinearPolar(src Mat, dst *Mat, center image.Point, maxRadius float64, flags InterpolationFlags) error {\n\tcenterP := C.struct_Point{\n\t\tx: C.int(center.X),\n\t\ty: C.int(center.Y),\n\t}\n\treturn OpenCVResult(C.LinearPolar(src.p, dst.p, centerP, C.double(maxRadius), C.int(flags)))\n}\n\n// DistanceTypes types for Distance Transform and M-estimatorss\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb\ntype DistanceTypes int\n\nconst (\n\tDistUser   DistanceTypes = 0\n\tDistL1     DistanceTypes = 1\n\tDistL2     DistanceTypes = 2\n\tDistC      DistanceTypes = 3\n\tDistL12    DistanceTypes = 4\n\tDistFair   DistanceTypes = 5\n\tDistWelsch DistanceTypes = 6\n\tDistHuber  DistanceTypes = 7\n)\n\n// FitLine fits a line to a 2D or 3D point set.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#gaf849da1fdafa67ee84b1e9a23b93f91f\nfunc FitLine(pts PointVector, line *Mat, distType DistanceTypes, param, reps, aeps float64) error {\n\treturn OpenCVResult(C.FitLine(pts.p, line.p, C.int(distType), C.double(param), C.double(reps), C.double(aeps)))\n}\n\n// Shape matching methods.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#gaadc90cb16e2362c9bd6e7363e6e4c317\ntype ShapeMatchModes int\n\nconst (\n\tContoursMatchI1 ShapeMatchModes = 1\n\tContoursMatchI2 ShapeMatchModes = 2\n\tContoursMatchI3 ShapeMatchModes = 3\n)\n\n// Compares two shapes.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d3/dc0/group__imgproc__shape.html#gaadc90cb16e2362c9bd6e7363e6e4c317\nfunc MatchShapes(contour1 PointVector, contour2 PointVector, method ShapeMatchModes, parameter float64) float64 {\n\treturn float64(C.MatchShapes(contour1.p, contour2.p, C.int(method), C.double(parameter)))\n}\n\n// CLAHE is a wrapper around the cv::CLAHE algorithm.\ntype CLAHE struct {\n\t// C.CLAHE\n\tp unsafe.Pointer\n}\n\n// NewCLAHE returns a new CLAHE algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/db6/classcv_1_1CLAHE.html\nfunc NewCLAHE() CLAHE {\n\treturn CLAHE{p: unsafe.Pointer(C.CLAHE_Create())}\n}\n\n// NewCLAHEWithParams returns a new CLAHE algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/db6/classcv_1_1CLAHE.html\nfunc NewCLAHEWithParams(clipLimit float64, tileGridSize image.Point) CLAHE {\n\tpSize := C.struct_Size{\n\t\twidth:  C.int(tileGridSize.X),\n\t\theight: C.int(tileGridSize.Y),\n\t}\n\treturn CLAHE{p: unsafe.Pointer(C.CLAHE_CreateWithParams(C.double(clipLimit), pSize))}\n}\n\n// Close CLAHE.\nfunc (c *CLAHE) Close() error {\n\tC.CLAHE_Close((C.CLAHE)(c.p))\n\tc.p = nil\n\treturn nil\n}\n\n// Apply CLAHE.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/db6/classcv_1_1CLAHE.html#a4e92e0e427de21be8d1fae8dcd862c5e\nfunc (c *CLAHE) Apply(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.CLAHE_Apply((C.CLAHE)(c.p), src.p, dst.p))\n}\n\nfunc InvertAffineTransform(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.InvertAffineTransform(src.p, dst.p))\n}\n\n// Apply phaseCorrelate.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga552420a2ace9ef3fb053cd630fdb4952\nfunc PhaseCorrelate(src1, src2, window Mat) (phaseShift Point2f, response float64) {\n\tvar responseDouble C.double\n\tresult := C.PhaseCorrelate(src1.p, src2.p, window.p, &responseDouble)\n\n\treturn Point2f{\n\t\tX: float32(result.x),\n\t\tY: float32(result.y),\n\t}, float64(responseDouble)\n}\n\n// CreateHanningWindow computes a Hanning window coefficients in two dimensions.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/df3/group__imgproc__motion.html#ga80e5c3de52f6bab3a7c1e60e89308e1b\nfunc CreateHanningWindow(img *Mat, size image.Point, typ MatType) error {\n\tsz := C.struct_Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn OpenCVResult(C.CreateHanningWindow(img.p, sz, C.int(typ)))\n}\n\n// ToImage converts a Mat to a image.Image.\nfunc (m *Mat) ToImage() (image.Image, error) {\n\tswitch m.Type() {\n\tcase MatTypeCV8UC1:\n\t\timg := image.NewGray(image.Rect(0, 0, m.Cols(), m.Rows()))\n\t\tdata, err := m.DataPtrUint8()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcopy(img.Pix, data[0:])\n\t\treturn img, nil\n\n\tcase MatTypeCV8UC3:\n\t\tdst := NewMat()\n\t\tdefer dst.Close()\n\n\t\tC.CvtColor(m.p, dst.p, C.int(ColorBGRToRGBA))\n\n\t\timg := image.NewRGBA(image.Rect(0, 0, m.Cols(), m.Rows()))\n\t\tdata, err := dst.DataPtrUint8()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcopy(img.Pix, data[0:])\n\t\treturn img, nil\n\n\tcase MatTypeCV8UC4:\n\t\tdst := NewMat()\n\t\tdefer dst.Close()\n\n\t\tC.CvtColor(m.p, dst.p, C.int(ColorBGRAToRGBA))\n\n\t\timg := image.NewNRGBA(image.Rect(0, 0, m.Cols(), m.Rows()))\n\t\tdata, err := dst.DataPtrUint8()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcopy(img.Pix, data[0:])\n\t\treturn img, nil\n\n\tdefault:\n\t\treturn nil, errors.New(\"ToImage supports only MatType CV8UC1, CV8UC3 and CV8UC4\")\n\t}\n}\n\n// ToImageYUV converts a Mat to a image.YCbCr using image.YCbCrSubsampleRatio420 as default subsampling param.\nfunc (m *Mat) ToImageYUV() (*image.YCbCr, error) {\n\timg, err := m.ToImage()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbounds := img.Bounds()\n\tconverted := image.NewYCbCr(bounds, image.YCbCrSubsampleRatio420)\n\n\tfor row := 0; row < bounds.Max.Y; row++ {\n\t\tfor col := 0; col < bounds.Max.X; col++ {\n\t\t\tr, g, b, _ := img.At(col, row).RGBA()\n\t\t\ty, cb, cr := color.RGBToYCbCr(uint8(r), uint8(g), uint8(b))\n\n\t\t\tconverted.Y[converted.YOffset(col, row)] = y\n\t\t\tconverted.Cb[converted.COffset(col, row)] = cb\n\t\t\tconverted.Cr[converted.COffset(col, row)] = cr\n\t\t}\n\t}\n\treturn converted, nil\n}\n\n// ToImageYUV converts a Mat to a image.YCbCr using provided YUV subsample ratio param.\nfunc (m *Mat) ToImageYUVWithParams(ratio image.YCbCrSubsampleRatio) (*image.YCbCr, error) {\n\timg, err := m.ToImage()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbounds := img.Bounds()\n\tconverted := image.NewYCbCr(bounds, ratio)\n\n\tfor row := 0; row < bounds.Max.Y; row++ {\n\t\tfor col := 0; col < bounds.Max.X; col++ {\n\t\t\tr, g, b, _ := img.At(col, row).RGBA()\n\t\t\ty, cb, cr := color.RGBToYCbCr(uint8(r), uint8(g), uint8(b))\n\n\t\t\tconverted.Y[converted.YOffset(col, row)] = y\n\t\t\tconverted.Cb[converted.COffset(col, row)] = cb\n\t\t\tconverted.Cr[converted.COffset(col, row)] = cr\n\t\t}\n\t}\n\treturn converted, nil\n}\n\n// ImageToMatRGBA converts image.Image to gocv.Mat,\n// which represents RGBA image having 8bit for each component.\n// Type of Mat is gocv.MatTypeCV8UC4.\nfunc ImageToMatRGBA(img image.Image) (Mat, error) {\n\tbounds := img.Bounds()\n\tx := bounds.Dx()\n\ty := bounds.Dy()\n\n\tvar data []uint8\n\tswitch img.ColorModel() {\n\tcase color.RGBAModel:\n\t\tm, res := img.(*image.RGBA)\n\t\tif !res {\n\t\t\treturn NewMat(), errors.New(\"Image color format error\")\n\t\t}\n\t\tdata = m.Pix\n\n\tcase color.NRGBAModel:\n\t\tm, res := img.(*image.NRGBA)\n\t\tif !res {\n\t\t\treturn NewMat(), errors.New(\"Image color format error\")\n\t\t}\n\t\tdata = m.Pix\n\n\tdefault:\n\t\tdata := make([]byte, 0, x*y*3)\n\t\tfor j := bounds.Min.Y; j < bounds.Max.Y; j++ {\n\t\t\tfor i := bounds.Min.X; i < bounds.Max.X; i++ {\n\t\t\t\tr, g, b, _ := img.At(i, j).RGBA()\n\t\t\t\tdata = append(data, byte(b>>8), byte(g>>8), byte(r>>8))\n\t\t\t}\n\t\t}\n\t\treturn NewMatFromBytes(y, x, MatTypeCV8UC3, data)\n\t}\n\n\t// speed up the conversion process of RGBA format\n\tcvt, err := NewMatFromBytes(y, x, MatTypeCV8UC4, data)\n\tif err != nil {\n\t\treturn NewMat(), err\n\t}\n\n\tdefer cvt.Close()\n\n\tdst := NewMat()\n\tC.CvtColor(cvt.p, dst.p, C.int(ColorBGRAToRGBA))\n\treturn dst, nil\n}\n\n// ImageToMatRGB converts image.Image to gocv.Mat,\n// which represents RGB image having 8bit for each component.\n// Type of Mat is gocv.MatTypeCV8UC3.\nfunc ImageToMatRGB(img image.Image) (Mat, error) {\n\tbounds := img.Bounds()\n\tx := bounds.Dx()\n\ty := bounds.Dy()\n\n\tvar data []uint8\n\tswitch img.ColorModel() {\n\tcase color.RGBAModel:\n\t\tm, res := img.(*image.RGBA)\n\t\tif true != res {\n\t\t\treturn NewMat(), errors.New(\"Image color format error\")\n\t\t}\n\t\tdata = m.Pix\n\t\t// speed up the conversion process of RGBA format\n\t\tsrc, err := NewMatFromBytes(y, x, MatTypeCV8UC4, data)\n\t\tif err != nil {\n\t\t\treturn NewMat(), err\n\t\t}\n\t\tdefer src.Close()\n\n\t\tdst := NewMat()\n\t\tCvtColor(src, &dst, ColorRGBAToBGR)\n\t\treturn dst, nil\n\n\tdefault:\n\t\tdata := make([]byte, 0, x*y*3)\n\t\tfor j := bounds.Min.Y; j < bounds.Max.Y; j++ {\n\t\t\tfor i := bounds.Min.X; i < bounds.Max.X; i++ {\n\t\t\t\tr, g, b, _ := img.At(i, j).RGBA()\n\t\t\t\tdata = append(data, byte(b>>8), byte(g>>8), byte(r>>8))\n\t\t\t}\n\t\t}\n\t\treturn NewMatFromBytes(y, x, MatTypeCV8UC3, data)\n\t}\n}\n\n// ImageGrayToMatGray converts image.Gray to gocv.Mat,\n// which represents grayscale image 8bit.\n// Type of Mat is gocv.MatTypeCV8UC1.\nfunc ImageGrayToMatGray(img *image.Gray) (Mat, error) {\n\tbounds := img.Bounds()\n\tx := bounds.Dx()\n\ty := bounds.Dy()\n\tm, err := NewMatFromBytes(y, x, MatTypeCV8UC1, img.Pix)\n\tif err != nil {\n\t\treturn NewMat(), err\n\t}\n\treturn m, nil\n}\n\n// Adds the square of a source image to the accumulator image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga1a567a79901513811ff3b9976923b199\n//\n\nfunc Accumulate(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_Accumulate(src.p, dst.p))\n}\n\n// Adds an image to the accumulator image with mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga1a567a79901513811ff3b9976923b199\nfunc AccumulateWithMask(src Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulateWithMask(src.p, dst.p, mask.p))\n}\n\n// Adds the square of a source image to the accumulator image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#gacb75e7ffb573227088cef9ceaf80be8c\nfunc AccumulateSquare(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulateSquare(src.p, dst.p))\n}\n\n// Adds the square of a source image to the accumulator image with mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#gacb75e7ffb573227088cef9ceaf80be8c\nfunc AccumulateSquareWithMask(src Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulateSquareWithMask(src.p, dst.p, mask.p))\n}\n\n// Adds the per-element product of two input images to the accumulator image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga82518a940ecfda49460f66117ac82520\nfunc AccumulateProduct(src1 Mat, src2 Mat, dst *Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulateProduct(src1.p, src2.p, dst.p))\n}\n\n// Adds the per-element product of two input images to the accumulator image with mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga82518a940ecfda49460f66117ac82520\nfunc AccumulateProductWithMask(src1 Mat, src2 Mat, dst *Mat, mask Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulateProductWithMask(src1.p, src2.p, dst.p, mask.p))\n}\n\n// Updates a running average.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga4f9552b541187f61f6818e8d2d826bc7\nfunc AccumulatedWeighted(src Mat, dst *Mat, alpha float64) error {\n\treturn OpenCVResult(C.Mat_AccumulatedWeighted(src.p, dst.p, C.double(alpha)))\n}\n\n// Updates a running average with mask.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df3/group__imgproc__motion.html#ga4f9552b541187f61f6818e8d2d826bc7\nfunc AccumulatedWeightedWithMask(src Mat, dst *Mat, alpha float64, mask Mat) error {\n\treturn OpenCVResult(C.Mat_AccumulatedWeightedWithMask(src.p, dst.p, C.double(alpha), mask.p))\n}\n"
  },
  {
    "path": "imgproc.h",
    "content": "#ifndef _OPENCV3_IMGPROC_H_\n#define _OPENCV3_IMGPROC_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::CLAHE>* CLAHE;\n#else\ntypedef void* CLAHE;\n#endif\n\n#include \"core.h\"\n\ndouble ArcLength(PointVector curve, bool is_closed);\nPointVector ApproxPolyDP(PointVector curve, double epsilon, bool closed);\nOpenCVResult CvtColor(Mat src, Mat dst, int code);\nOpenCVResult Demosaicing(Mat src, Mat dst, int code);\nOpenCVResult EqualizeHist(Mat src, Mat dst);\nOpenCVResult CalcHist(struct Mats mats, IntVector chans, Mat mask, Mat hist, IntVector sz, FloatVector rng, bool acc);\nOpenCVResult CalcBackProject(struct Mats mats, IntVector chans, Mat hist, Mat backProject, FloatVector rng, bool uniform);\ndouble CompareHist(Mat hist1, Mat hist2, int method);\nfloat EMD(Mat sig1, Mat sig2, int distType);\nOpenCVResult ConvexHull(PointVector points, Mat hull, bool clockwise, bool returnPoints);\nOpenCVResult ConvexityDefects(PointVector points, Mat hull, Mat result);\nOpenCVResult BilateralFilter(Mat src, Mat dst, int d, double sc, double ss);\nOpenCVResult Blur(Mat src, Mat dst, Size ps);\nOpenCVResult BoxFilter(Mat src, Mat dst, int ddepth, Size ps);\nOpenCVResult SqBoxFilter(Mat src, Mat dst, int ddepth, Size ps);\nOpenCVResult Dilate(Mat src, Mat dst, Mat kernel);\nOpenCVResult DilateWithParams(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue);\nOpenCVResult DistanceTransform(Mat src, Mat dst, Mat labels, int distanceType, int maskSize, int labelType);\nOpenCVResult Erode(Mat src, Mat dst, Mat kernel);\nOpenCVResult ErodeWithParams(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType);\nOpenCVResult ErodeWithParamsAndBorderValue(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType, Scalar borderValue);\nOpenCVResult MatchTemplate(Mat image, Mat templ, Mat result, int method, Mat mask);\nstruct Moment Moments(Mat src, bool binaryImage);\nOpenCVResult PyrDown(Mat src, Mat dst, Size dstsize, int borderType);\nOpenCVResult PyrUp(Mat src, Mat dst, Size dstsize, int borderType);\nstruct Rect BoundingRect(PointVector pts);\nOpenCVResult BoxPoints(RotatedRect rect, Mat boxPts);\nOpenCVResult BoxPoints2f(RotatedRect2f rect, Mat boxPts);\ndouble ContourArea(PointVector pts);\nstruct RotatedRect MinAreaRect(PointVector pts);\nstruct RotatedRect2f MinAreaRect2f(PointVector pts);\nstruct RotatedRect FitEllipse(PointVector pts);\nOpenCVResult MinEnclosingCircle(PointVector pts, Point2f* center, float* radius);\nPointsVector FindContours(Mat src, Mat hierarchy, int mode, int method);\ndouble PointPolygonTest(PointVector pts, Point pt, bool measureDist);\nint ConnectedComponents(Mat src, Mat dst, int connectivity, int ltype, int ccltype);\nint ConnectedComponentsWithStats(Mat src, Mat labels, Mat stats, Mat centroids, int connectivity, int ltype, int ccltype);\n\nOpenCVResult GaussianBlur(Mat src, Mat dst, Size ps, double sX, double sY, int bt);\nMat GetGaussianKernel(int ksize, double sigma, int ktype);\nOpenCVResult Laplacian(Mat src, Mat dst, int dDepth, int kSize, double scale, double delta, int borderType);\nOpenCVResult Scharr(Mat src, Mat dst, int dDepth, int dx, int dy, double scale, double delta,\n            int borderType);\nMat GetStructuringElement(int shape, Size ksize);\nScalar MorphologyDefaultBorderValue();\nOpenCVResult MorphologyEx(Mat src, Mat dst, int op, Mat kernel);\nOpenCVResult MorphologyExWithParams(Mat src, Mat dst, int op, Mat kernel, Point pt, int iterations, int borderType);\nOpenCVResult MedianBlur(Mat src, Mat dst, int ksize);\n\nOpenCVResult Canny(Mat src, Mat edges, double t1, double t2);\nOpenCVResult CornerSubPix(Mat img, Mat corners, Size winSize, Size zeroZone, TermCriteria criteria);\nOpenCVResult GoodFeaturesToTrack(Mat img, Mat corners, int maxCorners, double quality, double minDist);\nOpenCVResult GrabCut(Mat img, Mat mask, Rect rect, Mat bgdModel, Mat fgdModel, int iterCount, int mode);\nOpenCVResult HoughCircles(Mat src, Mat circles, int method, double dp, double minDist);\nOpenCVResult HoughCirclesWithParams(Mat src, Mat circles, int method, double dp, double minDist,\n                            double param1, double param2, int minRadius, int maxRadius);\nOpenCVResult HoughLines(Mat src, Mat lines, double rho, double theta, int threshold);\nOpenCVResult HoughLinesP(Mat src, Mat lines, double rho, double theta, int threshold);\nOpenCVResult HoughLinesPWithParams(Mat src, Mat lines, double rho, double theta, int threshold, double minLineLength, double maxLineGap);\nOpenCVResult HoughLinesPointSet(Mat points, Mat lines, int lines_max, int threshold,\n                        double min_rho, double  max_rho, double rho_step,\n                        double min_theta, double max_theta, double theta_step);\nOpenCVResult Integral(Mat src, Mat sum, Mat sqsum, Mat tilted);\ndouble Threshold(Mat src, Mat dst, double thresh, double maxvalue, int typ);\nOpenCVResult AdaptiveThreshold(Mat src, Mat dst, double maxValue, int adaptiveTyp, int typ, int blockSize,\n                       double c);\n\nOpenCVResult ArrowedLine(Mat img, Point pt1, Point pt2, Scalar color, int thickness);\nOpenCVResult Circle(Mat img, Point center, int radius, Scalar color, int thickness);\nOpenCVResult CircleWithParams(Mat img, Point center, int radius, Scalar color, int thickness, int lineType, int shift);\nOpenCVResult Ellipse(Mat img, Point center, Point axes, double angle, double\n             startAngle, double endAngle, Scalar color, int thickness);\nOpenCVResult EllipseWithParams(Mat img, Point center, Point axes, double angle, double\n             startAngle, double endAngle, Scalar color, int thickness, int lineType, int shift);\nOpenCVResult Line(Mat img, Point pt1, Point pt2, Scalar color, int thickness);\nOpenCVResult Rectangle(Mat img, Rect rect, Scalar color, int thickness);\nOpenCVResult RectangleWithParams(Mat img, Rect rect, Scalar color, int thickness, int lineType, int shift);\nOpenCVResult FillPoly(Mat img, PointsVector points, Scalar color);\nOpenCVResult FillPolyWithParams(Mat img, PointsVector points, Scalar color, int lineType, int shift, Point offset);\nOpenCVResult Polylines(Mat img, PointsVector points, bool isClosed, Scalar color, int thickness);\nstruct Size GetTextSize(const char* text, int fontFace, double fontScale, int thickness);\nstruct Size GetTextSizeWithBaseline(const char* text, int fontFace, double fontScale, int thickness, int* baseline);\nOpenCVResult PutText(Mat img, const char* text, Point org, int fontFace, double fontScale,\n            Scalar color, int thickness);\nOpenCVResult PutTextWithParams(Mat img, const char* text, Point org, int fontFace, double fontScale,\n            Scalar color, int thickness, int lineType, bool bottomLeftOrigin);\nOpenCVResult Resize(Mat src, Mat dst, Size sz, double fx, double fy, int interp);\nOpenCVResult GetRectSubPix(Mat src, Size patchSize, Point center, Mat dst);\nMat GetRotationMatrix2D(Point center, double angle, double scale);\nOpenCVResult WarpAffine(Mat src, Mat dst, Mat rot_mat, Size dsize);\nOpenCVResult WarpAffineWithParams(Mat src, Mat dst, Mat rot_mat, Size dsize, int flags, int borderMode, Scalar borderValue);\nOpenCVResult WarpPerspective(Mat src, Mat dst, Mat m, Size dsize);\nOpenCVResult WarpPerspectiveWithParams(Mat src, Mat dst, Mat rot_mat, Size dsize, int flags, int borderMode,\n                               Scalar borderValue);\nOpenCVResult Watershed(Mat image, Mat markers);\nOpenCVResult ApplyColorMap(Mat src, Mat dst, int colormap);\nOpenCVResult ApplyCustomColorMap(Mat src, Mat dst, Mat colormap);\nMat GetPerspectiveTransform(PointVector src, PointVector dst);\nMat GetPerspectiveTransform2f(Point2fVector src, Point2fVector dst);\nMat GetAffineTransform(PointVector src, PointVector dst);\nMat GetAffineTransform2f(Point2fVector src, Point2fVector dst);\nOpenCVResult DrawContours(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness);\nOpenCVResult DrawContoursWithParams(Mat src, PointsVector contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset);\nOpenCVResult Sobel(Mat src, Mat dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType);\nOpenCVResult SpatialGradient(Mat src, Mat dx, Mat dy, int ksize, int borderType);\nOpenCVResult Remap(Mat src, Mat dst, Mat map1, Mat map2, int interpolation, int borderMode, Scalar borderValue);\nOpenCVResult Filter2D(Mat src, Mat dst, int ddepth, Mat kernel, Point anchor, double delta, int borderType);\nOpenCVResult SepFilter2D(Mat src, Mat dst, int ddepth, Mat kernelX, Mat kernelY, Point anchor, double delta, int borderType);\nOpenCVResult LogPolar(Mat src, Mat dst, Point center, double m, int flags);\nOpenCVResult FitLine(PointVector pts, Mat line, int distType, double param, double reps, double aeps);\nOpenCVResult LinearPolar(Mat src, Mat dst, Point center, double maxRadius, int flags);\ndouble MatchShapes(PointVector contour1, PointVector contour2, int method, double parameter);\nbool ClipLine(Size imgSize, Point pt1, Point pt2);\nCLAHE CLAHE_Create();\nCLAHE CLAHE_CreateWithParams(double clipLimit, Size tileGridSize);\nvoid CLAHE_Close(CLAHE c);\nOpenCVResult CLAHE_Apply(CLAHE c, Mat src, Mat dst);\nOpenCVResult InvertAffineTransform(Mat src, Mat dst);\nPoint2f PhaseCorrelate(Mat src1, Mat src2, Mat window, double* response);\nOpenCVResult CreateHanningWindow(Mat dst, Size size, int typ);\nOpenCVResult Mat_Accumulate(Mat src, Mat dst);\nOpenCVResult Mat_AccumulateWithMask(Mat src, Mat dst, Mat mask);\nOpenCVResult Mat_AccumulateSquare(Mat src, Mat dst);\nOpenCVResult Mat_AccumulateSquareWithMask(Mat src, Mat dst, Mat mask);\nOpenCVResult Mat_AccumulateProduct(Mat src1, Mat src2, Mat dst);\nOpenCVResult Mat_AccumulateProductWithMask(Mat src1, Mat src2, Mat dst, Mat mask);\nOpenCVResult Mat_AccumulatedWeighted(Mat src, Mat dst, double alpha);\nOpenCVResult Mat_AccumulatedWeightedWithMask(Mat src, Mat dst, double alpha, Mat mask);\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_IMGPROC_H_\n"
  },
  {
    "path": "imgproc_colorcodes.go",
    "content": "package gocv\n\n// ColorConversionCode is a color conversion code used on Mat.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d7/d1b/group__imgproc__misc.html#ga4e0972be5de079fed4e3a10e24ef5ef0\ntype ColorConversionCode int\n\nconst (\n\t// ColorBGRToBGRA adds alpha channel to BGR image.\n\tColorBGRToBGRA ColorConversionCode = 0\n\t// ColorRGBToRGBA adds alpha channel to RGB image.\n\tColorRGBToRGBA ColorConversionCode = ColorBGRToBGRA\n\n\t// ColorBGRAToBGR removes alpha channel from BGR image.\n\tColorBGRAToBGR ColorConversionCode = 1\n\t// ColorRGBAToRGB removes alpha channel from RGB image.\n\tColorRGBAToRGB ColorConversionCode = ColorBGRAToBGR\n\n\t// ColorBGRToRGBA converts from BGR to RGB with alpha channel.\n\tColorBGRToRGBA ColorConversionCode = 2\n\t// ColorRGBToBGRA converts from RGB to BGR with alpha channel.\n\tColorRGBToBGRA ColorConversionCode = ColorBGRToRGBA\n\n\t// ColorRGBAToBGR converts from RGB with alpha to BGR color space.\n\tColorRGBAToBGR ColorConversionCode = 3\n\t// ColorBGRAToRGB converts from BRG with alpha to RGB color space.\n\tColorBGRAToRGB ColorConversionCode = ColorRGBAToBGR\n\n\t// ColorBGRToRGB converts from BGR to RGB without alpha channel.\n\tColorBGRToRGB ColorConversionCode = 4\n\t// ColorRGBToBGR converts from RGB to BGR without alpha channel.\n\tColorRGBToBGR ColorConversionCode = ColorBGRToRGB\n\n\t// ColorBGRAToRGBA converts from BGR with alpha channel\n\t// to RGB with alpha channel.\n\tColorBGRAToRGBA ColorConversionCode = 5\n\t// ColorRGBAToBGRA converts from RGB with alpha channel\n\t// to BGR with alpha channel.\n\tColorRGBAToBGRA ColorConversionCode = ColorBGRAToRGBA\n\n\t// ColorBGRToGray converts from BGR to grayscale.\n\tColorBGRToGray ColorConversionCode = 6\n\n\t// ColorRGBToGray converts from RGB to grayscale.\n\tColorRGBToGray ColorConversionCode = 7\n\n\t// ColorGrayToBGR converts from grayscale to BGR.\n\tColorGrayToBGR ColorConversionCode = 8\n\t// ColorGrayToRGB converts from grayscale to RGB.\n\tColorGrayToRGB ColorConversionCode = ColorGrayToBGR\n\n\t// ColorGrayToBGRA converts from grayscale to BGR with alpha channel.\n\tColorGrayToBGRA ColorConversionCode = 9\n\t// ColorGrayToRGBA converts from grayscale to RGB with alpha channel.\n\tColorGrayToRGBA ColorConversionCode = ColorGrayToBGRA\n\n\t// ColorBGRAToGray converts from BGR with alpha channel to grayscale.\n\tColorBGRAToGray ColorConversionCode = 10\n\n\t// ColorRGBAToGray converts from RGB with alpha channel to grayscale.\n\tColorRGBAToGray ColorConversionCode = 11\n\n\t// ColorBGRToBGR565 converts from BGR to BGR565 (16-bit images).\n\tColorBGRToBGR565 ColorConversionCode = 12\n\n\t// ColorRGBToBGR565 converts from RGB to BGR565 (16-bit images).\n\tColorRGBToBGR565 ColorConversionCode = 13\n\n\t// ColorBGR565ToBGR converts from BGR565 (16-bit images) to BGR.\n\tColorBGR565ToBGR ColorConversionCode = 14\n\n\t// ColorBGR565ToRGB converts from BGR565 (16-bit images) to RGB.\n\tColorBGR565ToRGB ColorConversionCode = 15\n\n\t// ColorBGRAToBGR565 converts from BGRA (with alpha channel)\n\t// to BGR565 (16-bit images).\n\tColorBGRAToBGR565 ColorConversionCode = 16\n\n\t// ColorRGBAToBGR565 converts from RGBA (with alpha channel)\n\t// to BGR565 (16-bit images).\n\tColorRGBAToBGR565 ColorConversionCode = 17\n\n\t// ColorBGR565ToBGRA converts from BGR565 (16-bit images)\n\t// to BGRA (with alpha channel).\n\tColorBGR565ToBGRA ColorConversionCode = 18\n\n\t// ColorBGR565ToRGBA converts from BGR565 (16-bit images)\n\t// to RGBA (with alpha channel).\n\tColorBGR565ToRGBA ColorConversionCode = 19\n\n\t// ColorGrayToBGR565 converts from grayscale\n\t// to BGR565 (16-bit images).\n\tColorGrayToBGR565 ColorConversionCode = 20\n\n\t// ColorBGR565ToGray converts from BGR565 (16-bit images)\n\t// to grayscale.\n\tColorBGR565ToGray ColorConversionCode = 21\n\n\t// ColorBGRToBGR555 converts from BGR to BGR555 (16-bit images).\n\tColorBGRToBGR555 ColorConversionCode = 22\n\n\t// ColorRGBToBGR555 converts from RGB to BGR555 (16-bit images).\n\tColorRGBToBGR555 ColorConversionCode = 23\n\n\t// ColorBGR555ToBGR converts from BGR555 (16-bit images) to BGR.\n\tColorBGR555ToBGR ColorConversionCode = 24\n\n\t// ColorBGR555ToRGB converts from BGR555 (16-bit images) to RGB.\n\tColorBGR555ToRGB ColorConversionCode = 25\n\n\t// ColorBGRAToBGR555 converts from BGRA (with alpha channel)\n\t// to BGR555 (16-bit images).\n\tColorBGRAToBGR555 ColorConversionCode = 26\n\n\t// ColorRGBAToBGR555 converts from RGBA (with alpha channel)\n\t// to BGR555 (16-bit images).\n\tColorRGBAToBGR555 ColorConversionCode = 27\n\n\t// ColorBGR555ToBGRA converts from BGR555 (16-bit images)\n\t// to BGRA (with alpha channel).\n\tColorBGR555ToBGRA ColorConversionCode = 28\n\n\t// ColorBGR555ToRGBA converts from BGR555 (16-bit images)\n\t// to RGBA (with alpha channel).\n\tColorBGR555ToRGBA ColorConversionCode = 29\n\n\t// ColorGrayToBGR555 converts from grayscale to BGR555 (16-bit images).\n\tColorGrayToBGR555 ColorConversionCode = 30\n\n\t// ColorBGR555ToGRAY converts from BGR555 (16-bit images) to grayscale.\n\tColorBGR555ToGRAY ColorConversionCode = 31\n\n\t// ColorBGRToXYZ converts from BGR to CIE XYZ.\n\tColorBGRToXYZ ColorConversionCode = 32\n\n\t// ColorRGBToXYZ converts from RGB to CIE XYZ.\n\tColorRGBToXYZ ColorConversionCode = 33\n\n\t// ColorXYZToBGR converts from CIE XYZ to BGR.\n\tColorXYZToBGR ColorConversionCode = 34\n\n\t// ColorXYZToRGB converts from CIE XYZ to RGB.\n\tColorXYZToRGB ColorConversionCode = 35\n\n\t// ColorBGRToYCrCb converts from BGR to luma-chroma (aka YCC).\n\tColorBGRToYCrCb ColorConversionCode = 36\n\n\t// ColorRGBToYCrCb converts from RGB to luma-chroma (aka YCC).\n\tColorRGBToYCrCb ColorConversionCode = 37\n\n\t// ColorYCrCbToBGR converts from luma-chroma (aka YCC) to BGR.\n\tColorYCrCbToBGR ColorConversionCode = 38\n\n\t// ColorYCrCbToRGB converts from luma-chroma (aka YCC) to RGB.\n\tColorYCrCbToRGB ColorConversionCode = 39\n\n\t// ColorBGRToHSV converts from BGR to HSV (hue saturation value).\n\tColorBGRToHSV ColorConversionCode = 40\n\n\t// ColorRGBToHSV converts from RGB to HSV (hue saturation value).\n\tColorRGBToHSV ColorConversionCode = 41\n\n\t// ColorBGRToLab converts from BGR to CIE Lab.\n\tColorBGRToLab ColorConversionCode = 44\n\n\t// ColorRGBToLab converts from RGB to CIE Lab.\n\tColorRGBToLab ColorConversionCode = 45\n\n\t// ColorBGRToLuv converts from BGR to CIE Luv.\n\tColorBGRToLuv ColorConversionCode = 50\n\n\t// ColorRGBToLuv converts from RGB to CIE Luv.\n\tColorRGBToLuv ColorConversionCode = 51\n\n\t// ColorBGRToHLS converts from BGR to HLS (hue lightness saturation).\n\tColorBGRToHLS ColorConversionCode = 52\n\n\t// ColorRGBToHLS converts from RGB to HLS (hue lightness saturation).\n\tColorRGBToHLS ColorConversionCode = 53\n\n\t// ColorHSVToBGR converts from HSV (hue saturation value) to BGR.\n\tColorHSVToBGR ColorConversionCode = 54\n\n\t// ColorHSVToRGB converts from HSV (hue saturation value) to RGB.\n\tColorHSVToRGB ColorConversionCode = 55\n\n\t// ColorLabToBGR converts from CIE Lab to BGR.\n\tColorLabToBGR ColorConversionCode = 56\n\n\t// ColorLabToRGB converts from CIE Lab to RGB.\n\tColorLabToRGB ColorConversionCode = 57\n\n\t// ColorLuvToBGR converts from CIE Luv to BGR.\n\tColorLuvToBGR ColorConversionCode = 58\n\n\t// ColorLuvToRGB converts from CIE Luv to RGB.\n\tColorLuvToRGB ColorConversionCode = 59\n\n\t// ColorHLSToBGR converts from HLS (hue lightness saturation) to BGR.\n\tColorHLSToBGR ColorConversionCode = 60\n\n\t// ColorHLSToRGB converts from HLS (hue lightness saturation) to RGB.\n\tColorHLSToRGB ColorConversionCode = 61\n\n\t// ColorBGRToHSVFull converts from BGR to HSV (hue saturation value) full.\n\tColorBGRToHSVFull ColorConversionCode = 66\n\n\t// ColorRGBToHSVFull converts from RGB to HSV (hue saturation value) full.\n\tColorRGBToHSVFull ColorConversionCode = 67\n\n\t// ColorBGRToHLSFull converts from BGR to HLS (hue lightness saturation) full.\n\tColorBGRToHLSFull ColorConversionCode = 68\n\n\t// ColorRGBToHLSFull converts from RGB to HLS (hue lightness saturation) full.\n\tColorRGBToHLSFull ColorConversionCode = 69\n\n\t// ColorHSVToBGRFull converts from HSV (hue saturation value) to BGR full.\n\tColorHSVToBGRFull ColorConversionCode = 70\n\n\t// ColorHSVToRGBFull converts from HSV (hue saturation value) to RGB full.\n\tColorHSVToRGBFull ColorConversionCode = 71\n\n\t// ColorHLSToBGRFull converts from HLS (hue lightness saturation) to BGR full.\n\tColorHLSToBGRFull ColorConversionCode = 72\n\n\t// ColorHLSToRGBFull converts from HLS (hue lightness saturation) to RGB full.\n\tColorHLSToRGBFull ColorConversionCode = 73\n\n\t// ColorLBGRToLab converts from LBGR to CIE Lab.\n\tColorLBGRToLab ColorConversionCode = 74\n\n\t// ColorLRGBToLab converts from LRGB to CIE Lab.\n\tColorLRGBToLab ColorConversionCode = 75\n\n\t// ColorLBGRToLuv converts from LBGR to CIE Luv.\n\tColorLBGRToLuv ColorConversionCode = 76\n\n\t// ColorLRGBToLuv converts from LRGB to CIE Luv.\n\tColorLRGBToLuv ColorConversionCode = 77\n\n\t// ColorLabToLBGR converts from CIE Lab to LBGR.\n\tColorLabToLBGR ColorConversionCode = 78\n\n\t// ColorLabToLRGB converts from CIE Lab to LRGB.\n\tColorLabToLRGB ColorConversionCode = 79\n\n\t// ColorLuvToLBGR converts from CIE Luv to LBGR.\n\tColorLuvToLBGR ColorConversionCode = 80\n\n\t// ColorLuvToLRGB converts from CIE Luv to LRGB.\n\tColorLuvToLRGB ColorConversionCode = 81\n\n\t// ColorBGRToYUV converts from BGR to YUV.\n\tColorBGRToYUV ColorConversionCode = 82\n\n\t// ColorRGBToYUV converts from RGB to YUV.\n\tColorRGBToYUV ColorConversionCode = 83\n\n\t// ColorYUVToBGR converts from YUV to BGR.\n\tColorYUVToBGR ColorConversionCode = 84\n\n\t// ColorYUVToRGB converts from YUV to RGB.\n\tColorYUVToRGB ColorConversionCode = 85\n\n\t// ColorYUVToRGBNV12 converts from YUV 4:2:0 to RGB NV12.\n\tColorYUVToRGBNV12 ColorConversionCode = 90\n\n\t// ColorYUVToBGRNV12 converts from YUV 4:2:0 to BGR NV12.\n\tColorYUVToBGRNV12 ColorConversionCode = 91\n\n\t// ColorYUVToRGBNV21 converts from YUV 4:2:0 to RGB NV21.\n\tColorYUVToRGBNV21 ColorConversionCode = 92\n\n\t// ColorYUVToBGRNV21 converts from YUV 4:2:0 to BGR NV21.\n\tColorYUVToBGRNV21 ColorConversionCode = 93\n\n\t// ColorYUVToRGBANV12 converts from YUV 4:2:0 to RGBA NV12.\n\tColorYUVToRGBANV12 ColorConversionCode = 94\n\n\t// ColorYUVToBGRANV12 converts from YUV 4:2:0 to BGRA NV12.\n\tColorYUVToBGRANV12 ColorConversionCode = 95\n\n\t// ColorYUVToRGBANV21 converts from YUV 4:2:0 to RGBA NV21.\n\tColorYUVToRGBANV21 ColorConversionCode = 96\n\n\t// ColorYUVToBGRANV21 converts from YUV 4:2:0 to BGRA NV21.\n\tColorYUVToBGRANV21 ColorConversionCode = 97\n\n\tColorYUVToRGBYV12 ColorConversionCode = 98\n\tColorYUVToBGRYV12 ColorConversionCode = 99\n\tColorYUVToRGBIYUV ColorConversionCode = 100\n\tColorYUVToBGRIYUV ColorConversionCode = 101\n\n\tColorYUVToRGBAYV12 ColorConversionCode = 102\n\tColorYUVToBGRAYV12 ColorConversionCode = 103\n\tColorYUVToRGBAIYUV ColorConversionCode = 104\n\tColorYUVToBGRAIYUV ColorConversionCode = 105\n\n\tColorYUVToGRAY420 ColorConversionCode = 106\n\n\t// YUV 4:2:2 family to RGB\n\tColorYUVToRGBUYVY ColorConversionCode = 107\n\tColorYUVToBGRUYVY ColorConversionCode = 108\n\n\tColorYUVToRGBAUYVY ColorConversionCode = 111\n\tColorYUVToBGRAUYVY ColorConversionCode = 112\n\n\tColorYUVToRGBYUY2 ColorConversionCode = 115\n\tColorYUVToBGRYUY2 ColorConversionCode = 116\n\tColorYUVToRGBYVYU ColorConversionCode = 117\n\tColorYUVToBGRYVYU ColorConversionCode = 118\n\n\tColorYUVToRGBAYUY2 ColorConversionCode = 119\n\tColorYUVToBGRAYUY2 ColorConversionCode = 120\n\tColorYUVToRGBAYVYU ColorConversionCode = 121\n\tColorYUVToBGRAYVYU ColorConversionCode = 122\n\n\tColorYUVToGRAYUYVY ColorConversionCode = 123\n\tColorYUVToGRAYYUY2 ColorConversionCode = 124\n\n\t// alpha premultiplication\n\tColorRGBATomRGBA ColorConversionCode = 125\n\tColormRGBAToRGBA ColorConversionCode = 126\n\n\t// RGB to YUV 4:2:0 family\n\tColorRGBToYUVI420 ColorConversionCode = 127\n\tColorBGRToYUVI420 ColorConversionCode = 128\n\n\tColorRGBAToYUVI420 ColorConversionCode = 129\n\tColorBGRAToYUVI420 ColorConversionCode = 130\n\tColorRGBToYUVYV12  ColorConversionCode = 131\n\tColorBGRToYUVYV12  ColorConversionCode = 132\n\tColorRGBAToYUVYV12 ColorConversionCode = 133\n\tColorBGRAToYUVYV12 ColorConversionCode = 134\n\n\t// Demosaicing\n\tColorBayerBGToBGR ColorConversionCode = 46\n\tColorBayerGBToBGR ColorConversionCode = 47\n\tColorBayerRGToBGR ColorConversionCode = 48\n\tColorBayerGRToBGR ColorConversionCode = 49\n\n\tColorBayerBGToRGB ColorConversionCode = ColorBayerRGToBGR\n\tColorBayerGBToRGB ColorConversionCode = ColorBayerGRToBGR\n\tColorBayerRGToRGB ColorConversionCode = ColorBayerBGToBGR\n\tColorBayerGRToRGB ColorConversionCode = ColorBayerGBToBGR\n\n\tColorBayerBGToGRAY ColorConversionCode = 86\n\tColorBayerGBToGRAY ColorConversionCode = 87\n\tColorBayerRGToGRAY ColorConversionCode = 88\n\tColorBayerGRToGRAY ColorConversionCode = 89\n\n\t// Demosaicing using Variable Number of Gradients\n\tColorBayerBGToBGRVNG ColorConversionCode = 62\n\tColorBayerGBToBGRVNG ColorConversionCode = 63\n\tColorBayerRGToBGRVNG ColorConversionCode = 64\n\tColorBayerGRToBGRVNG ColorConversionCode = 65\n\n\tColorBayerBGToRGBVNG ColorConversionCode = ColorBayerRGToBGRVNG\n\tColorBayerGBToRGBVNG ColorConversionCode = ColorBayerGRToBGRVNG\n\tColorBayerRGToRGBVNG ColorConversionCode = ColorBayerBGToBGRVNG\n\tColorBayerGRToRGBVNG ColorConversionCode = ColorBayerGBToBGRVNG\n\n\t// Edge-Aware Demosaicing\n\tColorBayerBGToBGREA ColorConversionCode = 135\n\tColorBayerGBToBGREA ColorConversionCode = 136\n\tColorBayerRGToBGREA ColorConversionCode = 137\n\tColorBayerGRToBGREA ColorConversionCode = 138\n\n\tColorBayerBGToRGBEA ColorConversionCode = ColorBayerRGToBGREA\n\tColorBayerGBToRGBEA ColorConversionCode = ColorBayerGRToBGREA\n\tColorBayerRGToRGBEA ColorConversionCode = ColorBayerBGToBGREA\n\tColorBayerGRToRGBEA ColorConversionCode = ColorBayerGBToBGREA\n\n\t// Demosaicing with alpha channel\n\tColorBayerBGToBGRA ColorConversionCode = 139\n\tColorBayerGBToBGRA ColorConversionCode = 140\n\tColorBayerRGToBGRA ColorConversionCode = 141\n\tColorBayerGRToBGRA ColorConversionCode = 142\n\n\tColorBayerBGToRGBA ColorConversionCode = ColorBayerRGToBGRA\n\tColorBayerGBToRGBA ColorConversionCode = ColorBayerGRToBGRA\n\tColorBayerRGToRGBA ColorConversionCode = ColorBayerBGToBGRA\n\tColorBayerGRToRGBA ColorConversionCode = ColorBayerGBToBGRA\n\n\tColorCOLORCVTMAX ColorConversionCode = 143\n)\n"
  },
  {
    "path": "imgproc_colorcodes_string.go",
    "content": "package gocv\n\nfunc (c ColorConversionCode) String() string {\n\tswitch c {\n\tcase ColorBGRToBGRA:\n\t\treturn \"color-bgr-to-bgra\"\n\tcase ColorBGRAToBGR:\n\t\treturn \"color-bgra-to-bgr\"\n\tcase ColorBGRToRGBA:\n\t\treturn \"color-bgr-to-rgba\"\n\tcase ColorRGBAToBGR:\n\t\treturn \"color-rgba-to-bgr\"\n\tcase ColorBGRToRGB:\n\t\treturn \"color-bgr-to-rgb\"\n\tcase ColorBGRAToRGBA:\n\t\treturn \"color-bgra-to-rgba\"\n\tcase ColorBGRToGray:\n\t\treturn \"color-bgr-to-gray\"\n\tcase ColorRGBToGray:\n\t\treturn \"color-rgb-to-gray\"\n\tcase ColorGrayToBGR:\n\t\treturn \"color-gray-to-bgr\"\n\tcase ColorGrayToBGRA:\n\t\treturn \"color-gray-to-bgra\"\n\tcase ColorBGRAToGray:\n\t\treturn \"color-bgra-to-gray\"\n\tcase ColorRGBAToGray:\n\t\treturn \"color-rgba-to-gray\"\n\tcase ColorBGRToBGR565:\n\t\treturn \"color-bgr-to-bgr565\"\n\tcase ColorRGBToBGR565:\n\t\treturn \"color-rgb-to-bgr565\"\n\tcase ColorBGR565ToBGR:\n\t\treturn \"color-bgr565-to-bgr\"\n\tcase ColorBGR565ToRGB:\n\t\treturn \"color-bgr565-to-rgb\"\n\tcase ColorBGRAToBGR565:\n\t\treturn \"color-bgra-to-bgr565\"\n\tcase ColorRGBAToBGR565:\n\t\treturn \"color-rgba-to-bgr565\"\n\tcase ColorBGR565ToBGRA:\n\t\treturn \"color-bgr565-to-bgra\"\n\tcase ColorBGR565ToRGBA:\n\t\treturn \"color-bgr565-to-rgba\"\n\tcase ColorGrayToBGR565:\n\t\treturn \"color-gray-to-bgr565\"\n\tcase ColorBGR565ToGray:\n\t\treturn \"color-bgr565-to-gray\"\n\tcase ColorBGRToBGR555:\n\t\treturn \"color-bgr-to-bgr555\"\n\tcase ColorRGBToBGR555:\n\t\treturn \"color-rgb-to-bgr555\"\n\tcase ColorBGR555ToBGR:\n\t\treturn \"color-bgr555-to-bgr\"\n\tcase ColorBGRAToBGR555:\n\t\treturn \"color-bgra-to-bgr555\"\n\tcase ColorRGBAToBGR555:\n\t\treturn \"color-rgba-to-bgr555\"\n\tcase ColorBGR555ToBGRA:\n\t\treturn \"color-bgr555-to-bgra\"\n\tcase ColorBGR555ToRGBA:\n\t\treturn \"color-bgr555-to-rgba\"\n\tcase ColorGrayToBGR555:\n\t\treturn \"color-gray-to-bgr555\"\n\tcase ColorBGR555ToGRAY:\n\t\treturn \"color-bgr555-to-gray\"\n\tcase ColorBGRToXYZ:\n\t\treturn \"color-bgr-to-xyz\"\n\tcase ColorRGBToXYZ:\n\t\treturn \"color-rgb-to-xyz\"\n\tcase ColorXYZToBGR:\n\t\treturn \"color-xyz-to-bgr\"\n\tcase ColorXYZToRGB:\n\t\treturn \"color-xyz-to-rgb\"\n\tcase ColorBGRToYCrCb:\n\t\treturn \"color-bgr-to-ycrcb\"\n\tcase ColorRGBToYCrCb:\n\t\treturn \"color-rgb-to-ycrcb\"\n\tcase ColorYCrCbToBGR:\n\t\treturn \"color-ycrcb-to-bgr\"\n\tcase ColorYCrCbToRGB:\n\t\treturn \"color-ycrcb-to-rgb\"\n\tcase ColorBGRToHSV:\n\t\treturn \"color-bgr-to-hsv\"\n\tcase ColorRGBToHSV:\n\t\treturn \"color-rgb-to-hsv\"\n\tcase ColorBGRToLab:\n\t\treturn \"color-bgr-to-lab\"\n\tcase ColorRGBToLab:\n\t\treturn \"color-rgb-to-lab\"\n\tcase ColorBGRToLuv:\n\t\treturn \"color-bgr-to-luv\"\n\tcase ColorRGBToLuv:\n\t\treturn \"color-rgb-to-luv\"\n\tcase ColorBGRToHLS:\n\t\treturn \"color-bgr-to-hls\"\n\tcase ColorRGBToHLS:\n\t\treturn \"color-rgb-to-hls\"\n\tcase ColorHSVToBGR:\n\t\treturn \"color-hsv-to-bgr\"\n\tcase ColorHSVToRGB:\n\t\treturn \"color-hsv-to-rgb\"\n\tcase ColorLabToBGR:\n\t\treturn \"color-lab-to-bgr\"\n\tcase ColorLabToRGB:\n\t\treturn \"color-lab-to-rgb\"\n\tcase ColorLuvToBGR:\n\t\treturn \"color-luv-to-bgr\"\n\tcase ColorLuvToRGB:\n\t\treturn \"color-luv-to-rgb\"\n\tcase ColorHLSToBGR:\n\t\treturn \"color-hls-to-bgr\"\n\tcase ColorHLSToRGB:\n\t\treturn \"color-hls-to-rgb\"\n\tcase ColorBGRToHSVFull:\n\t\treturn \"color-bgr-to-hsv-full\"\n\tcase ColorRGBToHSVFull:\n\t\treturn \"color-rgb-to-hsv-full\"\n\tcase ColorBGRToHLSFull:\n\t\treturn \"color-bgr-to-hls-full\"\n\tcase ColorRGBToHLSFull:\n\t\treturn \"color-rgb-to-hls-full\"\n\tcase ColorHSVToBGRFull:\n\t\treturn \"color-hsv-to-bgr-full\"\n\tcase ColorHSVToRGBFull:\n\t\treturn \"color-hsv-to-rgb-full\"\n\tcase ColorHLSToBGRFull:\n\t\treturn \"color-hls-to-bgr-full\"\n\tcase ColorHLSToRGBFull:\n\t\treturn \"color-hls-to-rgb-full\"\n\tcase ColorLBGRToLab:\n\t\treturn \"color-lbgr-to-lab\"\n\tcase ColorLRGBToLab:\n\t\treturn \"color-lrgb-to-lab\"\n\tcase ColorLBGRToLuv:\n\t\treturn \"color-lbgr-to-luv\"\n\tcase ColorLRGBToLuv:\n\t\treturn \"color-lrgb-to-luv\"\n\tcase ColorLabToLBGR:\n\t\treturn \"color-lab-to-lbgr\"\n\tcase ColorLabToLRGB:\n\t\treturn \"color-lab-to-lrgb\"\n\tcase ColorLuvToLBGR:\n\t\treturn \"color-luv-to-lbgr\"\n\tcase ColorLuvToLRGB:\n\t\treturn \"color-luv-to-lrgb\"\n\tcase ColorBGRToYUV:\n\t\treturn \"color-bgr-to-yuv\"\n\tcase ColorRGBToYUV:\n\t\treturn \"color-rgb-to-yuv\"\n\tcase ColorYUVToBGR:\n\t\treturn \"color-yuv-to-bgr\"\n\tcase ColorYUVToRGB:\n\t\treturn \"color-yuv-to-rgb\"\n\n\tcase ColorYUVToRGBNV12:\n\t\treturn \"color-yuv-to-rgbnv12\"\n\tcase ColorYUVToBGRNV12:\n\t\treturn \"color-yuv-to-bgrnv12\"\n\tcase ColorYUVToRGBNV21:\n\t\treturn \"color-yuv-to-rgbnv21\"\n\tcase ColorYUVToBGRNV21:\n\t\treturn \"color-yuv-to-bgrnv21\"\n\n\tcase ColorYUVToRGBANV12:\n\t\treturn \"color-yuv-to-rgbanv12\"\n\tcase ColorYUVToBGRANV12:\n\t\treturn \"color-yuv-to-bgranv12\"\n\tcase ColorYUVToRGBANV21:\n\t\treturn \"color-yuv-to-rgbanv21\"\n\tcase ColorYUVToBGRANV21:\n\t\treturn \"color-yuv-to-bgranv21\"\n\n\tcase ColorYUVToRGBYV12:\n\t\treturn \"color-yuv-to-rgbyv12\"\n\tcase ColorYUVToBGRYV12:\n\t\treturn \"color-yuv-to-bgryv12\"\n\n\tcase ColorYUVToRGBIYUV:\n\t\treturn \"color-yuv-to-rgbiyuv\"\n\tcase ColorYUVToBGRIYUV:\n\t\treturn \"color-yuv-to-bgriyuv\"\n\n\tcase ColorYUVToRGBAYV12:\n\t\treturn \"color-yuv-to-rgbayv12\"\n\tcase ColorYUVToBGRAYV12:\n\t\treturn \"color-yuv-to-bgrayv12\"\n\tcase ColorYUVToRGBAIYUV:\n\t\treturn \"color-yuv-to-rgbaiyuv\"\n\tcase ColorYUVToBGRAIYUV:\n\t\treturn \"color-yuv-to-bgraiyuv\"\n\n\tcase ColorYUVToGRAY420:\n\t\treturn \"color-yuv-to-gray420\"\n\n\tcase ColorYUVToRGBUYVY:\n\t\treturn \"color-yuv-to-rgbuyvy\"\n\tcase ColorYUVToBGRUYVY:\n\t\treturn \"color-yuv-to-bgruyvy\"\n\n\tcase ColorYUVToRGBAUYVY:\n\t\treturn \"color-yuv-to-rgbauyvy\"\n\tcase ColorYUVToBGRAUYVY:\n\t\treturn \"color-yuv-to-bgrauyvy\"\n\n\tcase ColorYUVToRGBYUY2:\n\t\treturn \"color-yuv-to-rgbyuy2\"\n\tcase ColorYUVToBGRYUY2:\n\t\treturn \"color-yuv-to-bgryuy2\"\n\n\tcase ColorYUVToRGBYVYU:\n\t\treturn \"color-yuv-to-rgbyvyu\"\n\tcase ColorYUVToBGRYVYU:\n\t\treturn \"color-yuv-to-bgryvyu\"\n\n\tcase ColorYUVToRGBAYUY2:\n\t\treturn \"color-yuv-to-rgbayuy2\"\n\tcase ColorYUVToBGRAYUY2:\n\t\treturn \"color-yuv-to-bgrayuy2\"\n\n\tcase ColorYUVToRGBAYVYU:\n\t\treturn \"color-yuv-to-rgbayvyu\"\n\tcase ColorYUVToBGRAYVYU:\n\t\treturn \"color-yuv-to-bgrayvyu\"\n\n\tcase ColorYUVToGRAYUYVY:\n\t\treturn \"color-yuv-to-grayuyvy\"\n\tcase ColorYUVToGRAYYUY2:\n\t\treturn \"color-yuv-to-grayyuy2\"\n\n\tcase ColorRGBATomRGBA:\n\t\treturn \"color-rgba-to-mrgba\"\n\tcase ColormRGBAToRGBA:\n\t\treturn \"color-mrgba-to-rgba\"\n\n\tcase ColorRGBToYUVI420:\n\t\treturn \"color-rgb-to-yuvi420\"\n\tcase ColorBGRToYUVI420:\n\t\treturn \"color-bgr-to-yuvi420\"\n\n\tcase ColorRGBAToYUVI420:\n\t\treturn \"color-rgba-to-yuvi420\"\n\n\tcase ColorBGRAToYUVI420:\n\t\treturn \"color-bgra-to-yuvi420\"\n\tcase ColorRGBToYUVYV12:\n\t\treturn \"color-rgb-to-yuvyv12\"\n\tcase ColorBGRToYUVYV12:\n\t\treturn \"color-bgr-to-yuvyv12\"\n\tcase ColorRGBAToYUVYV12:\n\t\treturn \"color-rgba-to-yuvyv12\"\n\tcase ColorBGRAToYUVYV12:\n\t\treturn \"color-bgra-to-yuvyv12\"\n\n\tcase ColorBayerBGToBGR:\n\t\treturn \"color-bayer-bgt-to-bgr\"\n\tcase ColorBayerGBToBGR:\n\t\treturn \"color-bayer-gbt-to-bgr\"\n\tcase ColorBayerRGToBGR:\n\t\treturn \"color-bayer-rgt-to-bgr\"\n\tcase ColorBayerGRToBGR:\n\t\treturn \"color-bayer-grt-to-bgr\"\n\n\tcase ColorBayerBGToGRAY:\n\t\treturn \"color-bayer-bgt-to-gray\"\n\tcase ColorBayerGBToGRAY:\n\t\treturn \"color-bayer-gbt-to-gray\"\n\tcase ColorBayerRGToGRAY:\n\t\treturn \"color-bayer-rgt-to-gray\"\n\tcase ColorBayerGRToGRAY:\n\t\treturn \"color-bayer-grt-to-gray\"\n\n\tcase ColorBayerBGToBGRVNG:\n\t\treturn \"color-bayer-bgt-to-bgrvng\"\n\tcase ColorBayerGBToBGRVNG:\n\t\treturn \"color-bayer-gbt-to-bgrvng\"\n\tcase ColorBayerRGToBGRVNG:\n\t\treturn \"color-bayer-rgt-to-bgrvng\"\n\tcase ColorBayerGRToBGRVNG:\n\t\treturn \"color-bayer-grt-to-bgrvng\"\n\n\tcase ColorBayerBGToBGREA:\n\t\treturn \"color-bayer-bgt-to-bgrea\"\n\tcase ColorBayerGBToBGREA:\n\t\treturn \"color-bayer-gbt-to-bgrea\"\n\tcase ColorBayerRGToBGREA:\n\t\treturn \"color-bayer-rgt-to-bgrea\"\n\tcase ColorBayerGRToBGREA:\n\t\treturn \"color-bayer-grt-to-bgrea\"\n\n\tcase ColorBayerBGToBGRA:\n\t\treturn \"color-bayer-bgt-to-bgra\"\n\tcase ColorBayerGBToBGRA:\n\t\treturn \"color-bayer-gbt-to-bgra\"\n\tcase ColorBayerRGToBGRA:\n\t\treturn \"color-bayer-rgt-to-bgra\"\n\tcase ColorBayerGRToBGRA:\n\t\treturn \"color-bayer-grt-to-bgra\"\n\tcase ColorCOLORCVTMAX:\n\t\treturn \"color-color-cvt-max\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "imgproc_string.go",
    "content": "package gocv\n\nfunc (c HistCompMethod) String() string {\n\tswitch c {\n\tcase HistCmpCorrel:\n\t\treturn \"hist-cmp-correl\"\n\tcase HistCmpChiSqr:\n\t\treturn \"hist-cmp-chi-sqr\"\n\tcase HistCmpIntersect:\n\t\treturn \"hist-cmp-intersect\"\n\tcase HistCmpBhattacharya:\n\t\treturn \"hist-cmp-bhattacharya\"\n\tcase HistCmpChiSqrAlt:\n\t\treturn \"hist-cmp-chi-sqr-alt\"\n\tcase HistCmpKlDiv:\n\t\treturn \"hist-cmp-kl-div\"\n\t}\n\treturn \"\"\n}\n\nfunc (c DistanceTransformLabelTypes) String() string {\n\tswitch c {\n\tcase DistanceLabelCComp:\n\t\treturn \"distance-label-ccomp\"\n\t}\n\treturn \"\"\n}\n\nfunc (c DistanceTransformMasks) String() string {\n\tswitch c {\n\tcase DistanceMask3:\n\t\treturn \"distance-mask3\"\n\t}\n\treturn \"\"\n}\n\nfunc (c RetrievalMode) String() string {\n\tswitch c {\n\tcase RetrievalExternal:\n\t\treturn \"retrieval-external\"\n\tcase RetrievalList:\n\t\treturn \"retrieval-list\"\n\tcase RetrievalCComp:\n\t\treturn \"retrieval-ccomp\"\n\tcase RetrievalTree:\n\t\treturn \"retrieval-tree\"\n\tcase RetrievalFloodfill:\n\t\treturn \"retrieval-floodfill\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ContourApproximationMode) String() string {\n\tswitch c {\n\tcase ChainApproxNone:\n\t\treturn \"chain-approx-none\"\n\tcase ChainApproxSimple:\n\t\treturn \"chain-approx-simple\"\n\tcase ChainApproxTC89L1:\n\t\treturn \"chain-approx-tc89l1\"\n\tcase ChainApproxTC89KCOS:\n\t\treturn \"chain-approx-tc89kcos\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ConnectedComponentsAlgorithmType) String() string {\n\tswitch c {\n\tcase CCL_WU:\n\t\treturn \"ccl-wu\"\n\tcase CCL_DEFAULT:\n\t\treturn \"ccl-default\"\n\tcase CCL_GRANA:\n\t\treturn \"ccl-grana\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ConnectedComponentsTypes) String() string {\n\tswitch c {\n\tcase CC_STAT_LEFT:\n\t\treturn \"cc-stat-left\"\n\tcase CC_STAT_TOP:\n\t\treturn \"cc-stat-top\"\n\tcase CC_STAT_WIDTH:\n\t\treturn \"cc-stat-width\"\n\tcase CC_STAT_AREA:\n\t\treturn \"cc-stat-area\"\n\tcase CC_STAT_MAX:\n\t\treturn \"cc-stat-max\"\n\tcase CC_STAT_HEIGHT:\n\t\treturn \"cc-stat-height\"\n\t}\n\treturn \"\"\n}\n\nfunc (c TemplateMatchMode) String() string {\n\tswitch c {\n\tcase TmSqdiff:\n\t\treturn \"tm-sq-diff\"\n\tcase TmSqdiffNormed:\n\t\treturn \"tm-sq-diff-normed\"\n\tcase TmCcorr:\n\t\treturn \"tm-ccorr\"\n\tcase TmCcorrNormed:\n\t\treturn \"tm-ccorr-normed\"\n\tcase TmCcoeff:\n\t\treturn \"tm-ccoeff\"\n\tcase TmCcoeffNormed:\n\t\treturn \"tm-ccoeff-normed\"\n\t}\n\treturn \"\"\n}\n\nfunc (c MorphShape) String() string {\n\tswitch c {\n\tcase MorphRect:\n\t\treturn \"morph-rect\"\n\tcase MorphCross:\n\t\treturn \"morph-cross\"\n\tcase MorphEllipse:\n\t\treturn \"morph-ellispe\"\n\t}\n\treturn \"\"\n}\n\nfunc (c MorphType) String() string {\n\tswitch c {\n\tcase MorphErode:\n\t\treturn \"morph-erode\"\n\tcase MorphDilate:\n\t\treturn \"morph-dilate\"\n\tcase MorphOpen:\n\t\treturn \"morph-open\"\n\tcase MorphClose:\n\t\treturn \"morph-close\"\n\tcase MorphGradient:\n\t\treturn \"morph-gradient\"\n\tcase MorphTophat:\n\t\treturn \"morph-tophat\"\n\tcase MorphBlackhat:\n\t\treturn \"morph-blackhat\"\n\tcase MorphHitmiss:\n\t\treturn \"morph-hitmiss\"\n\t}\n\treturn \"\"\n}\n\nfunc (c BorderType) String() string {\n\tswitch c {\n\tcase BorderConstant:\n\t\treturn \"border-constant\"\n\tcase BorderReplicate:\n\t\treturn \"border-replicate\"\n\tcase BorderReflect:\n\t\treturn \"border-reflect\"\n\tcase BorderWrap:\n\t\treturn \"border-wrap\"\n\tcase BorderTransparent:\n\t\treturn \"border-transparent\"\n\tcase BorderDefault:\n\t\treturn \"border-default\"\n\tcase BorderIsolated:\n\t\treturn \"border-isolated\"\n\t}\n\treturn \"\"\n}\n\nfunc (c GrabCutMode) String() string {\n\tswitch c {\n\tcase GCInitWithRect:\n\t\treturn \"gc-init-with-rect\"\n\tcase GCInitWithMask:\n\t\treturn \"gc-init-with-mask\"\n\tcase GCEval:\n\t\treturn \"gc-eval\"\n\tcase GCEvalFreezeModel:\n\t\treturn \"gc-eval-freeze-model\"\n\t}\n\treturn \"\"\n}\n\nfunc (c HoughMode) String() string {\n\tswitch c {\n\tcase HoughStandard:\n\t\treturn \"hough-standard\"\n\tcase HoughProbabilistic:\n\t\treturn \"hough-probabilistic\"\n\tcase HoughMultiScale:\n\t\treturn \"hough-multi-scale\"\n\tcase HoughGradient:\n\t\treturn \"hough-gradient\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ThresholdType) String() string {\n\tswitch c {\n\tcase ThresholdBinary:\n\t\treturn \"threshold-binary\"\n\tcase ThresholdBinaryInv:\n\t\treturn \"threshold-binary-inv\"\n\tcase ThresholdTrunc:\n\t\treturn \"threshold-trunc\"\n\tcase ThresholdToZero:\n\t\treturn \"threshold-to-zero\"\n\tcase ThresholdToZeroInv:\n\t\treturn \"threshold-to-zero-inv\"\n\tcase ThresholdMask:\n\t\treturn \"threshold-mask\"\n\tcase ThresholdOtsu:\n\t\treturn \"threshold-otsu\"\n\tcase ThresholdTriangle:\n\t\treturn \"threshold-triangle\"\n\t}\n\treturn \"\"\n}\n\nfunc (c AdaptiveThresholdType) String() string {\n\tswitch c {\n\tcase AdaptiveThresholdMean:\n\t\treturn \"adaptative-threshold-mean\"\n\tcase AdaptiveThresholdGaussian:\n\t\treturn \"adaptative-threshold-gaussian\"\n\t}\n\treturn \"\"\n}\n\nfunc (c HersheyFont) String() string {\n\tswitch c {\n\tcase FontHersheySimplex:\n\t\treturn \"font-hershey-simplex\"\n\tcase FontHersheyPlain:\n\t\treturn \"font-hershey-plain\"\n\tcase FontHersheyDuplex:\n\t\treturn \"font-hershey-duplex\"\n\tcase FontHersheyComplex:\n\t\treturn \"font-hershey-complex\"\n\tcase FontHersheyTriplex:\n\t\treturn \"font-hershey-triplex\"\n\tcase FontHersheyComplexSmall:\n\t\treturn \"font-hershey-complex-small\"\n\tcase FontHersheyScriptSimplex:\n\t\treturn \"font-hershey-script-simplex\"\n\tcase FontHersheyScriptComplex:\n\t\treturn \"font-hershey-scipt-complex\"\n\tcase FontItalic:\n\t\treturn \"font-italic\"\n\t}\n\treturn \"\"\n}\n\nfunc (c LineType) String() string {\n\tswitch c {\n\tcase Filled:\n\t\treturn \"filled\"\n\tcase Line4:\n\t\treturn \"line4\"\n\tcase Line8:\n\t\treturn \"line8\"\n\tcase LineAA:\n\t\treturn \"line-aa\"\n\t}\n\treturn \"\"\n}\n\nfunc (c InterpolationFlags) String() string {\n\tswitch c {\n\tcase InterpolationNearestNeighbor:\n\t\treturn \"interpolation-nearest-neighbor\"\n\tcase InterpolationLinear:\n\t\treturn \"interpolation-linear\"\n\tcase InterpolationCubic:\n\t\treturn \"interpolation-cubic\"\n\tcase InterpolationArea:\n\t\treturn \"interpolation-area\"\n\tcase InterpolationLanczos4:\n\t\treturn \"interpolation-lanczos4\"\n\tcase InterpolationMax:\n\t\treturn \"interpolation-max\"\n\t}\n\treturn \"\"\n}\n\nfunc (c ColormapTypes) String() string {\n\tswitch c {\n\tcase ColormapAutumn:\n\t\treturn \"colormap-autumn\"\n\tcase ColormapBone:\n\t\treturn \"colormap-bone\"\n\tcase ColormapJet:\n\t\treturn \"colormap-jet\"\n\tcase ColormapWinter:\n\t\treturn \"colormap-winter\"\n\tcase ColormapRainbow:\n\t\treturn \"colormap-rainbow\"\n\tcase ColormapOcean:\n\t\treturn \"colormap-ocean\"\n\tcase ColormapSummer:\n\t\treturn \"colormap-summer\"\n\tcase ColormapSpring:\n\t\treturn \"colormap-spring\"\n\tcase ColormapCool:\n\t\treturn \"colormap-cool\"\n\tcase ColormapHsv:\n\t\treturn \"colormap-hsv\"\n\tcase ColormapPink:\n\t\treturn \"colormap-pink\"\n\tcase ColormapParula:\n\t\treturn \"colormap-parula\"\n\tcase ColormapMagma:\n\t\treturn \"colormap-magma\"\n\tcase ColormapInferno:\n\t\treturn \"colormap-inferno\"\n\tcase ColormapPlasma:\n\t\treturn \"colormap-plasma\"\n\tcase ColormapViridis:\n\t\treturn \"colormap-viridis\"\n\tcase ColormapCividis:\n\t\treturn \"colormap-cividis\"\n\tcase ColormapTwilight:\n\t\treturn \"colormap-twilight\"\n\tcase ColormapTwilightShifted:\n\t\treturn \"colormap-twilight-shifted\"\n\tcase ColormapTurbo:\n\t\treturn \"colormap-turbo\"\n\tcase ColormapDeepGreen:\n\t\treturn \"colormap-deep-green\"\n\t}\n\treturn \"\"\n}\n\nfunc (c DistanceTypes) String() string {\n\tswitch c {\n\tcase DistUser:\n\t\treturn \"dist-user\"\n\tcase DistL1:\n\t\treturn \"dist-l1\"\n\tcase DistL2:\n\t\treturn \"dist-l2\"\n\tcase DistL12:\n\t\treturn \"dist-l12\"\n\tcase DistFair:\n\t\treturn \"dist-fair\"\n\tcase DistWelsch:\n\t\treturn \"dist-welsch\"\n\tcase DistHuber:\n\t\treturn \"dist-huber\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "imgproc_test.go",
    "content": "package gocv\n\nimport (\n\t\"fmt\"\n\t\"image\"\n\t\"image/color\"\n\t\"image/draw\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestApproxPolyDP(t *testing.T) {\n\timg := NewMatWithSize(100, 200, MatTypeCV8UC1)\n\tdefer img.Close()\n\n\twhite := color.RGBA{255, 255, 255, 255}\n\t// Draw triangle\n\tLine(&img, image.Pt(25, 25), image.Pt(25, 75), white, 1)\n\tLine(&img, image.Pt(25, 75), image.Pt(75, 50), white, 1)\n\tLine(&img, image.Pt(75, 50), image.Pt(25, 25), white, 1)\n\t// Draw rectangle\n\tRectangle(&img, image.Rect(125, 25, 175, 75), white, 1)\n\n\tcontours := FindContours(img, RetrievalExternal, ChainApproxSimple)\n\tdefer contours.Close()\n\n\ttrianglePerimeter := ArcLength(contours.At(0), true)\n\ttriangleContour := ApproxPolyDP(contours.At(0), 0.04*trianglePerimeter, true)\n\tdefer triangleContour.Close()\n\n\texpectedTriangleContour := []image.Point{image.Pt(25, 25), image.Pt(25, 75), image.Pt(75, 50)}\n\tactualTriangleContour := triangleContour.ToPoints()\n\tif !reflect.DeepEqual(actualTriangleContour, expectedTriangleContour) {\n\t\tt.Errorf(\"Failed to approximate triangle.\\nActual:%v\\nExpect:%v\", actualTriangleContour, expectedTriangleContour)\n\t}\n\n\trectPerimeter := ArcLength(contours.At(1), true)\n\trectContour := ApproxPolyDP(contours.At(1), 0.04*rectPerimeter, true)\n\tdefer rectContour.Close()\n\n\tactualRectContour := rectContour.ToPoints()\n\texpectedRectContour := []image.Point{image.Pt(125, 24), image.Pt(124, 75), image.Pt(175, 76), image.Pt(176, 25)}\n\tif !reflect.DeepEqual(actualRectContour, expectedRectContour) {\n\t\tt.Errorf(\"Failed to approximate rectangle.\\nActual:%v\\nExpect:%v\", actualRectContour, expectedRectContour)\n\t}\n}\n\nfunc TestConvexity(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tres := FindContours(img, RetrievalExternal, ChainApproxSimple)\n\tdefer res.Close()\n\n\tif res.Size() < 1 {\n\t\tt.Error(\"Invalid FindContours test\")\n\t}\n\n\tarea := ContourArea(res.At(0))\n\tif area != 127280.0 {\n\t\tt.Errorf(\"Invalid ContourArea test: %f\", area)\n\t}\n\n\thull := NewMat()\n\tdefer hull.Close()\n\n\tConvexHull(res.At(0), &hull, true, false)\n\tif hull.Empty() {\n\t\tt.Error(\"Invalid ConvexHull test\")\n\t}\n\n\tdefects := NewMat()\n\tdefer defects.Close()\n\n\tConvexityDefects(res.At(0), hull, &defects)\n\tif defects.Empty() {\n\t\tt.Error(\"Invalid ConvexityDefects test\")\n\t}\n}\n\nfunc TestMinEnclosingCircle(t *testing.T) {\n\tpts := []image.Point{\n\t\timage.Pt(0, 2),\n\t\timage.Pt(2, 0),\n\t\timage.Pt(0, -2),\n\t\timage.Pt(-2, 0),\n\t\timage.Pt(1, -1),\n\t}\n\tpv := NewPointVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tx, y, radius := MinEnclosingCircle(pv)\n\tconst epsilon = 0.001\n\tif math.Abs(float64(radius-2.0)) > epsilon ||\n\t\tmath.Abs(float64(x-0.0)) > epsilon ||\n\t\tmath.Abs(float64(y-0.0)) > epsilon {\n\t\tt.Error(\"Invalid circle returned in MinEnclosingCircle test\")\n\t}\n}\n\nfunc TestCvtColor(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CvtColor test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tCvtColor(img, &dest, ColorBGRAToGray)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid convert in CvtColor test\")\n\t}\n}\n\nfunc TestCvtColorException(t *testing.T) {\n\timg := NewMat()\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\terr := CvtColor(img, &dest, ColorBGRAToGray)\n\tif err == nil {\n\t\tt.Error(\"Expected exception in test\")\n\t}\n\tif len(err.Error()) == 0 {\n\t\tt.Error(\"Expected exception message in test\")\n\t}\n}\n\nfunc NewBayerFromMat(src Mat, pattern string) (Mat, error) {\n\tdest := NewMatWithSize(src.Rows(), src.Cols(), MatTypeCV8UC1)\n\n\tswitch pattern {\n\tcase \"bg\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"gb\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"rg\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase \"gr\":\n\t\tfor y := 0; y < src.Rows(); y++ {\n\t\t\tfor x := 0; x < src.Cols(); x++ {\n\t\t\t\tif (x+y)%2 == 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[1])\n\t\t\t\t} else if (x % 2) != 0 {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[0])\n\t\t\t\t} else {\n\t\t\t\t\tdest.SetUCharAt(y, x, src.GetVecbAt(y, x)[2])\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tdest.Close()\n\t\treturn Mat{}, fmt.Errorf(\"invalid pattern: %s\", pattern)\n\t}\n\n\treturn dest, nil\n}\n\nfunc TestDemosaicing(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Demosaicing test\")\n\t}\n\tdefer img.Close()\n\n\tpatterns := map[string]ColorConversionCode{\n\t\t\"bg\": ColorBayerBGToBGR,\n\t\t\"gb\": ColorBayerGBToBGR,\n\t\t\"rg\": ColorBayerRGToBGR,\n\t\t\"gr\": ColorBayerGRToBGR,\n\t}\n\n\tfor pattern, code := range patterns {\n\t\tbayerImg, err := NewBayerFromMat(img, pattern)\n\t\tif bayerImg.Empty() {\n\t\t\tt.Error(\"Invalid conversion from Mat to Bayer in Demosaicing test\")\n\t\t}\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\n\t\tdest := NewMat()\n\n\t\tDemosaicing(bayerImg, &dest, code)\n\t\tif dest.Empty() || bayerImg.Rows() != dest.Rows() || bayerImg.Cols() != dest.Cols() {\n\t\t\tt.Error(\"Invalid convert in Demosaicing test\")\n\t\t}\n\n\t\tbayerImg.Close()\n\t\tdest.Close()\n\t}\n}\n\nfunc TestBilateralFilter(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BilateralFilter test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tBilateralFilter(img, &dest, 1, 2.0, 3.0)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BilateralFilter test\")\n\t}\n}\n\nfunc TestBlur(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GaussianBlur test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tBlur(img, &dest, image.Pt(3, 3))\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Blur test\")\n\t}\n}\n\nfunc TestSobel(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Sobel test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tSobel(img, &dest, MatTypeCV16S, 0, 1, 3, 1, 0, BorderDefault)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Sober test\")\n\t}\n}\n\nfunc TestSpatialGradient(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in SpatialGradient test\")\n\t}\n\tdefer img.Close()\n\n\tdx := NewMat()\n\tdefer dx.Close()\n\n\tdy := NewMat()\n\tdefer dy.Close()\n\n\tSpatialGradient(img, &dx, &dy, MatTypeCV16S, BorderDefault)\n\tif dx.Empty() || dy.Empty() || img.Rows() != dx.Rows() || img.Rows() != dy.Rows() || img.Cols() != dx.Cols() || img.Cols() != dy.Cols() {\n\t\tt.Error(\"Invalid SpatialGradient test\")\n\t}\n}\n\nfunc TestBoxFilter(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BoxFilter test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tBoxFilter(img, &dest, -1, image.Pt(3, 3))\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid BoxFilter test\")\n\t}\n}\n\nfunc TestSqBoxFilter(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in SqBoxFilter test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tSqBoxFilter(img, &dest, -1, image.Pt(3, 3))\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid SqBoxFilter test\")\n\t}\n}\n\nfunc TestDilate(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Dilate test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tDilate(img, &dest, kernel)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Dilate test\")\n\t}\n}\n\nfunc TestDilateWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in DilateWithParams test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tDilateWithParams(img, &dest, kernel, image.Pt(-1, -1), 3, 0, color.RGBA{0, 0, 0, 0})\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid DilateWithParams test\")\n\t}\n}\n\nfunc TestDistanceTransform(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in DistanceTransform test\")\n\t}\n\tdefer img.Close()\n\n\tgray := NewMat()\n\tdefer gray.Close()\n\tCvtColor(img, &gray, ColorBGRToGray)\n\n\tthreshImg := NewMat()\n\tdefer threshImg.Close()\n\tThreshold(gray, &threshImg, 25, 255, ThresholdBinary)\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tlabels := NewMat()\n\tdefer labels.Close()\n\n\tDistanceTransform(threshImg, &dest, &labels, DistL2, DistanceMask3, DistanceLabelCComp)\n\tif dest.Empty() || dest.Rows() != img.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid DistanceTransform test\")\n\t}\n}\n\nfunc TestMatchTemplate(t *testing.T) {\n\timgScene := IMRead(\"images/face.jpg\", IMReadGrayScale)\n\tif imgScene.Empty() {\n\t\tt.Error(\"Invalid read of face.jpg in MatchTemplate test\")\n\t}\n\tdefer imgScene.Close()\n\n\timgTemplate := IMRead(\"images/toy.jpg\", IMReadGrayScale)\n\tif imgTemplate.Empty() {\n\t\tt.Error(\"Invalid read of toy.jpg in MatchTemplate test\")\n\t}\n\tdefer imgTemplate.Close()\n\n\tresult := NewMat()\n\tdefer result.Close()\n\tm := NewMat()\n\tMatchTemplate(imgScene, imgTemplate, &result, TmCcoeffNormed, m)\n\tm.Close()\n\t_, maxConfidence, _, _ := MinMaxLoc(result)\n\tif maxConfidence < 0.95 {\n\t\tt.Errorf(\"Max confidence of %f is too low. MatchTemplate could not find template in scene.\", maxConfidence)\n\t}\n}\n\nfunc TestMoments(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Moments test\")\n\t}\n\tdefer img.Close()\n\n\tresult := Moments(img, true)\n\tif len(result) < 1 {\n\t\tt.Errorf(\"Invalid Moments test: %v\", result)\n\t}\n}\n\nfunc TestPyrDown(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrDown test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tPyrDown(img, &dest, image.Point{X: dest.Cols(), Y: dest.Rows()}, BorderDefault)\n\tif dest.Empty() && math.Abs(float64(img.Cols()-2*dest.Cols())) < 2.0 && math.Abs(float64(img.Rows()-2*dest.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrDown test\")\n\t}\n}\n\nfunc TestPyrUp(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in PyrUp test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tPyrUp(img, &dest, image.Point{X: dest.Cols(), Y: dest.Rows()}, BorderDefault)\n\tif dest.Empty() && math.Abs(float64(2*img.Cols()-dest.Cols())) < 2.0 && math.Abs(float64(2*img.Rows()-dest.Rows())) < 2.0 {\n\t\tt.Error(\"Invalid PyrUp test\")\n\t}\n}\n\nfunc TestBoxPoints(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BoxPoints test\")\n\t}\n\tdefer img.Close()\n\n\tthreshImg := NewMat()\n\tdefer threshImg.Close()\n\n\tThreshold(img, &threshImg, 25, 255, ThresholdBinary)\n\n\tcontours := FindContours(threshImg, RetrievalExternal, ChainApproxSimple)\n\tdefer contours.Close()\n\n\tcontour := contours.At(0)\n\n\thull := NewMat()\n\tdefer hull.Close()\n\tConvexHull(contour, &hull, false, false)\n\thullPoints := []image.Point{}\n\tfor i := 0; i < hull.Cols(); i++ {\n\t\tfor j := 0; j < hull.Rows(); j++ {\n\t\t\tp := hull.GetIntAt(j, i)\n\t\t\thullPoints = append(hullPoints, contour.At(int(p)))\n\t\t}\n\t}\n\n\tpvhp := NewPointVectorFromPoints(hullPoints)\n\tdefer pvhp.Close()\n\n\trect := MinAreaRect(pvhp)\n\tpts := NewMat()\n\tdefer pts.Close()\n\tBoxPoints(rect, &pts)\n\n\tif pts.Empty() || pts.Rows() != 4 || pts.Cols() != 2 {\n\t\tt.Error(\"Invalid BoxPoints test\")\n\t}\n}\n\nfunc TestMinAreaRect(t *testing.T) {\n\tsrc := []image.Point{\n\t\timage.Pt(10, 15),\n\t\timage.Pt(10, 25),\n\t}\n\n\tpv := NewPointVectorFromPoints(src)\n\tdefer pv.Close()\n\n\tm := MinAreaRect(pv)\n\n\tif m.Center.X != 10 {\n\t\tt.Errorf(\"TestMinAreaRect(): unexpected center.X = %v, want = %v\", m.Center.X, 10)\n\t}\n\tif m.Center.Y != 20 {\n\t\tt.Errorf(\"TestMinAreaRect(): unexpected center.Y = %v, want = %v\", m.Center.Y, 20)\n\t}\n\tif m.Angle != -90.0 {\n\t\tt.Errorf(\"TestMinAreaRect(): unexpected angle = %v, want = %v\", m.Angle, -90.0)\n\t}\n}\n\nfunc TestBoxPoints2f(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in BoxPoints2f test\")\n\t}\n\tdefer img.Close()\n\n\tthreshImg := NewMat()\n\tdefer threshImg.Close()\n\n\tThreshold(img, &threshImg, 25, 255, ThresholdBinary)\n\n\tcontours := FindContours(threshImg, RetrievalExternal, ChainApproxSimple)\n\tdefer contours.Close()\n\n\tcontour := contours.At(0)\n\n\thull := NewMat()\n\tdefer hull.Close()\n\tConvexHull(contour, &hull, false, false)\n\thullPoints := []image.Point{}\n\tfor i := 0; i < hull.Cols(); i++ {\n\t\tfor j := 0; j < hull.Rows(); j++ {\n\t\t\tp := hull.GetIntAt(j, i)\n\t\t\thullPoints = append(hullPoints, contour.At(int(p)))\n\t\t}\n\t}\n\n\tpvhp := NewPointVectorFromPoints(hullPoints)\n\tdefer pvhp.Close()\n\n\trect := MinAreaRect2f(pvhp)\n\tpts := NewMat()\n\tdefer pts.Close()\n\tBoxPoints2f(rect, &pts)\n\n\tif pts.Empty() || pts.Rows() != 4 || pts.Cols() != 2 {\n\t\tt.Error(\"Invalid BoxPoints2f test\")\n\t}\n}\n\nfunc TestMinAreaRect2f(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tlog.Println(\"Skipping TestMinAreaRect2f on macOS due to version differences between OpenCV 4.12.0 and 4.13.0\")\n\t\treturn\n\t}\n\n\tsrc := []image.Point{\n\t\timage.Pt(9, 19),\n\t\timage.Pt(4, 7),\n\t}\n\n\tpv := NewPointVectorFromPoints(src)\n\tdefer pv.Close()\n\n\tm := MinAreaRect2f(pv)\n\n\tif m.Center.X != 6.5 {\n\t\tt.Errorf(\"TestMinAreaRect2f(): unexpected center.X = %v, want = %v\", m.Center.X, 6.5)\n\t}\n\tif m.Center.Y != 13 {\n\t\tt.Errorf(\"TestMinAreaRect2f(): unexpected center.Y = %v, want = %v\", m.Center.Y, 13)\n\t}\n\tif m.Angle != -22.61986541748047 {\n\t\tt.Errorf(\"TestMinAreaRect2f(): unexpected angle = %v, want = %v\", m.Angle, -22.61986541748047)\n\t}\n}\n\nfunc TestFitEllipse(t *testing.T) {\n\tsrc := []image.Point{\n\t\timage.Pt(1, 1),\n\t\timage.Pt(0, 1),\n\t\timage.Pt(0, 2),\n\t\timage.Pt(1, 3),\n\t\timage.Pt(2, 3),\n\t\timage.Pt(4, 2),\n\t\timage.Pt(4, 1),\n\t\timage.Pt(0, 3),\n\t\timage.Pt(0, 2),\n\t}\n\n\tpv := NewPointVectorFromPoints(src)\n\tdefer pv.Close()\n\n\trect := FitEllipse(pv)\n\tif rect.Center.X != 2 {\n\t\tt.Errorf(\"TestFitEllipse(): unexpected center.X = %v, want = %v\", rect.Center.X, 2)\n\t}\n\tif rect.Center.Y != 2 {\n\t\tt.Errorf(\"TestFitEllipse(): unexpected center.Y = %v, want = %v\", rect.Center.Y, 2)\n\t}\n\tif rect.Angle != 78.60807800292969 {\n\t\tt.Errorf(\"TestFitEllipse(): unexpected angle = %v, want = %v\", rect.Angle, 78.60807800292969)\n\t}\n}\n\nfunc TestFindContours(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tres := FindContours(img, RetrievalExternal, ChainApproxSimple)\n\tdefer res.Close()\n\n\tif res.Size() < 1 {\n\t\tt.Error(\"Invalid FindContours test\")\n\t}\n\n\tarea := ContourArea(res.At(0))\n\tif area != 127280.0 {\n\t\tt.Errorf(\"Invalid ContourArea test: %f\", area)\n\t}\n\n\tr := BoundingRect(res.At(0))\n\tif !r.Eq(image.Rect(0, 0, 400, 320)) {\n\t\tt.Errorf(\"Invalid BoundingRect test: %v\", r)\n\t}\n\n\tlength := ArcLength(res.At(0), true)\n\tif int(length) != 1436 {\n\t\tt.Errorf(\"Invalid ArcLength test: %f\", length)\n\t}\n\n\tlength = ArcLength(res.At(0), false)\n\tif int(length) != 1037 {\n\t\tt.Errorf(\"Invalid ArcLength test: %f\", length)\n\t}\n}\n\nfunc TestFindContoursWithParams(t *testing.T) {\n\timg := IMRead(\"images/contours.png\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Fatal(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\thierarchy := NewMat()\n\tdefer hierarchy.Close()\n\n\tres := FindContoursWithParams(img, &hierarchy, RetrievalTree, ChainApproxNone)\n\tdefer res.Close()\n\n\tif want := 4; want != res.Size() {\n\t\tt.Fatalf(\"Expected %d contours but got %d\", want, res.Size())\n\t}\n\tif res.Size() != hierarchy.Cols() {\n\t\tt.Fatalf(\"Expected %d hierarchy of contours, got %d\", res.Size(), hierarchy.Cols())\n\t}\n\t// Assert hierarchy values, the pattern is [Next, Previous, First_Child, Parent]\n\t// More info at https://docs.opencv.org/master/d9/d8b/tutorial_py_contours_hierarchy.html\n\tfor i, want := range []Veci{\n\t\t{1, -1, -1, -1},\n\t\t{-1, 0, 2, -1},\n\t\t{-1, -1, 3, 1},\n\t\t{-1, -1, -1, 2},\n\t} {\n\t\tgot := hierarchy.GetVeciAt(0, i)\n\t\tif !reflect.DeepEqual(want, got) {\n\t\t\tt.Errorf(\"wrong hierarchy at position %d, want %v got %v\", i, want, got)\n\t\t}\n\t}\n}\n\nfunc TestPointPolygonTest(t *testing.T) {\n\ttests := []struct {\n\t\tname      string      // name of the testcase\n\t\tthickness int         // thickness of the polygon\n\t\tpoint     image.Point // point to be checked\n\t\tresult    float64     // expected result; either distance or -1, 0, 1 based on measure parameter\n\t\tmeasure   bool        // enable distance measurement, if true\n\t}{\n\t\t{\n\t\t\tname:      \"Inside the polygon - measure=false\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{20, 30},\n\t\t\tresult:    1.0,\n\t\t\tmeasure:   false,\n\t\t}, {\n\t\t\tname:      \"Outside the polygon - measure=false\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{5, 15},\n\t\t\tresult:    -1.0,\n\t\t\tmeasure:   false,\n\t\t}, {\n\t\t\tname:      \"On the polygon - measure=false\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{10, 10},\n\t\t\tresult:    0.0,\n\t\t\tmeasure:   false,\n\t\t}, {\n\t\t\tname:      \"Inside the polygon - measure=true\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{20, 30},\n\t\t\tresult:    10.0,\n\t\t\tmeasure:   true,\n\t\t}, {\n\t\t\tname:      \"Outside the polygon - measure=true\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{5, 15},\n\t\t\tresult:    -5.0,\n\t\t\tmeasure:   true,\n\t\t}, {\n\t\t\tname:      \"On the polygon - measure=true\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{10, 10},\n\t\t\tresult:    0.0,\n\t\t\tmeasure:   true,\n\t\t},\n\t}\n\n\tpts := []image.Point{\n\t\timage.Pt(10, 10),\n\t\timage.Pt(10, 80),\n\t\timage.Pt(80, 80),\n\t\timage.Pt(80, 10),\n\t}\n\n\tctr := NewPointVectorFromPoints(pts)\n\tdefer ctr.Close()\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tif r := PointPolygonTest(ctr, tc.point, tc.measure); r != tc.result {\n\t\t\t\tt.Errorf(\"Wrong result, got = %v, want >= %v\", r, tc.result)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestConnectedComponents(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tlabels := NewMat()\n\tdefer labels.Close()\n\tres := ConnectedComponents(img, &labels)\n\tif res < 1 || labels.Empty() {\n\t\tt.Error(\"Invalid ConnectedComponents test\")\n\t}\n}\n\nfunc TestConnectedComponentsWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tlabels := NewMat()\n\tdefer labels.Close()\n\tres := ConnectedComponentsWithParams(img, &labels, 8, MatTypeCV32S, CCL_DEFAULT)\n\tif res < 1 || labels.Empty() {\n\t\tt.Error(\"Invalid ConnectedComponentsWithParams test\")\n\t}\n}\n\nfunc TestConnectedComponentsWithStats(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tlabels := NewMat()\n\tdefer labels.Close()\n\n\tstats := NewMat()\n\tdefer stats.Close()\n\n\tcentroids := NewMat()\n\tdefer centroids.Close()\n\n\tres := ConnectedComponentsWithStats(img, &labels, &stats, &centroids)\n\tif res < 1 || labels.Empty() || stats.Empty() || centroids.Empty() {\n\t\tt.Error(\"Invalid ConnectedComponentsWithStats test\")\n\t}\n}\n\nfunc TestConnectedComponentsWithStatsWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FindContours test\")\n\t}\n\tdefer img.Close()\n\n\tlabels := NewMat()\n\tdefer labels.Close()\n\n\tstats := NewMat()\n\tdefer stats.Close()\n\n\tcentroids := NewMat()\n\tdefer centroids.Close()\n\n\tres := ConnectedComponentsWithStatsWithParams(img, &labels, &stats, &centroids,\n\t\t8, MatTypeCV32S, CCL_DEFAULT)\n\tif res < 1 || labels.Empty() || stats.Empty() || centroids.Empty() {\n\t\tt.Error(\"Invalid ConnectedComponentsWithStatsWithParams test\")\n\t}\n}\n\nfunc TestErode(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Erode test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tErode(img, &dest, kernel)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Erode test\")\n\t}\n}\n\nfunc TestErodeWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in ErodeWithParams test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tErodeWithParams(img, &dest, kernel, image.Pt(-1, -1), 3, 0)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid ErodeWithParams test\")\n\t}\n}\n\nfunc TestErodeWithParamsAndBorderValue(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in ErodeWithParamsAndBorderValue test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tErodeWithParamsAndBorderValue(img, &dest, kernel, image.Pt(-1, -1), 3, 0, NewScalar(0, 0, 0, 0))\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid ErodeWithParamsAndBorderValue test\")\n\t}\n}\n\nfunc TestMorphologyDefaultBorderValue(t *testing.T) {\n\tzeroScalar := Scalar{}\n\tmorphologyDefaultBorderValue := MorphologyDefaultBorderValue()\n\n\tif reflect.DeepEqual(zeroScalar, morphologyDefaultBorderValue) {\n\t\tt.Error(\"Got zero valued scalar\")\n\t}\n\n}\n\nfunc TestMorphologyEx(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in MorphologyEx test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tMorphologyEx(img, &dest, MorphOpen, kernel)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid MorphologyEx test\")\n\t}\n}\n\nfunc TestMorphologyExWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in MorphologyEx test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tMorphologyExWithParams(img, &dest, MorphOpen, kernel, 2, BorderConstant)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid MorphologyExWithParams test\")\n\t}\n}\n\nfunc TestGaussianBlur(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GaussianBlur test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tGaussianBlur(img, &dest, image.Pt(23, 23), 30, 50, 4)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Blur test\")\n\t}\n}\n\nfunc TestGetGaussianKernel(t *testing.T) {\n\tkernel := GetGaussianKernel(1, 0.5)\n\tdefer kernel.Close()\n\tif kernel.Empty() {\n\t\tt.Error(\"Invalid GetGaussianKernel test\")\n\t}\n\n}\n\nfunc TestGetGaussianKernelWithParams(t *testing.T) {\n\tkernel := GetGaussianKernelWithParams(1, 0.5, MatTypeCV64F)\n\tdefer kernel.Close()\n\tif kernel.Empty() {\n\t\tt.Error(\"Invalid GetGaussianKernel test\")\n\t}\n\n}\n\nfunc TestLaplacian(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Laplacian test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tLaplacian(img, &dest, MatTypeCV16S, 1, 1, 0, BorderDefault)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Laplacian test\")\n\t}\n}\n\nfunc TestScharr(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Scharr test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tScharr(img, &dest, MatTypeCV16S, 1, 0, 0, 0, BorderDefault)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Scharr test\")\n\t}\n}\n\nfunc TestMedianBlur(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in MedianBlur test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tMedianBlur(img, &dest, 3)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid MedianBlur test\")\n\t}\n}\n\nfunc TestCanny(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Canny test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tCanny(img, &dest, 50, 150)\n\tif dest.Empty() {\n\t\tt.Error(\"Empty Canny test\")\n\t}\n\tif img.Rows() != dest.Rows() {\n\t\tt.Error(\"Invalid Canny test rows\")\n\t}\n\tif img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Canny test cols\")\n\t}\n}\n\nfunc TestGoodFeaturesToTrackAndCornerSubPix(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GoodFeaturesToTrack test\")\n\t}\n\tdefer img.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tGoodFeaturesToTrack(img, &corners, 500, 0.01, 10)\n\tif corners.Empty() {\n\t\tt.Error(\"Empty GoodFeaturesToTrack test\")\n\t}\n\tif corners.Rows() != 205 {\n\t\tt.Errorf(\"Invalid GoodFeaturesToTrack test rows: %v\", corners.Rows())\n\t}\n\tif corners.Cols() != 1 {\n\t\tt.Errorf(\"Invalid GoodFeaturesToTrack test cols: %v\", corners.Cols())\n\t}\n\n\ttc := NewTermCriteria(Count|EPS, 20, 0.03)\n\n\tCornerSubPix(img, &corners, image.Pt(10, 10), image.Pt(-1, -1), tc)\n\tif corners.Empty() {\n\t\tt.Error(\"Empty CornerSubPix test\")\n\t}\n\tif corners.Rows() != 205 {\n\t\tt.Errorf(\"Invalid CornerSubPix test rows: %v\", corners.Rows())\n\t}\n\tif corners.Cols() != 1 {\n\t\tt.Errorf(\"Invalid CornerSubPix test cols: %v\", corners.Cols())\n\t}\n}\n\nfunc TestGrabCut(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in GrabCut test\")\n\t}\n\tdefer img.Close()\n\n\tsrc := NewMat()\n\tdefer src.Close()\n\tCvtColor(img, &img, ColorRGBAToBGR)\n\timg.ConvertTo(&src, MatTypeCV8UC3)\n\n\tmask := NewMatWithSize(img.Rows(), img.Cols(), MatTypeCV8U)\n\tdefer mask.Close()\n\n\tbgdModel := NewMat()\n\tdefer bgdModel.Close()\n\tfgdModel := NewMat()\n\tdefer fgdModel.Close()\n\n\tr := image.Rect(0, 0, 50, 50)\n\n\tGrabCut(src, &mask, r, &bgdModel, &fgdModel, 1, GCEval)\n\tif bgdModel.Empty() {\n\t\tt.Error(\"Empty bgdmodel\")\n\t} else if fgdModel.Empty() {\n\t\tt.Error(\"Empty fgdmodel\")\n\t}\n}\n\nfunc TestHoughCircles(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughCircles test\")\n\t}\n\tdefer img.Close()\n\n\tcircles := NewMat()\n\tdefer circles.Close()\n\n\tHoughCircles(img, &circles, 3, 5.0, 5.0)\n\tif circles.Empty() {\n\t\tt.Error(\"Empty HoughCircles test\")\n\t}\n\tif circles.Rows() != 1 {\n\t\tt.Errorf(\"Invalid HoughCircles test rows: %v\", circles.Rows())\n\t}\n\tif circles.Cols() < 317 || circles.Cols() > 334 {\n\t\tt.Errorf(\"Invalid HoughCircles test cols: %v\", circles.Cols())\n\t}\n}\n\nfunc TestHoughCirclesWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughCircles test\")\n\t}\n\tdefer img.Close()\n\n\tcircles := NewMat()\n\tdefer circles.Close()\n\n\tHoughCirclesWithParams(img, &circles, 3, 5.0, 5.0, 100, 100, 0, 0)\n\tif circles.Empty() {\n\t\tt.Error(\"Empty HoughCirclesWithParams test\")\n\t}\n\tif circles.Rows() != 1 {\n\t\tt.Errorf(\"Invalid HoughCirclesWithParams test rows: %v\", circles.Rows())\n\t}\n\tif circles.Cols() < 317 || circles.Cols() > 334 {\n\t\tt.Errorf(\"Invalid HoughCirclesWithParams test cols: %v\", circles.Cols())\n\t}\n}\n\nfunc TestHoughLines(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughLines test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tHoughLines(img, &dest, 1, math.Pi/180, 50)\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLines test\")\n\t}\n\n\tif dest.Rows() != 6465 {\n\t\tt.Errorf(\"Invalid HoughLines test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughLines test cols: %v\", dest.Cols())\n\t}\n\n\tif dest.GetFloatAt(0, 0) != 226 && dest.GetFloatAt(0, 1) != 0.7853982 {\n\t\tt.Errorf(\"Invalid HoughLines first test element: %v, %v\", dest.GetFloatAt(0, 0), dest.GetFloatAt(0, 1))\n\t}\n\n\tif dest.GetFloatAt(1, 0) != 228 && dest.GetFloatAt(1, 1) != 0.7853982 {\n\t\tt.Errorf(\"Invalid HoughLines second test element: %v, %v\", dest.GetFloatAt(1, 0), dest.GetFloatAt(1, 1))\n\t}\n\n\tif dest.GetFloatAt(6463, 0) != 23 && dest.GetFloatAt(6463, 1) != 0.75049156 {\n\t\tt.Errorf(\"Invalid HoughLines penultimate test element: %v, %v\", dest.GetFloatAt(6463, 0), dest.GetFloatAt(6463, 1))\n\t}\n\n\tif dest.GetFloatAt(6464, 0) != 23 && dest.GetFloatAt(6464, 1) != 0.82030475 {\n\t\tt.Errorf(\"Invalid HoughLines last test element: %v, %v\", dest.GetFloatAt(6464, 0), dest.GetFloatAt(6464, 1))\n\t}\n}\n\nfunc TestHoughLinesP(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughLinesP test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tHoughLinesP(img, &dest, 1, math.Pi/180, 50)\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLinesP test\")\n\t}\n\tif dest.Rows() != 4356 {\n\t\tt.Errorf(\"Invalid HoughLinesP test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughLinesP test cols: %v\", dest.Cols())\n\t}\n\n\tif dest.GetIntAt(0, 0) != 46 && dest.GetIntAt(0, 1) != 0 && dest.GetIntAt(0, 2) != 365 && dest.GetIntAt(0, 3) != 319 {\n\t\tt.Errorf(\"Invalid HoughLinesP first test element: %v, %v, %v, %v\", dest.GetIntAt(0, 0), dest.GetIntAt(0, 1), dest.GetIntAt(0, 2), dest.GetIntAt(0, 3))\n\t}\n\n\tif dest.GetIntAt(1, 0) != 62 && dest.GetIntAt(1, 1) != 319 && dest.GetIntAt(1, 2) != 197 && dest.GetIntAt(1, 3) != 197 {\n\t\tt.Errorf(\"Invalid HoughLinesP second test element: %v, %v, %v, %v\", dest.GetIntAt(1, 0), dest.GetIntAt(1, 1), dest.GetIntAt(1, 2), dest.GetIntAt(1, 3))\n\t}\n\n\tif dest.GetIntAt(433, 0) != 357 && dest.GetIntAt(433, 1) != 316 && dest.GetIntAt(433, 2) != 357 && dest.GetIntAt(433, 3) != 316 {\n\t\tt.Errorf(\"Invalid HoughLinesP penultimate test element: %v, %v, %v, %v\", dest.GetIntAt(433, 0), dest.GetIntAt(433, 1), dest.GetIntAt(433, 2), dest.GetIntAt(433, 3))\n\t}\n\n\tif dest.GetIntAt(434, 0) != 39 && dest.GetIntAt(434, 1) != 280 && dest.GetIntAt(434, 2) != 89 && dest.GetIntAt(434, 3) != 227 {\n\t\tt.Errorf(\"Invalid HoughLinesP last test element: %v, %v, %v, %v\", dest.GetIntAt(434, 0), dest.GetIntAt(434, 1), dest.GetIntAt(434, 2), dest.GetIntAt(434, 3))\n\t}\n}\n\nfunc TestHoughLinesPWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in HoughLinesPWithParams test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tHoughLinesPWithParams(img, &dest, 1, math.Pi/180, 50, 1, 1)\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLinesPWithParams test\")\n\t}\n\tif dest.Rows() != 514 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams test cols: %v\", dest.Cols())\n\t}\n\n\tif dest.GetIntAt(0, 0) != 46 && dest.GetIntAt(0, 1) != 0 && dest.GetIntAt(0, 2) != 365 && dest.GetIntAt(0, 3) != 319 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams first test element: %v, %v, %v, %v\", dest.GetIntAt(0, 0), dest.GetIntAt(0, 1), dest.GetIntAt(0, 2), dest.GetIntAt(0, 3))\n\t}\n\n\tif dest.GetIntAt(1, 0) != 62 && dest.GetIntAt(1, 1) != 319 && dest.GetIntAt(1, 2) != 197 && dest.GetIntAt(1, 3) != 197 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams second test element: %v, %v, %v, %v\", dest.GetIntAt(1, 0), dest.GetIntAt(1, 1), dest.GetIntAt(1, 2), dest.GetIntAt(1, 3))\n\t}\n\n\tif dest.GetIntAt(433, 0) != 0 && dest.GetIntAt(433, 1) != 126 && dest.GetIntAt(433, 2) != 71 && dest.GetIntAt(433, 3) != 57 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams penultimate test element: %v, %v, %v, %v\", dest.GetIntAt(433, 0), dest.GetIntAt(433, 1), dest.GetIntAt(433, 2), dest.GetIntAt(433, 3))\n\t}\n\n\tif dest.GetIntAt(434, 0) != 309 && dest.GetIntAt(434, 1) != 280 && dest.GetIntAt(434, 2) != 89 && dest.GetIntAt(434, 3) != 227 {\n\t\tt.Errorf(\"Invalid HoughLinesPWithParams last test element: %v, %v, %v, %v\", dest.GetIntAt(434, 0), dest.GetIntAt(434, 1), dest.GetIntAt(434, 2), dest.GetIntAt(434, 3))\n\t}\n}\n\nfunc TestHoughLinesPointSet(t *testing.T) {\n\n\tpoints := [][2]int{\n\t\t{0, 369}, {10, 364}, {20, 358}, {30, 352},\n\t\t{40, 346}, {50, 341}, {60, 335}, {70, 329},\n\t\t{80, 323}, {90, 318}, {100, 312}, {110, 306},\n\t\t{120, 300}, {130, 295}, {140, 289}, {150, 284},\n\t\t{160, 277}, {170, 271}, {180, 266}, {190, 260},\n\t}\n\n\timg := NewMatWithSize(len(points), 1, MatTypeCV32F+MatChannels2)\n\tdefer img.Close()\n\tfor i, p := range points {\n\t\timg.SetFloatAt(i, 0, float32(p[0]))\n\t\timg.SetFloatAt(i, 1, float32(p[1]))\n\t}\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\trhoMin, rhoMax, rhoStep := float32(0), float32(360), float32(1)\n\tthetaMin, thetaMax, thetaStep := float32(0), float32(math.Pi/2), float32(math.Pi/180)\n\n\tHoughLinesPointSet(img, &dest, 20, 1,\n\t\trhoMin, rhoMax, rhoStep,\n\t\tthetaMin, thetaMax, thetaStep)\n\n\tif dest.Empty() {\n\t\tt.Error(\"Empty HoughLinesPointSet test\")\n\t}\n\tif dest.Rows() != 20 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet test rows: %v\", dest.Rows())\n\t}\n\tif dest.Cols() != 1 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet test cols: %v\", dest.Cols())\n\t}\n\n\tif dest.GetDoubleAt(0, 0) != 19 && dest.GetDoubleAt(0, 1) != 320 && dest.GetDoubleAt(0, 2) != 1.0471975803375244 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet first test element: %v, %v, %v\", dest.GetDoubleAt(0, 0), dest.GetDoubleAt(0, 1), dest.GetDoubleAt(0, 2))\n\t}\n\n\tif dest.GetDoubleAt(1, 0) != 7 && dest.GetDoubleAt(1, 1) != 321 && dest.GetDoubleAt(1, 2) != 1.0646508932113647 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet second test element: %v, %v, %v\", dest.GetDoubleAt(1, 0), dest.GetDoubleAt(1, 1), dest.GetDoubleAt(1, 2))\n\t}\n\n\tif dest.GetDoubleAt(18, 0) != 2 && dest.GetDoubleAt(18, 1) != 317 && dest.GetDoubleAt(18, 2) != 0 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet penultimate test element: %v, %v, %v\", dest.GetDoubleAt(18, 0), dest.GetDoubleAt(18, 1), dest.GetDoubleAt(18, 2))\n\t}\n\n\tif dest.GetDoubleAt(19, 0) != 2 && dest.GetDoubleAt(19, 1) != 330 && dest.GetDoubleAt(19, 2) != 0 {\n\t\tt.Errorf(\"Invalid HoughLinesPointSet last test element: %v, %v, %v\", dest.GetDoubleAt(19, 0), dest.GetDoubleAt(19, 1), dest.GetDoubleAt(19, 1))\n\t}\n}\n\nfunc TestIntegral(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Integral test\")\n\t}\n\tdefer img.Close()\n\n\tsum := NewMat()\n\tdefer sum.Close()\n\tsqSum := NewMat()\n\tdefer sqSum.Close()\n\ttilted := NewMat()\n\tdefer tilted.Close()\n\n\tIntegral(img, &sum, &sqSum, &tilted)\n\tif sum.Empty() || sqSum.Empty() || tilted.Empty() {\n\t\tt.Error(\"Invalid Integral test\")\n\t}\n}\n\nfunc TestThreshold(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Threshold test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tThreshold(img, &dest, 25, 255, ThresholdBinary)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Threshold test\")\n\t}\n}\nfunc TestAdaptiveThreshold(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in AdaptiveThreshold test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tAdaptiveThreshold(img, &dest, 255, AdaptiveThresholdMean, ThresholdBinary, 11, 2)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid Threshold test\")\n\t}\n}\n\nfunc TestCircle(t *testing.T) {\n\ttests := []struct {\n\t\tname      string      // name of the testcase\n\t\tthickness int         // thickness of the circle\n\t\tpoint     image.Point // point to be checked\n\t\tresult    uint8       // expected value at the point to be checked\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling\",\n\t\t\tthickness: 3,\n\t\t\tpoint:     image.Point{80, 89},\n\t\t\tresult:    255,\n\t\t}, {\n\t\t\tname:      \"With filling\",\n\t\t\tthickness: -1,\n\t\t\tpoint:     image.Point{60, 60},\n\t\t\tresult:    255,\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(\"tc.name\", func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tCircle(&img, image.Pt(70, 70), 20, white, tc.thickness)\n\n\t\t\tif v := img.GetUCharAt(tc.point.X, tc.point.Y); v != tc.result {\n\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v, want = %v\", v, tc.result)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCircleWithParams(t *testing.T) {\n\ttests := []struct {\n\t\tname      string                // name of the testcase\n\t\tthickness int                   // thickness of the circle\n\t\tshift     int                   // how much to shift and reduce(in size)\n\t\tchecks    map[image.Point]uint8 // map of points to be checked and corresponding expected value\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling and shift\",\n\t\t\tthickness: 3,\n\t\t\tshift:     0,\n\t\t\tchecks: map[image.Point]uint8{\n\t\t\t\t{80, 89}: 255,\n\t\t\t},\n\t\t}, {\n\t\t\tname:      \"With filling, without shift\",\n\t\t\tthickness: -1,\n\t\t\tshift:     0,\n\t\t\tchecks: map[image.Point]uint8{\n\t\t\t\t{60, 60}: 255,\n\t\t\t},\n\t\t}, {\n\t\t\tname:      \"Without filling, with shift\",\n\t\t\tthickness: 3,\n\t\t\tshift:     1,\n\t\t\tchecks: map[image.Point]uint8{\n\t\t\t\t{47, 38}: 255,\n\t\t\t\t{48, 38}: 0,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tCircleWithParams(&img, image.Pt(70, 70), 20, white, tc.thickness, Line4, tc.shift)\n\n\t\t\tfor c, result := range tc.checks {\n\t\t\t\tif v := img.GetUCharAt(c.X, c.Y); v != result {\n\t\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v, want = %v\", v, result)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRectangle(t *testing.T) {\n\ttests := []struct {\n\t\tname      string      // name of the testcase\n\t\tthickness int         // thickness of the rectangle\n\t\tpoint     image.Point // point to be checked\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{10, 60},\n\t\t}, {\n\t\t\tname:      \"With filling\",\n\t\t\tthickness: -1,\n\t\t\tpoint:     image.Point{30, 30},\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tRectangle(&img, image.Rect(10, 10, 80, 80), white, tc.thickness)\n\n\t\t\tif v := img.GetUCharAt(tc.point.X, tc.point.Y); v < 50 {\n\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v, want >= %v\", v, 50)\n\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRectangleWithParams(t *testing.T) {\n\ttests := []struct {\n\t\tname      string      // name of the testcase\n\t\tthickness int         // thickness of the rectangle\n\t\tshift     int         // how much to shift and reduce (in size)\n\t\tpoint     image.Point // point to be checked\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling and shift\",\n\t\t\tthickness: 1,\n\t\t\tpoint:     image.Point{10, 60},\n\t\t}, {\n\t\t\tname:      \"With filling, without shift\",\n\t\t\tthickness: -1,\n\t\t\tpoint:     image.Point{30, 30},\n\t\t}, {\n\t\t\tname:      \"Without filling, with shift\",\n\t\t\tthickness: 1,\n\t\t\tshift:     1,\n\t\t\tpoint:     image.Point{5, 5},\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tRectangleWithParams(&img, image.Rect(10, 10, 80, 80), white, tc.thickness, Line4, tc.shift)\n\n\t\t\tif v := img.GetUCharAt(tc.point.X, tc.point.Y); v != 255 {\n\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v, want = %v\", v, 255)\n\t\t\t}\n\n\t\t})\n\t}\n}\n\nfunc TestEqualizeHist(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in EqualizeHist test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tEqualizeHist(img, &dest)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Invalid EqualizeHist test\")\n\t}\n}\n\nfunc TestCalcHist(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcHist test\")\n\t}\n\tdefer img.Close()\n\n\thist := NewMat()\n\tdefer hist.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tCalcHist([]Mat{img}, []int{0}, mask, &hist, []int{256}, []float64{0.0, 256.0}, false)\n\tif hist.Empty() || hist.Rows() != 256 || hist.Cols() != 1 {\n\t\tt.Error(\"Invalid CalcHist test\")\n\t}\n}\n\nfunc TestCalcBackProject(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CalcHist test\")\n\t}\n\tdefer img.Close()\n\n\thist := NewMat()\n\tdefer hist.Close()\n\n\tbackProject := NewMat()\n\tdefer backProject.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tCalcHist([]Mat{img}, []int{0}, mask, &hist, []int{256}, []float64{0.0, 256.0}, false)\n\tCalcBackProject([]Mat{img}, []int{0}, hist, &backProject, []float64{0.0, 256.0}, false)\n\tif backProject.Empty() {\n\t\tt.Error(\"Invalid CalcBackProject test\")\n\t}\n}\n\nfunc TestCompareHist(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CompareHist test\")\n\t}\n\tdefer img.Close()\n\n\thist1 := NewMat()\n\tdefer hist1.Close()\n\n\thist2 := NewMat()\n\tdefer hist2.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tCalcHist([]Mat{img}, []int{0}, mask, &hist1, []int{256}, []float64{0.0, 256.0}, false)\n\tCalcHist([]Mat{img}, []int{0}, mask, &hist2, []int{256}, []float64{0.0, 256.0}, false)\n\tdist := CompareHist(hist1, hist2, HistCmpCorrel)\n\tif dist != 1 {\n\t\tt.Error(\"Invalid CompareHist test\")\n\t}\n\n}\n\nfunc TestEMD(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadUnchanged)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CompareHist test\")\n\t}\n\tdefer img.Close()\n\n\thist1 := NewMat()\n\tdefer hist1.Close()\n\n\thist2 := NewMat()\n\tdefer hist2.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\n\tCalcHist([]Mat{img}, []int{0, 1}, mask, &hist1, []int{30, 32}, []float64{0.0, 180.0, 0.0, 255.0}, false)\n\tCalcHist([]Mat{img}, []int{0, 1}, mask, &hist2, []int{30, 32}, []float64{0.0, 180.0, 0.0, 255.0}, false)\n\n\tsig1 := NewMatWithSize(30*32, 3, MatTypeCV32FC1)\n\tdefer sig1.Close()\n\n\tsig2 := NewMatWithSize(30*32, 3, MatTypeCV32FC1)\n\tdefer sig2.Close()\n\n\tfor h := 0; h < 30; h++ {\n\t\tfor s := 0; s < 32; s++ {\n\t\t\tval := hist1.GetFloatAt(h, s)\n\t\t\tsig1.SetFloatAt(h*32+s, 0, val)\n\t\t\tsig1.SetFloatAt(h*32+s, 1, float32(h))\n\t\t\tsig1.SetFloatAt(h*32+s, 2, float32(s))\n\n\t\t\tval = hist2.GetFloatAt(h, s)\n\t\t\tsig2.SetFloatAt(h*32+s, 0, val)\n\t\t\tsig2.SetFloatAt(h*32+s, 1, float32(h))\n\t\t\tsig2.SetFloatAt(h*32+s, 2, float32(s))\n\t\t}\n\t}\n\n\tsim := EMD(sig1, sig2, DistL2)\n\tif (1-sim)*100 < 99.9 {\n\t\tt.Error(\"Invalid EMD test\", (1-sim)*100)\n\t}\n\n}\n\nfunc TestDrawing(t *testing.T) {\n\timg := NewMatWithSize(150, 150, MatTypeCV8U)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in Rectangle\")\n\t}\n\tdefer img.Close()\n\n\tArrowedLine(&img, image.Pt(50, 50), image.Pt(75, 75), color.RGBA{0, 0, 255, 0}, 3)\n\tCircle(&img, image.Pt(60, 60), 20, color.RGBA{0, 0, 255, 0}, 3)\n\tRectangle(&img, image.Rect(50, 50, 75, 75), color.RGBA{0, 0, 255, 0}, 3)\n\tLine(&img, image.Pt(50, 50), image.Pt(75, 75), color.RGBA{0, 0, 255, 0}, 3)\n\n\tif img.Empty() {\n\t\tt.Error(\"Error in Rectangle test\")\n\t}\n}\n\nfunc TestGetTextSize(t *testing.T) {\n\tsize := GetTextSize(\"test\", FontHersheySimplex, 1.2, 1)\n\tif size.X != 72 {\n\t\tt.Error(\"Invalid text size width\")\n\t}\n\n\tif size.Y != 26 {\n\t\tt.Error(\"Invalid text size height\")\n\t}\n\n\tsize1, base := GetTextSizeWithBaseline(\"test\", FontHersheySimplex, 1.2, 1)\n\tif size1.X != 72 {\n\t\tt.Error(\"Invalid text size width\")\n\t}\n\n\tif size1.Y != 26 {\n\t\tt.Error(\"Invalid text size height\")\n\t}\n\n\texpected := 11\n\tif base != expected {\n\t\tt.Errorf(\"invalid base. expected %d, actual %d\", expected, base)\n\t}\n}\n\nfunc TestPutText(t *testing.T) {\n\timg := NewMatWithSize(150, 150, MatTypeCV8U)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMRead\")\n\t}\n\tdefer img.Close()\n\n\tpt := image.Pt(10, 10)\n\tPutText(&img, \"Testing\", pt, FontHersheyPlain, 1.2, color.RGBA{255, 255, 255, 0}, 2)\n\n\tif img.Empty() {\n\t\tt.Error(\"Error in PutText test\")\n\t}\n}\nfunc TestPutTextWithParams(t *testing.T) {\n\timg := NewMatWithSize(150, 150, MatTypeCV8U)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in IMRead\")\n\t}\n\tdefer img.Close()\n\n\tpt := image.Pt(10, 10)\n\tPutTextWithParams(&img, \"Testing\", pt, FontHersheyPlain, 1.2, color.RGBA{255, 255, 255, 0}, 2, LineAA, false)\n\n\tif img.Empty() {\n\t\tt.Error(\"Error in PutText test\")\n\t}\n}\n\nfunc TestResize(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Resize test\")\n\t}\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tResize(src, &dst, image.Point{}, 0.5, 0.5, InterpolationDefault)\n\tif dst.Cols() != 200 || dst.Rows() != 172 {\n\t\tt.Errorf(\"Expected dst size of 200x172 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n\n\tResize(src, &dst, image.Pt(440, 377), 0, 0, InterpolationCubic)\n\tif dst.Cols() != 440 || dst.Rows() != 377 {\n\t\tt.Errorf(\"Expected dst size of 440x377 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n}\n\nfunc TestGetRectSubPix(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadColor)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Resize test\")\n\t}\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tGetRectSubPix(src, image.Point{20, 30}, image.Point{200, 172}, &dst)\n\tif dst.Cols() != 20 || dst.Rows() != 30 {\n\t\tt.Errorf(\"Expected dst size of 20x30 got %dx%d\", dst.Cols(), dst.Rows())\n\t}\n}\n\nfunc TestGetRotationMatrix2D(t *testing.T) {\n\ttype args struct {\n\t\tcenter image.Point\n\t\tangle  float64\n\t\tscale  float64\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t\twant [][]float64\n\t}{\n\t\t{\n\t\t\tname: \"90\",\n\t\t\targs: args{image.Point{0, 0}, 90.0, 1.0},\n\t\t\twant: [][]float64{\n\t\t\t\t{6.123233995736766e-17, 1, 0},\n\t\t\t\t{-1, 6.123233995736766e-17, 0},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"45\",\n\t\t\targs: args{image.Point{0, 0}, 45.0, 1.0},\n\t\t\twant: [][]float64{\n\t\t\t\t{0.7071067811865476, 0.7071067811865475, 0},\n\t\t\t\t{-0.7071067811865475, 0.7071067811865476, 0},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"0\",\n\t\t\targs: args{image.Point{0, 0}, 0.0, 1.0},\n\t\t\twant: [][]float64{\n\t\t\t\t{1, 0, 0},\n\t\t\t\t{-0, 1, 0},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tgot := GetRotationMatrix2D(tt.args.center, tt.args.angle, tt.args.scale)\n\t\t\tfor row := 0; row < got.Rows(); row++ {\n\t\t\t\tfor col := 0; col < got.Cols(); col++ {\n\t\t\t\t\tif !floatEquals(got.GetDoubleAt(row, col), tt.want[row][col]) {\n\t\t\t\t\t\tt.Errorf(\"GetRotationMatrix2D() = %v, want %v at row:%v col:%v\", got.GetDoubleAt(row, col), tt.want[row][col], row, col)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgot.Close()\n\t\t})\n\t}\n}\n\nfunc TestWarpAffine(t *testing.T) {\n\tsrc := NewMatWithSize(256, 256, MatTypeCV8UC1)\n\tdefer src.Close()\n\trot := GetRotationMatrix2D(image.Point{0, 0}, 1.0, 1.0)\n\tdefer rot.Close()\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tWarpAffine(src, &dst, rot, image.Point{256, 256})\n\tresult := Norm(dst, NormL2)\n\tif result != 0.0 {\n\t\tt.Errorf(\"WarpAffine() = %v, want %v\", result, 0.0)\n\t}\n}\n\nfunc TestWarpAffineGocvLogo(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\trot := GetRotationMatrix2D(image.Point{0, 0}, 1.0, 1.0)\n\tdefer rot.Close()\n\tdst := src.Clone()\n\tdefer dst.Close()\n\tWarpAffine(src, &dst, rot, image.Point{343, 400})\n\tresult := Norm(dst, NormL2)\n\n\tif !floatEquals(round(result, 0.05), round(111111.05, 0.05)) {\n\t\tt.Errorf(\"WarpAffine() = %v, want %v\", round(result, 0.05), round(111111.05, 0.05))\n\t}\n}\n\nfunc TestWarpAffineWithParams(t *testing.T) {\n\tsrc := NewMatWithSize(256, 256, MatTypeCV8UC1)\n\tdefer src.Close()\n\trot := GetRotationMatrix2D(image.Point{0, 0}, 1.0, 1.0)\n\tdefer rot.Close()\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tWarpAffineWithParams(src, &dst, rot, image.Point{256, 256}, InterpolationLinear, BorderConstant, color.RGBA{0, 0, 0, 0})\n\tresult := Norm(dst, NormL2)\n\tif !floatEquals(result, 0.0) {\n\t\tt.Errorf(\"WarpAffineWithParams() = %v, want %v\", result, 0.0)\n\t}\n}\n\nfunc TestWarpAffineWithParamsGocvLogo(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\trot := GetRotationMatrix2D(image.Point{0, 0}, 1.0, 1.0)\n\tdefer rot.Close()\n\tdst := src.Clone()\n\tdefer dst.Close()\n\tWarpAffineWithParams(src, &dst, rot, image.Point{343, 400}, InterpolationLinear, BorderConstant, color.RGBA{0, 0, 0, 0})\n\tresult := Norm(dst, NormL2)\n\tif !floatEquals(round(result, 0.05), round(111111.05, 0.05)) {\n\t\tt.Errorf(\"WarpAffine() = %v, want %v\", round(result, 0.05), round(111111.05, 0.05))\n\t}\n}\n\nfunc TestClipLine(t *testing.T) {\n\n\tif ok := ClipLine(image.Point{20, 20}, image.Point{5, 5}, image.Point{5, 5}); !ok {\n\t\tt.Error(\"ClipLine(): is false\")\n\t}\n}\n\nfunc TestWatershed(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tif src.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Watershed test\")\n\t}\n\tdefer src.Close()\n\n\tgray := NewMat()\n\tdefer gray.Close()\n\tCvtColor(src, &gray, ColorBGRToGray)\n\n\timgThresh := NewMat()\n\tdefer imgThresh.Close()\n\tThreshold(gray, &imgThresh, 5, 50, ThresholdOtsu+ThresholdBinary)\n\n\tmarkers := NewMat()\n\tdefer markers.Close()\n\t_ = ConnectedComponents(imgThresh, &markers)\n\n\tWatershed(src, &markers)\n\tif markers.Empty() || src.Cols() != markers.Cols() || src.Rows() != markers.Rows() {\n\t\tt.Error(\"Invalid Watershed test\")\n\t}\n}\n\nfunc TestApplyColorMap(t *testing.T) {\n\ttype args struct {\n\t\tcolormapType ColormapTypes\n\t\twant         float64\n\t}\n\ttests := []struct {\n\t\tname string\n\t\targs args\n\t}{\n\t\t{name: \"COLORMAP_AUTUMN\", args: args{colormapType: ColormapAutumn, want: 118090.29593069873}},\n\t\t{name: \"COLORMAP_BONE\", args: args{colormapType: ColormapBone, want: 122067.44213343704}},\n\t\t{name: \"COLORMAP_JET\", args: args{colormapType: ColormapJet, want: 98220.64722857409}},\n\t\t{name: \"COLORMAP_WINTER\", args: args{colormapType: ColormapWinter, want: 94279.52859449394}},\n\t\t{name: \"COLORMAP_RAINBOW\", args: args{colormapType: ColormapRainbow, want: 92591.40608069411}},\n\t\t{name: \"COLORMAP_OCEAN\", args: args{colormapType: ColormapOcean, want: 106444.16919681415}},\n\t\t{name: \"COLORMAP_SUMMER\", args: args{colormapType: ColormapSummer, want: 114434.44957703952}},\n\t\t{name: \"COLORMAP_SPRING\", args: args{colormapType: ColormapSpring, want: 123557.60209715953}},\n\t\t{name: \"COLORMAP_COOL\", args: args{colormapType: ColormapCool, want: 123557.60209715953}},\n\t\t{name: \"COLORMAP_HSV\", args: args{colormapType: ColormapHsv, want: 107679.25179903508}},\n\t\t{name: \"COLORMAP_PINK\", args: args{colormapType: ColormapPink, want: 136043.97287274434}},\n\t\t{name: \"COLORMAP_HOT\", args: args{colormapType: ColormapHot, want: 124941.02475968412}},\n\t\t{name: \"COLORMAP_PARULA\", args: args{colormapType: ColormapParula, want: 111483.33555738274}},\n\t\t{name: \"COLORMAP_MAGMA\", args: args{colormapType: ColormapMagma, want: 113197.48853662788}},\n\t\t{name: \"COLORMAP_INFERNO\", args: args{colormapType: ColormapInferno, want: 108186.83126425323}},\n\t\t{name: \"COLORMAP_PLASMA\", args: args{colormapType: ColormapPlasma, want: 108665.39830599251}},\n\t\t{name: \"COLORMAP_VIRIDIS\", args: args{colormapType: ColormapViridis, want: 95101.87774697196}},\n\t\t{name: \"COLORMAP_CIVIDIS\", args: args{colormapType: ColormapCividis, want: 102175.91244515509}},\n\t\t{name: \"COLORMAP_TWILIGHT\", args: args{colormapType: ColormapTwilight, want: 98676.48484821498}},\n\t\t{name: \"COLORMAP_TWILIGHT_SHIFTED\", args: args{colormapType: ColormapTwilightShifted, want: 74717.33848311247}},\n\t\t{name: \"COLORMAP_TURBO\", args: args{colormapType: ColormapTurbo, want: 96848.08501978756}},\n\t\t{name: \"COLORMAP_DEEPGREEN\", args: args{colormapType: ColormapDeepGreen, want: 106444.16919681415}},\n\t}\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadGrayScale)\n\tdefer src.Close()\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tdst := src.Clone()\n\t\t\tdefer dst.Close()\n\t\t\tApplyColorMap(src, &dst, tt.args.colormapType)\n\t\t\tresult := Norm(dst, NormL2)\n\t\t\tif !floatEquals(result, tt.args.want) {\n\t\t\t\tt.Errorf(\"TestApplyColorMap() = %v, want %v\", result, tt.args.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestApplyCustomColorMap(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadGrayScale)\n\tdefer src.Close()\n\tcustomColorMap := NewMatWithSize(256, 1, MatTypeCV8UC1)\n\tdefer customColorMap.Close()\n\n\tdst := src.Clone()\n\tdefer dst.Close()\n\tApplyCustomColorMap(src, &dst, customColorMap)\n\tresult := Norm(dst, NormL2)\n\tif !floatEquals(result, 0.0) {\n\t\tt.Errorf(\"TestApplyCustomColorMap() = %v, want %v\", result, 0.0)\n\t}\n}\n\nfunc TestGetPerspectiveTransform(t *testing.T) {\n\tsrc := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 5),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(5, 10),\n\t}\n\tpvsrc := NewPointVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tdst := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 0),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(0, 10),\n\t}\n\tpvdst := NewPointVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := GetPerspectiveTransform(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestGetPerspectiveTransform(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 3 {\n\t\tt.Errorf(\"TestGetPerspectiveTransform(): unexpected rows = %v, want = %v\", m.Rows(), 3)\n\t}\n}\n\nfunc TestGetPerspectiveTransform2f(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10.5, 5.5},\n\t\t{10.5, 10.5},\n\t\t{5.5, 10.5},\n\t}\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{590.20, 24.12},\n\t\t{100.12, 150.21},\n\t\t{0, 10},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := GetPerspectiveTransform2f(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestGetPerspectiveTransform2f(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 3 {\n\t\tt.Errorf(\"TestGetPerspectiveTransform2f(): unexpected rows = %v, want = %v\", m.Rows(), 3)\n\t}\n}\n\nfunc TestGetAffineTransform(t *testing.T) {\n\tsrc := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 5),\n\t\timage.Pt(10, 10),\n\t}\n\tpvsrc := NewPointVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tdst := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 0),\n\t\timage.Pt(10, 10),\n\t}\n\tpvdst := NewPointVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := GetAffineTransform(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestGetAffineTransform(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestGetAffineTransform(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestGetAffineTransform2f(t *testing.T) {\n\tsrc := []Point2f{\n\t\t{0, 0},\n\t\t{10.5, 5.5},\n\t\t{10.5, 10.5},\n\t}\n\tdst := []Point2f{\n\t\t{0, 0},\n\t\t{590.20, 24.12},\n\t\t{100.12, 150.21},\n\t}\n\n\tpvsrc := NewPoint2fVectorFromPoints(src)\n\tdefer pvsrc.Close()\n\n\tpvdst := NewPoint2fVectorFromPoints(dst)\n\tdefer pvdst.Close()\n\n\tm := GetAffineTransform2f(pvsrc, pvdst)\n\tdefer m.Close()\n\n\tif m.Cols() != 3 {\n\t\tt.Errorf(\"TestGetAffineTransform2f(): unexpected cols = %v, want = %v\", m.Cols(), 3)\n\t}\n\tif m.Rows() != 2 {\n\t\tt.Errorf(\"TestGetAffineTransform2f(): unexpected rows = %v, want = %v\", m.Rows(), 2)\n\t}\n}\n\nfunc TestWarpPerspective(t *testing.T) {\n\timg := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer img.Close()\n\n\tw := img.Cols()\n\th := img.Rows()\n\n\ts := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 5),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(5, 10),\n\t}\n\tpvs := NewPointVectorFromPoints(s)\n\tdefer pvs.Close()\n\n\td := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 0),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(0, 10),\n\t}\n\tpvd := NewPointVectorFromPoints(d)\n\tdefer pvd.Close()\n\n\tm := GetPerspectiveTransform(pvs, pvd)\n\tdefer m.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tWarpPerspective(img, &dst, m, image.Pt(w, h))\n\n\tif dst.Cols() != w {\n\t\tt.Errorf(\"TestWarpPerspective(): unexpected cols = %v, want = %v\", dst.Cols(), w)\n\t}\n\n\tif dst.Rows() != h {\n\t\tt.Errorf(\"TestWarpPerspective(): unexpected rows = %v, want = %v\", dst.Rows(), h)\n\t}\n}\n\nfunc TestWarpPerspectiveWithParams(t *testing.T) {\n\timg := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer img.Close()\n\n\tw := img.Cols()\n\th := img.Rows()\n\n\ts := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 5),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(5, 10),\n\t}\n\tpvs := NewPointVectorFromPoints(s)\n\tdefer pvs.Close()\n\n\td := []image.Point{\n\t\timage.Pt(0, 0),\n\t\timage.Pt(10, 0),\n\t\timage.Pt(10, 10),\n\t\timage.Pt(0, 10),\n\t}\n\tpvd := NewPointVectorFromPoints(d)\n\tdefer pvd.Close()\n\n\tm := GetPerspectiveTransform(pvs, pvd)\n\tdefer m.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tWarpPerspectiveWithParams(img, &dst, m, image.Pt(w, h), InterpolationLinear, BorderConstant, color.RGBA{})\n\n\tif dst.Cols() != w {\n\t\tt.Errorf(\"TestWarpPerspectiveWithParams(): unexpected cols = %v, want = %v\", dst.Cols(), w)\n\t}\n\n\tif dst.Rows() != h {\n\t\tt.Errorf(\"TestWarpPerspectiveWithParams(): unexpected rows = %v, want = %v\", dst.Rows(), h)\n\t}\n}\n\nfunc TestDrawContours(t *testing.T) {\n\timg := NewMatWithSize(100, 200, MatTypeCV8UC1)\n\tdefer img.Close()\n\n\t// Draw rectangle\n\twhite := color.RGBA{255, 255, 255, 255}\n\tRectangle(&img, image.Rect(125, 25, 175, 75), white, 1)\n\n\tcontours := FindContours(img, RetrievalExternal, ChainApproxSimple)\n\tdefer contours.Close()\n\n\tif v := img.GetUCharAt(23, 123); v != 0 {\n\t\tt.Errorf(\"TestDrawContours(): wrong pixel value = %v, want = %v\", v, 0)\n\t}\n\tif v := img.GetUCharAt(25, 125); v != 206 {\n\t\tt.Errorf(\"TestDrawContours(): wrong pixel value = %v, want = %v\", v, 206)\n\t}\n\n\tDrawContours(&img, contours, -1, white, 2)\n\n\t// contour should be drawn with thickness = 2\n\tif v := img.GetUCharAt(24, 124); v != 255 {\n\t\tt.Errorf(\"TestDrawContours(): contour has not been drawn (value = %v, want = %v)\", v, 255)\n\t}\n\tif v := img.GetUCharAt(25, 125); v != 255 {\n\t\tt.Errorf(\"TestDrawContours(): contour has not been drawn (value = %v, want = %v)\", v, 255)\n\t}\n}\n\nfunc TestDrawContoursWithParams(t *testing.T) {\n\timg := NewMatWithSize(200, 200, MatTypeCV8UC1)\n\tdefer img.Close()\n\n\t// Draw circle\n\twhite := color.RGBA{255, 255, 255, 255}\n\tblack := color.RGBA{0, 0, 0, 255}\n\tCircle(&img, image.Pt(100, 100), 80, white, -1)\n\tCircle(&img, image.Pt(100, 100), 55, black, -1)\n\tCircle(&img, image.Pt(100, 100), 30, white, -1)\n\n\thierarchy := NewMat()\n\tdefer hierarchy.Close()\n\tcontours := FindContoursWithParams(img, &hierarchy, RetrievalTree, ChainApproxSimple)\n\tdefer contours.Close()\n\n\t// Draw contours by different line-type and assert value\n\tcases := []struct {\n\t\tname        string\n\t\tlineType    LineType\n\t\texpectUChar uint8\n\t}{\n\t\t{\n\t\t\tname:        \"draw by Line4\", // 4 connected line\n\t\t\tlineType:    Line4,\n\t\t\texpectUChar: 255,\n\t\t},\n\t\t{\n\t\t\tname:        \"draw by line8\", // 8 connected line\n\t\t\tlineType:    Line8,\n\t\t\texpectUChar: 0,\n\t\t},\n\t\t{\n\t\t\tname:        \"draw by line-AA\", // anti-aliased line\n\t\t\tlineType:    LineAA,\n\t\t\texpectUChar: 68,\n\t\t},\n\t}\n\tfor _, c := range cases {\n\t\tt.Run(c.name, func(t *testing.T) {\n\t\t\tbg := NewMatWithSize(img.Rows(), img.Cols(), MatTypeCV8UC1)\n\t\t\tdefer bg.Close()\n\n\t\t\tDrawContoursWithParams(&bg, contours, -1, white, 1, c.lineType, hierarchy, 0, image.Pt(0, 0))\n\t\t\tif v := bg.GetUCharAt(22, 88); v != c.expectUChar {\n\t\t\t\tt.Errorf(\"TestDrawContoursWithParams(): contour value expect %v but got %v\", c.expectUChar, v)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestEllipse(t *testing.T) {\n\ttests := []struct {\n\t\tname      string      // name of the testcase\n\t\tthickness int         // thickness of the ellipse\n\t\tpoint     image.Point // point to be checked\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling\",\n\t\t\tthickness: 2,\n\t\t\tpoint:     image.Point{24, 50},\n\t\t}, {\n\t\t\tname:      \"With filling\",\n\t\t\tthickness: -1,\n\t\t\tpoint:     image.Point{55, 47},\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tEllipse(&img, image.Pt(50., 50.), image.Pt(25., 25.), 0., 0, 360, white, tc.thickness)\n\n\t\t\tif v := img.GetUCharAt(tc.point.X, tc.point.Y); v != 255 {\n\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v, want = %v\", v, 255)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestEllipseWithParams(t *testing.T) {\n\tcheck255 := func(v uint8) bool {\n\t\treturn v != 255\n\t}\n\n\ttests := []struct {\n\t\tname      string                           // name of the testcase\n\t\tthickness int                              // thickness of the ellipse\n\t\tlinetype  LineType                         // type of line used for drawing\n\t\tshift     int                              // how much to shift and reduce(in size)\n\t\tchecks    map[image.Point]func(uint8) bool // points to be checked and corresponding expected value\n\t\tcheckFn   func(uint8) bool                 // function to check if the result is as expected\n\n\t}{\n\t\t{\n\t\t\tname:      \"Without filling and shift, line = Line8\",\n\t\t\tthickness: 2,\n\t\t\tlinetype:  Line8,\n\t\t\tchecks: map[image.Point]func(uint8) bool{\n\t\t\t\t{24, 50}: check255,\n\t\t\t},\n\t\t}, {\n\t\t\tname:      \"With filling, without shift, line = Line8\",\n\t\t\tthickness: -1,\n\t\t\tlinetype:  Line8,\n\t\t\tchecks: map[image.Point]func(uint8) bool{\n\t\t\t\t{55, 47}: check255,\n\t\t\t},\n\t\t}, {\n\t\t\tname:      \"Without filling, with shift 2, line = Line8\",\n\t\t\tthickness: 2,\n\t\t\tlinetype:  Line8,\n\t\t\tshift:     2,\n\t\t\tchecks: map[image.Point]func(uint8) bool{\n\t\t\t\t{6, 12}:  check255,\n\t\t\t\t{19, 13}: check255,\n\t\t\t},\n\t\t}, {\n\t\t\tname:      \"Without filling and shift, line = LineAA\",\n\t\t\tthickness: 2,\n\t\t\tlinetype:  LineAA,\n\t\t\tchecks: map[image.Point]func(uint8) bool{\n\t\t\t\t{77, 54}: func(v uint8) bool { return v < 10 || v > 220 },\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\twhite := color.RGBA{255, 255, 255, 0}\n\t\t\tEllipseWithParams(&img, image.Pt(50., 50.), image.Pt(25., 25.), 0., 0, 360, white,\n\t\t\t\ttc.thickness, tc.linetype, tc.shift)\n\n\t\t\tfor c, fn := range tc.checks {\n\t\t\t\tif v := img.GetUCharAt(c.X, c.Y); fn(v) {\n\t\t\t\t\tt.Errorf(\"Wrong pixel value, got = %v\", v)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestFillPoly(t *testing.T) {\n\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\tdefer img.Close()\n\n\twhite := color.RGBA{255, 255, 255, 0}\n\tpts := [][]image.Point{\n\t\t{\n\t\t\timage.Pt(10, 10),\n\t\t\timage.Pt(10, 20),\n\t\t\timage.Pt(20, 20),\n\t\t\timage.Pt(20, 10),\n\t\t},\n\t}\n\n\tpv := NewPointsVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tFillPoly(&img, pv, white)\n\n\tif v := img.GetUCharAt(10, 10); v != 255 {\n\t\tt.Errorf(\"TestFillPoly(): wrong pixel value = %v, want = %v\", v, 255)\n\t}\n}\n\nfunc TestFillPolyWithParams(t *testing.T) {\n\ttests := []struct {\n\t\tname   string      // name of testcase\n\t\toffset image.Point // offset to the FillPolyWithParams function\n\t\tpoint  image.Point // point to be checked\n\t\tresult uint8       // expected value at the point to be checked\n\t}{\n\t\t{\n\t\t\tname:   \"No offset\",\n\t\t\tpoint:  image.Point{10, 10},\n\t\t\tresult: 255,\n\t\t}, {\n\t\t\tname:   \"Offset of 2\",\n\t\t\toffset: image.Point{2, 2},\n\t\t\tpoint:  image.Point{12, 12},\n\t\t\tresult: 255,\n\t\t},\n\t}\n\twhite := color.RGBA{255, 255, 255, 0}\n\tpts := [][]image.Point{\n\t\t{\n\t\t\timage.Pt(10, 10),\n\t\t\timage.Pt(10, 20),\n\t\t\timage.Pt(20, 20),\n\t\t\timage.Pt(20, 10),\n\t\t},\n\t}\n\tpv := NewPointsVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\t\t\tdefer img.Close()\n\n\t\t\tFillPolyWithParams(&img, pv, white, Line4, 0, tc.offset)\n\n\t\t\tif v := img.GetUCharAt(tc.point.X, tc.point.Y); v != tc.result {\n\t\t\t\tt.Errorf(\"Wrong pixel value; got = %v, want = %v\", v, tc.result)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPolylines(t *testing.T) {\n\timg := NewMatWithSize(100, 100, MatTypeCV8UC1)\n\tdefer img.Close()\n\n\twhite := color.RGBA{255, 255, 255, 0}\n\tpts := [][]image.Point{\n\t\t{\n\t\t\timage.Pt(10, 10),\n\t\t\timage.Pt(10, 20),\n\t\t\timage.Pt(20, 20),\n\t\t\timage.Pt(20, 10),\n\t\t},\n\t}\n\tpv := NewPointsVectorFromPoints(pts)\n\tdefer pv.Close()\n\n\tPolylines(&img, pv, true, white, 1)\n\n\tif v := img.GetUCharAt(10, 10); v != 255 {\n\t\tt.Errorf(\"TestPolylines(): wrong pixel value = %v, want = %v\", v, 255)\n\t}\n}\n\nfunc TestRemap(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmap1 := NewMatWithSize(256, 256, MatTypeCV16SC2)\n\tdefer map1.Close()\n\tmap1.SetFloatAt(50, 50, 25.4)\n\tmap2 := NewMat()\n\tdefer map2.Close()\n\n\tRemap(src, &dst, &map1, &map2, InterpolationDefault, BorderConstant, color.RGBA{0, 0, 0, 0})\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Remap(): dst is empty\")\n\t}\n}\n\nfunc TestFilter2D(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tkernel := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernel.Close()\n\n\tFilter2D(src, &dst, -1, kernel, image.Pt(-1, -1), 0, BorderDefault)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Filter2D(): dst is empty\")\n\t}\n}\n\nfunc TestSepFilter2D(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tkernelX := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernelX.Close()\n\tkernelY := GetStructuringElement(MorphRect, image.Pt(1, 1))\n\tdefer kernelY.Close()\n\n\tSepFilter2D(src, &dst, -1, kernelX, kernelY, image.Pt(-1, -1), 0, BorderDefault)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Filter2D(): dst is empty\")\n\t}\n}\n\nfunc TestLogPolar(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tLogPolar(src, &dst, image.Pt(22, 22), 1, InterpolationDefault)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"LogPolar(): dst is empty\")\n\t}\n}\n\nfunc TestLinearPolar(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := src.Clone()\n\tdefer dst.Close()\n\n\tLinearPolar(src, &dst, image.Pt(22, 22), 1, InterpolationDefault)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"LinearPolar(): dst is empty\")\n\t}\n}\n\nfunc TestFitLine(t *testing.T) {\n\tpoints := []image.Point{image.Pt(125, 24), image.Pt(124, 75), image.Pt(175, 76), image.Pt(176, 25)}\n\tpv := NewPointVectorFromPoints(points)\n\tdefer pv.Close()\n\n\tline := NewMat()\n\tdefer line.Close()\n\n\tFitLine(pv, &line, DistL2, 0, 0.01, 0.01)\n\n\tif ok := line.Empty(); ok {\n\t\tt.Errorf(\"FitLine(): line is empty\")\n\t}\n}\n\nfunc TestMatchShapes(t *testing.T) {\n\tpoints1 := []image.Point{image.Pt(0, 0), image.Pt(1, 0), image.Pt(2, 2), image.Pt(3, 3), image.Pt(3, 4)}\n\tpoints2 := []image.Point{image.Pt(0, 0), image.Pt(1, 0), image.Pt(2, 3), image.Pt(3, 3), image.Pt(3, 5)}\n\tlowerSimilarity := 2.0\n\tupperSimilarity := 3.0\n\n\tcontour1 := NewPointVectorFromPoints(points1)\n\tdefer contour1.Close()\n\n\tcontour2 := NewPointVectorFromPoints(points2)\n\tdefer contour2.Close()\n\n\tsimilarity := MatchShapes(contour1, contour2, ContoursMatchI2, 0)\n\n\tif similarity < lowerSimilarity {\n\t\tt.Errorf(\"MatchShapes(): incorrect calculation, should be more than %f, got %f\", lowerSimilarity, similarity)\n\t}\n\n\tif similarity > upperSimilarity {\n\t\tt.Errorf(\"MatchShapes(): incorrect calculation, should be lower than %f, got %f\", upperSimilarity, similarity)\n\t}\n}\n\nfunc TestInvertAffineTransform(t *testing.T) {\n\tsrc := NewMatWithSize(2, 3, MatTypeCV32F)\n\tdefer src.Close()\n\n\tdst := NewMatWithSize(2, 3, MatTypeCV32F)\n\tdefer dst.Close()\n\n\tInvertAffineTransform(src, &dst)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"InvertAffineTransform(): dst is empty\")\n\t}\n}\n\nfunc TestCLAHE(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in NewCLAHE test\")\n\t}\n\tdefer img.Close()\n\n\tsrc := NewMat()\n\tdefer src.Close()\n\timg.ConvertTo(&src, MatTypeCV8UC1)\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tc := NewCLAHE()\n\tdefer c.Close()\n\tc.Apply(src, &dst)\n\tif dst.Empty() || img.Rows() != dst.Rows() || img.Cols() != dst.Cols() {\n\t\tt.Error(\"Invalid NewCLAHE test\")\n\t}\n}\n\nfunc TestCLAHEWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in CLAHEWithParams test\")\n\t}\n\tdefer img.Close()\n\n\tsrc := NewMat()\n\tdefer src.Close()\n\timg.ConvertTo(&src, MatTypeCV8UC1)\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tc := NewCLAHEWithParams(2.0, image.Pt(10, 10))\n\tdefer c.Close()\n\tc.Apply(src, &dst)\n\tif dst.Empty() || img.Rows() != dst.Rows() || img.Cols() != dst.Cols() {\n\t\tt.Error(\"Invalid NewCLAHEWithParams test\")\n\t}\n}\n\nfunc TestPhaseCorrelate(t *testing.T) {\n\ttemplate := IMRead(\"images/simple.jpg\", IMReadGrayScale)\n\tmatched := IMRead(\"images/simple-translated.jpg\", IMReadGrayScale)\n\tnotMatchedOrig := IMRead(\"images/space_shuttle.jpg\", IMReadGrayScale)\n\tnotMatched := NewMat()\n\n\tdefer template.Close()\n\tdefer matched.Close()\n\tdefer notMatchedOrig.Close()\n\tdefer notMatched.Close()\n\n\tResize(notMatchedOrig, &notMatched, image.Point{X: matched.Size()[0], Y: matched.Size()[1]}, 0, 0, InterpolationLinear)\n\n\ttemplate32FC1 := NewMat()\n\tmatched32FC1 := NewMat()\n\tnotMatched32FC1 := NewMat()\n\n\tdefer template32FC1.Close()\n\tdefer matched32FC1.Close()\n\tdefer notMatched32FC1.Close()\n\n\ttemplate.ConvertTo(&template32FC1, MatTypeCV32FC1)\n\tmatched.ConvertTo(&matched32FC1, MatTypeCV32FC1)\n\tnotMatched.ConvertTo(&notMatched32FC1, MatTypeCV32FC1)\n\n\twindow := NewMat()\n\tdefer window.Close()\n\n\tshiftTranslated, responseTranslated := PhaseCorrelate(template32FC1, matched32FC1, window)\n\t_, responseDifferent := PhaseCorrelate(template32FC1, notMatched32FC1, window)\n\n\tif !(shiftTranslated.X < 15) || !(shiftTranslated.Y < 15) {\n\t\tt.Errorf(\"expected shift to be > 15 pixels, got %v\", shiftTranslated)\n\t}\n\n\tif responseTranslated < 0.85 {\n\t\tt.Errorf(\"expected response for translated image to be > 0.85, got %f\", responseTranslated)\n\t}\n\n\tif responseDifferent > 0.05 {\n\t\tt.Errorf(\"expected response for different image to be < 0.05, but got %f\", responseDifferent)\n\t}\n}\n\nfunc TestCreateHanningWindow(t *testing.T) {\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tCreateHanningWindow(&dst, image.Pt(100, 100), MatTypeCV32F)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Invalid CreateHanningWindow test\")\n\t}\n}\n\nfunc TestMatToImage(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8UC3)\n\tdefer mat1.Close()\n\n\timg, err := mat1.ToImage()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImage %v.\", err)\n\t}\n\n\tif img.Bounds().Dx() != 102 {\n\t\tt.Errorf(\"TestToImage incorrect width got %d.\", img.Bounds().Dx())\n\t}\n\n\tif img.Bounds().Dy() != 101 {\n\t\tt.Errorf(\"TestToImage incorrect height got %d.\", img.Bounds().Dy())\n\t}\n\n\tmatreg := mat1.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg.Close()\n\timg, err = matreg.ToImage()\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8UC1)\n\tdefer mat2.Close()\n\n\timg, err = mat2.ToImage()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImage %v.\", err)\n\t}\n\n\tmat3 := NewMatWithSize(101, 102, MatTypeCV8UC4)\n\tdefer mat3.Close()\n\n\timg, err = mat3.ToImage()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImage %v.\", err)\n\t}\n\n\tmatreg3 := mat3.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg3.Close()\n\timg, err = matreg3.ToImage()\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmatWithUnsupportedType := NewMatWithSize(101, 102, MatTypeCV8S)\n\tdefer matWithUnsupportedType.Close()\n\n\t_, err = matWithUnsupportedType.ToImage()\n\tif err == nil {\n\t\tt.Error(\"TestToImage expected error got nil.\")\n\t}\n}\n\nfunc TestMatToImageYUV(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8UC3)\n\tdefer mat1.Close()\n\n\timg, err := mat1.ToImageYUV()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImage %v.\", err)\n\t}\n\n\tif img.Bounds().Dx() != 102 {\n\t\tt.Errorf(\"TestToImage incorrect width got %d.\", img.Bounds().Dx())\n\t}\n\n\tif img.Bounds().Dy() != 101 {\n\t\tt.Errorf(\"TestToImage incorrect height got %d.\", img.Bounds().Dy())\n\t}\n\n\tmatreg := mat1.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg.Close()\n\timg, err = matreg.ToImageYUV()\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8UC1)\n\tdefer mat2.Close()\n\n\timg, err = mat2.ToImageYUV()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImageYUV %v.\", err)\n\t}\n\n\tmat3 := NewMatWithSize(101, 102, MatTypeCV8UC4)\n\tdefer mat3.Close()\n\n\timg, err = mat3.ToImageYUV()\n\tif err != nil {\n\t\tt.Errorf(\"TestToImageYUV %v.\", err)\n\t}\n\n\tmatreg3 := mat3.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg3.Close()\n\timg, err = matreg3.ToImageYUV()\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmatWithUnsupportedType := NewMatWithSize(101, 102, MatTypeCV8S)\n\tdefer matWithUnsupportedType.Close()\n\n\t_, err = matWithUnsupportedType.ToImageYUV()\n\tif err == nil {\n\t\tt.Error(\"TestToImageYUV expected error got nil.\")\n\t}\n}\n\nfunc TestMatToImageYUVWithParams(t *testing.T) {\n\tmat1 := NewMatWithSize(101, 102, MatTypeCV8UC3)\n\tdefer mat1.Close()\n\n\timg, err := mat1.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err != nil {\n\t\tt.Errorf(\"TestToImage %v.\", err)\n\t}\n\n\tif img.Bounds().Dx() != 102 {\n\t\tt.Errorf(\"TestToImage incorrect width got %d.\", img.Bounds().Dx())\n\t}\n\n\tif img.Bounds().Dy() != 101 {\n\t\tt.Errorf(\"TestToImage incorrect height got %d.\", img.Bounds().Dy())\n\t}\n\n\tmatreg := mat1.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg.Close()\n\timg, err = matreg.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmat2 := NewMatWithSize(101, 102, MatTypeCV8UC1)\n\tdefer mat2.Close()\n\n\timg, err = mat2.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err != nil {\n\t\tt.Errorf(\"TestToImageYUVWithParams image.YCbCrSubsampleRatio420%v.\", err)\n\t}\n\n\tmat3 := NewMatWithSize(101, 102, MatTypeCV8UC4)\n\tdefer mat3.Close()\n\n\timg, err = mat3.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err != nil {\n\t\tt.Errorf(\"TestToImageYUVWithParams image.YCbCrSubsampleRatio420%v.\", err)\n\t}\n\n\tmatreg3 := mat3.Region(image.Rect(25, 25, 75, 75))\n\tdefer matreg3.Close()\n\timg, err = matreg3.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err != nil {\n\t\tt.Errorf(\"Expected error.\")\n\t}\n\n\tmatWithUnsupportedType := NewMatWithSize(101, 102, MatTypeCV8S)\n\tdefer matWithUnsupportedType.Close()\n\n\t_, err = matWithUnsupportedType.ToImageYUVWithParams(image.YCbCrSubsampleRatio420)\n\tif err == nil {\n\t\tt.Error(\"TestToImageYUVWithParams image.YCbCrSubsampleRatio420expected error got nil.\")\n\t}\n}\n\n// Tests that image is the same after converting to Mat and back to Image\nfunc TestImageToMatRGBA(t *testing.T) {\n\tfile, err := os.Open(\"images/gocvlogo.png\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\timg0, _, err := image.Decode(file)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tmat, err := ImageToMatRGBA(img0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer mat.Close()\n\timg1, err := mat.ToImage()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif !compareImages(img0, img1) {\n\t\tt.Errorf(\"Image after converting to Mat and back to Image isn't the same\")\n\t}\n\n\timg3 := image.NewRGBA(image.Rect(0, 0, 200, 200))\n\tmat3, err := ImageToMatRGBA(img3)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer mat3.Close()\n}\n\n// Tests that image is the same after converting to Mat and back to Image\nfunc TestImageToMatRGB(t *testing.T) {\n\tfile, err := os.Open(\"images/gocvlogo.jpg\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\timg0, _, err := image.Decode(file)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tmat, err := ImageToMatRGB(img0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer mat.Close()\n\timg1, err := mat.ToImage()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif !compareImages(img0, img1) {\n\t\tt.Errorf(\"Image after converting to Mat and back to Image isn't the same\")\n\t}\n\n\timg3 := image.NewRGBA(image.Rect(0, 0, 200, 200))\n\tmat3, err := ImageToMatRGB(img3)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tdefer mat3.Close()\n}\n\nfunc TestImageGrayToMatGray(t *testing.T) {\n\tfile, err := os.Open(\"images/gocvlogo.jpg\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\timgSrc, _, err := image.Decode(file)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\timg0 := image.NewGray(imgSrc.Bounds())\n\tdraw.Draw(img0, imgSrc.Bounds(), imgSrc, image.ZP, draw.Src)\n\n\tmat, err := ImageGrayToMatGray(img0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer mat.Close()\n\timg1, err := mat.ToImage()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif !compareImages(img0, img1) {\n\t\tt.Errorf(\"Image after converting to Mat and back to Image isn't the same\")\n\t}\n}\n\nfunc TestAccumulate(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tAccumulate(src, &dst)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulateWithMask(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\tAccumulateWithMask(src, &dst, mask)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulateSquare(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tAccumulateSquare(src, &dst)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulateSquareWithMask(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\tAccumulateSquareWithMask(src, &dst, mask)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulateProduct(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tsrc2 := src.Clone()\n\tdefer src2.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tAccumulateProduct(src, src2, &dst)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulateProductWithMask(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tsrc2 := src.Clone()\n\tdefer src2.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\tAccumulateProductWithMask(src, src2, &dst, mask)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"Accumulate: dst is empty\")\n\t}\n}\n\nfunc TestAccumulatedWeighted(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tAccumulatedWeighted(src, &dst, 0.1)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"AccumulatedWeighted: dst is empty\")\n\t}\n}\n\nfunc TestAccumulatedWeightedWithMask(t *testing.T) {\n\tsrc := IMRead(\"images/gocvlogo.jpg\", IMReadUnchanged)\n\tdefer src.Close()\n\n\tdst := NewMatWithSizes(src.Size(), MatTypeCV64FC3)\n\tdefer dst.Close()\n\n\tmask := NewMat()\n\tdefer mask.Close()\n\tAccumulatedWeightedWithMask(src, &dst, 0.1, mask)\n\n\tif ok := dst.Empty(); ok {\n\t\tt.Errorf(\"AccumulatedWeighted: dst is empty\")\n\t}\n}\n"
  },
  {
    "path": "mat_noprofile.go",
    "content": "//go:build !matprofile\n// +build !matprofile\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"core.h\"\n*/\nimport \"C\"\n\n// addMatToProfile does nothing if matprofile tag is not set.\nfunc addMatToProfile(p C.Mat) {\n\treturn\n}\n\n// newMat returns a new Mat from a C Mat\nfunc newMat(p C.Mat) Mat {\n\treturn Mat{p: p}\n}\n\n// Close the Mat object.\nfunc (m *Mat) Close() error {\n\tC.Mat_Close(m.p)\n\tm.p = nil\n\tm.d = nil\n\treturn nil\n}\n"
  },
  {
    "path": "mat_profile.go",
    "content": "//go:build matprofile\n// +build matprofile\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"core.h\"\n*/\nimport (\n\t\"C\"\n)\n\nimport (\n\t\"runtime/pprof\"\n)\n\n// MatProfile a pprof.Profile that contains stack traces that led to (currently)\n// unclosed Mat's creations.  Every time a Mat is created, the stack trace is\n// added to this profile and every time the Mat is closed the trace is removed.\n// In a program that is not leaking, this profile's count should not\n// continuously increase and ideally when a program is terminated the count\n// should be zero.  You can get the count at any time with:\n//\n//\tgocv.MatProfile.Count()\n//\n// and you can display the current entries with:\n//\n//\tvar b bytes.Buffer\n//\tgocv.MatProfile.WriteTo(&b, 1)\n//\tfmt.Print(b.String())\n//\n// This will display stack traces of where the unclosed Mats were instantiated.\n// For example, the results could look something like this:\n//\n//\t1 @ 0x4146a0c 0x4146a57 0x4119666 0x40bb18f 0x405a841\n//\t#\t0x4146a0b\tgocv.io/x/gocv.newMat+0x4b\t/go/src/gocv.io/x/gocv/core.go:120\n//\t#\t0x4146a56\tgocv.io/x/gocv.NewMat+0x26\t/go/src/gocv.io/x/gocv/core.go:126\n//\t#\t0x4119665\tgocv.io/x/gocv.TestMat+0x25\t/go/src/gocv.io/x/gocv/core_test.go:29\n//\t#\t0x40bb18e\ttesting.tRunner+0xbe\t\t/usr/local/Cellar/go/1.11/libexec/src/testing/testing.go:827\n//\n// Furthermore, if the program is a long running process or if gocv is being used on a\n// web server, it may be helpful to install the HTTP interface using:\n//\n//\timport _ \"net/http/pprof\"\n//\n// In order to include the MatProfile custom profiler, you MUST build or run your application\n// or tests using the following build tag:\n// -tags matprofile\n//\n// For more information, see the runtime/pprof package documentation.\nvar MatProfile *pprof.Profile\n\nfunc init() {\n\tprofName := \"gocv.io/x/gocv.Mat\"\n\tMatProfile = pprof.Lookup(profName)\n\tif MatProfile == nil {\n\t\tMatProfile = pprof.NewProfile(profName)\n\t}\n}\n\n// addMatToProfile records Mat to the MatProfile.\nfunc addMatToProfile(p C.Mat) {\n\tMatProfile.Add(p, 1)\n\treturn\n}\n\n// newMat returns a new Mat from a C Mat and records it to the MatProfile.\nfunc newMat(p C.Mat) Mat {\n\tm := Mat{p: p}\n\tMatProfile.Add(p, 1)\n\treturn m\n}\n\n// Close the Mat object.\nfunc (m *Mat) Close() error {\n\t// NOTE: The pointer must be removed from the profile before it is deleted to\n\t// avoid a data race.\n\tMatProfile.Remove(m.p)\n\tC.Mat_Close(m.p)\n\tm.p = nil\n\tm.d = nil\n\treturn nil\n}\n"
  },
  {
    "path": "matprofile_test.go",
    "content": "//go:build matprofile\n// +build matprofile\n\npackage gocv\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestMain(m *testing.M) {\n\tret := m.Run()\n\tif MatProfile.Count() != 0 {\n\t\tvar b bytes.Buffer\n\t\tMatProfile.WriteTo(&b, 1)\n\t\tfmt.Printf(\"Not all Mat's in tests were closed: %v\", b.String())\n\t\tos.Exit(1)\n\t}\n\tos.Exit(ret)\n}\n\nfunc TestMatProfile(t *testing.T) {\n\tif MatProfile.Count() != 0 {\n\t\tvar b bytes.Buffer\n\t\tMatProfile.WriteTo(&b, 1)\n\t\tt.Errorf(\"Mat profile should start with 0 entries. A test failure here likely means that some other test is not closing all Mats. Here are the current profile entries:\\n%v\", b.String())\n\t}\n\tmat := NewMat()\n\tif MatProfile.Count() != 1 {\n\t\tt.Errorf(\"Mat profile should == 1 after NewMat but instead was %v\", MatProfile.Count())\n\t}\n\tmat2 := NewMat()\n\tif MatProfile.Count() != 2 {\n\t\tt.Errorf(\"Mat profile should == 2 after NewMat but instead was %v\", MatProfile.Count())\n\t}\n\tmat.Close()\n\tmat2.Close()\n\tif MatProfile.Count() != 0 {\n\t\tt.Errorf(\"Mat profile should == 0 after Close but instead was %v\", MatProfile.Count())\n\t}\n}\n\nfunc TestAddMatToProfile(t *testing.T) {\n\tif MatProfile.Count() != 0 {\n\t\tvar b bytes.Buffer\n\t\tMatProfile.WriteTo(&b, 1)\n\t\tt.Errorf(\"Mat profile should start with 0 entries. A test failure here likely means that some other test is not closing all Mats. Here are the current profile entries:\\n%v\", b.String())\n\t}\n\tmat := NewMatWithSize(5, 5, MatTypeCV8UC3)\n\tif MatProfile.Count() != 1 {\n\t\tt.Errorf(\"Mat profile should == 1 after creating 3 channel mat but instead was %v\", MatProfile.Count())\n\t}\n\n\tchannels := Split(mat)\n\tif MatProfile.Count() != 4 {\n\t\tt.Errorf(\"Mat profile should == 4 after split channel but instead was %v\", MatProfile.Count())\n\t}\n\n\tfor _, channel := range channels {\n\t\tchannel.Close()\n\t}\n\tif MatProfile.Count() != 1 {\n\t\tt.Errorf(\"Mat profile should == 1 after closing channels but instead was %v\", MatProfile.Count())\n\t}\n\n\tmat.Close()\n\tif MatProfile.Count() != 0 {\n\t\tt.Errorf(\"Mat profile should == 0 after closing all mats but instead was %v\", MatProfile.Count())\n\t}\n}\n"
  },
  {
    "path": "objdetect.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_objdetect)\n\n#include \"objdetect.h\"\n\n// CascadeClassifier\n\nCascadeClassifier CascadeClassifier_New() {\n    try {\n        return new cv::CascadeClassifier();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid CascadeClassifier_Close(CascadeClassifier cs) {\n    delete cs;\n}\n\nint CascadeClassifier_Load(CascadeClassifier cs, const char* name) {\n    try {\n        return cs->load(name);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nstruct Rects CascadeClassifier_DetectMultiScale(CascadeClassifier cs, Mat img) {\n    try {\n        std::vector<cv::Rect> detected;\n        cs->detectMultiScale(*img, detected); // uses all default parameters\n        Rect* rects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\nstruct Rects CascadeClassifier_DetectMultiScaleWithParams(CascadeClassifier cs, Mat img,\n        double scale, int minNeighbors, int flags, Size minSize, Size maxSize) {\n    try {\n        cv::Size minSz(minSize.width, minSize.height);\n        cv::Size maxSz(maxSize.width, maxSize.height);\n    \n        std::vector<cv::Rect> detected;\n        cs->detectMultiScale(*img, detected, scale, minNeighbors, flags, minSz, maxSz);\n        Rect* rects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\n// HOGDescriptor\n\nHOGDescriptor HOGDescriptor_New() {\n    try {\n        return new cv::HOGDescriptor();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid HOGDescriptor_Close(HOGDescriptor hog) {\n    delete hog;\n}\n\nint HOGDescriptor_Load(HOGDescriptor hog, const char* name) {\n    try {\n        return hog->load(name);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nstruct Rects HOGDescriptor_DetectMultiScale(HOGDescriptor hog, Mat img) {\n    try {\n        std::vector<cv::Rect> detected;\n        hog->detectMultiScale(*img, detected);\n        Rect* rects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\nstruct Rects HOGDescriptor_DetectMultiScaleWithParams(HOGDescriptor hog, Mat img,\n        double hitThresh, Size winStride, Size padding, double scale, double finalThresh,\n        bool useMeanshiftGrouping) {\n\n    try {\n        cv::Size wSz(winStride.width, winStride.height);\n        cv::Size pSz(padding.width, padding.height);\n    \n        std::vector<cv::Rect> detected;\n        hog->detectMultiScale(*img, detected, hitThresh, wSz, pSz, scale, finalThresh,\n                              useMeanshiftGrouping);\n        Rect* rects = new Rect[detected.size()];\n    \n        for (size_t i = 0; i < detected.size(); ++i) {\n            Rect r = {detected[i].x, detected[i].y, detected[i].width, detected[i].height};\n            rects[i] = r;\n        }\n    \n        Rects ret = {rects, (int)detected.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\nMat HOG_GetDefaultPeopleDetector() {\n    try {\n        return new cv::Mat(cv::HOGDescriptor::getDefaultPeopleDetector());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return new cv::Mat();\n    }\n}\n\nvoid HOGDescriptor_SetSVMDetector(HOGDescriptor hog, Mat det) {\n    try {\n        hog->setSVMDetector(*det);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nstruct Rects GroupRectangles(struct Rects rects, int groupThreshold, double eps) {\n    try {\n        std::vector<cv::Rect> vRect;\n\n        for (int i = 0; i < rects.length; ++i) {\n            cv::Rect r = cv::Rect(rects.rects[i].x, rects.rects[i].y, rects.rects[i].width,\n                                  rects.rects[i].height);\n            vRect.push_back(r);\n        }\n    \n        cv::groupRectangles(vRect, groupThreshold, eps);\n    \n        Rect* results = new Rect[vRect.size()];\n    \n        for (size_t i = 0; i < vRect.size(); ++i) {\n            Rect r = {vRect[i].x, vRect[i].y, vRect[i].width, vRect[i].height};\n            results[i] = r;\n        }\n    \n        Rects ret = {results, (int)vRect.size()};\n        return ret;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Rects ret = {NULL, 0};\n        return ret;\n    }\n}\n\n// QRCodeDetector\n\nQRCodeDetector QRCodeDetector_New() {\n    try {\n        return new cv::QRCodeDetector();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid QRCodeDetector_Close(QRCodeDetector qr) {\n    delete qr;\n}\n\nconst char* QRCodeDetector_DetectAndDecode(QRCodeDetector qr, Mat input,Mat points,Mat straight_qrcode) {\n    try {\n        cv::String *str = new cv::String(qr->detectAndDecode(*input,*points,*straight_qrcode)); \n        return str->c_str();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return \"\";\n    }\n}\n\nbool QRCodeDetector_Detect(QRCodeDetector qr, Mat input,Mat points) {\n    try {\n        return qr->detect(*input,*points); \n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nconst char* QRCodeDetector_Decode(QRCodeDetector qr, Mat input,Mat inputPoints,Mat straight_qrcode) {\n    try {\n        cv::String *str = new cv::String(qr->detectAndDecode(*input,*inputPoints,*straight_qrcode)); \n        return str->c_str();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return \"\";\n    }\n}\n\nbool QRCodeDetector_DetectMulti(QRCodeDetector qr, Mat input, Mat points) {\n    try {\n        return qr->detectMulti(*input,*points);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nbool QRCodeDetector_DetectAndDecodeMulti(QRCodeDetector qr, Mat input, CStrings* decoded, Mat points, struct Mats* qrCodes) {\n    try {\n        std::vector<cv::String> decodedCodes;\n        std::vector<cv::Mat> straightQrCodes;\n        bool res = qr->detectAndDecodeMulti(*input, decodedCodes, *points, straightQrCodes);\n        if (!res) {\n            return res;\n        }\n    \n        qrCodes->mats = new Mat[straightQrCodes.size()];\n        qrCodes->length = straightQrCodes.size();\n        for (size_t i = 0; i < straightQrCodes.size(); i++) {\n            qrCodes->mats[i] = new cv::Mat(straightQrCodes[i]);\n        }\n    \n        const char **strs = new const char*[decodedCodes.size()];\n        for (size_t i = 0; i < decodedCodes.size(); ++i) {\n            strs[i] = decodedCodes[i].c_str();\n        }\n        decoded->length = decodedCodes.size();\n        decoded->strs = strs;\n        return res;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return false;\n    }\n}\n\nFaceDetectorYN FaceDetectorYN_Create(const char* model, const char* config, Size size) {\n    try {\n        cv::String smodel = cv::String(model);\n        cv::String sconfig = cv::String(config);\n        cv::Size   ssize = cv::Size(size.width, size.height);\n    \n        return new cv::Ptr<cv::FaceDetectorYN>(cv::FaceDetectorYN::create(smodel, sconfig, ssize));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nFaceDetectorYN FaceDetectorYN_Create_WithParams(const char* model, const char* config, Size size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id) {\n    try {\n        cv::String smodel = cv::String(model);\n        cv::String sconfig = cv::String(config);\n        cv::Size   ssize = cv::Size(size.width, size.height);\n    \n        return new cv::Ptr<cv::FaceDetectorYN>(cv::FaceDetectorYN::create(smodel, sconfig, ssize, score_threshold, nms_threshold, top_k, backend_id, target_id));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nFaceDetectorYN FaceDetectorYN_Create_FromBytes(const char* framework, void* bufferModel, int model_size, void* bufferConfig, int config_size, Size size) {\n    try {\n        cv::String sframework = cv::String(framework);\n        cv::Size   ssize = cv::Size(size.width, size.height);\n        \n        std::vector<uchar> bufferModelV;\n        std::vector<uchar> bufferConfigV;\n    \n        uchar* bmv = (uchar*)bufferModel;\n        uchar* bcv = (uchar*)bufferConfig;\n    \n    \n        for(int i = 0; i < model_size; i ++) {\n            bufferModelV.push_back(bmv[i]);\n        }\n        for(int i = 0; i < config_size; i ++) {\n            bufferConfigV.push_back(bcv[i]);\n        }\n    \n        return new cv::Ptr<cv::FaceDetectorYN>(cv::FaceDetectorYN::create(sframework, bufferModelV, bufferConfigV, ssize));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nFaceDetectorYN FaceDetectorYN_Create_FromBytes_WithParams(const char* framework, void* bufferModel, int model_size, void* bufferConfig, int config_size, Size size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id) {\n    try {\n        cv::String sframework = cv::String(framework);\n        cv::Size   ssize = cv::Size(size.width, size.height);\n        \n        std::vector<uchar> bufferModelV;\n        std::vector<uchar> bufferConfigV;\n    \n        uchar* bmv = (uchar*)bufferModel;\n        uchar* bcv = (uchar*)bufferConfig;\n    \n        for(int i = 0; i < model_size; i ++) {\n            bufferModelV.push_back(bmv[i]);\n        }\n        for(int i = 0; i < config_size; i ++) {\n            bufferConfigV.push_back(bcv[i]);\n        }\n    \n        return new cv::Ptr<cv::FaceDetectorYN>(cv::FaceDetectorYN::create(sframework, bufferModelV, bufferConfigV, ssize, score_threshold, nms_threshold, top_k, backend_id, target_id));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FaceDetectorYN_Close(FaceDetectorYN fd) {\n    delete fd;\n}\n\nint FaceDetectorYN_Detect(FaceDetectorYN fd, Mat image, Mat faces) {\n    try {\n        return (*fd)->detect(*image, *faces);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nSize FaceDetectorYN_GetInputSize(FaceDetectorYN fd) {\n    try {\n        Size sz;\n\n        cv::Size cvsz = (*fd)->getInputSize();\n    \n        sz.width = cvsz.width;\n        sz.height = cvsz.height;\n    \n        return sz;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        Size sz = {0, 0};\n        return sz;\n    }\n}\n\nfloat FaceDetectorYN_GetNMSThreshold(FaceDetectorYN fd) {\n    try {\n        return (*fd)->getNMSThreshold();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat FaceDetectorYN_GetScoreThreshold(FaceDetectorYN fd) {\n    try {\n        return (*fd)->getScoreThreshold();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nint FaceDetectorYN_GetTopK(FaceDetectorYN fd) {\n    try {\n        return (*fd)->getTopK();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\nvoid FaceDetectorYN_SetInputSize(FaceDetectorYN fd, Size input_size){\n    try {\n        cv::Size isz(input_size.width, input_size.height);\n        (*fd)->setInputSize(isz);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid FaceDetectorYN_SetNMSThreshold(FaceDetectorYN fd, float nms_threshold){\n    try {\n        (*fd)->setNMSThreshold(nms_threshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid FaceDetectorYN_SetScoreThreshold(FaceDetectorYN fd, float score_threshold){\n    try {\n        (*fd)->setScoreThreshold(score_threshold);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid FaceDetectorYN_SetTopK(FaceDetectorYN fd, int top_k){\n    try {\n        (*fd)->setTopK(top_k);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nFaceRecognizerSF FaceRecognizerSF_Create(const char* model, const char* config) {\n    try {\n        return FaceRecognizerSF_Create_WithParams(model, config, 0, 0);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nFaceRecognizerSF FaceRecognizerSF_Create_WithParams(const char* model, const char* config, int backend_id, int target_id) {\n    try {\n        return new cv::Ptr<cv::FaceRecognizerSF>(cv::FaceRecognizerSF::create(model, config, backend_id, target_id));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid FaceRecognizerSF_Close(FaceRecognizerSF fr) {\n    delete fr;\n}\n\nvoid FaceRecognizerSF_AlignCrop(FaceRecognizerSF fr, Mat src_img, Mat face_box, Mat aligned_img) {\n    try {\n        (*fr)->alignCrop(*src_img, *face_box, *aligned_img);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nvoid FaceRecognizerSF_Feature(FaceRecognizerSF fr, Mat aligned_img, Mat face_feature) {\n    try {\n        (*fr)->feature(*aligned_img, *face_feature);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n    }\n}\n\nfloat FaceRecognizerSF_Match(FaceRecognizerSF fr, Mat face_feature1, Mat face_feature2) {\n    try {\n        return FaceRecognizerSF_Match_WithParams(fr, face_feature1, face_feature2, 0);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}\n\nfloat FaceRecognizerSF_Match_WithParams(FaceRecognizerSF fr, Mat face_feature1, Mat face_feature2, int dis_type) {\n    try {\n        double rv = (*fr)->match(*face_feature1, *face_feature2, dis_type);\n        return (float)rv;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0.0;\n    }\n}"
  },
  {
    "path": "objdetect.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_objdetect)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"objdetect.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n)\n\n// CascadeClassifier is a cascade classifier class for object detection.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html\ntype CascadeClassifier struct {\n\tp C.CascadeClassifier\n}\n\n// NewCascadeClassifier returns a new CascadeClassifier.\nfunc NewCascadeClassifier() CascadeClassifier {\n\treturn CascadeClassifier{p: C.CascadeClassifier_New()}\n}\n\n// Close deletes the CascadeClassifier's pointer.\nfunc (c *CascadeClassifier) Close() error {\n\tC.CascadeClassifier_Close(c.p)\n\tc.p = nil\n\treturn nil\n}\n\n// Load cascade classifier from a file.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#a1a5884c8cc749422f9eb77c2471958bc\nfunc (c *CascadeClassifier) Load(name string) bool {\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\treturn C.CascadeClassifier_Load(c.p, cName) != 0\n}\n\n// DetectMultiScale detects objects of different sizes in the input Mat image.\n// The detected objects are returned as a slice of image.Rectangle structs.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498\nfunc (c *CascadeClassifier) DetectMultiScale(img Mat) []image.Rectangle {\n\tret := C.CascadeClassifier_DetectMultiScale(c.p, img.p)\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// DetectMultiScaleWithParams calls DetectMultiScale but allows setting parameters\n// to values other than just the defaults.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d1/de5/classcv_1_1CascadeClassifier.html#aaf8181cb63968136476ec4204ffca498\nfunc (c *CascadeClassifier) DetectMultiScaleWithParams(img Mat, scale float64,\n\tminNeighbors, flags int, minSize, maxSize image.Point) []image.Rectangle {\n\n\tminSz := C.struct_Size{\n\t\twidth:  C.int(minSize.X),\n\t\theight: C.int(minSize.Y),\n\t}\n\n\tmaxSz := C.struct_Size{\n\t\twidth:  C.int(maxSize.X),\n\t\theight: C.int(maxSize.Y),\n\t}\n\n\tret := C.CascadeClassifier_DetectMultiScaleWithParams(c.p, img.p, C.double(scale),\n\t\tC.int(minNeighbors), C.int(flags), minSz, maxSz)\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// HOGDescriptor is a Histogram Of Gradiants (HOG) for object detection.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a723b95b709cfd3f95cf9e616de988fc8\ntype HOGDescriptor struct {\n\tp C.HOGDescriptor\n}\n\n// NewHOGDescriptor returns a new HOGDescriptor.\nfunc NewHOGDescriptor() HOGDescriptor {\n\treturn HOGDescriptor{p: C.HOGDescriptor_New()}\n}\n\n// Close deletes the HOGDescriptor's pointer.\nfunc (h *HOGDescriptor) Close() error {\n\tC.HOGDescriptor_Close(h.p)\n\th.p = nil\n\treturn nil\n}\n\n// DetectMultiScale detects objects in the input Mat image.\n// The detected objects are returned as a slice of image.Rectangle structs.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948\nfunc (h *HOGDescriptor) DetectMultiScale(img Mat) []image.Rectangle {\n\tret := C.HOGDescriptor_DetectMultiScale(h.p, img.p)\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// DetectMultiScaleWithParams calls DetectMultiScale but allows setting parameters\n// to values other than just the defaults.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948\nfunc (h *HOGDescriptor) DetectMultiScaleWithParams(img Mat, hitThresh float64,\n\twinStride, padding image.Point, scale, finalThreshold float64, useMeanshiftGrouping bool) []image.Rectangle {\n\twSz := C.struct_Size{\n\t\twidth:  C.int(winStride.X),\n\t\theight: C.int(winStride.Y),\n\t}\n\n\tpSz := C.struct_Size{\n\t\twidth:  C.int(padding.X),\n\t\theight: C.int(padding.Y),\n\t}\n\n\tret := C.HOGDescriptor_DetectMultiScaleWithParams(h.p, img.p, C.double(hitThresh),\n\t\twSz, pSz, C.double(scale), C.double(finalThreshold), C.bool(useMeanshiftGrouping))\n\tdefer C.Rects_Close(ret)\n\n\treturn toRectangles(ret)\n}\n\n// HOGDefaultPeopleDetector returns a new Mat with the HOG DefaultPeopleDetector.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a660e5cd036fd5ddf0f5767b352acd948\nfunc HOGDefaultPeopleDetector() Mat {\n\treturn newMat(C.HOG_GetDefaultPeopleDetector())\n}\n\n// SetSVMDetector sets the data for the HOGDescriptor.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d33/structcv_1_1HOGDescriptor.html#a09e354ad701f56f9c550dc0385dc36f1\nfunc (h *HOGDescriptor) SetSVMDetector(det Mat) error {\n\tC.HOGDescriptor_SetSVMDetector(h.p, det.p)\n\treturn nil\n}\n\n// GroupRectangles groups the object candidate rectangles.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d5/d54/group__objdetect.html#ga3dba897ade8aa8227edda66508e16ab9\nfunc GroupRectangles(rects []image.Rectangle, groupThreshold int, eps float64) []image.Rectangle {\n\tcRectArray := make([]C.struct_Rect, len(rects))\n\tfor i, r := range rects {\n\t\tcRect := C.struct_Rect{\n\t\t\tx:      C.int(r.Min.X),\n\t\t\ty:      C.int(r.Min.Y),\n\t\t\twidth:  C.int(r.Size().X),\n\t\t\theight: C.int(r.Size().Y),\n\t\t}\n\t\tcRectArray[i] = cRect\n\t}\n\tcRects := C.struct_Rects{\n\t\trects:  (*C.Rect)(&cRectArray[0]),\n\t\tlength: C.int(len(rects)),\n\t}\n\n\tret := C.GroupRectangles(cRects, C.int(groupThreshold), C.double(eps))\n\n\treturn toRectangles(ret)\n}\n\n// QRCodeDetector groups the object candidate rectangles.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html\ntype QRCodeDetector struct {\n\tp C.QRCodeDetector\n}\n\n// newQRCodeDetector returns a new QRCodeDetector from a C QRCodeDetector\nfunc newQRCodeDetector(p C.QRCodeDetector) QRCodeDetector {\n\treturn QRCodeDetector{p: p}\n}\n\nfunc NewQRCodeDetector() QRCodeDetector {\n\treturn newQRCodeDetector(C.QRCodeDetector_New())\n}\n\nfunc (a *QRCodeDetector) Close() error {\n\tC.QRCodeDetector_Close(a.p)\n\ta.p = nil\n\treturn nil\n}\n\n// DetectAndDecode Both detects and decodes QR code.\n//\n// Returns true as long as some QR code was detected even in case where the decoding failed\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a7290bd6a5d59b14a37979c3a14fbf394\nfunc (a *QRCodeDetector) DetectAndDecode(input Mat, points *Mat, straight_qrcode *Mat) string {\n\tgoResult := C.GoString(C.QRCodeDetector_DetectAndDecode(a.p, input.p, points.p, straight_qrcode.p))\n\treturn string(goResult)\n}\n\n// Detect detects QR code in image and returns the quadrangle containing the code.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a64373f7d877d27473f64fe04bb57d22b\nfunc (a *QRCodeDetector) Detect(input Mat, points *Mat) bool {\n\tresult := C.QRCodeDetector_Detect(a.p, input.p, points.p)\n\treturn bool(result)\n}\n\n// Decode decodes QR code in image once it's found by the detect() method. Returns UTF8-encoded output string or empty string if the code cannot be decoded.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a4172c2eb4825c844fb1b0ae67202d329\nfunc (a *QRCodeDetector) Decode(input Mat, points Mat, straight_qrcode *Mat) string {\n\tgoResult := C.GoString(C.QRCodeDetector_DetectAndDecode(a.p, input.p, points.p, straight_qrcode.p))\n\treturn string(goResult)\n}\n\n// Detects QR codes in image and finds of the quadrangles containing the codes.\n//\n// Each quadrangle would be returned as a row in the `points` Mat and each point is a Vecf.\n// Returns true if QR code was detected\n// For usage please see TestQRCodeDetector\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#aaf2b6b2115b8e8fbc9acf3a8f68872b6\nfunc (a *QRCodeDetector) DetectMulti(input Mat, points *Mat) bool {\n\tresult := C.QRCodeDetector_DetectMulti(a.p, input.p, points.p)\n\treturn bool(result)\n}\n\n// Detects QR codes in image, finds the quadrangles containing the codes, and decodes the QRCodes to strings.\n//\n// Each quadrangle would be returned as a row in the `points` Mat and each point is a Vecf.\n// Returns true as long as some QR code was detected even in case where the decoding failed\n// For usage please see TestQRCodeDetector\n// For further details, please see:\n// https://docs.opencv.org/master/de/dc3/classcv_1_1QRCodeDetector.html#a188b63ffa17922b2c65d8a0ab7b70775\nfunc (a *QRCodeDetector) DetectAndDecodeMulti(input Mat, decoded []string, points *Mat, qrCodes []Mat) bool {\n\tcDecoded := C.CStrings{}\n\tdefer C.CStrings_Close(cDecoded)\n\tcQrCodes := C.struct_Mats{}\n\tdefer C.Mats_Close(cQrCodes)\n\tsuccess := C.QRCodeDetector_DetectAndDecodeMulti(a.p, input.p, &cDecoded, points.p, &cQrCodes)\n\tif !success {\n\t\treturn bool(success)\n\t}\n\n\ttmpCodes := make([]Mat, cQrCodes.length)\n\tfor i := C.int(0); i < cQrCodes.length; i++ {\n\t\ttmpCodes[i].p = C.Mats_get(cQrCodes, i)\n\t}\n\n\tfor _, qr := range tmpCodes {\n\t\tqrCodes = append(qrCodes, qr)\n\t}\n\n\tfor _, s := range toGoStrings(cDecoded) {\n\t\tdecoded = append(decoded, s)\n\t}\n\treturn bool(success)\n}\n\ntype FaceDetectorYN struct {\n\tp C.FaceDetectorYN\n}\n\n// NewFaceDetectorYN Creates an instance of face detector with given parameters.\n//\n// modelPath: the path to the requested model\n//\n// configPath: the path to the config file for compability, which is not requested for ONNX models\n//\n// size: the size of the input image\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516\nfunc NewFaceDetectorYN(modelPath string, configPath string, size image.Point) FaceDetectorYN {\n\n\tc_model_path := C.CString(modelPath)\n\tdefer C.free(unsafe.Pointer(c_model_path))\n\n\tc_config_path := C.CString(configPath)\n\tdefer C.free(unsafe.Pointer(c_config_path))\n\n\tc_size := C.Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn FaceDetectorYN{p: C.FaceDetectorYN_Create(c_model_path, c_config_path, c_size)}\n}\n\n// NewFaceDetectorYNWithParams Creates an instance of face detector with given parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a5f7fb43c60c95ca5ebab78483de02516\nfunc NewFaceDetectorYNWithParams(modelPath string, configPath string, size image.Point, scoreThreshold float32, nmsThreshold float32, topK int, backendId int, targetId int) FaceDetectorYN {\n\n\tc_model_path := C.CString(modelPath)\n\tdefer C.free(unsafe.Pointer(c_model_path))\n\n\tc_config_path := C.CString(configPath)\n\tdefer C.free(unsafe.Pointer(c_config_path))\n\n\tc_size := C.Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn FaceDetectorYN{p: C.FaceDetectorYN_Create_WithParams(c_model_path, c_config_path, c_size, C.float(scoreThreshold), C.float(nmsThreshold), C.int(topK), C.int(backendId), C.int(targetId))}\n}\n\n// NewFaceDetectorYNFromBytes Creates an instance of face detector with given parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#aa0796a4bfe2d4709bef81abbae9a927a\nfunc NewFaceDetectorYNFromBytes(framework string, bufferModel []byte, bufferConfig []byte, size image.Point) FaceDetectorYN {\n\n\tc_framework := C.CString(framework)\n\tdefer C.free(unsafe.Pointer(c_framework))\n\n\tc_size := C.Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn FaceDetectorYN{p: C.FaceDetectorYN_Create_FromBytes(c_framework,\n\t\tunsafe.Pointer(unsafe.SliceData(bufferModel)), C.int(len(bufferModel)),\n\t\tunsafe.Pointer(unsafe.SliceData(bufferConfig)), C.int(len(bufferConfig)), c_size)}\n}\n\n// NewFaceDetectorYNFromBuffers Creates an instance of face detector with given parameters.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#aa0796a4bfe2d4709bef81abbae9a927a\nfunc NewFaceDetectorYNFromBytesWithParams(framework string, bufferModel []byte, bufferConfig []byte, size image.Point, scoreThreshold float32, nmsThreshold float32, topK int, backendId int, targetId int) FaceDetectorYN {\n\n\tc_framework := C.CString(framework)\n\tdefer C.free(unsafe.Pointer(c_framework))\n\n\tc_size := C.Size{\n\t\twidth:  C.int(size.X),\n\t\theight: C.int(size.Y),\n\t}\n\n\treturn FaceDetectorYN{p: C.FaceDetectorYN_Create_FromBytes_WithParams(c_framework,\n\t\tunsafe.Pointer(unsafe.SliceData(bufferModel)), C.int(len(bufferModel)),\n\t\tunsafe.Pointer(unsafe.SliceData(bufferConfig)), C.int(len(bufferConfig)), c_size,\n\t\tC.float(scoreThreshold), C.float(nmsThreshold), C.int(topK), C.int(backendId), C.int(targetId))}\n}\n\nfunc (fd *FaceDetectorYN) Close() {\n\tC.FaceDetectorYN_Close(fd.p)\n}\n\n// Detect Detects faces in the input image.\n//\n// image: an image to detect\n//\n// faces: detection results stored in a 2D cv::Mat of shape [num_faces, 15]\n//\n// 0-1: x, y of bbox top left corner\n//\n// 2-3: width, height of bbox\n//\n// 4-5: x, y of right eye (blue point in the example image)\n//\n// 6-7: x, y of left eye (red point in the example image)\n//\n// 8-9: x, y of nose tip (green point in the example image)\n//\n// 10-11: x, y of right corner of mouth (pink point in the example image)\n//\n// 12-13: x, y of left corner of mouth (yellow point in the example image)\n//\n// 14: face score\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#ac05bd075ca3e6edc0e328927aae6f45b\nfunc (fd *FaceDetectorYN) Detect(image Mat, faces *Mat) int {\n\tc_rv := C.FaceDetectorYN_Detect(fd.p, image.p, faces.p)\n\treturn int(c_rv)\n}\n\nfunc (fd *FaceDetectorYN) GetInputSize() image.Point {\n\tsz := C.FaceDetectorYN_GetInputSize(fd.p)\n\n\treturn image.Pt(int(sz.width), int(sz.height))\n}\n\nfunc (fd *FaceDetectorYN) GetNMSThreshold() float32 {\n\tt := C.FaceDetectorYN_GetNMSThreshold(fd.p)\n\treturn float32(t)\n}\n\nfunc (fd *FaceDetectorYN) GetScoreThreshold() float32 {\n\tt := C.FaceDetectorYN_GetScoreThreshold(fd.p)\n\treturn float32(t)\n}\n\nfunc (fd *FaceDetectorYN) GetTopK() int {\n\ti := C.FaceDetectorYN_GetTopK(fd.p)\n\treturn int(i)\n}\n\n// SetInputSize Set the size for the network input, which overwrites the input size of creating model.\n// Call this method when the size of input image does not match the input size when creating model.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a072418e5ce7beeb69c41edda75c41d2e\nfunc (fd *FaceDetectorYN) SetInputSize(sz image.Point) {\n\tc_sz := C.Size{\n\t\twidth:  C.int(sz.X),\n\t\theight: C.int(sz.Y),\n\t}\n\tC.FaceDetectorYN_SetInputSize(fd.p, c_sz)\n}\n\n// SetNMSThreshold Set the Non-maximum-suppression threshold to suppress\n// bounding boxes that have IoU greater than the given value.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#ab6011efee7e12dca3857d82de5269ac5\nfunc (fd *FaceDetectorYN) SetNMSThreshold(nmsThreshold float32) {\n\tC.FaceDetectorYN_SetNMSThreshold(fd.p, C.float(nmsThreshold))\n}\n\n// SetScoreThreshold Set the score threshold to filter out bounding boxes of score less than the given value.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#a37f3c23b82158fac7fdad967d315f85a\nfunc (fd *FaceDetectorYN) SetScoreThreshold(scoreThreshold float32) {\n\tC.FaceDetectorYN_SetScoreThreshold(fd.p, C.float(scoreThreshold))\n}\n\n// SetTopK Set the number of bounding boxes preserved before NMS.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/d20/classcv_1_1FaceDetectorYN.html#aa88d20e1e2df75ea36b851534089856a\nfunc (fd *FaceDetectorYN) SetTopK(topK int) {\n\tC.FaceDetectorYN_SetTopK(fd.p, C.int(topK))\n}\n\ntype FaceRecognizerSFDisType int\n\nconst (\n\tFaceRecognizerSFDisTypeCosine FaceRecognizerSFDisType = 0\n\tFaceRecognizerSFDisTypeNormL2 FaceRecognizerSFDisType = 1\n)\n\ntype FaceRecognizerSF struct {\n\tp C.FaceRecognizerSF\n}\n\n// NewFaceRecognizerSF Creates an instance with given parameters.\n//\n// model: the path of the onnx model used for face recognition\n//\n// config: the path to the config file for compability, which is not requested for ONNX models\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a04df90b0cd7d26d350acd92621a35743\nfunc NewFaceRecognizerSF(modelPath string, configPath string) FaceRecognizerSF {\n\tc_model := C.CString(modelPath)\n\tdefer C.free(unsafe.Pointer(c_model))\n\n\tc_config := C.CString(configPath)\n\tdefer C.free(unsafe.Pointer(c_config))\n\n\treturn FaceRecognizerSF{p: C.FaceRecognizerSF_Create(c_model, c_config)}\n}\n\n// NewFaceRecognizerSFWithParams Creates an instance with given parameters.\n//\n// model: the path of the onnx model used for face recognition\n//\n// config: the path to the config file for compability, which is not requested for ONNX models\n//\n// backend_id: the id of backend\n//\n// target_id: the id of target device\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a04df90b0cd7d26d350acd92621a35743\nfunc NewFaceRecognizerSFWithParams(modelPath string, configPath string, backendId int, targetId int) FaceRecognizerSF {\n\tc_model := C.CString(modelPath)\n\tdefer C.free(unsafe.Pointer(c_model))\n\n\tc_config := C.CString(configPath)\n\tdefer C.free(unsafe.Pointer(c_config))\n\n\treturn FaceRecognizerSF{p: C.FaceRecognizerSF_Create_WithParams(c_model, c_config, C.int(backendId), C.int(targetId))}\n}\n\n// Close Releases FaceRecognizerSF resources.\nfunc (fr *FaceRecognizerSF) Close() {\n\tC.FaceRecognizerSF_Close(fr.p)\n}\n\n// AlignCrop Aligns detected face with the source input image and crops it.\n//\n// srcImg: input image\n//\n// faceBox: the detected face result from the input image\n//\n// alignedImg: output aligned image\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a84492908abecbc9362b4ddc8d46b8345\nfunc (fr *FaceRecognizerSF) AlignCrop(srcImg Mat, faceBox Mat, alignedImg *Mat) {\n\tC.FaceRecognizerSF_AlignCrop(fr.p, srcImg.p, faceBox.p, alignedImg.p)\n}\n\n// Feature Extracts face feature from aligned image.\n//\n// alignedImg: input aligned image\n//\n// faceFeature: output face feature\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#ab1b4a3c12213e89091a490c573dc5aba\nfunc (fr *FaceRecognizerSF) Feature(alignedImg Mat, faceFeature *Mat) {\n\tC.FaceRecognizerSF_Feature(fr.p, alignedImg.p, faceFeature.p)\n}\n\n// Match Calculates the distance between two face features.\n//\n// faceFeature1: the first input feature\n//\n// faceFeature2: the second input feature of the same size and the same type as face_feature1\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a2f0362ca1e64320a1f3ba7e1386d0219\nfunc (fr *FaceRecognizerSF) Match(faceFeature1 Mat, faceFeature2 Mat) float32 {\n\trv := C.FaceRecognizerSF_Match(fr.p, faceFeature1.p, faceFeature2.p)\n\treturn float32(rv)\n}\n\n// MatchWithParams Calculates the distance between two face features.\n//\n// faceFeature1: the first input feature\n//\n// faceFeature2: the second input feature of the same size and the same type as face_feature1\n//\n// disType: defines how to calculate the distance between two face features\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/da/d09/classcv_1_1FaceRecognizerSF.html#a2f0362ca1e64320a1f3ba7e1386d0219\nfunc (fr *FaceRecognizerSF) MatchWithParams(faceFeature1 Mat, faceFeature2 Mat, disType FaceRecognizerSFDisType) float32 {\n\trv := C.FaceRecognizerSF_Match_WithParams(fr.p, faceFeature1.p, faceFeature2.p, C.int(disType))\n\treturn float32(rv)\n}\n"
  },
  {
    "path": "objdetect.h",
    "content": "#ifndef _OPENCV3_OBJDETECT_H_\n#define _OPENCV3_OBJDETECT_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::CascadeClassifier* CascadeClassifier;\ntypedef cv::HOGDescriptor* HOGDescriptor;\ntypedef cv::QRCodeDetector* QRCodeDetector;\ntypedef cv::Ptr<cv::FaceDetectorYN>* FaceDetectorYN;\ntypedef cv::Ptr<cv::FaceRecognizerSF>* FaceRecognizerSF;\n#else\ntypedef void* CascadeClassifier;\ntypedef void* HOGDescriptor;\ntypedef void* QRCodeDetector;\ntypedef void* FaceDetectorYN;\ntypedef void* FaceRecognizerSF;\n#endif\n\n// CascadeClassifier\nCascadeClassifier CascadeClassifier_New();\nvoid CascadeClassifier_Close(CascadeClassifier cs);\nint CascadeClassifier_Load(CascadeClassifier cs, const char* name);\nstruct Rects CascadeClassifier_DetectMultiScale(CascadeClassifier cs, Mat img);\nstruct Rects CascadeClassifier_DetectMultiScaleWithParams(CascadeClassifier cs, Mat img,\n        double scale, int minNeighbors, int flags, Size minSize, Size maxSize);\n\nHOGDescriptor HOGDescriptor_New();\nvoid HOGDescriptor_Close(HOGDescriptor hog);\nint HOGDescriptor_Load(HOGDescriptor hog, const char* name);\nstruct Rects HOGDescriptor_DetectMultiScale(HOGDescriptor hog, Mat img);\nstruct Rects HOGDescriptor_DetectMultiScaleWithParams(HOGDescriptor hog, Mat img,\n        double hitThresh, Size winStride, Size padding, double scale, double finalThreshold,\n        bool useMeanshiftGrouping);\nMat HOG_GetDefaultPeopleDetector();\nvoid HOGDescriptor_SetSVMDetector(HOGDescriptor hog, Mat det);\n\nstruct Rects GroupRectangles(struct Rects rects, int groupThreshold, double eps);\n\nQRCodeDetector QRCodeDetector_New();\nconst char* QRCodeDetector_DetectAndDecode(QRCodeDetector qr, Mat input,Mat points,Mat straight_qrcode);\nbool QRCodeDetector_Detect(QRCodeDetector qr, Mat input,Mat points);\nconst char* QRCodeDetector_Decode(QRCodeDetector qr, Mat input,Mat inputPoints,Mat straight_qrcode);\nvoid QRCodeDetector_Close(QRCodeDetector qr);\nbool QRCodeDetector_DetectMulti(QRCodeDetector qr, Mat input, Mat points);\nbool QRCodeDetector_DetectAndDecodeMulti(QRCodeDetector qr, Mat input, CStrings* decoded ,Mat points, struct Mats* mats);\n\n// FaceDetectorYN\nFaceDetectorYN FaceDetectorYN_Create(const char* model, const char* config, Size size);\nFaceDetectorYN FaceDetectorYN_Create_WithParams(const char* model, const char* config, Size size, float score_threshold, float mms_threshold, int top_k, int backend_id, int target_id);\nFaceDetectorYN FaceDetectorYN_Create_FromBytes(const char* framework, void* bufferModel, int model_size, void* bufferConfig, int config_size, Size size);\nFaceDetectorYN FaceDetectorYN_Create_FromBytes_WithParams(const char* framework, void* bufferModel, int model_size, void* bufferConfig, int config_size, Size size, float score_threshold, float mms_threshold, int top_k, int backend_id, int target_id);\nvoid FaceDetectorYN_Close(FaceDetectorYN fd); \nint FaceDetectorYN_Detect(FaceDetectorYN fd, Mat image, Mat faces);\nSize FaceDetectorYN_GetInputSize(FaceDetectorYN fd);\nfloat FaceDetectorYN_GetNMSThreshold(FaceDetectorYN fd);\nfloat FaceDetectorYN_GetScoreThreshold(FaceDetectorYN fd);\nint FaceDetectorYN_GetTopK(FaceDetectorYN fd);\nvoid FaceDetectorYN_SetInputSize(FaceDetectorYN fd, Size input_size);\nvoid FaceDetectorYN_SetNMSThreshold(FaceDetectorYN fd, float nms_threshold);\nvoid FaceDetectorYN_SetScoreThreshold(FaceDetectorYN fd, float score_threshold);\nvoid FaceDetectorYN_SetTopK(FaceDetectorYN fd, int top_k);\n\n// FaceRecognizerSF\nFaceRecognizerSF FaceRecognizerSF_Create(const char* model, const char* config);\nFaceRecognizerSF FaceRecognizerSF_Create_WithParams(const char* model, const char* config, int backend_id, int target_id);\nvoid FaceRecognizerSF_Close(FaceRecognizerSF fr);\nvoid FaceRecognizerSF_AlignCrop(FaceRecognizerSF fr, Mat src_img, Mat face_box, Mat aligned_img);\nvoid FaceRecognizerSF_Feature(FaceRecognizerSF fr, Mat aligned_img, Mat face_feature);\nfloat FaceRecognizerSF_Match(FaceRecognizerSF fr, Mat face_feature1, Mat face_feature2);\nfloat FaceRecognizerSF_Match_WithParams(FaceRecognizerSF fr, Mat face_feature1, Mat face_feature2, int dis_type);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_OBJDETECT_H_\n"
  },
  {
    "path": "objdetect_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_objdetect)\n\npackage gocv\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCascadeClassifier(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CascadeClassifier test\")\n\t}\n\tdefer img.Close()\n\n\t// load classifier to recognize faces\n\tclassifier := NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tclassifier.Load(\"data/haarcascade_frontalface_default.xml\")\n\n\trects := classifier.DetectMultiScale(img)\n\tif len(rects) != 1 {\n\t\tt.Error(\"Error in TestCascadeClassifier test\")\n\t}\n}\n\nfunc TestCascadeClassifierWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in CascadeClassifierWithParams test\")\n\t}\n\tdefer img.Close()\n\n\t// load classifier to recognize faces\n\tclassifier := NewCascadeClassifier()\n\tdefer classifier.Close()\n\n\tclassifier.Load(\"data/haarcascade_frontalface_default.xml\")\n\n\trects := classifier.DetectMultiScaleWithParams(img, 1.1, 3, 0, image.Pt(0, 0), image.Pt(0, 0))\n\tif len(rects) != 1 {\n\t\tt.Errorf(\"Error in CascadeClassifierWithParams test: %v\", len(rects))\n\t}\n}\n\nfunc TestHOGDescriptor(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in HOGDescriptor test\")\n\t}\n\tdefer img.Close()\n\n\t// load HOGDescriptor to recognize people\n\thog := NewHOGDescriptor()\n\tdefer hog.Close()\n\n\td := HOGDefaultPeopleDetector()\n\tdefer d.Close()\n\thog.SetSVMDetector(d)\n\n\trects := hog.DetectMultiScale(img)\n\tif len(rects) != 1 {\n\t\tt.Errorf(\"Error in TestHOGDescriptor test: %d\", len(rects))\n\t}\n}\n\nfunc TestHOGDescriptorWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in HOGDescriptorWithParams test\")\n\t}\n\tdefer img.Close()\n\n\t// load HOGDescriptor to recognize people\n\thog := NewHOGDescriptor()\n\tdefer hog.Close()\n\n\td := HOGDefaultPeopleDetector()\n\tdefer d.Close()\n\thog.SetSVMDetector(d)\n\n\trects := hog.DetectMultiScaleWithParams(img, 0, image.Pt(0, 0), image.Pt(0, 0),\n\t\t1.05, 2.0, false)\n\tif len(rects) != 1 {\n\t\tt.Errorf(\"Error in TestHOGDescriptorWithParams test: %d\", len(rects))\n\t}\n}\n\nfunc TestGroupRectangles(t *testing.T) {\n\trects := []image.Rectangle{\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 30, 30),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t\timage.Rect(10, 10, 35, 35),\n\t}\n\n\tresults := GroupRectangles(rects, 1, 0.2)\n\tif len(results) != 2 {\n\t\tt.Errorf(\"Error in TestGroupRectangles test: %d\", len(results))\n\t}\n}\n\nfunc TestQRCodeDetector(t *testing.T) {\n\timg := IMRead(\"images/qrcode.png\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in QRCodeDetector test\")\n\t}\n\tdefer img.Close()\n\n\t// load QRCodeDetector to QR codes\n\n\tdetector := NewQRCodeDetector()\n\tdefer detector.Close()\n\n\tbbox := NewMat()\n\tqr := NewMat()\n\tdefer bbox.Close()\n\tdefer qr.Close()\n\n\tres := detector.Detect(img, &bbox)\n\tif !res {\n\t\tt.Errorf(\"Error in TestQRCodeDetector test: res == false\")\n\t}\n\tres2 := detector.Decode(img, bbox, &qr)\n\n\tres3 := detector.DetectAndDecode(img, &bbox, &qr)\n\n\tif res2 != res3 {\n\t\tt.Errorf(\"Error in TestQRCodeDetector res2: %s != res3: %s\", res2, res3)\n\t}\n\n\t// multi\n\timg2 := IMRead(\"images/multi_qrcodes.png\", IMReadColor)\n\tdefer img2.Close()\n\tif img2.Empty() {\n\t\tt.Error(\"Invalid Mat in QRCodeDetector test\")\n\t}\n\n\tmultiBox := NewMat()\n\tdefer multiBox.Close()\n\tres4 := detector.DetectMulti(img2, &multiBox)\n\tif !res4 {\n\t\tt.Errorf(\"Error in TestQRCodeDetector Multi test: res == false\")\n\t}\n\n\tif multiBox.Rows() != 2 {\n\t\tt.Errorf(\"Error in TestQRCodeDetector Multi test: number of Rows = %d\", multiBox.Rows())\n\t}\n\n\tmultiBox2 := NewMat()\n\tdefer multiBox2.Close()\n\tdecoded := []string{}\n\tqrCodes := make([]Mat, 0)\n\tdefer func() {\n\t\tfor _, q := range qrCodes {\n\t\t\tq.Close()\n\t\t}\n\t}()\n\tsuccess := detector.DetectAndDecodeMulti(img2, decoded, &multiBox2, qrCodes)\n\tif !success {\n\t\tt.Errorf(\"Error in TestQRCodeDetector Multi test: returned false\")\n\t}\n\n\ttmpPoints := NewMat()\n\tdefer tmpPoints.Close()\n\ttmpQr := NewMat()\n\tdefer tmpQr.Close()\n\tvar tmpDecoded string\n\tfor i, s := range decoded {\n\t\ttmpInput := padQr(&(qrCodes[i]))\n\t\tdefer tmpInput.Close()\n\t\ttmpDecoded = detector.Decode(tmpInput, tmpPoints, &tmpQr)\n\t\tif tmpDecoded != s {\n\t\t\tt.Errorf(\"Error in TestQRCodeDetector Multi test: decoded straight QR code=%s, decoded[%d] = %s\", tmpDecoded, i, s)\n\t\t}\n\t}\n\n\temptyMat := NewMatWithSize(100, 200, MatTypeCV8UC3)\n\tsuccess = detector.DetectAndDecodeMulti(emptyMat, decoded, &multiBox2, qrCodes)\n\tif success {\n\t\tt.Errorf(\"Error in TestQRCodeDetector Multi test: empty Mat returned success=true\")\n\t}\n\temptyMat.Close()\n}\n\nfunc padQr(qr *Mat) Mat {\n\tl := 101\n\td := 10\n\tL := l + 2*d\n\n\tout := NewMatWithSizeFromScalar(NewScalar(255, 255, 255, 255), L, L, MatTypeCV8UC3)\n\tqrCodes0 := NewMat()\n\tdefer qrCodes0.Close()\n\tqr.ConvertTo(&qrCodes0, MatTypeCV8UC3)\n\n\tResize(qrCodes0, &qrCodes0, image.Point{L, L}, 0, 0, InterpolationArea)\n\tCopyMakeBorder(qrCodes0, &out, d, d, d, d, BorderConstant, color.RGBA{255, 255, 255, 255})\n\treturn out\n}\n\nfunc TestFaceDetectorYN(t *testing.T) {\n\n\timg := IMRead(\"images/face.jpg\", IMReadAnyColor)\n\tdefer img.Close()\n\n\ts := image.Pt(img.Size()[1], img.Size()[0])\n\n\tfaces := NewMat()\n\tdefer faces.Close()\n\n\tfd := NewFaceDetectorYN(\"testdata/face_detection_yunet_2023mar.onnx\", \"\", s)\n\tdefer fd.Close()\n\n\tsz := fd.GetInputSize()\n\tif sz.X != 640 && sz.Y != 480 {\n\t\tt.Error(\"error on FaceDetectorYN.GetInputSize()\")\n\t}\n\tfd.SetInputSize(sz)\n\n\tt1 := fd.GetNMSThreshold()\n\tfd.SetNMSThreshold(t1)\n\n\tt2 := fd.GetScoreThreshold()\n\tfd.SetScoreThreshold(t2)\n\n\ttopK := fd.GetTopK()\n\tfd.SetTopK(topK)\n\n\tfd.Detect(img, &faces)\n\n\tfacesCount := faces.Rows()\n\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n}\n\nfunc TestFaceDetectorYNWithParams(t *testing.T) {\n\n\timg := IMRead(\"images/face.jpg\", IMReadAnyColor)\n\tdefer img.Close()\n\n\ts := image.Pt(img.Size()[1], img.Size()[0])\n\n\tfaces := NewMat()\n\tdefer faces.Close()\n\n\tfd := NewFaceDetectorYNWithParams(\"testdata/face_detection_yunet_2023mar.onnx\", \"\", s, 0.9, 0.3, 5000, 0, 0)\n\tdefer fd.Close()\n\n\tsz := fd.GetInputSize()\n\tif sz.X != 640 && sz.Y != 480 {\n\t\tt.Error(\"error on FaceDetectorYN.GetInputSize()\")\n\t}\n\tfd.SetInputSize(sz)\n\n\tt1 := fd.GetNMSThreshold()\n\tfd.SetNMSThreshold(t1)\n\n\tt2 := fd.GetScoreThreshold()\n\tfd.SetScoreThreshold(t2)\n\n\ttopK := fd.GetTopK()\n\tfd.SetTopK(topK)\n\n\tfd.Detect(img, &faces)\n\n\tfacesCount := faces.Rows()\n\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n\n}\n\nfunc TestFaceDetectorYNFromBytes(t *testing.T) {\n\n\tmodelBuffer, err := os.ReadFile(\"testdata/face_detection_yunet_2023mar.onnx\")\n\tif err != nil {\n\t\tt.Errorf(\"%s reading testdata/face_detection_yunet_2023mar.onnx\", err.Error())\n\t}\n\n\timg := IMRead(\"images/face.jpg\", IMReadAnyColor)\n\tdefer img.Close()\n\n\ts := image.Pt(img.Size()[1], img.Size()[0])\n\n\tfaces := NewMat()\n\tdefer faces.Close()\n\n\tfd := NewFaceDetectorYNFromBytes(\"onnx\", modelBuffer, []byte(\"\"), s)\n\tdefer fd.Close()\n\n\tsz := fd.GetInputSize()\n\tif sz.X != 640 && sz.Y != 480 {\n\t\tt.Error(\"error on FaceDetectorYN.GetInputSize()\")\n\t}\n\tfd.SetInputSize(sz)\n\n\tt1 := fd.GetNMSThreshold()\n\tfd.SetNMSThreshold(t1)\n\n\tt2 := fd.GetScoreThreshold()\n\tfd.SetScoreThreshold(t2)\n\n\ttopK := fd.GetTopK()\n\tfd.SetTopK(topK)\n\n\tfd.Detect(img, &faces)\n\n\tfacesCount := faces.Rows()\n\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n}\n\nfunc TestFaceDetectorYNFromBytesWithParams(t *testing.T) {\n\n\tmodelBuffer, err := os.ReadFile(\"testdata/face_detection_yunet_2023mar.onnx\")\n\tif err != nil {\n\t\tt.Errorf(\"%s reading testdata/face_detection_yunet_2023mar.onnx\", err.Error())\n\t}\n\n\timg := IMRead(\"images/face.jpg\", IMReadAnyColor)\n\tdefer img.Close()\n\n\ts := image.Pt(img.Size()[1], img.Size()[0])\n\n\tfaces := NewMat()\n\tdefer faces.Close()\n\n\tfd := NewFaceDetectorYNFromBytesWithParams(\"onnx\", modelBuffer, []byte(\"\"), s, 0.9, 0.3, 5000, 0, 0)\n\tdefer fd.Close()\n\n\tsz := fd.GetInputSize()\n\tif sz.X != 640 && sz.Y != 480 {\n\t\tt.Error(\"error on FaceDetectorYN.GetInputSize()\")\n\t}\n\tfd.SetInputSize(sz)\n\n\tt1 := fd.GetNMSThreshold()\n\tfd.SetNMSThreshold(t1)\n\n\tt2 := fd.GetScoreThreshold()\n\tfd.SetScoreThreshold(t2)\n\n\ttopK := fd.GetTopK()\n\tfd.SetTopK(topK)\n\n\tfd.Detect(img, &faces)\n\n\tfacesCount := faces.Rows()\n\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n}\n\nfunc TestFaceRecognizerSF(t *testing.T) {\n\n\trons := IMRead(\"images/face.jpg\", IMReadUnchanged)\n\tdefer rons.Close()\n\n\tronsImgSz := rons.Size()\n\n\ts := image.Pt(ronsImgSz[1], ronsImgSz[0])\n\n\tfd := NewFaceDetectorYN(\"testdata/face_detection_yunet_2023mar.onnx\", \"\", s)\n\tdefer fd.Close()\n\n\tronsFaces := NewMat()\n\tdefer ronsFaces.Close()\n\n\tdetectRv := fd.Detect(rons, &ronsFaces)\n\tt.Log(\"detect rv is\", detectRv)\n\n\tfacesCount := ronsFaces.Rows()\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n\n\tronsFaceX0 := ronsFaces.GetFloatAt(0, 0)\n\tronsFaceY0 := ronsFaces.GetFloatAt(0, 1)\n\tronsFaceX1 := ronsFaces.GetFloatAt(0, 0) + ronsFaces.GetFloatAt(0, 2)\n\tronsFaceY1 := ronsFaces.GetFloatAt(0, 1) + ronsFaces.GetFloatAt(0, 3)\n\n\tronsFace := rons.Region(image.Rect(int(ronsFaceX0), int(ronsFaceY0), int(ronsFaceX1), int(ronsFaceY1)))\n\tdefer ronsFace.Close()\n\n\tfr := NewFaceRecognizerSF(\"testdata/face_recognition_sface_2021dec.onnx\", \"\")\n\tdefer fr.Close()\n\n\tronsAligned := NewMat()\n\tdefer ronsAligned.Close()\n\n\tfr.AlignCrop(rons, ronsFace, &ronsAligned)\n\n\tif ronsAligned.Empty() {\n\t\tt.Error(\"aligned is empty\")\n\t}\n\n\tronsFaceFeature := NewMat()\n\tdefer ronsFaceFeature.Close()\n\n\tfr.Feature(ronsAligned, &ronsFaceFeature)\n\n\tmatch := fr.Match(ronsFaceFeature, ronsFaceFeature)\n\tt.Log(\"face feature match: \", match)\n\n}\n\nfunc TestFaceRecognizerSFWithParams(t *testing.T) {\n\n\trons := IMRead(\"images/face.jpg\", IMReadUnchanged)\n\tdefer rons.Close()\n\n\tronsImgSz := rons.Size()\n\n\ts := image.Pt(ronsImgSz[1], ronsImgSz[0])\n\n\tfd := NewFaceDetectorYN(\"testdata/face_detection_yunet_2023mar.onnx\", \"\", s)\n\tdefer fd.Close()\n\n\tronsFaces := NewMat()\n\tdefer ronsFaces.Close()\n\n\tdetectRv := fd.Detect(rons, &ronsFaces)\n\tt.Log(\"detect rv is\", detectRv)\n\n\tfacesCount := ronsFaces.Rows()\n\tif facesCount < 1 {\n\t\tt.Error(\"no face detected\")\n\t}\n\n\tronsFaceX0 := ronsFaces.GetFloatAt(0, 0)\n\tronsFaceY0 := ronsFaces.GetFloatAt(0, 1)\n\tronsFaceX1 := ronsFaces.GetFloatAt(0, 0) + ronsFaces.GetFloatAt(0, 2)\n\tronsFaceY1 := ronsFaces.GetFloatAt(0, 1) + ronsFaces.GetFloatAt(0, 3)\n\n\tronsFace := rons.Region(image.Rect(int(ronsFaceX0), int(ronsFaceY0), int(ronsFaceX1), int(ronsFaceY1)))\n\tdefer ronsFace.Close()\n\n\tfr := NewFaceRecognizerSFWithParams(\"testdata/face_recognition_sface_2021dec.onnx\", \"\", 0, 0)\n\tdefer fr.Close()\n\n\tronsAligned := NewMat()\n\tdefer ronsAligned.Close()\n\n\tfr.AlignCrop(rons, ronsFace, &ronsAligned)\n\n\tif ronsAligned.Empty() {\n\t\tt.Error(\"aligned is empty\")\n\t}\n\n\tronsFaceFeature := NewMat()\n\tdefer ronsFaceFeature.Close()\n\n\tfr.Feature(ronsAligned, &ronsFaceFeature)\n\n\tmatch := fr.MatchWithParams(ronsFaceFeature, ronsFaceFeature, FaceRecognizerSFDisTypeCosine)\n\tt.Log(\"face feature match: \", match)\n\n}\n"
  },
  {
    "path": "openvino/README.md",
    "content": "# Using the Intel® Distribution of OpenVINO™ toolkit\n\nThe [Intel® Distribution of OpenVINO™ toolkit](https://software.intel.com/en-us/openvino-toolkit) is a set of tools and libraries for computer vision applications, that uses computer vision and imaging algorithms developed at Intel. It also includes a complete build of OpenCV 4.5.5. Users must build opencv from source with openvino support to use a newer opencv version (eg. 4.6.0).\n\nGoCV supports using the Intel GPU or Intel OpenVINO Inference Engine as a backend for the OpenCV deep neural network (DNN) module. For details, please see:\nhttps://github.com/hybridgroup/gocv/blob/release/openvino/ie/README.md\n\n## Installing Intel OpenVINO toolkit\n\nThe most recent version of the Intel OpenVINO toolkit is currently 2022.1 LTS. You can obtain it from here:\n\nhttps://software.intel.com/en-us/openvino-toolkit\n\nOne you have downloaded the compressed file, unzip the contents, and then run the `install.sh` program within the extracted directory.\n\n## How to build/run code\n\nSetup the environment for the Intel OpenVINO toolkit, by running the `setupvars.sh` program included with OpenVINO:\n\n```\nsource /opt/intel/openvino_2022/setupvars.sh\n```\n\nThen set the needed other exports for building/running GoCV code by running the `env.sh` that is in the GoCV `openvino` directory:\n\n```\nsource openvino/env.sh\n```\n\nYou only need to do these two steps one time per session. Once you have run them, you do not need to run them again until you close your terminal window.\n\nNow you can run the version command example to make sure you are compiling/linking against Intel OpenVINO:\n\n```\n$ go run -tags customenv  ./cmd/version/main.go\ngocv version: 0.31.0\nopencv lib version: 4.5.5-openvino\n```\n\nNote the use of `-tags customenv` is needed when using `go run`, `go build`, and `go test` with OpenVINO, so the CGo compiler can pickup the correct settings for the environment, and ignore the usual defaults.\n\nExamples that use the Intel OpenVINO toolkit can be found in the `cmd/openvino` directory of this repository.\n"
  },
  {
    "path": "openvino/env.sh",
    "content": "export CGO_CXXFLAGS=\"--std=c++11\"\nexport CGO_CPPFLAGS=\"-I${INTEL_OPENVINO_DIR}/extras/opencv/include -I${INTEL_OPENVINO_DIR}/runtime/include -I${INTEL_OPENVINO_DIR}/runtime/include/ie\"\nexport CGO_LDFLAGS=\"-L${INTEL_OPENVINO_DIR}/extras/opencv/lib -L${INTEL_OPENVINO_DIR}/runtime/lib/intel64 -lpthread -ldl -lopenvino -lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_features2d -lopencv_video -lopencv_dnn -lopencv_calib3d -lopencv_photo\"\nexport PKG_CONFIG_PATH=/usr/lib64/pkgconfig\n"
  },
  {
    "path": "openvino/ie/README.md",
    "content": "# Using the Intel OpenVINO Inference Engine\n\nThe Intel OpenVINO Inference Engine is a set of libraries for executing convolutional neural networks.\n\nGoCV support for the Intel OpenVINO Inference Engine will be able to be found here in the \"gocv.io/x/gocv/openvino/ie\" package.\n\n## How It Works\n\nSupport in GoCV for the Intel OpenVINO Inference Engine requires version 2019 R3+ in order to work.\n\n## How to use\n\nThis code loads a Caffe model, and then uses OpenVINO inference engine to prepare it for execution on the GPU:\n\n```go\nnet := gocv.ReadNet(\"/path/to/your/model.caffemodel\", \"/path/to/your/config.proto\")\nif net.Empty() {\n    fmt.Println(\"Error reading network model\")\n    return\n}\n// GPU usage\nnet.SetPreferableBackend(gocv.NetBackendType(gocv.NetBackendOpenVINO))\nnet.SetPreferableTarget(gocv.NetTargetType(gocv.NetTargetFP16))\n\n// Intel Neural Compute Stick 2 usage\nnet.SetPreferableBackend(gocv.NetBackendType(gocv.NetBackendOpenVINO))\nnet.SetPreferableTarget(gocv.NetTargetType(gocv.NetTargetVPU))\n```\n"
  },
  {
    "path": "openvino/ie/ie.go",
    "content": "// Package ie is the GoCV wrapper around the Intel OpenVINO toolkit's\n// Inference Engine.\n//\n// For further details, please see:\n// https://software.intel.com/en-us/openvino-toolkit\npackage ie // import \"gocv.io/x/gocv/openvino/ie\"\n"
  },
  {
    "path": "openvino/ie/inference_engine.cpp",
    "content": "#include \"inference_engine.h\"\n\nconst char* OpenVinoVersion() {\n    std::ostringstream buf;\n    buf << std::to_string(InferenceEngine::GetInferenceEngineVersion()->apiVersion.major) \n        << \".\" \n        << std::to_string(InferenceEngine::GetInferenceEngineVersion()->apiVersion.minor)\n        << \".\" \n        << InferenceEngine::GetInferenceEngineVersion()->buildNumber;\n    auto version = buf.str();\n\n    size_t resLen = version.size() + 1;\n    auto res = (char*)malloc(resLen);\n\n    memset(res ,0, resLen);\n    memcpy(res, version.c_str(), resLen);\n    return res;\n}\n"
  },
  {
    "path": "openvino/ie/inference_engine.go",
    "content": "package ie\n\n/*\n#include <stdlib.h>\n#include \"inference_engine.h\"\n*/\nimport (\n\t\"C\"\n)\nimport \"unsafe\"\n\n// Version returns the current Inference Engine library version\nfunc Version() string {\n\tv := C.OpenVinoVersion()\n\tdefer C.free(unsafe.Pointer(v))\n\treturn C.GoString(v)\n}\n"
  },
  {
    "path": "openvino/ie/inference_engine.h",
    "content": "#ifndef _GOCVOPENVINO_IE_H_\n#define _GOCVOPENVINO_IE_H_\n\n#ifdef __cplusplus\n#include <inference_engine.hpp>\nextern \"C\" {\n#endif\n\n#ifdef __cplusplus\n#else\n#endif\n\nconst char* OpenVinoVersion();\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_GOCVOPENVINO_IE_H_\n"
  },
  {
    "path": "openvino/ie/inference_engine_test.go",
    "content": "package ie\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestInferenceEngineVersion(t *testing.T) {\n\tv := Version()\n\texpected := \"2022.1\"\n\tif v == \"\" || len(v) < len(expected) {\n\t\tt.Error(\"Invalid IE Version\")\n\t\treturn\n\t}\n\n\t// Different platforms can have different strings, only warn if expected\n\t// version string does not match.\n\t// eg. archlinux: 2.1.custom_makepkg_cdb9bec7210f8c24fde3e416c7ada820faaaa23e\n\tif !strings.Contains(v, expected) {\n\t\tt.Log(\"Unexpected IE Version: \", v)\n\t}\n}\n"
  },
  {
    "path": "openvino/openvino.go",
    "content": "// Package openvino is the GoCV wrapper around the Intel OpenVINO toolkit.\n//\n// For further details, please see:\n// https://software.intel.com/en-us/openvino-toolkit\npackage openvino // import \"gocv.io/x/gocv/openvino\"\n"
  },
  {
    "path": "patches/gstreamer-full.patch",
    "content": "From a784b9d05fddd0078b41a18377f4ced380fd53f0 Mon Sep 17 00:00:00 2001\nFrom: deadprogram <ron@hybridgroup.com>\nDate: Mon, 21 Oct 2024 10:08:11 +0200\nSubject: [PATCH] gstreamer: modify cmake file to handle staticly linked\n gstreamer lib\n\nSigned-off-by: deadprogram <ron@hybridgroup.com>\n---\n modules/videoio/cmake/detect_gstreamer.cmake | 233 ++++++++++++++++++-\n 1 file changed, 232 insertions(+), 1 deletion(-)\n\ndiff --git a/modules/videoio/cmake/detect_gstreamer.cmake b/modules/videoio/cmake/detect_gstreamer.cmake\nindex b2ab06060d..ae148a3a1d 100644\n--- a/modules/videoio/cmake/detect_gstreamer.cmake\n+++ b/modules/videoio/cmake/detect_gstreamer.cmake\n@@ -100,7 +100,238 @@ if(NOT HAVE_GSTREAMER AND PKG_CONFIG_FOUND)\n   ocv_check_modules(GSTREAMER_pbutils gstreamer-pbutils-1.0)\n   ocv_check_modules(GSTREAMER_video gstreamer-video-1.0)\n   ocv_check_modules(GSTREAMER_audio gstreamer-audio-1.0)\n-  if(GSTREAMER_base_FOUND AND GSTREAMER_app_FOUND AND GSTREAMER_riff_FOUND AND GSTREAMER_pbutils_FOUND AND GSTREAMER_video_FOUND AND GSTREAMER_audio_FOUND)\n+\n+  set(gst_paths \"${GSTREAMER_STATIC_LIB}\" ENV GSTREAMER_STATIC_LIB)\n+  find_library(GSTREAMER_full_LIBRARY\n+    NAMES gstreamer-full-1.0\n+    PATHS ${gst_paths}/..)\n+  if(GSTREAMER_base_FOUND AND GSTREAMER_full_LIBRARY)\n+    find_library(GSTREAMER_gstcoreelements_LIBRARY\n+      NAMES gstcoreelements\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstapp1_LIBRARY\n+      NAMES gstapp\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstplayback_LIBRARY\n+      NAMES gstplayback\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstrawparse_LIBRARY\n+      NAMES gstrawparse\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gsttcp_LIBRARY\n+      NAMES gsttcp\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstvideoconvertscale_LIBRARY\n+      NAMES gstvideoconvertscale\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstvideotestsrc_LIBRARY\n+      NAMES gstvideotestsrc\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstaudioparsers_LIBRARY\n+      NAMES gstaudioparsers\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstisomp4_LIBRARY\n+      NAMES gstisomp4\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstrtp_LIBRARY\n+      NAMES gstrtp\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstrtpmanager_LIBRARY\n+      NAMES gstrtpmanager\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstrtsp_LIBRARY\n+      NAMES gstrtsp\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstudp_LIBRARY\n+      NAMES gstudp\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstcodectimestamper_LIBRARY\n+      NAMES gstcodectimestamper\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstvideoparsersbad_LIBRARY\n+      NAMES gstvideoparsersbad\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstopenh264_LIBRARY\n+      NAMES gstopenh264\n+      PATHS ${gst_paths})\n+    find_library(GSTREAMER_gstadaptivedemux_LIBRARY\n+      NAMES gstadaptivedemux-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstallocators_LIBRARY\n+      NAMES gstallocators-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstanalytics_LIBRARY\n+      NAMES gstanalytics-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstapp_LIBRARY\n+      NAMES gstapp-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstaudio_LIBRARY\n+      NAMES gstaudio-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstbadaudio_LIBRARY\n+      NAMES gstbadaudio-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstbase_LIBRARY\n+      NAMES gstbase-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstbasecamerabinsrc_LIBRARY\n+      NAMES gstbasecamerabinsrc-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstcodecparsers_LIBRARY\n+      NAMES gstcodecparsers-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstcodecs_LIBRARY\n+      NAMES gstcodecs-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstcontroller_LIBRARY\n+      NAMES gstcontroller-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstcuda_LIBRARY\n+      NAMES gstcuda-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstfft_LIBRARY\n+      NAMES gstfft-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstinsertbin_LIBRARY\n+      NAMES gstinsertbin-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstisoff_LIBRARY\n+      NAMES gstisoff-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstmpegts_LIBRARY\n+      NAMES gstmpegts-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstmse_LIBRARY\n+      NAMES gstmse-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstnet_LIBRARY\n+      NAMES gstnet-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstpbutils_LIBRARY\n+      NAMES gstpbutils-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstphotography_LIBRARY\n+      NAMES gstphotography-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstplay_LIBRARY\n+      NAMES gstplay-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstplayer_LIBRARY\n+      NAMES gstplayer-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstreamer_LIBRARY\n+      NAMES gstreamer-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstriff_LIBRARY\n+      NAMES gstriff-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstrtp1_LIBRARY\n+      NAMES gstrtp-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstrtsp1_LIBRARY\n+      NAMES gstrtsp-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstsctp_LIBRARY\n+      NAMES gstsctp-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstsdp_LIBRARY\n+      NAMES gstsdp-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gsttag_LIBRARY\n+      NAMES gsttag-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gsttranscoder_LIBRARY\n+      NAMES gsttranscoder-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gsturidownloader_LIBRARY\n+      NAMES gsturidownloader-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstvideo_LIBRARY\n+      NAMES gstvideo-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gstwebrtc_LIBRARY\n+      NAMES gstwebrtc-1.0\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_openh264_LIBRARY\n+      NAMES openh264\n+      PATHS ${gst_paths}/..)\n+    find_library(GSTREAMER_gio_LIBRARY\n+      NAMES gio-2.0)\n+    find_library(GSTREAMER_gobject_LIBRARY\n+      NAMES gobject-2.0)\n+    find_library(GSTREAMER_intl_LIBRARY\n+      NAMES intl)\n+\n+    set(HAVE_GSTREAMER TRUE)\n+    set(GSTREAMER_LIBRARIES ${GSTREAMER_full_LIBRARY}\n+      ${GSTREAMER_gstcoreelements_LIBRARY}\n+      ${GSTREAMER_gstapp1_LIBRARY}\n+      ${GSTREAMER_gstplayback_LIBRARY}\n+      ${GSTREAMER_gstrawparse_LIBRARY}\n+      ${GSTREAMER_gsttcp_LIBRARY}\n+      ${GSTREAMER_gstvideoconvertscale_LIBRARY}\n+      ${GSTREAMER_gstvideotestsrc_LIBRARY}\n+      ${GSTREAMER_gstaudioparsers_LIBRARY}\n+      ${GSTREAMER_gstisomp4_LIBRARY}\n+      ${GSTREAMER_gstrtp_LIBRARY}\n+      ${GSTREAMER_gstrtpmanager_LIBRARY}\n+      ${GSTREAMER_gstrtsp_LIBRARY}\n+      ${GSTREAMER_gstudp_LIBRARY}\n+      ${GSTREAMER_gstcodectimestamper_LIBRARY}\n+      ${GSTREAMER_gstvideoparsersbad_LIBRARY}\n+      ${GSTREAMER_gstopenh264_LIBRARY}\n+      ${GSTREAMER_gstadaptivedemux_LIBRARY}\n+      ${GSTREAMER_gstallocators_LIBRARY}\n+      ${GSTREAMER_gstanalytics_LIBRARY}\n+      ${GSTREAMER_gstapp_LIBRARY}\n+      ${GSTREAMER_gstaudio_LIBRARY}\n+      ${GSTREAMER_gstbadaudio_LIBRARY}\n+      ${GSTREAMER_gstbase_LIBRARY}\n+      ${GSTREAMER_gstbasecamerabinsrc_LIBRARY}\n+      ${GSTREAMER_gstcodecparsers_LIBRARY}\n+      ${GSTREAMER_gstcodecs_LIBRARY}\n+      ${GSTREAMER_gstcontroller_LIBRARY}\n+      ${GSTREAMER_gstcuda_LIBRARY}\n+      ${GSTREAMER_gstfft_LIBRARY}\n+      ${GSTREAMER_gstinsertbin_LIBRARY}\n+      ${GSTREAMER_gstisoff_LIBRARY}\n+      ${GSTREAMER_gstmpegts_LIBRARY}\n+      ${GSTREAMER_gstmse_LIBRARY}\n+      ${GSTREAMER_gstnet_LIBRARY}\n+      ${GSTREAMER_gstpbutils_LIBRARY}\n+      ${GSTREAMER_gstphotography_LIBRARY}\n+      ${GSTREAMER_gstplay_LIBRARY}\n+      ${GSTREAMER_gstplayer_LIBRARY}\n+      ${GSTREAMER_gstreamer_LIBRARY}\n+      ${GSTREAMER_gstriff_LIBRARY}\n+      ${GSTREAMER_gstrtp1_LIBRARY}\n+      ${GSTREAMER_gstrtsp1_LIBRARY}\n+      ${GSTREAMER_gstsctp_LIBRARY}\n+      ${GSTREAMER_gstsdp_LIBRARY}\n+      ${GSTREAMER_gsttag_LIBRARY}\n+      ${GSTREAMER_gsttranscoder_LIBRARY}\n+      ${GSTREAMER_gsturidownloader_LIBRARY}\n+      ${GSTREAMER_gstvideo_LIBRARY}\n+      ${GSTREAMER_gstwebrtc_LIBRARY}\n+      ${GSTREAMER_openh264_LIBRARY}\n+      ${GSTREAMER_gio_LIBRARY}\n+      ${GSTREAMER_gobject_LIBRARY}\n+      ${GSTREAMER_intl_LIBRARY}\n+      ${GSTREAMER_base_LIBRARIES}\n+      ${GSTREAMER_app_LIBRARIES}\n+      ${GSTREAMER_riff_LIBRARIES}\n+      ${GSTREAMER_pbutils_LIBRARIES}\n+      ${GSTREAMER_video_LIBRARIES}\n+      ${GSTREAMER_audio_LIBRARIES})\n+    set(GSTREAMER_INCLUDE_DIRS \n+      ${GSTREAMER_base_INCLUDE_DIRS}\n+      ${GSTREAMER_app_INCLUDE_DIRS}\n+      ${GSTREAMER_riff_INCLUDE_DIRS}\n+      ${GSTREAMER_pbutils_INCLUDE_DIRS}\n+      ${GSTREAMER_video_INCLUDE_DIRS}\n+      ${GSTREAMER_audio_INCLUDE_DIRS})\n+  else(GSTREAMER_base_FOUND AND GSTREAMER_app_FOUND AND GSTREAMER_riff_FOUND AND GSTREAMER_pbutils_FOUND AND GSTREAMER_video_FOUND AND GSTREAMER_audio_FOUND)\n     set(HAVE_GSTREAMER TRUE)\n     set(GSTREAMER_VERSION ${GSTREAMER_base_VERSION})  # informational\n     set(GSTREAMER_LIBRARIES ${GSTREAMER_base_LIBRARIES} ${GSTREAMER_app_LIBRARIES} ${GSTREAMER_riff_LIBRARIES} ${GSTREAMER_pbutils_LIBRARIES} ${GSTREAMER_video_LIBRARIES} ${GSTREAMER_audio_LIBRARIES})\n-- \n2.34.1\n\n"
  },
  {
    "path": "persistence.h",
    "content": "#ifndef _OPENCV3_PERSISTENCE_H_\n#define _OPENCV3_PERSISTENCE_H_\n\n#include <stdbool.h>\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::FileStorage* FileStorage;\ntypedef cv::FileNode* FileNode;\n#else\ntypedef void* FileStorage;\ntypedef void* FileNode;\n#endif\n\n// FileStorage\nFileStorage FileStorage_Create(void);\nFileStorage FileStorage_CreateWithParams(const char* filename, int flags, const char* encoding);\nvoid FileStorage_Close(FileStorage fs);\n\nconst char *FileStorage_ElName(FileStorage fs);\nint FileStorage_State(FileStorage fs);\n\nvoid FileStorage_EndWriteStruct(FileStorage fs);\nint FileStorage_GetFormat(FileStorage fs);\nbool FileStorage_IsOpened(FileStorage fs);\nbool FileStorage_Open(FileStorage fs, const char* filename, int flags, const char* encoding);\nvoid FileStorage_Release(FileStorage fs);\nconst char* FileStorage_ReleaseAndGetString(FileStorage fs);\nvoid FileStorage_StartWriteStruct(FileStorage fs, const char* name, int flags, const char* typeName);\nvoid FileStorage_WriteMat(FileStorage fs, const char* name, Mat val);\nvoid FileStorage_WriteString(FileStorage fs, const char* name, const char* val);\nvoid FileStorage_WriteStringArray(FileStorage fs, const char* name, const char** val, size_t len);\nvoid FileStorage_WriteDouble(FileStorage fs, const char* name, double val);\nvoid FileStorage_WriteInt(FileStorage fs, const char* name, int val);\nvoid FileStorage_WriteComment(FileStorage fs, const char* comment, bool append);\nvoid FileStorage_WriteRaw(FileStorage fs, const char* fmt, const void* vec, size_t len);\n\nFileNode FileStorage_GetFirstTopLevelNode(FileStorage fs);\nFileNode FileStorage_GetNode(FileStorage fs, const char* nodename);\nFileNode FileStorage_Root(FileStorage fs, int streamidx);\n\nbool FileNode_Empty(FileNode fn);\nbool FileNode_IsInt(FileNode fn);\nbool FileNode_IsMap(FileNode fn);\nbool FileNode_IsNamed(FileNode fn);\nbool FileNode_IsNone(FileNode fn);\nbool FileNode_IsReal(FileNode fn);\nbool FileNode_IsSeq(FileNode fn);\nbool FileNode_IsString(FileNode fn);\nchar** FileNode_Keys(FileNode fn);\nsize_t FileNode_KeysCount(FileNode fn);\nvoid FileNode_KeysFree(char** keys, size_t len);\nMat FileNode_Mat(FileNode fn);\nconst char* FileNode_Name(FileNode fn);\nfloat FileNode_Float(FileNode fn);\nconst char* FileNode_String(FileNode fn);\nFileNode FileNode_Get(FileNode fn, int i); //FileNode operator[] (int i) const\nFileNode FileNode_GetByName(FileNode fn, const char* nodename); //FileNode operator[] (const char *nodename) const\nsize_t FileNode_RawSize(FileNode fn);\nvoid FileNode_ReadRaw(FileNode fn, const char* fmt, void *vec, size_t len);\nvoid FileNode_SetValue(FileNode fn, int type, const void *value, int len);\nsize_t FileNode_Size(FileNode fn);\nint FileNode_Type(FileNode fn);\n\nvoid FileNode_Close(FileNode fn);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_PERSISTENCE_H_\n"
  },
  {
    "path": "persistence_filenode.cpp",
    "content": "#include <string.h>\n#include \"persistence.h\"\n\nbool FileNode_Empty(FileNode fn) {\n    return fn->empty();\n}\n\nbool FileNode_IsInt(FileNode fn){\n    return fn->isInt();\n}\n\nbool FileNode_IsMap(FileNode fn){\n    return fn->isMap();\n}\n\nbool FileNode_IsNamed(FileNode fn) {\n    return fn->isNamed();\n}\n\nbool FileNode_IsNone(FileNode fn){\n    return fn->isNone();\n}\n\nbool FileNode_IsReal(FileNode fn){\n    return fn->isReal();\n}\n\nbool FileNode_IsSeq(FileNode fn) {\n    return fn->isSeq();\n}\n\nbool FileNode_IsString(FileNode fn) {\n    return fn->isString();\n}\n\nchar** FileNode_Keys(FileNode fn) {\n\n    std::vector<cv::String> keys = fn->keys();\n\n    char** c_keys = new char*[keys.size()];\n\n    for (int i = 0; i < keys.size(); i++) {\n        char *c_key = new char[keys[i].length()+1];\n        strcpy(c_key, keys[i].c_str());\n        c_keys[i] = c_key;\n    }\n\n    return c_keys;\n}\n\nsize_t FileNode_KeysCount(FileNode fn) {\n    return fn->keys().size();\n}\n\n\nvoid FileNode_KeysFree(char** keys, size_t len) {\n    for(int i = 0; i < len; i++) {\n        delete keys[i];\n    }\n    delete keys;\n}\n\nMat FileNode_Mat(FileNode fn) {\n    return new cv::Mat(fn->mat());\n}\n\nconst char* FileNode_Name(FileNode fn) {\n    char* str = new char[fn->name().length()+1];\n    strcpy(str, fn->name().c_str()); \n    return str;\n}\n\nfloat FileNode_Float(FileNode fn) {\n    return (float)fn->real();\n}\n\nconst char* FileNode_String(FileNode fn) {\n    char* str = new char[fn->string().length()+1];\n    strcpy(str, fn->string().c_str());\n    return str;\n}\n\nFileNode FileNode_Get(FileNode fn, int i) {\n    return new cv::FileNode((*fn)[i]);\n}\n\nFileNode FileNode_GetByName(FileNode fn, const char* nodename) {\n    return new cv::FileNode((*fn)[nodename]);\n}\n\nsize_t FileNode_RawSize(FileNode fn) {\n    return fn->rawSize();\n}\n\nvoid FileNode_ReadRaw(FileNode fn, const char* fmt, void *vec, size_t len) {\n    fn->readRaw(fmt, vec, len);\n}\n \nvoid FileNode_SetValue(FileNode fn, int type, const void *value, int len) {\n    fn->setValue(type, value, len);\n}\n\nsize_t FileNode_Size(FileNode fn) {\n    return fn->size();\n}\n\nint FileNode_Type(FileNode fn) {\n    return fn->type();\n}\n\nvoid FileNode_Close(FileNode fn){\n    delete fn;\n}\n"
  },
  {
    "path": "persistence_filenode.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include \"persistence.h\"\n*/\nimport \"C\"\nimport \"unsafe\"\n\ntype FileNodeType int\n\nconst (\n\tFileNodeTypeNone     FileNodeType = 0\n\tFileNodeTypeInt      FileNodeType = 1\n\tFileNodeTypeReal     FileNodeType = 2\n\tFileNodeTypeFloat    FileNodeType = FileNodeTypeReal\n\tFileNodeTypeStr      FileNodeType = 3\n\tFileNodeTypeString   FileNodeType = FileNodeTypeStr\n\tFileNodeTypeSeq      FileNodeType = 4\n\tFileNodeTypeMap      FileNodeType = 5\n\tFileNodeTypeTypeMask FileNodeType = 7\n\tFileNodeTypeFlow     FileNodeType = 8\n\tFileNodeTypeUniform  FileNodeType = 8\n\tFileNodeTypeEmpty    FileNodeType = 16\n\tFileNodeTypeNamed    FileNodeType = 32\n)\n\n// FileNode is a wrapper for the OpenCV FileNode class\n//\n// Ref: https://docs.opencv.org/4.x/de/dd9/classcv_1_1FileNode.html\ntype FileNode struct {\n\tp C.FileNode\n}\n\nfunc (fn *FileNode) Ptr() C.FileNode {\n\treturn fn.p\n}\n\nfunc (fn *FileNode) Empty() bool {\n\treturn bool(C.FileNode_Empty(fn.p))\n}\n\nfunc (fn *FileNode) IsInt() bool {\n\treturn bool(C.FileNode_IsInt(fn.p))\n}\n\nfunc (fn *FileNode) IsMap() bool {\n\treturn bool(C.FileNode_IsMap(fn.p))\n}\n\nfunc (fn *FileNode) IsNamed() bool {\n\treturn bool(C.FileNode_IsNamed(fn.p))\n}\n\nfunc (fn *FileNode) IsNone() bool {\n\treturn bool(C.FileNode_IsNone(fn.p))\n}\n\nfunc (fn *FileNode) IsReal() bool {\n\treturn bool(C.FileNode_IsReal(fn.p))\n}\n\nfunc (fn *FileNode) IsSeq() bool {\n\treturn bool(C.FileNode_IsSeq(fn.p))\n}\n\nfunc (fn *FileNode) IsString() bool {\n\treturn bool(C.FileNode_IsString(fn.p))\n}\n\nfunc (fn *FileNode) Keys() []string {\n\n\tc_keys_count := C.FileNode_KeysCount(fn.p)\n\tc_keys := C.FileNode_Keys(fn.p)\n\tdefer C.FileNode_KeysFree(c_keys, c_keys_count)\n\n\tkeys := make([]string, int(c_keys_count))\n\tc_keys_slice := unsafe.Slice(c_keys, c_keys_count)\n\n\tfor i := 0; i < int(c_keys_count); i++ {\n\t\tkeys[i] = C.GoString(c_keys_slice[i])\n\t}\n\treturn keys\n}\n\nfunc (fn *FileNode) Close() {\n\tC.FileNode_Close(fn.p)\n}\n"
  },
  {
    "path": "persistence_filestorage.cpp",
    "content": "#include <string.h>\n#include \"persistence.h\"\n\n\nFileStorage FileStorage_Create(void) {\n    return new cv::FileStorage();\n}\n\nFileStorage FileStorage_CreateWithParams(const char* filename, int flags, const char* encoding) {\n    return new cv::FileStorage(filename, flags, encoding);\n}\n\nconst char *FileStorage_ElName(FileStorage fs) {\n    char* str = new char[fs->elname.length()+1];\n    strcpy(str, fs->elname.c_str()); \n    return str;\n}\nint FileStorage_State(FileStorage fs) {\n    return fs->state;\n}\n\nvoid FileStorage_Close(FileStorage fs) {\n    fs->release();\n    delete fs;\n}\n\nvoid FileStorage_EndWriteStruct(FileStorage fs) {\n    fs->endWriteStruct();\n}\n\nint FileStorage_GetFormat(FileStorage fs){\n    return fs->getFormat();\n}\n\nbool FileStorage_IsOpened(FileStorage fs) {\n    return fs->isOpened();\n}\n\nbool FileStorage_Open(FileStorage fs, const char* filename, int flags, const char* encoding) {\n    return fs->open(filename, flags, encoding);\n}\n\nvoid FileStorage_Release(FileStorage fs) {\n    fs->release();\n    delete fs;\n}\n\nconst char* FileStorage_ReleaseAndGetString(FileStorage fs) {\n    cv::String s = fs->releaseAndGetString();\n\n    char* str = new char[s.length()+1];\n    strcpy(str, s.c_str()); \n    return str;\n}\n\nvoid FileStorage_StartWriteStruct(FileStorage fs, const char* name, int flags, const char* typeName){\n    fs->startWriteStruct(name, flags, typeName);\n}\n\nvoid FileStorage_WriteMat(FileStorage fs, const char* name, Mat val){\n    fs->write(name, *val);\n}\n\nvoid FileStorage_WriteString(FileStorage fs, const char* name, const char* val) {\n    fs->write(name, val);\n}\n\nvoid FileStorage_WriteStringArray(FileStorage fs, const char* name, const char** val, size_t len) {\n    std::vector<cv::String> vals;\n\n    for(int i = 0; i < len; i++) {\n        vals.push_back(val[i]);\n    }\n\n    fs->write(name, vals);\n}\n\nvoid FileStorage_WriteDouble(FileStorage fs, const char* name, double val){\n    fs->write(name, val);\n}\n\nvoid FileStorage_WriteInt(FileStorage fs, const char* name, int val){\n    fs->write(name, val);\n}\n\nvoid FileStorage_WriteComment(FileStorage fs, const char* comment, bool append){\n    fs->writeComment(comment, append);\n}\nvoid FileStorage_WriteRaw(FileStorage fs, const char* fmt, const void* vec, size_t len){\n    fs->writeRaw(fmt, vec, len);\n}\n\nFileNode FileStorage_GetFirstTopLevelNode(FileStorage fs) {\n    cv::FileNode node = fs->getFirstTopLevelNode();\n\n    FileNode fn = new cv::FileNode(node);\n    return fn;\n}\n\nFileNode FileStorage_GetNode(FileStorage fs, const char* nodename) {\n\n    cv::FileNode node = (*fs)[nodename];\n\n    FileNode fn = new cv::FileNode(node);\n    return fn;\n}\n\nFileNode FileStorage_Root(FileStorage fs, int streamidx) {\n    cv::FileNode node = fs->root(streamidx);\n\n    FileNode fn = new cv::FileNode(node);\n    return fn;\n}"
  },
  {
    "path": "persistence_filestorage.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include <stdbool.h>\n#include \"persistence.h\"\n*/\nimport \"C\"\nimport \"unsafe\"\n\ntype FileStorageMode int\n\nconst (\n\tFileStorageModeRead        FileStorageMode = 0\n\tFileStorageModeWrite       FileStorageMode = 1\n\tFileStorageModeAppend      FileStorageMode = 2\n\tFileStorageModeMemory      FileStorageMode = 4\n\tFileStorageModeFormatMask  FileStorageMode = (7 << 3)\n\tFileStorageModeFormatAuto  FileStorageMode = 0\n\tFileStorageModeFormatXml   FileStorageMode = (1 << 3)\n\tFileStorageModeFormatYaml  FileStorageMode = (2 << 3)\n\tFileStorageModeFormatJson  FileStorageMode = (3 << 3)\n\tFileStorageModeBase64      FileStorageMode = 64\n\tFileStorageModeWriteBase64 FileStorageMode = FileStorageModeBase64 | FileStorageModeWrite\n)\n\ntype FileStorageState int\n\nconst (\n\tFileStorageStateUndefined     FileStorageState = 0\n\tFileStorageStateValueExpected FileStorageState = 1\n\tFileStorageStateNameExpected  FileStorageState = 2\n\tFileStorageStateInsideMap     FileStorageState = 4\n)\n\n// FileStorage is a wrapper for the OpenCV FileStorage class\n//\n// Ref: https://docs.opencv.org/4.x/da/d56/classcv_1_1FileStorage.html\ntype FileStorage struct {\n\tp C.FileStorage\n}\n\nfunc NewFileStorage() *FileStorage {\n\treturn &FileStorage{p: C.FileStorage_Create()}\n}\n\nfunc NewFileStorageWithParams(filename string, flags FileStorageMode, encoding string) *FileStorage {\n\tc_filename := C.CString(filename)\n\tc_encoding := C.CString(encoding)\n\tdefer C.free(unsafe.Pointer(c_filename))\n\tdefer C.free(unsafe.Pointer(c_encoding))\n\n\treturn &FileStorage{p: C.FileStorage_CreateWithParams(c_filename, C.int(flags), c_encoding)}\n}\n\nfunc (fs *FileStorage) Close() {\n\tfs.Release()\n}\n\nfunc (fs *FileStorage) Release() {\n\tC.FileStorage_Release(fs.p)\n}\n\nfunc (fs *FileStorage) ElName() string {\n\tc_str := C.FileStorage_ElName(fs.p)\n\tdefer C.free(unsafe.Pointer(c_str))\n\n\tstr := C.GoString(c_str)\n\treturn str\n}\n\nfunc (fs *FileStorage) State() FileStorageState {\n\tstate := C.FileStorage_State(fs.p)\n\treturn FileStorageState(int(state))\n}\n\nfunc (fs *FileStorage) EndWriteStruct() {\n\tC.FileStorage_EndWriteStruct(fs.p)\n\n}\n\nfunc (fs *FileStorage) GetFormat() FileStorageMode {\n\tfmt := C.FileStorage_GetFormat(fs.p)\n\treturn FileStorageMode(int(fmt))\n}\n\nfunc (fs *FileStorage) IsOpened() bool {\n\tb := C.FileStorage_IsOpened(fs.p)\n\treturn bool(b)\n}\n\nfunc (fs *FileStorage) Open(filename string, flags FileStorageMode, encoding string) bool {\n\tc_filename := C.CString(filename)\n\tc_encoding := C.CString(encoding)\n\tdefer C.free(unsafe.Pointer(c_filename))\n\tdefer C.free(unsafe.Pointer(c_encoding))\n\n\tb := C.FileStorage_Open(fs.p, c_filename, C.int(flags), c_encoding)\n\treturn bool(b)\n}\n\nfunc (fs *FileStorage) ReleaseAndGetString() string {\n\tc_str := C.FileStorage_ReleaseAndGetString(fs.p)\n\tdefer C.free(unsafe.Pointer(c_str))\n\n\tstr := C.GoString(c_str)\n\treturn str\n}\n\nfunc (fs *FileStorage) StartWriteStruct(name string, flags FileNodeType, typeName string) {\n\tc_name := C.CString(name)\n\tc_typeName := C.CString(typeName)\n\tdefer C.free(unsafe.Pointer(c_name))\n\tdefer C.free(unsafe.Pointer(c_typeName))\n\n\tC.FileStorage_StartWriteStruct(fs.p, c_name, C.int(flags), c_typeName)\n}\n\nfunc (fs *FileStorage) WriteMat(name string, mat Mat) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tC.FileStorage_WriteMat(fs.p, c_name, mat.p)\n}\n\nfunc (fs *FileStorage) WriteString(name string, val string) {\n\tc_name := C.CString(name)\n\tc_val := C.CString(val)\n\tdefer C.free(unsafe.Pointer(c_name))\n\tdefer C.free(unsafe.Pointer(c_val))\n\n\tC.FileStorage_WriteString(fs.p, c_name, c_val)\n}\n\nfunc (fs *FileStorage) WriteStringArray(name string, val []string) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tc_val := make([]*C.char, 0, len(val))\n\n\tfor _, v := range val {\n\t\tc_val = append(c_val, C.CString(v))\n\t}\n\tdefer func() {\n\t\tfor _, p := range c_val {\n\t\t\tC.free(unsafe.Pointer(p))\n\t\t}\n\t}()\n\tC.FileStorage_WriteStringArray(fs.p, c_name, &c_val[0], C.size_t(len(val)))\n}\n\nfunc (fs *FileStorage) WriteDouble(name string, val float32) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tC.FileStorage_WriteDouble(fs.p, c_name, C.double(val))\n}\n\nfunc (fs *FileStorage) WriteInt(name string, val int) {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tC.FileStorage_WriteInt(fs.p, c_name, C.int(val))\n}\n\nfunc (fs *FileStorage) WriteComment(comment string, append bool) {\n\tc_comment := C.CString(comment)\n\tdefer C.free(unsafe.Pointer(c_comment))\n\n\tC.FileStorage_WriteComment(fs.p, c_comment, C.bool(append))\n}\n\nfunc (fs *FileStorage) WriteRaw(fmt string, vec []byte) {\n\tc_fmt := C.CString(fmt)\n\tdefer C.free(unsafe.Pointer(c_fmt))\n\n\tc_vec := C.CBytes(vec)\n\tdefer C.free(c_vec)\n\n\tC.FileStorage_WriteRaw(fs.p, c_fmt, c_vec, C.size_t(len(vec)))\n\n}\n\nfunc (fs *FileStorage) GetFirstTopLevelNode() *FileNode {\n\tnode_p := C.FileStorage_GetFirstTopLevelNode(fs.p)\n\treturn &FileNode{p: node_p}\n}\n\nfunc (fs *FileStorage) GetNode(name string) *FileNode {\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tnode_p := C.FileStorage_GetNode(fs.p, c_name)\n\n\treturn &FileNode{p: node_p}\n\n}\n\nfunc (fs *FileStorage) Root(streamIdx int) *FileNode {\n\tnode_p := C.FileStorage_Root(fs.p, C.int(streamIdx))\n\treturn &FileNode{p: node_p}\n}\n\nfunc (fs *FileStorage) Ptr() C.FileStorage {\n\treturn fs.p\n}\n"
  },
  {
    "path": "persistence_test.go",
    "content": "package gocv\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestFileStorage(t *testing.T) {\n\n\tfileStorageTestFilename := filepath.Join(os.TempDir(), \"filestorage.json\")\n\tfs := NewFileStorageWithParams(fileStorageTestFilename, FileStorageModeWrite|FileStorageModeFormatJson, \"utf-8\")\n\n\tfs.StartWriteStruct(\"gocv\", FileNodeTypeMap, \"person\")\n\tfs.ElName()\n\tfs.State()\n\tfs.GetFormat()\n\tfs.IsOpened()\n\n\tm := NewMat()\n\tdefer m.Close()\n\tfs.WriteMat(\"mat\", m)\n\n\tfs.WriteString(\"string\", \"string value\")\n\tfs.WriteStringArray(\"stringArray\", []string{\"string\", \"array\"})\n\tfs.WriteDouble(\"double\", 3.1415927)\n\tfs.WriteInt(\"int\", 42)\n\tfs.WriteComment(\"no comments\", true)\n\n\tfs.EndWriteStruct()\n\n\tfs.StartWriteStruct(\"gocv2\", FileNodeTypeSeq, \"int\")\n\tfs.WriteRaw(\"u\", []byte{0, 0})\n\tfs.EndWriteStruct()\n\n\tfs.GetNode(\"gocv\")\n\tfs.Root(0)\n\n\tfs.ReleaseAndGetString()\n\n\tfs = NewFileStorage()\n\tfs.Open(fileStorageTestFilename, FileStorageModeRead|FileStorageModeFormatJson, \"utf-8\")\n\n\tfn := fs.GetFirstTopLevelNode()\n\tdefer fn.Close()\n\n\tfn.Empty()\n\tfn.IsInt()\n\tfn.IsMap()\n\tfn.IsNamed()\n\tfn.IsNone()\n\tfn.IsReal()\n\tfn.IsSeq()\n\tfn.IsString()\n\tfn.Keys()\n\tfs.Release()\n}\n"
  },
  {
    "path": "photo.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_photo)\n\n#include \"photo.h\"\n\nOpenCVResult ColorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul, float blue_mul) {\n    try {\n        cv::colorChange(*src, *mask, *dst, red_mul, green_mul, blue_mul);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult IlluminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta) {\n    try {\n        cv::illuminationChange(*src, *mask, *dst, alpha, beta);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult SeamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat blend, int flags) {\n    try {\n        cv::Point pt(p.x, p.y);\n        cv::seamlessClone(*src, *dst, *mask, pt, *blend, flags);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult TextureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size) {\n    try {\n        cv::textureFlattening(*src, *mask, *dst, low_threshold, high_threshold, kernel_size);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\n\nOpenCVResult FastNlMeansDenoisingColoredMulti(\tstruct Mats src, Mat dst, int imgToDenoiseIndex, int \ttemporalWindowSize){\n    try {\n        std::vector<cv::Mat> images;\n        for (int i = 0; i < src.length; ++i) {\n            images.push_back(*src.mats[i]);\n        }\n        cv::fastNlMeansDenoisingColoredMulti( images, *dst, imgToDenoiseIndex, \ttemporalWindowSize );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FastNlMeansDenoisingColoredMultiWithParams( struct Mats src, Mat dst, int imgToDenoiseIndex, int \ttemporalWindowSize, float \th, float \thColor, int \ttemplateWindowSize, int \tsearchWindowSize ){\n    try {\n        std::vector<cv::Mat> images;\n        for (int i = 0; i < src.length; ++i) {\n            images.push_back(*src.mats[i]);\n        }\n        cv::fastNlMeansDenoisingColoredMulti( images, *dst, imgToDenoiseIndex, \ttemporalWindowSize, h, hColor, templateWindowSize, searchWindowSize );\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nMergeMertens MergeMertens_Create() {\n    try {\n        return new cv::Ptr<cv::MergeMertens>(cv::createMergeMertens());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nMergeMertens MergeMertens_CreateWithParams(float contrast_weight,\n                                           float saturation_weight,\n                                           float exposure_weight) {\n    try {\n        return new cv::Ptr<cv::MergeMertens>(cv::createMergeMertens(contrast_weight, saturation_weight, exposure_weight));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid MergeMertens_Close(MergeMertens b) {\n    delete b;\n}\n\nOpenCVResult MergeMertens_Process(MergeMertens b, struct Mats src, Mat dst) {\n    try {\n        std::vector<cv::Mat> images;\n        for (int i = 0; i < src.length; ++i) {\n            images.push_back(*src.mats[i]);\n        }\n        (*b)->process(images, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nAlignMTB AlignMTB_Create() {\n    try {\n        return new cv::Ptr<cv::AlignMTB>(cv::createAlignMTB(6,4,false));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nAlignMTB AlignMTB_CreateWithParams(int max_bits, int exclude_range, bool cut) {\n    try {\n        return new cv::Ptr<cv::AlignMTB>(cv::createAlignMTB(max_bits, exclude_range, cut));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return NULL;\n    }\n}\n\nvoid AlignMTB_Close(AlignMTB b) { delete b; }\n\nOpenCVResult AlignMTB_Process(AlignMTB b, struct Mats src, struct Mats *dst) {\n    try {\n        std::vector<cv::Mat> srcMats;\n        for (int i = 0; i < src.length; ++i) {\n            srcMats.push_back(*src.mats[i]);\n        }\n      \n        std::vector<cv::Mat> dstMats;\n        (*b)->process(srcMats, dstMats);\n      \n        dst->mats = new Mat[dstMats.size()];\n        for (size_t i = 0; i < dstMats.size() ; ++i) {\n            dst->mats[i] = new cv::Mat( dstMats[i] );\n        }\n        dst->length = (int)dstMats.size();\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FastNlMeansDenoising(Mat src, Mat dst) {\n    try {\n        cv::fastNlMeansDenoising(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FastNlMeansDenoisingWithParams(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize) {\n    try {\n        cv::fastNlMeansDenoising(*src, *dst, h, templateWindowSize, searchWindowSize);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FastNlMeansDenoisingColored(Mat src, Mat dst) {\n    try {\n        cv::fastNlMeansDenoisingColored(*src, *dst);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult FastNlMeansDenoisingColoredWithParams(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize) {\n    try {\n        cv::fastNlMeansDenoisingColored(*src, *dst, h, hColor, templateWindowSize, searchWindowSize);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult EdgePreservingFilter(Mat src, Mat dst, int filter, float sigma_s, float sigma_r) {\n    try {\n        cv::edgePreservingFilter(*src, *dst, filter, sigma_s, sigma_r);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult DetailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r) {\n    try {\n        cv::detailEnhance(*src, *dst, sigma_s, sigma_r);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult PencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor) {\n    try {\n        cv::pencilSketch(*src, *dst1, *dst2, sigma_s, sigma_r, shade_factor);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Stylization(Mat src, Mat dst, float sigma_s, float sigma_r) {\n    try {\n        cv::stylization(*src, *dst, sigma_s, sigma_r);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult PhotoInpaint(Mat src, Mat mask, Mat dst, float inpaint_radius, int algorithm_type) {\n    try {\n        cv::inpaint(*src, *mask, *dst, inpaint_radius, algorithm_type);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n\nOpenCVResult Decolor(Mat src, Mat grey, Mat boost) {\n    try {\n        cv::decolor(*src, *grey, *boost);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}\n"
  },
  {
    "path": "photo.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_photo)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"photo.h\"\n*/\nimport \"C\"\n\nimport (\n\t\"image\"\n\t\"unsafe\"\n)\n\n// SeamlessCloneFlags seamlessClone algorithm flags\ntype SeamlessCloneFlags int\n\n// MergeMertens is a wrapper around the cv::MergeMertens.\ntype MergeMertens struct {\n\tp unsafe.Pointer // This unsafe pointer will in fact be a C.MergeMertens\n}\n\n// AlignMTB is a wrapper around the cv::AlignMTB.\ntype AlignMTB struct {\n\tp unsafe.Pointer // This unsafe pointer will in fact be a C.AlignMTB\n}\n\nconst (\n\t// NormalClone The power of the method is fully expressed when inserting objects with complex outlines into a new background.\n\tNormalClone SeamlessCloneFlags = iota\n\n\t// MixedClone The classic method, color-based selection and alpha masking might be time consuming and often leaves an undesirable halo. Seamless cloning, even averaged with the original image, is not effective. Mixed seamless cloning based on a loose selection proves effective.\n\tMixedClone\n\n\t// MonochromeTransfer Monochrome transfer allows the user to easily replace certain features of one object by alternative features.\n\tMonochromeTransfer\n)\n\n// ColorChange mix two differently colored versions of an image seamlessly.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/da0/group__photo__clone.html#ga6684f35dc669ff6196a7c340dc73b98e\nfunc ColorChange(src, mask Mat, dst *Mat, red_mul, green_mul, blue_mul float32) error {\n\treturn OpenCVResult(C.ColorChange(src.p, mask.p, dst.p, C.float(red_mul), C.float(green_mul), C.float(blue_mul)))\n}\n\n// SeamlessClone blend two image by Poisson Blending.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/da0/group__photo__clone.html#ga2bf426e4c93a6b1f21705513dfeca49d\nfunc SeamlessClone(src, dst, mask Mat, p image.Point, blend *Mat, flags SeamlessCloneFlags) error {\n\tcp := C.struct_Point{\n\t\tx: C.int(p.X),\n\t\ty: C.int(p.Y),\n\t}\n\n\treturn OpenCVResult(C.SeamlessClone(src.p, dst.p, mask.p, cp, blend.p, C.int(flags)))\n}\n\n// IlluminationChange modifies locally the apparent illumination of an image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/da0/group__photo__clone.html#gac5025767cf2febd8029d474278e886c7\nfunc IlluminationChange(src, mask Mat, dst *Mat, alpha, beta float32) error {\n\treturn OpenCVResult(C.IlluminationChange(src.p, mask.p, dst.p, C.float(alpha), C.float(beta)))\n}\n\n// TextureFlattening washes out the texture of the selected region, giving its contents a flat aspect.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/df/da0/group__photo__clone.html#gad55df6aa53797365fa7cc23959a54004\nfunc TextureFlattening(src, mask Mat, dst *Mat, lowThreshold, highThreshold float32, kernelSize int) error {\n\treturn OpenCVResult(C.TextureFlattening(src.p, mask.p, dst.p, C.float(lowThreshold), C.float(highThreshold), C.int(kernelSize)))\n}\n\n// FastNlMeansDenoisingColoredMulti denoises the selected images.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#gaa501e71f52fb2dc17ff8ca5e7d2d3619\nfunc FastNlMeansDenoisingColoredMulti(src []Mat, dst *Mat, imgToDenoiseIndex int, temporalWindowSize int) error {\n\tcMatArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcMatArray[i] = (C.Mat)(r.p)\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\treturn OpenCVResult(C.FastNlMeansDenoisingColoredMulti(matsVector, dst.p, C.int(imgToDenoiseIndex), C.int(temporalWindowSize)))\n}\n\n// FastNlMeansDenoisingColoredMulti denoises the selected images.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d1/d79/group__photo__denoise.html#gaa501e71f52fb2dc17ff8ca5e7d2d3619\nfunc FastNlMeansDenoisingColoredMultiWithParams(src []Mat, dst *Mat, imgToDenoiseIndex int, temporalWindowSize int, h float32, hColor float32, templateWindowSize int, searchWindowSize int) error {\n\tcMatArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcMatArray[i] = (C.Mat)(r.p)\n\t}\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\treturn OpenCVResult(C.FastNlMeansDenoisingColoredMultiWithParams(matsVector, dst.p, C.int(imgToDenoiseIndex), C.int(temporalWindowSize), C.float(h), C.float(hColor), C.int(templateWindowSize), C.int(searchWindowSize)))\n}\n\n// NewMergeMertens returns returns a new MergeMertens white LDR merge algorithm.\n// of type MergeMertens with default parameters.\n// MergeMertens algorithm merge the ldr image should result in a HDR image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html\n// https://docs.opencv.org/master/d7/dd6/classcv_1_1MergeMertens.html\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga79d59aa3cb3a7c664e59a4b5acc1ccb6\nfunc NewMergeMertens() MergeMertens {\n\treturn MergeMertens{p: unsafe.Pointer(C.MergeMertens_Create())}\n}\n\n// NewMergeMertensWithParams returns a new MergeMertens white LDR merge algorithm\n// of type MergeMertens with customized parameters.\n// MergeMertens algorithm merge the ldr image should result in a HDR image.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html\n// https://docs.opencv.org/master/d7/dd6/classcv_1_1MergeMertens.html\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga79d59aa3cb3a7c664e59a4b5acc1ccb6\nfunc NewMergeMertensWithParams(contrast_weight float32, saturation_weight float32, exposure_weight float32) MergeMertens {\n\treturn MergeMertens{p: unsafe.Pointer(C.MergeMertens_CreateWithParams(C.float(contrast_weight), C.float(saturation_weight), C.float(exposure_weight)))}\n}\n\n// Close MergeMertens.\nfunc (b *MergeMertens) Close() error {\n\tC.MergeMertens_Close((C.MergeMertens)(b.p)) // Here the unsafe pointer is cast into the right type\n\tb.p = nil\n\treturn nil\n}\n\n// BalanceWhite computes merge LDR images using the current MergeMertens.\n// Return a image MAT : 8bits 3 channel image ( RGB 8 bits )\n// For further details, please see:\n// https://docs.opencv.org/master/d7/dd6/classcv_1_1MergeMertens.html#a2d2254b2aab722c16954de13a663644d\nfunc (b *MergeMertens) Process(src []Mat, dst *Mat) error {\n\tcMatArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcMatArray[i] = (C.Mat)(r.p)\n\t}\n\t// Conversion function from a Golang slice into an array of matrices that are understood by OpenCV\n\tmatsVector := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cMatArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\tres := C.MergeMertens_Process((C.MergeMertens)(b.p), matsVector, dst.p)\n\t// Convert a series of double [0.0,1.0] to [0,255] with Golang\n\tdst.ConvertToWithParams(dst, MatTypeCV8UC3, 255.0, 0.0)\n\treturn OpenCVResult(res)\n}\n\n// NewAlignMTB returns an AlignMTB for converts images to median threshold bitmaps.\n// of type AlignMTB converts images to median threshold bitmaps (1 for pixels\n// brighter than median luminance and 0 otherwise) and than aligns the resulting\n// bitmaps using bit operations.\n\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html\n// https://docs.opencv.org/master/d7/db6/classcv_1_1AlignMTB.html\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga2f1fafc885a5d79dbfb3542e08db0244\nfunc NewAlignMTB() AlignMTB {\n\treturn AlignMTB{p: unsafe.Pointer(C.AlignMTB_Create())}\n}\n\n// NewAlignMTBWithParams returns an AlignMTB for converts images to median threshold bitmaps.\n// of type AlignMTB converts images to median threshold bitmaps (1 for pixels\n// brighter than median luminance and 0 otherwise) and than aligns the resulting\n// bitmaps using bit operations.\n\n// For further details, please see:\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html\n// https://docs.opencv.org/master/d7/db6/classcv_1_1AlignMTB.html\n// https://docs.opencv.org/master/d6/df5/group__photo__hdr.html#ga2f1fafc885a5d79dbfb3542e08db0244\nfunc NewAlignMTBWithParams(max_bits int, exclude_range int, cut bool) AlignMTB {\n\treturn AlignMTB{p: unsafe.Pointer(C.AlignMTB_CreateWithParams(C.int(max_bits), C.int(exclude_range), C.bool(cut)))}\n}\n\n// Close AlignMTB.\nfunc (b *AlignMTB) Close() error {\n\tC.AlignMTB_Close((C.AlignMTB)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Process computes an alignment using the current AlignMTB.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/db6/classcv_1_1AlignMTB.html#a37b3417d844f362d781f34155cbcb201\nfunc (b *AlignMTB) Process(src []Mat, dst *[]Mat) error {\n\n\tcSrcArray := make([]C.Mat, len(src))\n\tfor i, r := range src {\n\t\tcSrcArray[i] = r.p\n\t}\n\tcSrcMats := C.struct_Mats{\n\t\tmats:   (*C.Mat)(&cSrcArray[0]),\n\t\tlength: C.int(len(src)),\n\t}\n\n\tcDstMats := C.struct_Mats{}\n\n\tres := C.AlignMTB_Process((C.AlignMTB)(b.p), cSrcMats, &cDstMats)\n\n\t// Pass the matrices by reference from an OpenCV/C++ to a GoCV::Mat object\n\tfor i := C.int(0); i < cDstMats.length; i++ {\n\t\tvar tempdst Mat\n\t\ttempdst.p = C.Mats_get(cDstMats, i)\n\t\t*dst = append(*dst, tempdst)\n\t}\n\treturn OpenCVResult(res)\n}\n\n// FastNlMeansDenoising performs image denoising using Non-local Means Denoising algorithm\n// http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93\nfunc FastNlMeansDenoising(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.FastNlMeansDenoising(src.p, dst.p))\n}\n\n// FastNlMeansDenoisingWithParams performs image denoising using Non-local Means Denoising algorithm\n// http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga4c6b0031f56ea3f98f768881279ffe93\nfunc FastNlMeansDenoisingWithParams(src Mat, dst *Mat, h float32, templateWindowSize int, searchWindowSize int) error {\n\treturn OpenCVResult(C.FastNlMeansDenoisingWithParams(src.p, dst.p, C.float(h), C.int(templateWindowSize), C.int(searchWindowSize)))\n}\n\n// FastNlMeansDenoisingColored is a modification of fastNlMeansDenoising function for colored images.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga21abc1c8b0e15f78cd3eff672cb6c476\nfunc FastNlMeansDenoisingColored(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.FastNlMeansDenoisingColored(src.p, dst.p))\n}\n\n// FastNlMeansDenoisingColoredWithParams is a modification of fastNlMeansDenoising function for colored images.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d1/d79/group__photo__denoise.html#ga21abc1c8b0e15f78cd3eff672cb6c476\nfunc FastNlMeansDenoisingColoredWithParams(src Mat, dst *Mat, h float32, hColor float32, templateWindowSize int, searchWindowSize int) error {\n\treturn OpenCVResult(C.FastNlMeansDenoisingColoredWithParams(src.p, dst.p, C.float(h), C.float(hColor), C.int(templateWindowSize), C.int(searchWindowSize)))\n}\n\n// DetailEnhance filter enhances the details of a particular image\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c\nfunc DetailEnhance(src Mat, dst *Mat, sigma_s, sigma_r float32) error {\n\treturn OpenCVResult(C.DetailEnhance(src.p, dst.p, C.float(sigma_s), C.float(sigma_r)))\n}\n\ntype EdgeFilter int\n\nconst (\n\t// RecursFilter Recursive Filtering.\n\tRecursFilter EdgeFilter = 1\n\n\t// NormconvFilter Normalized Convolution Filtering.\n\tNormconvFilter = 2\n)\n\n// EdgePreservingFilter filtering is the fundamental operation in image and video processing.\n// Edge-preserving smoothing filters are used in many different applications.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gafaee2977597029bc8e35da6e67bd31f7\nfunc EdgePreservingFilter(src Mat, dst *Mat, filter EdgeFilter, sigma_s, sigma_r float32) error {\n\treturn OpenCVResult(C.EdgePreservingFilter(src.p, dst.p, C.int(filter), C.float(sigma_s), C.float(sigma_r)))\n}\n\n// PencilSketch pencil-like non-photorealistic line drawing.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gae5930dd822c713b36f8529b21ddebd0c\nfunc PencilSketch(src Mat, dst1, dst2 *Mat, sigma_s, sigma_r, shade_factor float32) error {\n\treturn OpenCVResult(C.PencilSketch(src.p, dst1.p, dst2.p, C.float(sigma_s), C.float(sigma_r), C.float(shade_factor)))\n}\n\n// Stylization aims to produce digital imagery with a wide variety of effects\n// not focused on photorealism. Edge-aware filters are ideal for stylization,\n// as they can abstract regions of low contrast while preserving, or enhancing,\n// high-contrast features.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/df/dac/group__photo__render.html#gacb0f7324017df153d7b5d095aed53206\nfunc Stylization(src Mat, dst *Mat, sigma_s, sigma_r float32) error {\n\treturn OpenCVResult(C.Stylization(src.p, dst.p, C.float(sigma_s), C.float(sigma_r)))\n}\n\n// InpaintMethods is the methods for inpainting process.\ntype InpaintMethods int\n\nconst (\n\t// NS inpaints using Navier-Stokes based method, created by Bertalmio, Marcelo,\n\t// Andrea L. Bertozzi, and Guillermo Sapiro in 2001\n\tNS InpaintMethods = 0\n\n\t// Telea inpaints using Fast Marching Method proposed by Alexandru Telea in 2004.\n\tTelea InpaintMethods = 1\n)\n\n// Inpaint reconstructs the selected image area from the pixel near the area boundary.\n// The function may be used to remove dust and scratches from a scanned photo, or to\n// remove undesirable objects from still images or video.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/d8b/group__photo__inpaint.html#gaedd30dfa0214fec4c88138b51d678085\nfunc Inpaint(src Mat, mask Mat, dst *Mat, inpaintRadius float32, algorithmType InpaintMethods) error {\n\treturn OpenCVResult(C.PhotoInpaint(C.Mat(src.Ptr()), C.Mat(mask.Ptr()), C.Mat(dst.Ptr()), C.float(inpaintRadius), C.int(algorithmType)))\n}\n\n// Decolor Transforms a color image to a grayscale image.\n// It is a basic tool in digital printing, stylized black-and-white photograph rendering,\n// and in many single channel image processing applications\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d4/d32/group__photo__decolor.html#ga4864d4c007bda5dacdc5e9d4ed7e222c\nfunc Decolor(src Mat, grey *Mat, boost *Mat) error {\n\treturn OpenCVResult(C.Decolor(src.p, grey.p, boost.p))\n}\n"
  },
  {
    "path": "photo.h",
    "content": "#ifndef _OPENCV3_PHOTO_H_\n#define _OPENCV3_PHOTO_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/photo.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\n// see : https://docs.opencv.org/3.4/d7/dd6/classcv_1_1MergeMertens.html\ntypedef cv::Ptr<cv::MergeMertens> *MergeMertens;\n// see : https://docs.opencv.org/master/d7/db6/classcv_1_1AlignMTB.html\ntypedef cv::Ptr<cv::AlignMTB> *AlignMTB;\n#else\ntypedef void *MergeMertens;\ntypedef void *AlignMTB;\n#endif\n\nOpenCVResult ColorChange(Mat src, Mat mask, Mat dst, float red_mul, float green_mul, float blue_mul);\n\nOpenCVResult SeamlessClone(Mat src, Mat dst, Mat mask, Point p, Mat blend, int flags);\n\nOpenCVResult IlluminationChange(Mat src, Mat mask, Mat dst, float alpha, float beta);\n\nOpenCVResult TextureFlattening(Mat src, Mat mask, Mat dst, float low_threshold, float high_threshold, int kernel_size);\n\nOpenCVResult FastNlMeansDenoisingColoredMulti(struct Mats src, Mat dst, int imgToDenoiseIndex, int \ttemporalWindowSize);\nOpenCVResult FastNlMeansDenoisingColoredMultiWithParams(struct Mats src, Mat dst, int imgToDenoiseIndex, int \ttemporalWindowSize, float \th, float \thColor, int \ttemplateWindowSize, int \tsearchWindowSize );\nOpenCVResult FastNlMeansDenoising(Mat src, Mat dst);\nOpenCVResult FastNlMeansDenoisingWithParams(Mat src, Mat dst, float h, int templateWindowSize, int searchWindowSize);\nOpenCVResult FastNlMeansDenoisingColored(Mat src, Mat dst);\nOpenCVResult FastNlMeansDenoisingColoredWithParams(Mat src, Mat dst, float h, float hColor, int templateWindowSize, int searchWindowSize);\n\nMergeMertens MergeMertens_Create();\nMergeMertens MergeMertens_CreateWithParams(float contrast_weight, float saturation_weight, float exposure_weight);\nOpenCVResult MergeMertens_Process(MergeMertens b, struct Mats src, Mat dst);\nvoid MergeMertens_Close(MergeMertens b);\n\nAlignMTB AlignMTB_Create();\nAlignMTB AlignMTB_CreateWithParams(int max_bits, int exclude_range, bool cut);\nOpenCVResult AlignMTB_Process(AlignMTB b, struct Mats src, struct Mats *dst);\nvoid AlignMTB_Close(AlignMTB b);\n\nOpenCVResult DetailEnhance(Mat src, Mat dst, float sigma_s, float sigma_r);\nOpenCVResult EdgePreservingFilter(Mat src, Mat dst, int filter, float sigma_s, float sigma_r);\nOpenCVResult PencilSketch(Mat src, Mat dst1, Mat dst2, float sigma_s, float sigma_r, float shade_factor);\nOpenCVResult Stylization(Mat src, Mat dst, float sigma_s, float sigma_r);\n\nOpenCVResult PhotoInpaint(Mat src, Mat mask, Mat dst, float inpaint_radius, int algorithm_type);\nOpenCVResult Decolor(Mat src, Mat grey, Mat boost);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_PHOTO_H\n"
  },
  {
    "path": "photo_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_photo)\n\npackage gocv\n\nfunc (c SeamlessCloneFlags) String() string {\n\tswitch c {\n\tcase NormalClone:\n\t\treturn \"normal-clone\"\n\tcase MixedClone:\n\t\treturn \"mixed-clone\"\n\tcase MonochromeTransfer:\n\t\treturn \"monochrome-transfer\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "photo_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_photo)\n\npackage gocv\n\nimport (\n\t\"image\"\n\t\"testing\"\n)\n\nfunc TestColorChange(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tmask := src.Clone()\n\tdefer mask.Close()\n\n\tColorChange(src, mask, &dst, 1.5, .5, .5)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid ColorChange test\")\n\t}\n}\n\nfunc TestSeamlessClone(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMatWithSize(30, 30, MatTypeCV8UC3)\n\tdefer dst.Close()\n\tblend := NewMatWithSize(dst.Rows(), dst.Cols(), dst.Type())\n\tdefer blend.Close()\n\tmask := src.Clone()\n\tdefer mask.Close()\n\n\tcenter := image.Point{dst.Cols() / 2, dst.Rows() / 2}\n\tSeamlessClone(src, dst, mask, center, &blend, NormalClone)\n\tif blend.Empty() || dst.Rows() != blend.Rows() || dst.Cols() != blend.Cols() {\n\t\tt.Error(\"Invlalid SeamlessClone test\")\n\t}\n}\n\nfunc TestIlluminationChange(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tmask := src.Clone()\n\tdefer mask.Close()\n\n\tIlluminationChange(src, mask, &dst, 0.2, 0.4)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid IlluminationChange test\")\n\t}\n}\n\nfunc TestTextureFlattening(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\tmask := src.Clone()\n\tdefer mask.Close()\n\n\tTextureFlattening(src, mask, &dst, 30, 45, 3)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid TextureFlattening test\")\n\t}\n}\n\nfunc TestFastNlMeansDenoisingColoredMultiWithParams(t *testing.T) {\n\tvar src [3]Mat\n\tfor i := 0; i < 3; i++ {\n\t\tsrc[i] = NewMatWithSize(20, 20, MatTypeCV8UC3)\n\t\tdefer src[i].Close()\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tFastNlMeansDenoisingColoredMultiWithParams([]Mat{src[0], src[1], src[2]}, &dst, 1, 1, 3, 3, 7, 21)\n\n\tif dst.Empty() || dst.Rows() != src[0].Rows() || dst.Cols() != src[0].Cols() {\n\t\tt.Error(\"Invalid FastNlMeansDenoisingColoredMultiWithParams test\")\n\t}\n}\n\nfunc TestMergeMertens(t *testing.T) {\n\tvar src [3]Mat\n\tfor i := 0; i < 3; i++ {\n\t\tsrc[i] = NewMatWithSize(20, 20, MatTypeCV8UC3)\n\t\tdefer src[i].Close()\n\t}\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmertens := NewMergeMertens()\n\tdefer mertens.Close()\n\n\tmertens.Process([]Mat{src[0], src[1], src[2]}, &dst)\n\n\tif dst.Empty() || dst.Rows() != src[0].Rows() || dst.Cols() != src[0].Cols() {\n\t\tt.Error(\"Invalid TestMergeMertens test\")\n\t}\n}\n\nfunc TestNewAlignMTB(t *testing.T) {\n\tvar src [3]Mat\n\tfor i := 0; i < 3; i++ {\n\t\tsrc[i] = NewMatWithSize(20, 20, MatTypeCV8UC3)\n\t\tdefer src[i].Close()\n\t}\n\n\talignwtb := NewAlignMTB()\n\tdefer alignwtb.Close()\n\n\tvar dst []Mat\n\talignwtb.Process([]Mat{src[0], src[1], src[2]}, &dst)\n\n\tsizedst := len(dst)\n\tt.Logf(\" Size Dst slice : %d \", sizedst)\n\tif sizedst > 0 {\n\t\tif dst[0].Empty() || dst[0].Rows() != src[0].Rows() || dst[0].Cols() != src[0].Cols() {\n\t\t\tt.Error(\"Invalid TestNewAlignMTB test\")\n\t\t}\n\t}\n\tif sizedst <= 0 {\n\t\tt.Error(\"Invalid TestNewAlignMTB test : empty result\")\n\t}\n}\n\nfunc TestFastNlMeansDenoising(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in TestFastNlMeansDenoising test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tFastNlMeansDenoising(img, &dest)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Error in TestFastNlMeansDenoising test\")\n\t}\n}\n\nfunc TestFastNlMeansDenoisingWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in TestFastNlMeansDenoising test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tFastNlMeansDenoisingWithParams(img, &dest, 3, 7, 21)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Error in TestFastNlMeansDenoising test\")\n\t}\n}\n\nfunc TestFastNlMeansDenoisingColored(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FastNlMeansDenoisingColored test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tFastNlMeansDenoisingColored(img, &dest)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Error in FastNlMeansDenoisingColored test\")\n\t}\n}\n\nfunc TestFastNlMeansDenoisingColoredWithParams(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in FastNlMeansDenoisingColored test\")\n\t}\n\tdefer img.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tFastNlMeansDenoisingColoredWithParams(img, &dest, 3, 3, 7, 21)\n\tif dest.Empty() || img.Rows() != dest.Rows() || img.Cols() != dest.Cols() {\n\t\tt.Error(\"Error in FastNlMeansDenoisingColored test\")\n\t}\n}\n\nfunc TestDetailEnhance(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tDetailEnhance(src, &dst, 100.0, .5)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid DetailEnhance test\")\n\t}\n}\n\nfunc TestEdgePreservingFilter(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tEdgePreservingFilter(src, &dst, RecursFilter, 100.0, .5)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invalid EdgePreservingFilter test\")\n\t}\n}\n\nfunc TestStylization(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tStylization(src, &dst, 100.0, .5)\n\tif dst.Empty() || dst.Rows() != src.Rows() || dst.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid Stylization test\")\n\t}\n}\n\nfunc TestPencilSketch(t *testing.T) {\n\tsrc := NewMatWithSize(20, 20, MatTypeCV8UC3)\n\tdefer src.Close()\n\tdst1 := NewMat()\n\tdefer dst1.Close()\n\tdst2 := NewMat()\n\tdefer dst2.Close()\n\n\tPencilSketch(src, &dst1, &dst2, 100.0, .5, 0.05)\n\tif dst1.Empty() || dst1.Rows() != src.Rows() || dst1.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid PencilSketch test\")\n\t}\n\tif dst2.Empty() || dst2.Rows() != src.Rows() || dst2.Cols() != src.Cols() {\n\t\tt.Error(\"Invlalid PencilSketch test\")\n\t}\n}\n\nfunc TestInpaint(t *testing.T) {\n\tsrc := IMRead(\"images/inpaint-src.jpg\", IMReadColor)\n\tdefer src.Close()\n\tmask := IMRead(\"images/inpaint-mask.jpg\", IMReadGrayScale)\n\tdefer mask.Close()\n\tdst := NewMatWithSize(src.Rows(), src.Cols(), MatTypeCV8U)\n\tdefer dst.Close()\n\n\tInpaint(src, mask, &dst, 10, Telea)\n\tif dst.Channels() == 1 {\n\t\tt.Error(\"Invalid inpaint test\")\n\t}\n\n\tif sum := dst.Sum(); sum.Val1 == 0 || sum.Val2 == 0 || sum.Val3 == 0 {\n\t\tt.Error(\"Invalid inpaint test\")\n\t}\n}\n\nfunc TestDecolor(t *testing.T) {\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in Decolor test\")\n\t}\n\tdefer img.Close()\n\n\tgrey := NewMat()\n\tdefer grey.Close()\n\n\tboost := NewMat()\n\tdefer boost.Close()\n\n\tif err := Decolor(img, &grey, &boost); err != nil {\n\t\tt.Error(\"Error in Decolor test\", err)\n\t}\n\n\tif grey.Empty() || img.Rows() != grey.Rows() || img.Cols() != grey.Cols() {\n\t\tt.Error(\"Error in Decolor test\")\n\t}\n\n\tif boost.Empty() || img.Rows() != boost.Rows() || img.Cols() != boost.Cols() {\n\t\tt.Error(\"Error in Decolor test\")\n\t}\n}\n"
  },
  {
    "path": "svd.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_svd)\n\n#include \"svd.h\"\n\nOpenCVResult SVD_Compute(Mat src, Mat w, Mat u, Mat vt) {\n    try {\n        cv::SVD::compute(*src, *w, *u, *vt, 0);\n        return successResult();\n    } catch(const cv::Exception& e) {\n        return errorResult(e.code, e.what());\n    }\n}"
  },
  {
    "path": "svd.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_svd)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"svd.h\"\n*/\nimport \"C\"\n\n// SVDCompute decomposes matrix and stores the results to user-provided matrices\n//\n// https://docs.opencv.org/4.1.2/df/df7/classcv_1_1SVD.html#a76f0b2044df458160292045a3d3714c6\nfunc SVDCompute(src Mat, w, u, vt *Mat) error {\n\treturn OpenCVResult(C.SVD_Compute(src.Ptr(), w.Ptr(), u.Ptr(), vt.Ptr()))\n}\n"
  },
  {
    "path": "svd.h",
    "content": "#ifndef _OPENCV3_SVD_H_\n#define _OPENCV3_SVD_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\nOpenCVResult SVD_Compute(Mat src, Mat w, Mat u, Mat vt);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_SVD_H"
  },
  {
    "path": "svd_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_svd)\n\npackage gocv\n\nimport (\n\t\"runtime\"\n\t\"testing\"\n)\n\nfunc TestSVDCompute(t *testing.T) {\n\tif runtime.GOOS == \"darwin\" {\n\t\tt.Skip(\"skipping test on macos\")\n\t}\n\n\tvar resultW = []float32{6.167493, 3.8214223}\n\tvar resultU = []float32{-0.1346676, -0.99089086, 0.9908908, -0.1346676}\n\tvar resultVt = []float32{0.01964448, 0.999807, -0.999807, 0.01964448}\n\n\tcheckFunc := func(a []float32, b []float32) bool {\n\t\tif len(a) != len(b) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor i := range a {\n\t\t\tif a[i] != b[i] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\tsrc := NewMatWithSize(2, 2, MatTypeCV32F)\n\tsrc.SetFloatAt(0, 0, 3.76956568)\n\tsrc.SetFloatAt(0, 1, -0.90478725)\n\tsrc.SetFloatAt(1, 0, 0.634576)\n\tsrc.SetFloatAt(1, 1, 6.10002347)\n\tdefer src.Close()\n\n\tw := NewMat()\n\tdefer w.Close()\n\n\tu := NewMat()\n\tdefer u.Close()\n\n\tvt := NewMat()\n\tdefer vt.Close()\n\n\tSVDCompute(src, &w, &u, &vt)\n\n\tdataW, err := w.DataPtrFloat32()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif !checkFunc(resultW, dataW) {\n\t\tt.Error(\"w value is incorrect\")\n\t}\n\n\tdataU, err := u.DataPtrFloat32()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif !checkFunc(resultU, dataU) {\n\t\tt.Error(\"u value is incorrect\")\n\t}\n\n\tdataVt, err := vt.DataPtrFloat32()\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\n\tif !checkFunc(resultVt, dataVt) {\n\t\tt.Error(\"vt value is incorrect\")\n\t}\n}\n"
  },
  {
    "path": "version.cpp",
    "content": "#include \"version.h\"\n\nconst char* openCVVersion() {\n    return CV_VERSION;\n}\n"
  },
  {
    "path": "version.go",
    "content": "package gocv\n\n/*\n#include <stdlib.h>\n#include \"version.h\"\n*/\nimport \"C\"\n\n// GoCVVersion of this package, for display purposes.\nconst GoCVVersion = \"0.43.0\"\n\n// Version returns the current golang package version\nfunc Version() string {\n\treturn GoCVVersion\n}\n\n// OpenCVVersion returns the current OpenCV lib version\nfunc OpenCVVersion() string {\n\treturn C.GoString(C.openCVVersion())\n}\n"
  },
  {
    "path": "version.h",
    "content": "#ifndef _OPENCV3_VERSION_H_\n#define _OPENCV3_VERSION_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\nconst char* openCVVersion();\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_VERSION_H_\n"
  },
  {
    "path": "version_test.go",
    "content": "package gocv\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestVersions(t *testing.T) {\n\tocvv := OpenCVVersion()\n\n\tif !(strings.Contains(ocvv, \"4.11\") || strings.Contains(ocvv, \"4.12\") || strings.Contains(ocvv, \"4.13\")) {\n\t\tt.Error(\"Wrong version of OpenCV:\", ocvv)\n\t}\n\n\tv := Version()\n\n\tif v != GoCVVersion {\n\t\tt.Error(\"Wrong version of GoCV\")\n\t}\n}\n"
  },
  {
    "path": "video.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_video)\n\n#include \"video.h\"\n\nBackgroundSubtractorMOG2 BackgroundSubtractorMOG2_Create() {\n    try {\n\t\treturn new cv::Ptr<cv::BackgroundSubtractorMOG2>(cv::createBackgroundSubtractorMOG2());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nBackgroundSubtractorMOG2 BackgroundSubtractorMOG2_CreateWithParams(int history, double varThreshold, bool detectShadows) {\n    try {\n\t\treturn new cv::Ptr<cv::BackgroundSubtractorMOG2>(cv::createBackgroundSubtractorMOG2(history,varThreshold,detectShadows));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nBackgroundSubtractorKNN BackgroundSubtractorKNN_Create() {\n    try {\n\t\treturn new cv::Ptr<cv::BackgroundSubtractorKNN>(cv::createBackgroundSubtractorKNN());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nBackgroundSubtractorKNN BackgroundSubtractorKNN_CreateWithParams(int history, double dist2Threshold, bool detectShadows) {\n    try {\n\t\treturn new cv::Ptr<cv::BackgroundSubtractorKNN>(cv::createBackgroundSubtractorKNN(history,dist2Threshold,detectShadows));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nvoid BackgroundSubtractorMOG2_Close(BackgroundSubtractorMOG2 b) {\n    delete b;\n}\n\nOpenCVResult BackgroundSubtractorMOG2_Apply(BackgroundSubtractorMOG2 b, Mat src, Mat dst) {\n  \ttry {\n\t\t(*b)->apply(*src, *dst);\n      \tOpenCVResult result = {0, NULL};\n      \treturn result;\n  \t} catch(const cv::Exception& e) {\n      \tOpenCVResult result = {e.code, e.what()};\n      \treturn result;\n    }\n}\n\nOpenCVResult BackgroundSubtractorMOG2_ApplyWithParams(BackgroundSubtractorMOG2 b, Mat src, Mat dst, double learningRate) {\n    try {\n\t\t(*b)->apply(*src, *dst, learningRate);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\nvoid BackgroundSubtractorKNN_Close(BackgroundSubtractorKNN k) {\n    delete k;\n}\n\nOpenCVResult BackgroundSubtractorKNN_Apply(BackgroundSubtractorKNN k, Mat src, Mat dst) {\n    try {\n\t\t(*k)->apply(*src, *dst);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\nOpenCVResult CalcOpticalFlowFarneback(Mat prevImg, Mat nextImg, Mat flow, double scale, int levels,\n                              int winsize, int iterations, int polyN, double polySigma, int flags) {\n\ttry {\n\t\tcv::calcOpticalFlowFarneback(*prevImg, *nextImg, *flow, scale, levels, winsize, iterations, polyN, polySigma, flags);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\nOpenCVResult CalcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err) {\n    try {\n\t\tcv::calcOpticalFlowPyrLK(*prevImg, *nextImg, *prevPts, *nextPts, *status, *err);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n\t}\n}\n\nOpenCVResult CalcOpticalFlowPyrLKWithParams(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err, Size winSize, int maxLevel, TermCriteria criteria, int flags, double minEigThreshold){\n    try {\n\t\tcv::Size sz(winSize.width, winSize.height);\n\t\tcv::calcOpticalFlowPyrLK(*prevImg, *nextImg, *prevPts, *nextPts, *status, *err, sz, maxLevel, *criteria, flags, minEigThreshold);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\ndouble FindTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType, TermCriteria criteria, Mat inputMask, int gaussFiltSize){\n    try {\n\t\treturn cv::findTransformECC(*templateImage, *inputImage, *warpMatrix, motionType, *criteria, *inputMask, gaussFiltSize);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0.0;\n\t}\n}\n\nbool Tracker_Init(Tracker self, Mat image, Rect boundingBox) {\n    try {\n\t\tcv::Rect bb(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height);\n\n\t\t(*self)->init(*image, bb);\n\t\treturn true;\n\t} catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n\t}\n}\n\nbool Tracker_Update(Tracker self, Mat image, Rect* boundingBox) {\n    try {\n\t\tcv::Rect bb;\n\t\tbool ret = (*self)->update(*image, bb);\n\t\tboundingBox->x = int(bb.x);\n\t\tboundingBox->y = int(bb.y);\n\t\tboundingBox->width = int(bb.width);\n\t\tboundingBox->height = int(bb.height);\n\t\treturn ret;\n\t} catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n\t}\n}\n\nTrackerMIL TrackerMIL_Create() {\n    try {\n\t\treturn new cv::Ptr<cv::TrackerMIL>(cv::TrackerMIL::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nvoid TrackerMIL_Close(TrackerMIL self) {\n    delete self;\n}\n\nTrackerGOTURN TrackerGOTURN_Create(void){\n    try {\n\t\treturn new cv::Ptr<cv::TrackerGOTURN>(cv::TrackerGOTURN::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nTrackerGOTURN TrackerGOTURN_CreateWithParams(const char* modelBin, const char* modelTxt){\n    try {\n\t\tcv::TrackerGOTURN::Params params;\n\t\tparams.modelBin = modelBin;\n\t\tparams.modelTxt = modelTxt;\n\t  \n\t\treturn new cv::Ptr<cv::TrackerGOTURN>(cv::TrackerGOTURN::create(params));\n\t} catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\n\nvoid TrackerGOTURN_Close(TrackerGOTURN tr) {\n    delete tr;\n}\n\nTrackerVit TrackerVit_Create() {\n    try {\n\t\treturn new cv::Ptr<cv::TrackerVit>(cv::TrackerVit::create());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nTrackerVit TrackerVit_CreateWithParams(const char* model){\n    try {\n\t\tcv::TrackerVit::Params params;\n\t\tparams.net = model;\n\t  \n\t\treturn new cv::Ptr<cv::TrackerVit>(cv::TrackerVit::create(params));\n\t} catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nvoid TrackerVit_Close(TrackerVit self) {\n    delete self;\n}\n\nKalmanFilter KalmanFilter_New(int dynamParams, int measureParams) {\n    try {\n\t\treturn new cv::KalmanFilter(dynamParams, measureParams, 0, CV_32F);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nKalmanFilter KalmanFilter_NewWithParams(int dynamParams, int measureParams, int controlParams, int type) {\n    try {\n\t\treturn new cv::KalmanFilter(dynamParams, measureParams, controlParams, type);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nOpenCVResult KalmanFilter_Init(KalmanFilter kf, int dynamParams, int measureParams) {\n    try {\n\t\tkf->init(dynamParams, measureParams, 0, CV_32F);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\nOpenCVResult KalmanFilter_InitWithParams(KalmanFilter kf, int dynamParams, int measureParams, int controlParams, int type) {\n    try {\n\t\tkf->init(dynamParams, measureParams, controlParams, type);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n  \t}\n}\n\nvoid KalmanFilter_Close(KalmanFilter kf) {\n    delete kf;\n}\n\nMat KalmanFilter_Predict(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->predict());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_PredictWithParams(KalmanFilter kf, Mat control) {\n    try {\n\t\treturn new cv::Mat(kf->predict(*control));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_Correct(KalmanFilter kf, Mat measurement) {\n    try {\n\t\treturn new cv::Mat(kf->correct(*measurement));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetStatePre(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->statePre);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetStatePost(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->statePost);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTransitionMatrix(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->transitionMatrix);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetControlMatrix(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->controlMatrix);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetMeasurementMatrix(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->measurementMatrix);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetProcessNoiseCov(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->processNoiseCov);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetMeasurementNoiseCov(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->measurementNoiseCov);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetErrorCovPre(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->errorCovPre);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetGain(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->gain);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetErrorCovPost(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->errorCovPost);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTemp1(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->temp1);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTemp2(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->temp2);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTemp3(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->temp3);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTemp4(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->temp4);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nMat KalmanFilter_GetTemp5(KalmanFilter kf) {\n    try {\n\t\treturn new cv::Mat(kf->temp5);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn new cv::Mat();\n    }\n}\n\nvoid KalmanFilter_SetStatePre(KalmanFilter kf, Mat statePre) {\n  \tkf->statePre = *statePre;\n}\n\nvoid KalmanFilter_SetStatePost(KalmanFilter kf, Mat statePost) {\n  \tkf->statePost = *statePost;\n}\n\nvoid KalmanFilter_SetTransitionMatrix(KalmanFilter kf, Mat transitionMatrix) {\n  \tkf->transitionMatrix = *transitionMatrix;\n}\n\nvoid KalmanFilter_SetControlMatrix(KalmanFilter kf, Mat controlMatrix) {\n  \tkf->controlMatrix = *controlMatrix;\n}\n\nvoid KalmanFilter_SetMeasurementMatrix(KalmanFilter kf, Mat measurementMatrix) {\n  \tkf->measurementMatrix = *measurementMatrix;\n}\n\nvoid KalmanFilter_SetProcessNoiseCov(KalmanFilter kf, Mat processNoiseCov) {\n  \tkf->processNoiseCov = *processNoiseCov;\n}\n\nvoid KalmanFilter_SetMeasurementNoiseCov(KalmanFilter kf, Mat measurementNoiseCov) {\n  \tkf->measurementNoiseCov = *measurementNoiseCov;\n}\n\nvoid KalmanFilter_SetErrorCovPre(KalmanFilter kf, Mat errorCovPre) {\n  \tkf->errorCovPre = *errorCovPre;\n}\n\nvoid KalmanFilter_SetGain(KalmanFilter kf, Mat gain) {\n  \tkf->gain = *gain;\n}\n\nvoid KalmanFilter_SetErrorCovPost(KalmanFilter kf, Mat errorCovPost) {\n  \tkf->errorCovPost = *errorCovPost;\n}\n"
  },
  {
    "path": "video.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_video)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"video.h\"\n*/\nimport \"C\"\nimport (\n\t\"image\"\n\t\"unsafe\"\n)\n\n/*\n*\n\n\tcv::OPTFLOW_USE_INITIAL_FLOW = 4,\n\tcv::OPTFLOW_LK_GET_MIN_EIGENVALS = 8,\n\tcv::OPTFLOW_FARNEBACK_GAUSSIAN = 256\n\tFor further details, please see: https://docs.opencv.org/master/dc/d6b/group__video__track.html#gga2c6cc144c9eee043575d5b311ac8af08a9d4430ac75199af0cf6fcdefba30eafe\n*/\nconst (\n\tOptflowUseInitialFlow    = 4\n\tOptflowLkGetMinEigenvals = 8\n\tOptflowFarnebackGaussian = 256\n)\n\n/*\n*\n\n\tcv::MOTION_TRANSLATION = 0,\n\tcv::MOTION_EUCLIDEAN = 1,\n\tcv::MOTION_AFFINE = 2,\n\tcv::MOTION_HOMOGRAPHY = 3\n\tFor further details, please see: https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ggaaedb1f94e6b143cef163622c531afd88a01106d6d20122b782ff25eaeffe9a5be\n*/\nconst (\n\tMotionTranslation = 0\n\tMotionEuclidean   = 1\n\tMotionAffine      = 2\n\tMotionHomography  = 3\n)\n\n// BackgroundSubtractorMOG2 is a wrapper around the cv::BackgroundSubtractorMOG2.\ntype BackgroundSubtractorMOG2 struct {\n\t// C.BackgroundSubtractorMOG2\n\tp unsafe.Pointer\n}\n\n// NewBackgroundSubtractorMOG2 returns a new BackgroundSubtractor algorithm\n// of type MOG2. MOG2 is a Gaussian Mixture-based Background/Foreground\n// Segmentation Algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/de1/group__video__motion.html#ga2beb2dee7a073809ccec60f145b6b29c\n// https://docs.opencv.org/master/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html\nfunc NewBackgroundSubtractorMOG2() BackgroundSubtractorMOG2 {\n\treturn BackgroundSubtractorMOG2{p: unsafe.Pointer(C.BackgroundSubtractorMOG2_Create())}\n}\n\n// NewBackgroundSubtractorMOG2WithParams returns a new BackgroundSubtractor algorithm\n// of type MOG2 with customized parameters. MOG2 is a Gaussian Mixture-based Background/Foreground\n// Segmentation Algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/de1/group__video__motion.html#ga2beb2dee7a073809ccec60f145b6b29c\n// https://docs.opencv.org/master/d7/d7b/classcv_1_1BackgroundSubtractorMOG2.html\nfunc NewBackgroundSubtractorMOG2WithParams(history int, varThreshold float64, detectShadows bool) BackgroundSubtractorMOG2 {\n\treturn BackgroundSubtractorMOG2{p: unsafe.Pointer(C.BackgroundSubtractorMOG2_CreateWithParams(C.int(history), C.double(varThreshold), C.bool(detectShadows)))}\n}\n\n// Close BackgroundSubtractorMOG2.\nfunc (b *BackgroundSubtractorMOG2) Close() error {\n\tC.BackgroundSubtractorMOG2_Close((C.BackgroundSubtractorMOG2)(b.p))\n\tb.p = nil\n\treturn nil\n}\n\n// Apply computes a foreground mask using the current BackgroundSubtractorMOG2.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21\nfunc (b *BackgroundSubtractorMOG2) Apply(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.BackgroundSubtractorMOG2_Apply((C.BackgroundSubtractorMOG2)(b.p), src.p, dst.p))\n}\n\nfunc (b *BackgroundSubtractorMOG2) ApplyWithLearningRate(src Mat, dst *Mat, learningRate float64) error {\n\treturn OpenCVResult(C.BackgroundSubtractorMOG2_ApplyWithParams((C.BackgroundSubtractorMOG2)(b.p), src.p, dst.p, C.double(learningRate)))\n}\n\n// BackgroundSubtractorKNN is a wrapper around the cv::BackgroundSubtractorKNN.\ntype BackgroundSubtractorKNN struct {\n\t// C.BackgroundSubtractorKNN\n\tp unsafe.Pointer\n}\n\n// NewBackgroundSubtractorKNN returns a new BackgroundSubtractor algorithm\n// of type KNN. K-Nearest Neighbors (KNN) uses a Background/Foreground\n// Segmentation Algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/de1/group__video__motion.html#gac9be925771f805b6fdb614ec2292006d\n// https://docs.opencv.org/master/db/d88/classcv_1_1BackgroundSubtractorKNN.html\nfunc NewBackgroundSubtractorKNN() BackgroundSubtractorKNN {\n\treturn BackgroundSubtractorKNN{p: unsafe.Pointer(C.BackgroundSubtractorKNN_Create())}\n}\n\n// NewBackgroundSubtractorKNNWithParams returns a new BackgroundSubtractor algorithm\n// of type KNN with customized parameters. K-Nearest Neighbors (KNN) uses a Background/Foreground\n// Segmentation Algorithm\n//\n// For further details, please see:\n// https://docs.opencv.org/master/de/de1/group__video__motion.html#gac9be925771f805b6fdb614ec2292006d\n// https://docs.opencv.org/master/db/d88/classcv_1_1BackgroundSubtractorKNN.html\nfunc NewBackgroundSubtractorKNNWithParams(history int, dist2Threshold float64, detectShadows bool) BackgroundSubtractorKNN {\n\treturn BackgroundSubtractorKNN{p: unsafe.Pointer(C.BackgroundSubtractorKNN_CreateWithParams(C.int(history), C.double(dist2Threshold), C.bool(detectShadows)))}\n}\n\n// Close BackgroundSubtractorKNN.\nfunc (k *BackgroundSubtractorKNN) Close() error {\n\tC.BackgroundSubtractorKNN_Close((C.BackgroundSubtractorKNN)(k.p))\n\tk.p = nil\n\treturn nil\n}\n\n// Apply computes a foreground mask using the current BackgroundSubtractorKNN.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d7/df6/classcv_1_1BackgroundSubtractor.html#aa735e76f7069b3fa9c3f32395f9ccd21\nfunc (k *BackgroundSubtractorKNN) Apply(src Mat, dst *Mat) error {\n\treturn OpenCVResult(C.BackgroundSubtractorKNN_Apply((C.BackgroundSubtractorKNN)(k.p), src.p, dst.p))\n}\n\n// CalcOpticalFlowFarneback computes a dense optical flow using\n// Gunnar Farneback's algorithm.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d6b/group__video__track.html#ga5d10ebbd59fe09c5f650289ec0ece5af\nfunc CalcOpticalFlowFarneback(prevImg Mat, nextImg Mat, flow *Mat, pyrScale float64, levels int, winsize int,\n\titerations int, polyN int, polySigma float64, flags int) error {\n\treturn OpenCVResult(C.CalcOpticalFlowFarneback(prevImg.p, nextImg.p, flow.p, C.double(pyrScale), C.int(levels), C.int(winsize),\n\t\tC.int(iterations), C.int(polyN), C.double(polySigma), C.int(flags)))\n}\n\n// CalcOpticalFlowPyrLK calculates an optical flow for a sparse feature set using\n// the iterative Lucas-Kanade method with pyramids.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323\nfunc CalcOpticalFlowPyrLK(prevImg Mat, nextImg Mat, prevPts Mat, nextPts Mat, status *Mat, err *Mat) error {\n\treturn OpenCVResult(C.CalcOpticalFlowPyrLK(prevImg.p, nextImg.p, prevPts.p, nextPts.p, status.p, err.p))\n}\n\n// CalcOpticalFlowPyrLKWithParams calculates an optical flow for a sparse feature set using\n// the iterative Lucas-Kanade method with pyramids.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/dc/d6b/group__video__track.html#ga473e4b886d0bcc6b65831eb88ed93323\nfunc CalcOpticalFlowPyrLKWithParams(prevImg Mat, nextImg Mat, prevPts Mat, nextPts Mat, status *Mat, err *Mat,\n\twinSize image.Point, maxLevel int, criteria TermCriteria, flags int, minEigThreshold float64) error {\n\twinSz := C.struct_Size{\n\t\twidth:  C.int(winSize.X),\n\t\theight: C.int(winSize.Y),\n\t}\n\treturn OpenCVResult(C.CalcOpticalFlowPyrLKWithParams(prevImg.p, nextImg.p, prevPts.p, nextPts.p, status.p, err.p, winSz, C.int(maxLevel), criteria.p, C.int(flags), C.double(minEigThreshold)))\n}\n\n// FindTransformECC finds the geometric transform (warp) between two images in terms of the ECC criterion.\n//\n// For futther details, please see:\n// https://docs.opencv.org/4.x/dc/d6b/group__video__track.html#ga1aa357007eaec11e9ed03500ecbcbe47\nfunc FindTransformECC(templateImage Mat, inputImage Mat, warpMatrix *Mat, motionType int, criteria TermCriteria, inputMask Mat, gaussFiltSize int) float64 {\n\treturn float64(C.FindTransformECC(templateImage.p, inputImage.p, warpMatrix.p, C.int(motionType), criteria.p, inputMask.p, C.int(gaussFiltSize)))\n}\n\n// Tracker is the base interface for object tracking.\n//\n// see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html\ntype Tracker interface {\n\t// Close closes, as Trackers need to be Closed manually.\n\t//\n\tClose() error\n\n\t// Init initializes the tracker with a known bounding box that surrounded the target.\n\t// Note: this can only be called once. If you lose the object, you have to Close() the instance,\n\t// create a new one, and call Init() on it again.\n\t//\n\t// see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a4d285747589b1bdd16d2e4f00c3255dc\n\t//\n\tInit(image Mat, boundingBox image.Rectangle) bool\n\n\t// Update updates the tracker, returns a new bounding box and a boolean determining whether the tracker lost the target.\n\t//\n\t// see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a549159bd0553e6a8de356f3866df1f18\n\t//\n\tUpdate(image Mat) (image.Rectangle, bool)\n}\n\nfunc trackerInit(trk C.Tracker, img Mat, boundingBox image.Rectangle) bool {\n\tcBox := C.struct_Rect{\n\t\tx:      C.int(boundingBox.Min.X),\n\t\ty:      C.int(boundingBox.Min.Y),\n\t\twidth:  C.int(boundingBox.Size().X),\n\t\theight: C.int(boundingBox.Size().Y),\n\t}\n\n\tret := C.Tracker_Init(trk, C.Mat(img.Ptr()), cBox)\n\treturn bool(ret)\n}\n\nfunc trackerUpdate(trk C.Tracker, img Mat) (image.Rectangle, bool) {\n\tcBox := C.struct_Rect{}\n\n\tret := C.Tracker_Update(trk, C.Mat(img.Ptr()), &cBox)\n\n\trect := image.Rect(int(cBox.x), int(cBox.y), int(cBox.x+cBox.width), int(cBox.y+cBox.height))\n\treturn rect, bool(ret)\n}\n\n// TrackerMIL is a Tracker that uses the MIL algorithm. MIL trains a classifier in an online manner\n// to separate the object from the background.\n// Multiple Instance Learning avoids the drift problem for a robust tracking.\n//\n// For further details, please see:\n// https://docs.opencv.org/master/d0/d26/classcv_1_1TrackerMIL.html\ntype TrackerMIL struct {\n\tp C.TrackerMIL\n}\n\n// NewTrackerMIL returns a new TrackerMIL.\nfunc NewTrackerMIL() Tracker {\n\treturn TrackerMIL{p: C.TrackerMIL_Create()}\n}\n\n// Close closes the TrackerMIL.\nfunc (trk TrackerMIL) Close() error {\n\tC.TrackerMIL_Close(trk.p)\n\ttrk.p = nil\n\treturn nil\n}\n\n// Init initializes the TrackerMIL.\nfunc (trk TrackerMIL) Init(img Mat, boundingBox image.Rectangle) bool {\n\treturn trackerInit(C.Tracker(trk.p), img, boundingBox)\n}\n\n// Update updates the TrackerMIL.\nfunc (trk TrackerMIL) Update(img Mat) (image.Rectangle, bool) {\n\treturn trackerUpdate(C.Tracker(trk.p), img)\n}\n\ntype TrackerGOTURN struct {\n\tp C.TrackerGOTURN\n}\n\n// NewTrackerGOTURN the GOTURN (Generic Object Tracking Using Regression Networks) tracker\n// GOTURN ([122]) is kind of trackers based on Convolutional Neural Networks (CNN).\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/d4c/classcv_1_1TrackerGOTURN.html#details\nfunc NewTrackerGOTURN() TrackerGOTURN {\n\treturn TrackerGOTURN{p: C.TrackerGOTURN_Create()}\n}\n\n// NewTrackerGOTURNWithParams the GOTURN (Generic Object Tracking Using Regression Networks) tracker\n// GOTURN ([122]) is kind of trackers based on Convolutional Neural Networks (CNN).\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d7/d4c/classcv_1_1TrackerGOTURN.html#details\nfunc NewTrackerGOTURNWithParams(modelBin string, modelTxt string) TrackerGOTURN {\n\tc_modelBin := C.CString(modelBin)\n\tc_modelTxt := C.CString(modelTxt)\n\tdefer C.free(unsafe.Pointer(c_modelBin))\n\tdefer C.free(unsafe.Pointer(c_modelTxt))\n\n\treturn TrackerGOTURN{p: C.TrackerGOTURN_CreateWithParams(c_modelBin, c_modelTxt)}\n}\n\n// Init initializes the tracker with a known bounding box that surrounded the target.\n// Note: this can only be called once. If you lose the object, you have to Close() the instance,\n// create a new one, and call Init() on it again.\n//\n// see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a4d285747589b1bdd16d2e4f00c3255dc\nfunc (t TrackerGOTURN) Init(mat Mat, boundingBox image.Rectangle) bool {\n\treturn trackerInit(C.Tracker(t.p), mat, boundingBox)\n}\n\n// Update updates the tracker, returns a new bounding box and a boolean determining whether the tracker lost the target.\n//\n// see: https://docs.opencv.org/master/d0/d0a/classcv_1_1Tracker.html#a549159bd0553e6a8de356f3866df1f18\nfunc (t TrackerGOTURN) Update(mat Mat) (image.Rectangle, bool) {\n\treturn trackerUpdate(C.Tracker(t.p), mat)\n\n}\n\nfunc (t TrackerGOTURN) Close() error {\n\tC.TrackerGOTURN_Close(t.p)\n\tt.p = nil\n\treturn nil\n\n}\n\n// TrackerVit is a Tracker using the Vit tracker, a super lightweight dnn-based general object tracking.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d9/d26/classcv_1_1TrackerVit.html\ntype TrackerVit struct {\n\tp C.TrackerVit\n}\n\n// NewTrackerVit returns a new TrackerVit.\nfunc NewTrackerVit() Tracker {\n\treturn TrackerVit{p: C.TrackerVit_Create()}\n}\n\nfunc NewTrackerVitWithParams(model string) TrackerVit {\n\tc_model := C.CString(model)\n\tdefer C.free(unsafe.Pointer(c_model))\n\n\treturn TrackerVit{p: C.TrackerVit_CreateWithParams(c_model)}\n}\n\n// Close closes the TrackerMIL.\nfunc (trk TrackerVit) Close() error {\n\tC.TrackerVit_Close(trk.p)\n\ttrk.p = nil\n\treturn nil\n}\n\n// Init initializes the TrackerVIT.\nfunc (trk TrackerVit) Init(img Mat, boundingBox image.Rectangle) bool {\n\treturn trackerInit(C.Tracker(trk.p), img, boundingBox)\n}\n\n// Update updates the TrackerVIT.\nfunc (trk TrackerVit) Update(img Mat) (image.Rectangle, bool) {\n\treturn trackerUpdate(C.Tracker(trk.p), img)\n}\n\n// KalmanFilter implements a standard Kalman filter http://en.wikipedia.org/wiki/Kalman_filter.\n// However, you can modify transitionMatrix, controlMatrix, and measurementMatrix\n// to get an extended Kalman filter functionality.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html\ntype KalmanFilter struct {\n\tp C.KalmanFilter\n}\n\n// NewKalmanFilter returns a new KalmanFilter.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#ac0799f0611baee9e7e558f016e4a7b40\nfunc NewKalmanFilter(dynamParams int, measureParams int) KalmanFilter {\n\treturn KalmanFilter{p: C.KalmanFilter_New(C.int(dynamParams), C.int(measureParams))}\n}\n\n// NewKalmanFilterWithParams returns a new KalmanFilter.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#abac82ecfa530611a163255bc7d91c088\nfunc NewKalmanFilterWithParams(dynamParams int, measureParams int, controlParams int, matType MatType) KalmanFilter {\n\treturn KalmanFilter{p: C.KalmanFilter_NewWithParams(C.int(dynamParams), C.int(measureParams), C.int(controlParams), C.int(matType))}\n}\n\n// Init re-initializes the Kalman filter. The previous content is destroyed.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a4f136c39c016d3530c7c5801dd1ddb3b\nfunc (kf *KalmanFilter) Init(dynamParams int, measureParams int) error {\n\treturn OpenCVResult(C.KalmanFilter_Init(kf.p, C.int(dynamParams), C.int(measureParams)))\n}\n\n// Predict computes a predicted state.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#aa710d2255566bec8d6ce608d103d4fa7\nfunc (kf *KalmanFilter) Predict() Mat {\n\treturn newMat(C.KalmanFilter_Predict(kf.p))\n}\n\n// PredictWithParams computes a predicted state.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#aa710d2255566bec8d6ce608d103d4fa7\nfunc (kf *KalmanFilter) PredictWithParams(control Mat) Mat {\n\treturn newMat(C.KalmanFilter_PredictWithParams(kf.p, control.p))\n}\n\n// Correct the predicted state from the measurement.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a60eb7feb569222ad0657ef1875884b5e\nfunc (kf *KalmanFilter) Correct(measurement Mat) Mat {\n\treturn newMat(C.KalmanFilter_Correct(kf.p, measurement.p))\n}\n\n// Close closes the kalman filter.\nfunc (kf *KalmanFilter) Close() {\n\tC.KalmanFilter_Close(kf.p)\n\tkf.p = nil\n}\n\n// GetStatePre returns the Kalman filter's statePre Mat.\n//\n// predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a60eb7feb569222ad0657ef1875884b5e\nfunc (kf *KalmanFilter) GetStatePre() Mat {\n\treturn newMat(C.KalmanFilter_GetStatePre(kf.p))\n}\n\n// GetStatePost returns the Kalman filter's statePost Mat.\n//\n// corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#add8fb5ac9c04b4600b679698dcb0447d\nfunc (kf *KalmanFilter) GetStatePost() Mat {\n\treturn newMat(C.KalmanFilter_GetStatePost(kf.p))\n}\n\n// GetTransitionMatrix returns the Kalman filter's transitionMatrix Mat.\n//\n// state transition matrix (A)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a0657173e411acbf40d2d3c6b46e03b19\nfunc (kf *KalmanFilter) GetTransitionMatrix() Mat {\n\treturn newMat(C.KalmanFilter_GetTransitionMatrix(kf.p))\n}\n\n// GetControlMatrix returns the Kalman filter's controlMatrix Mat.\n//\n// control matrix (B) (not used if there is no control)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a6486e7287114810636fb33953280ed52\nfunc (kf *KalmanFilter) GetControlMatrix() Mat {\n\treturn newMat(C.KalmanFilter_GetControlMatrix(kf.p))\n}\n\n// GetMeasurementMatrix returns the Kalman filter's measurementMatrix Mat.\n//\n// measurement matrix (H)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a0f60b78726d8eccf74a1f2479c2d1f97\nfunc (kf *KalmanFilter) GetMeasurementMatrix() Mat {\n\treturn newMat(C.KalmanFilter_GetMeasurementMatrix(kf.p))\n}\n\n// GetProcessNoiseCov returns the Kalman filter's processNoiseCov Mat.\n//\n// process noise covariance matrix (Q)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#af19be9c0630d0f658bdbaea409a35cda\nfunc (kf *KalmanFilter) GetProcessNoiseCov() Mat {\n\treturn newMat(C.KalmanFilter_GetProcessNoiseCov(kf.p))\n}\n\n// GetMeasurementNoiseCov returns the Kalman filter's measurementNoiseCov Mat.\n//\n// measurement noise covariance matrix (R)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a828d051035ba807966ad65edf288a08e\nfunc (kf *KalmanFilter) GetMeasurementNoiseCov() Mat {\n\treturn newMat(C.KalmanFilter_GetMeasurementNoiseCov(kf.p))\n}\n\n// GetErrorCovPre returns the Kalman filter's errorCovPre Mat.\n//\n// priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#ae1bd3a86f10753d723e7174d570d9ac1\nfunc (kf *KalmanFilter) GetErrorCovPre() Mat {\n\treturn newMat(C.KalmanFilter_GetErrorCovPre(kf.p))\n}\n\n// GetGain returns the Kalman filter's gain Mat.\n//\n// Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a077d73eb075b00779dc009a9057c27c3\nfunc (kf *KalmanFilter) GetGain() Mat {\n\treturn newMat(C.KalmanFilter_GetGain(kf.p))\n}\n\n// GetErrorCovPost returns the Kalman filter's errorCovPost Mat.\n//\n// posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a446d8e9a0105b0aa35cd66119c529803\nfunc (kf *KalmanFilter) GetErrorCovPost() Mat {\n\treturn newMat(C.KalmanFilter_GetErrorCovPost(kf.p))\n}\n\n// GetTemp1 returns the Kalman filter's temp1 Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#aa3d064a9194c2815dbe19c056b6dc763\nfunc (kf *KalmanFilter) GetTemp1() Mat {\n\treturn newMat(C.KalmanFilter_GetTemp1(kf.p))\n}\n\n// GetTemp2 returns the Kalman filter's temp2 Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a14866bd506668eb0ed57b3974b3a1ee7\nfunc (kf *KalmanFilter) GetTemp2() Mat {\n\treturn newMat(C.KalmanFilter_GetTemp2(kf.p))\n}\n\n// GetTemp3 returns the Kalman filter's temp3 Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#afdbe36066a7d7f560aa02abe6be114d8\nfunc (kf *KalmanFilter) GetTemp3() Mat {\n\treturn newMat(C.KalmanFilter_GetTemp3(kf.p))\n}\n\n// GetTemp4 returns the Kalman filter's temp4 Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a84342f2d9dec1e6389025ad229401809\nfunc (kf *KalmanFilter) GetTemp4() Mat {\n\treturn newMat(C.KalmanFilter_GetTemp4(kf.p))\n}\n\n// GetTemp5 returns the Kalman filter's temp5 Mat.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.6.0/dd/d6a/classcv_1_1KalmanFilter.html#a846c2a6222c6e5d8b1385dfbccc83ae0\nfunc (kf *KalmanFilter) GetTemp5() Mat {\n\treturn newMat(C.KalmanFilter_GetTemp5(kf.p))\n}\n\n// SetStatePre sets the Kalman filter's statePre Mat.\nfunc (kf *KalmanFilter) SetStatePre(statePre Mat) {\n\tC.KalmanFilter_SetStatePre(kf.p, statePre.p)\n}\n\n// SetStatePost sets the Kalman filter's statePost Mat.\nfunc (kf *KalmanFilter) SetStatePost(statePost Mat) {\n\tC.KalmanFilter_SetStatePost(kf.p, statePost.p)\n}\n\n// SetTransitionMatrix sets the Kalman filter's transitionMatrix Mat.\nfunc (kf *KalmanFilter) SetTransitionMatrix(transitionMatrix Mat) {\n\tC.KalmanFilter_SetTransitionMatrix(kf.p, transitionMatrix.p)\n}\n\n// SetControlMatrix sets the Kalman filter's controlMatrix Mat.\nfunc (kf *KalmanFilter) SetControlMatrix(controlMatrix Mat) {\n\tC.KalmanFilter_SetControlMatrix(kf.p, controlMatrix.p)\n}\n\n// SetMeasurementMatrix sets the Kalman filter's measurementMatrix Mat.\nfunc (kf *KalmanFilter) SetMeasurementMatrix(measurementMatrix Mat) {\n\tC.KalmanFilter_SetMeasurementMatrix(kf.p, measurementMatrix.p)\n}\n\n// SetProcessNoiseCov sets the Kalman filter's processNoiseCov Mat.\nfunc (kf *KalmanFilter) SetProcessNoiseCov(processNoiseCov Mat) {\n\tC.KalmanFilter_SetProcessNoiseCov(kf.p, processNoiseCov.p)\n}\n\n// SetMeasurementNoiseCov sets the Kalman filter's measurementNoiseCov Mat.\nfunc (kf *KalmanFilter) SetMeasurementNoiseCov(measurementNoiseCov Mat) {\n\tC.KalmanFilter_SetMeasurementNoiseCov(kf.p, measurementNoiseCov.p)\n}\n\n// SetErrorCovPre sets the Kalman filter's errorCovPre Mat.\nfunc (kf *KalmanFilter) SetErrorCovPre(errorCovPre Mat) {\n\tC.KalmanFilter_SetErrorCovPre(kf.p, errorCovPre.p)\n}\n\n// SetGain sets the Kalman filter's gain Mat.\nfunc (kf *KalmanFilter) SetGain(gain Mat) {\n\tC.KalmanFilter_SetGain(kf.p, gain.p)\n}\n\n// SetErrorCovPost sets the Kalman filter's errorCovPost Mat.\nfunc (kf *KalmanFilter) SetErrorCovPost(errorCovPost Mat) {\n\tC.KalmanFilter_SetErrorCovPost(kf.p, errorCovPost.p)\n}\n"
  },
  {
    "path": "video.h",
    "content": "#ifndef _OPENCV3_VIDEO_H_\n#define _OPENCV3_VIDEO_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/video.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::Ptr<cv::BackgroundSubtractorMOG2>* BackgroundSubtractorMOG2;\ntypedef cv::Ptr<cv::BackgroundSubtractorKNN>* BackgroundSubtractorKNN;\ntypedef cv::Ptr<cv::Tracker>* Tracker;\ntypedef cv::Ptr<cv::TrackerMIL>* TrackerMIL;\ntypedef cv::Ptr<cv::TrackerGOTURN>* TrackerGOTURN;\ntypedef cv::Ptr<cv::TrackerVit>* TrackerVit;\ntypedef cv::KalmanFilter* KalmanFilter;\n#else\ntypedef void* BackgroundSubtractorMOG2;\ntypedef void* BackgroundSubtractorKNN;\ntypedef void* Tracker;\ntypedef void* TrackerMIL;\ntypedef void* TrackerGOTURN;\ntypedef void* TrackerVit;\ntypedef void* KalmanFilter;\n#endif\n\nBackgroundSubtractorMOG2 BackgroundSubtractorMOG2_Create();\nBackgroundSubtractorMOG2 BackgroundSubtractorMOG2_CreateWithParams(int history, double varThreshold, bool detectShadows);\nvoid BackgroundSubtractorMOG2_Close(BackgroundSubtractorMOG2 b);\nOpenCVResult BackgroundSubtractorMOG2_Apply(BackgroundSubtractorMOG2 b, Mat src, Mat dst);\nOpenCVResult BackgroundSubtractorMOG2_ApplyWithParams(BackgroundSubtractorMOG2 b, Mat src, Mat dst, double learningRate);\n\nBackgroundSubtractorKNN BackgroundSubtractorKNN_Create();\nBackgroundSubtractorKNN BackgroundSubtractorKNN_CreateWithParams(int history, double dist2Threshold, bool detectShadows);\n\nvoid BackgroundSubtractorKNN_Close(BackgroundSubtractorKNN b);\nOpenCVResult BackgroundSubtractorKNN_Apply(BackgroundSubtractorKNN b, Mat src, Mat dst);\n\nOpenCVResult CalcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err);\nOpenCVResult CalcOpticalFlowPyrLKWithParams(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err, Size winSize, int maxLevel, TermCriteria criteria, int flags, double minEigThreshold);\nOpenCVResult CalcOpticalFlowFarneback(Mat prevImg, Mat nextImg, Mat flow, double pyrScale, int levels,\n                              int winsize, int iterations, int polyN, double polySigma, int flags);\n\ndouble FindTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType, TermCriteria criteria, Mat inputMask, int gaussFiltSize);\n\nbool Tracker_Init(Tracker self, Mat image, Rect boundingBox);\nbool Tracker_Update(Tracker self, Mat image, Rect* boundingBox);\n\nTrackerMIL TrackerMIL_Create();\nvoid TrackerMIL_Close(TrackerMIL self);\n\nTrackerGOTURN TrackerGOTURN_Create(void);\nTrackerGOTURN TrackerGOTURN_CreateWithParams(const char* modelBin, const char* modelTxt);\nvoid TrackerGOTURN_Close(TrackerGOTURN tr);\n\nTrackerVit TrackerVit_Create();\nTrackerVit TrackerVit_CreateWithParams(const char* model);\nvoid TrackerVit_Close(TrackerVit self);\n\nKalmanFilter KalmanFilter_New(int dynamParams, int measureParams);\nKalmanFilter KalmanFilter_NewWithParams(int dynamParams, int measureParams, int controlParams, int type);\nvoid KalmanFilter_Close(KalmanFilter kf);\n\nOpenCVResult KalmanFilter_Init(KalmanFilter kf, int dynamParams, int measureParams);\nOpenCVResult KalmanFilter_InitWithParams(KalmanFilter kf, int dynamParams, int measureParams, int controlParams, int type);\nMat KalmanFilter_Predict(KalmanFilter kf);\nMat KalmanFilter_PredictWithParams(KalmanFilter kf, Mat control);\nMat KalmanFilter_Correct(KalmanFilter kf, Mat measurement);\n\nMat KalmanFilter_GetStatePre(KalmanFilter kf);\nMat KalmanFilter_GetStatePost(KalmanFilter kf);\nMat KalmanFilter_GetTransitionMatrix(KalmanFilter kf);\nMat KalmanFilter_GetControlMatrix(KalmanFilter kf);\nMat KalmanFilter_GetMeasurementMatrix(KalmanFilter kf);\nMat KalmanFilter_GetProcessNoiseCov(KalmanFilter kf);\nMat KalmanFilter_GetMeasurementNoiseCov(KalmanFilter kf);\nMat KalmanFilter_GetErrorCovPre(KalmanFilter kf);\nMat KalmanFilter_GetGain(KalmanFilter kf);\nMat KalmanFilter_GetErrorCovPost(KalmanFilter kf);\nMat KalmanFilter_GetTemp1(KalmanFilter kf);\nMat KalmanFilter_GetTemp2(KalmanFilter kf);\nMat KalmanFilter_GetTemp3(KalmanFilter kf);\nMat KalmanFilter_GetTemp4(KalmanFilter kf);\nMat KalmanFilter_GetTemp5(KalmanFilter kf);\n\nvoid KalmanFilter_SetStatePre(KalmanFilter kf, Mat statePre);\nvoid KalmanFilter_SetStatePost(KalmanFilter kf, Mat statePost);\nvoid KalmanFilter_SetTransitionMatrix(KalmanFilter kf, Mat transitionMatrix);\nvoid KalmanFilter_SetControlMatrix(KalmanFilter kf, Mat controlMatrix);\nvoid KalmanFilter_SetMeasurementMatrix(KalmanFilter kf, Mat measurementMatrix);\nvoid KalmanFilter_SetProcessNoiseCov(KalmanFilter kf, Mat processNoiseCov);\nvoid KalmanFilter_SetMeasurementNoiseCov(KalmanFilter kf, Mat measurementNoiseCov);\nvoid KalmanFilter_SetErrorCovPre(KalmanFilter kf, Mat errorCovPre);\nvoid KalmanFilter_SetGain(KalmanFilter kf, Mat gain);\nvoid KalmanFilter_SetErrorCovPost(KalmanFilter kf, Mat errorCovPost);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_VIDEO_H_\n"
  },
  {
    "path": "video_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_video)\n\npackage gocv\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"math\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestMOG2(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tmog2.Apply(img, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestMOG2 test\")\n\t}\n}\n\nfunc TestMOG2ApplyWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2()\n\tdefer mog2.Close()\n\n\tmog2.ApplyWithLearningRate(img, &dst, 0.01)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestMOG2 test\")\n\t}\n}\n\nfunc TestMOG2WithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2WithParams(250, 8, false)\n\tdefer mog2.Close()\n\n\tmog2.Apply(img, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestMOG2WithParams test\")\n\t}\n}\n\nfunc TestMOG2WithParamsWithLR(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in MOG2 test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tmog2 := NewBackgroundSubtractorMOG2WithParams(250, 8, false)\n\tdefer mog2.Close()\n\n\tmog2.ApplyWithLearningRate(img, &dst, 0.0)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestMOG2WithParams test\")\n\t}\n}\n\nfunc TestKNN(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in KNN test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tknn := NewBackgroundSubtractorKNN()\n\tdefer knn.Close()\n\n\tknn.Apply(img, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestKNN test\")\n\t}\n}\n\nfunc TestKNNWithParams(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in KNN test\")\n\t}\n\tdefer img.Close()\n\n\tdst := NewMat()\n\tdefer dst.Close()\n\n\tknn := NewBackgroundSubtractorKNNWithParams(250, 200, false)\n\tdefer knn.Close()\n\n\tknn.Apply(img, &dst)\n\n\tif dst.Empty() {\n\t\tt.Error(\"Error in TestKNNWithParams test\")\n\t}\n}\n\nfunc TestCalcOpticalFlowFarneback(t *testing.T) {\n\timg1 := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img1.Empty() {\n\t\tt.Error(\"Invalid Mat in CalcOpticalFlowFarneback test\")\n\t}\n\tdefer img1.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tCvtColor(img1, &dest, ColorBGRAToGray)\n\n\timg2 := dest.Clone()\n\tdefer img2.Close()\n\n\tflow := NewMat()\n\tdefer flow.Close()\n\n\tCalcOpticalFlowFarneback(dest, img2, &flow, 0.4, 1, 12, 2, 8, 1.2, 0)\n\n\tif flow.Empty() {\n\t\tt.Error(\"Error in CalcOpticalFlowFarneback test\")\n\t}\n\tif flow.Rows() != 480 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowFarneback test rows: %v\", flow.Rows())\n\t}\n\tif flow.Cols() != 640 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowFarneback test cols: %v\", flow.Cols())\n\t}\n}\n\nfunc TestCalcOpticalFlowPyrLK(t *testing.T) {\n\timg1 := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img1.Empty() {\n\t\tt.Error(\"Invalid Mat in CalcOpticalFlowPyrLK test\")\n\t}\n\tdefer img1.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tCvtColor(img1, &dest, ColorBGRAToGray)\n\n\timg2 := dest.Clone()\n\tdefer img2.Close()\n\n\tprevPts := NewMat()\n\tdefer prevPts.Close()\n\n\tnextPts := NewMat()\n\tdefer nextPts.Close()\n\n\tstatus := NewMat()\n\tdefer status.Close()\n\n\terr := NewMat()\n\tdefer err.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tGoodFeaturesToTrack(dest, &corners, 500, 0.01, 10)\n\ttc := NewTermCriteria(Count|EPS, 20, 0.03)\n\tCornerSubPix(dest, &corners, image.Pt(10, 10), image.Pt(-1, -1), tc)\n\n\tCalcOpticalFlowPyrLK(dest, img2, corners, nextPts, &status, &err)\n\n\tif status.Empty() {\n\t\tt.Error(\"Error in CalcOpticalFlowPyrLK test\")\n\t}\n\tif status.Rows() != 323 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowPyrLK test rows: %v\", status.Rows())\n\t}\n\tif status.Cols() != 1 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowPyrLK test cols: %v\", status.Cols())\n\t}\n}\n\nfunc TestCalcOpticalFlowPyrLKWithParams(t *testing.T) {\n\timg1 := IMRead(\"images/face.jpg\", IMReadColor)\n\tif img1.Empty() {\n\t\tt.Error(\"Invalid Mat in CalcOpticalFlowPyrLK test\")\n\t}\n\tdefer img1.Close()\n\n\tdest := NewMat()\n\tdefer dest.Close()\n\n\tCvtColor(img1, &dest, ColorBGRAToGray)\n\n\timg2 := dest.Clone()\n\tdefer img2.Close()\n\n\tprevPts := NewMat()\n\tdefer prevPts.Close()\n\n\tnextPts := NewMat()\n\tdefer nextPts.Close()\n\n\tstatus := NewMat()\n\tdefer status.Close()\n\n\terr := NewMat()\n\tdefer err.Close()\n\n\tcorners := NewMat()\n\tdefer corners.Close()\n\n\tGoodFeaturesToTrack(dest, &corners, 500, 0.01, 10)\n\ttc := NewTermCriteria(Count|EPS, 30, 0.03)\n\tCornerSubPix(dest, &corners, image.Pt(10, 10), image.Pt(-1, -1), tc)\n\n\tCalcOpticalFlowPyrLKWithParams(dest, img2, corners, nextPts, &status, &err, image.Pt(21, 21), 3, tc, 0, 0.0001)\n\n\tif status.Empty() {\n\t\tt.Error(\"Error in CalcOpticalFlowPyrLK test\")\n\t}\n\tif status.Rows() != 323 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowPyrLK test rows: %v\", status.Rows())\n\t}\n\tif status.Cols() != 1 {\n\t\tt.Errorf(\"Invalid CalcOpticalFlowPyrLK test cols: %v\", status.Cols())\n\t}\n}\n\nfunc computeRMS(mat1 Mat, mat2 Mat) float64 {\n\tvar rms float64\n\tfor y := 0; y < mat1.Rows(); y++ {\n\t\tfor x := 0; x < mat1.Cols(); x++ {\n\t\t\tdiff := float64(mat1.GetFloatAt(y, x) - mat2.GetFloatAt(y, x))\n\t\t\trms += diff * diff\n\t\t}\n\t}\n\n\trms /= float64(mat1.Rows() * mat1.Cols())\n\treturn math.Sqrt(rms)\n}\n\nfunc TestFindTransformECC(t *testing.T) {\n\timg := IMRead(\"images/face.jpg\", IMReadGrayScale)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid Mat in FindTransformECC test\")\n\t}\n\tdefer img.Close()\n\ttestImg := NewMat()\n\tdefer testImg.Close()\n\tResize(img, &testImg, image.Point{216, 216}, 0, 0, InterpolationLinear)\n\n\ttranslationGround := Eye(2, 3, MatTypeCV32F)\n\tdefer translationGround.Close()\n\ttranslationGround.SetFloatAt(0, 2, 11.4159)\n\ttranslationGround.SetFloatAt(1, 2, 17.1828)\n\n\twarpedImage := NewMat()\n\tdefer warpedImage.Close()\n\tWarpAffineWithParams(testImg, &warpedImage, translationGround, image.Point{200, 200}, InterpolationLinear+WarpInverseMap, BorderConstant, color.RGBA{})\n\n\tmapTranslation := Eye(2, 3, MatTypeCV32F)\n\tdefer mapTranslation.Close()\n\teecIterations := 50\n\t// Negative value means that ECC_Iterations will be executed.\n\tvar eecEpsilon float64 = -1\n\tcriteria := NewTermCriteria(Count+EPS, eecIterations, eecEpsilon)\n\tinputMask := NewMat()\n\tdefer inputMask.Close()\n\tgaussFiltSize := 5\n\tFindTransformECC(warpedImage, testImg, &mapTranslation, MotionTranslation, criteria, inputMask, gaussFiltSize)\n\n\tmaxRMSECC := 0.1\n\trms := computeRMS(mapTranslation, translationGround)\n\tif rms > maxRMSECC {\n\t\tt.Errorf(\"FindTransformECC RMS = %f\", rms)\n\t}\n}\n\nfunc BaseTestTracker(t *testing.T, tracker Tracker, name string) {\n\tif tracker == nil {\n\t\tt.Error(\"TestTracker \" + name + \" should not be nil\")\n\t}\n\n\timg := IMRead(\"./images/face.jpg\", 1)\n\tif img.Empty() {\n\t\tt.Error(\"TestTracker \" + name + \" input img failed to load\")\n\t}\n\tdefer img.Close()\n\n\trect := image.Rect(250, 150, 250+200, 150+250)\n\tinit := tracker.Init(img, rect)\n\tif !init {\n\t\tt.Error(\"TestTracker \" + name + \" failed in Init\")\n\t}\n\n\t_, ok := tracker.Update(img)\n\tif !ok {\n\t\tt.Error(\"TestTracker \" + name + \" lost object in Update\")\n\t}\n}\n\nfunc TestSingleTrackers(t *testing.T) {\n\tgoturnPath := os.Getenv(\"GOCV_TRACKER_GOTURN_TEST_FILES\")\n\tif goturnPath == \"\" {\n\t\tgoturnPath = \"./testdata\"\n\t}\n\n\tvitPath := os.Getenv(\"GOCV_ONNX_TEST_FILES\")\n\tif vitPath == \"\" {\n\t\tvitPath = \"./testdata\"\n\t}\n\n\ttab := []struct {\n\t\tname    string\n\t\ttracker Tracker\n\t}{\n\t\t{\"MIL\", NewTrackerMIL()},\n\t\t{\"GOTURN\", NewTrackerGOTURNWithParams(goturnPath+\"/goturn.caffemodel\", goturnPath+\"/goturn.prototxt\")},\n\t\t{\"Vit\", NewTrackerVitWithParams(vitPath + \"/object_tracking_vittrack_2023sep.onnx\")},\n\t}\n\n\tfor _, test := range tab {\n\t\tfunc() {\n\t\t\tdefer test.tracker.Close()\n\t\t\tBaseTestTracker(t, test.tracker, test.name)\n\t\t}()\n\t}\n}\n\nfunc TestKalmanFilter(t *testing.T) {\n\t// Basic test with default constructor.\n\tkf := NewKalmanFilter(2, 1)\n\tkf.Init(2, 1)\n\tmeasurement := Zeros(1, 1, MatTypeCV32F)\n\tprediction := kf.Predict()\n\tstatePost := kf.Correct(measurement)\n\tstatePost.Close()\n\tprediction.Close()\n\tmeasurement.Close()\n\tkf.Close()\n\n\t// Basic test with param constructor.\n\tkf = NewKalmanFilterWithParams(2, 1, 1, MatTypeCV32F)\n\tcontrol := Ones(1, 1, MatTypeCV32F)\n\tmeasurement = Ones(1, 1, MatTypeCV32F)\n\tprediction = kf.PredictWithParams(control)\n\tstatePost = kf.Correct(measurement)\n\tstatePost.Close()\n\tprediction.Close()\n\tmeasurement.Close()\n\tcontrol.Close()\n\tkf.Close()\n}\n\nfunc TestKalmanFilter_Getters(t *testing.T) {\n\tkf := NewKalmanFilterWithParams(2, 1, 1, MatTypeCV32F)\n\tgetterTests := []struct {\n\t\tdesc string\n\t\tf    func() Mat\n\t}{\n\t\t{desc: \"GetStatePre()\", f: kf.GetStatePre},\n\t\t{desc: \"GetStatePost()\", f: kf.GetStatePost},\n\t\t{desc: \"GetTransitionMatrix()\", f: kf.GetTransitionMatrix},\n\t\t{desc: \"GetControlMatrix()\", f: kf.GetControlMatrix},\n\t\t{desc: \"GetMeasurementMatrix()\", f: kf.GetMeasurementMatrix},\n\t\t{desc: \"GetProcessNoiseCov()\", f: kf.GetProcessNoiseCov},\n\t\t{desc: \"GetMeasurementNoiseCov()\", f: kf.GetMeasurementNoiseCov},\n\t\t{desc: \"GetErrorCovPre()\", f: kf.GetErrorCovPre},\n\t\t{desc: \"GetGain()\", f: kf.GetGain},\n\t\t{desc: \"GetErrorCovPost()\", f: kf.GetErrorCovPost},\n\t\t{desc: \"GetTemp1()\", f: kf.GetTemp1},\n\t\t{desc: \"GetTemp2()\", f: kf.GetTemp2},\n\t\t{desc: \"GetTemp3()\", f: kf.GetTemp3},\n\t\t{desc: \"GetTemp4()\", f: kf.GetTemp4},\n\t\t{desc: \"GetTemp5()\", f: kf.GetTemp5},\n\t}\n\tfor _, test := range getterTests {\n\t\tt.Run(test.desc, func(t *testing.T) {\n\t\t\tif got := test.f(); got.Empty() {\n\t\t\t\tt.Errorf(\"%v: returned empty, want non-Empty\", test.desc)\n\t\t\t} else {\n\t\t\t\tgot.Close()\n\t\t\t}\n\n\t\t})\n\t}\n\tkf.Close()\n}\n\nfunc TestKalmanFilter_Setters(t *testing.T) {\n\tkf := NewKalmanFilter(2, 1)\n\ttests := []struct {\n\t\tdesc string\n\t\tf    func(Mat)\n\t}{\n\t\t{desc: \"SetStatePre()\", f: kf.SetStatePre},\n\t\t{desc: \"SetStatePost()\", f: kf.SetStatePost},\n\t\t{desc: \"SetTransitionMatrix()\", f: kf.SetTransitionMatrix},\n\t\t{desc: \"SetControlMatrix()\", f: kf.SetControlMatrix},\n\t\t{desc: \"SetMeasurementMatrix()\", f: kf.SetMeasurementMatrix},\n\t\t{desc: \"SetProcessNoiseCov()\", f: kf.SetProcessNoiseCov},\n\t\t{desc: \"SetMeasurementNoiseCov()\", f: kf.SetMeasurementNoiseCov},\n\t\t{desc: \"SetErrorCovPre()\", f: kf.SetErrorCovPre},\n\t\t{desc: \"SetGain()\", f: kf.SetGain},\n\t\t{desc: \"SetErrorCovPost()\", f: kf.SetErrorCovPost},\n\t}\n\tfor _, test := range tests {\n\t\tt.Run(test.desc, func(t *testing.T) {\n\t\t\ttestMat := Ones(2, 1, MatTypeCV32F)\n\t\t\t// Just run this to make sure the execution doesn't fail.\n\t\t\ttest.f(testMat)\n\t\t\ttestMat.Close()\n\t\t})\n\t}\n\tkf.Close()\n}\n"
  },
  {
    "path": "videoio.cpp",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_videoio)\n\n#include <stdexcept>\n#include \"videoio.h\"\n\n// VideoWriter\nVideoCapture VideoCapture_New() {\n    try {\n        return new cv::VideoCapture();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nvoid VideoCapture_Close(VideoCapture v) {\n    delete v;\n}\n\nbool VideoCapture_Open(VideoCapture v, const char* uri) {\n    try {\n        return v->open(uri);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool VideoCapture_OpenWithAPI(VideoCapture v, const char* uri, int apiPreference) {\n    try {\n        return v->open(uri, apiPreference);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool VideoCapture_OpenWithAPIParams(VideoCapture v, const char* uri, int apiPreference, int *paramsv, int paramsc) {\n    try {\n        std::vector< int > params;\n\n        for( int i = 0; i< paramsc; i++) {\n            params.push_back(paramsv[i]);\n        }\n    \n        return v->open(cv::String(uri), apiPreference, params);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool VideoCapture_OpenDevice(VideoCapture v, int device) {\n    try {\n        return v->open(device);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool VideoCapture_OpenDeviceWithAPI(VideoCapture v, int device, int apiPreference) {\n    try {\n        return v->open(device, apiPreference);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool VideoCapture_OpenDeviceWithAPIParams(VideoCapture v, int device, int apiPreference, int *paramsv, int paramsc) {\n    try {\n        std::vector< int > params;\n\n        for( int i = 0; i< paramsc; i++) {\n            params.push_back(paramsv[i]);\n        }\n    \n        return v->open(device, apiPreference, params);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\n\nOpenCVResult VideoCapture_Set(VideoCapture v, int prop, double param) {\n    try {\n        v->set(prop, param);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\ndouble VideoCapture_Get(VideoCapture v, int prop) {\n    try {\n        return v->get(prop);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0.0;\n    }\n}\n\nint VideoCapture_IsOpened(VideoCapture v) {\n    try {\n        return v->isOpened();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0;\n    }\n}\n\nint VideoCapture_Read(VideoCapture v, Mat buf) {\n    try {\n        return v->read(*buf);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0;\n    }\n}\n\nOpenCVResult VideoCapture_Grab(VideoCapture v, int skip) {\n    try {\n        for (int i = 0; i < skip; i++) {\n            v->grab();\n        }\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\nint VideoCapture_Retrieve(VideoCapture v, Mat buf) {\n    try {\n        return v->retrieve(*buf);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0;\n    }\n}\n\nint VideoCapture_RetrieveChannel(VideoCapture v, Mat buf, int channel) {\n    try {\n        return v->retrieve(*buf, channel);\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return 0;\n    }\n}\n\n// VideoWriter\nVideoWriter VideoWriter_New() {\n    try {\n        return new cv::VideoWriter();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn NULL;\n    }\n}\n\nvoid VideoWriter_Close(VideoWriter vw) {\n    delete vw;\n}\n\nOpenCVResult VideoWriter_Open(VideoWriter vw, const char* name, const char* codec, double fps, int width, int height, bool isColor) {\n    try {\n        int codecCode = cv::VideoWriter::fourcc(codec[0], codec[1], codec[2], codec[3]);\n        vw->open(name, codecCode, fps, cv::Size(width, height), isColor);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\nOpenCVResult VideoWriter_OpenWithAPI(VideoWriter vw, const char* name, int apiPreference, const char* codec, double fps, int width, int height, bool isColor) {\n    try {\n        int codecCode = cv::VideoWriter::fourcc(codec[0], codec[1], codec[2], codec[3]);\n        vw->open(name, apiPreference, codecCode, fps, cv::Size(width, height), isColor);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\nOpenCVResult VideoWriter_OpenWithAPIParams(VideoWriter vw, const char* name, int apiPreference, const char* codec, double fps, int width, int height, IntVector params) {\n    try {\n        std::vector<int> cpp_params;\n\n        for(int i = 0; i < params.length; i++) {\n            cpp_params.push_back(params.val[i]);\n        }\n    \n        int codecCode = cv::VideoWriter::fourcc(codec[0], codec[1], codec[2], codec[3]);\n        vw->open(name, apiPreference, codecCode, fps, cv::Size(width, height), cpp_params);\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\nint VideoWriter_IsOpened(VideoWriter vw) {\n    try {\n        return vw->isOpened();\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn 0;\n    }\n}\n\nOpenCVResult VideoWriter_Write(VideoWriter vw, Mat img) {\n    try {\n        *vw << *img;\n\t\tOpenCVResult result = {0, NULL};\n\t\treturn result;\n\t} catch(const cv::Exception& e) {\n\t\tOpenCVResult result = {e.code, e.what()};\n\t\treturn result;\n    }\n}\n\nconst char* Videoio_Registry_GetBackendName(int api) {\n    try {\n        cv::String name;\n        name = cv::videoio_registry::getBackendName((cv::VideoCaptureAPIs)(api));\n        return strdup(name.c_str());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        return \"\";\n    }\n}\n\nIntVector Videio_Registry_GetBackends() {\n    try {\n        IntVector c_backs;\n        std::vector<cv::VideoCaptureAPIs> backs = cv::videoio_registry::getBackends();\n    \n        c_backs.val = new int[backs.size()];\n        c_backs.length = backs.size();\n    \n        for(int i = 0; i < c_backs.length; i++) {\n            c_backs.val[i] = backs[i];\n        }\n    \n        return c_backs;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        IntVector empty;\n\t\treturn empty;\n    }\n}\n\nconst char* Videoio_Registry_GetCameraBackendPluginVersion(int api, int* version_ABI, int* version_API) {\n    try {\n        std::string desc = cv::videoio_registry::getCameraBackendPluginVersion((cv::VideoCaptureAPIs)(api), *version_ABI, *version_API);\n\n        return strdup(desc.c_str());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn \"\";\n    }\n}\n\nIntVector Videoio_Registry_GetCameraBackends() {\n    try {\n        IntVector c_backs;\n        std::vector<cv::VideoCaptureAPIs> backs = cv::videoio_registry::getCameraBackends();\n    \n        c_backs.val = new int[backs.size()];\n        c_backs.length = backs.size();\n    \n        for(int i = 0; i < c_backs.length; i++) {\n            c_backs.val[i] = backs[i];\n        }\n    \n        return c_backs;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        IntVector empty;\n\t\treturn empty;\n    }\n}\n\nconst char* Videoio_Registry_GetStreamBackendPluginVersion(int api, int* version_ABI, int* version_API){\n    try {\n        std::string desc = cv::videoio_registry::getStreamBackendPluginVersion((cv::VideoCaptureAPIs)(api), *version_ABI, *version_API);\n\n        return strdup(desc.c_str());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn \"\";\n    } \n}\n\nIntVector Videoio_Registry_GetStreamBackends() {\n    try {\n        IntVector c_backs;\n\n        std::vector<cv::VideoCaptureAPIs> backs = cv::videoio_registry::getStreamBackends();\n    \n        c_backs.val = new int[backs.size()];\n        c_backs.length = backs.size();\n    \n        for(int i = 0; i < c_backs.length; i++) {\n            c_backs.val[i] = backs[i];\n        }\n    \n        return c_backs;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        IntVector empty;\n\t\treturn empty;\n    }\n}\n\nconst char* Videoio_Registry_GetWriterBackendPluginVersion(int api, int* version_ABI, int* version_API){\n    try {\n        std::string desc = cv::videoio_registry::getWriterBackendPluginVersion((cv::VideoCaptureAPIs)(api), *version_ABI, *version_API);\n\n        return strdup(desc.c_str());\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn \"\";\n    }\n}\n\nIntVector Videoio_Registry_GetWriterBackends() {\n    try {\n        IntVector c_backs;\n\n        std::vector<cv::VideoCaptureAPIs> backs = cv::videoio_registry::getWriterBackends();\n    \n        c_backs.val = new int[backs.size()];\n        c_backs.length = backs.size();\n    \n        for(int i = 0; i < c_backs.length; i++) {\n            c_backs.val[i] = backs[i];\n        }\n    \n        return c_backs;\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n        IntVector empty;\n\t\treturn empty;\n    }\n}\n\nbool Videoio_Registry_HasBackend(int api) {\n    try {\n        return cv::videoio_registry::hasBackend((cv::VideoCaptureAPIs)(api));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n\nbool Videoio_Registry_IsBackendBuiltIn(int api) {\n    try {\n        return cv::videoio_registry::isBackendBuiltIn((cv::VideoCaptureAPIs)(api));\n    } catch(const cv::Exception& e){\n        setExceptionInfo(e.code, e.what());\n\t\treturn false;\n    }\n}\n"
  },
  {
    "path": "videoio.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_videoio)\n\npackage gocv\n\n/*\n#include <stdlib.h>\n#include \"videoio.h\"\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\n// Select preferred API for a capture object.\n// Note: Backends are available only if they have been built with your OpenCV binaries\ntype VideoCaptureAPI int\n\nconst (\n\t// Auto detect == 0\n\tVideoCaptureAny VideoCaptureAPI = 0\n\n\t// Video For Windows (obsolete, removed)\n\tVideoCaptureVFW VideoCaptureAPI = 200\n\n\t// V4L/V4L2 capturing support\n\tVideoCaptureV4L VideoCaptureAPI = 200\n\n\t// Same as VideoCaptureV4L\n\tVideoCaptureV4L2 VideoCaptureAPI = 200\n\n\t// IEEE 1394 drivers\n\tVideoCaptureFirewire VideoCaptureAPI = 300\n\n\t// Same value as VideoCaptureFirewire\n\tVideoCaptureFireware VideoCaptureAPI = 300\n\n\t// Same value as VideoCaptureFirewire\n\tVideoCaptureIEEE1394 VideoCaptureAPI = 300\n\n\t// Same value as VideoCaptureFirewire\n\tVideoCaptureDC1394 VideoCaptureAPI = 300\n\n\t// Same value as VideoCaptureFirewire\n\tVideoCaptureCMU1394 VideoCaptureAPI = 300\n\n\t// QuickTime (obsolete, removed)\n\tVideoCaptureQT VideoCaptureAPI = 500\n\n\t// Unicap drivers (obsolete, removed)\n\tVideoCaptureUnicap VideoCaptureAPI = 600\n\n\t// DirectShow (via videoInput)\n\tVideoCaptureDshow VideoCaptureAPI = 700\n\n\t// PvAPI, Prosilica GigE SDK\n\tVideoCapturePvAPI VideoCaptureAPI = 800\n\n\t// OpenNI (for Kinect)\n\tVideoCaptureOpenNI VideoCaptureAPI = 900\n\n\t// OpenNI (for Asus Xtion)\n\tVideoCaptureOpenNIAsus VideoCaptureAPI = 910\n\n\t// Android - not used\n\tVideoCaptureAndroid VideoCaptureAPI = 1000\n\n\t// XIMEA Camera API\n\tVideoCaptureXiAPI VideoCaptureAPI = 1100\n\n\t// AVFoundation framework for iOS (OS X Lion will have the same API)\n\tVideoCaptureAVFoundation VideoCaptureAPI = 1200\n\n\t// Smartek Giganetix GigEVisionSDK\n\tVideoCaptureGiganetix VideoCaptureAPI = 1300\n\n\t// Microsoft Media Foundation (via videoInput)\n\tVideoCaptureMSMF VideoCaptureAPI = 1400\n\n\t// Microsoft Windows Runtime using Media Foundation\n\tVideoCaptureWinRT VideoCaptureAPI = 1410\n\n\t// RealSense (former Intel Perceptual Computing SDK)\n\tVideoCaptureIntelPerc VideoCaptureAPI = 1500\n\n\t// Synonym for VideoCaptureIntelPerc\n\tVideoCaptureRealsense VideoCaptureAPI = 1500\n\n\t// OpenNI2 (for Kinect)\n\tVideoCaptureOpenNI2 VideoCaptureAPI = 1600\n\n\t// OpenNI2 (for Asus Xtion and Occipital Structure sensors)\n\tVideoCaptureOpenNI2Asus VideoCaptureAPI = 1610\n\n\t// gPhoto2 connection\n\tVideoCaptureGPhoto2 VideoCaptureAPI = 1700\n\n\t// GStreamer\n\tVideoCaptureGstreamer VideoCaptureAPI = 1800\n\n\t// Open and record video file or stream using the FFMPEG library\n\tVideoCaptureFFmpeg VideoCaptureAPI = 1900\n\n\t// OpenCV Image Sequence (e.g. img_%02d.jpg)\n\tVideoCaptureImages VideoCaptureAPI = 2000\n\n\t// Aravis SDK\n\tVideoCaptureAravis VideoCaptureAPI = 2100\n\n\t// Built-in OpenCV MotionJPEG codec\n\tVideoCaptureOpencvMjpeg VideoCaptureAPI = 2200\n\n\t// Intel MediaSDK\n\tVideoCaptureIntelMFX VideoCaptureAPI = 2300\n\n\t// XINE engine (Linux)\n\tVideoCaptureXINE VideoCaptureAPI = 2400\n)\n\n// VideoCaptureProperties are the properties used for VideoCapture operations.\ntype VideoCaptureProperties int32\n\nconst (\n\t// VideoCapturePosMsec contains current position of the\n\t// video file in milliseconds.\n\tVideoCapturePosMsec VideoCaptureProperties = 0\n\n\t// VideoCapturePosFrames 0-based index of the frame to be\n\t// decoded/captured next.\n\tVideoCapturePosFrames VideoCaptureProperties = 1\n\n\t// VideoCapturePosAVIRatio relative position of the video file:\n\t// 0=start of the film, 1=end of the film.\n\tVideoCapturePosAVIRatio VideoCaptureProperties = 2\n\n\t// VideoCaptureFrameWidth is width of the frames in the video stream.\n\tVideoCaptureFrameWidth VideoCaptureProperties = 3\n\n\t// VideoCaptureFrameHeight controls height of frames in the video stream.\n\tVideoCaptureFrameHeight VideoCaptureProperties = 4\n\n\t// VideoCaptureFPS controls capture frame rate.\n\tVideoCaptureFPS VideoCaptureProperties = 5\n\n\t// VideoCaptureFOURCC contains the 4-character code of codec.\n\t// see VideoWriter::fourcc for details.\n\tVideoCaptureFOURCC VideoCaptureProperties = 6\n\n\t// VideoCaptureFrameCount contains number of frames in the video file.\n\tVideoCaptureFrameCount VideoCaptureProperties = 7\n\n\t// VideoCaptureFormat format of the Mat objects returned by\n\t// VideoCapture::retrieve().\n\tVideoCaptureFormat VideoCaptureProperties = 8\n\n\t// VideoCaptureMode contains backend-specific value indicating\n\t// the current capture mode.\n\tVideoCaptureMode VideoCaptureProperties = 9\n\n\t// VideoCaptureBrightness is brightness of the image\n\t// (only for those cameras that support).\n\tVideoCaptureBrightness VideoCaptureProperties = 10\n\n\t// VideoCaptureContrast is contrast of the image\n\t// (only for cameras that support it).\n\tVideoCaptureContrast VideoCaptureProperties = 11\n\n\t// VideoCaptureSaturation saturation of the image\n\t// (only for cameras that support).\n\tVideoCaptureSaturation VideoCaptureProperties = 12\n\n\t// VideoCaptureHue hue of the image (only for cameras that support).\n\tVideoCaptureHue VideoCaptureProperties = 13\n\n\t// VideoCaptureGain is the gain of the capture image.\n\t// (only for those cameras that support).\n\tVideoCaptureGain VideoCaptureProperties = 14\n\n\t// VideoCaptureExposure is the exposure of the capture image.\n\t// (only for those cameras that support).\n\tVideoCaptureExposure VideoCaptureProperties = 15\n\n\t// VideoCaptureConvertRGB is a boolean flags indicating whether\n\t// images should be converted to RGB.\n\tVideoCaptureConvertRGB VideoCaptureProperties = 16\n\n\t// VideoCaptureWhiteBalanceBlueU is currently unsupported.\n\tVideoCaptureWhiteBalanceBlueU VideoCaptureProperties = 17\n\n\t// VideoCaptureRectification is the rectification flag for stereo cameras.\n\t// Note: only supported by DC1394 v 2.x backend currently.\n\tVideoCaptureRectification VideoCaptureProperties = 18\n\n\t// VideoCaptureMonochrome indicates whether images should be\n\t// converted to monochrome.\n\tVideoCaptureMonochrome VideoCaptureProperties = 19\n\n\t// VideoCaptureSharpness controls image capture sharpness.\n\tVideoCaptureSharpness VideoCaptureProperties = 20\n\n\t// VideoCaptureAutoExposure controls the DC1394 exposure control\n\t// done by camera, user can adjust reference level using this feature.\n\tVideoCaptureAutoExposure VideoCaptureProperties = 21\n\n\t// VideoCaptureGamma controls video capture gamma.\n\tVideoCaptureGamma VideoCaptureProperties = 22\n\n\t// VideoCaptureTemperature controls video capture temperature.\n\tVideoCaptureTemperature VideoCaptureProperties = 23\n\n\t// VideoCaptureTrigger controls video capture trigger.\n\tVideoCaptureTrigger VideoCaptureProperties = 24\n\n\t// VideoCaptureTriggerDelay controls video capture trigger delay.\n\tVideoCaptureTriggerDelay VideoCaptureProperties = 25\n\n\t// VideoCaptureWhiteBalanceRedV controls video capture setting for\n\t// white balance.\n\tVideoCaptureWhiteBalanceRedV VideoCaptureProperties = 26\n\n\t// VideoCaptureZoom controls video capture zoom.\n\tVideoCaptureZoom VideoCaptureProperties = 27\n\n\t// VideoCaptureFocus controls video capture focus.\n\tVideoCaptureFocus VideoCaptureProperties = 28\n\n\t// VideoCaptureGUID controls video capture GUID.\n\tVideoCaptureGUID VideoCaptureProperties = 29\n\n\t// VideoCaptureISOSpeed controls video capture ISO speed.\n\tVideoCaptureISOSpeed VideoCaptureProperties = 30\n\n\t// VideoCaptureBacklight controls video capture backlight.\n\tVideoCaptureBacklight VideoCaptureProperties = 32\n\n\t// VideoCapturePan controls video capture pan.\n\tVideoCapturePan VideoCaptureProperties = 33\n\n\t// VideoCaptureTilt controls video capture tilt.\n\tVideoCaptureTilt VideoCaptureProperties = 34\n\n\t// VideoCaptureRoll controls video capture roll.\n\tVideoCaptureRoll VideoCaptureProperties = 35\n\n\t// VideoCaptureIris controls video capture iris.\n\tVideoCaptureIris VideoCaptureProperties = 36\n\n\t// VideoCaptureSettings is the pop up video/camera filter dialog. Note:\n\t// only supported by DSHOW backend currently. The property value is ignored.\n\tVideoCaptureSettings VideoCaptureProperties = 37\n\n\t// VideoCaptureBufferSize controls video capture buffer size.\n\tVideoCaptureBufferSize VideoCaptureProperties = 38\n\n\t// VideoCaptureAutoFocus controls video capture auto focus..\n\tVideoCaptureAutoFocus VideoCaptureProperties = 39\n\n\t// VideoCaptureSarNumerator controls the sample aspect ratio: num/den (num)\n\tVideoCaptureSarNumerator VideoCaptureProperties = 40\n\n\t// VideoCaptureSarDenominator controls the sample aspect ratio: num/den (den)\n\tVideoCaptureSarDenominator VideoCaptureProperties = 41\n\n\t// VideoCaptureBackend is the current api backend (VideoCaptureAPI). Read-only property.\n\tVideoCaptureBackend VideoCaptureProperties = 42\n\n\t// VideoCaptureChannel controls the video input or channel number (only for those cameras that support).\n\tVideoCaptureChannel VideoCaptureProperties = 43\n\n\t// VideoCaptureAutoWB controls the auto white-balance.\n\tVideoCaptureAutoWB VideoCaptureProperties = 44\n\n\t// VideoCaptureWBTemperature controls the white-balance color temperature\n\tVideoCaptureWBTemperature VideoCaptureProperties = 45\n\n\t// VideoCaptureCodecPixelFormat shows the the codec's pixel format (4-character code). Read-only property.\n\t// Subset of AV_PIX_FMT_* or -1 if unknown.\n\tVideoCaptureCodecPixelFormat VideoCaptureProperties = 46\n\n\t// VideoCaptureBitrate displays the video bitrate in kbits/s. Read-only property.\n\tVideoCaptureBitrate VideoCaptureProperties = 47\n\n\t// VideoCaptureHWAcceleration Hardware acceleration type.\n\tVideoCaptureHWAcceleration VideoCaptureProperties = 50\n\n\t// VideoCaptureHWDevice Hardware device index (select GPU if multiple available).\n\tVideoCaptureHWDevice VideoCaptureProperties = 51\n)\n\n// VideoWriterProperty\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d4/d15/group__videoio__flags__base.html#ga41c5cfa7859ae542b71b1d33bbd4d2b4\ntype VideoWriterProperty int\n\nconst (\n\t// VideoWriterQuality Current quality (0..100%) of the encoded videostream.\n\t// Can be adjusted dynamically in some codecs.\n\tVideoWriterQuality VideoWriterProperty = 1\n\n\t// VideoWriterFramebytes (Read-only): Size of just encoded video frame.\n\t// Note that the encoding order may be different from representation order.\n\tVideoWriterFramebytes VideoWriterProperty = 2\n\n\t// VideoWriterNstripes Number of stripes for parallel encoding. -1 for auto detection.\n\tVideoWriterNstripes VideoWriterProperty = 3\n\n\t// VideoWriterIsColor If it is not zero, the encoder will expect and encode color frames,\n\t// otherwise it will work with grayscale frames.\n\tVideoWriterIsColor VideoWriterProperty = 4\n\n\t// VideoWriterDepth Defaults to CV8U.\n\tVideoWriterDepth VideoWriterProperty = 5\n\n\t// VideoWriterHwAcceleration (open-only) Hardware acceleration type\n\t// (see https://docs.opencv.org/4.x/dc/dfc/group__videoio__flags__others.html#gaf61f8388a47aad88cd82cbda6d52c391).\n\t// Setting supported only via params parameter in VideoWriterFileWithAPIParams.\n\t// Default value is backend-specific.\n\tVideoWriterHwAcceleration VideoWriterProperty = 6\n\n\t// VideoWriterHwDevice (open-only) Hardware device index (select GPU if multiple available).\n\t// Device enumeration is acceleration type specific.\n\tVideoWriterHwDevice VideoWriterProperty = 7\n\n\t// VideoWriterHwAccelerationUseOpencl open-only) If non-zero, create new OpenCL context and bind it to current thread.\n\tVideoWriterHwAccelerationUseOpencl VideoWriterProperty = 8\n\n\t// VideoWriterRawVideo (open-only) Set to non-zero to enable encapsulation of an encoded raw video stream.\n\tVideoWriterRawVideo VideoWriterProperty = 9\n\n\t// VideoWriterKeyInterval (open-only) Set the key frame interval using raw video encapsulation\n\t// (VideoWriterRawVideo != 0). Defaults to 1 when not set. FFmpeg back-end only.\n\tVideoWriterKeyInterval VideoWriterProperty = 10\n\n\t// VideoWriterKeyFlag Set to non-zero to signal that the following frames are key frames or zero if not,\n\t// when encapsulating raw video (VideoWriterRawVideo != 0). FFmpeg back-end only.\n\tVideoWriterKeyFlag VideoWriterProperty = 11\n\n\t// VideoWriterPts Specifies the frame presentation timestamp for each frame using the FPS time base.\n\tVideoWriterPts VideoWriterProperty = 12\n\n\t// VideoWriterDtsDelay Specifies the maximum difference between presentation (pts)\n\t// and decompression timestamps (dts) using the FPS time base.\n\tVideoWriterDtsDelay VideoWriterProperty = 13\n)\n\n// VideoCapture is a wrapper around the OpenCV VideoCapture class.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/d8/dfe/classcv_1_1VideoCapture.html\ntype VideoCapture struct {\n\tp C.VideoCapture\n}\n\n// VideoCaptureFile opens a VideoCapture from a file and prepares\n// to start capturing. It returns error if it fails to open the file stored in uri path.\nfunc VideoCaptureFile(uri string) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tcURI := C.CString(uri)\n\tdefer C.free(unsafe.Pointer(cURI))\n\n\tif !C.VideoCapture_Open(vc.p, cURI) {\n\t\terr = fmt.Errorf(\"Error opening file: %s\", uri)\n\t}\n\n\treturn\n}\n\n// VideoCaptureFile opens a VideoCapture from a file and prepares\n// to start capturing. It returns error if it fails to open the file stored in uri path.\nfunc VideoCaptureFileWithAPI(uri string, apiPreference VideoCaptureAPI) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tcURI := C.CString(uri)\n\tdefer C.free(unsafe.Pointer(cURI))\n\n\tif !C.VideoCapture_OpenWithAPI(vc.p, cURI, C.int(apiPreference)) {\n\t\terr = fmt.Errorf(\"Error opening file: %s with api backend: %d\", uri, apiPreference)\n\t}\n\n\treturn\n}\n\n// VideoCaptureFileWithAPIParams opens a VideoCapture from a file and prepares\n// to start capturing. It returns error if it fails to open the file stored in uri path.\nfunc VideoCaptureFileWithAPIParams(uri string, apiPreference VideoCaptureAPI, params []VideoCaptureProperties) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tcURI := C.CString(uri)\n\tdefer C.free(unsafe.Pointer(cURI))\n\n\tif !C.VideoCapture_OpenWithAPIParams(vc.p, cURI, C.int(apiPreference), (*C.int)(unsafe.Pointer(&params[0])), C.int(len(params))) {\n\t\terr = fmt.Errorf(\"Error opening file: %s with api backend: %d\", uri, apiPreference)\n\t}\n\n\treturn\n}\n\n// VideoCaptureDevice opens a VideoCapture from a device and prepares\n// to start capturing. It returns error if it fails to open the video device.\nfunc VideoCaptureDevice(device int) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tif !C.VideoCapture_OpenDevice(vc.p, C.int(device)) {\n\t\terr = fmt.Errorf(\"Error opening device: %d\", device)\n\t}\n\n\treturn\n}\n\n// VideoCaptureDeviceWithAPI opens a VideoCapture from a device with the api preference.\n// It returns error if it fails to open the video device.\nfunc VideoCaptureDeviceWithAPI(device int, apiPreference VideoCaptureAPI) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tif !C.VideoCapture_OpenDeviceWithAPI(vc.p, C.int(device), C.int(apiPreference)) {\n\t\terr = fmt.Errorf(\"Error opening device: %d with api backend: %d\", device, apiPreference)\n\t}\n\n\treturn\n}\n\n// VideoCaptureDeviceWithAPIParams opens a VideoCapture from a device with the api preference.\n// It returns error if it fails to open the video device.\nfunc VideoCaptureDeviceWithAPIParams(device int, apiPreference VideoCaptureAPI, params []VideoCaptureProperties) (vc *VideoCapture, err error) {\n\tvc = &VideoCapture{p: C.VideoCapture_New()}\n\n\tif !C.VideoCapture_OpenDeviceWithAPIParams(vc.p, C.int(device), C.int(apiPreference), (*C.int)(unsafe.Pointer(&params[0])), C.int(len(params))) {\n\t\terr = fmt.Errorf(\"Error opening device: %d with api backend: %d\", device, apiPreference)\n\t}\n\n\treturn\n}\n\n// Close VideoCapture object.\nfunc (v *VideoCapture) Close() error {\n\tC.VideoCapture_Close(v.p)\n\tv.p = nil\n\treturn nil\n}\n\n// Set parameter with property (=key).\nfunc (v *VideoCapture) Set(prop VideoCaptureProperties, param float64) {\n\tC.VideoCapture_Set(v.p, C.int(prop), C.double(param))\n}\n\n// Get parameter with property (=key).\nfunc (v VideoCapture) Get(prop VideoCaptureProperties) float64 {\n\treturn float64(C.VideoCapture_Get(v.p, C.int(prop)))\n}\n\n// IsOpened returns if the VideoCapture has been opened to read from\n// a file or capture device.\nfunc (v *VideoCapture) IsOpened() bool {\n\tisOpened := C.VideoCapture_IsOpened(v.p)\n\treturn isOpened != 0\n}\n\n// Read reads the next frame from the VideoCapture to the Mat passed in\n// as the param. It returns false if the VideoCapture cannot read frame.\nfunc (v *VideoCapture) Read(m *Mat) bool {\n\treturn C.VideoCapture_Read(v.p, m.p) != 0\n}\n\n// Grab skips a specific number of frames.\nfunc (v *VideoCapture) Grab(skip int) error {\n\treturn OpenCVResult(C.VideoCapture_Grab(v.p, C.int(skip)))\n}\n\n// Retrieve decodes and returns the grabbed video frame. Should be used after Grab\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/dfe/classcv_1_1VideoCapture.html#a9ac7f4b1cdfe624663478568486e6712\nfunc (v *VideoCapture) Retrieve(m *Mat) bool {\n\treturn C.VideoCapture_Retrieve(v.p, m.p) != 0\n}\n\n// Retrieve decodes and returns the grabbed frame for a specific channel. Should be used after Grab\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/d8/dfe/classcv_1_1VideoCapture.html#a9ac7f4b1cdfe624663478568486e6712\nfunc (v *VideoCapture) RetrieveChannel(m *Mat, channel int) bool {\n\treturn C.VideoCapture_RetrieveChannel(v.p, m.p, C.int(channel)) != 0\n}\n\n// CodecString returns a string representation of FourCC bytes, i.e. the name of a codec\nfunc (v *VideoCapture) CodecString() string {\n\tres := \"\"\n\thexes := []int64{0xff, 0xff00, 0xff0000, 0xff000000}\n\tfor i, h := range hexes {\n\t\tres += string(rune(int64(v.Get(VideoCaptureFOURCC)) & h >> (uint(i * 8))))\n\t}\n\treturn res\n}\n\n// ToCodec returns an float64 representation of FourCC bytes\nfunc (v *VideoCapture) ToCodec(codec string) float64 {\n\tif len(codec) != 4 {\n\t\treturn -1.0\n\t}\n\tc1 := []rune(string(codec[0]))[0]\n\tc2 := []rune(string(codec[1]))[0]\n\tc3 := []rune(string(codec[2]))[0]\n\tc4 := []rune(string(codec[3]))[0]\n\treturn float64((c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24))\n}\n\n// VideoWriter is a wrapper around the OpenCV VideoWriter`class.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html\ntype VideoWriter struct {\n\tmu *sync.RWMutex\n\tp  C.VideoWriter\n}\n\n// VideoWriterFile opens a VideoWriter with a specific output file.\n// The \"codec\" param should be the four-letter code for the desired output\n// codec, for example \"MJPG\".\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130\nfunc VideoWriterFile(name string, codec string, fps float64, width int, height int, isColor bool) (vw *VideoWriter, err error) {\n\n\tif fps == 0 || width == 0 || height == 0 {\n\t\treturn nil, fmt.Errorf(\"one of the numerical parameters \"+\n\t\t\t\"is equal to zero: FPS: %f, width: %d, height: %d\", fps, width, height)\n\t}\n\n\tvw = &VideoWriter{\n\t\tp:  C.VideoWriter_New(),\n\t\tmu: &sync.RWMutex{},\n\t}\n\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tcCodec := C.CString(codec)\n\tdefer C.free(unsafe.Pointer(cCodec))\n\n\terr = OpenCVResult(C.VideoWriter_Open(vw.p, cName, cCodec, C.double(fps), C.int(width), C.int(height), C.bool(isColor)))\n\treturn\n}\n\n// VideoWriterFileWithAPI opens a VideoWriter with a specific output file.\n// The \"codec\" param should be the four-letter code for the desired output\n// codec, for example \"MJPG\".\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130\nfunc VideoWriterFileWithAPI(name string, apiPreference VideoCaptureAPI, codec string, fps float64, width int, height int, isColor bool) (vw *VideoWriter, err error) {\n\n\tif fps == 0 || width == 0 || height == 0 {\n\t\treturn nil, fmt.Errorf(\"one of the numerical parameters \"+\n\t\t\t\"is equal to zero: FPS: %f, width: %d, height: %d\", fps, width, height)\n\t}\n\n\tvw = &VideoWriter{\n\t\tp:  C.VideoWriter_New(),\n\t\tmu: &sync.RWMutex{},\n\t}\n\n\tcName := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cName))\n\n\tcCodec := C.CString(codec)\n\tdefer C.free(unsafe.Pointer(cCodec))\n\n\terr = OpenCVResult(C.VideoWriter_OpenWithAPI(vw.p, cName, C.int(apiPreference), cCodec, C.double(fps), C.int(width), C.int(height), C.bool(isColor)))\n\treturn\n}\n\n// VideoWriterFileWithAPIParams opens a VideoWriter with a specific output file.\n// The \"codec\" param should be the four-letter code for the desired output\n// codec, for example \"MJPG\".\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#a0901c353cd5ea05bba455317dab81130\nfunc VideoWriterFileWithAPIParams(name string, apiPreference VideoCaptureAPI, codec string, fps float64, width int, height int, params []VideoWriterProperty) (vw *VideoWriter, err error) {\n\n\tif fps == 0 || width == 0 || height == 0 {\n\t\treturn nil, fmt.Errorf(\"one of the numerical parameters \"+\n\t\t\t\"is equal to zero: FPS: %f, width: %d, height: %d\", fps, width, height)\n\t}\n\n\tvw = &VideoWriter{\n\t\tp:  C.VideoWriter_New(),\n\t\tmu: &sync.RWMutex{},\n\t}\n\n\tc_name := C.CString(name)\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tc_codec := C.CString(codec)\n\tdefer C.free(unsafe.Pointer(c_codec))\n\n\tc_ints := make([]C.int, len(params))\n\tfor i := range params {\n\t\tc_ints[i] = C.int(params[i])\n\t}\n\n\tc_params := C.IntVector{\n\t\tval:    unsafe.SliceData(c_ints),\n\t\tlength: C.int(len(params)),\n\t}\n\terr = OpenCVResult(C.VideoWriter_OpenWithAPIParams(vw.p, c_name, C.int(apiPreference), c_codec, C.double(fps), C.int(width), C.int(height), c_params))\n\treturn\n}\n\n// Close VideoWriter object.\nfunc (vw *VideoWriter) Close() error {\n\tC.VideoWriter_Close(vw.p)\n\tvw.p = nil\n\treturn nil\n}\n\n// IsOpened checks if the VideoWriter is open and ready to be written to.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#a9a40803e5f671968ac9efa877c984d75\nfunc (vw *VideoWriter) IsOpened() bool {\n\tisOpend := C.VideoWriter_IsOpened(vw.p)\n\treturn isOpend != 0\n}\n\n// Write the next video frame from the Mat image to the open VideoWriter.\n//\n// For further details, please see:\n// http://docs.opencv.org/master/dd/d9e/classcv_1_1VideoWriter.html#a3115b679d612a6a0b5864a0c88ed4b39\nfunc (vw *VideoWriter) Write(img Mat) error {\n\tvw.mu.Lock()\n\tdefer vw.mu.Unlock()\n\treturn OpenCVResult(C.VideoWriter_Write(vw.p, img.p))\n}\n\n// OpenVideoCapture return VideoCapture specified by device ID if v is a\n// number. Return VideoCapture created from video file, URL, or GStreamer\n// pipeline if v is a string.\nfunc OpenVideoCapture(v interface{}) (*VideoCapture, error) {\n\tswitch vv := v.(type) {\n\tcase int:\n\t\treturn VideoCaptureDevice(vv)\n\tcase string:\n\t\tid, err := strconv.Atoi(vv)\n\t\tif err == nil {\n\t\t\treturn VideoCaptureDevice(id)\n\t\t}\n\t\treturn VideoCaptureFile(vv)\n\tdefault:\n\t\treturn nil, errors.New(\"argument must be int or string\")\n\t}\n}\n\n// OpenVideoCaptureWithAPI return VideoCapture specified by device ID if v is a\n// number. Return VideoCapture created from video file, URL, or GStreamer\n// pipeline if v is a string.\nfunc OpenVideoCaptureWithAPI(v interface{}, apiPreference VideoCaptureAPI) (*VideoCapture, error) {\n\tswitch vv := v.(type) {\n\tcase int:\n\t\treturn VideoCaptureDeviceWithAPI(vv, apiPreference)\n\tcase string:\n\t\tid, err := strconv.Atoi(vv)\n\t\tif err == nil {\n\t\t\treturn VideoCaptureDeviceWithAPI(id, apiPreference)\n\t\t}\n\t\treturn VideoCaptureFileWithAPI(vv, apiPreference)\n\tdefault:\n\t\treturn nil, errors.New(\"argument must be int or string\")\n\t}\n}\n\n// OpenVideoCaptureWithAPIParams return VideoCapture specified by device ID if v is a\n// number. Return VideoCapture created from video file, URL, or GStreamer\n// pipeline if v is a string.\nfunc OpenVideoCaptureWithAPIParams(v interface{}, apiPreference VideoCaptureAPI, params []VideoCaptureProperties) (*VideoCapture, error) {\n\tswitch vv := v.(type) {\n\tcase int:\n\t\treturn VideoCaptureDeviceWithAPIParams(vv, apiPreference, params)\n\tcase string:\n\t\tid, err := strconv.Atoi(vv)\n\t\tif err == nil {\n\t\t\treturn VideoCaptureDeviceWithAPIParams(id, apiPreference, params)\n\t\t}\n\t\t//TODO: params with files\n\t\treturn VideoCaptureFileWithAPIParams(vv, apiPreference, params)\n\tdefault:\n\t\treturn nil, errors.New(\"argument must be int or string\")\n\t}\n}\n\ntype VideoRegistryType struct{}\n\n// VideoRegistry\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html\nvar VideoRegistry VideoRegistryType\n\n// GetBackendName Returns backend API name or \"UnknownVideoAPI(xxx)\".\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#ga6723e68832186e20bd44cd3c2b0d8c60\nfunc (VideoRegistryType) GetBackendName(api VideoCaptureAPI) string {\n\n\tc_name := C.Videoio_Registry_GetBackendName(C.int(api))\n\tdefer C.free(unsafe.Pointer(c_name))\n\n\tname := C.GoString(c_name)\n\treturn name\n}\n\n// GetBackends Returns list of all available backends.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#ga973abd27c3ea165472f789fa511d9f7b\nfunc (VideoRegistryType) GetBackends() []VideoCaptureAPI {\n\tintVec := C.Videio_Registry_GetBackends()\n\tdefer C.IntVector_Close(intVec)\n\n\tc_ints := unsafe.Slice(intVec.val, int(intVec.length))\n\n\tints := make([]VideoCaptureAPI, len(c_ints))\n\n\tfor i, val := range c_ints {\n\t\tints[i] = VideoCaptureAPI(int(val))\n\t}\n\treturn ints\n}\n\n// GetCameraBackendPluginVersion Returns description and ABI/API version of videoio plugin's camera interface.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#gab36e3e19ab2396410b74046de141323c\nfunc (VideoRegistryType) GetCameraBackendPluginVersion(api VideoCaptureAPI) (string, int, int) {\n\tvar (\n\t\tversion_abi C.int\n\t\tversion_api C.int\n\t)\n\n\tc_desc := C.Videoio_Registry_GetCameraBackendPluginVersion(C.int(api), &version_abi, &version_api)\n\tdefer C.free(unsafe.Pointer(c_desc))\n\tdesc := C.GoString(c_desc)\n\n\treturn desc, int(version_abi), int(version_api)\n}\n\n// GetCameraBackends Returns list of available backends which works via gocv.VideoCapture(int index)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#ga043347faf6f5590b867a8b621906f7a9\nfunc (VideoRegistryType) GetCameraBackends() []VideoCaptureAPI {\n\tintVec := C.Videoio_Registry_GetCameraBackends()\n\tdefer C.IntVector_Close(intVec)\n\n\tc_ints := unsafe.Slice(intVec.val, int(intVec.length))\n\n\tints := make([]VideoCaptureAPI, len(c_ints))\n\n\tfor i, val := range c_ints {\n\t\tints[i] = VideoCaptureAPI(int(val))\n\t}\n\treturn ints\n}\n\n// GetStreamBackendPluginVersion Returns description and ABI/API version of videoio plugin's stream capture interface\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#gadf3c0c355f0917ccf754ac1af79d605a\nfunc (VideoRegistryType) GetStreamBackendPluginVersion(api VideoCaptureAPI) (string, int, int) {\n\tvar (\n\t\tversion_abi C.int\n\t\tversion_api C.int\n\t)\n\n\tc_desc := C.Videoio_Registry_GetStreamBackendPluginVersion(C.int(api), &version_abi, &version_api)\n\tdefer C.free(unsafe.Pointer(c_desc))\n\tdesc := C.GoString(c_desc)\n\n\treturn desc, int(version_abi), int(version_api)\n}\n\n// GetStreamBackends Returns list of available backends which works via gocv.VideoCapture(filename string)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#ga29296d4c06ed9a9ff8bddae9fe581de1\nfunc (VideoRegistryType) GetStreamBackends() []VideoCaptureAPI {\n\tintVec := C.Videoio_Registry_GetStreamBackends()\n\tdefer C.IntVector_Close(intVec)\n\n\tc_ints := unsafe.Slice(intVec.val, int(intVec.length))\n\n\tints := make([]VideoCaptureAPI, len(c_ints))\n\n\tfor i, val := range c_ints {\n\t\tints[i] = VideoCaptureAPI(int(val))\n\t}\n\treturn ints\n}\n\n// GetWriterBackendPluginVersion Returns description and ABI/API version of videoio plugin's writer interface.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#gac41a544552a08bf3dc8142d687fbe4e5\nfunc (VideoRegistryType) GetWriterBackendPluginVersion(api VideoCaptureAPI) (string, int, int) {\n\tvar (\n\t\tversion_abi C.int\n\t\tversion_api C.int\n\t)\n\n\tc_desc := C.Videoio_Registry_GetWriterBackendPluginVersion(C.int(api), &version_abi, &version_api)\n\tdefer C.free(unsafe.Pointer(c_desc))\n\tdesc := C.GoString(c_desc)\n\n\treturn desc, int(version_abi), int(version_api)\n}\n\n// GetWriterBackends Returns list of available backends which works via gocv.VideoWriter()\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#gaed03e49e6a45ca5b20afe1b9f78955e0\nfunc (VideoRegistryType) GetWriterBackends() []VideoCaptureAPI {\n\tintVec := C.Videoio_Registry_GetWriterBackends()\n\tdefer C.IntVector_Close(intVec)\n\n\tc_ints := unsafe.Slice(intVec.val, int(intVec.length))\n\n\tints := make([]VideoCaptureAPI, len(c_ints))\n\n\tfor i, val := range c_ints {\n\t\tints[i] = VideoCaptureAPI(int(val))\n\t}\n\treturn ints\n}\n\n// HasBackend Returns true if backend is available.\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#ga9068310d50ef430c2f5f6b185a99a24b\nfunc (VideoRegistryType) HasBackend(api VideoCaptureAPI) bool {\n\tb := C.Videoio_Registry_HasBackend(C.int(api))\n\treturn bool(b)\n}\n\n// IsBackendBuiltIn Returns true if backend is built in (false if backend is used as plugin)\n//\n// For further details, please see:\n// https://docs.opencv.org/4.x/de/db1/group__videoio__registry.html#gadf24ec0854bb893a75591306ad9f3878\nfunc (VideoRegistryType) IsBackendBuiltIn(api VideoCaptureAPI) bool {\n\tb := C.Videoio_Registry_IsBackendBuiltIn(C.int(api))\n\treturn bool(b)\n}\n"
  },
  {
    "path": "videoio.h",
    "content": "#ifndef _OPENCV3_VIDEOIO_H_\n#define _OPENCV3_VIDEOIO_H_\n\n#ifdef __cplusplus\n#include <opencv2/opencv.hpp>\n#include <opencv2/videoio/registry.hpp>\nextern \"C\" {\n#endif\n\n#include \"core.h\"\n\n#ifdef __cplusplus\ntypedef cv::VideoCapture* VideoCapture;\ntypedef cv::VideoWriter* VideoWriter;\n#else\ntypedef void* VideoCapture;\ntypedef void* VideoWriter;\n#endif\n\n// VideoCapture\nVideoCapture VideoCapture_New();\nvoid VideoCapture_Close(VideoCapture v);\nbool VideoCapture_Open(VideoCapture v, const char* uri);\nbool VideoCapture_OpenWithAPI(VideoCapture v, const char* uri, int apiPreference);\nbool VideoCapture_OpenWithAPIParams(VideoCapture v, const char* uri, int apiPreference, int *paramsv, int paramsc);\nbool VideoCapture_OpenDevice(VideoCapture v, int device);\nbool VideoCapture_OpenDeviceWithAPI(VideoCapture v, int device, int apiPreference);\nbool VideoCapture_OpenDeviceWithAPIParams(VideoCapture v, int device, int apiPreference, int *paramsv, int paramsc);\nOpenCVResult VideoCapture_Set(VideoCapture v, int prop, double param);\ndouble VideoCapture_Get(VideoCapture v, int prop);\nint VideoCapture_IsOpened(VideoCapture v);\nint VideoCapture_Read(VideoCapture v, Mat buf);\nOpenCVResult VideoCapture_Grab(VideoCapture v, int skip);\nint VideoCapture_Retrieve(VideoCapture v, Mat buf);\nint VideoCapture_RetrieveChannel(VideoCapture v, Mat buf, int channel);\n\n// VideoWriter\nVideoWriter VideoWriter_New();\nvoid VideoWriter_Close(VideoWriter vw);\nOpenCVResult VideoWriter_Open(VideoWriter vw, const char* name, const char* codec, double fps, int width,\n                      int height, bool isColor);\nOpenCVResult VideoWriter_OpenWithAPI(VideoWriter vw, const char* name, int apiPreference, const char* codec, double fps,\n                      int width, int height, bool isColor);\nOpenCVResult VideoWriter_OpenWithAPIParams(VideoWriter vw, const char* name, int apiPreference, const char* codec, double fps,\n                      int width, int height, IntVector params);\n\nint VideoWriter_IsOpened(VideoWriter vw);\nOpenCVResult VideoWriter_Write(VideoWriter vw, Mat img);\n\n//Videoio Query I/O API backends registry\nconst char* Videoio_Registry_GetBackendName(int api);\nIntVector Videio_Registry_GetBackends();\nconst char* Videoio_Registry_GetCameraBackendPluginVersion(int api, int* version_ABI, int* version_API);\nIntVector Videoio_Registry_GetCameraBackends();\nconst char* Videoio_Registry_GetStreamBackendPluginVersion(int api, int* version_ABI, int* version_API);\nIntVector Videoio_Registry_GetStreamBackends();\nconst char* Videoio_Registry_GetWriterBackendPluginVersion(int api, int* version_ABI, int* version_API);\nIntVector Videoio_Registry_GetWriterBackends();\nbool Videoio_Registry_HasBackend(int api);\nbool Videoio_Registry_IsBackendBuiltIn(int api);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif //_OPENCV3_VIDEOIO_H_\n"
  },
  {
    "path": "videoio_string.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_videoio)\n\npackage gocv\n\nfunc (c VideoCaptureAPI) String() string {\n\tswitch c {\n\tcase VideoCaptureAny:\n\t\treturn \"video-capture-any\"\n\tcase VideoCaptureV4L2:\n\t\treturn \"video-capture-v4l2\"\n\tcase VideoCaptureFirewire:\n\t\treturn \"video-capture-firewire\"\n\tcase VideoCaptureQT:\n\t\treturn \"video-capture-qt\"\n\tcase VideoCaptureUnicap:\n\t\treturn \"video-capture-unicap\"\n\tcase VideoCaptureDshow:\n\t\treturn \"video-capture-dshow\"\n\tcase VideoCapturePvAPI:\n\t\treturn \"video-capture-pvapi\"\n\tcase VideoCaptureOpenNI:\n\t\treturn \"video-capture-openni\"\n\tcase VideoCaptureOpenNIAsus:\n\t\treturn \"video-capture-openni-asus\"\n\tcase VideoCaptureAndroid:\n\t\treturn \"video-capture-android\"\n\tcase VideoCaptureXiAPI:\n\t\treturn \"video-capture-xiapi\"\n\tcase VideoCaptureAVFoundation:\n\t\treturn \"video-capture-av-foundation\"\n\tcase VideoCaptureGiganetix:\n\t\treturn \"video-capture-giganetix\"\n\tcase VideoCaptureMSMF:\n\t\treturn \"video-capture-msmf\"\n\tcase VideoCaptureWinRT:\n\t\treturn \"video-capture-winrt\"\n\tcase VideoCaptureIntelPerc:\n\t\treturn \"video-capture-intel-perc\"\n\tcase VideoCaptureOpenNI2:\n\t\treturn \"video-capture-openni2\"\n\tcase VideoCaptureOpenNI2Asus:\n\t\treturn \"video-capture-openni2-asus\"\n\tcase VideoCaptureGPhoto2:\n\t\treturn \"video-capture-gphoto2\"\n\tcase VideoCaptureGstreamer:\n\t\treturn \"video-capture-gstreamer\"\n\tcase VideoCaptureFFmpeg:\n\t\treturn \"video-capture-ffmpeg\"\n\tcase VideoCaptureImages:\n\t\treturn \"video-capture-images\"\n\tcase VideoCaptureAravis:\n\t\treturn \"video-capture-aravis\"\n\tcase VideoCaptureOpencvMjpeg:\n\t\treturn \"video-capture-opencv-mjpeg\"\n\tcase VideoCaptureIntelMFX:\n\t\treturn \"video-capture-intel-mfx\"\n\tcase VideoCaptureXINE:\n\t\treturn \"video-capture-xine\"\n\t}\n\treturn \"\"\n}\n\nfunc (c VideoCaptureProperties) String() string {\n\tswitch c {\n\tcase VideoCapturePosMsec:\n\t\treturn \"video-capture-pos-msec\"\n\tcase VideoCapturePosFrames:\n\t\treturn \"video-capture-pos-frames\"\n\tcase VideoCapturePosAVIRatio:\n\t\treturn \"video-capture-pos-avi-ratio\"\n\tcase VideoCaptureFrameWidth:\n\t\treturn \"video-capture-frame-width\"\n\tcase VideoCaptureFrameHeight:\n\t\treturn \"video-capture-frame-height\"\n\tcase VideoCaptureFPS:\n\t\treturn \"video-capture-fps\"\n\tcase VideoCaptureFOURCC:\n\t\treturn \"video-capture-fourcc\"\n\tcase VideoCaptureFrameCount:\n\t\treturn \"video-capture-frame-count\"\n\tcase VideoCaptureFormat:\n\t\treturn \"video-capture-format\"\n\tcase VideoCaptureMode:\n\t\treturn \"video-capture-mode\"\n\tcase VideoCaptureBrightness:\n\t\treturn \"video-capture-brightness\"\n\tcase VideoCaptureContrast:\n\t\treturn \"video-capture-contrast\"\n\tcase VideoCaptureSaturation:\n\t\treturn \"video-capture-saturation\"\n\tcase VideoCaptureHue:\n\t\treturn \"video-capture-hue\"\n\tcase VideoCaptureGain:\n\t\treturn \"video-capture-gain\"\n\tcase VideoCaptureExposure:\n\t\treturn \"video-capture-exposure\"\n\tcase VideoCaptureConvertRGB:\n\t\treturn \"video-capture-convert-rgb\"\n\tcase VideoCaptureWhiteBalanceBlueU:\n\t\treturn \"video-capture-white-balanced-blue-u\"\n\tcase VideoCaptureWhiteBalanceRedV:\n\t\treturn \"video-capture-white-balanced-red-v\"\n\tcase VideoCaptureRectification:\n\t\treturn \"video-capture-rectification\"\n\tcase VideoCaptureMonochrome:\n\t\treturn \"video-capture-monochrome\"\n\tcase VideoCaptureSharpness:\n\t\treturn \"video-capture-sharpness\"\n\tcase VideoCaptureAutoExposure:\n\t\treturn \"video-capture-auto-exposure\"\n\tcase VideoCaptureGamma:\n\t\treturn \"video-capture-gamma\"\n\tcase VideoCaptureTemperature:\n\t\treturn \"video-capture-temperature\"\n\tcase VideoCaptureTrigger:\n\t\treturn \"video-capture-trigger\"\n\tcase VideoCaptureTriggerDelay:\n\t\treturn \"video-capture-trigger-delay\"\n\tcase VideoCaptureZoom:\n\t\treturn \"video-capture-zoom\"\n\tcase VideoCaptureFocus:\n\t\treturn \"video-capture-focus\"\n\tcase VideoCaptureGUID:\n\t\treturn \"video-capture-guid\"\n\tcase VideoCaptureISOSpeed:\n\t\treturn \"video-capture-iso-speed\"\n\tcase VideoCaptureBacklight:\n\t\treturn \"video-capture-backlight\"\n\tcase VideoCapturePan:\n\t\treturn \"video-capture-pan\"\n\tcase VideoCaptureTilt:\n\t\treturn \"video-capture-tilt\"\n\tcase VideoCaptureRoll:\n\t\treturn \"video-capture-roll\"\n\tcase VideoCaptureIris:\n\t\treturn \"video-capture-iris\"\n\tcase VideoCaptureSettings:\n\t\treturn \"video-capture-settings\"\n\tcase VideoCaptureBufferSize:\n\t\treturn \"video-capture-buffer-size\"\n\tcase VideoCaptureAutoFocus:\n\t\treturn \"video-capture-auto-focus\"\n\tcase VideoCaptureSarNumerator:\n\t\treturn \"video-capture-sar-numerator\"\n\tcase VideoCaptureSarDenominator:\n\t\treturn \"video-capture-sar-denominator\"\n\tcase VideoCaptureBackend:\n\t\treturn \"video-capture-backend\"\n\tcase VideoCaptureChannel:\n\t\treturn \"video-capture-channel\"\n\tcase VideoCaptureAutoWB:\n\t\treturn \"video-capture-auto-wb\"\n\tcase VideoCaptureWBTemperature:\n\t\treturn \"video-capture-wb-temperature\"\n\tcase VideoCaptureCodecPixelFormat:\n\t\treturn \"video-capture-pixel-format\"\n\tcase VideoCaptureBitrate:\n\t\treturn \"video-capture-bitrate\"\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "videoio_test.go",
    "content": "//go:build !gocv_specific_modules || (gocv_specific_modules && gocv_videoio)\n\npackage gocv\n\nimport (\n\t\"io/ioutil\"\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestVideoCaptureEmptyNumericalParameters(t *testing.T) {\n\t_, err := VideoWriterFile(\n\t\t\"images/small.mp4\", \"MJPEG\", 0, 0, 0, true)\n\tif err == nil {\n\t\tt.Error(\"Must fail due to an empty numerical parameters.\")\n\t}\n\tif !strings.Contains(err.Error(), \"one of the numerical parameters is equal to zero\") {\n\t\tt.Errorf(\"Must fail due to an empty numerical \"+\n\t\t\t\"parameters, but have different error: %v\", err)\n\t}\n}\n\nfunc TestVideoCaptureCodecString(t *testing.T) {\n\tvc, err := OpenVideoCapture(\"images/small.mp4\")\n\tif err != nil {\n\t\tt.Errorf(\"TestVideoCaptureCodecString: error loading a file: %v\", err)\n\t}\n\tif vc.CodecString() == \"\" {\n\t\tt.Fatal(\"TestVideoCaptureCodecString: empty codec string\")\n\t}\n}\n\nfunc TestVideoCaptureCodecConversion(t *testing.T) {\n\tvc, err := OpenVideoCapture(\"images/small.mp4\")\n\tif err != nil {\n\t\tt.Errorf(\"TestVideoCaptureCodecConversion: error loading a file: %v\", err)\n\t}\n\tif vc.CodecString() == \"\" {\n\t\tt.Fatal(\"TestVideoCaptureCodecConversion: empty codec string\")\n\t}\n\tif int64(vc.ToCodec(vc.CodecString())) != int64(vc.Get(VideoCaptureFOURCC)) {\n\t\tt.Fatal(\"TestVideoCaptureCodecConversion: codec conversion failed\")\n\t}\n}\n\nfunc TestVideoCaptureCodecConversionBadInput(t *testing.T) {\n\tvc, err := OpenVideoCapture(\"images/small.mp4\")\n\tif err != nil {\n\t\tt.Errorf(\"TestVideoCaptureCodecString: error loading a file: %v\", err)\n\t}\n\tcodec := vc.ToCodec(\"BAD CODEC\")\n\tif int64(codec) != -1 {\n\t\tt.Fatal(\"TestVideoCaptureCodecConversionBadInput: input validation failed\")\n\t}\n}\n\nfunc TestVideoCaptureInvalid(t *testing.T) {\n\t_, err := OpenVideoCapture(1.1)\n\tif err == nil {\n\t\tt.Errorf(\"Should return error with invalid param\")\n\t}\n}\n\nfunc TestVideoCaptureWithAPI(t *testing.T) {\n\tt.Run(\"video capture file with api\", func(t *testing.T) {\n\t\tvc, err := OpenVideoCaptureWithAPI(\"images/small.mp4\", VideoCaptureAny)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"error loading a file: %v\", err)\n\t\t}\n\t\tbackend := vc.Get(VideoCaptureBackend)\n\t\tif backend == float64(VideoCaptureAny) {\n\t\t\tt.Errorf(\"video capture backend api did not select a backend\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture unknown device with api\", func(t *testing.T) {\n\t\t_, err := OpenVideoCaptureWithAPI(math.MaxInt32, VideoCaptureAny)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error opening device\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture invalid with api\", func(t *testing.T) {\n\t\t_, err := OpenVideoCaptureWithAPI(1.1, VideoCaptureAny)\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error with invalid param\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture valid int string with api no available device\", func(t *testing.T) {\n\t\tvc5, err := OpenVideoCaptureWithAPI(\"99\", VideoCaptureAny)\n\t\tdefer vc5.Close()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error opening device\")\n\t\t}\n\t})\n}\n\nfunc TestVideoCaptureWithAPIParams(t *testing.T) {\n\tvc, _ := OpenVideoCaptureWithAPIParams(0, VideoCaptureAny, []VideoCaptureProperties{VideoCaptureHWAcceleration, 1, VideoCaptureHWDevice, 0})\n\tdefer vc.Close()\n\n}\n\nfunc TestVideoCaptureFileWithAPIParams(t *testing.T) {\n\tvc, _ := OpenVideoCaptureWithAPIParams(\"images/small.mp4\", VideoCaptureAny, []VideoCaptureProperties{VideoCaptureHWAcceleration, 1, VideoCaptureHWDevice, 0})\n\tdefer vc.Close()\n\n}\n\nfunc TestVideoCaptureFile(t *testing.T) {\n\tvc, err := VideoCaptureFile(\"images/small.mp4\")\n\tdefer vc.Close()\n\n\tif err != nil {\n\t\tt.Errorf(\"%s\", err)\n\t}\n\n\tif !vc.IsOpened() {\n\t\tt.Error(\"Unable to open VideoCaptureFile\")\n\t}\n\n\tif fw := vc.Get(VideoCaptureFrameWidth); int(fw) != 560 {\n\t\tt.Errorf(\"Expected frame width property of 560.0 got %f\", fw)\n\t}\n\tif fh := vc.Get(VideoCaptureFrameHeight); int(fh) != 320 {\n\t\tt.Errorf(\"Expected frame height property of 320.0 got %f\", fh)\n\t}\n\n\tvc.Set(VideoCaptureBrightness, 100.0)\n\n\tvc.Grab(10)\n\n\timg := NewMat()\n\tdefer img.Close()\n\n\tvc.Read(&img)\n\tif img.Empty() {\n\t\tt.Error(\"Unable to read VideoCaptureFile\")\n\t}\n\n\t// video capture file with non-existent video\n\tvc2, err := VideoCaptureFile(\"nonexistent.mp4\")\n\tdefer vc2.Close()\n\n\tif err == nil {\n\t\tt.Errorf(\"Expected error when opening invalid file\")\n\t}\n\n\tt.Run(\" video capture file with api\", func(t *testing.T) {\n\t\tvc3, err := VideoCaptureFileWithAPI(\"images/small.mp4\", VideoCaptureAny)\n\t\tdefer vc3.Close()\n\t\tif err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t})\n\n\tt.Run(\"video capture non-existent video with api\", func(t *testing.T) {\n\t\tvc4, err := VideoCaptureFileWithAPI(\"nonexistent.mp4\", VideoCaptureAny)\n\t\tdefer vc4.Close()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"Expected error when opening invalid file\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture invalid int\", func(t *testing.T) {\n\t\tvc5, err := OpenVideoCapture(math.MaxInt32)\n\t\tdefer vc5.Close()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error opening device\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture invalid string\", func(t *testing.T) {\n\t\tvc5, err := OpenVideoCapture(\"test-device\")\n\t\tdefer vc5.Close()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error opening device\")\n\t\t}\n\t})\n\n\tt.Run(\"video capture valid string\", func(t *testing.T) {\n\t\tvc5, err := OpenVideoCapture(strconv.Itoa(math.MaxInt32))\n\t\tdefer vc5.Close()\n\t\tif err == nil {\n\t\t\tt.Errorf(\"should return error opening device\")\n\t\t}\n\t})\n}\n\nfunc TestVideoWriterFile(t *testing.T) {\n\tdir, _ := ioutil.TempDir(\"\", \"gocvtests\")\n\ttmpfn := filepath.Join(dir, \"test.avi\")\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in VideoWriterFile test\")\n\t}\n\tdefer img.Close()\n\n\tvw, _ := VideoWriterFile(tmpfn, \"MJPG\", 25, img.Cols(), img.Rows(), true)\n\tdefer vw.Close()\n\n\tif !vw.IsOpened() {\n\t\tt.Error(\"Unable to open VideoWriterFile\")\n\t}\n\n\terr := vw.Write(img)\n\tif err != nil {\n\t\tt.Error(\"Invalid Write() in VideoWriter\")\n\t}\n}\n\nfunc TestVideoWriterFileWithAPI(t *testing.T) {\n\tdir := os.TempDir()\n\ttmpfn := filepath.Join(dir, \"test.avi\")\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in VideoWriterFile test\")\n\t}\n\tdefer img.Close()\n\n\tvw, _ := VideoWriterFileWithAPI(tmpfn, VideoCaptureFFmpeg, \"MJPG\", 25, img.Cols(), img.Rows(), true)\n\tdefer vw.Close()\n\n\tif !vw.IsOpened() {\n\t\tt.Error(\"Unable to open VideoWriterFile\")\n\t}\n\n\terr := vw.Write(img)\n\tif err != nil {\n\t\tt.Error(\"Invalid Write() in VideoWriter\")\n\t}\n}\n\nfunc TestVideoWriterFileWithAPIParams(t *testing.T) {\n\tdir := os.TempDir()\n\ttmpfn := filepath.Join(dir, \"test.avi\")\n\n\timg := IMRead(\"images/face-detect.jpg\", IMReadColor)\n\tif img.Empty() {\n\t\tt.Error(\"Invalid read of Mat in VideoWriterFile test\")\n\t}\n\tdefer img.Close()\n\n\tvw, _ := VideoWriterFileWithAPIParams(tmpfn, VideoCaptureFFmpeg, \"MJPG\", 25, img.Cols(), img.Rows(),\n\t\t[]VideoWriterProperty{VideoWriterHwAcceleration, 0, VideoWriterIsColor, 1})\n\tdefer vw.Close()\n\n\tif !vw.IsOpened() {\n\t\tt.Error(\"Unable to open VideoWriterFile\")\n\t}\n\n\terr := vw.Write(img)\n\tif err != nil {\n\t\tt.Error(\"Invalid Write() in VideoWriter\")\n\t}\n}\n\nfunc TestVideoCaptureFile_GrabRetrieve(t *testing.T) {\n\tvc, err := VideoCaptureFile(\"images/small.mp4\")\n\tdefer vc.Close()\n\n\tif err != nil {\n\t\tt.Errorf(\"%s\", err)\n\t}\n\n\tif !vc.IsOpened() {\n\t\tt.Error(\"Unable to open VideoCaptureFile\")\n\t}\n\n\tif fw := vc.Get(VideoCaptureFrameWidth); int(fw) != 560 {\n\t\tt.Errorf(\"Expected frame width property of 560.0 got %f\", fw)\n\t}\n\tif fh := vc.Get(VideoCaptureFrameHeight); int(fh) != 320 {\n\t\tt.Errorf(\"Expected frame height property of 320.0 got %f\", fh)\n\t}\n\n\tvc.Set(VideoCaptureBrightness, 100.0)\n\n\tvc.Grab(10)\n\n\timg := NewMat()\n\tdefer img.Close()\n\n\tif ok := vc.Retrieve(&img); !ok {\n\t\tt.Error(\"Unable to read VideoCaptureFile\")\n\t}\n\tif img.Empty() {\n\t\tt.Error(\"Unable to read VideoCaptureFile\")\n\t}\n}\n\nfunc TestVideoCaptureFile_GrabRetrieveChannel(t *testing.T) {\n\tvc, err := VideoCaptureFile(\"images/small.mp4\")\n\tdefer vc.Close()\n\n\tif err != nil {\n\t\tt.Errorf(\"%s\", err)\n\t}\n\n\tif !vc.IsOpened() {\n\t\tt.Error(\"Unable to open VideoCaptureFile\")\n\t}\n\n\tif fw := vc.Get(VideoCaptureFrameWidth); int(fw) != 560 {\n\t\tt.Errorf(\"Expected frame width property of 560.0 got %f\", fw)\n\t}\n\tif fh := vc.Get(VideoCaptureFrameHeight); int(fh) != 320 {\n\t\tt.Errorf(\"Expected frame height property of 320.0 got %f\", fh)\n\t}\n\n\tvc.Set(VideoCaptureBrightness, 100.0)\n\n\tvc.Grab(10)\n\n\timg := NewMat()\n\tdefer img.Close()\n\n\tif ok := vc.RetrieveChannel(&img, 0); !ok {\n\t\tt.Error(\"Unable to read VideoCaptureFile\")\n\t}\n\tif img.Empty() {\n\t\tt.Error(\"Unable to read VideoCaptureFile\")\n\t}\n}\n\nfunc TestVideoRegistry(t *testing.T) {\n\n\tname := VideoRegistry.GetBackendName(VideoCaptureFFmpeg)\n\tt.Log(\"VideoRegistry.GetBackendName()\", name)\n\n\tbacks := VideoRegistry.GetBackends()\n\tfor _, b := range backs {\n\t\tt.Log(\"VideoRegistry.GetBackends()\", b.String())\n\t}\n\n\tcameraBacks := VideoRegistry.GetCameraBackends()\n\tfor _, b := range cameraBacks {\n\t\tt.Log(\"VideoRegistry.GetCameraBackends()\", b.String())\n\t\tif !VideoRegistry.IsBackendBuiltIn(b) && VideoRegistry.HasBackend(b) {\n\n\t\t\tdescription, abiVersion, apiVersion := VideoRegistry.GetCameraBackendPluginVersion(b)\n\t\t\tt.Log(\"VideoRegistry.GetCameraBackendPluginVersion()\", description, abiVersion, apiVersion)\n\t\t}\n\t}\n\n\tstreamBacks := VideoRegistry.GetStreamBackends()\n\tfor _, b := range streamBacks {\n\t\tt.Log(\"VideoRegistry.GetStreamBackends()\", b.String())\n\t\tif !VideoRegistry.IsBackendBuiltIn(b) && VideoRegistry.HasBackend(b) {\n\n\t\t\tdescription, abiVersion, apiVersion := VideoRegistry.GetStreamBackendPluginVersion(b)\n\t\t\tt.Log(\"VideoRegistry.GetStreamBackendPluginVersion()\", description, abiVersion, apiVersion)\n\t\t}\n\t}\n\n\twriterBacks := VideoRegistry.GetWriterBackends()\n\n\tfor _, b := range writerBacks {\n\t\tt.Log(\"VideoRegistry.GetWriterBackends()\", b.String())\n\t\tif !VideoRegistry.IsBackendBuiltIn(b) && VideoRegistry.HasBackend(b) {\n\n\t\t\tdescription, abiVersion, apiVersion := VideoRegistry.GetWriterBackendPluginVersion(b)\n\t\t\tt.Log(\"VideoRegistry.GetWriterBackendPluginVersion()\", description, abiVersion, apiVersion)\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "win_build_opencv.cmd",
    "content": "@echo off\n\nREM Save the starting directory\nset \"START_DIR=%CD%\"\n\nREM Set install directory, default to C:\\opencv if not provided\nset \"INSTALL_DIR=%~1\"\nif \"%INSTALL_DIR%\"==\"\" set \"INSTALL_DIR=C:\\opencv\"\n\nREM Always quote paths to handle spaces\nif not exist \"%INSTALL_DIR%\\build\" mkdir \"%INSTALL_DIR%\\build\"\n\nREM Change to build directory\ncd /D \"%INSTALL_DIR%\\build\"\n\nREM Set enable_shared default\nset \"enable_shared=ON\"\nif /I \"%2\"==\"static\" (\n  echo Build static opencv\n  set \"enable_shared=OFF\"\n)\n\nREM Use variables for version\nset \"OPENCV_VERSION=4.13.0\"\n\nREM Run CMake with quoted paths\ncmake \"%INSTALL_DIR%\\opencv-%OPENCV_VERSION%\" -G \"MinGW Makefiles\" -B\"%INSTALL_DIR%\\build\" -DENABLE_CXX11=ON -DOPENCV_EXTRA_MODULES_PATH=\"%INSTALL_DIR%\\opencv_contrib-%OPENCV_VERSION%\\modules\" -DBUILD_SHARED_LIBS=%enable_shared% -DWITH_IPP=OFF -DWITH_MSMF=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=ON -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_DOCS=OFF -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_saliency=OFF -DBUILD_opencv_wechat_qrcode=ON -DCPU_DISPATCH= -DOPENCV_GENERATE_PKGCONFIG=ON -DWITH_OPENCL_D3D11_NV=OFF -DOPENCV_ALLOCATOR_STATS_COUNTER_TYPE=int64_t -DOPENCV_ENABLE_NONFREE=ON -Wno-dev\n\nif errorlevel 1 (\n    echo CMake configuration failed!\n    cd /D \"%START_DIR%\"\n    exit /b 1\n)\n\ncmake --build . --target install\nif errorlevel 1 (\n    echo Build failed!\n    cd /D \"%START_DIR%\"\n    exit /b 1\n)\n\nREM Return to the original directory\ncd /D \"%START_DIR%\""
  },
  {
    "path": "win_download_opencv.cmd",
    "content": "@echo off\n\nREM Save the starting directory\nset \"START_DIR=%CD%\"\n\nREM Set install directory, default to C:\\opencv if not provided\nset \"INSTALL_DIR=%~1\"\nif \"%INSTALL_DIR%\"==\"\" set \"INSTALL_DIR=C:\\opencv\"\n\nif not exist \"%INSTALL_DIR%\" mkdir \"%INSTALL_DIR%\"\n\necho Downloading OpenCV sources\necho.\necho For monitoring the download progress please check the %INSTALL_DIR% directory.\necho.\n\nREM This is why there is no progress bar:\nREM https://github.com/PowerShell/PowerShell/issues/2138\n\nREM Downloading: opencv-4.13.0.zip [91MB]\npowershell -command \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri 'https://github.com/opencv/opencv/archive/4.13.0.zip' -OutFile \\\"%INSTALL_DIR%\\opencv-4.13.0.zip\\\"\"\necho Extracting...\npowershell -command \"$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path \\\"%INSTALL_DIR%\\opencv-4.13.0.zip\\\" -DestinationPath \\\"%INSTALL_DIR%\\\"\"\ndel \"%INSTALL_DIR%\\opencv-4.13.0.zip\" /q\necho.\n\necho Downloading: opencv_contrib-4.13.0.zip [58MB]\npowershell -command \"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri 'https://github.com/opencv/opencv_contrib/archive/4.13.0.zip' -OutFile \\\"%INSTALL_DIR%\\opencv_contrib-4.13.0.zip\\\"\"\necho Extracting...\npowershell -command \"$ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path \\\"%INSTALL_DIR%\\opencv_contrib-4.13.0.zip\\\" -DestinationPath \\\"%INSTALL_DIR%\\\"\"\ndel \"%INSTALL_DIR%\\opencv_contrib-4.13.0.zip\" /q\necho.\n\necho Done with downloading and extracting sources.\necho.\n\n@echo on\n\nREM Return to the original directory\nchdir /D \"%START_DIR%\""
  }
]