Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

edge detection on a moving object

Hi
I have a problem on edge detection. I have a pulley of different types.
Pulleys where Dia is same, but height differs. Pulleys of different dia but the number of teeth (ridges) vary.
I need to identify one type of pulley from the other. I am trying to use the following logic:
1. Locate the base of the pulley (which is distinct) using pattern match
2. Define a co ordinate based on this pattern match.
3. Define edge detection tool using the co ordinate (this is where I am running into a wall)

I have used extracts of examples : battery inspection, gage and fuse inspection

I am not able to define the edge tool (Edge detector under vision assistant 7.1)
I am trying to use the co ordinates, since if the pulley moves a bit, then the edge detector appears away (in Vision assistant)
THE CATCH IS:
I have to do this in VB since Machine vision has to be integrated into existing vb application.

NOTE: attached image of pulley

Now can some one help me PLS
Thanks in advance
Suresh
0 Kudos
Message 1 of 11
(5,434 Views)
Suresh,
the Vision Assistant is only a prototyping tool. It's not possible, as in VB AI, to set a new coordinate system.
If you want to become familiar with this function, navigate to the following path on your PC and have a look into the examples:
C:\Program Files\National Instruments\Vision\Examples\MSVB.NET\3. Applications

Best regards,
ThSa
0 Kudos
Message 2 of 11
(5,424 Views)
Hi
Thanks for the reply. I have been thru the applications folder. (BTB it is MSVB not MSVB.net , in my system, probably bcoz my version is 7.1.1)
The battery clamp inspection appears to be the nearest fit. And it uses the circular edge. I am trying to use the same by modifying it for the edge detector tool (simple edge) but I am not able to get it. And the documentation is not able to enlighten me. I have to complete it fast. And I would be highly thankful for any help. I feel I am making some mistake somewhere. I even tried the fuse inspection example (by modifying it).

If some code extract for vb 6, I shall be grateful
Thanks
Suresh
0 Kudos
Message 3 of 11
(5,419 Views)
Hi Suresh -

I took your image and expanded the background region to make three versions with the pulley in different positions.  Then I loaded the three images into Vision Assistant and built a script that finds the teeth of the pulley.  Although Vision Assistant can't generate coordinate systems, I used edge detection algorithms to define a placeholder where the coordinate system code should be added.

I chose to use a clamp and midpoint instead of the Pattern Matching tool because of the nature of the image.  Silhouetted images are difficult to pattern match, and the vertical line symmetry of the pulley makes it even more difficult to find a unique area of the object that can be recognized repeatedly.  Instead, I generally find more success using algorithms that are designed around edge detection.  I assumed that the "notch" at the bottom of the pulley will always be present in your images, so I performed a Clamp in the Horizontal Min Caliper to find this notch.  The midpoint of this clamp section can be used as the origin of a coordinate system around which the following Edge Detection steps are performed.  This allows you to find the teeth of the pulley no matter where it is in the image.  (Note that the VA script was built using pulley with BG 3.png.)

The Builder File that was generated from the script gives you all the code you need except for the Caliper function and the Coordinate System functions.  I added comments to these sections to show what type of code you will have to add there.

It may not be exactly the application you need to perform, but it should give you a solid starting point.  I hope it helps.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 4 of 11
(5,402 Views)
Hi all,
Thanks for the reply. Your help however small is highly appreciated. I am new to NI products and new to this forum. I started off on this forum before buying ni products (to decide on the purchase), now to learn. I really appreciate the effort of all the people.
Browsing the threads (I do it to learn abt vision) I read somewhere, that one can give stars as appreciation. How is this done?
Thanks
Suresh
0 Kudos
Message 5 of 11
(5,392 Views)
Hi David
Thanks for all the support. I could at last get it. I am able to position the edge detecting tool along a derived co ordinate system. I am using pattern match to find the left edges and right edges.
Thanks and Thanks again
Suresh
0 Kudos
Message 6 of 11
(5,380 Views)
Hi David,

I realize the original poster has found a solution to his problem.  But I am also struggling with Coordinate Systems and was curious about the files you posted.  

When I opened the .scr file, I was unable to run the script on the images you included as they were RGB images and not compatible with the Find Circular Edge or Clamp functions.  I added an Extract Color Plane function and was then able to run your script.  

I'm a little confused though as to how you would use this script to generate positioning information.  Would it be possible to explain it a little?  

Thanks.   

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 7 of 11
(5,200 Views)
Hi pallen -

The first step in the script extracts the Intensity plane from the image, which results in an 8-bit grayscale image that later steps can use.  I was able to run it without any modification.

As I commented in the Builder File, you'll have to create and implement a coordinate system youself because Vision Assistant doesn't generate this code currently.  I recommend using the midpoint of the Clamp results as the system origin.  You can use the CWIMAQVision.BuildCoordinateSystem method in doing this.  To use the coordinate system with the Simple Edge Detectors, I recommend using CWIMAQRegions.TransformRegions to conform the ROI input to the new coordinate system.

I'm not a VB programmer myself, so I can't write the code for you.  However, if you run into problems using our API, I can use my resources to help you solve them.

David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 8 of 11
(5,181 Views)
Thanks for the explanation.

I'm not a VB programmer myself either.  LabView here.  

I found this thread while looking for a way to use simple edge detection of one "feature" as a way of translating the location of other "sensors" in my ROI.  My previous experience with DVT systems provided a very simple way of doing this and as yet I'm still struggling with LabView.  

Basically I want to use the outside edges of a part to help locate certain details inside of the part because part positioning under the camera may vary slightly from sample to sample.  

I've only just begun this project though.  I'm confident that with all the resources available I'll have it figured out in time.  Smiley Very Happy

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 9 of 11
(5,177 Views)


Message Edited by pallen on 06-16-2006 02:38 PM

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 10 of 11
(5,178 Views)