So in my code I am representing an image as a double int[][] array of 1's and 0's. I would like to be able to reduce the image to a smaller int[][] array. This is an example of what I am trying to do:
0000000000
0000000000 00000
0000110000 00100
0000110000 => 00100
0000110000 01110
0000110000 00000
0011111100 00000
0000000000
0000000000
0000000000
Is there any library that can do something like this for me? Or any ideas on how to write the code to do this for me. This would be the method prototype I am looking for:
int[][] reduceImage(int[][] image, double scaleOfReduction) {
// somehow make image reduced
// how to implement this efficiently???
return reducedImage;
}