All Projects → nihui → Opencv Mobile

nihui / Opencv Mobile

Licence: apache-2.0
The minimal opencv for Android, iOS and ARM Linux

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Opencv Mobile

Qbr
A webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV.
Stars: ✭ 122 (-60.65%)
Mutual labels:  opencv
Powerai Counting Cars
Run a Jupyter Notebook to detect, track, and count cars in a video using Maximo Visual Insights (formerly PowerAI Vision) and OpenCV
Stars: ✭ 282 (-9.03%)
Mutual labels:  opencv
Car Finding Lane Lines
Finding Lane Lines using Python and OpenCV
Stars: ✭ 299 (-3.55%)
Mutual labels:  opencv
Ffdynamic
Library with dynamic audio/video composition and runtime control
Stars: ✭ 274 (-11.61%)
Mutual labels:  opencv
Harvesters
🌈 Friendly Image Acquisition Library for Computer Vision People
Stars: ✭ 274 (-11.61%)
Mutual labels:  opencv
Opencvsharp
OpenCV wrapper for .NET
Stars: ✭ 3,598 (+1060.65%)
Mutual labels:  opencv
Evision
计算机视觉实践和探索/Practice and explorations in computer vision.
Stars: ✭ 268 (-13.55%)
Mutual labels:  opencv
Amazon Rekognition Video Analyzer
A working prototype for capturing frames off of a live MJPEG video stream, identifying objects in near real-time using deep learning, and triggering actions based on an objects watch list.
Stars: ✭ 309 (-0.32%)
Mutual labels:  opencv
Docker Python3 Opencv
🐋 🐍 👁 Docker image with python 3 and opencv 4.1
Stars: ✭ 283 (-8.71%)
Mutual labels:  opencv
Vehicle License Plate Recognition
🔥 🔥🔥基于Python的车牌检测和识别系统:
Stars: ✭ 293 (-5.48%)
Mutual labels:  opencv
Superpixel Benchmark
An extensive evaluation and comparison of 28 state-of-the-art superpixel algorithms on 5 datasets.
Stars: ✭ 275 (-11.29%)
Mutual labels:  opencv
Opencv Androidsamples
OpenCv samples for Android from OpenCV SDK using Android Studio and Gradle System
Stars: ✭ 278 (-10.32%)
Mutual labels:  opencv
Curvaturefilter
Curvature Filters are efficient solvers for Variational Models
Stars: ✭ 291 (-6.13%)
Mutual labels:  opencv
Trace.moe
Anime Scene Search by Image
Stars: ✭ 3,231 (+942.26%)
Mutual labels:  opencv
Footfall
Application that allows you to monitor the traffic in and out of your building, using the RPi Camera and openFrameworks
Stars: ✭ 301 (-2.9%)
Mutual labels:  opencv
Orb Slam2 Gpu2016 Final
Stars: ✭ 272 (-12.26%)
Mutual labels:  opencv
Sistine
Turn a MacBook into a Touchscreen with $1 of Hardware
Stars: ✭ 3,169 (+922.26%)
Mutual labels:  opencv
Grip
Program for rapidly developing computer vision applications
Stars: ✭ 314 (+1.29%)
Mutual labels:  opencv
Pigo
Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Stars: ✭ 3,542 (+1042.58%)
Mutual labels:  opencv
Adversarial Examples Pytorch
Implementation of Papers on Adversarial Examples
Stars: ✭ 293 (-5.48%)
Mutual labels:  opencv

opencv-mobile

License release download

✔️ This project provides the minimal build of opencv library for the Android, iOS and ARM Linux platforms.

✔️ We provide prebuild binary packages for opencv 2.4.13.7, 3.4.13 and 4.5.1.

✔️ We also provide prebuild binary package for iOS with bitcode enabled, that the official package lacks.

✔️ All the binaries are compiled from source on github action, no virus, no backdoor, no secret code.

opencv 4.5.1 android package size
The official opencv 229MB
opencv-mobile 15.5MB
opencv 4.5.1 ios package size
The official opencv 173MB
opencv-mobile 14.8MB
opencv 4.5.1 ios with bitcode package size
The official opencv missing :(
opencv-mobile 51.6MB

Download

Android

(armeabi-v7a arm64-v8a x86 x86_64) build with ndk r21d and android api 24

iOS

(armv7 arm64 arm64e i386 x86_64) build with Xcode 12.2

iOS with bitcode

(armv7 arm64 arm64e i386 x86_64) build with Xcode 12.2

ARM Linux

(arm-linux-gnueabi arm-linux-gnueabihf aarch64-linux-gnu) build with ubuntu cross compiler

Usage Android

  1. Extract archive to <project dir>/app/src/main/jni/
  2. Modify <project dir>/app/src/main/jni/CMakeListst.txt to find and link opencv
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.5.1-android/sdk/native/jni)
find_package(OpenCV REQUIRED)

