MylesMadness
2009-07-04 01:35:02
I was trying to break this captcha and I got this, anyone want to help me get farther?
program New;
var
b: TBitmap;
w, h, i: Integer;
p: TPointArray;
Procedure RemoveTPointFromArray(Index:Integer; Var Arr:TPointArray);
begin
tSwap(Arr[Index], Arr[High(Arr)]);
SetArrayLength(Arr, High(Arr));
end;
Procedure FilterPoints(var p:TPointArray; II, III:Integer);
var
I, x, y, c:Integer;
begin
For I:=0 to high(P)do
begin
C:=0;
for x:= 0 to II do
for y:= 0 to II do
if getcolor(p[I].x-x, p[I].y-y) <> 0 then
Inc(C);
If C > III then
RemoveTPointFromArray(I, P);
end;
end;
begin
b := LoadBitmap('C:\tmp.jpeg');
GetBitmapSize(b, w, h);
SetTargetBitmap(b);
FindColorsTolerance(p, clwhite, 0, 0, w, h, 0);
for i := 0 to High(p) do
FastSetPixel(b, p[i].x, p[i].y, clblack);
FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
FilterPoints(P, 1, 3);
for i := 0 to High(p) do
FastSetPixel(b, p[i].x, p[i].y, clblack);
FindColorsTolerance(p, clwhite, 0, 0, w, h, 441);
for i := 0 to High(p) do
FastSetPixel(b, p[i].x, p[i].y, clred);
DisplayDebugImgWindow(w, h);
SafeDrawBitmap(b, GetDebugCanvas, 0, 0);
FreeBitmap(b);
end.