loading

Ellipses

The ellipses module is a shape detection module that identifies contours within an image that are elliptical. The ellipses module is meant to run after a contour based module (like Canny, DOB, Sobel, etc.) that identify edges within an image. Using these edges the ellipses module will determine which contours are part of a elliptical shape and identify that shape for successive processing.

Note that since the ellipses module is contour based several edge processing routines can be applied prior to the ellipses module to best create distinct contours.

Interface

Instructions

1. Threshold - Select the ellipse threshold. The threshold value sets the sensitivity of the ellipse detector. The lower the threshold the more partial ellipses will be detected. The higher the value the more complete and defined the ellipses will need to be.

2. Min Radius - Select the minimum radius of detected ellipses. Any ellipse detected whose radius is less than the minimum radius will be eliminated. Note that this is compared with the major radius of the ellipse.

3. Max Radius - Select the maximum radius of detected Ellipses. Any ellipse detected whose radius is more than the maximum radius will be eliminated. Note that this is compared with the major radius of the ellipse.

4. Min Aspect - Select the minimum aspect ratio of the ellipse. The ratio is defined by the major axis radius divided by the minor axis radius. Any ellipse detected whose aspect ratio is less than the minimum radius will be eliminated.

5. Max Aspect - Select the maximum aspect ratio of the ellipse. The ratio is defined by the major axis radius divided by the minor axis radius. Any ellipse detected whose aspect ratio is greater than the maximum radius will be eliminated.

6. Isolation - Select how close to each other can ellipses can be detected. The larger the isolation the more space between successive ellipses needs to exist. If you find that too many overlapping ellipses are detected increase the isolation number as this will reduce overlapping ellipses.

7. Isolation Scope - Determine what area is considered when determining if two ellipses overlap. It set to radius then the isolation is determined by adding the isolation pixels to the current ellipse size. Thus if any ellipses include each other the less stronger ellipse will be eliminated. If center is chosen then ellipses that are within X pixels of each other's center will tested for elimination.

8. Ellipse Color - Select which color you would like to replace a detected ellipse with.

9. Thickness - Select how thick the line that draws the ellipse should be.

10. Fill - Select if you want to fill the detected Ellipses with the appropriate color selected above. If "Fill" is not selected then ellipses will not be filled and remain as a thin ellipses.

11. Center Color - Select which color the X in the center of the ellipse will be draw using.

12. Radius Color - Select which color the ellipses radius will be draw in.

13. Overlay on - Select which image the ellipse will be draw on. If none is selected the ellipses will be draw on a black cleared image.

Example

SourceCanny Edges
Detected Ellipses in GreenEdges

Variables

ELLIPSES_COUNT - the number of detected ellipses

ELLIPSES - contains an array of detected ellipses.

The array contains blocks of 6 values per detected ellipse. The elements
are as follows:

Offset   Contents
0       x coordinate of the center of the ellipse
1       y coordinate of the center of the ellipse
2       major radius of the ellipse
3       minor radius of the ellipse
4       orientation in radians of the ellipse
5       x axis rotation of the ellipse

For example, to add up all the radii of detected Ellipses would be

ellipses = GetArrayVariable("ELLIPSES")
for i = 0 to ubound(ellipses)-1 step 6
  radius = radius + ellipses(i+2)
next

SetVariable "total_radius", radius

See Also


Circles
Sobel
Canny
DOB

 New Post 

Ellipses Related Forum PostsLast postPostsViews
None