【发布时间】:2022-01-11 17:09:21
【问题描述】:
为什么我正在处理的图像的强度分布不包括右端?我应该看到 7 个“高峰”,但我没有。
下面是我的代码:
from matplotlib import pyplot as plt
from skimage.measure import profile_line
from skimage.io import imread
start = (0, 714) #Start of the profile line
end = (100, 100) #End of the profile line
#image = imread('....tif') #Read the images
profile = profile_line(image, start, end, linewidth=1, mode='constant') #Take the profile line
fig, ax = plt.subplots(2, 1, figsize=(10, 10)) #Create the figures
ax[0].imshow(image) #Show the film at the top
ax[0].plot(start, end, 'r-', lw=2) #Plot a red line across the film
ax[1].plot(profile)
ax[1].grid()
结果图:
我正在处理的胶卷:
【问题讨论】:
-
试试
start = (100,0)和end = (100,714) -
@Eumel 非常感谢,它似乎有效!
-
你能发两张图片吗?一个是感兴趣的,一个是情节的?你也可以把你的代码变成一个正确的minimal reproducible example吗?例如,您不应该有一个循环来加载多个文件。
-
你愿意使用 numpy 或其他库来完成这项任务吗?它会让你的代码变得无限简单。
-
plt.plot(x, y),但skimage.measure.profile_line(image, start, end)。您绘制的线与您实际在做的不匹配,并且您的开始和结束是不明智的。投票结束是一个错字。