I want to check if the physical material is aligned with its bonding diagram?
3 views (last 30 days)
Show older comments

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
Accepted Answer
praguna manvi
on 13 Feb 2025
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:
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!