deskew
deskew copied to clipboard
deskew confidence?
Hi @sbrunner,
Is there a way to retrieve the deskew confidence?
It would make it much easier to avoid rotating the image when the confidence in the skew angle is low.
Good question,
Currently, there is nothing like it, but it will be a great improvement :-)
Do you have any pointers on how such a confidence should be implemented?
I may imagine something like the rate of adherence of the maximum peak's frequency against that of all other peaks...
I guess a softmax on the freqs dictionary will do it for now, turning the number of occurrences into probabilities
Or an addition of the dist on the same angle? https://github.com/sbrunner/deskew/blob/master/deskew/init.py#L48
Or an addition of the dist on the same angle? https://github.com/sbrunner/deskew/blob/master/deskew/init.py#L48
Do you mean summing the distances for each angle instead of summing ones as you do in the freqs array? Then, softmax?
What is the rationale behind summing distances and confidence, tho?
Yes, if the line concerned is long, it's more confident than if it's short, not?
I just don't see how the $\rho$ parameters (the dists array) of the lines parameterized as $(\rho, \theta)$ in Hough space, or their magnitude (short or long), would relate to the detection confidence of the skew angle