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:
filtered image 
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
Post a Comment