From Radon2D to Image

未关闭
#345 33 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
matplotlib, numpy, python
领域
api

调研方向

Start with the pylops.signalprocessing.Radon2D entry point and the coordinate values used in the issue's example. Determine how the reported theta and px values correspond to the spatial image, then explain how to draw the associated line. Done means the coordinate interpretation and line overlay are clear; the issue does not name a test or documentation file.

由索引模型根据 Issue 内容生成。

描述

I have a 2D binary image.
I get the sinogram of this with RADON2D.
Next I want to draw the line corresponding to the maximum value cell in the sinogram over my binary image in the spatial domain.

I get the theta and px values of the max valued cell in the sinogram, but I don't know how to draw the line on the image using these values.

Thank you

import matplotlib.pyplot as plt
import numpy as np
import pylops
plt.close("all")
nt, nh = 80, 200
npx, pxmax = 200, 199
dt, dh = 1, 1
t = np.arange(nt) * dt
h = np.arange(nh) * dh
px = np.linspace(0, pxmax, npx)

x = np.zeros((npx, nt))  # npx: satır: 200,     nt:sütun:80
kk=np.arange(50); 
x[kk+10,kk+15] = 1
kk=np.arange(80);
x[kk+25,8] = 1

RLop = pylops.signalprocessing.Radon2D(t, h, px, centeredh=True, kind="linear", interp=False, engine="numpy")
yL = RLop * x.ravel()
yL = yL.reshape(nh, nt)  # nh: satır: 200,     nt:sütun:80
Max = yL.max(); #print(Max)
xx,yy = np.where(yL==yL.max()); #print("xx:",xx,"  yy:",yy,"   yL[max]:",yL[100][8])
ph, pt = h[xx[0]], t[yy[0]]; #print("ph:",ph,"  pt:",pt)

fig, axs = plt.subplots(1, 2, figsize=(10, 6))
axs[0].imshow(x.T, vmin=-1, vmax=1, cmap="seismic_r", extent=(px[0], px[-1], t[-1], t[0]))
axs[0].set_title("Input model")
axs[0].axis("tight")
axs[1].imshow(yL.T, vmin=-1, vmax=1, cmap="seismic_r", extent=(h[0], h[-1], t[-1], t[0]))
axs[1].set_title("Linear Result")
axs[1].axis("tight")
主要语言
Python
星标
539
派生
126
平均合并
2 天 17 小时
30 天内合并 PR
21

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PyLops/pylops 的其他 Issue

查看 PyLops/pylops 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。