Just wanted to try out again, tried a few times with Tin and seems to work fine, around 15-50ms... No guarantee of anything...
SCAR Code:
Function FindRocks(Color, Tol: Integer; tol_H, tol_S: Extended): TPointArray;
Var
TPA: TPointArray;
L, C, I: Integer;
B: TBox;
TPAA: T2DPointArray;
Begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(tol_H, tol_S);
FindColorsTolerance(TPA, Color, MSX1, MSY1, MSX2, MSY2, tol);
SetColorSpeed2Modifiers(0.2, 0.2);
TPAA := TPAToATPAEx(TPA, 30, 30);
L := High(TPAA);
SetArrayLength(Result, L + 1);
For I := 0 To L Do
If Length(TPAA[i]) < 65 Then
If Length(TPAA[i]) > 10 Then
Begin
B := GetTPABounds(TPAA[i]);
Try
If (Length(TPAA[i]) + 0.001) / ((B.x2 - B.x1) * (B.y2 - B.y1)) < 0.5 Then
Begin
Result[c] := Point((B.x2 + B.x1) shr 1, (B.y2 + B.y1) shr 1);
C := C + 1;
End;
Except End;
End;
SetArrayLength(Result, C);
ColorToleranceSpeed(1);
End;