当前位置: 首页 > news >正文

Python和MATLAB(Java)及Arduino和Raspberry Pi(树莓派)点扩展函数导图

🎯要点

  1. 反卷积显微镜图像算法
  2. 微珠图像获取显微镜分辨率
  3. 基于像素、小形状、高斯混合等全视野建模
  4. 基于探测器像素经验建模
  5. 荧光成像算法模型
  6. 傅里叶方法计算矢量点扩展函数模型
  7. 天文空间成像重建
  8. 二维高斯拟合天体图像
  9. 伽马射线能量和视场中心偏移角
  10. 标量矢量模型
  11. 盲解卷积和深度估计
  12. 测量绘制光源虹膜孔径和峰值
    在这里插入图片描述

Python泽尼克矩

泽尼克多项式被广泛用作图像矩的基函数。由于泽尼克多项式彼此正交,泽尼克矩可以表示图像的属性,且矩之间没有冗余或信息重叠。尽管泽尼克矩很大程度上取决于感兴趣区域中对象的缩放和平移,但其幅度与对象的旋转角度无关。因此,它们可用于从图像中提取描述对象形状特征的特征。例如,泽尼克矩被用作形状描述符,以对良性和恶性乳腺肿块进行分类或振动盘的表面。泽尼克矩还被用于在单细胞水平上量化骨肉瘤癌细胞系的形状。此外,泽尼克矩已用于早期发现阿尔茨海默病,方法是从阿尔茨海默病、轻度认知障碍和健康人群的 MR 图像中提取判别信息。

泽尼克矩是一种图像描述符,用于表征图像中对象的形状。要描述的形状可以是分割的二值图像,也可以是对象的边界(即形状的“轮廓”或“轮廓”)。在大多数应用中,最好使用分割的二值图像而不仅仅是轮廓,因为分割的二值图像不易受噪声影响。

泽尼克矩数学形态

泽尼克矩使用复泽尼克多项式作为矩基组。二维泽尼克矩 Z n m Z_{n m} Znm,阶数 n n n,重复 m m m,在单位圆内的极坐标 ( r , θ ) (r, θ) (r,θ) 中定义为
Z n m = n + 1 π ∫ 0 1 ∫ 0 2 π R m ( r ) e − j m θ f ( r , θ ) r d r d θ , 0 ≤ ∣ m ∣ ≤ n , n − ∣ m ∣ 是偶数  \begin{gathered} Z_{n m}=\frac{n+1}{\pi} \int_0^1 \int_0^{2 \pi} R_m(r) e^{-j m \theta} f(r, \theta) r d r d \theta, 0 \leq|m| \leq n, n-|m| \text { 是偶数 } \end{gathered} Znm=πn+10102πRm(r)ejmθf(r,θ)rdrdθ,0mn,nm 是偶数 
其中 R n m ( r ) R_{n m}(r) Rnm(r) 是泽尼克径向多项式的 n n n 阶,由下式给出
R n m ( r ) = ∑ k = 0 ( n − ∣ m ∣ ) / 2 ( − 1 ) k ( n − k ) ! k ! ⌊ ( n − 2 k + ∣ m ∣ ) / 2 ⌋ ! ⌊ ( n − 2 k − ∣ m ∣ ) / 2 ⌋ ! r n − 2 k \begin{gathered} R_{n m}(r)= \\ \sum_{k=0}^{(n-|m|) / 2}(-1)^k \frac{(n-k)!}{k!\lfloor(n-2 k+|m|) / 2\rfloor!\lfloor(n-2 k-|m|) / 2\rfloor!} r^{n-2 k} \end{gathered} Rnm(r)=k=0(nm)/2(1)kk!⌊(n2k+m)/2⌋!⌊(n2km)/2⌋!(nk)!rn2k
与旋转矩和复矩一样,泽尼克矩的大小在图像旋转变换下是不变的。图像可以使用 M M M 阶矩的集合来重建为
f ( r , θ ) ≈ ∑ n = 0 M ∑ m Z n m R n m ( r ) e j m θ f(r, \theta) \approx \sum_{n=0}^M \sum_m Z_{n m} R_{n m}(r) e^{j m \theta} f(r,θ)n=0MmZnmRnm(r)ejmθ

