by ConMan » Thu May 17, 2012 11:40 pm UTC
Are you trying to find something that's nice and matrix-y so that it works quickly in Matlab? Given that you've found the circle, am I right in saying that you have the radius and coordinates of the centre already calculated? In which case, consider the following (matrices are all of the same size and your image):
1. Create X where X[i, j] = i.
2. Create Y where Y[i, j] = j. (I'm pretty sure there are a few ways to create X and Y efficiently)
3. Create C by C = (X - x0) .^ 2 + (Y - y0) .^ 2, where (x0, y0) is the centre of your circle.
4. Create C1 by C1 = (C > r^2), where r is the radius of your circle.
So, what are the values in C1? What can you do with that and your pixel matrix?
If the dimensions of your matrices are quite big, then steps 3 and 4 may be a little prone to overflow errors, in which case changing C to ((X - x0) / r) .^2 + ((Y - y0) / r).^2 and C1 to (C > 1) should work a little better.
pollywog wrote:Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.
I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.