How deepsoftwareeng/facedetectionattendance works
Main Components
• User Interface (Presentation Layer): Represented by the WPF views (XAML files in the “FaceDetectionAttendance/MVVM/View” folder) and UI components (custom controls in “FaceDetectionAttendance/MVVM/Components”). These are the parts that the end user interacts with.
• Presentation Logic: The ViewModels (located in “FaceDetectionAttendance/MVVM/ViewModel”) that bind the UI to the application’s underlying logic. They handle data binding, commands, and interactions between the UI and the business logic.
• Domain Models and Business Logic: The Models (in “FaceDetectionAttendance/MVVM/Model”) define the core objects (such as Account, Attendance, Request, etc.) and include utility classes like Database connection helper objects.
• Face Detection Module: Though not separated into a distinct module, the presence of the “haarcascade_frontalface_default.xml” indicates that OpenCV is used in conjunction with some underlying code (possibly in the Models or a utility class) to execute face recognition.
• Database Layer: External SQL server connectivity (using localdb/SQL Server) as mentioned in the README, with the schema defined in “CCPTPM.sql”. This component manages all data persistence (accounts, attendance records, etc.).
• External Services & Utilities: Email sending components (“SendEmailUI” and its associated ViewModel) to notify the manager about attendance, along with image resources and other assets in the “Resource” folder.
Out the Relationships and Interactions
• The UI layer (Views and custom components) captures user events and feeds them into the associated ViewModels.
• The ViewModels then make calls to the Domain Models for operations like login, managing accounts, marking attendance, processing face detection, and generating reports.
• The Face Detection feature integrates with the Model layer to process camera or image input using OpenCV (leveraging the provided cascade XML file).
• Data from user interactions and face recognition results flow to the Database layer via appropriate Model classes which encapsulate the connection logic (as seen with “Dataconnecttion.cs”).
• Email notifications or requests (handled in “SendEmail.cs” and related View/UI files) deliver automated communications to the manager.
• The entire data flow is supported by MVVM’s separation of concerns, making the components loosely coupled and testable.
Architectural Patterns and Components
• Client-Server Communication: Even though it’s a desktop application, represent the database as a separate server component (SQL Server/localdb) that the application communicates with.
• Integration with OpenCV: Even if the OpenCV calls are encapsulated within utility or service classes, clearly denote this as the face recognition engine.