Python计算泽尼克矩

示例一:

_slow_zernike_poly 函数构造二维泽尼克基函数。在 zernike_reconstruct 函数中,我们将图像投影到 _slow_zernike_poly 返回的基函数上并计算矩。然后我们使用重建公式。

import numpy as np
from math import atan2
from numpy import cos, sin, conjugate, sqrtdef _slow_zernike_poly(Y,X,n,l):def _polar(r,theta):x = r * cos(theta)y = r * sin(theta)return 1.*x+1.j*ydef _factorial(n):if n == 0: return 1.return n * _factorial(n - 1)y,x = Y[0],X[0]vxy = np.zeros(Y.size, dtype=complex)index = 0for x,y in zip(X,Y):Vnl = 0.for m in range( int( (n-l)//2 ) + 1 ):Vnl += (-1.)**m * _factorial(n-m) /  \( _factorial(m) * _factorial((n - 2*m + l) // 2) * _factorial((n - 2*m - l) // 2) ) * \( sqrt(x*x + y*y)**(n - 2*m) * _polar(1.0, l*atan2(y,x)) )vxy[index] = Vnlindex = index + 1return vxydef zernike_reconstruct(img, radius, D, cof):idx = np.ones(img.shape)cofy,cofx = cofcofy = float(cofy)cofx = float(cofx)radius = float(radius)    Y,X = np.where(idx > 0)P = img[Y,X].ravel()Yn = ( (Y -cofy)/radius).ravel()Xn = ( (X -cofx)/radius).ravel()k = (np.sqrt(Xn**2 + Yn**2) <= 1.)frac_center = np.array(P[k], np.double)Yn = Yn[k]Xn = Xn[k]frac_center = frac_center.ravel()npix = float(frac_center.size)reconstr = np.zeros(img.size, dtype=complex)accum = np.zeros(Yn.size, dtype=complex)for n in range(D+1):for l in range(n+1):if (n-l)%2 == 0:vxy = _slow_zernike_poly(Yn, Xn, float(n), float(l))a = sum(frac_center * conjugate(vxy)) * (n + 1)/npixaccum += a * vxyreconstr[k] = accumreturn reconstrif __name__ == '__main__':import cv2import pylab as plfrom matplotlib import cmD = 12img = cv2.imread('fl.bmp', 0)rows, cols = img.shaperadius = cols//2 if rows > cols else rows//2reconst = zernike_reconstruct(img, radius, D, (rows/2., cols/2.))reconst = reconst.reshape(img.shape)pl.figure(1)pl.imshow(img, cmap=cm.jet, origin = 'upper')pl.figure(2)    pl.imshow(reconst.real, cmap=cm.jet, origin = 'upper')

示例二:

我们将学习应用泽尼克矩矩实际识别图像中的对象。我们需要 2 张图像:第一个图像将是我们要检测的对象的参考图像。第二张图像将是一个干扰物图像,其中包含 (1) 我们想要查找和识别的对象,以及 (2) 一堆旨在“迷惑”我们的算法的“干扰物”对象。我们的目标是成功检测第二张图像中的参考图像。

from scipy.spatial import distance as dist
import numpy as np
import cv2
import imutilsdef describe_shapes(image):shapeFeatures = []gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)blurred = cv2.GaussianBlur(gray, (13, 13), 0)thresh = cv2.threshold(blurred, 50, 255, cv2.THRESH_BINARY)[1]thresh = cv2.dilate(thresh, None, iterations=4)thresh = cv2.erode(thresh, None, iterations=2)cnts = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)cnts = imutils.grab_contours(cnts)for c in cnts:mask = np.zeros(image.shape[:2], dtype="uint8")cv2.drawContours(mask, [c], -1, 255, -1)(x, y, w, h) = cv2.boundingRect(c)roi = mask[y:y + h, x:x + w]features = zerni_moments(roi, cv2.minEnclosingCircle(c)[1], degree=8)shapeFeatures.append(features)return (cnts, shapeFeatures)refImage = cv2.imread("pokemon_red.png")
(_, gameFeatures) = describe_shapes(refImage)shapesImage = cv2.imread("shapes.png")
(cnts, shapeFeatures) = describe_shapes(shapesImage)D = dist.cdist(gameFeatures, shapeFeatures)
i = np.argmin(D)for (j, c) in enumerate(cnts):if i != j:box = cv2.minAreaRect(c)box = np.int0(cv2.cv.BoxPoints(box) if imutils.is_cv2() else cv2.boxPoints(box))cv2.drawContours(shapesImage, [box], -1, (0, 0, 255), 2)box = cv2.minAreaRect(cnts[i])
box = np.int0(cv2.cv.BoxPoints(box) if imutils.is_cv2() else cv2.boxPoints(box))
cv2.drawContours(shapesImage, [box], -1, (0, 255, 0), 2)
(x, y, w, h) = cv2.boundingRect(cnts[i])
cv2.putText(shapesImage, "FOUND!", (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9,(0, 255, 0), 3)
cv2.imshow("Input Image", refImage)
cv2.imshow("Detected Shapes", shapesImage)
cv2.waitKey(0)

要查看实际效果,只需执行以下命令:

$ python detect.py

👉更新:亚图跨际

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • Laravel安全应用模块示例教程
  • 【视频讲解】Python贝叶斯卷积神经网络分类胸部X光图像数据集实例
  • 仿华为车机UI--图标从Workspace拖动到Hotseat同时保留图标在原来位置
  • 从监控到智能:EasyCVR视频汇聚平台助力加油站安全监管升级转型
  • 黑神话:游戏的诞生
  • 桥接模式bridge
  • leetcode :746使用最小花费爬楼梯
  • 微软云技术深度解析与实战案例
  • 算法打卡——田忌赛马问题
  • (pycharm)安装python库函数Matplotlib步骤
  • 微服务架构设计模式简要介绍
  • 经验笔记:Spring Boot项目结构
  • Nacos注册中心与OpenFeign远程调用
  • PHP轻量级高性能HTTP服务框架 - webman
  • 【MATLAB】运算符及其优先级
  • 分享的文章《人生如棋》
  • Apache Zeppelin在Apache Trafodion上的可视化
  • CODING 缺陷管理功能正式开始公测
  • Cumulo 的 ClojureScript 模块已经成型
  • FastReport在线报表设计器工作原理
  • Material Design
  • spring + angular 实现导出excel
  • 动态规划入门(以爬楼梯为例)
  • 和 || 运算
  • 机器学习 vs. 深度学习
  • 聊聊sentinel的DegradeSlot
  • 猫头鹰的深夜翻译:JDK9 NotNullOrElse方法
  • 深度学习入门:10门免费线上课程推荐
  • 原创:新手布局福音!微信小程序使用flex的一些基础样式属性(一)
  • 3月27日云栖精选夜读 | 从 “城市大脑”实践,瞭望未来城市源起 ...
  • ​520就是要宠粉,你的心头书我买单
  • #在 README.md 中生成项目目录结构
  • (13):Silverlight 2 数据与通信之WebRequest
  • (19)夹钳(用于送货)
  • (C语言)编写程序将一个4×4的数组进行顺时针旋转90度后输出。
  • (SERIES12)DM性能优化
  • (附源码)springboot工单管理系统 毕业设计 964158
  • (转)JAVA中的堆栈
  • .htaccess配置常用技巧
  • .Net Core与存储过程(一)
  • .Net Redis的秒杀Dome和异步执行
  • .net websocket 获取http登录的用户_如何解密浏览器的登录密码?获取浏览器内用户信息?...
  • .NET导入Excel数据
  • //TODO 注释的作用
  • :“Failed to access IIS metabase”解决方法
  • @ModelAttribute 注解
  • @zabbix数据库历史与趋势数据占用优化(mysql存储查询)
  • [BUUCTF]-PWN:wustctf2020_number_game解析(补码,整数漏洞)
  • [BZOJ] 2006: [NOI2010]超级钢琴
  • [C#]科学计数法(scientific notation)显示为正常数字
  • [CSDN首发]鱿鱼游戏的具体玩法详细介绍
  • [IE技巧] 如何关闭Windows Server版IE的安全限制
  • [Kubernetes]2. k8s集群中部署基于nodejs golang的项目以及Pod、Deployment详解
  • [leetcode 数位计算]2520. 统计能整除数字的位数
  • [leetcode]Search a 2D Matrix @ Python