app
AI Flow: Reverse Engineering
Public Made by Adomby adom
Photos of a PCB to a tagged KiCad copy: parts placed, copper and nets with their evidence, a schematic, a measured confidence score, bench tests and a video of the run.
← Commit history
README.md+32@@ -10,6 +10,38 @@ It is a standalone Rust program. It measures from the photos, generates the boar **Status: version 0.5.0, tested on thirteen boards, not a finished result.** The flow now runs from a folder of photos to its last file without stopping for a person. It places parts well. It does not yet recover a board's connections: no test board came out as a copy you could build from, and every run says so in its own report. The section below says what to expect. [docs/status.md](docs/status.md) lists every known gap. +## Taking photos for the best results++The program reads copper, vias and markings pixel by pixel, so the photos decide most of the result. Photograph both faces of the board the same way and pass every photo to `init --photos` unsorted.++| # | Topic | Do | Avoid | Why it matters |+|---|---|---|---|---|+| 1 | **Backlight** | Shoot each face with a strong, even light **behind** the board (a light pad, a tablet showing a white screen, or a window), room lights off, at the same distance as the close-ups | Backlight that is uneven, or so bright that the picture turns white | On two-layer and thin boards the copper shows through as dark shapes against the light: tracks, pours and vias stand out clearly whatever the mask colour. This is the biggest single improvement for reading copper |+| 2 | Detail | Shoot close enough for **60 pixels per mm or more** of board: a phone about a hand's width away (10 to 15 cm), or a macro lens | Whole-board phone shots only (about 16 pixels per mm) | Tracks and the gaps between them must be several pixels wide to be read; the boards that read best were photographed at 65 to 85 pixels per mm |+| 3 | Coverage | 6 to 8 close-ups per face, each overlapping its neighbours by about a third, covering every edge | Gaps between shots, or tiles that only just touch | The close-ups are stitched into one image per face; the overlap is how they are lined up |+| 4 | Overview | One photo of each whole face, the board filling most of the frame with a clear margin all round | A board cut off at the frame edge | Gives the board outline and fills any gap the close-ups missed |+| 5 | Both faces | Photograph top and bottom the same way, at the same detail | A sharp top and a rough bottom | Vias and through-hole joints are confirmed by seeing them from both sides |+| 6 | Camera angle | Straight down, the phone parallel to the board, the board lying flat | Tilted shots, wide-angle shots from very close | A slanted shot skews the stitched image and throws the two faces out of line |+| 7 | Focus | Sharp over the whole frame, edges included; focus on the board surface | Blur, or focus on a tall part instead of the board | Blur merges neighbouring tracks into one |+| 8 | Front lighting | Soft, even light: a ring light, a light box, or daylight from a window | Flash, a single bright lamp, hard side light | Glare looks like silkscreen and hides tracks; long shadows cut tracks |+| 9 | Glare | Angle the light so no bright reflections sit on the board; a polarising filter helps | Shiny reflections on pads, chips and mask | Reflections are read as metal or print |+| 10 | Background | Plain, matte, and a colour unlike the solder mask (mid grey suits most boards; black suits light boards) | Patterned cloth, or a colour close to the mask (teal under purple, green under green) | The board edge is found by the mask colour |+| 11 | Scale | Nothing extra when the board has a 2.54 mm header, a hole row or a chip of known size; otherwise lay a ruler flat against the board edge, at board height, in at least one top photo | A ruler propped up, or lower than the board | Scale comes from features of known size; a ruler out of the board's plane gives a slightly wrong scale |+| 12 | Board condition | Clean and unplugged, no cables or modules attached, no stickers over parts | Glue or coating over markings, cables lying across the board | Covered parts and tracks cannot be read |+| 13 | Markings | Close-ups sharp enough to read chip and resistor markings | Markings in glare or shadow | Part identities and values come from the markings |+| 14 | Files | The original camera files as JPG or PNG, in any order (set an iPhone to "Most Compatible" or export HEIC as JPG) | Edited, cropped, rotated, filtered or stitched photos; HEIC files | The program reads JPG and PNG only, and sorts, rotates and stitches the photos itself from their original pixels |+| 15 | Video | Still photos | Video as the only input | Video frames are compressed and often blurred; video is not accepted as input |++**Optional extras.** They add information and are never required.++| # | Extra | What it adds |+|---|---|---|+| A | A second front-lit set with the light from the opposite side | Glare and shadows move and copper does not, so the two can be told apart |+| B | Multimeter continuity checks from the run's bench plan | Settles connections no photo can show |+| C | An X-ray or an edge cut of the board | The only evidence for inner layers |++**Quick check before sending.** Zoom into one close-up until a single track fills the screen. The track and the gaps beside it should have clean, sharp edges. If they do not, move closer and shoot that area again.+ ## Version 0.5.0: what to expect from a run Eleven boards were run from photos alone, from a 2-layer launchpad to a 6-layer control board, on green, red and blue solder mask. Seven of them were then graded against their real designs (KiCad files, one Eagle board through KiCad's import, one placement list). The designs were never an input to a run.