How yushiuan9499/michelson-interfer works
Project Type and Purpose
• This is a desktop Qt5 C++ application that automates analysis of Michelson interferometer videos.
High-Level Architecture Overview
• Monolithic desktop client separated into:
a. User Interface (Qt MainWindow)
b. Core Processing (Analyzer)
c. File I/O and Data Export (FileIo)
d. External Libraries (Qt5 modules, OpenCV)
• Communication is via Qt’s signal-slot mechanism.
Main Components
• GUI Module
• src/header/mainWindow.h / src/source/mainWindow.cpp
• Contains controls to load video, select ROI, start analysis, show plots or status.
• Emits signals like “startAnalysis()” or “exportCsv()”.
• File I/O Module
• src/header/fileIo.h / src/source/fileIo.cpp
• Opens video files via OpenCV VideoCapture, reads frames, handles CSV writes.
• Analyzer Module
• src/header/analyzer.h / src/source/analyzer.cpp
• Application Entry Point
• src/main.cpp
• Initializes QApplication, loads the MainWindow, connects signals to slots.
• External Libraries
• Qt5 (Widgets, Core) for GUI, event loop, signals/slots.
• OpenCV for video decoding and image processing.
Relationships and Data Flow
1. User clicks “Load Video” in GUI → FileIo opens file via OpenCV → emits frame-ready signals.
2. GUI passes frame and ROI rectangle to Analyzer → Analyzer processes image → emits result data.
3. GUI receives process updates → updates display/progress bar.
4. On “Export CSV” command, GUI calls FileIo to write results to disk.
Architectural Patterns and Principles
• Separation of concerns: UI logic (MainWindow) is decoupled from image processing and file handling.
• Event-driven design: Qt signals/slots handle asynchronous processing and UI updates.
• Single responsibility: each module (Analyzer, FileIo, MainWindow) has a focused role.