J J
10-27-2012, 06:27 PM
V1: http://villavu.com/forum/showthread.php?t=85683
I've now made a plugin which makes it a hell of a lot times faster! It used to be around 20 seconds and it is now 15 ms for the mainscreen :)
http://img145.imageshack.us/img145/6237/edgedetection.png
Added the dll with source as an attachment.
Usage:
procedure Edges;
var
Colors: TIntegerArray;
Edge: TPointArray;
begin
writeln(GetSystemTime);
Colors := GetColorsBox(MSX1, MSY1, MSX2, MSY2, false);
Edge := GetEdges(Colors, MSX1, MSY1, MSX2, MSY2, 5);
writeln(GetSystemTime);
SMART_DrawDotsEx(True, Edge, clRed);
end;
A threshold of around 20 seems to work pretty well but it depends where you are using it. I'm not sure about the uses, I originally looked into edge detection to make a solver for the Leo random. But since random events have been removed I personally don't have a use at this moment. Let me know if you have something to use this for :)
Credits to
http://villavu.com/forum/showthread.php?t=41311
http://villavu.com/forum/showthread.php?t=58815
http://villavu.com/forum/showthread.php?t=78465
Other posters at the first version to give me the idea to make a plugin.
I've now made a plugin which makes it a hell of a lot times faster! It used to be around 20 seconds and it is now 15 ms for the mainscreen :)
http://img145.imageshack.us/img145/6237/edgedetection.png
Added the dll with source as an attachment.
Usage:
procedure Edges;
var
Colors: TIntegerArray;
Edge: TPointArray;
begin
writeln(GetSystemTime);
Colors := GetColorsBox(MSX1, MSY1, MSX2, MSY2, false);
Edge := GetEdges(Colors, MSX1, MSY1, MSX2, MSY2, 5);
writeln(GetSystemTime);
SMART_DrawDotsEx(True, Edge, clRed);
end;
A threshold of around 20 seems to work pretty well but it depends where you are using it. I'm not sure about the uses, I originally looked into edge detection to make a solver for the Leo random. But since random events have been removed I personally don't have a use at this moment. Let me know if you have something to use this for :)
Credits to
http://villavu.com/forum/showthread.php?t=41311
http://villavu.com/forum/showthread.php?t=58815
http://villavu.com/forum/showthread.php?t=78465
Other posters at the first version to give me the idea to make a plugin.