purerange86
2015-02-02 22:13:30
So right now I'm trying to write a function that will look for objects on shaded tiles of a specific colour. What I'm thinking of doing is finding a TPA of the floor color, filling the gaps, and searching for the object within my filled TPA. How might I do this? Right now I have
However I debugged writeln(ATPA) and it returned the same points as found in the original TPA. What is the proper way to use this function to find the GAPS in the TPA?
Any suggestions is appreciated, whether using this function or not
//function FindGapsTPA(const TPA: TPointArray; MinPixels: Integer): T2DPointArray; (for reference)
function FindObjOnTPA: boolean;
var
TPA, TPA2, NewTPA: TPointArray;
ATPA, ATPA2: T2DPointArray;
begin
FindColorsTolerance(TPA,FloorColor,msx1,msy1,msx2,msy2,FloorTol);
ATPA := FindGapsTPA(TPA,5);
TPA2 := MergeATPA(ATPA);
NewTPA := CombineTPA(TPA,TPA2);
//I want to find a valid NewTPA to search in
end;
However I debugged writeln(ATPA) and it returned the same points as found in the original TPA. What is the proper way to use this function to find the GAPS in the TPA?
Any suggestions is appreciated, whether using this function or not