Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

edge detection with mouse event

Hi,

 

I tried to adapt the edge detection example to my program but the while loop freezes the screen. I have a 3D image array and i can choose which image i want to see thanks to an event structure. I would like to be able now to work on the image.

 

I wanted to use one of the ROI tools (drawline) but i can't handle different types of events : a changed value to choose the image, and a draw event on the image which doesn't need an event structure but a while loop checking if there is a change every 5 ms.

 

I think that i should deal with the draw event with an event structure but it means I lose all the advantages of the ROI tools...

 

I attched my Vi (it is not working, i must change the frame number to get information about the profile...).

 

Please help...i am really stuck!

 

0 Kudos
Message 1 of 2
(3,110 Views)

As far as I know, drawing or editing the ROI on the image control does not generate any event. You are not the first one to miss this. The only way I can think of is to poll for the ROI change.

 

Actually, it's not a big problem to implement the polling. Create a "timeout" case in your event structure with a reasonable polling interval. In the timeout case, read the ROI property of the image control. Compare it to the one from the previous iteration. If there's a change, do your processing.

 

Example attached.


View my profile on LinkedIn
0 Kudos
Message 2 of 2
(3,070 Views)