Python OpenCV Sobel [X] or [Y] / Laplace with and without smooth

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
133 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 3, 2011

This is a demonstration of the result and difference comparison between Sobel Y and X, notice how horizontal lines highlighted in one and vertical lines are highlighted on the other ...
Then i show the difference between the noise from laplace with and without the
cv.Smooth function ...

You can process contours in opencv
using the convolution matrix :
Sobel [X] : -1 -2 -1
Sobel [X] : 0 0 0
Sobel [X] : 1 2 1

Sobel [Y] : -1 0 1
Sobel [Y] : -2 0 2
Sobel [Y] : 1 0 1

and

Laplace : -1 -1 -1 OR 0 -1 0
Laplace : -1 8 -1 OR -1 4 -1
Laplace : -1 -1 -1 OR 0 -1 0

You can see some code for convoluting here :
https://github.com/elissonmichael/OpenCV_AND_OR_OpenGL/blob/master/Filtros_Co...

Or you can use OpenCV functions :

cv.Sobel and cv.Laplace
depth of the images should be cv.IPL_DEPTH_16S
so you'll have to use cv.ConvertScaleAbs

I hope it will help someone that is starting with opencv ...

Esse video mostra a diferença entre o filtro de sobel aplicado em x e y, vc pode notar a diferença de realce entre as linhas horizontais e verticais em cada um.
Depois mostrei a diferença da aplicação do filtro de Laplace com e sem a aplicação da função cv.Smooth para suavição e remoção de ruídos.

Vc pode obter esses resultados por convolução, acima vc encontra as matrizes de cada um e um link se quiser ver algum código.

Vc também pode chegar a esses resultados usando as funções do OpenCv
cv.Sobel e cv.Laplace a profundidade deve ser cv.IPL_DEPTH_16S
então vc vai precisar usar cv.ConvertScaleAbs

Espero que isso possa ajudar quem estiver tendo dificuldades

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more