I am trying to understand how to process images manually. This is a school project, so I won't be able to use ConvolveOp. I am trying to manually do what it does.
From what I have read, the sharpen kernel is this:
-1 -1 -1
-1 9 -1
-1 -1 -1
This would mean that the value of the new pixel would be (9*pixel - sum_of_neighbors)/9. Please correct me if i'm wrong. However I am having problems with this approach. I think it is because of the way in which I get the value of the pixel.
I have tried changing the "kernel" used. But I either obtain a mess of pixels or a red pixels over my original image.
I am clearly doing something terribly wrong. It could be that I am not supposed to use .getRGB or that I do not fully understand how this type of image processing works.
Update :
Thank you for the pointers Steffen. Following your recommendations I created a 3 dimensional array. I used the 3'rd dimension to keep track of rgb values
Thank you for pointing out that mistake.