I suggest creating an equivalent image in which you define your collision zone with a value of 1, and the area without collisions with a value of 0 (or 0 and 255).
So, you will have two images, colorful that you see, and a collision image that you will upload to.
Then you can find out if you are in the collision zone with:
Bitmap collision; collision = BitmapFactory.decodeStream(...yourImage...); collision.getPixel(x,y)
Another solution is to create two arrays after processing the collision image, you can do this by creating a Java application that processes the original image and creates a text file with two lines, the first line is the x coordinate, and the second line is the y pair.
Then read this file in your Android application, and if your x and y exist in this array, this is the collision point.
source share