user1873073
user1873073

Reputation: 3670

How do filters work in image processing?

I have a sobel edge detector example that uses this algorithm

enter image description here enter image description here

So basically it goes through every pixel and alters its value using the impulse function, b. The filters it uses in the impulse function are:

{{-1, 0, 1},  {{-1,-2,-1},
 {-2, 0, 2},   { 0, 0, 0},
 {-1, 0, 1}}   { 1, 2, 1}}

But why does it use negative numbers on one end of the filter and positive numbers on the other end? I understand using 2 the closer you are to the origin but I don't understand what purpose the negative numbers serve.

Upvotes: 2

Views: 1030

Answers (1)

Raluca
Raluca

Reputation: 280

Sobel filter aims at computing the gradient of an image. It means it has to compute local differences between pixels. That’s way you have negative coefficients: to obtain differences. Further, the edges are detected as regions with a high absolute value of the gradient.

Upvotes: 3

Related Questions