# Software edge detection

Discussion in 'Photography, Art & Design' started by LostInTranslation, 15 Jul 2007.

1. ### LostInTranslationWhat's a Dremel?

Joined:
1 Jul 2007
Posts:
27
0
just out of interest, does anyone know how to do this - in photoshop, mathematics, or whatever?

cheers,
darren

2. ### FirehedWhy not? I own a domain to match.

Joined:
15 Feb 2004
Posts:
12,574
16
I don't have the slightest clue how it works, but Photoshop CS3's Quick Select tool does a pretty darn good job of finding edges.

3. ### FIBRE+Minimodder

Joined:
27 Feb 2005
Posts:
1,597
11
I've always just done it manually...

4. ### hitman012Minimodder

Joined:
6 May 2005
Posts:
4,877
19
Wikipedia's article describes technically how it's done. On a basic level, it seems that you would compute the derivative of intensity for each row of pixels, with peaks outside your threshold values corresponding to edges. Obviously it's more complicated than that in real situations, but it's fairly interesting reading if you like that sort of thing.

5. ### LostInTranslationWhat's a Dremel?

Joined:
1 Jul 2007
Posts:
27
0
cool, good way of putting it. I have to say, it does get rather complex

Photoshop does do it well, but I don't know if CS 3 does it any better than CS 2.

Truthfully, I was just pondering what funky AI techniques might be possible with a good edge detection algorithm to hand.

6. ### relixMinimodder

Joined:
14 Nov 2001
Posts:
5,948
41
All you need is a convolution matrix filter using the following matrix:
0, -1, 0
-1, 4, -1
0, -1, 0

That's both horizontal and vertical. Leave out the horizontal -1's or vertical -1's (and replace 4 by 2) and you get vertical or horizontal edge detection respectively. That's a pretty basic implementation however, and possible not up to standards of scientific usage .

7. ### Fodwhat is the cheesecake?

Joined:
26 Aug 2004
Posts:
5,802
133
matlab has some fairly advanced edge detection routines built in. i could go into the maths of how it works, but to be honest, it's not particularly fun.

although suffice to say there are a good few approaches to it.

Joined:
1 Jul 2007
Posts:
2,024