Skip to content

Instantly share code, notes, and snippets.

@rajithv
rajithv / integer.rb
Created May 18, 2016 15:58
SymEngine::Integer implicit conversion to int
module SymEngine
class Integer
def to_int
self.to_s.to_i
end
end
end
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]);
}
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;
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