Skip to content

Conversation

@purvi1508
Copy link

  • Added bounding box existence and empty image checks in minmax_size_ to prevent paste errors on padded images.
  • Wrapped cv2.getPerspectiveTransform and cv2.warpPerspective in try/except in get_rotate_crop_image to avoid OpenCV crashes.
  • Added validation for polygon validity and area in get_poly_rect_crop to skip invalid or too-small polygons.
  • Updated rectification return logic in get_poly_rect_crop to handle empty crops and ensure a valid image is returned.
  • These changes improve stability for processing images with tables, irregular polygons, or edge cases that previously caused errors like "!ssize.empty() in resize".

Refine image padding logic to handle bounding box cases.
Add check for None coordinates in image processing
Added boundary checks for cropping coordinates and error handling for perspective transformation.
Handle case where cropped image is empty by returning the original image.
@paddle-bot
Copy link

paddle-bot bot commented Nov 26, 2025

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Nov 26, 2025

CLA assistant check
All committers have signed the CLA.

@paddle-bot paddle-bot bot added the contributor External developers label Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants