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
// Written by Nadav Benedek 2017 | |
#include "SparseConnectedComponents.h" | |
#include <iostream> | |
#include "opencv2/opencv.hpp" | |
SparseConnectedComponents::SparseConnectedComponents() { | |
} |
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
# Written by Nadav Benedek | |
import numpy as np | |
from numba import jit, autojit | |
import scipy | |
@jit(nopython=True) | |
def approx_sinc_interp(x, s, u): | |
MAX_ELEMENTS_TO_TAKE_EACH_SIDE = 20 # Change this number to change the accuracy | |
result = np.empty(len(u)) | |
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
def sinc_interp(x, s, u): | |
""" | |
Interpolates x, sampled at "s" instants | |
Output y is sampled at "u" instants ("u" for "upsampled") | |
""" | |
if len(x) != len(s): | |
raise Exception, 'x and s must be the same length' | |
NewerOlder