Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

screen coordinates of edge detection in real time

Hi there,

I am evaluating the vision assistant addtion to labview.  I have managed to use the applications features to identify two edges a want to track and control.  These edges are constantly moving and I need to know their location with respect to a known point on the screen say 0,0.  The idea will be to eventually keep the edge in centre screen by means of an external control system.  I can see that the straight edge function creates a couple of coordinates which I believe are screen coordinates.  It also mentions an angle of the line of 280deg but I am unshure what this is referenced from.

 

So far I have only been able to run the image analysis on still images in vision asssistant which I have grabbed from a live video feed.  How can I input the live feed (in the first instance a recording in avi format) and check that the processing is still sound at 30 frames per second for instance?  I then need to get this process into labview so I can analyses the coordinates (with respect to 0,0) as the edges move.    

 

If tried to create a VI from Vision Assistant but I can't as I'm only evaluating it at the moment.  I notice all of the functions are available in Labview, is it possible to build it there directly and cut out Vision assistant.  Obviously if I can prove this is likely to work I will purchase the vision assistant licence which should make life easier.

 

Any help would be most appreciated,

 

Regards

 

0 Kudos
Message 1 of 13
(5,402 Views)
0 Kudos
Message 2 of 13
(5,393 Views)
Sorry about the double post, I am aware of it, but don't know how to delete one of them.  Good old IE crashed as I submitted it but it turns it it managed to post it, hense the repeat. 
0 Kudos
Message 3 of 13
(5,391 Views)
No Problem I guess. I have fixed with a notification in this thread. Also in the labVIEW thread i have notified that the question has been shifted. I am sure your question will be answered soon
0 Kudos
Message 4 of 13
(5,389 Views)

Hello,

 

I believe that the Vision Concepts Manual will help clear things up for you. If you are using a rake method tofind your straight edge and are looking at the resulting angle that is measured, it is with respect to the horizontal axis and in a counterclockwise direction. This is on page 202 of the pdf (10-15 of the document. Thus, if your angle is 280 degrees, this signifies a 80  (360-280 = 80) degree angle in the clockwise direction from the horizontal axis. In terms of using a video, I would suggest doing a search for "avi" in the example finder. There is an example called "Read AVI Example" that would be a good place to start. You could use this as your image source and do image processing within a loop one frame at a time. Finally, Vision Assistant can be made into a subVI in order to move everything into LabVIEW code.

 

-Zach

Message Edited by iZACHdx on 10-21-2009 10:16 AM
0 Kudos
Message 5 of 13
(5,370 Views)

Hi Zach,

 

Thanks for the info.  My biggest issue is I don't have a full copy of Vission Assistant as I only have the trial copy with my licenced Labview 8.  As you would know the feature to create a labview VI is disabled.  I can see that the read avi example is perfet for acquiring my video feed.  What I'm struggling with is the code in labview to process the images in the loop.  I have expanded all of the clusters and trying to replicate my vission assistant code which works well.  If I can prove this code will work with this avi then there is grounds for me to purchase the Vission Development module. 

 

 

I've attached a screen shot of my Vission Assistant window which shows my image with my code which has picked up two straight edges.  I am trying to butcher the read avi code to include the 3 functions I used in Vission Assistant to process the images from the avi and record the pixel coordinates and angles for the entire avi.  Later these coordinates will be used to create the control system, for now they can just be recorded for analysis.

 

I do admit that reading the manuals will be helpful and playing with the examples will provide to be invaluable, unfortunately time is of the essence and all I'm trying to do is proove the concept at this stage.  I understand labview to an intermediate level, I just don't know much about image processing.  

 

I am hoping to see the straight line recignition showing up in image 3 of my code (image 2 being the unmodified video).  I also want to see the 4 coordinates of the two straight lines as they change from image to image through the avi.  This is all I require to proove concept based on our video.  From here the rest is in purchasing the software and learning how to optimise refine the code.

 

I really can't waste too much time on this so if I really am out of my depth, to achieve my objective quickly, let me know and I'll put this to bed. 

 

Cheers

 

 

 

 

 

 

Download All
0 Kudos
Message 6 of 13
(5,353 Views)

Hello,

 

Are you not able to wire your AVI feed into the Vision Assistant? Vision Assistant uses LabVIEW code in the background. Anything that you can accomplish with Vision Assistant can be done in LabVIEW. Often, image processing with LabVIEW can be hard to wrap your head around which is why we provide the option to generate the LabVIEW code. If you use the option to select controls, you can also select your indicators and still use the Vision assistant to do your processing and then provide the indicators you need.

 

-Zach

0 Kudos
Message 7 of 13
(5,339 Views)

Hi Zach,

I am fairly confident I will get this to work once I get full function of Vision Assistant when I get a licence.  I can get my avi to open in Vission Assistant but I can't seem to get it to play the file in full speed while processing the images, it just populates the browse image tab with all of the avi frames.  THis is why I've tried to re create it with VI's in labview (because my trial version of VA wont allow me to create labview code).  This eventually will need to be running on a live video feed processing data in Real Time, and controlling the associated system, hence the need to proove processing ability on a full speed avi.

 

Cheers


Wes 

 

   

0 Kudos
Message 8 of 13
(5,328 Views)

Hello,

 

What I am suggesting is that you use the Read AVI example in conjunction with the Vision Assistant to read a frame and then do processing. Take a look at the screenshot below:

Example.png 

 

-Zach

0 Kudos
Message 9 of 13
(5,312 Views)

Hi Zach,

Your example has completely answered my question and solved my problem.  I was not aware of the Vission Assistant express VI.  I was starting in Vission Assistant but then could not create the code given I only have an evaluation copy.  THe vission Assistant VI worked perfectly without needing to code it through the more basic vi's.  The avi read is working well and the image analysis appears to be working ok on a video feed.

 

I have noticed that the displayed video on the front panel is jolting alot with occassional image processing lines appearing.  I am assumming there are some issues to do with the speed of processing, the loop speed and the video feed frame rate.  The read avi example appears to tackle this by calculating the wait period based on the frame rate from the feed.  I cannot see how the loop is synchronised with the avi feed.  By observation it appears they are not exactly synchronised, which is why the time stamp annotation on the avi is not counting consistantly.  I am also unsure why the image processing lines (i.e. red edge detection line) only appears sporadically on the front panel display, even though I think the processing is happening on all of the frames in the avi. Hope this makes sense, I'm finding these observations difficult to explain!

 

Cheers

 

 

 

 

 

0 Kudos
Message 10 of 13
(5,259 Views)