Statistics
| Branch: | Revision:

root / rgbdslam / external / siftgpu / src / SiftGPU / SiftMatchCU.h @ 9240aaa3

History | View | Annotate | Download (2.13 KB)

1
////////////////////////////////////////////////////////////////////////////
2
//        File:                SiftMatchCU.h
3
//        Author:                Changchang Wu
4
//        Description :        interface for the SiftMatchCU
5
////
6
//        Copyright (c) 2007 University of North Carolina at Chapel Hill
7
//        All Rights Reserved
8
//
9
//        Permission to use, copy, modify and distribute this software and its
10
//        documentation for educational, research and non-profit purposes, without
11
//        fee, and without a written agreement is hereby granted, provided that the
12
//        above copyright notice and the following paragraph appear in all copies.
13
//        
14
//        The University of North Carolina at Chapel Hill make no representations
15
//        about the suitability of this software for any purpose. It is provided
16
//        'as is' without express or implied warranty. 
17
//
18
//        Please send BUG REPORTS to ccwu@cs.unc.edu
19
//
20
////////////////////////////////////////////////////////////////////////////
21

    
22

    
23

    
24
#ifndef CU_SIFT_MATCH_H
25
#define CU_SIFT_MATCH_H
26
#if defined(CUDA_SIFTGPU_ENABLED)
27

    
28
class CuTexImage;
29
class SiftMatchCU:public SiftMatchGPU
30
{
31
private:
32
        //tex storage
33
        CuTexImage _texLoc[2];
34
        CuTexImage _texDes[2];
35
        CuTexImage _texDot;
36
        CuTexImage _texMatch[2];
37
        CuTexImage _texCRT;
38

    
39
        //programs
40
        //
41
        int _max_sift; 
42
        int _num_sift[2];
43
        int _id_sift[2];
44
        int _have_loc[2];
45

    
46
        //gpu parameter
47
        int _initialized;
48
        vector<int> sift_buffer; 
49
private:
50
        int  GetBestMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm);
51
public:
52
        SiftMatchCU(int max_sift);
53
        virtual ~SiftMatchCU(){};
54
        void InitSiftMatch();
55
        void SetMaxSift(int max_sift);
56
        void SetDescriptors(int index, int num, const unsigned char * descriptor, int id = -1);
57
        void SetDescriptors(int index, int num, const float * descriptor, int id = -1);
58
        void SetFeautreLocation(int index, const float* locatoins, int gap);
59
        int  GetSiftMatch(int max_match, int match_buffer[][2], float distmax, float ratiomax, int mbm);
60
        int  GetGuidedSiftMatch(int max_match, int match_buffer[][2], float H[3][3], float F[3][3],
61
                                                                         float distmax, float ratiomax, float hdistmax, float fdistmax, int mbm);
62
    //////////////////////////////
63
    static int  CheckCudaDevice(int device);
64
};
65

    
66
#endif
67
#endif
68