MCPcopy Create free account
hub / github.com/creatale/node-dv / countNonZero_

Function countNonZero_

deps/opencv/modules/core/src/stat.cpp:217–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215
216template<typename T>
217static int countNonZero_(const T* src, int len )
218{
219 int i=0, nz = 0;
220 #if CV_ENABLE_UNROLLED
221 for(; i <= len - 4; i += 4 )
222 nz += (src[i] != 0) + (src[i+1] != 0) + (src[i+2] != 0) + (src[i+3] != 0);
223 #endif
224 for( ; i < len; i++ )
225 nz += src[i] != 0;
226 return nz;
227}
228
229static int countNonZero8u( const uchar* src, int len )
230{

Callers 4

countNonZero16uFunction · 0.85
countNonZero32sFunction · 0.85
countNonZero32fFunction · 0.85
countNonZero64fFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected