Definition at line 20 of file KeypointsLowe.h. References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), PixMax(), and RGB2Intensity(). Referenced by Impala::Application::Src::WindowSrc::HandleNewFrame(). 00022 { 00023 using namespace Impala::Link::LoweSift; 00024 00025 Array2dScalarReal64* rData = 0; 00026 RGB2Intensity(rData, src); 00027 Real64 maxVal = PixMax(rData); 00028 00029 int width = src->CW(); 00030 int height = src->CH(); 00031 Image im = CreateImage(height, width, IMAGE_POOL); 00032 Real64* dataPtr = rData->CPB(); 00033 for (int r = 0; r < height; r++) 00034 for (int c = 0; c < width; c++) 00035 im->pixels[r][c] = *dataPtr++ / maxVal; 00036 delete rData; 00037 00038 LoweKeypoints loweKeypoints; 00039 Keypoint keys = loweKeypoints.GetKeypoints(im); 00040 00041 int nrPoints = 0; 00042 for (Keypoint k = keys; k != NULL; k = k->next) 00043 nrPoints++; 00044 00045 if (!points || (points->CW() != 4) || (points->CH() != nrPoints)) 00046 { 00047 delete points; 00048 points = new Array2dScalarReal64(4, nrPoints, 0, 0); 00049 } 00050 if (!featVecs || (featVecs->CW() != LoweKeypoints::VecLength) || 00051 (featVecs->CH() != nrPoints)) 00052 { 00053 if (doFeatVecs) 00054 { 00055 delete featVecs; 00056 featVecs = new Array2dScalarUInt8(LoweKeypoints::VecLength, 00057 nrPoints, 0, 0); 00058 } 00059 } 00060 00061 int row = 0; 00062 for (Keypoint srcK = keys ; srcK != NULL; srcK = srcK->next) 00063 { 00064 Real64* pointPtr = points->CPB(0, row); 00065 *pointPtr++ = srcK->col; 00066 *pointPtr++ = srcK->row; 00067 *pointPtr++ = srcK->scale; 00068 *pointPtr++ = srcK->ori; 00069 if (doFeatVecs) 00070 { 00071 UInt8* featPtr = featVecs->CPB(0, row); 00072 for (int i = 0; i < LoweKeypoints::VecLength; i++) 00073 *featPtr++ = srcK->ivec[i]; 00074 } 00075 row++; 00076 } 00077 }
Here is the call graph for this function:
|