PDA

View Full Version : Edge detection V2



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.

litoris
10-27-2012, 06:32 PM
reserved
E:
Alright so, we can basically get TPAs of the edges with this? Perhaps we can try to match them with known TPAs, at a tolerance to identify MS objects?

J J
10-27-2012, 07:03 PM
reserved
E:
Alright so, we can basically get TPAs of the edges with this? Perhaps we can try to match them with known TPAs, at a tolerance to identify MS objects?
Yeah this is probably only useful when combining it :P The result is a TPA of where the edges are indeed. Plugin needs to be in C:\Simba\Plugins

litoris
10-27-2012, 07:17 PM
Why don't you work on functions to detect/compare objects? Would be a hell lot more useful :P

Le Jingle
10-27-2012, 08:07 PM
Wow I knew plugins could be a good deal faster, but from 20 seconds -> 15 ms!!! dang!

I'll toy around with it here after the weekend :)

J J
10-27-2012, 10:50 PM
Why don't you work on functions to detect/compare objects? Would be a hell lot more useful :P
Well I wasn't sure what was needed the most but I'll try out some stuff in my updated GOP Script which I'm working on. From the suggestions here or other snippets we might be able to make some more accurate object finding stuff :)


Wow I knew plugins could be a good deal faster, but from 20 seconds -> 15 ms!!! dang!

I'll toy around with it here after the weekend :)
Great :P Plugins are indeed an extreme amount faster!

Flight
10-28-2012, 12:18 AM
You did great J J, this is really impressive. I'd like to use this with zmon's work.

Main
10-28-2012, 12:37 AM
Good job jj!

___
10-28-2012, 02:28 AM
As much as I love it, where would we use this and in what instances is it better than other methods?