02-23-2010 01:17 AM
Hi all!
I would like to subtract two images. I have a source (reference image) and a copy one. The second image doesn't have same parameters like the source, ( the image size is different, and it has vertical and/or horizontal movement)
Could you help me how could I subtract these images ( form copy ) to get the defect from the copy one?
Solved! Go to Solution.
02-23-2010 03:37 AM
02-23-2010 07:39 AM
Thanks for your fast reply!
Coordinate System is set both images(pattern matching) and got the coordinate system. But I don't know how to go on?
In the second pictures you can see small defects. I need to find these defects but I don't want to see the same items. thats why I use image subtract, or Xor on Images.
Could you tell me how to determine the orientation?
My process is the following:
1. set coordinate system by pattern matching
2. set ROI on the first image (full image is the roi)
3. from the first image got all pixels inside the ROI (x,y)(double for loop)
4. convert all pixel points to ROI points and use Imaq Transform roi to got the new points in the rotated image
5. use Xor function
but this procedure takes so much time ... 😞 (due to the image size is up to 2000x2000 )
Could you tell me better solution?
Thank you very much!!!
02-23-2010 07:45 AM
02-23-2010 07:52 AM
02-26-2010 03:49 AM
Hi Durnek,
did you try to use threshold earlier (not before Xor)?
Can you somewhere post the original puctures, to be able to look at that by myself?
Regards,
Jiri Keprt
NI EE Czech Republic
CLA, CTA
02-26-2010 05:09 AM
Dear FredyCz!
Yes, I have already used threshold. By the way, my problem become more complex. Let me explain it, and I hope it become more understandable:
I have a source IMG file, and a scanned One. I have to compare them, and determine the defects. These defects can be of scanner or printer. Both type is needed.
The best procedure is Threshold and mask , or Xor each images.
But these 2 images are different size, so masking and/or Xor is not usable, i think.
Is the any possible solution for my problem? ie. change scanner DPI ? or?
I uploaded 2 images.
02-26-2010 10:22 AM
You should take a look at Golden Template Inspection
<LabVIEW directory>\examples\Vision\3. Applications\Golden Template Inspection Example.vi
Kevin C.
National Instruments
02-26-2010 11:37 AM
03-01-2010 12:11 PM
If you already know the scale of the Template Image to your Inspection Image, you can just set it as part of the Alignment for IMAQ Compare Golden Template. If you need to find the relative scale, I suggest you use Geometric Matching, as shown in this example:
<LabVIEW directory>\examples\Vision\3. Applications\Geometric Matching with Calibration Example.vi
Kevin C.