• Create Account

opencl and sobel

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

#1giugio  Members   -  Reputation: 207

Like
0Likes
Like

Posted 04 December 2012 - 09:04 AM

hello.
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.

#2Ashaman73  Crossbones+   -  Reputation: 5310

Like
1Likes
Like

Posted 05 December 2012 - 12:49 AM

for understand better the sobel filter:

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:

xxoo
xxoo
xxoo


apply 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.

#3giugio  Members   -  Reputation: 207

Like
0Likes
Like

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.

#4Ashaman73  Crossbones+   -  Reputation: 5310

Like
0Likes
Like

Posted 05 December 2012 - 07:04 AM

It depends on the requirements. What is your goal ? Have you examples of how it should look like ? Not every solution is suitable for all scenarios. E.g. rendering to an higher resolution and sampling it down (super sampling) will have a very good quality, but on the other hand makes the rendering of your scene ~4 times slower, which is often not feasible.

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.

#5giugio  Members   -  Reputation: 207

Like
0Likes
Like

Posted 05 December 2012 - 07:35 AM

my goal is to find edge on images(.jpg or tiff ecc..) taken from the scan of html tables with a border of a pixel.
I use opencl and 4 time slower is not a problem.
What is super sampler ?

#6Ashaman73  Crossbones+   -  Reputation: 5310

Like
0Likes
Like

Posted 05 December 2012 - 08:52 AM

my goal is to find edge on images(.jpg or tiff ecc..)

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 ?

#7giugio  Members   -  Reputation: 207

Like
0Likes
Like

Posted 05 December 2012 - 09:08 AM

my goal is to find edge on images(.jpg or tiff ecc..)

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 ?

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

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS