Giter Site home page Giter Site logo

hunter-packages / opencv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opencv/opencv

3.0 6.0 14.0 457.44 MB

Open Source Computer Vision Library

Home Page: opencv.org

License: Other

CMake 2.86% C++ 86.58% Cuda 0.21% Shell 0.05% C 4.77% Objective-C 0.03% Java 2.44% Python 2.02% Objective-C++ 0.59% PowerShell 0.05% Batchfile 0.01% TeX 0.01% Perl 0.05% Prolog 0.01% JavaScript 0.31% HTML 0.01%

opencv's Issues

iOS toolchain files still do not set ARM/AARCH64, leads to missing CPU_KNOWN_OPTIMIZATIONS

System information (version)
  • OpenCV => 3.4.3-p2, various
  • Operating System / Platform => macOS Mojave 10.14.1
  • Compiler => Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Detailed description

Despite the workaround in this commit, generally CMAKE_SYSTEM_PROCESSOR does not get set, which leads to both AARCH64 and ARM never getting set, which leads to NEON not getting detected i.e.

--   CPU/HW features:
--     Baseline:

There's a good discussion on why CMAKE_SYSTEM_PROCESSOR needs to be set in ruslo/hunter#954 but it appears the workaround currently in polly is insufficient. OpenCVDetectCXXCompiler.cmake and OpenCVCompilerOptimizations.cmake depend on a value here in order to know to even run the checks for NEON (or SSE).

The problem is that the attempted fix:

set(_all_archs ${IPHONESIMULATOR_ARCHS} ${IPHONEOS_ARCHS})
list(LENGTH _all_archs _all_archs_len)
if(_all_archs_len EQUAL 1)
  set(CMAKE_SYSTEM_PROCESSOR ${_all_archs})
else()
  set(CMAKE_SYSTEM_PROCESSOR "")
endif()

doesn't work when _all_archs_len is greater than 1, which is the case when I use any ios-*.cmake, where _all_archs ends up being x86_64;arm64 (simulator arch ; iPhone arch).

Note we are seeing NEON always properly detected with hunter targeting Android and this problem is specific to iOS.

Steps to reproduce

We run:

POLLY_IOS_DEVELOPMENT_TEAM="<our 10-digit ID>" POLLY_IOS_BUNDLE_IDENTIFIER="<our com.company.appname id>" \
  cmake -DCMAKE_TOOLCHAIN_FILE=~/polly/ios.cmake -G Xcode "<source dir>"

where the top-level CMake file does hunter_add_package(OpenCV). When detecting CPU baseline features the output will just show Baseline: i.e. did not find NEON.

Compare that to the base case of grabbing non-hunter opencv's 3.4.3 tag and running:

python platforms/ios/build_framework.py build/ios

Then the output will show successful detection of Baseline: NEON or Baseline: NEON,FP16.

v3.2.0-p2 hash mismatch

System information (version)
  • OpenCV => 3.2.0-p2
  • Operating System / Platform => Mac OS 10.13.5
  • Compiler => XCode
Detailed description

I'm using the latest hunter version 22.16. Previously I used 0.19.155. The problem occurs with both versions.

Upon running CMake config, the OpenCV 3.2.0-p2 package is downloaded. But the hash verification fails:

Command:
cmake -G'Xcode' -H. -B_builds/ios-nocodesign-11-4 -DCMAKE_TOOLCHAIN_FILE='/Users/robert/Development/.../polly/ios-nocodesign-11-4.cmake' -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=_install/ios-Release -DCMAKE_IOS_INSTALL_COMBINED=YES -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO

Output:
(...)
-- Downloading...
   dst='/Users/robert/.hunter/_Base/Download/OpenCV/3.2.0-p2/9921920/v3.2.0-p2.tar.gz'
   timeout='none'
-- Using src='https://github.com/hunter-packages/opencv/archive/v3.2.0-p2.tar.gz'
(...)
-- [download 100% complete]
-- verifying file...
       file='/Users/robert/.hunter/_Base/Download/OpenCV/3.2.0-p2/9921920/v3.2.0-p2.tar.gz'
-- SHA1 hash of
    /Users/robert/.hunter/_Base/Download/OpenCV/3.2.0-p2/9921920/v3.2.0-p2.tar.gz
  does not match expected value
    expected: '99219206c4fb9b5b6f60e03112746461baf6c9ab'
      actual: 'ea8f612eea55dfa6d2f3669d5e9eb4240417444b'
-- Hash mismatch, removing...
-- Retrying...

Please note that using a newer OpenCV version is not an option, because the newer versions (3.3 & 3.4) have bad performance on some of the latest iPhone devices like iPhone 6S or iPhone X. (I am going to create a bug report for this issue.) OpenCV 3.2 is the latest version that does not have this issue.

Steps to reproduce

Create a hunter project and try to use OpenCV 3.2.0-p2:
hunter_config(OpenCV VERSION 3.2.0-p2)

Allow building with system Qt instead of Hunter Qt

Since the Hunter Qt is stuck at 5.5, I would like the ability to use my system Qt instead.

If I try to use Qt4 to provide GUI in OpenCV, this conflicts with the Qt5.
I haven't had much luck with GTK and it seems like extreme lengths to get GUI working.

So, I propose a define to allow us to use system Qt package.

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.