00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00022
00023 #ifndef _PROGRAM_CU_H
00024 #define _PROGRAM_CU_H
00025 #if defined(CUDA_SIFTGPU_ENABLED)
00026
00027 class CuTexImage;
00028
00029 class ProgramCU
00030 {
00031 public:
00032
00033 static void FinishCUDA();
00034 static int CheckErrorCUDA(const char* location);
00035 static int CheckCudaDevice(int device);
00036 public:
00038 static void CreateFilterKernel(float sigma, float* kernel, int& width);
00039 template<int KWIDTH> static void FilterImage(CuTexImage *dst, CuTexImage *src, CuTexImage* buf);
00040 static void FilterImage(CuTexImage *dst, CuTexImage *src, CuTexImage* buf, float sigma);
00041 static void ComputeDOG(CuTexImage* gus, CuTexImage* dog, CuTexImage* got);
00042 static void ComputeKEY(CuTexImage* dog, CuTexImage* key, float Tdog, float Tedge);
00043 static void InitHistogram(CuTexImage* key, CuTexImage* hist);
00044 static void ReduceHistogram(CuTexImage*hist1, CuTexImage* hist2);
00045 static void GenerateList(CuTexImage* list, CuTexImage* hist);
00046 static void ComputeOrientation(CuTexImage*list, CuTexImage* got, CuTexImage*key,
00047 float sigma, float sigma_step, int existing_keypoint);
00048 static void ComputeDescriptor(CuTexImage*list, CuTexImage* got, CuTexImage* dtex, int rect = 0, int stream = 0);
00049
00050
00051 static void SampleImageU(CuTexImage *dst, CuTexImage *src, int log_scale);
00052 static void SampleImageD(CuTexImage *dst, CuTexImage *src, int log_scale = 1);
00053 static void ReduceToSingleChannel(CuTexImage* dst, CuTexImage* src, int convert_rgb);
00054 static void ConvertByteToFloat(CuTexImage*src, CuTexImage* dst);
00055
00056
00057 static void DisplayConvertDOG(CuTexImage* dog, CuTexImage* out);
00058 static void DisplayConvertGRD(CuTexImage* got, CuTexImage* out);
00059 static void DisplayConvertKEY(CuTexImage* key, CuTexImage* dog, CuTexImage* out);
00060 static void DisplayKeyPoint(CuTexImage* ftex, CuTexImage* out);
00061 static void DisplayKeyBox(CuTexImage* ftex, CuTexImage* out);
00062
00063
00064 static void MultiplyDescriptor(CuTexImage* tex1, CuTexImage* tex2, CuTexImage* texDot, CuTexImage* texCRT);
00065 static void MultiplyDescriptorG(CuTexImage* texDes1, CuTexImage* texDes2,
00066 CuTexImage* texLoc1, CuTexImage* texLoc2, CuTexImage* texDot, CuTexImage* texCRT,
00067 float H[3][3], float hdistmax, float F[3][3], float fdistmax);
00068 static void GetRowMatch(CuTexImage* texDot, CuTexImage* texMatch, float distmax, float ratiomax);
00069 static void GetColMatch(CuTexImage* texCRT, CuTexImage* texMatch, float distmax, float ratiomax);
00070 };
00071
00072 #endif
00073 #endif
00074