- Store all edge-pixels (pixels in black) in an array
Store all edge-pixels (pixels in black) in an array
- clear the accumulator-array (you'll see the use of it later)
clear the accumulator-array (you'll see the use of it later)
- Loop through each array-entry in the "edge-pixels-array"
Loop through each array-entry in the "edge-pixels-array"
- Loop through each array-entry again, check if the distance between the two coordinates (from step 3+4) is in between the min-radius and max-radius of my ellipse (min-radius and max-radius are just function parameters)
Loop through each array-entry again, check if the distance between the two coordinates (from step 3+4) is in between the min-radius and max-radius of my ellipse (min-radius and max-radius are just function parameters)
If this is true, then proceed with steps 5-14.
Calculate the center, orientation and the assumed length of the major axis (you can see the equations on the paper, but I don't think that they are necessary)
Loop through each array-entry a third time, check if the distance between this coordinate and the assumed center of the point is between the min-radius and the max-radius. It this is true, then proceed with steps 7.-9.
Calculate the length of minor axis using equations (if you need to look them up on the paper)
Add the assumed parameters of the ellipse to the accumulator-array (center, x-Width, y-Width, orientation)
Wait for the inner (3.)
forloop to finishAverage all values in the accumulator-array to find the average parameters for the investigated ellipse
Save the average ellipse parameters
Remove the pixels within the detected ellipse (so you don't check the pixels twice...)
Clear accumulator-array
Wait for the outer two
forloops to finishOutput the found ellipses
If this is true, then proceed with steps 5-14.
5. Calculate the center, orientation and the assumed length of the major axis (you can see the equations on the paper, but I don't think that they are necessary)
6. Loop through each array-entry a third time, check if the distance between this coordinate and the assumed center of the point is between the min-radius and the max-radius. It this is true, then proceed with steps 7.-9.
7. Calculate the length of minor axis using equations (if you need to look them up on the paper)
8. Add the assumed parameters of the ellipse to the accumulator-array (center, x-Width, y-Width, orientation)
9. Wait for the inner (3.) for loop to finish
10. Average all values in the accumulator-array to find the average parameters for the investigated ellipse
11. Save the average ellipse parameters
12. Remove the pixels within the detected ellipse (so you don't check the pixels twice...)
13. Clear accumulator-array
14. Wait for the outer two for loops to finish
15. Output the found ellipses