<commit_before>//
// Created by owain on 03/08/15.
//

#include <math.h>
#include <opencv2/opencv.hpp>
#include "utils/Utils.h"
#include "include/Target.hpp"
#include "include/PersistentTarget.hpp"

using namespace targetfinder;

void PersistentTarget::tick() {
    this->lifetime++;
}

double PersistentTarget::similarity(Target *other) {
    /**
     * Calculate the n-dimensional euclidean distance between this
     * target and another.
     * Looks at center position, target dimensions and angle.
     */
    if(this->lifetime == 0 || !this->calc_alive) {
        return -1.0;
    }
    cv::Rect other_rect = other->rect();
    return sqrt(
            pow((this->x - other_rect.x), 2)
            + pow((this->y - other_rect.y), 2)
            + pow((this->width - other_rect.width), 2)
            + pow((this->height - other_rect.height), 2)
            + pow((this->angle() - other->angle()), 2)
    );
}<commit_msg>removed angle from target similarity calculation<commit_after>//
// Created by owain on 03/08/15.
//

#include <math.h>
#include <opencv2/opencv.hpp>
#include "utils/Utils.h"
#include "include/Target.hpp"
#include "include/PersistentTarget.hpp"

using namespace targetfinder;

void PersistentTarget::tick() {
    this->lifetime++;
}

double PersistentTarget::similarity(Target *other) {
    /**
     * Calculate the n-dimensional euclidean distance between this
     * target and another.
     * Looks at center position, target dimensions and angle.
     */
    if(this->lifetime == 0 || !this->calc_alive) {
        return -1.0;
    }
    cv::Rect other_rect = other->rect();
    return sqrt(
            pow((this->x - other_rect.x), 2)
            + pow((this->y - other_rect.y), 2)
            + pow((this->width - other_rect.width), 2)
            + pow((this->height - other_rect.height), 2)
    );
}
{'fraction_non_alphanumeric': 0.15321701199563795, 'fraction_numerical': 0.015812431842966195, 'mean_word_length': 2.67, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '629144', 'n_tokens_mistral': 616, 'n_tokens_neox': 583, 'n_words': 138}