Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Call to undefined function CV\findContours() #61

Open
@michabbb

Description

@michabbb

hi,

i am using php 8.2.8 via docker:

RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
RUN unzip opencv.zip
RUN mkdir -p build && cd build && cmake ../opencv-4.x && cmake --build . && make install

RUN apt-get install -y libopencv-dev
RUN git clone https://github.com/php-opencv/php-opencv.git
RUN cd php-opencv && phpize && ./configure --with-php-config=/usr/local/bin/php-config && make && make install && make test
RUN echo "extension=opencv.so" > /usr/local/etc/php/conf.d/docker-php-ext-opencv.ini

and here´s my code:

<?php

use function CV\{imread, cvtColor, GaussianBlur, threshold, findContours, drawContours, minAreaRect};
use const CV\{COLOR_BGR2GRAY, THRESH_BINARY, THRESH_OTSU, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE};
use CV\Size;
// ..................
list($contours, $_) = findContours($thresh, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE);

I don´t understand why findContours is not available.
is my opencv version too old or did I miss something while compiling it ???

thanks for any help!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions