Skip to content

PueoHSAlign.process_eyescan_eyes returns None as an eye sometimes? #11

@barawn

Description

@barawn

process_eyescan_eyes checks if scan[eye_center] is None: it should actually check if scan[eye_center][1] is None.

        for edge in edges:
            edge_val = int((edge[0] + edge[1])/2)
            eye_center = edge_val - (eye_width//2)
            if eye_center > 0 and scan[eye_center] is not None:
                eyes[scan[eye_center][1]] = eye_center

should be

        for edge in edges:
            edge_val = int((edge[0] + edge[1])/2)
            eye_center = edge_val - (eye_width//2)
            if eye_center > 0 and scan[eye_center][1] is not None:
                eyes[scan[eye_center][1]] = eye_center

But this shouldn't happen in any case, because it should have probably reported an additional edge in the scan and it doesn't appear like it did there.
Change this and catch when it happens, print it out for debugging.

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