Beatmup
Kernels::ComputeSquaredL2Metric< 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::ComputeSquaredL2Metric< in_t >

Definition at line 46 of file metric.cpp.

Member Function Documentation

◆ process()

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

Definition at line 48 of file metric.cpp.

52  {
53  in_t in1(bitmap1), in2(bitmap2);
54  result = 0;
55  for (int y = roi1.a.y; y < roi1.b.y; ++y) {
56  in1.goTo(roi1.a.x, y);
57  in2.goTo(roi2.a.x, roi2.a.y + y - roi1.a.y);
58  for (int x = roi2.a.x; x < roi2.b.x; ++x, in1++, in2++) {
59  const auto diff = (in1() - in2()).makeFloat();
60  result += (diff * diff).sum();
61  }
62  }
63  }
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: