π π«π· Lire en franΓ§ais
BoardMapper is an open-source tool designed to automatically generate PCB layout. It labels component references (e.g. U1, R1, C1) directly on the circuit image, facilitating component identification for reverse engineering purposes.
- π€ Automation: Eliminates the need for manual placement annotation on PCB layouts.
- β±οΈ Efficiency: Saves time for engineers and makers working on PCB assembly and debugging.
- π Clarity: Provides a clear visual reference for debugging, testing, and manufacturing.
- π» Cross-Platform: Works on Windows, Linux, and macOS systems.
| Position | Original | Annotated |
|---|---|---|
| Top | ![]() |
![]() |
| Bottom | ![]() |
![]() |
- Python: Version 3.6 or higher
- Required Libraries:
opencv-python(for image processing)lxml(for XML parsing)
-
Clone the repository or Download the project to your local machine.
-
Labeling the PCB:
-
Step 1: Take a photo of both the top and bottom layers of the chosen PCB.
-
Step 2: Place the
top.pngandbottom.pngimages into theinputfolder. -
Step 3: Install the latest version of LabelImg.
-
Step 4: Open
top.pngin LabelImg and draw bounding boxes around each component. Label each component according to its type:- R: Resistor
- C: Capacitor
- L: Inductor
- F: Fuse
- POT: Potentiometer
- D: Diode
- LED: LED
- Q: Transistor (BJT, MOSFET)
- U: Integrated Circuit (IC)
- J: Connector
- K: Relay
- SW: Switch
- Y: Quartz / Resonator
- SP: Speaker
- ANT: Antenna
- BUZ: Buzzer
LabelImg Shortcuts:
- βοΈ W: Draw a new rectangular bounding box (RectBox)
- β D: Delete the last drawn bounding box
- πΎ Ctrl + S: Save the annotation as an XML file
- βͺ Ctrl + Z: Undo the last action
- π Ctrl + C: Copy a bounding box
- π Ctrl + V: Paste a copied bounding box
- π Ctrl + A: Select all bounding boxes
- π Ctrl + R: Rotate the image (for better labeling)
- π« Esc: Cancel the current operation or close a dialog box
-
Step 5: After labeling the
top.png, save the annotation astop.xml. -
Step 6: Repeat the labeling process for the
bottom.pngand save it asbottom.xml. -
Step 7: Place both
top.xmlandbottom.xmlinto theinputfolder.
-
-
Running the Tool:
- Windows: Double-click on
setup_and_run.batto automatically run the script. The tool will read the XML annotations, draw bounding boxes on the images, and save the annotated images. - Linux/macOS: You can run the script from the terminal:
chmod +x script.sh ./script.sh
- Windows: Double-click on
-
π Output:
- After the script has executed, navigate to the
outputfolder to find the resulting annotated images:top_annotated.pngbottom_annotated.png
- After the script has executed, navigate to the
If you'd like to contribute to the project, please follow these steps:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
We welcome any contributions to improve BoardMapper! π
This project is open-source. Feel free to use, modify, and contribute! π




