mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
ORB: Quantize angle and fix rotation
This commit is contained in:
parent
29a93a3c68
commit
24292d4f55
@ -315,6 +315,9 @@ static int comp_angle(image_t *img, kp_t *kp, int *u_max, float *a, float *b)
|
||||
angle += 360;
|
||||
}
|
||||
|
||||
// Quantize angle to 15 degrees
|
||||
angle = angle - (angle % 15);
|
||||
|
||||
*a = cos_table[angle];
|
||||
*b = sin_table[angle];
|
||||
return angle;
|
||||
@ -407,7 +410,7 @@ array_t *orb_find_keypoints(image_t *img, bool normalized, int threshold, rectan
|
||||
#if 1
|
||||
#define GET_VALUE(idx) \
|
||||
(x = (int) roundf(pattern[idx].x*a - pattern[idx].y*b), \
|
||||
y = (int) roundf(pattern[idx].x*b - pattern[idx].y*a), \
|
||||
y = (int) roundf(pattern[idx].x*b + pattern[idx].y*a), \
|
||||
img_scaled.pixels[((kpt->y+y)*img_scaled.w)+(kpt->x+x)])
|
||||
#else
|
||||
#define GET_VALUE(idx) \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user