Skip to content

fix(hough): make intersection_points() more general and stable - #742

Closed
bioinformatist wants to merge 1 commit into
image-rs:mainfrom
bioinformatist:fix/intersection_points
Closed

fix(hough): make intersection_points() more general and stable#742
bioinformatist wants to merge 1 commit into
image-rs:mainfrom
bioinformatist:fix/intersection_points

Conversation

@bioinformatist

@bioinformatist bioinformatist commented Nov 19, 2025

Copy link
Copy Markdown

Generality

Though the angle_in_degrees of PolarLine represents for an angle, it's u32, and the Miri has no idea about the range. So the more general way is to use sin/cos for special cases.

Robustness

The trigonometric functions has unspecified precision at the moment, as well as the mul_add is targeted to the dedicated fma instruction. That means, it's possible for the line has a calculated position which is slightly "outside" the box, while the true location is "inside".

To solve it, a tolerance was added for judgement, then the final coordinates were restricted back to the border for accurate coordinates. This version works well with Miri.

This was referenced Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant