11-04-2015 05:45 PM
Completely different approach:
Load it into imaq image control, draw line roi, get roi coords.
No hardware, no image processing, do not need imaq license.
11-04-2015 05:54 PM
Hi AS,
Thanks for the idea. Questions:
1. Do I need the Vision Module for that?
2. I guess I need Mouse Events again?
3. Can I use IMAQ with WebCams as snapshot source instead of files?
11-05-2015 05:38 PM
Guys,
Thank you for the help, this is working already 2 days :). However, I cannot get rid of the flicker - the JPG has to be inside the event, and due to the while loop refresh of the picture control.
Any ideas?
Thanks in advance,
11-05-2015 05:50 PM
Please post the VI you are using now along with any data we need to see what is happening. Things like flickering images can be very hard to diagnose from a verbal description. With the VI someone can probably guide you in the right direction quickly.
Lynn
11-05-2015 06:03 PM
OK, here it is, basically Altenbach's VI with a sample JPG...
11-05-2015 06:24 PM
I do not see any flicker. Can you provide a more detailed description of what you see and what you are doing when you see it?
Lynn
11-05-2015 06:46 PM - edited 11-05-2015 10:19 PM
(Posting by phone, cannot look at your code)
Right-click the picture control and make sure "advanced...smooth updates" is enabled. Mine flickered before I did that.
11-06-2015 02:07 AM
Thank you all, especially Altenbach!
Smoothing updates solved the issue!
11-06-2015 09:27 AM
1. Do I need the Vision Module for that?
Minimum is vision acquisition software, NI IMAQ part (not Imaqdx).
2. I guess I need Mouse Events again?
Yes. The difference is coordinates are not important. There is no event "ROI change" for the image, you need Mouse up event and check if ROI has changed
3. Can I use IMAQ with WebCams as snapshot source instead of files?
That what it is designed for: read camera and show it on the image indicator. But it is IMAQdx (423$ license) or third-party software.
11-06-2015 10:54 AM
@golubovski wrote:
Thank you all, especially Altenbach!
Smoothing updates solved the issue!
There are a few things that might help you to simplify the code.
For example you could get both the distance and angle from the complex number by just splititng it into r and theta (and convert to degrees) using complex to polar. (The original "abs" just gets the r alone).
There is also the two input inverse tangent function that gives you the full 360 degrees range for the result.