Skip to content

Error while trying with another jpg file #1

@risbac

Description

@risbac

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions