【发布时间】:2020-10-08 06:46:39
【问题描述】:
使用 GeFolki 进行不同卫星数据集的配准我收到以下 ValueError 试图操纵数据。
你能解释一下我做错了什么吗?请帮帮我
from skimage.transform import resize
nx = int(round(dimx/fdecimation))
ny = int(round(dimy/fdecimation))
Mg = resize(Master,(nx, ny),1,'constant')
nsx = int(round(dimxn/fdecimation))
nsy = int(round(dimyn/fdecimation))
Sg = resize(Slave,(nsx, nsy),1,'constant')
# Rank computation and Criterion on images after deximation
from rank import rank_sup as rank_filter_sup
from rank import rank_inf as rank_filter_inf
Mg_rank = rank_filter_inf(Mg, rank) # rank sup : high value pixels have low rank
Sg_rank = rank_filter_inf(Sg, rank)
R=np.zeros((nx-nsx-1,ny-nsy-1));
indices=np.nonzero(Sg_rank);
test2=Sg_rank[indices];
for k in range(0,nx-nsx-1):
for p in range(0,ny-nsy-1):
test1=Mg_rank[k:k+nsx,p:p+nsy];
test1=test1[indices];
test=(test1-test2)**2
R[k,p]=test.mean();
ValueError Traceback (most recent call last)
<ipython-input-24-bebe7595123d> in <module>
17 Sg_rank = rank_filter_inf(Sg, rank)
18
---> 19 R=np.zeros((nx-nsx-1,ny-nsy-1));
20 indices=np.nonzero(Sg_rank);
21 test2=Sg_rank[indices];
ValueError: negative dimensions are not allowed
【问题讨论】:
标签: numpy dimensions valueerror negative-number