target_link_libraries(your_jni_target ${OpenCV_LIBS})

Usage iOS

  1. Extract archive, and drag opencv2.framework into your project

Usage ARM Linux

  1. Extract archive to <project dir>/
  2. Modify <project dir>/CMakeListst.txt to find and link opencv
set(OpenCV_DIR ${CMAKE_SOURCE_DIR}/opencv-mobile-4.5.1-armlinux/arm-linux-gnueabihf/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)

target_link_libraries(your_target ${OpenCV_LIBS})

How-to-build your custom package

step1 download opencv source

wget -q https://github.com/opencv/opencv/archive/4.5.1.zip -O opencv-4.5.1.zip
unzip -q opencv-4.5.1.zip
cd opencv-4.5.1

step2 strip zlib dependency and use stb-based highgui implementation (optional)

truncate -s 0 cmake/OpenCVFindLibsGrfmt.cmake
rm -rf modules/gapi
rm -rf modules/highgui
cp -r ../highgui modules/

step3 patch opencv source for no-rtti build (optional)

patch -p1 -i ../opencv-4.5.1-no-rtti.patch

step4 apply your opencv options to opencv4_cmake_options.txt

step5 build your opencv package with cmake

mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=install \
  -DCMAKE_BUILD_TYPE=Release \
  `cat ../../opencv4_cmake_options.txt` \
  -DBUILD_opencv_world=OFF ..

step6 make a package

zip -r -9 opencv-mobile-4.5.1.zip install

Some notes

  • The minimal opencv build contains most basic opencv operators and common image processing functions, with some handy additions like keypoint feature extraction and matching, image inpainting and opticalflow estimation.

  • Many computer vision algorithms that reside in dedicated modules are discarded, such as face detection etc. You could try deep-learning based algorithms with nerual network inference library optimized for mobile.

  • Image IO functions in highgui module, like cv::imread and cv::imwrite, are re-implemented using stb for smaller code size. GUI functions, like cv::imshow, are discarded.

  • cuda and opencl are disabled because there is no cuda on mobile, no opencl on ios, and opencl on android is slow. opencv on gpu is not suitable for real productions. Write metal on ios and opengles/vulkan on android if you need good gpu acceleration.

  • C++ RTTI and exceptions are disabled for minimal build. Be careful when you write cv::Mat roi = image(roirect); :P

opencv modules included

module comment
opencv_core Mat, matrix operations, etc
opencv_imgproc resize, cvtColor, warpAffine, etc
opencv_highgui imread, imwrite
opencv_features2d keypoint feature and matcher, etc (not included in opencv 2.x package)
opencv_photo inpaint, etc
opencv_video opticalflow, etc

opencv modules discarded

module comment
opencv_androidcamera use android Camera api instead
opencv_calib3d camera calibration, rare uses on mobile
opencv_contrib experimental functions, build part of the source externally if you need
opencv_dnn very slow on mobile, try ncnn for nerual network inference on mobile
opencv_dynamicuda no cuda on mobile
opencv_flann feature matching, rare uses on mobile, build the source externally if you need
opencv_gapi graph based image processing, little gain on mobile
opencv_gpu no cuda/opencl on mobile
opencv_imgcodecs link with opencv_highgui instead
opencv_java wrap your c++ code with jni
opencv_js write native code on mobile
opencv_lagacy various good-old cv routines, build part of the source externally if you need
opencv_ml train your ML algorithm on powerful pc or server
opencv_nonfree the SIFT and SURF, use ORB which is faster and better
opencv_objdetect HOG, cascade detector, use deep learning detector which is faster and better
opencv_ocl no opencl on mobile
opencv_python no python on mobile
opencv_shape shape matching, rare uses on mobile, build the source externally if you need
opencv_stitching image stitching, rare uses on mobile, build the source externally if you need
opencv_superres do video super-resolution on powerful pc or server
opencv_ts test modules, useless in production anyway
opencv_videoio use android MediaCodec or ios AVFoundation api instead
opencv_videostab do video stablization on powerful pc or server
opencv_viz vtk is not available on mobile, write your own data visualization routines
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].