SRL Archive - SRL Snippets

Edge detection V2


J J

2012-10-27 14:27:22

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 :)


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

2012-10-27 14:32:49

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

2012-10-27 15:03:15

From: litoris
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

2012-10-27 15:17:11

Why don't you work on functions to detect/compare objects? Would be a hell lot more useful :P

Le Jingle

2012-10-27 16:07:16

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

2012-10-27 18:50:06

From: litoris
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 :)

From: Le Jingle
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

2012-10-27 20:18:23

You did great J J, this is really impressive. I'd like to use this with zmon's work.

Main

2012-10-27 20:37:31

Good job jj!

___

2012-10-27 22:28:34

As much as I love it, where would we use this and in what instances is it better than other methods?