-
Notifications
You must be signed in to change notification settings - Fork 19
Bresenham circle and ellipse iterators. #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Each point of the circle is iterated exactly once, and there is no "hole" in the circle. Contrary to the algorithm in Wikipedia, the circles generated by this cursor are "slim": each pixel of the circle is connected with 8-connectivity. For instance, a bitmap excerpt from such a circle looks like this: .......... OOO....... ...OO..... .....O.... .....O....
|
@tinevez This started as a feature request and then it came out as just a comment... This will fit nicely with some discrete
The equivalent of your first example Circles.set( img1, center, w / 4, new UnsignedIntType( 70 ) );above would be Regions.sample( new Circle( center, w / 4 ), img1 ).forEach( t -> t.set( 70 ) );The This is part of a larger cleanup that will also get rid of the neighborhood framework ( So requests:
|
Not an easy one for sure. I think we need to play with this question with a proper Computer Scientist.
Yes! I was puzzled by that question too a while ago. A StackOverflow discussion ensued: |
Hmm, from the answers I don't really get whether any of the solutions is actually exact? |
|
|
|
What about the comment:
? |
I do not understand said comment 😐 |
Cursors that iterates over a circle or an ellipse exactly once over each pixel of the circle. Can be set to iterate over a nD in any 2D dimensions.
Simple addition to the
regionpackage.Examples: