我有一个numpy数组,其中包含一些图像数据(ch4_out)。现在,我想提取沿着特定线(水平)的强度分布。我正在使用skimage模块中的profile_line
函数来执行此操作,但我遇到了错误。我正在寻求一些帮助来解决我的代码。
显示的错误为
order = _validate_interpolation_order(image.d类型,顺序)
# reading multiple images
S01=[i for i in
glob.glob("C:/Users/experiment/S01/*.tif")]
# Averaging images
ch4=np.array([np.array(Image.open(fname)) for fname in
S01])
ch4_avg=np.array(np.mean(ch4,axis=(0)),dtype=np.uint16)
ch4_out=Image.fromarray(ch4_avg) # image data as numpy array
#plotting figure
plt.figure()
plt.subplot(1,2,1)
plt.imshow(ch4_out,cmap='gray',interpolation='none')
#code works fine until this point
#Now, extract intensity profile at pixel along horizontal line x (2 to 1000) at a height in vertical direction of 730
pixels
p = profile_line(ch4_out, (2, 1000), (730, 730))
# coordinates for horizontal (2,1000) and vertical
(730,730))
plt.imshow(p)
plt.show()
1条答案
按热度按时间n6lpvg4x1#
这是我使用的解决方案,