Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# Blob tracking

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Sep 19, 2011 6:40 am    Post subject: C# Blob tracking Reply with quote

I started working on a project for blob trackiing using a euclidean filter. I know aforge can do this but i wanted to make everything from scratch.

Iv come near to the end and im stuck on something. Math isnt my strong point. I need to calculate the corners using the coordinates, i have every pixels xy. I have no idea how to do this. Anyone?
Circles are easy but for odd shapes im clueless.
Heres a pic showing some odd shapes but iv got it set up to only mark the centre.

As you can see, id beable to draw a rectangle around some of the shapes but not all.

I'll probably sign up to aforge and ask them too but i know CE members have an interest in lots of things, maybe someone has some experience with this.

_________________
Back to top
View user's profile Send private message
Josheh
Expert Cheater
Reputation: 1

Joined: 28 Aug 2011
Posts: 155

PostPosted: Mon Sep 19, 2011 3:49 pm    Post subject: Reply with quote

So you're trying to draw a rectangle around each item within?
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Mon Sep 19, 2011 6:10 pm    Post subject: Reply with quote

Something maybe like this.


Maybe im looking at this the wrong way. I'll go read up on edge detection and see if i can trace around objects instead. That might look better.
Like this pic

_________________
Back to top
View user's profile Send private message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Tue Sep 20, 2011 11:52 pm    Post subject: Reply with quote

Math? Take minimum X,Y and maximum X,Y and draw a rectangle...
You can do this either with recursion and mark visited pixels, or an iterative solution which may or may not be as efficient, depending on how you choose to implement it.

_________________
SharpDisassembler

"When I find my code in tons of trouble,
Friends and colleagues come to me...
Speaking words of wisdom:
Write in C."


#pragma message("Let there be byte!")
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Wed Sep 21, 2011 8:09 am    Post subject: Reply with quote

No not a rectangle. I can do that with my current setup or draw a circle around circular shapes.

An example odd shape would be a diamond. Id like to trace around it instead of using a rectangle.

I'll put this part of the code on hold for now.
Im gonna optimize the merging code first and come back to this. But im still open to suggestions.

_________________
Back to top
View user's profile Send private message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Wed Sep 21, 2011 10:56 am    Post subject: This post has 1 review(s) Reply with quote

You can use an edge filter:
http://en.wikipedia.org/wiki/Edge_detection
http://www.codeproject.com/KB/cs/Canny_Edge_Detection.aspx
http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx
It is recommended to convert the image to grayscale for such operations.

_________________
SharpDisassembler

"When I find my code in tons of trouble,
Friends and colleagues come to me...
Speaking words of wisdom:
Write in C."


#pragma message("Let there be byte!")
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Wed Sep 21, 2011 2:16 pm    Post subject: Reply with quote

Thanks for the link but iv read them all and iv already got those apps.

All the adge detectors or blob trackers say to convert to grayscale or binary first.
But the way im doing it is reading it without converting. I figured if i can read the bitmap as a binary and with the background removed without converting, that'l save some time.
The euclidean filter removes anything i dont want to read.

I'll look for it in the aforge source later, i know it has this option. But the source is alittle hard to read. Its clean but all over the place.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites