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

Correcting perspective of image based on QR code #141

Open
yatharthchhabra opened this issue Jun 29, 2021 · 2 comments
Open

Correcting perspective of image based on QR code #141

yatharthchhabra opened this issue Jun 29, 2021 · 2 comments

Comments

@yatharthchhabra
Copy link

yatharthchhabra commented Jun 29, 2021

Hi Paul,
I'm trying to use your pod and I'd really appreciate some help. I'm making an AR app in which I detect a qr code in a frame and then straighten the entire frame image based on the qr code. Your library seems perfect for tranforming an image based on a polygon. Right now, I have the overall frame image and the screen coordinates of the QR code corners (in both UIkit and Core Image coordinates). How can I use your library to achieve this goal? When I pass in the coordinates of the QR code as source and entire view frame as the destination, I do not get the QR code crop. Thank you and keep up the great work!

@paulz
Copy link
Owner

paulz commented Jun 29, 2021

Great, that's the perfect use case. Just pass UIKit coordinates of QR code corners and corners of destination view. You will get the transformation. Then apply that transformation to get straight QR code view. You probably want to capture resulting view image to pass to QR code detector.

@yatharthchhabra
Copy link
Author

Thanks for your response. I actually tried to do just that but for some reason the crop I get is still not of the QR code. I have attached the view controller file to show you how I am using your framework. I've also attached the frame image with green dots on the detected QR code corners and the transformed image. I would really appreciate if you could point out my usage mistake. Thanks!
StraightViewController.pdf
IMG_8834
IMG_8835

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

2 participants