- #1
Curiose
- 18
- 2
For one of my current projects in computer vision (which really is a study in point clustering and tracking in a data stream of n-dimensional data), I have come up with a way to very quickly index a 2D angle between two points or the angle of a vector. Doing a little bit of investigation, and using +/- Infinity, I found a way to get an angle index through two divisions and one subtraction operation only using the position of the two points.
Here is the explanation and a Javascript implementation of the function
https://github.com/newsbubbles/mang
As some of you may know... finding the base angle of any two given points uses trig functions, and I have read people saying that it is impossible to find the angle. I threw radians and other such concepts out of the window as while they are very accurate, they take too long to process for hundreds of point samples at rates higher than 30 samples per second. Besides that, while having the exact angle is very useful for exact calculations, the idea of rotation-translation-size invariant memory (fuzzy memory?) is very important for object recognition or shape categorization in images or video.
This work may have already been done... but I am looking for some feedback and maybe some contributions to the idea. Also, if you know someone else who has already done this, please let me know.
Not sure if the image shows up on github properly, so here is the diagram which explains how I approached the problem...
To put it briefly, by playing with the ratios between the points, I found a repeating pattern in each quadrant which I use to create a quadrant-specific angle index.
Here is the explanation and a Javascript implementation of the function
https://github.com/newsbubbles/mang
As some of you may know... finding the base angle of any two given points uses trig functions, and I have read people saying that it is impossible to find the angle. I threw radians and other such concepts out of the window as while they are very accurate, they take too long to process for hundreds of point samples at rates higher than 30 samples per second. Besides that, while having the exact angle is very useful for exact calculations, the idea of rotation-translation-size invariant memory (fuzzy memory?) is very important for object recognition or shape categorization in images or video.
This work may have already been done... but I am looking for some feedback and maybe some contributions to the idea. Also, if you know someone else who has already done this, please let me know.
Not sure if the image shows up on github properly, so here is the diagram which explains how I approached the problem...
To put it briefly, by playing with the ratios between the points, I found a repeating pattern in each quadrant which I use to create a quadrant-specific angle index.