Skip to content

Instantly share code, notes, and snippets.

@cyphunk
Last active December 8, 2015 16:41
Show Gist options
  • Save cyphunk/e365d115b6b1805062be to your computer and use it in GitHub Desktop.
Save cyphunk/e365d115b6b1805062be to your computer and use it in GitHub Desktop.
Methods for aligning images of PCB layers from a device

Aligning PCB Layers

Reverse engineering a device can be assisted by tracing lines that are exposed on the PCB. For complex tracing I have used depcb and for more simple tracing I use gimp. First the images of the PCB layers should be aligned with each other.

Using Gimp

Recent versions of Gimp allow for preview+opacity during use of "Perspective Tool". On linux this makes manual alignment much easier than the old grid alignment method. To align layers make the master layer visible and set the layer you intend to adjust to invisible. With the adjust layer still selected click on the Perspective Tool. In the tools options and set the opacity for the Image Preview to 50%.

Using Fotoxx

Fotoxx can be used to automatically align and combine two layers. There are 4 options for combining and the following are the results of each for 3 different test cases: top layer skewed, top layer rotated, top layer offset.

Offset

Sample top and bottom) layers offset by a few pixels.

  • Combine "Dynamic Range"
  • Combine "Depth of Field"
  • Combine "Stack / Paint"
  • Combine "Stack / Noise"

Rotated

Sample top layer rotated a few degrees from bottom) layer.

  • Combine "Dynamic Range"
  • Combine "Depth of Field"
  • Combine "Stack / Paint"
  • Combine "Stack / Noise"

Skew

Sample top layer is skewed and transformed from bottom) layer.

  • Combine "Dynamic Range"
  • Combine "Depth of Field"
  • Combine "Stack / Paint"
  • Combine "Stack / Noise"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment