I want to check if the physical material is aligned with its bonding diagram?

physical material
Bonding diagram
I want to check if all the SMDs and filp dies are located in each white rectangle respectively.
How to do the alignment? Assume top-left corner of top-left rectangle is aligned with top-left corner of top-left SMD pad, but these two figures are not the same size.

3 Comments

Registration is why boards have fiducial marks, but all those marks have been cropped out of the image.
Alignment with a rectangle also doesn't tell us what the connectivity of the pads are, or whether connected pads have solder mask between them. The alignment of parts does not mean there are no solder bridges, but not all solder bridges are defects.
You can check for part presence (easiest). You can check for part alignment (IPC 610 has multiple classes which dictate acceptability of alignment). Neither of these tell us about the solder joint, which is arguably more important, and (in my experience) much more difficult to inspect automatically -- both because it relies on non-visible information which must be considered in the program, but because the solder is simply difficult to image due to its reflectivity.
The clarity and subtle contours of reflection patterns will be susceptible to changes in solder alloy specification or changes in the age of the paste being used. Do better strategies exist? I don't know. I'm just the jerk who had to visually inspect everything when the AOI equipment returned ~100% false positive rates on humid days.
Yes, you are right. The fiducial marks are cropped out of the image by me. that is not allocated at each unit. I just want to learn how to align two figures and detect how to find out the SMDs or Dies movement or solder bridges(maybe this defect is not covered by rectangle,so that can be detected.)
That's very Professional you said:
NOT all solder bridges are defects!

Sign in to comment.

 Accepted Answer

Hi @xie,
To find the alignment between two images, you can perform an "affinetform2d" transformation using key points, specifically the top corners of the first rectangle, and compare the alignment using "imshowpair." Here is an example of how to do this for the images mentioned above:
physical_image = imread("ground.png");
bounding_image = imread("masked.png");
rect_top_left = [25, 35];
smd_top_left = [17, 15];
scale_x = size(physical_image, 2) / size(bounding_image, 2);
scale_y = size(physical_image, 1) / size(bounding_image, 1);
translation_x = rect_top_left(1) - smd_top_left(1);
translation_y = rect_top_left(2) - smd_top_left(2);
tform = affinetform2d ([scale_x 0 0; 0 scale_y 0; translation_x translation_y 1]');
smd_transformed = imwarp(bounding_image, tform, 'OutputView', imref2d(size(physical_image)));
imshowpair(physical_image, smd_transformed, "blend", "Scaling", "joint");
For more information, refer to the following documentation links on the "affinetform2d," "imshowpair," and "imwarp" functions:
Additionally, here is a useful discussion thread on other techniques in general for aligning two images:

1 Comment

Thank you Praguna! You teach me to get a new skill.
To do fine tune the mis-alignment, I do some adjustment in you code: crop the active range at first step insead of input the top-left position(it is not easy to be defined). Thank you again!
physical_image = imread("Phisical material.png");
bounding_image = imread("BondingDiagram.png");
physical_image = imcrop(physical_image);
bounding_image = imcrop(bounding_image);
%rect_top_left = [23, 28];
%smd_top_left = [8, 16];
scale_x = size(physical_image, 2) / size(bounding_image, 2);
scale_y = size(physical_image, 1) / size(bounding_image, 1);
% translation_x = rect_top_left(1) - smd_top_left(1);
% translation_y = rect_top_left(2) - smd_top_left(2);
tform = affinetform2d ([scale_x 0 0; 0 scale_y 0])%; translation_x translation_y 1]');
smd_transformed = imwarp(bounding_image, tform, 'OutputView', imref2d(size(physical_image)));
aa=imshowpair(physical_image, smd_transformed, "blend", "Scaling", "joint");

Sign in to comment.

More Answers (0)

Asked:

xie
on 8 Feb 2025

Commented:

xie
on 13 Feb 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!