Beatmup
Kernels::ComputeL1Metric< in_t > Class Template Reference

Static Public Member Functions

static void process (AbstractBitmap &bitmap1, AbstractBitmap &bitmap2, const IntRectangle &roi1, const IntRectangle &roi2, double &result)
 

Detailed Description

template<class in_t>
class Kernels::ComputeL1Metric< in_t >

Definition at line 25 of file metric.cpp.

Member Function Documentation

◆ process()

template<class in_t >
static void Kernels::ComputeL1Metric< in_t >::process ( AbstractBitmap bitmap1,
AbstractBitmap bitmap2,
const IntRectangle roi1,
const IntRectangle roi2,
double &  result 
)
inlinestatic

Definition at line 27 of file metric.cpp.

31  {
32  in_t in1(bitmap1), in2(bitmap2);
33  result = 0;
34  for (int y = roi1.a.y; y < roi1.b.y; ++y) {
35  in1.goTo(roi1.a.x, y);
36  in2.goTo(roi2.a.x, roi2.a.y + y - roi1.a.y);
37  for (int x = roi2.a.x; x < roi2.b.x; ++x, in1++, in2++) {
38  const auto diff = in1() - in2();
39  result += diff.abs().makeFloat().sum();
40  }
41  }
42  }
CustomPoint< numeric > b
Definition: geometry.h:131
CustomPoint< numeric > a
Definition: geometry.h:131
jobject jlong jint jint y
Beatmup::IntPoint result
jobject jlong jint x

The documentation for this class was generated from the following file: