How nminhmoi/projectpcb works
This repository is a classical-computer-vision PCB inspection prototype. Its main workflow pairs template and test images, aligns them, detects and localizes differences, then saves annotated results and defect crops. Dataset preparation and three experiment scripts support the workflow and document benchmarking capabilities. The README also describes machine-learning defect classification and richer alignment visualizations, but no corresponding runtime implementation was identified in the supplied tree or excerpts; those are noted as documented-only. Some orchestration details are supported by README statements because source excerpts are partial.
Main entry points: main.py Pair Runner · dataset_utils.py Dataset Loader · module_detection.py Box & Crop Extraction · exp_blur_kernel.py Blur Study
Components 13
Dataset Handling
- Pair Builder
experiments/build_pairs.py - Pair Manifest
data/PKU-Market-PCB - Dataset Loader
dataset_utils.py
Inspection Pipeline
- Pair Runner
main.py - Alignment & Difference
module_preprocess.py - Box & Crop Extraction
module_detection.py
Inspection Results
- Annotated Results
main.py - Defect Crops
module_detection.py
Benchmarking
- Blur Study
experiments/exp_blur_kernel.py - Feature Study
experiments/exp_max_features.py - Color Binarization Study
experiments/exp_rgb2binary.py - ML Classification
Other components
- Operator
Connections 17
- Operator → Pair Runner: runs inspection
main.py - Pair Builder → Pair Manifest: writes pairs
experiments/build_pairs.py - Pair Manifest → Dataset Loader: loads pairs
dataset_utils.py - Pair Runner → Dataset Loader: finds pairs
main.py - Dataset Loader → Pair Runner: loads images
main.py - Pair Runner → Alignment & Difference: aligns and compares
README.md - Pair Runner → Box & Crop Extraction: extracts boxes and crops
main.py - Pair Runner → Annotated Results: writes annotations
main.py - Box & Crop Extraction → Defect Crops: writes patches
module_detection.py - Blur Study → Dataset Loader: loads pairs
experiments/exp_blur_kernel.py - Blur Study → Alignment & Difference: checks difference
experiments/exp_blur_kernel.py - Blur Study → Box & Crop Extraction: evaluates boxes
experiments/exp_blur_kernel.py - Feature Study → Dataset Loader: loads pairs
experiments/exp_max_features.py - Feature Study → Alignment & Difference: checks alignment
experiments/exp_max_features.py - Feature Study → Box & Crop Extraction: evaluates defects
experiments/exp_max_features.py - Color Binarization Study → Dataset Loader: loads pairs
experiments/exp_rgb2binary.py - ML Classification → Pair Runner: classification stage
README.md