Benchmark¶
It’s easy to assert that our implementation is fast without backing our claim with numbers and source code freely available to everyone to check.
- Rules:
We’re running the processing function within a loop for #100 times.
The positive rate defines the percentage of images with at least #2 MRZ lines. For example, 20% positives means we will have #80 negative images (no MRZ lines) and #20 positives (with MRZ lines) out of the #100 total images. This percentage is important as it allows timing both the detector and recognizer.
We’re using high accuracy for the segmenter and bilinear interpolation.
All positive images contain a least #2 MRZ lines.
The initialization is done outside the loop.
- The concept of negative and positive images is very important because in most use cases you’ll:
Start the application
Move the application to the MRZ zone to recognize the data
You only need a single “good frame” to recognize the MRZ lines. But, between step #1 and step #2 the application has probably processed more than #200 frames (40fps * 5sec). So, in such scenario the application have to process #201 frames before reaching the “good frame”: #200 negatives and #1 positive. If processing negative frame is very slow then, the application won’t be able to catch this “good frame” at the right time. A slow application will do one of these strategies:
Drop frames to keep the impression that the application is running at realtime: In such scenario the positive frames will most likely be dropped (probability = 1/201 = 0.49%) which means reporting the time when this single “good frame” is caught.
Enqueue the frames and process them at the application speed: This is the worse solution because you could run out of memory and when the application is running slowly then, you can spend several minutes before reaching this single “good frame”.
A fast application will run at 40fps and catch this “good frame” as soon as it’s presented for processing. This offers a nice user experience.
0% positives |
20% positives |
50% positives |
70% positives |
100% positives |
|
---|---|---|---|---|---|
Core i7-4790K |
877 ms |
1975 ms |
3736 ms |
4901 ms |
6526 ms |
iPhone7 |
1990 ms |
4325 ms |
7982 ms |
10595 ms |
14201 ms |
Galaxy S10+ |
2825 ms |
7575 ms |
12960 ms |
17636 ms |
21069 ms |
Raspberry Pi 4 |
4335 ms |
13555 ms |
27878 ms |
37399 ms |
47797 ms |
More information on how to build and use the application could be found at https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/master/samples/c++/benchmark/README.md.
For Android and iOS the Benchmark application is in samples/android/benchmark and samples/ios/benchmark folders.
Please note that even if Raspberry Pi 4 have a 64-bit CPU Raspbian OS uses a 32-bit kernel which means we’re loosing many SIMD optimizations.