[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


Discuss the use of seed fill algorithm with a simple...

<< Back to general questions

Question by Md. Afzalur Rashid
Submitted on 11/2/2003
Related FAQ: N/A
Rating: Rate this question: Vote
Discuss the use of seed fill algorithm with a simple illustration.


Answer by joybhattacharya
Submitted on 12/24/2003
Rating:  Rate this answer: Vote
The Seed Fill Algorithms assume that at least one pixel is interior to a polygon or region is known. The algorithm then attempts to find and color or fill all other pixels interior to the region.
The method of the seed fill is to start with a seed and recursively check neighboring points to fill in the polygon.
1.   Start with a point known to be contained within the polygon. This is the seed.
2.   Set the buffer for this seed and draw it.
3.   Check each neighbor point. A neighbor point is a point for which the x and/or y values are exactly one greater or less than the current point's values. For each neighbor that is not a boundary point and is not already set, recursively call this function.
The following will demonstrate this method. The polygon below is outlined by black pixels. Start with the point (23, 11), as the seed. This is filled in blue. The buffer would be set so as not to draw this pixel again.

Then each neighbor would be checked. For example, let's check point (24, 10). This point is in the polygon, so we would recursively call the seed fill algorithm on it. At that point, the pixel would be drawn.

Then the neighbors of point (24, 10) would be checked. If we checked pointer (25, 9), we would see that it is a border point and not draw it or recursively call the seed fill algorithm. You can see that this method would lead to a slightly different polygon than one filled with the scan-line method. The top and left edges would not be drawn in the seed fill since no edges are drawn.

 

Answer by mireille
Submitted on 3/18/2004
Rating:  Rate this answer: Vote
I am the best

 

Answer by uuu
Submitted on 1/19/2006
Rating: Not yet rated Rate this answer: Vote
Yea, in you get 5 white stars, yea I see.

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to general questions


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.