Hello people,
I'm new here and new to java also... My only programming experience is in C, but now I have to do some work in java.
First, the problem is:
My input is an image file that contains different routes from a source to destination. (I have attached the sample input)
My output should be the shortest route highlighted.
________________________________________________________________________
Now, what I've thought of is, the way to find the shortest route is to find the route with the smallest number of black pixels. I know there is some way to return the cooridinates of pixels in java from my research so far.
I thought of traversing the image to find a blue pixel that has an adjacent black pixel to find a road, but then it occurred to me that my roads are obviously made of more than one pixel.
So, how do I differentiate between the roads, and how do I count the pixels in each road?
The highlighting part needs to have an array of all the co-ordinates of black pixels for each road, I would think. Then, according to the result of the count value, I have to change the RGB code for the co-ordinates of the shortest route so far.
Converting all this to java however is the major hurdle, I'm looking up some basic tutorials right now. If anyone could please help me, it would be much appreciated.
Thank you,
Kelvin