I want to make a function for calculating the sift descriptors that takes two arguments as input, one is the image and second in the vector of certain points in the image. The output would be the rows of 128 dimensional sift descriptors with each row corresponds to a descriptor of certain point in the image. For the calculations of SIFT descriptors, one needs to crop certain patch around the keypoint (say 32 x 32) and do some image processing stuff (histogram of orientations and all). My question here is that how to deal with the corner pixels in the image. for example if i will give pixel location (1,1) as input to the function, then how to crop the patch or how to do the calculation for the descriptor for such location in the image??
1 Answers
1
votes
As others pointed out in the comments, in image processing, it's a common practice to mirror the image at the boundaries, or sometimes, you can also pad zeros at the boundaries.
If the "vector of certain points" that you're referring to are the "keypoints", then you can use opencv
to extract SIFT features, which returns 128 dimensional feature vector for each keypoint.
You do not have to do the computation of SIFT descriptors explicitly yourself, since OPENCV
provides methods for that as described in SIFT descriptors
BORDER_REFLECT_101
. – Mikir
radius neighbourhood. The bigger ther
(depends on the feature), the larger the amount of pixels which lose information in the image. As an example, for ar = 5
, a5
pixel band around the boundaries of the image will lose information when computing features. To solve this there are the boundary conditions, you can either reflect, set to 0 or wrap the image outside its limits, but the result will be the same, a loss in information. Thus, don't rely too much in the features near the boundaries. – Imanol Luengo