MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / FullProf

Function FullProf

jni/stasm/classicdesc.cpp:118–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116// We also use shape for figuring out the direction of the whisker.
117
118static VEC FullProf( // return full profile
119 const Image& img, // in
120 const MAT& shape, // in
121 int ipoint, // in: index of the current point
122 int fullproflen) // in
123{
124 CV_Assert(fullproflen > 1 && fullproflen < 100); // 100 is arb
125 CV_Assert(fullproflen % 2 == 1); // fullprof length must be odd
126
127 VEC fullprof(1, fullproflen);
128
129 double xstep; // x axis dist corresponding to one pixel along whisker
130 double ystep;
131 WhiskerStep(xstep, ystep, shape, ipoint);
132
133 const double x = shape(ipoint, IX); // center point of the whisker
134 const double y = shape(ipoint, IY);
135
136 // number of pixs to sample in each direction along the whisker
137 const int n = (NSIZE(fullprof) - 1) / 2;
138
139 int prevpix = Pix(img,
140 Step(x, xstep, -n-1), Step(y, ystep, -n-1));
141
142 for (int i = -n; i <= n; i++)
143 {
144 const int pix = Pix(img,
145 Step(x, xstep, i), Step(y, ystep, i));
146 fullprof(i + n) = double(pix - prevpix); // signed gradient
147 prevpix = pix;
148 }
149 return fullprof;
150}
151
152static double SumAbsElems( // return the sum of the abs values of the elems of mat
153 const MAT& mat) // in

Callers 2

ClassicProfFunction · 0.85
ClassicDescSearchFunction · 0.85

Calls 4

WhiskerStepFunction · 0.85
NSIZEFunction · 0.85
PixFunction · 0.85
StepFunction · 0.85

Tested by

no test coverage detected