From Radon2D to Image

Đang mở
#345 33 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
matplotlib, numpy, python
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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")
Ngôn ngữ chính
Python
Star
539
Fork
126
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PyLops/pylops

Tất cả issue của PyLops/pylops

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.