Page 1 of 1

Fixing rotation problem

PostPosted: Wed Mar 21, 2012 9:26 am
by MaartenWitteveen
I am using the standard source code from the Glyph Recognition Proto v.2.0.1 and I am witnessing a small anomaly. When processing this image it results to this.

test.jpg
Input bitmap
test.jpg (87.57 KiB) Viewed 12206 times


processed.jpg
after process
processed.jpg (250.89 KiB) Viewed 12206 times


I first thought it could have something to do with a database which I hadn’t created yet, but when I printed the output it somehow is translated to this
0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 0 0
0 0 0 1 1 1 1 1 0
0 0 1 1 1 1 1 1 0
0 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 0
0 0 0 1 1 1 1 1 0
0 0 0 0 1 1 1 0 0
0 0 0 0 0 0 0 0 0

While the output where the letters are upright are formatted like this. (turned 90 degrees to the left)

0 0 0 0 0 0 0 0 0
0 0 1 1 0 1 1 0 0
0 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 0
0 0 1 1 1 1 1 0 0
0 0 0 1 1 1 0 0 0
0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0

I am trying to make sense whether this is something that I can fix within the source code or if anyone has ever come across this problem. I haven’t made any major changes to the source code, not ones that could cause this problem. I would very much appreciate your input so please let me know if something comes to mind.

Kind regards, Maarten Witteveen

Re: Fixing rotation problem

PostPosted: Wed Mar 21, 2012 9:39 am
by andrew.kirillov
MaartenWitteveen wrote:While the output where the letters are upright are formatted like this. (turned 90 degrees to the left)

Not sure what is the problem you have. The fact that recognized output is 90 degrees rotated does not seem to be wrong to me. It all depends on which corner is the first one in the detected glyph's quadrilateral. If it would be top left one, then the output should not be rotated. But it seems like in your case the algorithm just picked another corner as the first one - bottom left (the most left one, which is 100% valid for the FindQuadrilateralCorners() routine).