09-09-2008 03:35 PM
Please help. I do not know why this simple while loop will not work.
I read a simple image file and performs histogram equalization on it, changing the minimum and maximum values, I expect to see the immediate output on the display, but to my surprise, I only see the desired output after the stop button is pressed.
Thank you.
I have attached the VI in ver 8.5, and 8.0.
Thank you.
09-09-2008 06:10 PM
can you attach the subvi with it?
IMAQ Load Image Dialog
IMAQ Create
IMAQ ReadFile
IMAQ Equalize
i want to be able to run it in order to see if i can try to help.
09-09-2008 07:33 PM
Thanks.
Those VIs are actually from Vision Toolbox, so if you do not have the toolbox, it won't open.
I think I know the answer to my problem.
The controls I need to interactively change are embedded inside a cluster, and I think I have to unbundle them before I can use it.
09-09-2008 07:55 PM
yeah. i figured that i don't have the subvi because i dont have Vision.
GLAD you found the answer.
09-09-2008 10:57 PM
okogidi wrote:The controls I need to interactively change are embedded inside a cluster, and I think I have to unbundle them before I can use it.
This statement makes absolutely no sense. If the subVI expects a cluster input, unbundling would be wrong.
09-10-2008 12:35 AM
Yes, I clearly understand that all the functions to the left of the Histogram equalization needs to be outside the loop. It was in frustration of not getting it right that made me put all the functions inside the while loop.
The unbundle I mean was to bundle two controls together and use the bundle function .
Like you said, I have put a delay in the while loop.
My final application would surely have an event structure, but I need it to work in a while loop first.
I guess the problem is coming from the the function "IMAQ Equalize", and I need to figure that out.
I have revised it but it is still not working, when I change the values the while loop continues and does not respond to the controls again.
I have attached a modified version of the VI
Thanks for the information.
09-10-2008 09:26 AM
okogidi,
It is important to note that the image data type used with NI Vision is passed by reference, not by value. This means that the output image of the IMAQ Equalize VI is referring to the same piece of data created by the IMAQ Create VI. The way you have things now, you are equalizing the same image over and over each loop iteration, which is causing bad results. If you create a second image with the IMAQ Create VI (give it a different name that the existing image) outside the loop, you can wire the new image to the "Image Dst" input of the IMAQ Equalize VI. This way, the function will take the image data from the picture file (Image Src), perform calculations on it, then place the resulting data in the memory space of the 'new' image (Image Dst). Try this, and change the value of "Max" ranging from 0 to 255.
Chris M
09-10-2008 10:49 AM
CMal wrote:It is important to note that the image data type used with NI Vision is passed by reference, not by value.
Ah, that's good to know. I never had IMAQ. 🙂
09-10-2008 04:12 PM