08-26-2010 01:55 PM
Hi,
I've a vi that calculated centroid and diameter, and the algorithm behind it works on intensity levels. My current work is on shadowgrams, so I need to invert my frames pixels (see attached file). Does NI have a built in vi for that (other than IMAQ invert)?
Thank you,
Solved! Go to Solution.
08-26-2010 03:34 PM
IMAQ Invert does it so well, why would you need another version?
If you don't have vision, you can convert to an array and subtract it from 255.
Bruce
08-26-2010 08:55 PM
Hi Bruce,
I've tried IMAQ invert, but it doesn't change the image at all.
According to the help section, if mask in isn't connected it should process the entire image.
08-26-2010 09:38 PM
It should change the image. What is the image format? Is IMAQ Inverse compatible with that format? I assume it works with most formats. Probably not floating point formats, though.
Your code snippet looks fine, but I can't really troubleshoot your code unless you can provide the vi. You could always just strip out all the code that follows the Inverse, and compare the images before and after.
Bruce
08-26-2010 10:18 PM - edited 08-26-2010 10:18 PM
Hi Bruce,
The input image is grayscale U8, and the IMAQ inverse doesn't give me an error while running, it's just not doing anything visible
I've uploaded the vi and a sample avi file after removing all the other code, I just want to see the image inverted....
Thank you very much for your help.
08-27-2010 01:16 AM
Do you have vision assistant? If so go to grayscle-->lookuptable--> reverse .
See if that is what you are looking for
08-27-2010 07:42 AM
It is working just fine. You just can't see the results. You are loading a new image in the next iteration before it has time to update the display. The new image replaces the previous inverted image.
Try the following solutions:
Add a delay to your loop. Both displays will display the current version of the image (inverted).
Turn on snapshot on both displays using right click. This preserves the image in the state it was in when you displayed it. Very useful when you keep reusing the same image for processing.
You could also use probes, which should use the snapshot method.
Bruce
08-27-2010 11:39 AM
Thank you.