Hello !
I have a few photos I would love to treat with a good shadow removal method. I tried your code, with a random jpg, and I have an error :
shadow_detect.py:19: RuntimeWarning: invalid value encountered in double_scalars hsi[i][j][0] = math.acos(((blur[i][j][2]-blur[i][j][1])*(blur[i][j][2]-blur[i][j][0]))/(2*math.sqrt((blur[i][j][2]-blur[i][j][1])*(blur[i][j][2]-blur[i][j][1])+(blur[i][j][2]-blur[i][j][0])*(blur[i][j][1]-blur[i][j][0])))) Traceback (most recent call last): File "shadow_detect.py", line 21, in <module> ratio_map[i][j] = hsi[i][j][0]/(hsi[i][j][2]+0.01) ValueError: cannot convert float NaN to integer
I took a small jpeg file online to test it, and renamed it "shadow.jpg", before running your code.
Hello !
I have a few photos I would love to treat with a good shadow removal method. I tried your code, with a random jpg, and I have an error :
shadow_detect.py:19: RuntimeWarning: invalid value encountered in double_scalars hsi[i][j][0] = math.acos(((blur[i][j][2]-blur[i][j][1])*(blur[i][j][2]-blur[i][j][0]))/(2*math.sqrt((blur[i][j][2]-blur[i][j][1])*(blur[i][j][2]-blur[i][j][1])+(blur[i][j][2]-blur[i][j][0])*(blur[i][j][1]-blur[i][j][0])))) Traceback (most recent call last): File "shadow_detect.py", line 21, in <module> ratio_map[i][j] = hsi[i][j][0]/(hsi[i][j][2]+0.01) ValueError: cannot convert float NaN to integerI took a small jpeg file online to test it, and renamed it "shadow.jpg", before running your code.