LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drawing line with mouse clicks in picture indicator

Solved!
Go to solution

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.

0 Kudos
Message 11 of 21
(2,683 Views)

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?

0 Kudos
Message 12 of 21
(2,675 Views)

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,

0 Kudos
Message 13 of 21
(2,633 Views)

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

0 Kudos
Message 14 of 21
(2,627 Views)

OK, here it is, basically Altenbach's VI with a sample JPG...

Download All
0 Kudos
Message 15 of 21
(2,623 Views)

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

0 Kudos
Message 16 of 21
(2,616 Views)
Solution
Accepted by golubovski

(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.

Message 17 of 21
(2,608 Views)

Thank you all, especially Altenbach!

Smoothing updates solved the issue!

0 Kudos
Message 18 of 21
(2,582 Views)

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.

0 Kudos
Message 19 of 21
(2,557 Views)

@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.

0 Kudos
Message 20 of 21
(2,545 Views)