This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SymEngine | |
class Integer | |
def to_int | |
self.to_s.to_i | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int findMinDist(vector<int> vec1, vector<int> vec2){ | |
float dif = 1000000000; | |
int pos = 0; | |
for(int i=0; i<vec1.size()-6; i++){ | |
float temp2 = 0; | |
for(int j=5; i+j<vec1.size()-5; j++){ | |
temp2 += (vec1[i+j] - vec2[j])*(vec1[i+j] - vec2[j]); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<int> calculateIntegrals(Mat &gray, int _case){ | |
// Calculating integral projections | |
vector<int> integral; | |
// _case 1 : Horizontal Differentiation : Vertical Integration | |
if(_case == 1){ | |
integral.clear(); | |
for (int i = 0; i < gray.cols; i++) { | |
int temp_sum = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat applyFilter(Mat &gray_1, Mat &kernal){ | |
Point anchor = Point (-1,1); | |
double delta = 0; | |
int ddepth = -1; | |
Mat temp; // temporarily store the image | |
Mat gray; // final grayscale image after differentiation | |
// Apply the differential filter |