(Already solved) UnboundLocalError in get_z_from_dsm() when DSM is too small #39
Ken-Kuroki
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
>>> a = np.array([255,255,255])
>>> len(a.shape)
1 Provide a better notice in df25235: Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../easyidp/cvtools.py", line 109, in imarray_crop
raise ValueError(
ValueError: Only image dimention=2 (mxn) or 3(mxnxd) are accepted, not current[shape=(3,) dim=1], please check whether your ROI is smaller than on pixel. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I encountered an error with certain DSM files. When I run
Then
Exception has occurred: UnboundLocalError (note: full exception trace is shown but execution is paused at: _run_module_as_main) local variable 'imarray_out' referenced before assignment
at the 109 line of cvtools.py.It looks when
dim==1
the variable isn't set. I eventually figured out the DSM file resolution was not enough and with small plots in my.shp
file, probably each plot only made up an area smaller than one pixel. The error was solved after increasing the DSM image size.I don't think this is an issue, but just sharing since other users may find the same error.
Beta Was this translation helpful? Give feedback.
All reactions