Ask Your Question

How to use SIFT with a color inverted image

asked 2013-02-23 02:50:29 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

For example I have two images, where first one is a regular and second one with a color inversion (I mean 255 - pixel color value).

I've applied SIFT algorithm to both of them, so now I have key points and descriptors of each image.

KeyPoints positions do match, but KeyPoints orientations and Descriptors values do not, because of color inversion.

I'm curious do anybody try to solve such a problem?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-02-23 08:30:32 -0500

SR gravatar image

updated 2013-02-24 05:48:56 -0500

The gradients should have the opposite direction. That is, the orientation ori' = (ori + 180) % 360 (assuming that ori is in [0°, 360°]. Most likely the orientation is in [-180°, 180°]; you have to adapt the equation appropriately.)

Following that the resulting SIFT descriptor of the inverted image is a permutation of the original SIFT descriptor. To obtain it you have to swap the descriptor bins of the original bin and the bin associated with the opposite direction. It is probably the easiest to draw it first an sheet of paper to see the effect of gradient inversion.

edit flag offensive delete link more


Do you mean by "gradient direction" keypoint orientation on which descriptor orientation depends? What do you mean by "swap the contents"? We have 8 bins histogram for each 16 regions (8x4x4=128), you mean to switch values of the opposite bins? for example 1st and 5th, 2nd and 6th?

valgussev gravatar imagevalgussev ( 2013-02-23 11:08:49 -0500 )edit

The gradient direction is the direction of the gradients as gradients are defined in their mathematical sense. This then applies to both the orientation assigned to the interest point as well as to the gradients that are interpolated and binned into the SIFT descriptor bins. By "swap the contents" I meant that you effectively have to swap bins. There is no need to recompute the SIFT descriptor a simple permutation of the already compute bins will do.

SR gravatar imageSR ( 2013-02-24 05:41:43 -0500 )edit

thanks for the explanation, but as you can see here gradients are not absolutely opposite

valgussev gravatar imagevalgussev ( 2013-02-24 06:58:08 -0500 )edit

That looks odd indeed. I would first test this on a simple black and white image that only contains simple shapes as a circle, triangles and rectangles.

SR gravatar imageSR ( 2013-02-24 08:49:36 -0500 )edit

Looks the same.. But when I subtract 180 or add 180 (within [0, 360]) looks like , interesting

valgussev gravatar imagevalgussev ( 2013-02-24 09:07:24 -0500 )edit

Question Tools


Asked: 2013-02-23 02:50:29 -0500

Seen: 1,007 times

Last updated: Feb 24 '13