Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use imaq count objects in a while loop?

Solved!
Go to solution

Hello, I've been using IMAQ Count objects and works good, but when I use a while loop and I want to modify the image which i'm analyzing to see the results instantly, the search area and the locations of the objects remains in the image even if I return to the original values (for example in Threshold), the location objects and the green rectangle remains there like in the next image:

 

 

18221iE9EC953BB1F29FEE

 

 

 

This is the block diagram I'm using:

 

18223i8731303F1E3BC435

 

 

I've used this same configuration with the IMAQ 3D View and it works good, I can change values and the 3D view changes while I do it.

 

Am I using inappropriately the IMAQ Dispose?

 

Thank you so much for your helps and comments.

 

Bebin

Impossible is nothing
0 Kudos
Message 1 of 7
(6,752 Views)

It's suposed that the green lines on the image should disappear when I rotate the image as many of the red points (location objects). I haven't saw any posted message with a similar trouble.

 

Any help or comment will be appreciated.

 

 

 

 

Bebin

Impossible is nothing
0 Kudos
Message 2 of 7
(6,721 Views)
Solution
Accepted by topic author bebin

The problem is due to the way IMAQ Vision works : the image wire contains a reference (handle) to the image, not the image itself. Means that once an image has been modified somewhere, the mods are propagated everywhere.

The solution is simple : Just add an IMAQ clear Overlay immediately upon entering the while loop (and add a small temporisation inside the loop).

See the attached vi as example.

18433i82A3D2D407CB8122

Chilly Charly    (aka CC)
Message 3 of 7
(6,704 Views)

Hi Chilly Charly, thanks for your comment. I did what you suggest, but now the objects location and the search area flashes (blink, wink). I send the image of the VI I made.

Is this a expected behaviour at using the IMAQ Clear Overlay and IMAQ Count Objects?

 

 

 

18663iEF03E5C525B12198

 

I attach the VI, it's called opening.vi

 

 

Thanks for your help.

Impossible is nothing
0 Kudos
Message 4 of 7
(6,668 Views)

 


bebin a écrit :

Hi Chilly Charly, thanks for your comment. I did what you suggest, but now the objects location and the search area flashes (blink, wink).

Is this a expected behaviour at using the IMAQ Clear Overlay and IMAQ Count Objects?


I think it is.

You could use an event structure to run the IMAQ vi's only after detection of change in the settings. Or embed both vis in a case structure, using a shift register to detect a change in the settings...

Chilly Charly    (aka CC)
0 Kudos
Message 5 of 7
(6,662 Views)

Hi Chilly Charly, I have obtained what i needed with your first suggestion. I only changed the image display to the Image out of IMAQ Count Objects and moved the Image In of the IMAQ Light Meter just like the next image. Really thank you, i'm begginer with labview and i discover new ways and tricks to work with it.

 

Bebin

 

 

18683iBCCF828BDB12B9DA

Impossible is nothing
0 Kudos
Message 6 of 7
(6,659 Views)

con conteo de tapas por webcam

0 Kudos
Message 7 of 7
(3,513 Views)