Dear maintainer,
Your package fails to build from source against opencv 5.0.0+dfsg-1~exp1,
currently in experimental.
OpenCV 5.0 renames its entire install tree from opencv4 to opencv5 and ships
no compatibility shims:
* pkg-config: only /usr/lib/<triplet>/pkgconfig/opencv5.pc. There is no
opencv4.pc and no opencv.pc.
* headers: /usr/include/opencv5/opencv2/..., no /usr/include/opencv4.
* cmake: /usr/lib/<triplet>/cmake/opencv5/OpenCVConfig.cmake. A bare
find_package(OpenCV) still resolves, but a pinned version
such as find_package(OpenCV 4.7) no longer matches.
* modules: libopencv-calib3d-dev is split into libopencv-calib-dev,
libopencv-geometry-dev, libopencv-stereo-dev and
libopencv-ptcloud-dev; libopencv-features2d-dev becomes
libopencv-features-dev. The CMake component names change
with them (features2d -> features).
* geometry: the new geometry module is not only a piece of calib3d. It
also absorbs shape and contour functions that used to live
in imgproc -- contourArea, arcLength, approxPolyDP,
boundingRect, minAreaRect, convexHull and
getPerspectiveTransform among them -- and opencv2/opencv.hpp
does not pull in opencv2/geometry.hpp, so code that reached
those through the umbrella header now needs an explicit
include of opencv2/geometry.hpp.
In lomiri-camerascanner-app's case,
plugins/ImageProcessing/ONSExtractor.cpp calls contourArea (line 27),
arcLength (line 119), approxPolyDP (line 123), boundingRect (line 144) and
getPerspectiveTransform (line 200) unqualified, relying on a
using-namespace-cv directive; cv::Mat, cv::Rect and cv::Size resolve fine
on the same lines, so this is not a missing include path. Under opencv5
these five functions are no longer declared by opencv2/imgproc.hpp: they
were relocated out of imgproc into the new geometry module
(opencv2/geometry.hpp, backed by libopencv-geometry-dev /
libopencv-geometry500), which also absorbs pose-estimation code formerly
in calib3d, and neither the flat nor the nested imgproc/highgui spellings
reach that header -- the nested opencv2/imgproc/imgproc.hpp wrapper still
just forwards to the flat opencv2/imgproc.hpp, so switching between the
two spellings changes nothing. The top-level opencv2/opencv.hpp umbrella
does not include opencv2/geometry.hpp either, so ONSExtractor.h's umbrella
include cannot supply these declarations regardless of spelling. Fixing
the FTBFS requires adding an explicit #include <opencv2/geometry.hpp>
wherever these functions are used, plus adding the geometry component to
the package's OpenCV CMake lookup and build-dependencies.
The same source builds fine in the same chroot against the OpenCV 4.10
packages currently in unstable, so this is specific to OpenCV 5.
The relevant part of the build log follows; the full log is attached.
make[3]: Entering directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
Consolidate compiler generated dependencies of target ImageProcessing
make[3]: Leaving directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
make -f plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/build.make
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/build
make[3]: Entering directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
[ 56%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/DocumentStore.cpp.o
[ 60%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/ImageProcessing_autogen/mocs_compilation.cpp.o
[ 65%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/plugin.cpp.o
[ 73%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/ImageProcessing.cpp.o
[ 73%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/Document.cpp.o
[ 78%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/ONSExtractor.cpp.o
[ 82%] Building CXX object
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/ExtractorConfig.cpp.o
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:
In member function ‘bool BorderSort::operator()(const Border&, const
Border&) const’:
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:27:16:
error: ‘contourArea’ was not declared in this scope
27 | return contourArea(a) < contourArea(b);
| ^~~~~~~~~~~
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:119:22:
error: ‘arcLength’ was not declared in this scope
119 | float peri = arcLength(c2f, true);
| ^~~~~~~~~
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:123:9:
error: ‘approxPolyDP’ was not declared in this scope
123 | approxPolyDP(c2f, approx, 0.02 * peri, true);
| ^~~~~~~~~~~~
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:137:36:
error: ‘contourArea’ was not declared in this scope
137 | const double cornersArea = contourArea(cornerPoints);
| ^~~~~~~~~~~
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:144:28:
error: ‘boundingRect’ was not declared in this scope
144 | Rect boxPolygone = boundingRect(points);
| ^~~~~~~~~~~~
[ 86%] Linking CXX executable camerascanner
/usr/bin/cmake -E cmake_link_script
CMakeFiles/camerascanner.dir/link.txt --verbose=1
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:
In function ‘void rectify(const Quad&, const cv::Mat&, cv::Mat&)’:
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/ONSExtractor.cpp:200:13:
error: ‘getPerspectiveTransform’ was not declared in this scope
200 | Mat m = getPerspectiveTransform(src_mat, dst_mat);
| ^~~~~~~~~~~~~~~~~~~~~~~
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/DocumentStore.cpp:
In member function ‘QString
DocumentScanner::DocumentStore::exportPdf(const QStringList&) const’:
308 | pdfwriter.setPageSize(QPagedPaintDevice::A4);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/QPdfWriter:1,
from
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/DocumentStore.cpp:8:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qpdfwriter.h:96:10: note:
declared here
96 | void setPageSize(PageSize size) override;
| ^~~~~~~~~~~
make[3]: Leaving directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
[ 91%] Built target camerascanner
make[3]: *** [plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/build.make:158:
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/ONSExtractor.cpp.o]
Error 1
make[3]: *** Waiting for unfinished jobs....
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/DocumentStore.cpp:
In member function ‘bool
DocumentScanner::DocumentStore::isExtractedDoc(const QString&) const’:
/build/reproducible-path/lomiri-camerascanner-app-0.5.1/plugins/ImageProcessing/DocumentStore.cpp:341:15:
warning: control reaches end of non-void function [-Wreturn-type]
341 | qDebug() << "Tried to access document with invalid id " << id;
| ^
make[3]: Leaving directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:537:
plugins/ImageProcessing/CMakeFiles/ImageProcessing.dir/all] Error 2
make[2]: Leaving directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory
'/build/reproducible-path/lomiri-camerascanner-app-0.5.1/obj-x86_64-linux-gnu'
dh_auto_build: error: cd obj-x86_64-linux-gnu && make -j40
INSTALL="install --strip-program=true" VERBOSE=1 returned exit code 2
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with
exit status 2
--------------------------------------------------------------------------------
Please close this bug if it turns out to be a collision with another ongoing
transition rather than an OpenCV 5 problem.
Thanks,
Aron