Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 3912727

Browse files
Piotr SuwałaPiotr Suwała
authored andcommitted
add better readme
1 parent ee1dc7e commit 3912727

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# What this tutorial is about
2-
How to use OpenCV for data processing togeether with React Native
2+
This tutorial is how to use React Native together with OpenCV for image processing. This example uses native Java and Objective-C bindings for OpenCV. In this example we use the device's camera to take a photo and detect whether the taken photo is clear or blurred.
3+
4+
# Demo
5+
6+
The examples below show the situation right after taking a photo. The first one shows what happens if we take a blurry photo and the second one is the situation after we took a clear photo and are able to proceed with it to do whatever we want.
7+
8+
![Blurred photo](./images/blurred_photo.png)
9+
![Clear photo](./images/clear_photo.png)
310

411
# Prerequisites
512

@@ -9,13 +16,28 @@
916
# How to run the project
1017

1118
1. Clone the repository.
12-
2. Run `./downloadAndInsertOpenCV.sh`.
13-
3. Download manually the Android pack from https://opencv.org/releases.html (version 3.4.1).
14-
4. Unzip the package.
15-
5. Import OpenCV to Android Studio, From File -> New -> Import Module, choose sdk/java folder in the unzipped opencv archive.
16-
6. Update build.gradle under imported OpenCV module to update 4 fields to match your project build.gradle a) compileSdkVersion b) buildToolsVersion c) minSdkVersion and d) targetSdkVersion.
17-
7. Add module dependency by Application -> Module Settings, and select the Dependencies tab. Click + icon at bottom, choose Module Dependency and select the imported OpenCV module. For Android Studio v1.2.2, to access to Module Settings : in the project view, right-click the dependent module -> Open Module Settings.
18-
8. `react-native run-ios` or `react-native run-android`.
19+
2. `cd cloned/repository/path`
20+
3. `npm i` or `yarn`
21+
4. `react-native link`
22+
5. Run `./downloadAndInsertOpenCV.sh`.
23+
6. Download manually the Android pack from https://opencv.org/releases.html (version 3.4.1).
24+
7. Unzip the package.
25+
8. Import OpenCV to Android Studio, From File -> New -> Import Module, choose sdk/java folder in the unzipped opencv archive.
26+
9. Update build.gradle under imported OpenCV module to update 4 fields to match your project's `build.gradle`<br/>
27+
28+
a) compileSdkVersion<br/>
29+
b) buildToolsVersion<br/>
30+
c) minSdkVersion<br/>
31+
d) targetSdkVersion.
32+
33+
10. Add module dependency by Application -> Module Settings, and select the Dependencies tab. Click + icon at bottom, choose Module Dependency and select the imported OpenCV module. For Android Studio v1.2.2, to access to Module Settings : in the project view, right-click the dependent module -> Open Module Settings.
34+
11. `react-native run-ios` or `react-native run-android`.
35+
36+
## Additional notes
37+
In case of any `downloadAndInsertOpenCV.sh ` script related errors, please, check the paths inside this file and change them if they do not match yours.
38+
If this script does not run at all since it has no permissions, run `chmod 777 downloadAndInsertOpenCV.sh`.
39+
40+
If you do not have `React Native` installed, type `npm i -g react-native-cli` in the terminal.
1941

2042
## License
2143

images/blurred_photo.png

121 KB
Loading

images/clear_photo.png

91.2 KB
Loading

0 commit comments

Comments
 (0)