Skip to content

Conversation

@Pearapps
Copy link
Collaborator

@Pearapps Pearapps commented Nov 10, 2025

Progress on: #12016

Adds in some live feedback if you are scanning the wrong side of the document for the side requested & to center the ID if it is not centered in the view frame; during document capture.

Also - this adds in some live feedback during document capture for when the id is too blurry or the distance is not correct and can be corrected.

Examples:

ID distance:

Screenshot_20251117-145630 Screenshot_20251117-145709

Focus:

Screenshot_20251119-152218 Screenshot_20251119-152236

Centering

Screenshot_20251118-123323 Screenshot_20251118-123416

Incorrect side:

Screenshot_20251118-123338 Screenshot_20251118-123356

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │   2.1 MiB │   2.1 MiB │   +706 B │   4.3 MiB │   4.3 MiB │ +1,016 B 
     arsc │   1.1 MiB │   1.1 MiB │ +5.7 KiB │   1.1 MiB │   1.1 MiB │ +5.7 KiB 
 manifest │   2.3 KiB │   2.3 KiB │      0 B │     8 KiB │     8 KiB │      0 B 
      res │ 303.5 KiB │ 303.5 KiB │      0 B │ 457.7 KiB │ 457.7 KiB │      0 B 
   native │   7.9 MiB │   7.9 MiB │      0 B │  19.3 MiB │  19.3 MiB │      0 B 
    asset │   7.7 KiB │   7.7 KiB │     +1 B │   7.5 KiB │   7.5 KiB │     +1 B 
    other │  95.6 KiB │  95.6 KiB │    +10 B │ 183.6 KiB │ 183.6 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  11.5 MiB │  11.5 MiB │ +6.4 KiB │  25.4 MiB │  25.4 MiB │ +6.7 KiB 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 20721 │ 20722 │ +1 (+2 -1) 
   types │  6513 │  6513 │  0 (+0 -0) 
 classes │  5277 │  5277 │  0 (+0 -0) 
 methods │ 31557 │ 31561 │ +4 (+5 -1) 
  fields │ 18290 │ 18292 │ +2 (+4 -2) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  163 │  163 │  0         
 entries │ 3667 │ 3673 │ +6 (+6 -0)
APK
     compressed      │    uncompressed     │                                           
──────────┬──────────┼──────────┬──────────┤                                           
 size     │ diff     │ size     │ diff     │ path                                      
──────────┼──────────┼──────────┼──────────┼───────────────────────────────────────────
  1.1 MiB │ +5.7 KiB │  1.1 MiB │ +5.7 KiB │ ∆ resources.arsc                          
  2.1 MiB │   +706 B │  4.3 MiB │ +1,016 B │ ∆ classes.dex                             
   26 KiB │     +8 B │ 64.6 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
 29.2 KiB │     +3 B │ 64.6 KiB │      0 B │ ∆ META-INF/CERT.SF                        
  1.2 KiB │     -2 B │  1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
    272 B │     +1 B │    120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
  6.8 KiB │     +1 B │  6.7 KiB │     +1 B │ ∆ assets/dexopt/baseline.prof             
──────────┼──────────┼──────────┼──────────┼───────────────────────────────────────────
  3.3 MiB │ +6.4 KiB │  5.6 MiB │ +6.7 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   20721 │ 20722 │ +1 (+2 -1) 
  
  + reachedStateAt
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"2fdb827","r8-mode":"full","version":"8.8.34"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"c307bc6","r8-mode":"full","version":"8.8.34"}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   31557 │ 31561 │ +4 (+5 -1) 
  
  + U3.e e(c) → boolean
  + U3.e f(d, j) → boolean
  + U3.g <init>(j, n, g, Integer, Boolean)
  + U3.g b(Integer) → g
  + U3.h <init>(j, n, Integer)
  
  - U3.e e(d, j) → boolean
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   18290 │ 18292 │ +2 (+4 -2) 
  
  + U3.g d: g
  + U3.g e: Integer
  + U3.g f: Boolean
  + U3.h d: Integer
  
  - U3.g d: b
  - U3.g e: Boolean
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   3667 │ 3673 │ +6 (+6 -0) 
  + string/stripe_back_of_id_not_detected
  + string/stripe_front_of_id_not_detected
  + string/stripe_move_closer
  + string/stripe_move_farther
  + string/stripe_move_id_to_center
  + string/stripe_reduce_blur

@Pearapps Pearapps changed the title [Draft] [Identity] Feedback to center ID if off center during document capture [Identity] Feedback to flip ID Document over if incorrect side is detected & center ID if off center Nov 13, 2025
@Pearapps Pearapps marked this pull request as ready for review November 13, 2025 15:47
@Pearapps Pearapps requested review from a team as code owners November 13, 2025 15:47
@Pearapps Pearapps marked this pull request as draft November 18, 2025 16:39
Pearapps and others added 3 commits November 18, 2025 11:43
#11993)

* Update IDDetectorTransitioner.kt

* Update IDDetectorTransitionerTest.kt

* closer and further

* Update IDDetectorTransitioner.kt

* Update IDDetectorTransitioner.kt

* Update IDDetectorTransitioner.kt

---------

Co-authored-by: Ken Ackerson <ken@lickability.net>
@Pearapps Pearapps changed the title [Identity] Feedback to flip ID Document over if incorrect side is detected & center ID if off center [Identity] Feedback to flip ID Document over if incorrect side is detected, center ID if off center, ID is too blurry, and if distance needs correction Nov 18, 2025
@Pearapps Pearapps marked this pull request as ready for review November 18, 2025 18:36

// Distance feedback thresholds based on area coverage of the frame
const val MIN_BOX_COVERAGE_FEEDBACK = 0.18f
const val MAX_BOX_COVERAGE_FEEDBACK = 0.78f

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we calculate this coverage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the logic on these (on both platforms), I mostly played around with it a bunch until it felt right; the logic is not as portable as I had originally hoped and also does not work between these two platforms.

}

// Distance gating: if the detected document is too small or too large, keep in Found and reset timer
isNormalizedBox(analyzerOutput.boundingBox) && tooSmall(analyzerOutput.boundingBox) -> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would the box not be normalized? It seems like we are skipping the tooSmall/tooLarge feedback if it's not normalized? Should we instead try to normalize the boundingBox (clamp it to the bounds of the full image width/height)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants