View previous topic :: View next topic |
Author |
Message |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Sep 19, 2011 6:40 am Post subject: C# Blob tracking |
|
|
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 |
|
 |
Josheh Expert Cheater
Reputation: 1
Joined: 28 Aug 2011 Posts: 155
|
Posted: Mon Sep 19, 2011 3:49 pm Post subject: |
|
|
So you're trying to draw a rectangle around each item within?
|
|
Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Sep 19, 2011 6:10 pm Post subject: |
|
|
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 |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
Posted: Tue Sep 20, 2011 11:52 pm Post subject: |
|
|
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 |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Wed Sep 21, 2011 8:09 am Post subject: |
|
|
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 |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
|
Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Wed Sep 21, 2011 2:16 pm Post subject: |
|
|
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 |
|
 |
|