Aligning scanned PCB images.

206 views
Skip to first unread message

Igor P

unread,
Jul 5, 2018, 4:03:01 PM7/5/18
to hugin and other free panoramic software
Hello, is there any imaging specialist that could help me? I need to align scanned images of PCB layers to exatly match. But the scanned images has some distortion, every image is a little stretched compared to each other and tiny bit rotated. I have experimented with hugin but i cant succesfully set it up to make as output aligned images.
Is there someone who would help me with this?

Terry Duell

unread,
Jul 5, 2018, 7:29:53 PM7/5/18
to hugi...@googlegroups.com
Hello igor,
I will try to give you some help, if you don't get a better offer.
Can you put a sample of the images on a site where I can retrieve them?
Reply direct if you wish.

Cheers,
--
Regards,
Terry Duell

Kai M

unread,
Jul 6, 2018, 4:35:28 AM7/6/18
to hugin and other free panoramic software
Hey Igor,

Do you already know http://hugin.sourceforge.net/tutorials/scans/en.shtml
The tutorial was very useful for me.
For a similar application I only have images with overlap checked by cpfind.

1 UTC+2 schrieb Igor P:

bugbear

unread,
Jul 6, 2018, 4:43:35 AM7/6/18
to hugi...@googlegroups.com
Igor P wrote:
> Hello, is there any imaging specialist that could help me? I need to align scanned images of PCB layers to exatly match. But the scanned images has some distortion, every image is a little stretched compared to each other and tiny bit rotated. I have experimented with hugin but i cant succesfully set it up to make as output aligned images.
> Is there someone who would help me with this?

I wanted to overlay the component side of a (single sided) board with
the track side. I needed to use 2 techniques over and above the basic mosaic mode
of Hugin

1) On the component side, parallax is an issue - so take the shot from as far as you can get, using your longest lens
2) Assuming you want to view from the component side, you will need to mirror flip the track side image; Hugin cannot do this.

Other than that, mosaic mode, and manual control points should do the task nicely.

BugBear

Igor P

unread,
Oct 2, 2018, 7:37:49 AM10/2/18
to hugin and other free panoramic software
I tried too many times, but even if i manually add control points to the two images, the output of registration/stack is incorrect. The holes are not well aligned. Can somebody try to align the images for me with some steps to do other layers correctly?
I am sending the layer files link here https://files.fm/u/sbbhrtdf in attachement, also a look at how badly the results are aligned. (Holes are not matched well).
unaligned.png

Igor P

unread,
Oct 2, 2018, 7:45:36 AM10/2/18
to hugin and other free panoramic software
I forgot to mention that the layer files were flatbed - scanned.

Dňa utorok, 2. októbra 2018 13:37:49 UTC+2 Igor P napísal(-a):

bugbear

unread,
Oct 2, 2018, 10:22:19 AM10/2/18
to hugi...@googlegroups.com
Igor P wrote:
> I tried too many times, but even if i manually add control points to the two images, the output of registration/stack is incorrect. The holes are not well aligned. Can somebody try to align the images for me with some steps to do other layers correctly?
> I am sending the layer files link here https://files.fm/u/sbbhrtdf in attachement, also a look at how badly the results are aligned. (Holes are not matched well).

I believe you have a scanning error. I aligned the 2 images using 11 careful manual control points, 2 lenses,
and ONLY rotate, X/Y shift and second lens focal length (AKA zoom) as optimisation parameters.

Despite this simple model, along the low edge, I have perfect hole alignment at far left and far right,
but poor hole alignment in the middle, very much as you did.

BugBear

bugbear

unread,
Oct 2, 2018, 10:30:55 AM10/2/18
to hugi...@googlegroups.com
Igor P wrote:
> I tried too many times, but even if i manually add control points to the two images, the output of registration/stack is incorrect. The holes are not well aligned. Can somebody try to align the images for me with some steps to do other layers correctly?

Followup - when I added carefully placed control point to the areas that visually didn't line up well
(28 points in all), the project will NOT OPTIMISE well.

average control point distance: 4.199018
standard deviation: 2.232713
maximum: 8.827131

This confirms my observations from aligning the two images with a small
number of CPs and checking the output (layer mode in Gimp).

BugBear

bugbear

unread,
Oct 2, 2018, 10:42:26 AM10/2/18
to hugi...@googlegroups.com
Igor P wrote:
> I tried too many times, but even if i manually add control points to the two images, the output of registration/stack is incorrect. The holes are not well aligned. Can somebody try to align the images for me with some steps to do other layers correctly?
> I am sending the layer files link here https://files.fm/u/sbbhrtdf in attachement, also a look at how badly the results are aligned. (Holes are not matched well).

OK - nerd time. Working in 1 dimension on the bottom row of holes, on the unaltered images, in Gimp, aligned left-right
These are the X offsets, in pixels, of the hole centres, under zoom.

L1 L6
First hole 366, 366
Last hole 3496,3496
mid hole 2117, 2125

In other words, on NON modified images, the extreme holes align, but the mid ones don't.
It's a non linear scan!!!

BugBear

Igor P

unread,
Oct 3, 2018, 2:53:25 AM10/3/18
to hugin and other free panoramic software
Hello bugbear, thanks for a quick response.
Yes it seems non linear. Like it would be ball bent in the middle, but it sit totally flat to the scan surface. Is there some way to deal with this transformation automated? The reason behind the automation is that i have scanned a whole stack of the board wich has 6 layers.

Evan Gray

unread,
Dec 13, 2018, 5:33:42 PM12/13/18
to hugin and other free panoramic software
Hi Igor, have you had a look at pr0ntools?

It's a fantastic set of tools that actually wraps some of the Hugin tooling to accomplish a similar goal.


/Evan
Reply all
Reply to author
Forward
0 new messages