bbri06
2010-05-23 20:46:24
So I have a function that is supposed to check density of colors and the problem is I get results such as
I don't really have the slightest clue what that means or what to do with it. Is E supposed to be Euler's number?
0.0000000000000000E+0000
I don't really have the slightest clue what that means or what to do with it. Is E supposed to be Euler's number?
Function CheckDensity(TPA: TPointArray; Min, Max: Extended): boolean;
var
PB, Bounds: TBox;
RTPA: TPointArray;
Density : Extended;
begin
DebugTPA(TPA, '');
PB := GetTPABounds(TPA);
FindColorsTolerance(RTPA, URockAC, PB.x1 - 5, PB.y1 - 5, PB.x2 + 5, PB.y2 + 5, 20);
if(Length(RTPA) > 0)then
begin
Bounds := GetTPABounds(RTPA);
Density := (Length(TPA))/((Bounds.x2 - Bounds.x1) * (Bounds.y2 - Bounds.y1));
Writeln(Density);
if(Density > Min)and(Density < Max)then
Result := True
else
Result := False;
end;
end;