How jacob-424/sg2-images works
SG2 is a command-line ballot-image processor: it validates a PNG, locates two plus-shaped markers, checks horizontal alignment, translates the image, and reports image statistics. The main implementation is consolidated in SG2.py; the tree also contains standalone versions of validation, detection, and translation, plus ballot-image generators. The excerpts show some implementation details but omit much of SG2.py’s main control flow, so uncertain stage connections are marked unverified rather than asserted.
Main entry points: SG2.py SG2 Workflow · Image_Translation.py Image Translator · pngGen.py Binary Ballot Generator · grayScalePngGen.py Grayscale Ballot Generator
Components 15
Ballot Processing
- SG2 Workflow
SG2.py - PNG Validation
SG2.py - Grayscale Conversion
SG2.py - Marker Detection
SG2.py - Alignment Check
SG2.py - Image Translation
SG2.py - BallotY Image
SG2.py - Image Statistics
SG2.py - Grayness Labels
SG2.py
Standalone Modules
- PNG Validator
Png_input_and_validation.py - Pattern Detector
patternDetection.py - Image Translator
Image_Translation.py
Image Generation
- Binary Ballot Generator
pngGen.py - Grayscale Ballot Generator
grayScalePngGen.py
Other components
- Operator
Connections 12
- Operator → SG2 Workflow: runs
SG2.py - SG2 Workflow → PNG Validation: calls
SG2.py - SG2 Workflow → Grayscale Conversion: uses
SG2.py - SG2 Workflow → Marker Detection: uses
SG2.py - SG2 Workflow → Alignment Check: uses
SG2.py - SG2 Workflow → Image Translation: uses
SG2.py - SG2 Workflow → Image Statistics: uses
SG2.py - Image Statistics → Grayness Labels: calls
SG2.py - Image Translation → BallotY Image: saves
SG2.py - Image Translator → PNG Validator: imports
Image_Translation.py - Binary Ballot Generator → Operator: generates
- Grayscale Ballot Generator → Operator: generates