07-01-2016 09:23 AM
Hello,
I'm trying to do some manipulations with image in a loop.
For simplicity in the example below I used rotation.
Only on 1st iteration rotated image is displayed. Then display becomes empty.
Thanks in advance
Solved! Go to Solution.
07-01-2016 09:28 AM - edited 07-01-2016 09:30 AM
You're creating a new IMAQ image every loop with the same exact name. I believe this is causing your issue because it is overwriting the image already rotated. Try not creating a new image for your destination every loop.
From the IMAQ Create VI:
Image Name is the name associated with the created image. Each image created must have a unique name. |
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-01-2016 09:33 AM
Yes !
07-01-2016 09:39 AM
Pavel,
You keep coming to the Forum with elementary questions about LabVIEW Vision. Am I correct that you are trying to teach yourself this rather-more-difficult LabVIEW topic, and have no mentors or colleagues around who can help you? Have you done a Web search for IMAQ Tutorials or LabVIEW Vision Tutorials (there's not a lot, and most are a decade old, but they do cover some basic concepts that you do not seem to understand)? Have you purchased any of the (relatively-few) books written about IMAQ and studied them?
Inside your loop, you create an Image to hold the rotated Image. From the LabVIEW Help for IMAQ Create VI, "Image Name is the name associated with the created image. Each image created must have a unique name." You violate this requirement when the While loop repeats.
Bob Schor
07-01-2016 09:42 AM
To build on what Bob has suggested, you should get in to the habit of reading the entire Help article for a VI you haven't used before. I do this and it helps tremendously, even if it's just because there's an option that I didn't know existed.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-01-2016 10:13 AM
James.Morris a écrit :To build on what Bob has suggested, you should get in to the habit of reading the entire Help article for a VI you haven't used before. I do this and it helps tremendously, even if it's just because there's an option that I didn't know existed.
Bob, James,
Thanks for suggestions.
Have no mentor, no collegues and must terminate project in 2 days ... so really have no time to read textbooks/manuals.
There is core algoritm that doesn't work properly ... I try different options.
If someone form forum helps me, it accelerate things, otherwise I continue to try until it works (but it takes more time).
Thank you for comprehension.
Sincerely
07-01-2016 02:02 PM
@Pavel_47 wrote:
Have no mentor, no collegues and must terminate project in 2 days ... so really have no time to read textbooks/manuals.
Well, the project should probably be allowed to terminate -- it is not reasonable to expect someone (like you) to tackle a very technical project (like figuring out IMAQ) with no mentors, colleagues, and no time to read textbooks and manuals.
There are two problems with your VI. One comes from your not paying attention to the wiring for the function, and (despite having spent some time with LabVIEW) not understanding how Data Flow works, especially what happens within loops (ask yourself how many times you create the same IMAQ Image). Since you don't have time to read the Help carefully, here is the Connector Diagram for Rotate VI.
Do you notice that there are two inputs, and the output has a different name from the input at the corresponding position of this VI?
Even if you manage to get this right, there will still (probably) be a problem unless you are rotating a perfectly square image a multiple of 90°. You do know, don't you, that Images are a fixed-size array of integer quantities, right? Suppose I have a 100 by 100 image, and I rotate it 45°. The "image" I'm going to use to display it is also 100 by 100, but now my rotated image will have "corners" that stick outside my "image for display". Here are two entries from "Detailed Help":
The first says that if your rotated image does not "cover" the Image being used for display purposes (like the corners in the above example), the missing pixels will, by default, be set to 0 = black. The second informs you that when you rotate a pixel and its new coordinates are not exact integers (which is most of the pixels), IMAQ does some form of interpolation on the pixel values. It's kind of important to know this.
Bob Schor