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

fix: in-odered polygon #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sushil-bharati
Copy link

This fix will allow obtaining in-ordered polygon vertices for bar/QR code irrespective of the angular placement of the bar/QR code in the scene. This will certainly help for those who are trying to determine the in-order corners of the QR/bar code in the scene i.e. anti-clockwise from the top-left for an upright position.

@@ -106,11 +106,21 @@ def _decode_symbols(symbols):
for index in _RANGEFN(zbar_symbol_get_loc_size(symbol))
)

# since 'polygon' is very misleading if one wants to detect the QR/bar
# code position in order no matter how they appear in the scene
polygon_upright = list(map(Point._make,(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the naming more misleading now, since polygon_upright implies that it is invariant in regard to 90° rotations, which is not the case for your variant.

Also you could rename this to polygon and remove the definition above.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check PR #78

@esclear esclear mentioned this pull request Aug 14, 2019
@mcbridejc
Copy link

This PR is IMHO the correct way to order the returned polygon, and I'd love to see this merged and released. I'm currently using sushil-bharati:master and it works for me.

@coolacid
Copy link

Given this PR hasn't been merged (and looks like it might not due to the PR change request - is there a way to accomplish this post detection? I'd like to be able to rotate an image based on the detected orientation of the QR code, and I suspect this is going to be my blocker.

@mcbridejc
Copy link

@coolacid I'm not aware of a simple way to do so. I've been using the sushil-bharati fork because of this problem. I'd really like to see this get fixed. I wonder if the maintainer of this project is still working on it, and would like to chime in? This may be a case where it makes sense to petition to re-assign ownership of the pyzbar package on PyPi if the current owner is unavailable.

@coolacid
Copy link

@mcbridejc Thanks. I'd thing that the maintainer is waiting on @sushil-bharati to fix based on the feedback in the PR before merging.

@alexander-soare
Copy link

For what it's worth, I also have the same need. In any case, thank you to the author for their good work!

@LilithHafner
Copy link

Thanks @sushil-bharati! Like @mcbridgejc, I've switched to sushil's version. I ran:

pip uninstall pyzbar
pip install pip install git+https://github.com/sushil-bharati/pyzbar.git

Everything work and the points are in a consistent order!

@Camilochiang
Copy link

@quicklizard99 is 2022 and this problem is still around. Is there any way to merge or solve it? Thanks

@pablospe
Copy link

pablospe commented Nov 2, 2022

I started using this fork:
https://pypi.org/project/pyzbar-upright/

@lunasara
Copy link

This is a great update! Are there any plans on merging this feature to avoid switching to unmaintained versions of the code?

@tykateetee
Copy link

Wow. I have been trying to order them for so long and this is the solution? As simple as it may be, this is amazing work! Don't know why this isn't merged, as it helps severely for absolute orientation of a QR code.

@sushil-bharati
Copy link
Author

@esclear - would you be able to merge this PR?

@esclear
Copy link

esclear commented Sep 10, 2024

@esclear - would you be able to merge this PR?

No, I don't have and never had the permissions for that.

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.

10 participants