-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weighted Triangles for Reducing Search Space #4
Comments
Yeah hashing each triangle 3 times is obviously very wasteful. One thing I could do is just rotate the triangle to only 2 edges instead of 3 (where the 2 edges are randomly chosen) then we can be sure that two matching triangles will have at least one edge in common. |
That is not a bad idea also. Reducing the number of triangles generated per number of keypoints is something that i will have to think about more. The question becomes what specific cases of cropping do you want to not support. When i think of a good idea, i will try my hand at implementing it as a runtime option. A couple really rough ideas that popped into my head:
With those thoughts i see two main categories that need to be addressed: big and small triangles. Big to help find when the image gets shrunk. Small to help find sub-parts of an image like when things get sampled into other images. Then there is the thought of a REALLY big picture, perhaps a medium level of triangles sizes is prudent. Then you enter multiple scale feature detection, which is basically back to just do all the triangles. What a circle to think about..... |
The problem here is that a nearest neighbor might not be the nearest neighbor after affine transformations are applied. In fact if you take any 3 keypoint you can always make any two of those keypoint closer to each other than the other keypoint by applying affine transformations. This makes it really hard to come up with an affine transformation invariant way of describing two keypoints as close to each other. |
There is a solution to the rotation - determine the lightest and darkest corner of the triangle (after applying blur), and make sure the hash is triangle ABC (corner A is lightest, C is darkest) and not BCA or CBA etc. If two of the corners are similar in brightness we double the amount of triangles to scan. Same goes for homogeneous triangles. Another solution to the "exploding triangle problem" is to make sure that two over-lapping triangles should not have more than a certain % of overlap. This way no matter how the triangles are scaled it would still work (affine transformations). One more solution to do this, is to essentially scale the points such that the "nearest neighbors" maintains the same geometry even if affine transformation is applied, such that divisions of those points can be used to form triangles with less redundancy. Th only way this system breaks down is if we introduce projective transformations, otherwise all of the previously mentioned methods will all work. |
Reading through https://news.ycombinator.com/item?id=14973741 Also here are two of my hypothesis in matching images @pippy360 :
In order to use these hypothesis properly, every image with hashes must also have the coordinates of the triangles in order to abstract away their position in relations to other triangles. |
Regarding trianglular Discrete Cosine Transforms https://arxiv.org/pdf/1811.04033.pdf |
I read through the writup you have on github.io and saw that you rotate the triangle onto every edge to make a hash of it. I was thinking that it seems fairly wasteful to have essentially the same triangle multiple times in a database to compare against.
Idea: choose a single rotation for the triangle based on some heuristic
I was originally thinking about choosing the lightest corner of the triangle and always rotate it to the top. As long as there is no crazy color/saturation shifting, i believe this would help reduce the number of hashes that would need to be compared.
The text was updated successfully, but these errors were encountered: