数字图像处理
文章平均质量分 64
MarkJhon
这个作者很懒,什么都没留下…
展开
-
图谱滤波(Graph Spectral Processing)-1
时域和空域信号的滤波是图像处理的基本技术之一,迄今已得到广泛的研究。Graph Spectral Processing(GSP)可以处理不规则结构的信号,这些信号在数学上用图形表示。利用谱图理论研究了图信号滤波的理论和方法。在图像处理中,图是表示像素形成的结构的强有力工具,如边和纹理。图信号的滤波不仅是对标准时域和空域信号滤波的扩展,而且具有自身的性质特点。例如,GSP可以将传统的基于像素的图像滤波方法表示为图谱域滤波器。原创 2023-10-04 09:09:07 · 274 阅读 · 0 评论 -
注意力机制学习:Multi-Head Attention
多头注意力机制(Mutil-head Attention):多头注意( Multihead Attention )是注意机制模块。实现:通过一个注意力机制的多次并行运行,将独立的注意力输出串联起来,线性地转化为预期维度。直观看来,多个注意头允许对序列的不同部分进行注意力运算。其中,都是可学习的参数矩阵。注:缩放点积注意力(Scaled dot-product attention)在这个模块中很常用的,同时也可以将其换为其他类型的注意力机制。import numpy...原创 2021-10-04 15:29:59 · 3620 阅读 · 0 评论 -
GAN in action: Implement Autoencoder
使用Tensorflow和keras构建自编码器Let's get started!Define some key variables.Define sampling helper function.Define the encoder.Define the decoder.Define the Variational Autoencoder(VAE).Define the loss and run our model.Load Mnist Dataset.Generate new image .Let’原创 2020-12-09 17:01:57 · 162 阅读 · 0 评论 -
目标检测面试:IOU计算+mAP计算(Python+pytorch计算实现)
def iou(boxA, boxB): #计算重合部分的上下左右4个边的值,注意最大最小函数的使用 left_max = max(boxA[0], boxB[0]) top_max = max(boxA[1], boxB[1]) right_min = min(boxA[2], boxB[2]) bottom_min = min(boxA[3], boxB[3]) #计算重合部分面积 inter = max(0, (right_min-left_m.原创 2020-12-02 09:08:57 · 2772 阅读 · 4 评论 -
注意力机制热力图可视化
import tensorflow as tfimport numpy as npimport cv2def visualize_attention_map(attention_map): """ The attention map is a matrix ranging from 0 to 1, where the greater the value, the greater attention is suggests. :param attention_map.原创 2020-12-01 13:11:51 · 19749 阅读 · 7 评论 -
Tensorflow如何使用GPU训练(笔记)
Tensorflow和tf.keras 模型可以在单个GPU上透明运行,而无需更改。注意:(1)需要使用tf.config.experimental.list_physical_devices('GPU')确认使用的tensorflow可以使用GPU。(2)在一台机器上运行多个GPU,或者在多台机器上运行,最简单的方法是使用分布策略。确保你的机器已经安装TensorflowGPU版。import tensorflow as tfprint("Num GPUs Available: ",原创 2020-07-12 18:33:03 · 37750 阅读 · 3 评论 -
YoloV3使用k-means聚类产生矛框大小(以VOC数据集为例)
import matplotlib.pyplot as pltimport numpy as npimport os, cv2%matplotlib inlineLABELS = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable','dog', 'ho.原创 2020-07-12 16:06:01 · 3103 阅读 · 3 评论 -
目标检测:获得类别信息
from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionfrom __future__ import unicode_literalsimport osimport sysimport numpy as npfrom .coco_eval import bbox2outimport logginglogger = logging.原创 2020-07-10 14:43:36 · 664 阅读 · 0 评论 -
目标检测:绘制mask和bbox
from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionfrom __future__ import unicode_literalsimport numpy as npfrom PIL import Image, ImageDrawfrom .colormap import colormap__all__ = ['visualiz.原创 2020-07-10 14:39:21 · 1807 阅读 · 0 评论 -
设置颜色图
from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionfrom __future__ import unicode_literalsimport numpy as npdef colormap(rgb=False): """ Get colormap """ color_list = np.array(.原创 2020-07-10 14:20:46 · 393 阅读 · 0 评论 -
目标检测:交并比计算和bbox回归操作
from __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionimport loggingimport numpy as npimport paddle.fluid as fluid__all__ = ["bbox_overlaps", "box_to_delta"]logger = logging.getLogger(__name__.原创 2020-07-10 08:04:22 · 887 阅读 · 0 评论 -
python环境下opencv学习(1)
检测opencv是否安装"""测试opencv是否安装"""# 导入opencvimport cv2#使用函数cv2。imread()读入图像#图像应该在工作目录中,或者提供全路径image = cv2.imread("logo.png")#使用cv2.cvtColor()转变图像格式# In this case we use cv2.cvtColor() to conve...原创 2020-05-06 09:09:46 · 237 阅读 · 0 评论 -
数字图像处理—学习日记(2):图像直方图及均衡化
基本的图像处理操作交互式标注使用PyLab库ginput()函数进行交互式标注。下面展示代码,脚本首先绘制图像,然后等待用户在图像窗口图像区域点击三次,点击得到的坐标【x, y】自动保存在x列表中。from PIL import Imagefrom pylab imprt *im = array(Image.open('example.jpg'))imshow(im)print...原创 2020-03-28 10:29:55 · 335 阅读 · 0 评论 -
数字图像处理—学习日记(2):基本的图像操作和处理
使用Matplotlib进行基本图像操作Matplotlib介绍绘制图像、点和线图像轮廓和直方图Matplotlib介绍Matplotlib类库可以进行数字运算,绘制图表,绘制点,直线和曲线等等。绘制图像、点和线用几个点和一条线绘制图像:from PIL import Imagefrom pylab import *#读取图片到数组im = array(Image.open('e...原创 2020-03-27 21:28:31 · 289 阅读 · 0 评论 -
数字图像处理—学习日记(1):简单的图像读写,转换操作,通过python
1 PIL:python图像处理库(1)PIL最重要的模块为Image,读取一张图像。from PIL import Imagepil_im = Image.open('example.jpg')(2)对读入的图像进行转换,使用Convert()方法pil_im = Image.open('example.jpg').convert(‘L’)2 对图像格式进行转...原创 2020-03-27 20:52:55 · 321 阅读 · 0 评论