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

Perspective transform broken on some iOS devices #53

Open
calebbergman opened this issue Jul 31, 2019 · 2 comments
Open

Perspective transform broken on some iOS devices #53

calebbergman opened this issue Jul 31, 2019 · 2 comments

Comments

@calebbergman
Copy link

calebbergman commented Jul 31, 2019

I've ran into an issue with using perspective transform on some iOS devices using Ionic and Capacitor (i.e. WKWebView) - thus far an iPhone 6 and a iPad Air 2. I've put together a Github project demonstrating the issue.

I've tested on iPhone 7 and iPhone 8 and it's worked fine. I upgraded the iPad Air 2's OS to iOS 12.4; the issue persists.

EDIT: I decided a much smaller image made my life easier as regards getting the tensor data

Desired

alt text

Undesired (iPad Air 2 iOS 12.4)

alt text

Original

alt text

@calebbergman calebbergman changed the title Perspective transform odd on some iOS devices Perspective transform warped on some iOS devices Jul 31, 2019
@calebbergman calebbergman changed the title Perspective transform warped on some iOS devices Perspective transform broken on some iOS devices Jul 31, 2019
@rmhrisk
Copy link
Contributor

rmhrisk commented Aug 1, 2019

I don’t know we have a iPad 2 in our test equipment. Can you share the values returned in the good and negative cases?

@calebbergman
Copy link
Author

calebbergman commented Aug 1, 2019

Certainly. Please let me know if there's anything I'm missing or can add that would be helpful.

Good case

// input (source tensor)
data: Uint8Array(384256)
dtype: "uint8"
empty: Uint8Array(384256)
get: ƒ (i0,i1,i2)
id: 6
index: ƒ (i0,i1,i2, v)
name: "Tensor:6"
offset: 0
set: ƒ (i0,i1,i2, v)
shape: [316, 304, 4]
size: 384256
stride: [1216, 4, 1]
// rect
data: Float32Array(8) [102, 5, 301, 42, 254, 315, 55, 279]
P: 959.6585846065385
angleA: 1.5847472567080332
angleB: 1.5574556992303161
angleC: 1.579275389553046
angleD: 1.5617069616881911
area: 56145.530856629484
ax: 102
ay: 5
bx: 301
by: 42
cx: 254
cy: 315
distA: 278.0017985553331
distB: 277.01624501101014
distC: 202.41047403728888
distD: 202.23006700290637
distE: 345.2593228285081
distF: 341.5918617297549
dx: 55
dy: 279
maxHeight: 277
maxWidth: 214
// output (transformed tensor)
data: Uint8Array(237112)
dtype: "uint8"
empty: Uint8Array(237112)
get: ƒ (i0,i1,i2)
id: 10
index: ƒ (i0,i1,i2, v)
name: "Tensor:10"
offset: 0
set: ƒ (i0,i1,i2, v)
shape: [277, 214, 4]
size: 237112
stride: [856, 4, 1]

Output tensor data

Negative case

// input
data: Uint8Array [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, …] (384256)
dtype: "uint8"
empty: Uint8Array [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] (384256)
get: function(i0,i1,i2)
id: 1
index: function(i0,i1,i2, v)
name: "Tensor:1"
offset: 0
set: function(i0,i1,i2, v)
shape: [316, 304, 4] (3)
size: 384256
stride: [1216, 4, 1] (3)
// rect
data: Float32Array (8) [102, 5, 301, 42, 254, 315, 55, 279]
P: 959.6585846065385
angleA: 1.5847472567080332
angleB: 1.5574556992303161
angleC: 1.579275389553046
angleD: 1.5617069616881911
ax: 102
ay: 5
bx: 301
by: 42
cx: 254
cy: 315
distA: 278.0017985553331
distB: 277.01624501101014
distC: 202.41047403728888
distD: 202.23006700290637
distE: 345.2593228285081
distF: 341.5918617297549
dx: 55
dy: 279
maxHeight: 277
maxWidth: 214
// output
data: Uint8Array [0, 0, 0, 255, 5, 5, 5, 255, 3, 3, …] (237112)
dtype: "uint8"
empty: Uint8Array [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] (237112)
get: function(i0,i1,i2)
id: 5
index: function(i0,i1,i2, v)
name: "Tensor:5"
offset: 0
set: function(i0,i1,i2, v)
shape: [277, 214, 4] (3)
size: 237112
stride: [856, 4, 1] (3)

Output tensor data

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