Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: arrays used as indices must be of integer (or boolean) type #6

Open
pietrso opened this issue Oct 4, 2022 · 0 comments

Comments

@pietrso
Copy link

pietrso commented Oct 4, 2022

I am trying to run the example OPTIC to RADAR registration (line 54 of main.py) but when running GEFOLKI (line 71 of main.py) I get error:


IndexError Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 u, v = GEFolki(Iradar, Ioptique, iteration=2, radius=range(32, 4, -4), rank=4, levels=6)
3 N = np.sqrt(u2+v2)
4 pl.figure()

File /srv/conda/envs/env_snap/lib/python3.8/site-packages/gefolki/pyramid.py:32, in BurtOF.call(self, I0, I1, **kparams)
30 kparams['uinit'] = u
31 kparams['vinit'] = v
---> 32 u, v = self.flow(Py0[i], Py1[i], **kparams)
33 if i > 0:
34 col, row = Py0[i-1].shape[1], Py0[i-1].shape[0]

File /srv/conda/envs/env_snap/lib/python3.8/site-packages/gefolki/folki.py:130, in GEFolkiIter(I0, I1, iteration, radius, rank, uinit, vinit)
128 toto = toto*255
129 toto = toto.astype(np.uint8)
--> 130 H0 = equalize_adapthist(toto, 8, clip_limit=1, nbins=256)
132 if res_x > 0 or res_y > 0:
133 H0 = resize(H0, (y, x), order=1)

File /srv/conda/envs/env_snap/lib/python3.8/site-packages/gefolki/adapthist.py:82, in equalize_adapthist(image, ntiles_x, ntiles_y, clip_limit, nbins)
80 image = skimage.img_as_uint(image)
81 args[0] = rescale_intensity(image, out_range=(0, NR_OF_GREY - 1))
---> 82 out = _clahe(*args)
83 image[:out.shape[0], :out.shape[1]] = out
84 image = rescale_intensity(image)

File /srv/conda/envs/env_snap/lib/python3.8/site-packages/gefolki/adapthist.py:156, in _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins)
154 for x in range(ntiles_x):
155 sub_img = img_blocks[y, x]
--> 156 hist = aLUT[sub_img.ravel()]
157 hist = np.bincount(hist)
158 hist = np.append(hist, np.zeros(nbins - hist.size, dtype=int))

IndexError: arrays used as indices must be of integer (or boolean) type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant