|
Re: How to filter the points to get only the left most and right most?
I'm not sure of your data, it looks like a series of X, Y, VALUE triples.
How about something like this ...
upperleft_y = first value of Y
upperleft_x = first value of X
lowerright_y = first value of Y
lowerright_x = first value of X
As you iterate through the remaining points X,Y,VALUE in your data:
if (X < upperleft_x) AND (Y < upperleft_y)
upperleft_x = X;
upperleft_y = Y;
if (X > lowerright_x) AND (Y > lowerright_y)
lowerright_x = X;
lowerright_y = Y;
If each line of your .PGM represents one image, then repeat the above for each line and store the resulting upperleft and lowerright X,Y pairs in your corners[] array.
mike
|