Trant
Trant

Reputation: 3611

Edge detection in C#

I'm trying to think of a efficient way to trace the outlines of homogeneously colored regions of a bitmap image and save them as GraphicsPath objects.

Check out this small sample image:

enter image description here

Now, most edge detection type of stuff I can find are either way too complicated - working on photos with varying degrees of brightness and so on - my edges are very easy to detect, simple any minute change in the RGB values means its an edge.

But also I have a more involved situation than the simplest things that scan a whole image for one blob to edge detect on. I have regions which share boundaries and I need to be as efficient as possible because speed is a bigtime issue.

Can anyone give me some pointers on how to accomplish this? Pseudo code or real code would be awesome

Ideally I can scan line by line building up the outlines of each distinct region simultaneously. But this kind of coding is beyond my skills since I am crappy at math.

Upvotes: 3

Views: 2675

Answers (1)

user180326
user180326

Reputation:

I would try:

It is probably doable to find standard libraries that do the above, and do so efficiently and correctly. After you have this working you can think about optimizations like avoiding detecting an edge twice.

If you need this optimization, my guess is that will have to write this yourself. If you can't, make sure someone is hired who can.

Upvotes: 1

Related Questions