Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Call to undefined function CV\findContours() #61

Open
michabbb opened this issue Aug 17, 2023 · 1 comment
Open

Call to undefined function CV\findContours() #61

michabbb opened this issue Aug 17, 2023 · 1 comment

Comments

@michabbb
Copy link

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!!

@BbenWeb1
Copy link

hi.
Yes, this function does not exist by this name, but by another name

Another name is findContoursWithoutHierarchy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants