Skip to content

[models] Estimate the orientation of a float image (values in [0, 1]) in estimate_orientation - #2206

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:estimate-orientation-float-image
Oct 30, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
RavSinghChandan:estimate-orientation-float-image

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

estimate_orientation thresholds a color image with Otsu's method, which only takes 8-bit or 16-bit images, so a float image (values in [0, 1], like the predictors take) raised:

cv2.error: ... THRESH_OTSU mode: 'src_type == CV_8UC1 || src_type == CV_16UC1' where 'src_type' is 5 (CV_32FC1)

A float color image is now scaled to uint8 first, so it gives the same angle as the uint8 image. The predictors call it on their segmentation maps, which are not affected

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (50c2ef1) to head (332e85e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2206      +/-   ##
==========================================
- Coverage   97.77%   97.73%   -0.05%     
==========================================
  Files         170      170              
  Lines       10980    10982       +2     
==========================================
- Hits        10736    10733       -3     
- Misses        244      249       +5     
Flag Coverage Δ
unittests 97.73% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@felixdittrich92 felixdittrich92 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@felixdittrich92 felixdittrich92 self-assigned this Oct 30, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 30, 2026
@felixdittrich92 felixdittrich92 added type: enhancement Improvement module: models Related to doctr.models ext: tests Related to tests folder labels Oct 30, 2026
@felixdittrich92
felixdittrich92 merged commit c215d57 into mindee:main Oct 30, 2026
55 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: tests Related to tests folder module: models Related to doctr.models type: enhancement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants