xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/algos/aorb/orb_algos.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 #ifndef _ORB_ALGOS_H_
2 #define _ORB_ALGOS_H_
3 #include "rk_aiq_types_orb_algo.h"
4 
5 typedef  unsigned char  U8 ;
6 typedef  unsigned short U16 ;
7 typedef  unsigned int   U32 ;
8 typedef enum Byte { Uchar = 1, Float = 4, Rgb = 3} Byte;
9 
10 typedef struct point_s {
11     float row;
12     float col;
13 } point_t;
14 
15 typedef struct Mat {
16     void* buffer; //buffer to save the image
17     U16 height;
18     U16 width;
19     U8 channels;
20     Byte bytes;
21 } Mat;
22 
23 typedef struct Node {
24     struct Node* next;
25     void* data;
26 } Node;
27 
28 typedef struct ORBList {
29     struct Node* start;
30     struct Node* end;
31     U16 length;
32     U32 bytes;
33 } ORBList;
34 
35 ORBList* initList(U32 bytes);
36 void resetList(ORBList* list);
37 void freeList(ORBList* list);
38 #if 0
39 int push(ORBList* list, void* data);
40 orb_point_t* init_orbpoint(U16 row, U16 col, bool descriptor[ORB_FEATURE_DESCRIPTOR_BITS]);
41 orb_matched_point_t* init_matchpoints(U16 row1, U16 col1, U16 row2, U16 col2);
42 #endif
43 void freeList(ORBList* list);
44 
45 ORBList* get_roi_points_list (rk_aiq_orb_algo_stat_t* keypoints, orb_rect_t roi);
46 
47 ORBList* matching(ORBList* roi_points_list, rk_aiq_orb_algo_stat_t* keypoints2, orb_rect_t roi);
48 
49 int find_homography_by_four_points(ORBList* matched_keypoints, double homography[9]);
50 int elimate_affine_transform(ORBList* matched_keypoints, double homography[9]);
51 orb_rect_t map_rect(double homography[9], orb_rect_t* rect_src);
52 
53 void work_begin();
54 void work_end(const char* module_name);
55 
56 #endif
57