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

Generic aspect ratio for both mobile and desktop #39

Open
nicolocarpignoli opened this issue Feb 1, 2020 · 3 comments
Open

Generic aspect ratio for both mobile and desktop #39

nicolocarpignoli opened this issue Feb 1, 2020 · 3 comments
Labels
code design javascript all about javascript code NFT nft markerless technology

Comments

@nicolocarpignoli
Copy link
Collaborator

We should make it work with every aspect ratio of camera/screen, so not always 4:3. This will make possible to use the NFT with fullscreen camera on mobile and desktop devices.

@albjeremias
Copy link

are there more insight into this issue? why the 4:3 ?
Is it because of the camera parameters as mentioned by @misdake ?

I keep the canvas passed into ar.process to have aspect ratio 4:3 to fit the camera params. This canvas is called "canvas_process" . (You can see a lot of my code is just calculating width/height.)

@misdake
Copy link

misdake commented May 21, 2020

@albjeremias (At least for my demos) 4:3 because I used a fixed "camera_para-iPhone 5 rear 640x480 1.0m.dat" for camera params and didn't have time to implement a matching.
I think 3:4 is doable with that camera params. rotate video feed 90 degrees when drawing onto canvas_process and rotate the perspective matrix back.

@misdake
Copy link

misdake commented May 21, 2020

Take a look at images here.
In CSS terms, I did an "object-fit: contain;" to fit video in canvas_process.
To solve this aspect ratio issue, maybe do this again, do an "object-fit: cover;" to cover fullscreen canvas with video, and use another pair of ratioW/H to fix the perspective matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code design javascript all about javascript code NFT nft markerless technology
Projects
None yet
Development

No branches or pull requests

4 participants