mardi 3 mars 2015

Calculating image gradient

I'll make it short as possible for your convenience. I'm trying calculate the grey value of each pixel of some image's gradient.


To my knowledge, G(x,y) (the pixel x,y in the gradient image) can be calculated in two ways:



1. G(x,y) = sqrt(dx(x,y) * dx(x,y) + dy(x,y) * (dy(x,y))
2. G(x,y) = |dx(x,y)| + |dy(x,y)|


I'm trying to understand how the first one results in a value in [0, 255], for example dx(x,y) = 255, dy(x,y) = 255 will result in ~360, which is undefined in grey scale.


Also, how is the second method defined? what does it mean |dx(x,y)| when dx(x,y) belongs to [0, 255], thus positive?


Thank you!


Aucun commentaire:

Enregistrer un commentaire