Is there a way to automatically fill an image (as though using the paint bucket tool in Photoshop) based on a line that runs from one side of the image to another?
For example, if I have the following image:
edge_win =
0 0 0 0 0
1 1 0 0 0
0 0 1 1 1
0 0 0 0 0
0 0 0 0 0
where the ones represent the line, is it possible to produce the following image:
filled_win =
2 2 2 2 2
1 1 2 2 2
0 0 1 1 1
0 0 0 0 0
0 0 0 0 0
The fill value can be any value other than zero or one. However, the original line (ones) may run either from left to right, or from top to bottom, so it may be difficult to do this using a loop...
Many thanks.
1 Comment
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/42440-auto-fill-an-image-based-on-edge-line#comment_87104
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/42440-auto-fill-an-image-based-on-edge-line#comment_87104
Sign in to comment.