java - What am I doing wrong with this 3x3 Mean filter? -


i trying implement mean filter on coloured image android application. when apply filter on chosen image.

the original image:

enter image description here filtered image enter image description here

at each pixel read color value pixels[index], index variable index filtered array, not original image. should reading pixel data @ index x+filterx+width*(y+filtery), , careful @ edges of image.

a bigger problem sums of red, green, , blue never reset 0, means they'll keep accumulating pixel values. should explain discoloring. add:

        sumr = 0;         sumg = 0;         sumb = 0;          (int = 0; < rarray.length; i++) {             sumr += rarray[i];             sumg += garray[i];             sumb += barray[i];         } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -