I have a question regarding looping through a table of data but not storing the data in a table; instead, I would like to store the location of a certain piece of data in the table.
What I am working with now is a table of pgm pixel values which are either defined as the number 0 for black and 255 for white. What I am hoping to do with this table is then loop through it and store the location of that pixel, the row and column number, in an array, but only if that pixel displays a value of 255.
I don't have the pgm table with me at the moment so I'll provide this one for an example. To make it simple could you please help me to only log the position of the pixels that display a value of 15? All answers are greatly appreciated :)
P2
# feep.pgm
24 7
15
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0