$$ \beginbmatrix 0 & 1 & 0 \ 1 & -4 & 1 \ 0 & 1 & 0 \endbmatrix $$
Compute gradient magnitude and direction using Sobel operator. digital image processing final exam solution
Intensity: ( I = (R+G+B)/3 ) Saturation: ( S = 1 - \frac3R+G+B \min(R,G,B) ) Hue: [ H = \cos^-1\left( \frac0.5[(R-G)+(R-B)]\sqrt(R-G)^2 + (R-B)(G-B) \right) ] Adjust ( H ) if ( B > G ): ( H = 360^\circ - H ). Then scale to [0,1] if needed. $$ \beginbmatrix 0 & 1 & 0 \
Compute the gradient magnitude at the center of a 3x3 pixel region using the Sobel operator. digital image processing final exam solution