Bug 1254673 - Digikam won't build with OpenCV version 3
Summary: Digikam won't build with OpenCV version 3
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: digikam
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Steven M. Parrish
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1246056 digikam-5.0
Blocks: opencv3
TreeView+ depends on / blocked
 
Reported: 2015-08-18 15:49 UTC by Viktor Jancik
Modified: 2016-02-12 01:37 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-12 01:37:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
digikam-4.12.0-opencv3.patch (5.55 KB, patch)
2015-08-18 17:12 UTC, Viktor Jancik
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
KDE Software Compilation 349601 0 None None None Never

Description Viktor Jancik 2015-08-18 15:49:33 UTC
Description of problem:
Digikam is dependent on OpenCV and Fedora is migrating to OpenCV 3.
However digikam isn't compatible with OpenCV 3 and uses some functionality that didn't make it to OpenCV 3 from OpenCV 2.4

Version-Release number of selected component (if applicable):
digikam 4.12.0

Comment 1 Viktor Jancik 2015-08-18 15:56:29 UTC
Digikam depends on libkface, which is also incompatible with OpenCV 3 as it is right now in rawhide.

Comment 2 Viktor Jancik 2015-08-18 17:12:20 UTC
Created attachment 1064382 [details]
digikam-4.12.0-opencv3.patch

Fixes the issue.

cvCreateMat returns cvMat but variable d is of type Mat, a 1 to 1 replacement was possible with the Mat constructor.
In core/libs/database/imgqsort/imgqsort.cpp vector containers were missing the std:: namespace prefix. How did it build before?
In extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp I had to add a definition of cvFillImage because it was removed from OpenCV 3. The definition is exactly the same as it was in OpenCV 2.4.11.
I had to conditionally disable the building of ipptest because it used a function that no longer exists in OpenCV 3 (cvGetModuleInfo) and I couldn't find / create a replacement. As a consequence, I am not sure if the tests pass properly, because I am not sure if this is a good way to disable a test.
And lastly, I had to modify the includes in 2 libopencv.h files and modify the OPENCV_TEST_VERSION macros as they didn't work as intended for versions 2.3.0 up to 2.4.X Yes, there are two libopencv.h files.

Successful build with these changes can be seen here:
https://copr.fedoraproject.org/coprs/vjancik/opencv3-deps/build/109686/

Comment 3 Viktor Jancik 2015-10-13 14:01:00 UTC
A fix for this issue was released with Digikam version 4.14.0.

Could you update Digikam to that version in Rawhide?

Reportedly, there is information on a new compile option in the libkface README.txt file, which let's you choose between OpenCV3 and OpenCV2 for backwards compatibility.

Comment 4 nucleo 2015-10-13 16:25:59 UTC
(In reply to Viktor Jancik from comment #3)
> A fix for this issue was released with Digikam version 4.14.0.

4.14.0 sources not available yet http://download.kde.org/stable/digikam/
When tarball will be available it will be built for Rawhide.

Comment 5 Sergio Basto 2015-11-26 13:42:58 UTC
Victor , 
 4.14.0. is built for f24, f23 and f22 [1]


[1] http://koji.fedoraproject.org/koji/packageinfo?packageID=1593

Comment 6 Sergio Basto 2015-11-26 14:13:41 UTC
still falling [1] 

--  libopencv found.......................... NO


[1] 
https://copr.fedoraproject.org/coprs/sergiomb/opencv/build/142674/

Comment 7 Rex Dieter 2015-12-31 00:24:43 UTC
digikam-5.0.0 presumably natively supports opencv (though I haven't tested it yet)

Comment 8 Rex Dieter 2016-01-05 12:56:54 UTC
Note, requires build time cmake flag:  -DENABLE_OPENCV3:BOOL=ON

Comment 9 Sergio Basto 2016-01-07 19:26:46 UTC
Build of digikam-5.0.0-0.1.beta2.fc23.src.rpm succeeded for F23 and F22 [1] .
 
kf5-libkface and digikam needs add -DENABLE_OPENCV3:BOOL=ON in .spec to build. 

I have also build kf5-libkdcraw, kf5-libksane,  kf5-libkface, kf5-libkipi before.

[1] https://copr.fedoraproject.org/coprs/sergiomb/opencv/build/152093/

Build of digikam fails in rawhide in lensfunfilter.cpp : 

In file included from /builddir/build/BUILD/digikam-5.0.0-beta2/core/libs/dimg/filters/lens/lensfuniface.h:29:0,
                 from /builddir/build/BUILD/digikam-5.0.0-beta2/core/libs/dimg/filters/lens/lensfunfilter.cpp:32:
/usr/include/lensfun/lensfun.h:2506:5: error: template with C linkage
     template<typename T> static void ModifyColor_Vignetting_PA (
     ^
/usr/include/lensfun/lensfun.h:2508:5: error: template with C linkage
     template<typename T> static void ModifyColor_DeVignetting_PA (
     ^
core/libs/dimg/CMakeFiles/dimg_src.dir/build.make:2465: recipe for target 'core/libs/dimg/CMakeFiles/dimg_src.dir/filters/lens/lensfunfilter.cpp.o' failed
make[2]: *** [core/libs/dimg/CMakeFiles/dimg_src.dir/filters/lens/lensfunfilter.cpp.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/digikam-5.0.0-beta2/x86_64-redhat-linux-gnu'
CMakeFiles/Makefile2:2797: recipe for target 'core/libs/dimg/CMakeFiles/dimg_src.dir/all' failed

Comment 11 Rex Dieter 2016-02-12 01:37:13 UTC
digikam-5.0.0-beta3 is imported into rawhide, it should also include a fix for the aforementioned lensfunfilter issue


Note You need to log in before you can comment on or make changes to this bug.