Skip to content
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

BBox.visual_box can get 0 width #96

Open
abramov-oleg opened this issue Oct 23, 2023 · 0 comments
Open

BBox.visual_box can get 0 width #96

abramov-oleg opened this issue Oct 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@abramov-oleg
Copy link
Contributor

from savant_rs.draw_spec import PaddingDraw
from savant_rs.primitives.geometry import BBox

padding = PaddingDraw(0,0,0,0)

max_col = 1279
max_row = 719

bboxes = [
    BBox(380.201, 603.9101, 2.3868103, 4.445815),
    BBox(490.4524, 603.80145, 2.9029846, 3.4778595)
]

for bbox in bboxes:
    vis_bbox = bbox.visual_box(padding, 0, max_col, max_row)
    left, top, width, height = vis_bbox.as_ltwh_int()

    assert width >= 1
    assert height >= 1

Sample bboxes trigger width >= 1 assertion.

Bboxes with 0 width or height break blur and copy_frame_region methods in artist.

@abramov-oleg abramov-oleg added the bug Something isn't working label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant