1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Software edge detection

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

  1. LostInTranslation

    LostInTranslation What's a Dremel?

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

    cheers,
    darren
     
  2. Firehed

    Firehed Why not? I own a domain to match.

    Joined:
    15 Feb 2004
    Posts:
    12,574
    Likes Received:
    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+

    FIBRE+ Minimodder

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

    hitman012 Minimodder

    Joined:
    6 May 2005
    Posts:
    4,877
    Likes Received:
    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. LostInTranslation

    LostInTranslation What's a Dremel?

    Joined:
    1 Jul 2007
    Posts:
    27
    Likes Received:
    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. relix

    relix Minimodder

    Joined:
    14 Nov 2001
    Posts:
    5,948
    Likes Received:
    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. Fod

    Fod what is the cheesecake?

    Joined:
    26 Aug 2004
    Posts:
    5,802
    Likes Received:
    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.
     
  8. OleJ

    OleJ Me!

    Joined:
    1 Jul 2007
    Posts:
    2,024
    Likes Received:
    10
    I often have great luck using the "Magnetic Lasso Tool" in Photoshop... You can tweak it to be very good at edge detection by setting the tool parameters.
     
Tags:

Share This Page