7 #include "MoravecOperator.h"
19 int height = chip.
Lines();
21 std::vector<double> interests;
22 double smallestInterest = 0.0;
25 for(
int offX = -1; offX <= 1; offX++) {
26 for(
int offY = -1; offY <= 1; offY++) {
28 if(offX == 0 && offY == 0)
continue;
30 double interest = 0.0;
31 for(
int y = 2; y <= height - 1; y++) {
32 for(
int x = 2; x <= width - 1; x++) {
35 interest += std::pow(chip.
GetValue(x, y) - chip.
GetValue(x + offX, y + offY), 2);
40 if(interests.size() == 1) {
41 smallestInterest = interest;
43 interests.push_back(interest);
47 for(
unsigned int i = 0; i < interests.size(); i++) {
48 if(interests[i] < smallestInterest) {
49 smallestInterest = interests[i];
52 return smallestInterest;