Add Fixed Frame Mode with Auto-Capture and Positioning Guidance #85
Open
saade wants to merge 5 commits intoConezi:mainfrom
Open
Add Fixed Frame Mode with Auto-Capture and Positioning Guidance #85saade wants to merge 5 commits intoConezi:mainfrom
saade wants to merge 5 commits intoConezi:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new fixed-frame capture mode with countdown-based auto-capture, face-position guidance, and optional landmark debugging overlays to improve consistency for selfie/KYC capture flows.
Changes:
- Introduces
IndicatorShape.fixedFrameand renders a centered fixed frame with red/green/neutral feedback. - Adds countdown state + timer-driven auto-capture gating (
captureDelay,countdown,isCapturing,isFaceWellPositioned). - Adds positioning guidance API (
getFacePositionGuidance) and optional debug landmark rendering (showDebugLandmarks).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/smart_face_camera.dart | Passes new painter flags and overlays countdown UI during auto-capture. |
| lib/src/res/enums.dart | Adds the fixedFrame indicator shape enum value. |
| lib/src/paints/face_painter.dart | Implements fixed frame drawing and debug landmark/bounding-box rendering. |
| lib/src/handlers/face_identifier.dart | Adjusts positioning thresholds and relaxes landmark requirements (ears). |
| lib/src/controllers/face_camera_state.dart | Adds countdown/capturing/well-positioned fields and copyWith support. |
| lib/src/controllers/face_camera_controller.dart | Implements countdown timer, centered-face checks, and guidance messaging API. |
| example/lib/main.dart | Demonstrates fixed frame mode, countdown messaging, and custom guidance text. |
| README.md | Documents fixed frame mode, constraints, debug landmarks, and countdown configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
Everything should be fixed by now, ready for review |
84dfc29 to
2137f29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
This PR adds a new
IndicatorShape.fixedFramemode that displays a centered, fixed-size frame with color-coded feedback (white/red/green) and real-time positioning guidance. Includes configurable countdown timer, intelligentface detection constraints, and debug mode for visualization. Ideal for KYC, document verification, and applications requiring consistent face capture quality.
Overview
This PR introduces a fixed frame capture mode that significantly improves the user experience for face capture applications by providing visual feedback and real-time guidance to help users position their
faces correctly.
Key Features
1. Fixed Frame Mode (
IndicatorShape.fixedFrame)Instead of drawing an indicator that follows the detected face, this mode displays a centered, fixed-size frame (70% of screen) that changes color based on face positioning:
2. Real-Time Positioning Guidance
Provides intelligent, context-aware guidance messages through messageBuilder:
Messages can be fully customized for branding, localization, or specific use cases.
3. Countdown Timer
New
captureDelayparameter (default: 3 seconds) adds a countdown before auto-capture:4. Intelligent Detection Constraints
Face must meet ALL of the following criteria for green frame/countdown:
Face Distance
Landmark Positioning
Face Centering
Head Orientation
5. Debug Mode
New showDebugLandmarks parameter enables visual debugging:
Helps developers understand detection behavior and fine-tune positioning requirements.
API Changes
New Controller Parameters
captureDelay: int(default: 3)showDebugLandmarks: bool(default: false)New Controller Method
String? getFacePositionGuidance()
New State Field
isCapturing: bool
Indicator Shape
IndicatorShape.fixedFrame
Technical Implementation
Coordinate System Handling
Face Detection Optimization
Backward Compatibility
✅ Fully backward compatible - All changes are additive:
Future Enhancements (Not in this PR)
Potential additions for future PRs: