Ai
3 Star 3 Fork 1

Gitee 极速下载/scikit-image

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/scikit-image/scikit-image
克隆/下载
benchmark_feature.py 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Jarrod Millman 提交于 2023-10-12 14:13 +08:00 . Format with black
# See "Writing benchmarks" in the asv docs for more information.
# https://asv.readthedocs.io/en/latest/writing_benchmarks.html
import numpy as np
from skimage import color, data, feature, util
class FeatureSuite:
"""Benchmark for feature routines in scikit-image."""
def setup(self):
# Use a real-world image for more realistic features, but tile it to
# get a larger size for the benchmark.
self.image = np.tile(color.rgb2gray(data.astronaut()), (4, 4))
self.image_ubyte = util.img_as_ubyte(self.image)
self.keypoints = feature.corner_peaks(
self.image, min_distance=5, threshold_rel=0.1
)
def time_canny(self):
feature.canny(self.image)
def time_glcm(self):
pi = np.pi
feature.greycomatrix(
self.image_ubyte, distances=[1, 2], angles=[0, pi / 4, pi / 2, 3 * pi / 4]
)
def time_brief(self):
extractor = feature.BRIEF()
extractor.extract(self.image, self.keypoints)
def time_hessian_matrix_det(self):
feature.hessian_matrix_det(self.image, 4)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/scikit-image.git
git@gitee.com:mirrors/scikit-image.git
mirrors
scikit-image
scikit-image
main

搜索帮助