in my research for shadering videos, i was wondering if anybody has created an adaption of the Laplace edge algorithm in pixelshader language ?
I had a look to Gimp sources, but really its too much difficult for me…
Sobel shader is good but let a lot of noise in the image. I was wondering about a graphical filter giving birth to lines more elegantely… or other approaches i didn t know…
QUOTE: “However there is a simpler approach that you can use for edge detection. It tends to result in slightly less optimal results, but it only uses one filter (so you skip the addition phase also). This approach is referred to as Laplace.”
I have used Sobel (not realtime) before and was very happy with the results.
Maybe you should denoise your source material first?
SobelEdgeDetection.fx in the girlpower folder does exactly this.
Don’t let the matrices scare you, it just means you also use the values of the surrounding pixels to calculate the new value of the current pixel.
Here’s 2 other matrices that you could try out, that are very similar to Sobel. I have used them a few years ago, when I was kind of ‘reinventing’ Sobel’s algorhythm :)
0 -2 0
-2 0 2
0 2 0
0 2 0
2 0 -2
0 -2 0
This basically means, the current pixel is replaced by:
(-2 times the pixel to the left) + (-2 times the pixel above) + (2 times the pixel to the right) + (-2 times the pixel below)