-
Notifications
You must be signed in to change notification settings - Fork 184
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
Negative Value Errors for Images #316
Comments
@kkcthans any chance that your images object dtype is uint? |
@boazmohar Minimal example of images, or of use case? My dtype is initially uint8, but get the negative values arise from doing a homomorphic filter. However, after subtracting off the low frequency components, some values become negative and that I did notice when I do |
@kkcthans Sorry, I was not clear. I meant a minimal example of code that I could run and get the error. import thunder as td
data1 = td.images.fromrand(engine=sc, seed=0)
data2 = td.images.fromrand(engine=sc, seed=1)
data3 = data1.minus(data2)
data3.first() This works for me. |
@boazmohar Here is some code: import thunder as td It doesn't occur in Local Mode, however. |
It looks like the underling |
@kkcthans That should do it. |
Cool. After that branch matches the commit I'll update and see if it fixed it for me. |
nice job figuring this out! merging the PR now, @kkcthans definitely post if there's still a problem |
When using the
images.minus()
function, sometimes the values of some pixels may become negative.To correct for this, I would like to shift the whole image by a scalar value (The minimum of the difference between the images). However, after doing the minus call, anytime I try to access the new image object, I get this error:
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-x86_64/egg/thunder/images/images.py", line 191, in map
File "build/bdist.linux-x86_64/egg/thunder/base.py", line 460, in _map
File "build/bdist.linux-x86_64/egg/bolt/spark/array.py", line 141, in map
File "build/bdist.linux-x86_64/egg/bolt/spark/array.py", line 94, in _align
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Thus, I'm not able to calculate the minimum value across the images to then adjust.
A current workaround is to convert the
image
object to an RDD, calculate the minimum, and adjust the minimum value as an rdd, then dotd.images.fromrdd()
to get back to an RDD.The text was updated successfully, but these errors were encountered: