Git Product home page Git Product logo

Comments (8)

TianZerL avatar TianZerL commented on May 26, 2024

理论上用最新的OpenCV4就行,当时最新的版本应该是4.5左右,但是官网的预编译包应该是不带FFmpeg的,如果需要视频处理的话,最好是自己编译OpenCV。

关于O0和gnu++11,可能你引了OpenCV的Debug库,也有可能是你的CMakeFiles里写了相应的SET,单纯的OpenCV库应该是不会自己往编译器加参数的。

from anime4kcpp.

TianZerL avatar TianZerL commented on May 26, 2024

然后Core的代码最好不要用release的2.5.0版本,用库里最新的。

from anime4kcpp.

liguobing avatar liguobing commented on May 26, 2024

哈喽,我又来了 T_T

因为我的需求只是处理图片,所以我就没有自己编译 OpenCV

我是直接使用的 Anime4KCPP_Android CMakeList.txt
OpenCV 也是直接在 opencvReleases 下载的。

另外我使用了库里最新的 core 替换了 Anime4KCPP_Android 中的 Anime4KCore 中的文件,但是提示 E:/Work_Space/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\AC.hpp:17:10: fatal error: 'ac_export.h' file not found

ac_export.h 这个头文件又是哪里的呢?

from anime4kcpp.

TianZerL avatar TianZerL commented on May 26, 2024

主库最新代码的ac_export.h是core里面的CMakeLists.txt生成的。

另外Anime4KCPP_Android自带的Anime4KCore不可以直接编译吗?我看你将里面的Anime4KCore替换为了2.5.0 Release的。

from anime4kcpp.

liguobing avatar liguobing commented on May 26, 2024

clone Anime4KCPP_Android ,然后修改 CMakeLists.txt 中到 OpenCV OpenCL EIGEN3 路径之后,rebuild 出错,提示:

D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:76:39: error: no member named 'setprecision' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:77:25: error: no member named 'setw' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:78:43: error: no member named 'setw' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:79:46: error: no member named 'setw' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:89:35: error: no member named 'setprecision' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:90:21: error: no member named 'setw' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/VideoProcessor.cpp:91:39: error: no member named 'setw' in namespace 'std'

from anime4kcpp.

liguobing avatar liguobing commented on May 26, 2024

上面那个提示是 OpenCV 3.X 的,将 OpenCV SDK 换成 4.8.1 之后,错误提示如下:

D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: no member named 'make_unique' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:33:20: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:77: note: expanded from macro '\
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: expected '(' for function-style cast or type construction
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:33:20: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:93: note: expanded from macro '\
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: no member named 'make_unique' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:34:36: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:77: note: expanded from macro '\
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: expected '(' for function-style cast or type construction
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:34:36: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:93: note: expanded from macro '\
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: no member named 'make_unique' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:35:32: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:4:40: note: expanded from macro '\
<scratch space>:16:1: note: expanded from here
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:7:39: note: expanded from macro 'REGISTER_PROCESSOR_IF_1'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:77: note: expanded from macro 'REGISTER_PROCESSOR'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: expected '(' for function-style cast or type construction
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:35:32: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:4:40: note: expanded from macro '\
<scratch space>:16:1: note: expanded from here
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:7:39: note: expanded from macro 'REGISTER_PROCESSOR_IF_1'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:93: note: expanded from macro 'REGISTER_PROCESSOR'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/src/ACCreator.cpp:40:9: error: no member named 'make_unique' in namespace 'std'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:83:27: note: expanded from macro 'PROCESSOR_CASE_UP'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:36:55: note: expanded from macro 'PROCESSORS'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:4:40: note: expanded from macro '\
<scratch space>:19:1: note: expanded from here
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:7:39: note: expanded from macro 'REGISTER_PROCESSOR_IF_1'
D:/WorkSpace/Android_Studio_workspace/Anime4KCPP_Android/app/src/main/cpp/Anime4KCore/include\ACRegister.hpp:62:77: note: expanded from macro 'REGISTER_PROCESSOR'

from anime4kcpp.

TianZerL avatar TianZerL commented on May 26, 2024

因为很久没搞了,一些细节我可能遗忘了,所以我自己试了一下,直接clone Anime4KCPP_Android然后编译,一切正常,未发生上述报错。

我的环境:

  • Win11,Android Studio最新版现装的
  • OpenCV:4.8.1版本android sdk
  • OpenCL:so库是手机里扒下来的,头文件来自KhronosGroup(具体后面说)
  • Eigen 3.4.0

编译过程:clone后直接Android Studio打开项目,此时自动下载gradle7.0.2和ndk 21,因为最新AS自带java版本太新的问题会报错提示让升级gradle,自动升级就行,去设置好CMake里依赖的路径之后可以直接编译,不需要额外操作。

上面提到的OpenCL头文件问题,我用的的头文件是编译OpenCL SDK项目后生成的,理论上就是OpenCL-HeadersOpenCL-CLHPP里的头文件,应该可以直接从这两个项目下载放在一起就行,不需要先编译一遍SDK。

对比,我觉得您的问题可能在于opencl,在此提供一份我使用的opencl库供测试:
opencl.zip

顺便测试了一下把ndk升级到比较新的25版本也可以正常编译。

from anime4kcpp.

liguobing avatar liguobing commented on May 26, 2024

不知道该用什么语言来形容了,白天整整折腾了一天,就差重装电脑了,按照您到步骤一步一步操作,却始终还是出错

晚上回家继续折腾,莫名其妙到好了,回想之前到操作,应该是又升级了一次 gradle

现在的 gradle 及插件版本分别是 7.5/7.4.2

最后祝您备考成功,好运连连!

from anime4kcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.