• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Bitmap Edge Detection

## Recommended Posts

VisualB4BigD    122
I want to be able to take a picture and find all of the edges in it. Is there a fomula to do this? I sure hope this world isn''t one big joke, because I don''t get it.

##### Share on other sites
stevenmarky    369
This seems like a pretty complex problem to me, and if I understand you quickly it will most likely detect edges where there are (large) differences in the brightness of 2 or more pixels that are ..
One way would just to do this, scroll though pixel by pixel and compare it to all adjacent pixels, if the difference in brightness is greater than 50%, its an edge.
This isnt a pretty algorithm and you''ll probably have to modify the 50%, or how many pixels it compares to (it could compare to a group of pixels depending of their average brighness, it could get real messy).
in pseudocode (im lazy ):
for (int picSearch=0; {for (int x=-1; x<2; x++) for (int y=-1; y<2; y++)  if ((picture[picsearch].brightness-picture[picsearch+x][picsearch+y])> thenthisisedge}

I dont know much about this, but it was an interesting question and no-one else answered..sorry for my messy psuedo code, i wonder how it looks with formating?
Well its the thought/idea that counts