Which is more computationally efficient: DoG or Sobel + Magnitude

asked 2018-06-03 03:26:14 -0500

sazr gravatar image

I would like to do crude edge detection. Which of the following techniques would be faster/more computationally efficient?

Technique 1:

  • GaussianBlur() image with kernel 5,5.
  • GaussianBlur() image with kernel 11,11.
  • Subtract the 2 images

    • Benefits of this technique; less noise/eliminates smaller/weaker edges. Anything else?
    • Cons of this technique; less accurate

Technique 2:

  • Sobel() image to get horizontal edges
  • Sobel() image to get vertical edges
  • magnitude() to get edge strengths

    • Benefits of this technique; more accurate
    • Cons of this technique; more noise/shows weaker edges
edit retag flag offensive close merge delete


Why don't you try it? It's only a few lines of code. THIS tutorial shows how to time operations.

For best accuracy, create the Mat objects ahead of time, run the operation once, start the timer, run it 1000 times, and stop the timer.

Tetragramm gravatar imageTetragramm ( 2018-06-04 21:52:26 -0500 )edit