Does OpenCV for Mac use the Accelerate framework? - opencv

The Accelerate framework is a Mac-specific framework that provides things like image convolutions and LAPACK, supposedly optimized to be as fast as possible on Macs. My question: Does OpenCV take advantage of this? Specifically, does the function "filter2D" use Accelerate?

It does not use the Accelerate framework, but it looks like it has been speeded up using the CUDA stuff in 2.2
The relevant files in OpenCV2.2 ...
/modules/gpu/include/opencv2/gpu/gpu.hpp
/modules/gpu/src/filtering.cpp
and
modules/imgproc/src/filter.cpp
for the non-gpu stuff

Not a mac expert but AFAIK openCV uses IPP (if installed) TBB (build option) and NVidia-CUDA (build option)

If you use the MacPorts version, you can specify the options
$ port variants opencv
opencv has the variants:
debug: Enable debug binaries
python26: Add Python 2.6 bindings
* conflicts with python27
python27: Add Python 2.7 bindings
* conflicts with python26
tbb: Use Intel TBB
universal: Build for multiple architectures
I have used
sudo port install py26-numpy
sudo port install opencv +python26 +tbb
with success. Concerning the Accelerate.framework specifically, this blog entry says "# Add Accelerate.framework which is used internally from OpenCV library.", but I have no clue as to know if it is the case here.

Related

mingw : Giving reference to opencv libraries in simpler way

Successfully installed opencv 4.5.4 in windows under mingw evironment. I was able to compile opencv applications. But is there any easy way to give reference to libraries instead of typing long list of opencv libraries (i.e. something like pkg-config in windows)
For a simple opencv program I need to give reference to 4 libraries.
g++ rotate.cpp -lopencv_core454 -lopencv_highgui454 -lopencv_imgproc454 -lopencv_imgcodecs454
instead do we have some option to give list of libraries through some flags in windows environment.
Thanks
You can actually use pkg-config in Windows. If you use MSYS2 shell is is usually available or it can be installed via pacman.

What does the “BUILD_CUDA_STUBS” option do when building OpenCV?

In open CV CMakeLists.txt, there is a flag called "BUILD_CUDA_STUBS":
OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT APPLE_FRAMEWORK) )
What does this means? It sounds like, open cv's doc is a bit limited on the build flag.
It’s poorly, or un-, documented.
If BUILD_CUDA_STUBS is enabled, when building, it (supposedly) adds some code (“CUDA stubs”) to replace the CUDA toolkit(’s drivers? IDK), to enable building CUDA-powered code on a machine that does not have the CUDA toolkit installed.
I recommend you just leave it OFF, which is the default, and install the genuine CUDA toolkit on your machine.

Build Opencv 3.1.0 with IPP ippicv_windows_20151201.zip

I'm trying to build OpenCV 3.1.0 on a stand alone computer (there is no internet access).
I have an Intel composer 2015 installed, which include IPP v8.
During CMake build configuration, I get the following message:
Cmake error at 3rdparty/downloader.cmake.73
for file: [..... /ippicv_windows_20151201.zip]
expected hash [...] actual hash [...]
I figure out that I need to manually download ippicv_windows_20151201.zip and place it in the sources sub - folder.
Do you know where I can download it from?
I can exclude the build flag: "WITH_IPP" , In that case, I'd not build with IPP at all, which is something I don't want.
I'd rather like to build OpenCV with my pre-installed IPP (Intel Composer), not the downloaded free version from OpenCV, Do you know how I can do that ?
BWT, What is the difference between build WITH_IPP and WITH_IPP_A flags ?
P.S. I posted the same question on OpenCV forum
If the downloader.cmake is not finding the hash perhaps is not available yet or there is some error when reaching the URL (downloading protocol maybe?). Download the previous version from here, it'll do the work. Just need to place it in the correct folder. I'm using OpenCV 3.1.0 with the 20141027 with no problem at all.
In case you have an Intel composer which includes IPP library.
Go to your Opencv CMake --> Add entry (right side) --> Insert variable as a path:
IPP_ROOT
Set with the library location
Thus, would compile Opencv with IPP library from the Intel Composer
IPP_A comes for asynchronous IPP which is currently experimental

Home-brew installation of LAPACKe

I've been trying to find the right package to install so that I can use
#include <lapacke.h>
but I've not been able to find a home-brew command that once downloaded contains this library. Is it possible to download this using home-brew, if not what our my alternatives?
Accelerate ships with OS X and provides LAPACK: https://developer.apple.com/library/prerelease/mac/documentation/Darwin/Reference/ManPages/man7/LAPACK.7.html
Alternatively, the homebrew/science/openblas package provides a LAPACK implementation.

How to cross compile OpenCV with ffmpeg

I want to cross compile opencv with ffmpeg for arm.
I have cross compiled ffmpeg, how do I configure cmake to see the ffmpeg?
Edit: I am cross compiling for AR Drone 2.0. I use toolchain under platform/linux.
The answer to your specific problem is to use cmake-gui which provides you a visual interface to ease the process of setting up variables, like your ffmpeg package location.
However I have 2 recommendations:
Download the most updated toolchain.
DO NOT USE THIS GUIDE. Use instead the toolchain that you find in the package in sources\platforms\android\android.toolchain.cmake: read inside, you'll find the correct instructions at the beginning of the file.
Another optional recommendation: use ninja as build system, much faster.
I was successful in cross compiling OpenCV with ffmpeg for AR Drone's ARM processor by writing my own toolchain file where I explicitly set all the linker, pkg_config and compiler paths to relevant directories containing the cross-compiled stuff.
I have written a blog post detailing the entire process here:
How to Cross-Compile OpenCV with FFmpeg for AR Drone (ARM Processor).

Resources