How to label the edges in an image, I have some of the cells that I have applied edge detection techniques. Now I want to label th开发者_运维问答e edge detected cell from an image.
You'll need to give more information: how well does the edge detection work? Do you get whole blobs, or disconnected, but related, edges? Posting an example of the sort of image, and the problem would be good --- pictures (images) are worth a thousand words, particularly when describing image processing problems.
This page might be a start. It gives the pseudocode:
l = 1 // Initial Label number
for each pixel
if pixel X is foreground
if neighbours A,B,C & D are unlabelled (equal to zero)
label pixel X with l
increment l
else
num = neighbour label A,B,C & D with least value, not including 0
label pixel X and pixels A, B, C & D if foreground with num
end if
end if
done
精彩评论