Welcome, Guest. Please login or register.

Author Topic: Help needed with a very silly idea...  (Read 8421 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show all replies
Re: Help needed with a very silly idea...
« on: January 20, 2005, 05:48:56 AM »
Why not take a 2D FFT and the corrolate that against a series of FFTs of every conceivable shape and then ...
Hmmmm.
Your way is probably faster and more possible in a finite amount of time.
 

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show all replies
Re: Help needed with a very silly idea...
« Reply #1 on: January 20, 2005, 05:58:03 AM »
Thinks a bit more...

Are these areas allowed to be "hollow" e.i. can they enclose a set of out of range pixels?

And how do you start looking? Do you start in the shape, as if you were doing a paint fill, or are you just looking for pixels that satisfy the criteria within the entire pixmap?
(So, could there be more than one match.)


And, if you scan one way, haven't you already scanned the other? Really?
Like if you walk the Ys and you know the x where you hit the good stuff and the x where you left.

And you could get faster if you took those start and ends and went straight down from there to the next Y
and if you are on the right side (for e.g.) and you go down and your pixel is in range, then go right further to find the edge, else go left.
For the other side, vice versa. If your left and right get to be the same, you've closed out the bottom.
Then from your starting Y go back up the same way to close your top.
 

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show all replies
Re: Help needed with a very silly idea...
« Reply #2 on: January 20, 2005, 06:00:52 AM »
re-reading, I see you've answered one of my questions.

Anyway, I don't think what I said would catch convex shapes coz you'd have to go back on yourself when they fold, but it's pretty close to a generic fill algo and there's a bunch of them around.
The amount of time it takes to finish depends upon the shape, but your method should be the same amount of time for anything.
 

Offline FluffyMcDeath

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 3440
    • Show all replies
Re: Help needed with a very silly idea...
« Reply #3 on: January 20, 2005, 06:01:36 AM »
By the way, I should thank you for helping me boost my post count which has been languishing of late.