登录
首页 » python » python hog 特征提取

python hog 特征提取

于 2022-04-02 发布 文件大小:1.42 kB
0 141
下载积分: 2 下载次数: 1

代码说明:

import cv2 import numpy as np import math import matplotlib.pyplot as plt class Hog_descriptor(): def __init__(self, img, cell_size=16, bin_size=8): self.img = img self.img = np.sqrt(img / np.max(img)) self.img = img * 255 self.cell_size = cell_size self.bin_size = bin_size self.angle_unit = 360 / self.bin_size # assert type(self.bin_size) == int, "bin_size should be integer," # assert type(self.cell_size) == int, "cell_size should be integer," # assert type(self.angle_unit) == int, "bin_size should be divisible by 360" def extract(self): height, width = self.img.shape gradient_magnitude, gradient_angle = self.global_gradient() gradient_magnitude = abs(gradient_magnitude) cell_gradient_vector = np.zeros((int(height / self.cell_size), int(width / self.cell_size), self.bin_size)) for i in rang

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 求两点互信息
    根据两变量的数据序列来计算两个变量之间的互信息,用的基本思想是histogram法,将两个变量等间距分组,得到其概率密度函数,再带入信息熵公式求解得互信息。
    2022-05-21 00:40:44下载
    积分:1
  • python pip安装命令集合
    【实例简介】
    2021-08-31 00:30:57下载
    积分:1
  • yolov3-master-protorch
    说明:  目前一种快速稳健的卷积神经网络yolov3的代码,在protorch平台上运行(At present, the code of yolov3, a fast and robust convolutional neural network, runs on the platform of protorch)
    2020-02-11 10:55:14下载
    积分:1
  • Python机器学习实践:测试驱动的开发方法
    说明:  Python机器学习实践:测试驱动的开发方法(Python machine learning practice: Test Driven Development Method)
    2020-12-09 19:05:32下载
    积分:1
  • logger
    日志模块,日志记录,适用于所有程序,可直接调用。(Logging module, log recording)
    2020-06-20 19:40:02下载
    积分:1
  • 17.3开运算
    说明:  图像开运算代码实例,可以直接运行,只需修改路径(Examples of image open operation code)
    2019-04-11 20:58:24下载
    积分:1
  • ofdm
    gnuradio下ofdm系统的python实现。包括收发路径,fft变换,标准的ofdm程序。(ofdm system under gnuradio achieve python. Including the transceiver path, fft transform, ofdm standard procedures.)
    2021-03-24 20:49:17下载
    积分:1
  • css_code
    关于压缩感知的一些代码,对初学者有很大的帮助,是一篇文献的仿真(some python code about comprehenssed sensing)
    2014-01-14 13:28:43下载
    积分:1
  • 用FCM对数据集进行分类
    模糊C均值聚类算法,其思想:使得被划分到同一簇的对象之间相似度最大,而不同簇之间的相似度最小。每一个数据都有p个特征,将样本X分为c个模糊组,并求每组的聚类中心。FCM的输入是一个待聚类的数据集,它的输出是一个cxn的模糊划分矩阵U.一个数据集的隶属度的和总等于1. 聚类中心表示的是每个类的平均特征,认为是这个类的代表点。
    2022-08-02 17:52:33下载
    积分:1
  • clang_complete
    clang complete for accurately completing C and C++ code.
    2018-01-16 19:10:07下载
    积分:1
  • 696516资源总数
  • 106783会员总数
  • 25今日下载