python类correlate2d()的实例源码

MyImage_class.py 文件源码 项目:DenoiseAverage 作者: Pella86 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def correlate(self, image):
        ''' scipy correlate function. veri slow, based on convolution'''
        corr = signal.correlate2d(image.data, self.data, boundary='symm', mode='same')
        return Corr(corr)
wsola.py 文件源码 项目:sprocket 作者: k2kobayashi 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def _search_minimum_distance(self, ref, buff):
        if len(ref) < self.fl:
            ref = np.r_[ref, np.zeros(self.fl - len(ref))]

        # slicing and windowing one sample by one
        buffmat = view_as_windows(buff, self.fl) * self.win
        refwin = np.array(ref * self.win).reshape(1, self.fl)
        corr = correlate2d(buffmat, refwin, mode='valid')

        return np.argmax(corr) - self.sl
numpy_extensions_tutorial.py 文件源码 项目:tutorials 作者: pytorch 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def forward(self, input, filter):
        result = correlate2d(input.numpy(), filter.numpy(), mode='valid')
        self.save_for_backward(input, filter)
        return torch.FloatTensor(result)
find_template_1D.py 文件源码 项目:CV-lecture-quizzes-python 作者: pdvelez 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def find_template_1D(t, s):
    c = sp.correlate2d(s, t, mode='valid')
    raw_index = np.argmax(c)
    return raw_index
find_template_2D.py 文件源码 项目:CV-lecture-quizzes-python 作者: pdvelez 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def find_template_2D(template, img):
    c = sp.correlate2d(img, template, mode='same')

    # These y, x coordinates represent the peak. This point needs to be
    # translated to be the top-left corner as the quiz suggests
    y, x = np.unravel_index(np.argmax(c), c.shape)
    return y - template.shape[0] // 2, x - template.shape[1] // 2
ff11.py 文件源码 项目:extract 作者: dblalock 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def _dotProdsWithAllWindows(x, X):
    """Slide x along the columns of X and compute the dot product"""
    return sig.correlate2d(X, x, mode='valid').flatten()
ff10.py 文件源码 项目:extract 作者: dblalock 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def dotProdsWithAllWindows(x, X):
    """Slide x along the columns of X and compute the dot product

    >>> x = np.array([[1, 1], [2, 2]])
    >>> X = np.arange(12).reshape((2, -1))
    >>> dotProdsWithAllWindows(x, X) # doctest: +NORMALIZE_WHITESPACE
    array([27, 33, 39, 45, 51])
    """
    return sig.correlate2d(X, x, mode='valid').flatten()
extract.py 文件源码 项目:extract 作者: dblalock 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def _dotProdsWithAllWindows(x, X):
    """Slide x along the columns of X and compute the dot product"""
    return sig.correlate2d(X, x, mode='valid').flatten()


问题


面经


文章

微信
公众号

扫码关注公众号