-
Notifications
You must be signed in to change notification settings - Fork 179
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
base: master
Are you sure you want to change the base?
Conversation
@@ -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,( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check PR #78
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. |
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. |
@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. |
@mcbridejc Thanks. I'd thing that the maintainer is waiting on @sushil-bharati to fix based on the feedback in the PR before merging. |
For what it's worth, I also have the same need. In any case, thank you to the author for their good work! |
Thanks @sushil-bharati! Like @mcbridgejc, I've switched to sushil's version. I ran:
Everything work and the points are in a consistent order! |
@quicklizard99 is 2022 and this problem is still around. Is there any way to merge or solve it? Thanks |
I started using this fork: |
This is a great update! Are there any plans on merging this feature to avoid switching to unmaintained versions of the code? |
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. |
@esclear - would you be able to merge this PR? |
No, I don't have and never had the permissions for that. |
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.