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

42 ビュー (過去 30 日間)
xie
xie 2025 年 2 月 8 日 8:36
コメント済み: xie 2025 年 2 月 13 日 15:48
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 件のコメント
xie
xie 2025 年 2 月 13 日 14:41
編集済み: xie 2025 年 2 月 13 日 14:45
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.)
xie
xie 2025 年 2 月 13 日 15:48
That's very Professional you said:
NOT all solder bridges are defects!

サインインしてコメントする。

採用された回答

praguna manvi
praguna manvi 2025 年 2 月 13 日 10:30
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 件のコメント
xie
xie 2025 年 2 月 13 日 15:03
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");

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by