├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Gemfile ├── Gemfile.lock ├── OpenCVModule.js ├── README.md ├── __tests__ └── App-test.js ├── _bundle └── config ├── _ruby-version ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── opencvframeprocessor │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── opencvframeprocessor │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ ├── ObjectDetectFrameProcessorPlugin.java │ │ │ ├── ObjectDetectFrameProcessorPluginModule.java │ │ │ ├── OpenCV.java │ │ │ └── newarchitecture │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ ├── components │ │ │ └── MainComponentsRegistry.java │ │ │ └── modules │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ ├── jni │ │ ├── Android.mk │ │ ├── MainApplicationModuleProvider.cpp │ │ ├── MainApplicationModuleProvider.h │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ ├── MainComponentsRegistry.cpp │ │ ├── MainComponentsRegistry.h │ │ └── OnLoad.cpp │ │ └── res │ │ ├── drawable │ │ └── rn_edit_text_material.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── ObjectDetectFrameProcessor.mm ├── OpenCV.h ├── OpenCV.mm ├── Podfile ├── Podfile.lock ├── PrefixHeader.pch ├── opencvframeprocessor.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── opencvframeprocessor.xcscheme ├── opencvframeprocessor.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── opencvframeprocessor │ ├── AppDelegate.h │ ├── AppDelegate.mm │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── main.m └── opencvframeprocessorTests │ ├── Info.plist │ └── opencvframeprocessorTests.m ├── metro.config.js ├── package.json └── yarn.lock /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | .*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ 15 | 16 | [untyped] 17 | .*/node_modules/@react-native-community/cli/.*/.* 18 | 19 | [include] 20 | 21 | [libs] 22 | node_modules/react-native/interface.js 23 | node_modules/react-native/flow/ 24 | 25 | [options] 26 | emoji=true 27 | 28 | exact_by_default=true 29 | 30 | format.bracket_spacing=false 31 | 32 | module.file_ext=.js 33 | module.file_ext=.json 34 | module.file_ext=.ios.js 35 | 36 | munge_underscores=true 37 | 38 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 39 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 40 | 41 | suppress_type=$FlowIssue 42 | suppress_type=$FlowFixMe 43 | suppress_type=$FlowFixMeProps 44 | suppress_type=$FlowFixMeState 45 | 46 | [lints] 47 | sketchy-null-number=warn 48 | sketchy-null-mixed=warn 49 | sketchy-number=warn 50 | untyped-type-import=warn 51 | nonstrict-import=warn 52 | deprecated-type=warn 53 | unsafe-getters-setters=warn 54 | unnecessary-invariant=warn 55 | signature-verification-failure=warn 56 | 57 | [strict] 58 | deprecated-type 59 | nonstrict-import 60 | sketchy-null 61 | unclear-type 62 | unsafe-getters-setters 63 | untyped-import 64 | untyped-type-import 65 | 66 | [version] 67 | ^0.170.0 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | *.hprof 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | !debug.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # Ruby / CocoaPods 60 | /ios/Pods/ 61 | /vendor/bundle/ 62 | 63 | jniLibs/ 64 | opencv2.framework 65 | openCVLib/ -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import React, {useEffect} from 'react'; 2 | import 'react-native-reanimated'; 3 | import {Platform, StyleSheet, useWindowDimensions} from 'react-native'; 4 | import { 5 | Camera, 6 | useFrameProcessor, 7 | useCameraDevices, 8 | } from 'react-native-vision-camera'; 9 | import {useSharedValue, useAnimatedStyle} from 'react-native-reanimated'; 10 | import Animated from 'react-native-reanimated'; 11 | 12 | export function objectDetect(frame) { 13 | 'worklet'; 14 | return __objectDetect(frame); 15 | } 16 | 17 | function App() { 18 | const flag = useSharedValue({height: 0, left: 0, top: 0, width: 0}); 19 | 20 | const flagOverlayStyle = useAnimatedStyle( 21 | () => ({ 22 | backgroundColor: 'blue', 23 | position: 'absolute', 24 | ...flag.value, 25 | }), 26 | [flag], 27 | ); 28 | 29 | const dimensions = useWindowDimensions(); 30 | 31 | const frameProcessor = useFrameProcessor(frame => { 32 | 'worklet'; 33 | const rectangle = objectDetect(frame); 34 | 35 | const xFactor = 36 | dimensions.width / Platform.OS === 'ios' ? frame.width : frame.height; 37 | const yFactor = 38 | dimensions.height / Platform.OS === 'ios' ? frame.height : frame.width; 39 | 40 | if (rectangle.x) { 41 | flag.value = { 42 | height: rectangle.height * yFactor, 43 | left: rectangle.x * xFactor, 44 | top: rectangle.y * yFactor, 45 | width: rectangle.width * xFactor, 46 | }; 47 | } else { 48 | flag.value = {height: 0, left: 0, top: 0, width: 0}; 49 | } 50 | }, []); 51 | 52 | const devices = useCameraDevices(); 53 | const device = devices.back; 54 | 55 | useEffect(() => { 56 | const checkPermissions = async () => { 57 | await Camera.requestCameraPermission(); 58 | }; 59 | checkPermissions(); 60 | }, []); 61 | 62 | if (device == null) { 63 | return null; 64 | } 65 | 66 | return ( 67 | <> 68 | 75 | 76 | 77 | ); 78 | } 79 | 80 | export default App; 81 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.4' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.5) 5 | rexml 6 | activesupport (6.1.5.1) 7 | concurrent-ruby (~> 1.0, >= 1.0.2) 8 | i18n (>= 1.6, < 2) 9 | minitest (>= 5.1) 10 | tzinfo (~> 2.0) 11 | zeitwerk (~> 2.3) 12 | addressable (2.8.0) 13 | public_suffix (>= 2.0.2, < 5.0) 14 | algoliasearch (1.27.5) 15 | httpclient (~> 2.8, >= 2.8.3) 16 | json (>= 1.5.1) 17 | atomos (0.1.3) 18 | claide (1.1.0) 19 | cocoapods (1.11.3) 20 | addressable (~> 2.8) 21 | claide (>= 1.0.2, < 2.0) 22 | cocoapods-core (= 1.11.3) 23 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 24 | cocoapods-downloader (>= 1.4.0, < 2.0) 25 | cocoapods-plugins (>= 1.0.0, < 2.0) 26 | cocoapods-search (>= 1.0.0, < 2.0) 27 | cocoapods-trunk (>= 1.4.0, < 2.0) 28 | cocoapods-try (>= 1.1.0, < 2.0) 29 | colored2 (~> 3.1) 30 | escape (~> 0.0.4) 31 | fourflusher (>= 2.3.0, < 3.0) 32 | gh_inspector (~> 1.0) 33 | molinillo (~> 0.8.0) 34 | nap (~> 1.0) 35 | ruby-macho (>= 1.0, < 3.0) 36 | xcodeproj (>= 1.21.0, < 2.0) 37 | cocoapods-core (1.11.3) 38 | activesupport (>= 5.0, < 7) 39 | addressable (~> 2.8) 40 | algoliasearch (~> 1.0) 41 | concurrent-ruby (~> 1.1) 42 | fuzzy_match (~> 2.0.4) 43 | nap (~> 1.0) 44 | netrc (~> 0.11) 45 | public_suffix (~> 4.0) 46 | typhoeus (~> 1.0) 47 | cocoapods-deintegrate (1.0.5) 48 | cocoapods-downloader (1.6.3) 49 | cocoapods-plugins (1.0.0) 50 | nap 51 | cocoapods-search (1.0.1) 52 | cocoapods-trunk (1.6.0) 53 | nap (>= 0.8, < 2.0) 54 | netrc (~> 0.11) 55 | cocoapods-try (1.2.0) 56 | colored2 (3.1.2) 57 | concurrent-ruby (1.1.10) 58 | escape (0.0.4) 59 | ethon (0.15.0) 60 | ffi (>= 1.15.0) 61 | ffi (1.15.5) 62 | fourflusher (2.3.1) 63 | fuzzy_match (2.0.4) 64 | gh_inspector (1.1.3) 65 | httpclient (2.8.3) 66 | i18n (1.10.0) 67 | concurrent-ruby (~> 1.0) 68 | json (2.6.1) 69 | minitest (5.15.0) 70 | molinillo (0.8.0) 71 | nanaimo (0.3.0) 72 | nap (1.1.0) 73 | netrc (0.11.0) 74 | public_suffix (4.0.7) 75 | rexml (3.2.5) 76 | ruby-macho (2.5.1) 77 | typhoeus (1.4.0) 78 | ethon (>= 0.9.0) 79 | tzinfo (2.0.4) 80 | concurrent-ruby (~> 1.0) 81 | xcodeproj (1.21.0) 82 | CFPropertyList (>= 2.3.3, < 4.0) 83 | atomos (~> 0.1.3) 84 | claide (>= 1.0.2, < 2.0) 85 | colored2 (~> 3.1) 86 | nanaimo (~> 0.3.0) 87 | rexml (~> 3.2.4) 88 | zeitwerk (2.5.4) 89 | 90 | PLATFORMS 91 | ruby 92 | 93 | DEPENDENCIES 94 | cocoapods (~> 1.11, >= 1.11.2) 95 | 96 | RUBY VERSION 97 | ruby 2.7.4p191 98 | 99 | BUNDLED WITH 100 | 2.2.27 101 | -------------------------------------------------------------------------------- /OpenCVModule.js: -------------------------------------------------------------------------------- 1 | import {NativeModules} from 'react-native'; 2 | 3 | const {OpenCVModule} = NativeModules; 4 | 5 | export default OpenCVModule; 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # opencvframeprocessor 2 | 3 | The project includes the code from the article: link here. 4 | 5 | Required steps to run: 6 | - Add downloaded OpenCV library to ios directory (it should be have name opencv2.framework) 7 | - Add downloaded OpenCV library to android directory (it should be have name openCVlib) 8 | - Add jniLibs to android/app/src/main/jniLibs (you can find them in downloaded OpenCV archive) 9 | 10 | Make sure you installed pods and necessary libararies. 11 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /_bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /_ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.4 2 | -------------------------------------------------------------------------------- /android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.opencvframeprocessor", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.opencvframeprocessor", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: false, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: "../../node_modules/react-native/react.gradle" 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get("enableHermes", false); 123 | 124 | /** 125 | * Architectures to build native code for. 126 | */ 127 | def reactNativeArchitectures() { 128 | def value = project.getProperties().get("reactNativeArchitectures") 129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 130 | } 131 | 132 | android { 133 | ndkVersion rootProject.ext.ndkVersion 134 | 135 | compileSdkVersion rootProject.ext.compileSdkVersion 136 | 137 | packagingOptions { 138 | pickFirst '**/*.so' 139 | } 140 | 141 | defaultConfig { 142 | applicationId "com.opencvframeprocessor" 143 | minSdkVersion rootProject.ext.minSdkVersion 144 | targetSdkVersion rootProject.ext.targetSdkVersion 145 | versionCode 1 146 | versionName "1.0" 147 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 148 | 149 | if (isNewArchitectureEnabled()) { 150 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 151 | externalNativeBuild { 152 | ndkBuild { 153 | arguments "APP_PLATFORM=android-21", 154 | "APP_STL=c++_shared", 155 | "NDK_TOOLCHAIN_VERSION=clang", 156 | "GENERATED_SRC_DIR=$buildDir/generated/source", 157 | "PROJECT_BUILD_DIR=$buildDir", 158 | "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 159 | "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build" 160 | cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" 161 | cppFlags "-std=c++17" 162 | // Make sure this target name is the same you specify inside the 163 | // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable. 164 | targets "opencvframeprocessor_appmodules" 165 | // Fix for windows limit on number of character in file paths and in command lines 166 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 167 | arguments "NDK_APP_SHORT_COMMANDS=true" 168 | } 169 | } 170 | } 171 | if (!enableSeparateBuildPerCPUArchitecture) { 172 | ndk { 173 | abiFilters (*reactNativeArchitectures()) 174 | } 175 | } 176 | } 177 | } 178 | 179 | if (isNewArchitectureEnabled()) { 180 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 181 | externalNativeBuild { 182 | ndkBuild { 183 | path "$projectDir/src/main/jni/Android.mk" 184 | } 185 | } 186 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 187 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 188 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 189 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 190 | into("$buildDir/react-ndk/exported") 191 | } 192 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 193 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 194 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 195 | into("$buildDir/react-ndk/exported") 196 | } 197 | afterEvaluate { 198 | // If you wish to add a custom TurboModule or component locally, 199 | // you should uncomment this line. 200 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 201 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 202 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 203 | 204 | // Due to a bug inside AGP, we have to explicitly set a dependency 205 | // between configureNdkBuild* tasks and the preBuild tasks. 206 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 207 | configureNdkBuildRelease.dependsOn(preReleaseBuild) 208 | configureNdkBuildDebug.dependsOn(preDebugBuild) 209 | reactNativeArchitectures().each { architecture -> 210 | tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure { 211 | dependsOn("preDebugBuild") 212 | } 213 | tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure { 214 | dependsOn("preReleaseBuild") 215 | } 216 | } 217 | } 218 | } 219 | 220 | splits { 221 | abi { 222 | reset() 223 | enable enableSeparateBuildPerCPUArchitecture 224 | universalApk false // If true, also generate a universal APK 225 | include (*reactNativeArchitectures()) 226 | } 227 | } 228 | signingConfigs { 229 | debug { 230 | storeFile file('debug.keystore') 231 | storePassword 'android' 232 | keyAlias 'androiddebugkey' 233 | keyPassword 'android' 234 | } 235 | } 236 | buildTypes { 237 | debug { 238 | signingConfig signingConfigs.debug 239 | } 240 | release { 241 | // Caution! In production, you need to generate your own keystore file. 242 | // see https://reactnative.dev/docs/signed-apk-android. 243 | signingConfig signingConfigs.debug 244 | minifyEnabled enableProguardInReleaseBuilds 245 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 246 | } 247 | } 248 | 249 | // applicationVariants are e.g. debug, release 250 | applicationVariants.all { variant -> 251 | variant.outputs.each { output -> 252 | // For each separate APK per architecture, set a unique version code as described here: 253 | // https://developer.android.com/studio/build/configure-apk-splits.html 254 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 255 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 256 | def abi = output.getFilter(OutputFile.ABI) 257 | if (abi != null) { // null for the universal-debug, universal-release variants 258 | output.versionCodeOverride = 259 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 260 | } 261 | 262 | } 263 | } 264 | } 265 | 266 | dependencies { 267 | implementation fileTree(dir: "libs", include: ["*.jar"]) 268 | 269 | //noinspection GradleDynamicVersion 270 | implementation "com.facebook.react:react-native:+" // From node_modules 271 | 272 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 273 | implementation project(path: ':openCVlib') 274 | 275 | implementation 'androidx.camera:camera-core:1.1.0-beta02' 276 | 277 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 278 | exclude group:'com.facebook.fbjni' 279 | } 280 | 281 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 282 | exclude group:'com.facebook.flipper' 283 | exclude group:'com.squareup.okhttp3', module:'okhttp' 284 | } 285 | 286 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 287 | exclude group:'com.facebook.flipper' 288 | } 289 | 290 | if (enableHermes) { 291 | def hermesPath = "../../node_modules/hermes-engine/android/"; 292 | debugImplementation files(hermesPath + "hermes-debug.aar") 293 | releaseImplementation files(hermesPath + "hermes-release.aar") 294 | } else { 295 | implementation jscFlavor 296 | } 297 | } 298 | 299 | if (isNewArchitectureEnabled()) { 300 | // If new architecture is enabled, we let you build RN from source 301 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 302 | // This will be applied to all the imported transtitive dependency. 303 | configurations.all { 304 | resolutionStrategy.dependencySubstitution { 305 | substitute(module("com.facebook.react:react-native")) 306 | .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source") 307 | } 308 | } 309 | } 310 | 311 | // Run this once to be able to run the application with BUCK 312 | // puts all compile dependencies into folder libs for BUCK to use 313 | task copyDownloadableDepsToLibs(type: Copy) { 314 | from configurations.implementation 315 | into 'libs' 316 | } 317 | 318 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 319 | 320 | def isNewArchitectureEnabled() { 321 | // To opt-in for the New Architecture, you can either: 322 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 323 | // - Invoke gradle with `-newArchEnabled=true` 324 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 325 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 326 | } 327 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/opencvframeprocessor/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.opencvframeprocessor; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor; 2 | 3 | import android.util.Log; 4 | 5 | import com.facebook.react.ReactActivity; 6 | import com.facebook.react.ReactActivityDelegate; 7 | import com.facebook.react.ReactRootView; 8 | import org.opencv.android.OpenCVLoader; 9 | 10 | public class MainActivity extends ReactActivity { 11 | 12 | /** 13 | * Returns the name of the main component registered from JavaScript. This is used to schedule 14 | * rendering of the component. 15 | */ 16 | @Override 17 | protected String getMainComponentName() { 18 | return "opencvframeprocessor"; 19 | } 20 | 21 | static { 22 | if(OpenCVLoader.initDebug()) { 23 | Log.d("TEST", "opencv loaded"); 24 | } 25 | } 26 | 27 | /** 28 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 29 | * you can specify the rendered you wish to use (Fabric or the older renderer). 30 | */ 31 | @Override 32 | protected ReactActivityDelegate createReactActivityDelegate() { 33 | return new MainActivityDelegate(this, getMainComponentName()); 34 | } 35 | 36 | public static class MainActivityDelegate extends ReactActivityDelegate { 37 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 38 | super(activity, mainComponentName); 39 | } 40 | 41 | @Override 42 | protected ReactRootView createRootView() { 43 | ReactRootView reactRootView = new ReactRootView(getContext()); 44 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 45 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 46 | return reactRootView; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.config.ReactFeatureFlags; 11 | import com.facebook.soloader.SoLoader; 12 | import com.opencvframeprocessor.newarchitecture.MainApplicationReactNativeHost; 13 | import java.lang.reflect.InvocationTargetException; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | packages.add(new ObjectDetectFrameProcessorPluginModule()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | private final ReactNativeHost mNewArchitectureNativeHost = 41 | new MainApplicationReactNativeHost(this); 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 46 | return mNewArchitectureNativeHost; 47 | } else { 48 | return mReactNativeHost; 49 | } 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | // If you opted-in for the New Architecture, we enable the TurboModule system 56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 57 | SoLoader.init(this, /* native exopackage */ false); 58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 59 | } 60 | 61 | /** 62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 64 | * 65 | * @param context 66 | * @param reactInstanceManager 67 | */ 68 | private static void initializeFlipper( 69 | Context context, ReactInstanceManager reactInstanceManager) { 70 | if (BuildConfig.DEBUG) { 71 | try { 72 | /* 73 | We use reflection here to pick up the class that initializes Flipper, 74 | since Flipper library is not available in release mode 75 | */ 76 | Class aClass = Class.forName("com.opencvframeprocessor.ReactNativeFlipper"); 77 | aClass 78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 79 | .invoke(null, context, reactInstanceManager); 80 | } catch (ClassNotFoundException e) { 81 | e.printStackTrace(); 82 | } catch (NoSuchMethodException e) { 83 | e.printStackTrace(); 84 | } catch (IllegalAccessException e) { 85 | e.printStackTrace(); 86 | } catch (InvocationTargetException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/ObjectDetectFrameProcessorPlugin.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor; 2 | 3 | import androidx.camera.core.ImageProxy; 4 | import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin; 5 | 6 | import org.opencv.core.Mat; 7 | 8 | public class ObjectDetectFrameProcessorPlugin extends FrameProcessorPlugin { 9 | @Override 10 | public Object callback(ImageProxy image, Object[] params) { 11 | Mat mat = OpenCV.imageToMat(image); 12 | return OpenCV.findObjects(mat); 13 | } 14 | 15 | ObjectDetectFrameProcessorPlugin() { 16 | super("objectDetect"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/ObjectDetectFrameProcessorPluginModule.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.facebook.react.ReactPackage; 6 | import com.facebook.react.bridge.NativeModule; 7 | import com.facebook.react.bridge.ReactApplicationContext; 8 | import com.facebook.react.uimanager.ViewManager; 9 | import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin; 10 | 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | import javax.annotation.Nonnull; 15 | 16 | public class ObjectDetectFrameProcessorPluginModule implements ReactPackage { 17 | @NonNull 18 | @Override 19 | public List createNativeModules(@NonNull ReactApplicationContext reactContext) { 20 | FrameProcessorPlugin.register(new ObjectDetectFrameProcessorPlugin()); 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Nonnull 25 | @Override 26 | public List createViewManagers(@Nonnull ReactApplicationContext reactContext) { 27 | return Collections.emptyList(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/OpenCV.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.graphics.ImageFormat; 6 | import android.graphics.Matrix; 7 | import android.graphics.YuvImage; 8 | 9 | import com.facebook.react.bridge.WritableNativeMap; 10 | 11 | import org.opencv.android.Utils; 12 | import org.opencv.core.Core; 13 | import org.opencv.core.CvType; 14 | import org.opencv.core.Mat; 15 | import org.opencv.core.MatOfPoint; 16 | import org.opencv.core.Rect; 17 | import org.opencv.core.Scalar; 18 | import org.opencv.imgproc.Imgproc; 19 | 20 | import java.io.ByteArrayOutputStream; 21 | import java.io.IOException; 22 | import java.nio.ByteBuffer; 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | import androidx.camera.core.ImageProxy; 26 | 27 | public class OpenCV { 28 | static WritableNativeMap findObjects(Mat matRGB) { 29 | Scalar lowerBound = new Scalar(90, 120, 120); 30 | Scalar upperBound = new Scalar(140, 255, 255); 31 | 32 | Mat matBGR = new Mat(), hsv = new Mat(); 33 | List channels = new ArrayList<>(); 34 | 35 | Imgproc.cvtColor(matRGB, matBGR, Imgproc.COLOR_RGB2BGR); 36 | Imgproc.cvtColor(matBGR, hsv, Imgproc.COLOR_BGR2HSV); 37 | Core.inRange(hsv, lowerBound, upperBound, hsv); 38 | Core.split(hsv, channels); 39 | 40 | List contours = new ArrayList<>(); 41 | Mat hierarchy = new Mat(); 42 | 43 | Imgproc.findContours(channels.get(0), contours, hierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE); 44 | 45 | for (int i = 0; i < contours.size(); i++) { 46 | MatOfPoint contour = contours.get(i); 47 | double area = Imgproc.contourArea(contour); 48 | 49 | if(area > 3000) { 50 | Rect rect = Imgproc.boundingRect(contour); 51 | WritableNativeMap result = new WritableNativeMap(); 52 | result.putInt("x", rect.x); 53 | result.putInt("y", rect.y); 54 | result.putInt("width", rect.width); 55 | result.putInt("height", rect.height); 56 | 57 | return result; 58 | } 59 | } 60 | 61 | return new WritableNativeMap(); 62 | } 63 | 64 | static Mat imageToMat(ImageProxy imageProxy) { 65 | ImageProxy.PlaneProxy[] plane = imageProxy.getPlanes(); 66 | ByteBuffer yBuffer = plane[0].getBuffer(); 67 | ByteBuffer uBuffer = plane[1].getBuffer(); 68 | ByteBuffer vBuffer = plane[2].getBuffer(); 69 | 70 | int ySize = yBuffer.remaining(); 71 | int uSize = uBuffer.remaining(); 72 | int vSize = vBuffer.remaining(); 73 | 74 | byte[] nv21 = new byte[ySize + uSize + vSize]; 75 | 76 | yBuffer.get(nv21, 0, ySize); 77 | vBuffer.get(nv21, ySize, vSize); 78 | uBuffer.get(nv21, ySize + vSize, uSize); 79 | try { 80 | YuvImage yuvImage = new YuvImage(nv21, ImageFormat.NV21, imageProxy.getWidth(), imageProxy.getHeight(), null); 81 | ByteArrayOutputStream stream = new ByteArrayOutputStream(nv21.length); 82 | yuvImage.compressToJpeg(new android.graphics.Rect(0, 0, yuvImage.getWidth(), yuvImage.getHeight()), 90, stream); 83 | Bitmap bitmap = BitmapFactory.decodeByteArray(stream.toByteArray(), 0, stream.size()); 84 | Matrix matrix = new Matrix(); 85 | matrix.postRotate(90); 86 | stream.close(); 87 | Bitmap rotatedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); 88 | Mat mat = new Mat(rotatedBitmap.getWidth(), rotatedBitmap.getHeight(), CvType.CV_8UC4); 89 | Utils.bitmapToMat(rotatedBitmap, mat); 90 | return mat; 91 | } catch (IOException e) { 92 | e.printStackTrace(); 93 | } 94 | return null; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.EmptyReactNativeConfig; 20 | import com.facebook.react.fabric.FabricJSIModuleProvider; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.opencvframeprocessor.BuildConfig; 23 | import com.opencvframeprocessor.newarchitecture.components.MainComponentsRegistry; 24 | import com.opencvframeprocessor.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | new EmptyReactNativeConfig(), 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/opencvframeprocessor/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.opencvframeprocessor.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("opencvframeprocessor_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | THIS_DIR := $(call my-dir) 2 | 3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk 4 | 5 | # If you wish to add a custom TurboModule or Fabric component in your app you 6 | # will have to include the following autogenerated makefile. 7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_PATH := $(THIS_DIR) 11 | 12 | # You can customize the name of your application .so file here. 13 | LOCAL_MODULE := opencvframeprocessor_appmodules 14 | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) 17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 18 | 19 | # If you wish to add a custom TurboModule or Fabric component in your app you 20 | # will have to uncomment those lines to include the generated source 21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) 22 | # 23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) 25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 26 | 27 | # Here you should add any native library you wish to depend on. 28 | LOCAL_SHARED_LIBRARIES := \ 29 | libfabricjni \ 30 | libfbjni \ 31 | libfolly_futures \ 32 | libfolly_json \ 33 | libglog \ 34 | libjsi \ 35 | libreact_codegen_rncore \ 36 | libreact_debug \ 37 | libreact_nativemodule_core \ 38 | libreact_render_componentregistry \ 39 | libreact_render_core \ 40 | libreact_render_debug \ 41 | libreact_render_graphics \ 42 | librrc_view \ 43 | libruntimeexecutor \ 44 | libturbomodulejsijni \ 45 | libyoga 46 | 47 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall 48 | 49 | include $(BUILD_SHARED_LIBRARY) 50 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | 5 | namespace facebook { 6 | namespace react { 7 | 8 | std::shared_ptr MainApplicationModuleProvider( 9 | const std::string moduleName, 10 | const JavaTurboModule::InitParams ¶ms) { 11 | // Here you can provide your own module provider for TurboModules coming from 12 | // either your application or from external libraries. The approach to follow 13 | // is similar to the following (for a library called `samplelibrary`: 14 | // 15 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 16 | // if (module != nullptr) { 17 | // return module; 18 | // } 19 | // return rncore_ModuleProvider(moduleName, params); 20 | return rncore_ModuleProvider(moduleName, params); 21 | } 22 | 23 | } // namespace react 24 | } // namespace facebook 25 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string name, 26 | const std::shared_ptr jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | std::string name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/opencvframeprocessor/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string name, 25 | const std::shared_ptr jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(std::string name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 12 | 13 | std::shared_ptr 14 | MainComponentsRegistry::sharedProviderRegistry() { 15 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 16 | 17 | // Custom Fabric Components go here. You can register custom 18 | // components coming from your App or from 3rd party libraries here. 19 | // 20 | // providerRegistry->add(concreteComponentDescriptorProvider< 21 | // AocViewerComponentDescriptor>()); 22 | return providerRegistry; 23 | } 24 | 25 | jni::local_ref 26 | MainComponentsRegistry::initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate) { 29 | auto instance = makeCxxInstance(delegate); 30 | 31 | auto buildRegistryFunction = 32 | [](EventDispatcher::Weak const &eventDispatcher, 33 | ContextContainer::Shared const &contextContainer) 34 | -> ComponentDescriptorRegistry::Shared { 35 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 36 | ->createComponentDescriptorRegistry( 37 | {eventDispatcher, contextContainer}); 38 | 39 | auto mutableRegistry = 40 | std::const_pointer_cast(registry); 41 | 42 | mutableRegistry->setFallbackComponentDescriptor( 43 | std::make_shared( 44 | ComponentDescriptorParameters{ 45 | eventDispatcher, contextContainer, nullptr})); 46 | 47 | return registry; 48 | }; 49 | 50 | delegate->buildRegistryFunction = buildRegistryFunction; 51 | return instance; 52 | } 53 | 54 | void MainComponentsRegistry::registerNatives() { 55 | registerHybrid({ 56 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 57 | }); 58 | } 59 | 60 | } // namespace react 61 | } // namespace facebook 62 | -------------------------------------------------------------------------------- /android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/opencvframeprocessor/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | opencvframeprocessor 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 4 | 5 | buildscript { 6 | ext { 7 | buildToolsVersion = "31.0.0" 8 | minSdkVersion = 21 9 | compileSdkVersion = 31 10 | targetSdkVersion = 31 11 | kotlin_version = '1.6.10' 12 | 13 | if (System.properties['os.arch'] == "aarch64") { 14 | // For M1 Users we need to use the NDK 24 which added support for aarch64 15 | ndkVersion = "24.0.8215888" 16 | } else { 17 | // Otherwise we default to the side-by-side NDK version from AGP. 18 | ndkVersion = "21.4.7075529" 19 | } 20 | } 21 | repositories { 22 | google() 23 | mavenCentral() 24 | } 25 | dependencies { 26 | classpath("com.android.tools.build:gradle:7.0.4") 27 | classpath("com.facebook.react:react-native-gradle-plugin") 28 | classpath("de.undercouch:gradle-download-task:4.1.2") 29 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 30 | // NOTE: Do not place your application dependencies here; they belong 31 | // in the individual module build.gradle files 32 | } 33 | } 34 | 35 | allprojects { 36 | repositories { 37 | maven { 38 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 39 | url("$rootDir/../node_modules/react-native/android") 40 | } 41 | maven { 42 | // Android JSC is installed from npm 43 | url("$rootDir/../node_modules/jsc-android/dist") 44 | } 45 | mavenCentral { 46 | // We don't want to fetch react-native from Maven Central as there are 47 | // older versions over there. 48 | content { 49 | excludeGroup "com.facebook.react" 50 | } 51 | } 52 | google() 53 | maven { url 'https://www.jitpack.io' } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dogtronic/blog-opencv-frame-processor/8232089bfa38c1de8ebb3e62386fd1e7eadf1c66/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'opencvframeprocessor' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | } 10 | include ':openCVlib' 11 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "opencvframeprocessor", 3 | "displayName": "opencvframeprocessor" 4 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | 'react-native-reanimated/plugin', 6 | { 7 | globals: ['__objectDetect'], 8 | }, 9 | ], 10 | ], 11 | }; 12 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /ios/ObjectDetectFrameProcessor.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import "OpenCV.h" 6 | 7 | @interface ObjectDetectFrameProcessor : NSObject 8 | @end 9 | 10 | @implementation ObjectDetectFrameProcessor 11 | 12 | static inline id objectDetect(Frame* frame, NSArray* args) { 13 | CMSampleBufferRef buffer = frame.buffer; 14 | return [OpenCV findObjects:[OpenCV toUIImage:buffer]]; 15 | } 16 | 17 | VISION_EXPORT_FRAME_PROCESSOR(objectDetect) 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ios/OpenCV.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenCV.h 3 | // opencvframeprocessor 4 | // 5 | // Created by Łukasz Kurant on 29/07/2022. 6 | // 7 | 8 | #ifndef OpenCV_h 9 | #define OpenCV_h 10 | 11 | #include 12 | #import 13 | #import 14 | 15 | @interface OpenCV: NSObject 16 | + (NSString *) getOpenCVVersion; 17 | + (UIImage *) toUIImage:(CMSampleBufferRef)samImageBuff; 18 | + (NSDictionary *)findObjects:(UIImage *)image; 19 | @end 20 | 21 | #endif /* OpenCV_h */ 22 | -------------------------------------------------------------------------------- /ios/OpenCV.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "OpenCV.h" 3 | #import 4 | #import 5 | #import 6 | 7 | @implementation OpenCV : NSObject 8 | 9 | + (NSString *) getOpenCVVersion { 10 | return [NSString stringWithFormat:@"Version: %s", CV_VERSION]; 11 | } 12 | 13 | + (NSDictionary *)findObjects:(UIImage *)image { 14 | 15 | cv::Vec3b lowerBound(90, 120, 120); 16 | cv::Vec3b upperBound(140, 255, 255); 17 | 18 | cv::Mat matBGR, hsv; 19 | std::vector channels; 20 | 21 | cv::Mat matRGB = [self cvMatFromUIImage:(image)]; 22 | cv::cvtColor(matRGB,matBGR,cv::COLOR_RGB2BGR); 23 | cv::cvtColor(matBGR,hsv,cv::COLOR_BGR2HSV); 24 | cv::inRange(hsv, lowerBound, upperBound, hsv); 25 | cv::split(hsv, channels); 26 | 27 | 28 | std::vector> contours; 29 | cv::findContours(channels[0], contours, cv::RETR_TREE, cv::CHAIN_APPROX_SIMPLE ); 30 | 31 | std::vector rects; 32 | 33 | for( int i = 0; i< contours.size(); i++ ) { 34 | double area = contourArea(contours[i],false); 35 | if (area>3000) { 36 | cv::Rect rect = cv::boundingRect(contours.at(i)); 37 | 38 | return @{@"x": [NSNumber numberWithInt:rect.x] , @"y": 39 | [NSNumber numberWithInt: rect.y], @"width": [NSNumber numberWithInt:rect.width], @"height": [NSNumber numberWithInt:rect.height] }; 40 | } 41 | } 42 | 43 | return @{}; 44 | } 45 | 46 | + (cv::Mat)cvMatFromUIImage:(UIImage *)image 47 | { 48 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(image.CGImage); 49 | CGFloat cols = image.size.width; 50 | CGFloat rows = image.size.height; 51 | cv::Mat cvMat(rows, cols, CV_8UC4); 52 | CGContextRef contextRef = CGBitmapContextCreate(cvMat.data, 53 | cols, 54 | rows, 55 | 8, 56 | cvMat.step[0], 57 | colorSpace, 58 | kCGImageAlphaNoneSkipLast | 59 | kCGBitmapByteOrderDefault); 60 | CGContextDrawImage(contextRef, CGRectMake(0, 0, cols, rows), image.CGImage); 61 | CGContextRelease(contextRef); 62 | return cvMat; 63 | } 64 | 65 | + (UIImage *) toUIImage:(CMSampleBufferRef)samImageBuff 66 | { 67 | CVImageBufferRef imageBuffer = 68 | CMSampleBufferGetImageBuffer(samImageBuff); 69 | CIImage *ciImage = [CIImage imageWithCVPixelBuffer:imageBuffer]; 70 | CIContext *temporaryContext = [CIContext contextWithOptions:nil]; 71 | CGImageRef videoImage = [temporaryContext 72 | createCGImage:ciImage 73 | fromRect:CGRectMake(0, 0, 74 | CVPixelBufferGetWidth(imageBuffer), 75 | CVPixelBufferGetHeight(imageBuffer))]; 76 | 77 | UIImage *image = [[UIImage alloc] initWithCGImage:videoImage]; 78 | CGImageRelease(videoImage); 79 | return image; 80 | } 81 | 82 | +(UIImage *)UIImageFromCVMat:(cv::Mat)cvMat { 83 | NSData *data = [NSData dataWithBytes:cvMat.data length:cvMat.elemSize()*cvMat.total()]; 84 | 85 | CGColorSpaceRef colorSpace; 86 | CGBitmapInfo bitmapInfo; 87 | 88 | if (cvMat.elemSize() == 1) { 89 | colorSpace = CGColorSpaceCreateDeviceGray(); 90 | bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault; 91 | } else { 92 | colorSpace = CGColorSpaceCreateDeviceRGB(); 93 | // OpenCV defaults to either BGR or ABGR. In CoreGraphics land, 94 | // this means using the "32Little" byte order, and potentially 95 | // skipping the first pixel. These may need to be adjusted if the 96 | // input matrix uses a different pixel format. 97 | bitmapInfo = kCGBitmapByteOrder32Little | ( 98 | cvMat.elemSize() == 3? kCGImageAlphaNone : kCGImageAlphaNoneSkipFirst 99 | ); 100 | } 101 | 102 | CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data); 103 | 104 | // Creating CGImage from cv::Mat 105 | CGImageRef imageRef = CGImageCreate( 106 | cvMat.cols, //width 107 | cvMat.rows, //height 108 | 8, //bits per component 109 | 8 * cvMat.elemSize(), //bits per pixel 110 | cvMat.step[0], //bytesPerRow 111 | colorSpace, //colorspace 112 | bitmapInfo, // bitmap info 113 | provider, //CGDataProviderRef 114 | NULL, //decode 115 | false, //should interpolate 116 | kCGRenderingIntentDefault //intent 117 | ); 118 | 119 | // Getting UIImage from CGImage 120 | UIImage *finalImage = [UIImage imageWithCGImage:imageRef]; 121 | CGImageRelease(imageRef); 122 | CGDataProviderRelease(provider); 123 | CGColorSpaceRelease(colorSpace); 124 | 125 | return finalImage; 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'opencvframeprocessor' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # to enable hermes on iOS, change `false` to `true` and then install pods 16 | :hermes_enabled => flags[:hermes_enabled], 17 | :fabric_enabled => flags[:fabric_enabled], 18 | # An absolute path to your application root. 19 | :app_path => "#{Pod::Config.instance.installation_root}/.." 20 | ) 21 | 22 | target 'opencvframeprocessorTests' do 23 | inherit! :complete 24 | # Pods for testing 25 | end 26 | 27 | # Enables Flipper. 28 | # 29 | # Note that if you have use_frameworks! enabled, Flipper will not work and 30 | # you should disable the next line. 31 | use_flipper!() 32 | 33 | post_install do |installer| 34 | react_native_post_install(installer) 35 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.68.2) 6 | - FBReactNativeSpec (0.68.2): 7 | - RCT-Folly (= 2021.06.28.00-v2) 8 | - RCTRequired (= 0.68.2) 9 | - RCTTypeSafety (= 0.68.2) 10 | - React-Core (= 0.68.2) 11 | - React-jsi (= 0.68.2) 12 | - ReactCommon/turbomodule/core (= 0.68.2) 13 | - Flipper (0.125.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.2.0) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.10): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.1100) 26 | - Flipper-Glog (0.5.0.4) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.125.0): 31 | - FlipperKit/Core (= 0.125.0) 32 | - FlipperKit/Core (0.125.0): 33 | - Flipper (~> 0.125.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - SocketRocket (~> 0.6.0) 39 | - FlipperKit/CppBridge (0.125.0): 40 | - Flipper (~> 0.125.0) 41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0): 42 | - Flipper-Folly (~> 2.6) 43 | - FlipperKit/FBDefines (0.125.0) 44 | - FlipperKit/FKPortForwarding (0.125.0): 45 | - CocoaAsyncSocket (~> 7.6) 46 | - Flipper-PeerTalk (~> 0.0.4) 47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0) 48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0): 49 | - FlipperKit/Core 50 | - FlipperKit/FlipperKitHighlightOverlay 51 | - FlipperKit/FlipperKitLayoutTextSearchable 52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0): 53 | - FlipperKit/Core 54 | - FlipperKit/FlipperKitHighlightOverlay 55 | - FlipperKit/FlipperKitLayoutHelpers 56 | - YogaKit (~> 1.18) 57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0): 58 | - FlipperKit/Core 59 | - FlipperKit/FlipperKitHighlightOverlay 60 | - FlipperKit/FlipperKitLayoutHelpers 61 | - FlipperKit/FlipperKitLayoutIOSDescriptors 62 | - FlipperKit/FlipperKitLayoutTextSearchable 63 | - YogaKit (~> 1.18) 64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0) 65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0): 66 | - FlipperKit/Core 67 | - FlipperKit/FlipperKitReactPlugin (0.125.0): 68 | - FlipperKit/Core 69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0): 70 | - FlipperKit/Core 71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0): 72 | - FlipperKit/Core 73 | - FlipperKit/FlipperKitNetworkPlugin 74 | - fmt (6.2.1) 75 | - glog (0.3.5) 76 | - libevent (2.1.12) 77 | - OpenSSL-Universal (1.1.1100) 78 | - RCT-Folly (2021.06.28.00-v2): 79 | - boost 80 | - DoubleConversion 81 | - fmt (~> 6.2.1) 82 | - glog 83 | - RCT-Folly/Default (= 2021.06.28.00-v2) 84 | - RCT-Folly/Default (2021.06.28.00-v2): 85 | - boost 86 | - DoubleConversion 87 | - fmt (~> 6.2.1) 88 | - glog 89 | - RCTRequired (0.68.2) 90 | - RCTTypeSafety (0.68.2): 91 | - FBLazyVector (= 0.68.2) 92 | - RCT-Folly (= 2021.06.28.00-v2) 93 | - RCTRequired (= 0.68.2) 94 | - React-Core (= 0.68.2) 95 | - React (0.68.2): 96 | - React-Core (= 0.68.2) 97 | - React-Core/DevSupport (= 0.68.2) 98 | - React-Core/RCTWebSocket (= 0.68.2) 99 | - React-RCTActionSheet (= 0.68.2) 100 | - React-RCTAnimation (= 0.68.2) 101 | - React-RCTBlob (= 0.68.2) 102 | - React-RCTImage (= 0.68.2) 103 | - React-RCTLinking (= 0.68.2) 104 | - React-RCTNetwork (= 0.68.2) 105 | - React-RCTSettings (= 0.68.2) 106 | - React-RCTText (= 0.68.2) 107 | - React-RCTVibration (= 0.68.2) 108 | - React-callinvoker (0.68.2) 109 | - React-Codegen (0.68.2): 110 | - FBReactNativeSpec (= 0.68.2) 111 | - RCT-Folly (= 2021.06.28.00-v2) 112 | - RCTRequired (= 0.68.2) 113 | - RCTTypeSafety (= 0.68.2) 114 | - React-Core (= 0.68.2) 115 | - React-jsi (= 0.68.2) 116 | - React-jsiexecutor (= 0.68.2) 117 | - ReactCommon/turbomodule/core (= 0.68.2) 118 | - React-Core (0.68.2): 119 | - glog 120 | - RCT-Folly (= 2021.06.28.00-v2) 121 | - React-Core/Default (= 0.68.2) 122 | - React-cxxreact (= 0.68.2) 123 | - React-jsi (= 0.68.2) 124 | - React-jsiexecutor (= 0.68.2) 125 | - React-perflogger (= 0.68.2) 126 | - Yoga 127 | - React-Core/CoreModulesHeaders (0.68.2): 128 | - glog 129 | - RCT-Folly (= 2021.06.28.00-v2) 130 | - React-Core/Default 131 | - React-cxxreact (= 0.68.2) 132 | - React-jsi (= 0.68.2) 133 | - React-jsiexecutor (= 0.68.2) 134 | - React-perflogger (= 0.68.2) 135 | - Yoga 136 | - React-Core/Default (0.68.2): 137 | - glog 138 | - RCT-Folly (= 2021.06.28.00-v2) 139 | - React-cxxreact (= 0.68.2) 140 | - React-jsi (= 0.68.2) 141 | - React-jsiexecutor (= 0.68.2) 142 | - React-perflogger (= 0.68.2) 143 | - Yoga 144 | - React-Core/DevSupport (0.68.2): 145 | - glog 146 | - RCT-Folly (= 2021.06.28.00-v2) 147 | - React-Core/Default (= 0.68.2) 148 | - React-Core/RCTWebSocket (= 0.68.2) 149 | - React-cxxreact (= 0.68.2) 150 | - React-jsi (= 0.68.2) 151 | - React-jsiexecutor (= 0.68.2) 152 | - React-jsinspector (= 0.68.2) 153 | - React-perflogger (= 0.68.2) 154 | - Yoga 155 | - React-Core/RCTActionSheetHeaders (0.68.2): 156 | - glog 157 | - RCT-Folly (= 2021.06.28.00-v2) 158 | - React-Core/Default 159 | - React-cxxreact (= 0.68.2) 160 | - React-jsi (= 0.68.2) 161 | - React-jsiexecutor (= 0.68.2) 162 | - React-perflogger (= 0.68.2) 163 | - Yoga 164 | - React-Core/RCTAnimationHeaders (0.68.2): 165 | - glog 166 | - RCT-Folly (= 2021.06.28.00-v2) 167 | - React-Core/Default 168 | - React-cxxreact (= 0.68.2) 169 | - React-jsi (= 0.68.2) 170 | - React-jsiexecutor (= 0.68.2) 171 | - React-perflogger (= 0.68.2) 172 | - Yoga 173 | - React-Core/RCTBlobHeaders (0.68.2): 174 | - glog 175 | - RCT-Folly (= 2021.06.28.00-v2) 176 | - React-Core/Default 177 | - React-cxxreact (= 0.68.2) 178 | - React-jsi (= 0.68.2) 179 | - React-jsiexecutor (= 0.68.2) 180 | - React-perflogger (= 0.68.2) 181 | - Yoga 182 | - React-Core/RCTImageHeaders (0.68.2): 183 | - glog 184 | - RCT-Folly (= 2021.06.28.00-v2) 185 | - React-Core/Default 186 | - React-cxxreact (= 0.68.2) 187 | - React-jsi (= 0.68.2) 188 | - React-jsiexecutor (= 0.68.2) 189 | - React-perflogger (= 0.68.2) 190 | - Yoga 191 | - React-Core/RCTLinkingHeaders (0.68.2): 192 | - glog 193 | - RCT-Folly (= 2021.06.28.00-v2) 194 | - React-Core/Default 195 | - React-cxxreact (= 0.68.2) 196 | - React-jsi (= 0.68.2) 197 | - React-jsiexecutor (= 0.68.2) 198 | - React-perflogger (= 0.68.2) 199 | - Yoga 200 | - React-Core/RCTNetworkHeaders (0.68.2): 201 | - glog 202 | - RCT-Folly (= 2021.06.28.00-v2) 203 | - React-Core/Default 204 | - React-cxxreact (= 0.68.2) 205 | - React-jsi (= 0.68.2) 206 | - React-jsiexecutor (= 0.68.2) 207 | - React-perflogger (= 0.68.2) 208 | - Yoga 209 | - React-Core/RCTSettingsHeaders (0.68.2): 210 | - glog 211 | - RCT-Folly (= 2021.06.28.00-v2) 212 | - React-Core/Default 213 | - React-cxxreact (= 0.68.2) 214 | - React-jsi (= 0.68.2) 215 | - React-jsiexecutor (= 0.68.2) 216 | - React-perflogger (= 0.68.2) 217 | - Yoga 218 | - React-Core/RCTTextHeaders (0.68.2): 219 | - glog 220 | - RCT-Folly (= 2021.06.28.00-v2) 221 | - React-Core/Default 222 | - React-cxxreact (= 0.68.2) 223 | - React-jsi (= 0.68.2) 224 | - React-jsiexecutor (= 0.68.2) 225 | - React-perflogger (= 0.68.2) 226 | - Yoga 227 | - React-Core/RCTVibrationHeaders (0.68.2): 228 | - glog 229 | - RCT-Folly (= 2021.06.28.00-v2) 230 | - React-Core/Default 231 | - React-cxxreact (= 0.68.2) 232 | - React-jsi (= 0.68.2) 233 | - React-jsiexecutor (= 0.68.2) 234 | - React-perflogger (= 0.68.2) 235 | - Yoga 236 | - React-Core/RCTWebSocket (0.68.2): 237 | - glog 238 | - RCT-Folly (= 2021.06.28.00-v2) 239 | - React-Core/Default (= 0.68.2) 240 | - React-cxxreact (= 0.68.2) 241 | - React-jsi (= 0.68.2) 242 | - React-jsiexecutor (= 0.68.2) 243 | - React-perflogger (= 0.68.2) 244 | - Yoga 245 | - React-CoreModules (0.68.2): 246 | - RCT-Folly (= 2021.06.28.00-v2) 247 | - RCTTypeSafety (= 0.68.2) 248 | - React-Codegen (= 0.68.2) 249 | - React-Core/CoreModulesHeaders (= 0.68.2) 250 | - React-jsi (= 0.68.2) 251 | - React-RCTImage (= 0.68.2) 252 | - ReactCommon/turbomodule/core (= 0.68.2) 253 | - React-cxxreact (0.68.2): 254 | - boost (= 1.76.0) 255 | - DoubleConversion 256 | - glog 257 | - RCT-Folly (= 2021.06.28.00-v2) 258 | - React-callinvoker (= 0.68.2) 259 | - React-jsi (= 0.68.2) 260 | - React-jsinspector (= 0.68.2) 261 | - React-logger (= 0.68.2) 262 | - React-perflogger (= 0.68.2) 263 | - React-runtimeexecutor (= 0.68.2) 264 | - React-jsi (0.68.2): 265 | - boost (= 1.76.0) 266 | - DoubleConversion 267 | - glog 268 | - RCT-Folly (= 2021.06.28.00-v2) 269 | - React-jsi/Default (= 0.68.2) 270 | - React-jsi/Default (0.68.2): 271 | - boost (= 1.76.0) 272 | - DoubleConversion 273 | - glog 274 | - RCT-Folly (= 2021.06.28.00-v2) 275 | - React-jsiexecutor (0.68.2): 276 | - DoubleConversion 277 | - glog 278 | - RCT-Folly (= 2021.06.28.00-v2) 279 | - React-cxxreact (= 0.68.2) 280 | - React-jsi (= 0.68.2) 281 | - React-perflogger (= 0.68.2) 282 | - React-jsinspector (0.68.2) 283 | - React-logger (0.68.2): 284 | - glog 285 | - React-perflogger (0.68.2) 286 | - React-RCTActionSheet (0.68.2): 287 | - React-Core/RCTActionSheetHeaders (= 0.68.2) 288 | - React-RCTAnimation (0.68.2): 289 | - RCT-Folly (= 2021.06.28.00-v2) 290 | - RCTTypeSafety (= 0.68.2) 291 | - React-Codegen (= 0.68.2) 292 | - React-Core/RCTAnimationHeaders (= 0.68.2) 293 | - React-jsi (= 0.68.2) 294 | - ReactCommon/turbomodule/core (= 0.68.2) 295 | - React-RCTBlob (0.68.2): 296 | - RCT-Folly (= 2021.06.28.00-v2) 297 | - React-Codegen (= 0.68.2) 298 | - React-Core/RCTBlobHeaders (= 0.68.2) 299 | - React-Core/RCTWebSocket (= 0.68.2) 300 | - React-jsi (= 0.68.2) 301 | - React-RCTNetwork (= 0.68.2) 302 | - ReactCommon/turbomodule/core (= 0.68.2) 303 | - React-RCTImage (0.68.2): 304 | - RCT-Folly (= 2021.06.28.00-v2) 305 | - RCTTypeSafety (= 0.68.2) 306 | - React-Codegen (= 0.68.2) 307 | - React-Core/RCTImageHeaders (= 0.68.2) 308 | - React-jsi (= 0.68.2) 309 | - React-RCTNetwork (= 0.68.2) 310 | - ReactCommon/turbomodule/core (= 0.68.2) 311 | - React-RCTLinking (0.68.2): 312 | - React-Codegen (= 0.68.2) 313 | - React-Core/RCTLinkingHeaders (= 0.68.2) 314 | - React-jsi (= 0.68.2) 315 | - ReactCommon/turbomodule/core (= 0.68.2) 316 | - React-RCTNetwork (0.68.2): 317 | - RCT-Folly (= 2021.06.28.00-v2) 318 | - RCTTypeSafety (= 0.68.2) 319 | - React-Codegen (= 0.68.2) 320 | - React-Core/RCTNetworkHeaders (= 0.68.2) 321 | - React-jsi (= 0.68.2) 322 | - ReactCommon/turbomodule/core (= 0.68.2) 323 | - React-RCTSettings (0.68.2): 324 | - RCT-Folly (= 2021.06.28.00-v2) 325 | - RCTTypeSafety (= 0.68.2) 326 | - React-Codegen (= 0.68.2) 327 | - React-Core/RCTSettingsHeaders (= 0.68.2) 328 | - React-jsi (= 0.68.2) 329 | - ReactCommon/turbomodule/core (= 0.68.2) 330 | - React-RCTText (0.68.2): 331 | - React-Core/RCTTextHeaders (= 0.68.2) 332 | - React-RCTVibration (0.68.2): 333 | - RCT-Folly (= 2021.06.28.00-v2) 334 | - React-Codegen (= 0.68.2) 335 | - React-Core/RCTVibrationHeaders (= 0.68.2) 336 | - React-jsi (= 0.68.2) 337 | - ReactCommon/turbomodule/core (= 0.68.2) 338 | - React-runtimeexecutor (0.68.2): 339 | - React-jsi (= 0.68.2) 340 | - ReactCommon/turbomodule/core (0.68.2): 341 | - DoubleConversion 342 | - glog 343 | - RCT-Folly (= 2021.06.28.00-v2) 344 | - React-callinvoker (= 0.68.2) 345 | - React-Core (= 0.68.2) 346 | - React-cxxreact (= 0.68.2) 347 | - React-jsi (= 0.68.2) 348 | - React-logger (= 0.68.2) 349 | - React-perflogger (= 0.68.2) 350 | - RNReanimated (2.9.1): 351 | - DoubleConversion 352 | - FBLazyVector 353 | - FBReactNativeSpec 354 | - glog 355 | - RCT-Folly 356 | - RCTRequired 357 | - RCTTypeSafety 358 | - React-callinvoker 359 | - React-Core 360 | - React-Core/DevSupport 361 | - React-Core/RCTWebSocket 362 | - React-CoreModules 363 | - React-cxxreact 364 | - React-jsi 365 | - React-jsiexecutor 366 | - React-jsinspector 367 | - React-RCTActionSheet 368 | - React-RCTAnimation 369 | - React-RCTBlob 370 | - React-RCTImage 371 | - React-RCTLinking 372 | - React-RCTNetwork 373 | - React-RCTSettings 374 | - React-RCTText 375 | - ReactCommon/turbomodule/core 376 | - Yoga 377 | - SocketRocket (0.6.0) 378 | - VisionCamera (2.14.0): 379 | - React 380 | - React-callinvoker 381 | - React-Core 382 | - Yoga (1.14.0) 383 | - YogaKit (1.18.1): 384 | - Yoga (~> 1.14) 385 | 386 | DEPENDENCIES: 387 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 388 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 389 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 390 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 391 | - Flipper (= 0.125.0) 392 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 393 | - Flipper-DoubleConversion (= 3.2.0) 394 | - Flipper-Fmt (= 7.1.7) 395 | - Flipper-Folly (= 2.6.10) 396 | - Flipper-Glog (= 0.5.0.4) 397 | - Flipper-PeerTalk (= 0.0.4) 398 | - Flipper-RSocket (= 1.4.3) 399 | - FlipperKit (= 0.125.0) 400 | - FlipperKit/Core (= 0.125.0) 401 | - FlipperKit/CppBridge (= 0.125.0) 402 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0) 403 | - FlipperKit/FBDefines (= 0.125.0) 404 | - FlipperKit/FKPortForwarding (= 0.125.0) 405 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0) 406 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0) 407 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0) 408 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0) 409 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0) 410 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0) 411 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0) 412 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 413 | - OpenSSL-Universal (= 1.1.1100) 414 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 415 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 416 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 417 | - React (from `../node_modules/react-native/`) 418 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 419 | - React-Codegen (from `build/generated/ios`) 420 | - React-Core (from `../node_modules/react-native/`) 421 | - React-Core/DevSupport (from `../node_modules/react-native/`) 422 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 423 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 424 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 425 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 426 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 427 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 428 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 429 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 430 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 431 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 432 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 433 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 434 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 435 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 436 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 437 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 438 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 439 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 440 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 441 | - RNReanimated (from `../node_modules/react-native-reanimated`) 442 | - VisionCamera (from `../node_modules/react-native-vision-camera`) 443 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 444 | 445 | SPEC REPOS: 446 | trunk: 447 | - CocoaAsyncSocket 448 | - Flipper 449 | - Flipper-Boost-iOSX 450 | - Flipper-DoubleConversion 451 | - Flipper-Fmt 452 | - Flipper-Folly 453 | - Flipper-Glog 454 | - Flipper-PeerTalk 455 | - Flipper-RSocket 456 | - FlipperKit 457 | - fmt 458 | - libevent 459 | - OpenSSL-Universal 460 | - SocketRocket 461 | - YogaKit 462 | 463 | EXTERNAL SOURCES: 464 | boost: 465 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 466 | DoubleConversion: 467 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 468 | FBLazyVector: 469 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 470 | FBReactNativeSpec: 471 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 472 | glog: 473 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 474 | RCT-Folly: 475 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 476 | RCTRequired: 477 | :path: "../node_modules/react-native/Libraries/RCTRequired" 478 | RCTTypeSafety: 479 | :path: "../node_modules/react-native/Libraries/TypeSafety" 480 | React: 481 | :path: "../node_modules/react-native/" 482 | React-callinvoker: 483 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 484 | React-Codegen: 485 | :path: build/generated/ios 486 | React-Core: 487 | :path: "../node_modules/react-native/" 488 | React-CoreModules: 489 | :path: "../node_modules/react-native/React/CoreModules" 490 | React-cxxreact: 491 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 492 | React-jsi: 493 | :path: "../node_modules/react-native/ReactCommon/jsi" 494 | React-jsiexecutor: 495 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 496 | React-jsinspector: 497 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 498 | React-logger: 499 | :path: "../node_modules/react-native/ReactCommon/logger" 500 | React-perflogger: 501 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 502 | React-RCTActionSheet: 503 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 504 | React-RCTAnimation: 505 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 506 | React-RCTBlob: 507 | :path: "../node_modules/react-native/Libraries/Blob" 508 | React-RCTImage: 509 | :path: "../node_modules/react-native/Libraries/Image" 510 | React-RCTLinking: 511 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 512 | React-RCTNetwork: 513 | :path: "../node_modules/react-native/Libraries/Network" 514 | React-RCTSettings: 515 | :path: "../node_modules/react-native/Libraries/Settings" 516 | React-RCTText: 517 | :path: "../node_modules/react-native/Libraries/Text" 518 | React-RCTVibration: 519 | :path: "../node_modules/react-native/Libraries/Vibration" 520 | React-runtimeexecutor: 521 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 522 | ReactCommon: 523 | :path: "../node_modules/react-native/ReactCommon" 524 | RNReanimated: 525 | :path: "../node_modules/react-native-reanimated" 526 | VisionCamera: 527 | :path: "../node_modules/react-native-vision-camera" 528 | Yoga: 529 | :path: "../node_modules/react-native/ReactCommon/yoga" 530 | 531 | SPEC CHECKSUMS: 532 | boost: a7c83b31436843459a1961bfd74b96033dc77234 533 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 534 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 535 | FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648 536 | FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4 537 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 538 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 539 | Flipper-DoubleConversion: 3d3d04a078d4f3a1b6c6916587f159dc11f232c4 540 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 541 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 542 | Flipper-Glog: 87bc98ff48de90cb5b0b5114ed3da79d85ee2dd4 543 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 544 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 545 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 546 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 547 | glog: 476ee3e89abb49e07f822b48323c51c57124b572 548 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 549 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c 550 | RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8 551 | RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0 552 | RCTTypeSafety: c43c072a4bd60feb49a9570b0517892b4305c45e 553 | React: 176dd882de001854ced260fad41bb68a31aa4bd0 554 | React-callinvoker: c2864d1818d6e64928d2faf774a3800dfc38fe1f 555 | React-Codegen: 98b6f97f0a7abf7d67e4ce435c77c05b7a95cf05 556 | React-Core: fdaa2916b1c893f39f02cff0476d1fb0cab1e352 557 | React-CoreModules: fd8705b80699ec36c2cdd635c2ce9d874b9cfdfc 558 | React-cxxreact: 1832d971f7b0cb2c7b943dc0ec962762c90c906e 559 | React-jsi: 72af715135abe8c3f0dcf3b2548b71d048b69a7e 560 | React-jsiexecutor: b7b553412f2ec768fe6c8f27cd6bafdb9d8719e6 561 | React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8 562 | React-logger: a0833912d93b36b791b7a521672d8ee89107aff1 563 | React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6 564 | React-RCTActionSheet: 547fe42fdb4b6089598d79f8e1d855d7c23e2162 565 | React-RCTAnimation: bc9440a1c37b06ae9ebbb532d244f607805c6034 566 | React-RCTBlob: a1295c8e183756d7ef30ba6e8f8144dfe8a19215 567 | React-RCTImage: a30d1ee09b1334067fbb6f30789aae2d7ac150c9 568 | React-RCTLinking: ffc6d5b88d1cb9aca13c54c2ec6507fbf07f2ac4 569 | React-RCTNetwork: f807a2facab6cf5cf36d592e634611de9cf12d81 570 | React-RCTSettings: 861806819226ed8332e6a8f90df2951a34bb3e7f 571 | React-RCTText: f3fb464cc41a50fc7a1aba4deeb76a9ad8282cb9 572 | React-RCTVibration: 79040b92bfa9c3c2d2cb4f57e981164ec7ab9374 573 | React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23 574 | ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2 575 | RNReanimated: 5c8c17e26787fd8984cd5accdc70fef2ca70aafd 576 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 577 | VisionCamera: 0545b4d3ed83299af898cec4ee2bf9a6ca98fc7a 578 | Yoga: 99652481fcd320aefa4a7ef90095b95acd181952 579 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 580 | 581 | PODFILE CHECKSUM: 59720e33649c186ea42e6d28915b0e9cc3b92617 582 | 583 | COCOAPODS: 1.11.3 584 | -------------------------------------------------------------------------------- /ios/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | #ifndef PrefixHeader_pch 2 | #define PrefixHeader_pch 3 | 4 | #ifdef __cplusplus 5 | #include 6 | #include 7 | #endif 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* opencvframeprocessorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* opencvframeprocessorTests.m */; }; 11 | 0C80B921A6F3F58F76C31292 /* libPods-opencvframeprocessor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-opencvframeprocessor.a */; }; 12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 7699B88040F8A987B510C191 /* libPods-opencvframeprocessor-opencvframeprocessorTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-opencvframeprocessor-opencvframeprocessorTests.a */; }; 16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 17 | B2DA82B02893EDDD00EECB34 /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82AF2893EDDD00EECB34 /* opencv2.framework */; }; 18 | B2DA82B22893EDFD00EECB34 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82B12893EDFD00EECB34 /* QuartzCore.framework */; }; 19 | B2DA82B42893EE0300EECB34 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82B32893EE0300EECB34 /* CoreMedia.framework */; }; 20 | B2DA82B62893EE0A00EECB34 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82B52893EE0A00EECB34 /* CoreImage.framework */; }; 21 | B2DA82B82893EE1100EECB34 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82B72893EE1100EECB34 /* AssetsLibrary.framework */; }; 22 | B2DA82BA2893EE1800EECB34 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82B92893EE1800EECB34 /* CoreFoundation.framework */; }; 23 | B2DA82BC2893EE1F00EECB34 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82BB2893EE1F00EECB34 /* CoreGraphics.framework */; }; 24 | B2DA82BE2893EE2D00EECB34 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B2DA82BD2893EE2D00EECB34 /* Accelerate.framework */; }; 25 | B2DA82C12893EE7600EECB34 /* OpenCV.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2DA82C02893EE7600EECB34 /* OpenCV.mm */; }; 26 | B2DA82C42893F05700EECB34 /* ObjectDetectFrameProcessor.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2DA82C32893F05700EECB34 /* ObjectDetectFrameProcessor.mm */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 35 | remoteInfo = opencvframeprocessor; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 00E356EE1AD99517003FC87E /* opencvframeprocessorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = opencvframeprocessorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 00E356F21AD99517003FC87E /* opencvframeprocessorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = opencvframeprocessorTests.m; sourceTree = ""; }; 43 | 13B07F961A680F5B00A75B9A /* opencvframeprocessor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = opencvframeprocessor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = opencvframeprocessor/AppDelegate.h; sourceTree = ""; }; 45 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = opencvframeprocessor/AppDelegate.mm; sourceTree = ""; }; 46 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = opencvframeprocessor/Images.xcassets; sourceTree = ""; }; 47 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = opencvframeprocessor/Info.plist; sourceTree = ""; }; 48 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = opencvframeprocessor/main.m; sourceTree = ""; }; 49 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-opencvframeprocessor-opencvframeprocessorTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-opencvframeprocessor-opencvframeprocessorTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 3B4392A12AC88292D35C810B /* Pods-opencvframeprocessor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-opencvframeprocessor.debug.xcconfig"; path = "Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor.debug.xcconfig"; sourceTree = ""; }; 51 | 5709B34CF0A7D63546082F79 /* Pods-opencvframeprocessor.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-opencvframeprocessor.release.xcconfig"; path = "Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor.release.xcconfig"; sourceTree = ""; }; 52 | 5B7EB9410499542E8C5724F5 /* Pods-opencvframeprocessor-opencvframeprocessorTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-opencvframeprocessor-opencvframeprocessorTests.debug.xcconfig"; path = "Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests.debug.xcconfig"; sourceTree = ""; }; 53 | 5DCACB8F33CDC322A6C60F78 /* libPods-opencvframeprocessor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-opencvframeprocessor.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = opencvframeprocessor/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 89C6BE57DB24E9ADA2F236DE /* Pods-opencvframeprocessor-opencvframeprocessorTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-opencvframeprocessor-opencvframeprocessorTests.release.xcconfig"; path = "Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests.release.xcconfig"; sourceTree = ""; }; 56 | B2DA82AF2893EDDD00EECB34 /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = opencv2.framework; sourceTree = ""; }; 57 | B2DA82B12893EDFD00EECB34 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 58 | B2DA82B32893EE0300EECB34 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 59 | B2DA82B52893EE0A00EECB34 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 60 | B2DA82B72893EE1100EECB34 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 61 | B2DA82B92893EE1800EECB34 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 62 | B2DA82BB2893EE1F00EECB34 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 63 | B2DA82BD2893EE2D00EECB34 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 64 | B2DA82BF2893EE5200EECB34 /* OpenCV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenCV.h; sourceTree = ""; }; 65 | B2DA82C02893EE7600EECB34 /* OpenCV.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = OpenCV.mm; sourceTree = ""; }; 66 | B2DA82C22893EE9600EECB34 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 67 | B2DA82C32893F05700EECB34 /* ObjectDetectFrameProcessor.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ObjectDetectFrameProcessor.mm; sourceTree = ""; }; 68 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 7699B88040F8A987B510C191 /* libPods-opencvframeprocessor-opencvframeprocessorTests.a in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | B2DA82BE2893EE2D00EECB34 /* Accelerate.framework in Frameworks */, 85 | B2DA82B42893EE0300EECB34 /* CoreMedia.framework in Frameworks */, 86 | B2DA82BC2893EE1F00EECB34 /* CoreGraphics.framework in Frameworks */, 87 | B2DA82BA2893EE1800EECB34 /* CoreFoundation.framework in Frameworks */, 88 | B2DA82B82893EE1100EECB34 /* AssetsLibrary.framework in Frameworks */, 89 | B2DA82B62893EE0A00EECB34 /* CoreImage.framework in Frameworks */, 90 | B2DA82B22893EDFD00EECB34 /* QuartzCore.framework in Frameworks */, 91 | B2DA82B02893EDDD00EECB34 /* opencv2.framework in Frameworks */, 92 | 0C80B921A6F3F58F76C31292 /* libPods-opencvframeprocessor.a in Frameworks */, 93 | ); 94 | runOnlyForDeploymentPostprocessing = 0; 95 | }; 96 | /* End PBXFrameworksBuildPhase section */ 97 | 98 | /* Begin PBXGroup section */ 99 | 00E356EF1AD99517003FC87E /* opencvframeprocessorTests */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 00E356F21AD99517003FC87E /* opencvframeprocessorTests.m */, 103 | 00E356F01AD99517003FC87E /* Supporting Files */, 104 | ); 105 | path = opencvframeprocessorTests; 106 | sourceTree = ""; 107 | }; 108 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 00E356F11AD99517003FC87E /* Info.plist */, 112 | ); 113 | name = "Supporting Files"; 114 | sourceTree = ""; 115 | }; 116 | 13B07FAE1A68108700A75B9A /* opencvframeprocessor */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 120 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 121 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 122 | 13B07FB61A68108700A75B9A /* Info.plist */, 123 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 124 | 13B07FB71A68108700A75B9A /* main.m */, 125 | B2DA82BF2893EE5200EECB34 /* OpenCV.h */, 126 | B2DA82C02893EE7600EECB34 /* OpenCV.mm */, 127 | B2DA82C22893EE9600EECB34 /* PrefixHeader.pch */, 128 | B2DA82C32893F05700EECB34 /* ObjectDetectFrameProcessor.mm */, 129 | ); 130 | name = opencvframeprocessor; 131 | sourceTree = ""; 132 | }; 133 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | B2DA82BD2893EE2D00EECB34 /* Accelerate.framework */, 137 | B2DA82BB2893EE1F00EECB34 /* CoreGraphics.framework */, 138 | B2DA82B92893EE1800EECB34 /* CoreFoundation.framework */, 139 | B2DA82B72893EE1100EECB34 /* AssetsLibrary.framework */, 140 | B2DA82B52893EE0A00EECB34 /* CoreImage.framework */, 141 | B2DA82B32893EE0300EECB34 /* CoreMedia.framework */, 142 | B2DA82B12893EDFD00EECB34 /* QuartzCore.framework */, 143 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 144 | 5DCACB8F33CDC322A6C60F78 /* libPods-opencvframeprocessor.a */, 145 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-opencvframeprocessor-opencvframeprocessorTests.a */, 146 | ); 147 | name = Frameworks; 148 | sourceTree = ""; 149 | }; 150 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | ); 154 | name = Libraries; 155 | sourceTree = ""; 156 | }; 157 | 83CBB9F61A601CBA00E9B192 = { 158 | isa = PBXGroup; 159 | children = ( 160 | B2DA82AF2893EDDD00EECB34 /* opencv2.framework */, 161 | 13B07FAE1A68108700A75B9A /* opencvframeprocessor */, 162 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 163 | 00E356EF1AD99517003FC87E /* opencvframeprocessorTests */, 164 | 83CBBA001A601CBA00E9B192 /* Products */, 165 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 166 | BBD78D7AC51CEA395F1C20DB /* Pods */, 167 | ); 168 | indentWidth = 2; 169 | sourceTree = ""; 170 | tabWidth = 2; 171 | usesTabs = 0; 172 | }; 173 | 83CBBA001A601CBA00E9B192 /* Products */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 13B07F961A680F5B00A75B9A /* opencvframeprocessor.app */, 177 | 00E356EE1AD99517003FC87E /* opencvframeprocessorTests.xctest */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 3B4392A12AC88292D35C810B /* Pods-opencvframeprocessor.debug.xcconfig */, 186 | 5709B34CF0A7D63546082F79 /* Pods-opencvframeprocessor.release.xcconfig */, 187 | 5B7EB9410499542E8C5724F5 /* Pods-opencvframeprocessor-opencvframeprocessorTests.debug.xcconfig */, 188 | 89C6BE57DB24E9ADA2F236DE /* Pods-opencvframeprocessor-opencvframeprocessorTests.release.xcconfig */, 189 | ); 190 | path = Pods; 191 | sourceTree = ""; 192 | }; 193 | /* End PBXGroup section */ 194 | 195 | /* Begin PBXNativeTarget section */ 196 | 00E356ED1AD99517003FC87E /* opencvframeprocessorTests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "opencvframeprocessorTests" */; 199 | buildPhases = ( 200 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 201 | 00E356EA1AD99517003FC87E /* Sources */, 202 | 00E356EB1AD99517003FC87E /* Frameworks */, 203 | 00E356EC1AD99517003FC87E /* Resources */, 204 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, 205 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 211 | ); 212 | name = opencvframeprocessorTests; 213 | productName = opencvframeprocessorTests; 214 | productReference = 00E356EE1AD99517003FC87E /* opencvframeprocessorTests.xctest */; 215 | productType = "com.apple.product-type.bundle.unit-test"; 216 | }; 217 | 13B07F861A680F5B00A75B9A /* opencvframeprocessor */ = { 218 | isa = PBXNativeTarget; 219 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "opencvframeprocessor" */; 220 | buildPhases = ( 221 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 222 | FD10A7F022414F080027D42C /* Start Packager */, 223 | 13B07F871A680F5B00A75B9A /* Sources */, 224 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 225 | 13B07F8E1A680F5B00A75B9A /* Resources */, 226 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 227 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 228 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | ); 234 | name = opencvframeprocessor; 235 | productName = opencvframeprocessor; 236 | productReference = 13B07F961A680F5B00A75B9A /* opencvframeprocessor.app */; 237 | productType = "com.apple.product-type.application"; 238 | }; 239 | /* End PBXNativeTarget section */ 240 | 241 | /* Begin PBXProject section */ 242 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 243 | isa = PBXProject; 244 | attributes = { 245 | LastUpgradeCheck = 1210; 246 | TargetAttributes = { 247 | 00E356ED1AD99517003FC87E = { 248 | CreatedOnToolsVersion = 6.2; 249 | TestTargetID = 13B07F861A680F5B00A75B9A; 250 | }; 251 | 13B07F861A680F5B00A75B9A = { 252 | LastSwiftMigration = 1120; 253 | }; 254 | }; 255 | }; 256 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "opencvframeprocessor" */; 257 | compatibilityVersion = "Xcode 12.0"; 258 | developmentRegion = en; 259 | hasScannedForEncodings = 0; 260 | knownRegions = ( 261 | en, 262 | Base, 263 | ); 264 | mainGroup = 83CBB9F61A601CBA00E9B192; 265 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 266 | projectDirPath = ""; 267 | projectRoot = ""; 268 | targets = ( 269 | 13B07F861A680F5B00A75B9A /* opencvframeprocessor */, 270 | 00E356ED1AD99517003FC87E /* opencvframeprocessorTests */, 271 | ); 272 | }; 273 | /* End PBXProject section */ 274 | 275 | /* Begin PBXResourcesBuildPhase section */ 276 | 00E356EC1AD99517003FC87E /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 284 | isa = PBXResourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 288 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXResourcesBuildPhase section */ 293 | 294 | /* Begin PBXShellScriptBuildPhase section */ 295 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputPaths = ( 301 | ); 302 | name = "Bundle React Native code and images"; 303 | outputPaths = ( 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 308 | }; 309 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputFileListPaths = ( 315 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-frameworks-${CONFIGURATION}-input-files.xcfilelist", 316 | ); 317 | name = "[CP] Embed Pods Frameworks"; 318 | outputFileListPaths = ( 319 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-frameworks-${CONFIGURATION}-output-files.xcfilelist", 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | shellPath = /bin/sh; 323 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-frameworks.sh\"\n"; 324 | showEnvVarsInLog = 0; 325 | }; 326 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 327 | isa = PBXShellScriptBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | inputFileListPaths = ( 332 | ); 333 | inputPaths = ( 334 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 335 | "${PODS_ROOT}/Manifest.lock", 336 | ); 337 | name = "[CP] Check Pods Manifest.lock"; 338 | outputFileListPaths = ( 339 | ); 340 | outputPaths = ( 341 | "$(DERIVED_FILE_DIR)/Pods-opencvframeprocessor-opencvframeprocessorTests-checkManifestLockResult.txt", 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | shellPath = /bin/sh; 345 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 346 | showEnvVarsInLog = 0; 347 | }; 348 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 349 | isa = PBXShellScriptBuildPhase; 350 | buildActionMask = 2147483647; 351 | files = ( 352 | ); 353 | inputFileListPaths = ( 354 | ); 355 | inputPaths = ( 356 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 357 | "${PODS_ROOT}/Manifest.lock", 358 | ); 359 | name = "[CP] Check Pods Manifest.lock"; 360 | outputFileListPaths = ( 361 | ); 362 | outputPaths = ( 363 | "$(DERIVED_FILE_DIR)/Pods-opencvframeprocessor-checkManifestLockResult.txt", 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | shellPath = /bin/sh; 367 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 368 | showEnvVarsInLog = 0; 369 | }; 370 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { 371 | isa = PBXShellScriptBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | ); 375 | inputFileListPaths = ( 376 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 377 | ); 378 | name = "[CP] Embed Pods Frameworks"; 379 | outputFileListPaths = ( 380 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | shellPath = /bin/sh; 384 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-frameworks.sh\"\n"; 385 | showEnvVarsInLog = 0; 386 | }; 387 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 388 | isa = PBXShellScriptBuildPhase; 389 | buildActionMask = 2147483647; 390 | files = ( 391 | ); 392 | inputFileListPaths = ( 393 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-resources-${CONFIGURATION}-input-files.xcfilelist", 394 | ); 395 | name = "[CP] Copy Pods Resources"; 396 | outputFileListPaths = ( 397 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-resources-${CONFIGURATION}-output-files.xcfilelist", 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | shellPath = /bin/sh; 401 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor/Pods-opencvframeprocessor-resources.sh\"\n"; 402 | showEnvVarsInLog = 0; 403 | }; 404 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 405 | isa = PBXShellScriptBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | ); 409 | inputFileListPaths = ( 410 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-resources-${CONFIGURATION}-input-files.xcfilelist", 411 | ); 412 | name = "[CP] Copy Pods Resources"; 413 | outputFileListPaths = ( 414 | "${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-resources-${CONFIGURATION}-output-files.xcfilelist", 415 | ); 416 | runOnlyForDeploymentPostprocessing = 0; 417 | shellPath = /bin/sh; 418 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-opencvframeprocessor-opencvframeprocessorTests/Pods-opencvframeprocessor-opencvframeprocessorTests-resources.sh\"\n"; 419 | showEnvVarsInLog = 0; 420 | }; 421 | FD10A7F022414F080027D42C /* Start Packager */ = { 422 | isa = PBXShellScriptBuildPhase; 423 | buildActionMask = 2147483647; 424 | files = ( 425 | ); 426 | inputFileListPaths = ( 427 | ); 428 | inputPaths = ( 429 | ); 430 | name = "Start Packager"; 431 | outputFileListPaths = ( 432 | ); 433 | outputPaths = ( 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | shellPath = /bin/sh; 437 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 438 | showEnvVarsInLog = 0; 439 | }; 440 | /* End PBXShellScriptBuildPhase section */ 441 | 442 | /* Begin PBXSourcesBuildPhase section */ 443 | 00E356EA1AD99517003FC87E /* Sources */ = { 444 | isa = PBXSourcesBuildPhase; 445 | buildActionMask = 2147483647; 446 | files = ( 447 | 00E356F31AD99517003FC87E /* opencvframeprocessorTests.m in Sources */, 448 | ); 449 | runOnlyForDeploymentPostprocessing = 0; 450 | }; 451 | 13B07F871A680F5B00A75B9A /* Sources */ = { 452 | isa = PBXSourcesBuildPhase; 453 | buildActionMask = 2147483647; 454 | files = ( 455 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 456 | B2DA82C42893F05700EECB34 /* ObjectDetectFrameProcessor.mm in Sources */, 457 | B2DA82C12893EE7600EECB34 /* OpenCV.mm in Sources */, 458 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | }; 462 | /* End PBXSourcesBuildPhase section */ 463 | 464 | /* Begin PBXTargetDependency section */ 465 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 466 | isa = PBXTargetDependency; 467 | target = 13B07F861A680F5B00A75B9A /* opencvframeprocessor */; 468 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 469 | }; 470 | /* End PBXTargetDependency section */ 471 | 472 | /* Begin XCBuildConfiguration section */ 473 | 00E356F61AD99517003FC87E /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-opencvframeprocessor-opencvframeprocessorTests.debug.xcconfig */; 476 | buildSettings = { 477 | BUNDLE_LOADER = "$(TEST_HOST)"; 478 | GCC_PREPROCESSOR_DEFINITIONS = ( 479 | "DEBUG=1", 480 | "$(inherited)", 481 | ); 482 | INFOPLIST_FILE = opencvframeprocessorTests/Info.plist; 483 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 484 | LD_RUNPATH_SEARCH_PATHS = ( 485 | "$(inherited)", 486 | "@executable_path/Frameworks", 487 | "@loader_path/Frameworks", 488 | ); 489 | OTHER_LDFLAGS = ( 490 | "-ObjC", 491 | "-lc++", 492 | "$(inherited)", 493 | ); 494 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/opencvframeprocessor.app/opencvframeprocessor"; 497 | }; 498 | name = Debug; 499 | }; 500 | 00E356F71AD99517003FC87E /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-opencvframeprocessor-opencvframeprocessorTests.release.xcconfig */; 503 | buildSettings = { 504 | BUNDLE_LOADER = "$(TEST_HOST)"; 505 | COPY_PHASE_STRIP = NO; 506 | INFOPLIST_FILE = opencvframeprocessorTests/Info.plist; 507 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 508 | LD_RUNPATH_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "@executable_path/Frameworks", 511 | "@loader_path/Frameworks", 512 | ); 513 | OTHER_LDFLAGS = ( 514 | "-ObjC", 515 | "-lc++", 516 | "$(inherited)", 517 | ); 518 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/opencvframeprocessor.app/opencvframeprocessor"; 521 | }; 522 | name = Release; 523 | }; 524 | 13B07F941A680F5B00A75B9A /* Debug */ = { 525 | isa = XCBuildConfiguration; 526 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-opencvframeprocessor.debug.xcconfig */; 527 | buildSettings = { 528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 529 | CLANG_ENABLE_MODULES = YES; 530 | CURRENT_PROJECT_VERSION = 1; 531 | DEVELOPMENT_TEAM = 57D78AMT65; 532 | ENABLE_BITCODE = NO; 533 | FRAMEWORK_SEARCH_PATHS = ( 534 | "$(inherited)", 535 | "$(PROJECT_DIR)", 536 | ); 537 | GCC_PREFIX_HEADER = "${PROJECT_DIR}/PrefixHeader.pch"; 538 | INFOPLIST_FILE = opencvframeprocessor/Info.plist; 539 | LD_RUNPATH_SEARCH_PATHS = ( 540 | "$(inherited)", 541 | "@executable_path/Frameworks", 542 | ); 543 | OTHER_LDFLAGS = ( 544 | "$(inherited)", 545 | "-ObjC", 546 | "-lc++", 547 | ); 548 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 549 | PRODUCT_NAME = opencvframeprocessor; 550 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 551 | SWIFT_VERSION = 5.0; 552 | VERSIONING_SYSTEM = "apple-generic"; 553 | }; 554 | name = Debug; 555 | }; 556 | 13B07F951A680F5B00A75B9A /* Release */ = { 557 | isa = XCBuildConfiguration; 558 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-opencvframeprocessor.release.xcconfig */; 559 | buildSettings = { 560 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 561 | CLANG_ENABLE_MODULES = YES; 562 | CURRENT_PROJECT_VERSION = 1; 563 | DEVELOPMENT_TEAM = 57D78AMT65; 564 | FRAMEWORK_SEARCH_PATHS = ( 565 | "$(inherited)", 566 | "$(PROJECT_DIR)", 567 | ); 568 | GCC_PREFIX_HEADER = "${PROJECT_DIR}/PrefixHeader.pch"; 569 | INFOPLIST_FILE = opencvframeprocessor/Info.plist; 570 | LD_RUNPATH_SEARCH_PATHS = ( 571 | "$(inherited)", 572 | "@executable_path/Frameworks", 573 | ); 574 | OTHER_LDFLAGS = ( 575 | "$(inherited)", 576 | "-ObjC", 577 | "-lc++", 578 | ); 579 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 580 | PRODUCT_NAME = opencvframeprocessor; 581 | SWIFT_VERSION = 5.0; 582 | VERSIONING_SYSTEM = "apple-generic"; 583 | }; 584 | name = Release; 585 | }; 586 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 587 | isa = XCBuildConfiguration; 588 | buildSettings = { 589 | ALWAYS_SEARCH_USER_PATHS = NO; 590 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 591 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 592 | CLANG_CXX_LIBRARY = "libc++"; 593 | CLANG_ENABLE_MODULES = YES; 594 | CLANG_ENABLE_OBJC_ARC = YES; 595 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 596 | CLANG_WARN_BOOL_CONVERSION = YES; 597 | CLANG_WARN_COMMA = YES; 598 | CLANG_WARN_CONSTANT_CONVERSION = YES; 599 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 600 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 601 | CLANG_WARN_EMPTY_BODY = YES; 602 | CLANG_WARN_ENUM_CONVERSION = YES; 603 | CLANG_WARN_INFINITE_RECURSION = YES; 604 | CLANG_WARN_INT_CONVERSION = YES; 605 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 606 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 607 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 608 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 609 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 610 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 611 | CLANG_WARN_STRICT_PROTOTYPES = YES; 612 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 613 | CLANG_WARN_UNREACHABLE_CODE = YES; 614 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 615 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 616 | COPY_PHASE_STRIP = NO; 617 | ENABLE_STRICT_OBJC_MSGSEND = YES; 618 | ENABLE_TESTABILITY = YES; 619 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 620 | GCC_C_LANGUAGE_STANDARD = gnu99; 621 | GCC_DYNAMIC_NO_PIC = NO; 622 | GCC_NO_COMMON_BLOCKS = YES; 623 | GCC_OPTIMIZATION_LEVEL = 0; 624 | GCC_PREPROCESSOR_DEFINITIONS = ( 625 | "DEBUG=1", 626 | "$(inherited)", 627 | ); 628 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 629 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 630 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 631 | GCC_WARN_UNDECLARED_SELECTOR = YES; 632 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 633 | GCC_WARN_UNUSED_FUNCTION = YES; 634 | GCC_WARN_UNUSED_VARIABLE = YES; 635 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 636 | LD_RUNPATH_SEARCH_PATHS = ( 637 | /usr/lib/swift, 638 | "$(inherited)", 639 | ); 640 | LIBRARY_SEARCH_PATHS = ( 641 | "\"$(SDKROOT)/usr/lib/swift\"", 642 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 643 | "\"$(inherited)\"", 644 | ); 645 | MTL_ENABLE_DEBUG_INFO = YES; 646 | ONLY_ACTIVE_ARCH = YES; 647 | OTHER_CPLUSPLUSFLAGS = ( 648 | "$(OTHER_CFLAGS)", 649 | "-DFOLLY_NO_CONFIG", 650 | "-DFOLLY_MOBILE=1", 651 | "-DFOLLY_USE_LIBCPP=1", 652 | ); 653 | SDKROOT = iphoneos; 654 | }; 655 | name = Debug; 656 | }; 657 | 83CBBA211A601CBA00E9B192 /* Release */ = { 658 | isa = XCBuildConfiguration; 659 | buildSettings = { 660 | ALWAYS_SEARCH_USER_PATHS = NO; 661 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 662 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 663 | CLANG_CXX_LIBRARY = "libc++"; 664 | CLANG_ENABLE_MODULES = YES; 665 | CLANG_ENABLE_OBJC_ARC = YES; 666 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 667 | CLANG_WARN_BOOL_CONVERSION = YES; 668 | CLANG_WARN_COMMA = YES; 669 | CLANG_WARN_CONSTANT_CONVERSION = YES; 670 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 671 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 672 | CLANG_WARN_EMPTY_BODY = YES; 673 | CLANG_WARN_ENUM_CONVERSION = YES; 674 | CLANG_WARN_INFINITE_RECURSION = YES; 675 | CLANG_WARN_INT_CONVERSION = YES; 676 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 677 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 678 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 679 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 680 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 681 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 682 | CLANG_WARN_STRICT_PROTOTYPES = YES; 683 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 684 | CLANG_WARN_UNREACHABLE_CODE = YES; 685 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 686 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 687 | COPY_PHASE_STRIP = YES; 688 | ENABLE_NS_ASSERTIONS = NO; 689 | ENABLE_STRICT_OBJC_MSGSEND = YES; 690 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 691 | GCC_C_LANGUAGE_STANDARD = gnu99; 692 | GCC_NO_COMMON_BLOCKS = YES; 693 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 694 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 695 | GCC_WARN_UNDECLARED_SELECTOR = YES; 696 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 697 | GCC_WARN_UNUSED_FUNCTION = YES; 698 | GCC_WARN_UNUSED_VARIABLE = YES; 699 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 700 | LD_RUNPATH_SEARCH_PATHS = ( 701 | /usr/lib/swift, 702 | "$(inherited)", 703 | ); 704 | LIBRARY_SEARCH_PATHS = ( 705 | "\"$(SDKROOT)/usr/lib/swift\"", 706 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 707 | "\"$(inherited)\"", 708 | ); 709 | MTL_ENABLE_DEBUG_INFO = NO; 710 | OTHER_CPLUSPLUSFLAGS = ( 711 | "$(OTHER_CFLAGS)", 712 | "-DFOLLY_NO_CONFIG", 713 | "-DFOLLY_MOBILE=1", 714 | "-DFOLLY_USE_LIBCPP=1", 715 | ); 716 | SDKROOT = iphoneos; 717 | VALIDATE_PRODUCT = YES; 718 | }; 719 | name = Release; 720 | }; 721 | /* End XCBuildConfiguration section */ 722 | 723 | /* Begin XCConfigurationList section */ 724 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "opencvframeprocessorTests" */ = { 725 | isa = XCConfigurationList; 726 | buildConfigurations = ( 727 | 00E356F61AD99517003FC87E /* Debug */, 728 | 00E356F71AD99517003FC87E /* Release */, 729 | ); 730 | defaultConfigurationIsVisible = 0; 731 | defaultConfigurationName = Release; 732 | }; 733 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "opencvframeprocessor" */ = { 734 | isa = XCConfigurationList; 735 | buildConfigurations = ( 736 | 13B07F941A680F5B00A75B9A /* Debug */, 737 | 13B07F951A680F5B00A75B9A /* Release */, 738 | ); 739 | defaultConfigurationIsVisible = 0; 740 | defaultConfigurationName = Release; 741 | }; 742 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "opencvframeprocessor" */ = { 743 | isa = XCConfigurationList; 744 | buildConfigurations = ( 745 | 83CBBA201A601CBA00E9B192 /* Debug */, 746 | 83CBBA211A601CBA00E9B192 /* Release */, 747 | ); 748 | defaultConfigurationIsVisible = 0; 749 | defaultConfigurationName = Release; 750 | }; 751 | /* End XCConfigurationList section */ 752 | }; 753 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 754 | } 755 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor.xcodeproj/xcshareddata/xcschemes/opencvframeprocessor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | @interface AppDelegate () { 20 | RCTTurboModuleManager *_turboModuleManager; 21 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 22 | std::shared_ptr _reactNativeConfig; 23 | facebook::react::ContextContainer::Shared _contextContainer; 24 | } 25 | @end 26 | #endif 27 | 28 | @implementation AppDelegate 29 | 30 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 31 | { 32 | RCTAppSetupPrepareApp(application); 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | 36 | #if RCT_NEW_ARCH_ENABLED 37 | _contextContainer = std::make_shared(); 38 | _reactNativeConfig = std::make_shared(); 39 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 40 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 41 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 42 | #endif 43 | 44 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"opencvframeprocessor", nil); 45 | 46 | if (@available(iOS 13.0, *)) { 47 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 48 | } else { 49 | rootView.backgroundColor = [UIColor whiteColor]; 50 | } 51 | 52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 53 | UIViewController *rootViewController = [UIViewController new]; 54 | rootViewController.view = rootView; 55 | self.window.rootViewController = rootViewController; 56 | [self.window makeKeyAndVisible]; 57 | return YES; 58 | } 59 | 60 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 61 | { 62 | #if DEBUG 63 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 64 | #else 65 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 66 | #endif 67 | } 68 | 69 | #if RCT_NEW_ARCH_ENABLED 70 | 71 | #pragma mark - RCTCxxBridgeDelegate 72 | 73 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 74 | { 75 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 76 | delegate:self 77 | jsInvoker:bridge.jsCallInvoker]; 78 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 79 | } 80 | 81 | #pragma mark RCTTurboModuleManagerDelegate 82 | 83 | - (Class)getModuleClassFromName:(const char *)name 84 | { 85 | return RCTCoreModulesClassProvider(name); 86 | } 87 | 88 | - (std::shared_ptr)getTurboModule:(const std::string &)name 89 | jsInvoker:(std::shared_ptr)jsInvoker 90 | { 91 | return nullptr; 92 | } 93 | 94 | - (std::shared_ptr)getTurboModule:(const std::string &)name 95 | initParams: 96 | (const facebook::react::ObjCTurboModule::InitParams &)params 97 | { 98 | return nullptr; 99 | } 100 | 101 | - (id)getModuleInstanceFromClass:(Class)moduleClass 102 | { 103 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 104 | } 105 | 106 | #endif 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | opencvframeprocessor 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | NSCameraUsageDescription 55 | $(PRODUCT_NAME) needs access to your Camera. 56 | 57 | 58 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/opencvframeprocessor/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ios/opencvframeprocessorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/opencvframeprocessorTests/opencvframeprocessorTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface opencvframeprocessorTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation opencvframeprocessorTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "opencvframeprocessor", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "react": "17.0.2", 14 | "react-native": "0.68.2", 15 | "react-native-reanimated": "^2.9.1", 16 | "react-native-vision-camera": "^2.14.0" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.12.9", 20 | "@babel/runtime": "^7.12.5", 21 | "@react-native-community/eslint-config": "^2.0.0", 22 | "babel-jest": "^26.6.3", 23 | "eslint": "^7.32.0", 24 | "jest": "^26.6.3", 25 | "metro-react-native-babel-preset": "^0.67.0", 26 | "react-test-renderer": "17.0.2" 27 | }, 28 | "jest": { 29 | "preset": "react-native" 30 | } 31 | } 32 | --------------------------------------------------------------------------------