03-23-2020 10:55 PM
Dear Members,
I am working on a PCB verification system school project using LabVIEW and Vision Assistant. My plan is to subtract the test image taken by a camera from the reference image which is a bitmap format of the CAD gerber file. I cut out the reference image manually and for the subtraction method, the test image should be the same resolution with perfect alignment to the reference image, so the appropriate pixels will be subtracted from each other. However, I would like to automate this process and I am stucked with the pre-processing part of the test image.
So far I manually masked the test image trying to find the closest pixels of the edge of the PCB and with the "Geometry" function I resampled it for the same size like the test image. However, at the end when I execute the subtraction operator we can see that the two images are misaligned so false defects are detected. My ideas which I tried but couldn't figure out how to program it:
- Instead of me trying to find the edge and mask it, I should find the edge with image processing and then mask it around the found edge. Since the green PCB is on a white background I could find the edge with grayscaling and thresholdind but after that I don't know how to use that as a ROI for masking. It is just my idea and not sure if it's doable. I would appreciate any other solution for finding the PCB board and mask it as precisely as possible.
- Since the the pictures are misaligned I tried "Geometric Matching" and "Set coordinate system" methods so I find a reference point on both images and set a coordinate system to those points. However, I couldn't figure out how to fit the two coordinate systems on the same pixel and give them the same orientation.
I took a screen record, screenshots and also attached the Vision Assistant script about the process with the above mentioned problems so you may have a better understanding. Thank you in advance for your time and help.
Kind regards,
vitya
04-04-2020 01:34 PM
Hello Vitya
It is challenging to align the reference and test images at a pixel level for subtraction. Using Grayscale pattern matching or geometric matching should be the best possible way to find the shift and orientation.Still it cannot be 100 percent accurate. But try using the IMAQ ROITransform to convert ROIs from one coordinate system to another.
Hope this helps !!!
Hit KUDOs for Thanks
04-04-2020 10:14 PM
You will notice that in 3 of the corners of the PCB there are holes.
That is called fiducials.
Normally you would try to use for alignment the 3 fiducial points.
It is 3 holes. You need to find the center of the holes and align them.
I am not sure if LabVIEW has alignment base on 3 point in the toolbox.
But matlab image processing tool box has alignment base on 3 points
You can take example from there.
04-09-2020 11:59 PM
Thank you for both of your answers Rahulbala and Amit. In the meantime I progressed a lot with the project after I realized I have to use more LabVIEW programming beside Vision Assistant than I expected before. I have another question in connection with a LabVIEW code. I could manage to use IMAQ Shift and IMAQ Rotate functions, but after doing that, the original image becomes black. I attached the original image and the result image with the LV code. Could you please tell me how can I keep the original image after shifting and rotating? Thank you so much in advance for your time and assistance.
Kind regards,
vitya
04-10-2020 12:30 AM
Hi Vitya,
Some image processing functions can't work "in place".
Sometime you want to allocate image destination for the processing result.
Try to create destination image for your processing function. That will let you see what function needs it.