From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-27-2017 04:25 AM
Hi to all,
First of all thanks a lot for reading this post and being able to help.
I am trying to use Imaq Compare Golden Template vi in a for loop.
So I am trying to do the next:
1- I have 3 templates and 1 image inspection.
2- The templates are in the image inspection. So imagen that the image inspection is an image with a big 1 2 3 numbers. So the templates are 1, then 2, and then 3. An for loop has 3 iterations.
3- In each iteration I pass a template, with IMAQ pattern matching vi template is found in an image (getting bounding box) and then do the compare golden template to get the defects (differences between template and image).
I am doing the program based on this example "LabVIEW\examples\Vision\Golden Template Comparison\Golden Template Inspection.vi"
My program is the next (attached as well):
The problem is the next:
· If I do this just for one iteration, code works fine. But the problem is that when i do the next iteration, the defects of before iteration is removed, so always I get the defects of iteration 3 (the last iteration) so I thing that I need to create a image with all defects, so combine "defect image" in every iteration in one. I try to do this with IMAQ add (red circle in image) but it does not work.
Any ideas? Please tell me if I do not explain well.
Thanks a lot.
12-27-2017 07:03 AM
You're using a shift register with a single buffer. The shift register will only store the last value.
You want to get away from the shift register. Then, you want to allocate three buffers and feed those into your for loop so the first iteration acts on the first buffer, the second on the second, and the third on the third.
That way, each iteration is working in a different space. Otherwise, each iteration will clobber the work done in the prior iteration.
The golden template is working just fine if this works in a single iteration and you get the last template's data with multiple iterations. The problem is the way you're storing your calculations.
12-27-2017 08:39 AM
Also, using auto-indexing and wiring the [N] isn't a good thing. Just use auto-indexing and let the FOR loop handle how many times it needs to iterate.
01-03-2018 01:04 AM
Hello,
Thanks a lot for replying.
I do what you say and now I have the next code:
But as you say, I have now three images (Cam1_PROD_display, Cam1_PROD_display2, Cam1_PROD_display3) with defects drawn in each templates, I mean, defects in template 1 are drawn in Cam1_PROD_display, defects in template 2 are drawn in Cam1_PROD_display2, defects in template 3 are drawn in Cam1_PROD_display3. Something like this:
· Source image is the next (with defects in white):
· Templates are:
Template 1 Template 2 Template3
- And the displays Cam1_PROD_display, Cam1_PROD_display2, Cam1_PROD_display3 show the next in each display (with defects in red):
- But I want just a display which shows all defects in one image like this:
How can I do that with the code that I have?
Thanks a lot
01-04-2018 02:46 AM
Thanks!
I did what you said in for loop.!
I am still stacked, any ideas?
thanks a lot.
01-08-2018 08:05 AM
Can anybody help me?
Any ideas help me a lot!
Thanks.