opencl and sobel
#1 Members - Reputation: 182
Posted 04 December 2012 - 09:04 AM
I have this problem with sobel filter:
when the sobel filter finds an edge of a line, it finds the initial up edge and the end edge , then,a line in the sobel filter have two edge?.
Is possible to eliminate this behaviour and show only the start edge?
i'm trying to filter some letters in a texture but the words after the sobel filter are enlarged and confused.
for understand better the sobel filter:
The matrix system is a method for gain-time for find the edges?
isn't possible to test pixel for pixel the difference of color of neighbors pixels and see if it's in a range and if it is select the pixel?
it's only a compute method?
thanks.
#2 Members - Reputation: 4606
Posted 05 December 2012 - 12:49 AM
The double line is an effct of the sobel filter. The filter works on a pixel, therefor when sobel detects an edge at a pixel, it will detect it too on the other side too:for understand better the sobel filter:
xxoo xxoo xxooapply sobel on all x
xXoo
xXoo
xXoo
apply soble on all o
xXOo
xXOo
xXOo
There are several solutions:
1. Use the stencil buffer to detect the edge only on parts of the screen, e.g. the x surface only.
2. Use double resolution and scale it down afterwards (or use multisampling).
3. Use an other AA technique to make it less obviously.
Edited by Ashaman73, 05 December 2012 - 12:50 AM.
#3 Members - Reputation: 182
Posted 05 December 2012 - 05:07 AM
The double line is an effct of the sobel filter. The filter works on a pixel, therefor when sobel detects an edge at a pixel, it will detect it too on the other side too:
There are several solutions:
1. Use the stencil buffer to detect the edge only on parts of the screen, e.g. the x surface only.
2. Use double resolution and scale it down afterwards (or use multisampling).
3. Use an other AA technique to make it less obviously.
very thanks Ashaman73,
I see your solutions but i'm a little newbe, can you explain me better a solution? the more simplest or post a link or a book and I study alone.
Thanks for your time
by.
#4 Members - Reputation: 4606
Posted 05 December 2012 - 07:04 AM
Edit:
A fast way to evaluate the AA option is to play around with the AA settings of your video card.
Edited by Ashaman73, 05 December 2012 - 07:06 AM.
#6 Members - Reputation: 4606
Posted 05 December 2012 - 08:52 AM
uggh... well I thought, that you were talking about rendering outlines or something like this. In your case, image analysing, the solutions I sugguested will not work. If performance isn't an issue, have you played around with edge filters of image processing tools like photoshop or gimp ?my goal is to find edge on images(.jpg or tiff ecc..)
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
#7 Members - Reputation: 182
Posted 05 December 2012 - 09:08 AM
uggh... well I thought, that you were talking about rendering outlines or something like this. In your case, image analysing, the solutions I sugguested will not work. If performance isn't an issue, have you played around with edge filters of image processing tools like photoshop or gimp ?
my goal is to find edge on images(.jpg or tiff ecc..)
the performance are not an issue because i use opencl , but my goal is to create template tables and finding with the project after select a new table image, what is the most similar model from the analized(i use c++ and mysql for the models).
Then the performance are a little issue with opencl.
now for starting i would create o adapt a single edge sobel detector.
i found this on canny:
http://dasl.mem.drexel.edu/alumni/bGreen/www.pages.drexel.edu/_weg22/can_tut.html
the third image is a single edge canny.
thanks again






