LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Algorithm for oval shape detection

Is anybody know how to use algorithm to detect an oval?Because I am a beginner in the labview, I do not know how to do the algorithm to detect oval shape. Is there an example or sample for the algorithm to detect oval?
Beside that, if there is no algorithm for it. Then is it have other function to detect the oval shape or the example or sample? Please help me I am a beginner and not so used to it with the labview. Thank you for the helping. If there is any sample or example can send it to me as a guideline? Thank you.

 

0 Kudos
Message 1 of 14
(7,259 Views)

Detecting an oval with code is an algorithmic problem and has nothing to do with the programming environment you use. Your unfamiliarity of LabVIEW shold not prevent you from solving this. How would you do it in another programming language?

 

As a first step, let's define what you mean by "oval". Is this in an image? Is the oval filled or just an outline? Is the shape fixed and you just try to find the rotation and translation or is the oval arbitrary, from a near circle to a very stretched ellipse. Could there be perspective distortion? How many ovals are there and can they overlap? What else is there that you need to reject (squares, triangles, flowers, teddybears, etc.)? How is the signal to noise and contrast?

 

Do you have only plain LabVIEW or do you also have some tookits (e.g. vision)?

0 Kudos
Message 2 of 14
(7,250 Views)

The oval I mean is an image shown in a picture, the format is jpg.
There will be different shape like circle, triangle, rectangle and other shapes.
The size of the shapes are not fixed and it will be smaller or bigger shapes combined together.
The oval shape is arbitrary and it can be any size and can be nearly an ellipse.

There are as many oval shape it can and some of the oval will be overlap with each other or other shapes.

I need to reject any other shapes except oval, which including basic shapes which are squares, triangles, rectangle.

The contrast for the background and the shapes is robust.

I have vision and motion function and math script in my labview 2011.

 

Thank you.

 

0 Kudos
Message 3 of 14
(7,232 Views)

hi johnlee90,

 

could you post an example .jpg?

 

 

alex

0 Kudos
Message 4 of 14
(7,223 Views)

I have posted 1 simple image that I using to do the program now, but still can't imagine how to do to detect the overlap oval. 1 more image is robust image that I cannot detect it yet. Thank you for the helping

Download All
0 Kudos
Message 5 of 14
(7,216 Views)

Ok, I admit this task is quite tricky, because you are looking for way more than a classification algorithm for oval shapes.

What you are into is a whole image processing algorithm in order to identify oval objects.





Before you can think about classification, you inevitably have to work out a proper way to segment your image in background information and object information.

After this step you mighty identify different geometric shapes in the object information.



As you point out  "The contrast for the background and the shapes is robust."

So I guess you do use a threshold to segment object information from background information?




If your overlapping objects only "touch" each other as in "test.jpg" you mighty use several erosion & dilation operations to liberate connected objects.
e.g. http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm

Then a threshold approach will be fine.




But if two objects are overlapping as in "shape 3.jpg", you are supposed to take a different segmentation approach into consideration.

An approach to detect overlapping objects is "template matching":
http://en.wikipedia.org/wiki/Template_matching

But: Template matching will work only to a certain degree of overlapping.

0 Kudos
Message 6 of 14
(7,184 Views)

Can I know is it I need to threshold the image first just morphological the image or the other way round?Because I doing now is threshold using imaq autobthreshold which is the inter-class variance and then use the imaq morphology to erode and dilate the image. Can u give me some suggestion about it? Thank you.

0 Kudos
Message 7 of 14
(7,171 Views)

Unfortunately, I don't use NI Vision for most image processing steps besides image acquisition; I'm rather using plain Labview.

 

From my experience it's often sufficient to set the threshold(s) before doing morphological operations.

 

 

 

If you are looking towards setting thresholds automatically you might be interested in this topic:

http://www.discover.uottawa.ca/~qchen/my_papers/have04_published_version.pdf

 

It's about watershed algorithm in combination with distance functions.

 

0 Kudos
Message 8 of 14
(7,152 Views)

What is mean by plain labview?

Can I know is it there is the function which can detect oval shape using the vi inside the labview without using algorithm?I just wan do it in a simple way first. Thank you for the helping.

 

0 Kudos
Message 9 of 14
(7,126 Views)

@johnlee90 wrote:

What is mean by plain labview?


Plain LabVIEW is without any extra toolkits, such as vision.

0 Kudos
Message 10 of 14
(7,118 Views)