Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rotations of some word bounding boxes do not line up properly with the word itself. #26

Open
cjnolet opened this issue Mar 2, 2017 · 4 comments

Comments

@cjnolet
Copy link

cjnolet commented Mar 2, 2017

It's strange and it happens quite often, maybe 20% of the time. It usually occurs when a word is rotated itself or has been projected onto a surface causing it to have a strange dimension. Thing is, though, it does not only happen on extreme projections. It also happens on only slightly projected text. It makes it hard for the fully convolutional network to converge well on the sin/cos pose params.

@ankush-me
Copy link
Owner

Can you please share some pictures? That'll help understand this problem better.

@cjnolet
Copy link
Author

cjnolet commented Mar 22, 2017

Unfortunately, I'm on a private network creating these images and they will not allow me to release them. They will allow me to help out fixing bugs and stuff, however.

Anyways, I've finally gotten some time to code up a visualization of each of the character bounding boxes and the final word bounding boxes that are generated. It looks like there is an empty character being drawn on the canvas. Literally it's blank and it ends up returning a 0-width bounding box which has a pretty large height. I believe that is throwing off the calculation of the final word bounding box dimensions.

I already know some of the fonts are having trouble drawing some of the characters in this language but that's so strange it's returning a 0-width bounding box. Many of the other fonts / bad characters just show up as an empty square.

@IgorSondors
Copy link

IgorSondors commented Jan 22, 2021

This problem occurs because of pygame render_to rotating character image within bounding box only but not rotating bounding box itself. Check this line

ch_bounds = font.render_to(surf, rect, word_text[mid_idx], rotation=rots[mid_idx])

The is an example
photo_2021-01-22_16-28-12

image

@ankush-me
Copy link
Owner

@IgorSondors --- thanks! If you can share a patch for this, that would be great!

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

No branches or pull requests

3 participants