-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutilities.cpp
42 lines (35 loc) · 867 Bytes
/
utilities.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* utilities.cpp
* imageRegistration
*
* Created by gbohus on 7/14/10.
* Copyright 2010 gbohus. All rights reserved.
*
*/
#include <string>
#include "ppm.h"
#include "utilities.h"
namespace imageRegistration {
std::string transformString(const std::string & s_, const char * tr_)
{
//const char * lastDot = strrchr(s_.c_str(), '.');
//int offSet(0);
//if(lastDot)
// offSet = lastDot - (s_.c_str());
//std::string destination(s_);
//destination.resize(offSet);
//destination += tr_;
//destination += s_.substr(offSet, s_.size() - offSet);
std::string destination(tr_);
destination += s_;
return destination;
}
double absAverageDiff(const double & t0, const double & t1)
{
return std::abs(t0 - t1);
}
double absAverageDiff(const drgb & t0, const drgb & t1)
{
return std::abs(t0.r - t1.r);
}
} //namespace imageRegistration