Skip to content

Commit 2df6499

Browse files
committed
Add timing table in README.md
1 parent 6bdb488 commit 2df6499

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

README.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,11 @@
1-
# DocScan
2-
App for document scanning.
1+
# peed comparison between native and Java OpenCV calls
2+
This is just a quick and dirty branch for measuring OpenCV timings.
33

4-
<a href='https://play.google.com/store/apps/details?id=at.ac.tuwien.caa.docscan&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' width="250px"/></a>
4+
Results gained on Pixel 4A (in seconds). Mat size is 3000x4000.
55

6-
## Authors
7-
Fabian Hollaus,
8-
Florian Kleber,
9-
Markus Diem
10-
11-
### Build Instructions
12-
DocScan makes use of native (C++) OpenCV and OpenCV Java API. The Java part is automatically downloaded after syncing,
13-
the native part is imported as a git submodule from `https://github.com/hollaus/opencv_libs.git` which also automatically
14-
downloads the resources.
15-
16-
### Sync and build the project
17-
18-
## API keys
19-
The app makes use of two APIs that require keys which are not published in the repository and should never be provided to the public. Instead not working dummy keys are provided in the following files:
20-
- `gradle.properties`: contains the key for Dropbox integration
21-
- `google-services.json`: contains the key for Firebase integration (needed for OCR)
22-
23-
You can get the API key if you send a mail to docscan@cvl.tuwien.ac.at. Before you replace the dummy keys, assure that you do not commit the keys with the following commands:
24-
- `git update-index --assume-unchanged google-services.json`
25-
- `git update-index --assume-unchanged gradle.properties`
26-
27-
## Cheatsheet
28-
In case you need a more detailed error message for build errors, try: ``.\gradlew clean build``
29-
30-
## Visual Studio Project (C++ Library)
31-
- Optional for testing the C++ module
32-
- C++ lib for page segmentation and focus measure
33-
- use CMake to create a Visual Studio Project
34-
- source code path: DocScan/app/src/main
35-
- binaries path e.g.: DocScan/build2015-x64
36-
- Specify OpenCV_DIR
6+
| Operation | C++ | Java |
7+
| ------------- |:-----:|:-----:|
8+
| Accessing mat pixel-wise | 0.3 | 6 |
9+
| cv::remap (INTER_LANCZOS4) | 0.75 | 0.75 |
10+
| cv::remap (INTER_LINEAR) | 0.08 | 0.08 |
11+
| cv::remap (INTER_CUBIC) | 0.05 | 0.05 |

app/src/main/cpp/PageSegmentation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ namespace dsc {
489489
Utils::print("C++ updateMap took: " + std::to_string(secs) + " seconds", "DkPageSegmentation");
490490

491491
t0 = cv::getTickCount();
492-
remap( input, dst, map_x, map_y, cv::INTER_LANCZOS4, cv::BORDER_CONSTANT, cv::Scalar(0, 0, 0) );
492+
remap( input, dst, map_x, map_y, cv::INTER_NEAREST, cv::BORDER_CONSTANT, cv::Scalar(0, 0, 0) );
493493
t1 = cv::getTickCount();
494494
secs = (t1-t0)/cv::getTickFrequency();
495495
Utils::print("C++ remap took: " + std::to_string(secs) + " seconds", "DkPageSegmentation");

app/src/main/java/at/ac/tuwien/caa/docscan/camera/cv/Remap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void run(Mat src) {
7070
Log.d("Remap", "Java updateMap took: " + secs + " seconds");
7171

7272
t0 = Core.getTickCount();
73-
Imgproc.remap(input, dst, mapX, mapY, Imgproc.INTER_LANCZOS4);
73+
Imgproc.remap(input, dst, mapX, mapY, Imgproc.INTER_NEAREST);
7474
t1 = Core.getTickCount();
7575
secs = (t1-t0) / Core.getTickFrequency();
7676
Log.d("Remap", "Java remap took: " + secs + " seconds");

0 commit comments

Comments
 (0)