compute rotation angle of binary shape image without having primary image(image before rotation)

4 visualizzazioni (ultimi 30 giorni)
I have some binary image of letters.I need to rotate these letters shapes X degree, then compute the degree of rotation (X) without having the first letters shapes image (Not-Rotated shapes).
I tested several ways. I used RegionProps.Rotation(RP.R), but had little accuracy. For example if RP.R is 90 degree, after 5 degree rotation with imrotate method, it will be 80 degree instead 85 degree.
Also I used minimum bounding box;before and after rotating the shapes, I measure the angle between square diagonal and x-axis, or on side of square and x-axis. In this way,for some shapes of letters, measure specified angle after rotating the shape and it was inaccurate and in some cases after X degree rotation(X = 2,3, or 5 degree),the specified angle was unchanged (figure1).
I want to familiar me with a solution for this problem with these constraints: -we don't have the ascii code. -we couldn't used OCR for letter detection -for angle calculation,we don't have the primary image shape.
thank you.

Risposta accettata

DGM
DGM il 1 Ott 2024
Modificato: DGM il 1 Ott 2024
As far as I recall, regionprops() has never had a Rotation property, and even if it did, that wouldn't be how it's invoked.
Let's assume that what's meant is either Orientation or one of the Feret angles. Either way, neither are relevant. Given an arbitrary image which has been rotated, none of its current properties inform us of its original properties -- unless there are reliably identifiable features which can tell us about the original orientation.
So are there reliably identifiable features? It's easy to come up with a counterexample.
What is the rotation of this character? 3 degrees? 5 degrees?
The answer is 0.
What about this one? It's about the same, so I'm probably playing the same trick, right?
No, that's rotated 17.8 degrees.
Okay, fine. That's only difficult because there aren't any straight lines or cusps to work with. How about something easy?
Is that 0 degrees or 2 degrees? If we don't have the original image, then I'm assuming we also don't have any other sort of prior knowledge. Even if we know that the straight edge on this L is at 80 degrees, we don't know what it was originally. We have no idea where the cusps were with relation to each other either.
There are no magical universal properties embedded in images of text which inform us of their intended geometry or alignment. Unless we have intimate familiarity with the font, we can only guess at the intended orientation of features or even basic things like em height.
When we only have a single character, then there's even less information. Should we even assume that we know what the font is based on a single character?
When we're working with a character that's only a few pixels tall and has been subject to nearest-neighbor interpolation, it's just that much worse.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by