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

Function SubProf

jni/stasm/classicdesc.cpp:164–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164static VEC SubProf( // return the profile at given offset within fullprof
165 int offset, // in: offset along whisker in pixels
166 int proflen, // in
167 const VEC& fullprof) // in
168{
169 CV_Assert(proflen > 1 && proflen < 100); // 100 is arb
170 CV_Assert(proflen % 2 == 1); // prof length must be odd
171
172 VEC prof(1, proflen); // the profile at the given offset along whisker
173
174 // copy the relevant part of fullprof into prof
175
176 memcpy(Buf(prof),
177 Buf(fullprof) + offset + NSIZE(fullprof)/2 - NSIZE(prof)/2,
178 NSIZE(prof) * sizeof(prof(0)));
179
180 // normalize prof
181
182 double sum = SumAbsElems(prof);
183 if (!IsZero(sum))
184 prof *= NSIZE(prof) / sum;
185
186 return prof;
187}
188
189VEC ClassicProf( // currently used only when training a new model
190 const Image& img, // in: the image scaled to this pyramid level

Callers 2

ClassicProfFunction · 0.85
ClassicDescSearchFunction · 0.85

Calls 4

BufFunction · 0.85
NSIZEFunction · 0.85
SumAbsElemsFunction · 0.85
IsZeroFunction · 0.85

Tested by

no test coverage detected